/* instant-base.css - Complete Instant Win Modal & Games Styles */

/* ============================================
   MODAL BASE - ESSENTIAL STRUCTURE
   ============================================ */
#instantWinModal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    overflow-y: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

#instantWinModal.hidden {
    display: none !important;
}

/* Modal Wrapper - CRITICAL */
.instant-win-modal-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Modal Container */
.instant-win-modal-container {
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
    border: none;
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 0;
}

@media (min-width: 768px) {
    #instantWinModal {
        padding: 1rem;
    }
    
    .instant-win-modal-wrapper {
        min-height: auto;
    }
    
    .instant-win-modal-container {
        border: 3px solid transparent;
        background-clip: padding-box;
        border-radius: 2rem;
        max-height: 90vh;
        border-color: rgba(255, 215, 0, 0.3);
    }
}

/* Header */
.instant-win-header {
    background: rgba(0, 0, 0, 0.95);
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(10px);
}

/* Content Area */
.instant-win-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1.5rem;
    background: transparent;
    -webkit-overflow-scrolling: touch;
}

/* Grid Layout */
.instant-win-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .instant-win-content {
        padding: 2rem;
    }
    
    .instant-win-grid {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 2rem;
    }
}

/* ============================================
   GOLD THEME ELEMENTS
   ============================================ */
.gold-text-gradient {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.gold-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.gold-card:hover {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(255, 215, 0, 0.05);
}

.gold-button {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
}

.gold-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 215, 0, 0.3);
}

.gold-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Try Buttons */
.try-btn {
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.try-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    border-color: rgba(255, 215, 0, 0.5);
}

.try-btn.active {
    background: rgba(255, 215, 0, 0.2) !important;
    border-color: #FFD700 !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* ============================================
   GAME OVERLAY
   ============================================ */
.instant-reveal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
}

.instant-reveal-container {
    background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
    border: 3px solid #FFD700;
    border-radius: 2rem;
    padding: 2rem;
    max-width: 1000px;
    width: 100%;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.game-header {
    text-align: center;
    margin-bottom: 2rem;
}

/* ============================================
   REVEAL BOXES GAME
   ============================================ */
.reveal-boxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.reveal-box {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 200px;
}

.box-front, .box-back {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    border: 3px solid #FFD700;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.box-header {
    font-size: 14px;
    letter-spacing: 2px;
    color: #FFD700;
    font-weight: bold;
    margin-bottom: 15px;
}

.box-icon {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #FFD700, #FFA500);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.box-icon i {
    font-size: 30px;
    color: #000;
}

.box-hint {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.box-sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
}

.sparkle {
    position: absolute;
    font-size: 20px;
    color: #FFD700;
    animation: sparkle 3s linear infinite;
}

@keyframes sparkle {
    0%, 100% { 
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
}

.sparkle:nth-child(1) { top: 20%; left: 20%; animation-delay: 0s; }
.sparkle:nth-child(2) { top: 20%; right: 20%; animation-delay: 0.5s; }
.sparkle:nth-child(3) { bottom: 20%; left: 20%; animation-delay: 1s; }
.sparkle:nth-child(4) { bottom: 20%; right: 20%; animation-delay: 1.5s; }
.sparkle:nth-child(5) { top: 50%; left: 50%; animation-delay: 2s; }

.reveal-box:hover:not(.revealed) {
    transform: translateY(-10px) scale(1.05);
}

.reveal-box.revealing {
    animation: boxFlip 0.6s ease;
}

.reveal-box.revealed.winner {
    animation: winnerPulse 2s ease-in-out infinite;
}

.reveal-box.revealed.winner .box-back {
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.3), transparent),
                linear-gradient(135deg, #1a1a1a, #2d2d2d);
    border-color: #FFD700;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
}

.reveal-box.revealed.loser {
    opacity: 0.6;
}

@keyframes boxFlip {
    0% { transform: rotateY(0) scale(1); }
    50% { transform: rotateY(90deg) scale(1.1); }
    100% { transform: rotateY(0) scale(1); }
}

@keyframes winnerPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
    }
}

/* Winner/Loser content */
.winner-content, .loser-content {
    text-align: center;
    animation: zoomIn 0.5s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   COMMON ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* Win animations */
.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #FFD700;
    bottom: 0;
    animation: fireworkLaunch 2s ease-out forwards;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 4s linear forwards;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .reveal-boxes-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .reveal-box {
        height: 160px;
    }
    
    .box-icon {
        width: 50px;
        height: 50px;
    }
    
    .box-icon i {
        font-size: 25px;
    }
}

/* Reveal all button */
.reveal-all-btn {
    background: linear-gradient(135deg, #9333EA, #7C3AED);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.reveal-all-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.4);
}