/* Reset and Base Styles with performance optimization */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Optimize font loading */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800;900&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background: radial-gradient(ellipse at center, #1e3c72 0%, #2a5298 30%, #3b82f6 70%, #6366f1 100%);
    min-height: 100vh;
    position: relative;
}

/* Lightning background effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(139, 69, 19, 0.1) 35%, 
        transparent 40%,
        transparent 60%,
        rgba(255, 215, 0, 0.1) 65%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

/* Header - Initially Hidden */
.header {
    position: fixed;
    top: -80px; /* Hidden by default */
    width: 100%;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    backdrop-filter: blur(15px);
    padding: 15px 0;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    z-index: 1000;
    transition: top 0.4s ease-in-out;
    box-shadow: 0 4px 25px rgba(30, 60, 114, 0.4);
}

.header.visible {
    top: 0; /* Show when scrolling */
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-brand img {
    height: 40px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}

.game-name {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/* Header Download Button */
.header-download-btn {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #1e3c72;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    min-width: 100px;
}

.header-download-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #FFF700, #FFD700);
}

/* Main Content */
.main-content {
    padding: 40px 0;
    position: relative;
    z-index: 1;
}

/* Download Section */
.download-section {
    text-align: center;
    margin-bottom: 60px;
}

.download-content h1 {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #FFFFFF, #FFD700, #FF6B35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 40px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    font-weight: 500;
}

/* Main Download Button - Enhanced */
.download-btn {
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF8C00);
    color: #1e3c72;
    border: none;
    border-radius: 60px;
    padding: 18px 45px;
    font-size: 1.3rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 25px 50px rgba(255, 215, 0, 0.4);
    transition: all 0.4s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    width: 90%;
    max-width: 320px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    border: 4px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
    will-change: transform, box-shadow; /* Optimize for hover animations */
    transform: translateZ(0); /* Enable hardware acceleration */
}

.download-btn:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 30px 60px rgba(255, 215, 0, 0.6);
    background: linear-gradient(45deg, #FFF700, #FFD700, #FFA500);
}

/* Gift Box Animation */
.gift-box {
    font-size: 2rem;
    animation: giftShake 2s infinite ease-in-out;
    display: inline-block;
}

@keyframes giftShake {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(0);
    }
    40% {
        transform: translateX(-3px) rotate(-5deg);
    }
    60% {
        transform: translateX(3px) rotate(5deg);
    }
}

/* Product Header */
.product-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0;
}

.product-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
    letter-spacing: 0.5px;
}

.product-logo {
    height: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.product-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    margin: 0;
    letter-spacing: 0.5px;
}

/* Promotional Banner */
.promo-banner {
    margin-bottom: 30px;
}

.promo-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    margin: 0 auto;
    display: block;
}

/* Gift Code Image */
.gift-code-section {
    margin: 30px 0;
}

.gift-code-image {
    max-width: 250px;
    width: 100%;
    height: auto;
}

/* Description */
.description {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.8rem;
    max-width: 500px;
    margin: 0 auto;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.description p {
    margin-bottom: 12px;
    font-weight: 500;
}

.description p:nth-child(2) {
    color: #FFD700;
}

/* Jackpot Section */
.jackpot-section {
    margin-bottom: 40px;
    position: relative;
}

.jackpot-section h2 {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 30px;
    color: white;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #FFFFFF, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.jackpot-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.jackpot-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.jackpot-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.2), transparent);
    animation: jackpotShine 3s infinite;
}

@keyframes jackpotShine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.mega-jackpot {
    border-color: rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.1));
}

.major-jackpot {
    border-color: rgba(192, 192, 192, 0.6);
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.2), rgba(169, 169, 169, 0.1));
}

.minor-jackpot {
    border-color: rgba(205, 127, 50, 0.6);
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.2), rgba(160, 82, 45, 0.1));
}

.jackpot-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.jackpot-amount {
    font-size: 1.4rem;
    font-weight: 900;
    color: #FFD700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: jackpotPulse 2s infinite;
}

@keyframes jackpotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.mega-jackpot .jackpot-amount {
    font-size: 1.6rem;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.major-jackpot .jackpot-amount {
    color: #C0C0C0;
    text-shadow: 0 0 8px rgba(192, 192, 192, 0.6);
}

.minor-jackpot .jackpot-amount {
    color: #CD7F32;
    text-shadow: 0 0 6px rgba(205, 127, 50, 0.6);
}

.jackpot-winner {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.jackpot-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.8);
}

/* Games Section */
.games-section {
    background: linear-gradient(135deg, rgba(30, 60, 114, 0.3), rgba(42, 82, 152, 0.2)); 
    backdrop-filter: blur(15px);
    border-radius: 25px;
    padding: 20px 0;
    margin: 0 20px;
    border: 1px solid rgba(255, 215, 0, 0.3); 
    box-shadow: 0 15px 40px rgba(30, 60, 114, 0.3);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.games-section h2 {
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 30px;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #FFFFFF, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.game-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.game-item:hover {
    transform: translateY(-10px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.1));
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 215, 0, 0.5);
}

/* Game Icon */
.game-icon {
    width: 100%;
    aspect-ratio: 1 / 1;
    margin-bottom: 15px;
}

.game-icon img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.4);
}

/* Game Progress */
.game-progress {
    width: 100%;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(30, 60, 114, 0.4);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    border-radius: 6px;
    width: 0%;
    transition: width 2s ease-in-out;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    will-change: width; /* Optimize for animations */
}

/* Fixed: Better text readability - removed inner shadow */
.progress-text {
    font-size: 1rem;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8); /* Strong outer shadow for readability */
    background: none; /* Remove gradient background */
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Mobile notification adjustments for very small screens */
@media (max-width: 380px) {
    .container {
        padding: 0 15px;
    }
    
    .navbar {
        padding: 0 15px;
    }
    
    .download-btn {
        padding: 18px 35px;
        font-size: 1.1rem;
        letter-spacing: 1px;
        max-width: 280px;
        gap: 12px;
    }
    
    .gift-box {
        font-size: 1.6rem;
    }
}

/* Ultra small screens */
@media (max-width: 320px) {
    .download-btn {
        padding: 16px 30px;
        font-size: 1rem;
        letter-spacing: 0.8px;
        max-width: 260px;
        gap: 10px;
    }
    
    .gift-box {
        font-size: 1.4rem;
    }
}

/* Loading Animation for Buttons */
.loading {
    position: relative;
    color: transparent !important;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    border: 3px solid rgba(30, 60, 114, 0.3);
    border-top: 3px solid #1e3c72;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Ripple Effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 215, 0, 0.4);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.download-btn, .header-download-btn {
    position: relative;
    overflow: hidden;
}

/* Lightning Effect */
.games-section::after {
    content: '⚡';
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 1.8rem;
    opacity: 0.8;
    animation: lightning 3s infinite;
}

@keyframes lightning {
    0%, 90%, 100% { opacity: 0.3; }
    5%, 15% { opacity: 1; }
}

/* Pulsing Effect for High Progress */
.progress-fill[data-progress="90"], 
.progress-fill[data-progress="91"], 
.progress-fill[data-progress="92"], 
.progress-fill[data-progress="93"], 
.progress-fill[data-progress="94"], 
.progress-fill[data-progress="95"] {
    animation: goldPulse 2s infinite;
}

@keyframes goldPulse {
    0% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    }
    50% { 
        box-shadow: 0 0 30px rgba(255, 215, 0, 1);
    }
    100% { 
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    }
}