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

/* Accessibility: Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    z-index: 10000;
    text-decoration: none;
    font-weight: bold;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 0;
}

/* Accessibility: Visually Hidden (for screen readers) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 3px solid var(--theme-accent);
    outline-offset: 2px;
}

:root {
    /* Default theme (Light Blue) */
    --theme-primary: #60a5fa;
    --theme-secondary: #3b82f6;
    --theme-accent: #2563eb;
    --theme-gradient-start: #60a5fa;
    --theme-gradient-end: #3b82f6;
    --theme-text: #333;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--theme-text);
    transition: background 0.5s ease;
}

/* Light Blue Theme (default) - Fresh & Airy */
body.theme-light-blue {
    --theme-primary: #60a5fa;
    --theme-secondary: #3b82f6;
    --theme-accent: #2563eb;
    --theme-gradient-start: #60a5fa;
    --theme-gradient-end: #3b82f6;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #87ceeb 0%, #60a5fa 25%, #3b82f6 50%, #2563eb 75%, #1d4ed8 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%;
}

/* Light Green Theme - Fresh & Natural */
body.theme-light-green {
    --theme-primary: #34d399;
    --theme-secondary: #10b981;
    --theme-accent: #059669;
    --theme-gradient-start: #34d399;
    --theme-gradient-end: #10b981;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #6ee7b7 0%, #34d399 30%, #10b981 60%, #059669 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%;
}

/* Pink Theme - Soft & Lovely */
body.theme-pink {
    --theme-primary: #f472b6;
    --theme-secondary: #ec4899;
    --theme-accent: #db2777;
    --theme-gradient-start: #f472b6;
    --theme-gradient-end: #ec4899;
    background: 
        radial-gradient(ellipse at 25% 25%, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 75%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 182, 193, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #fce7f3 0%, #fbcfe8 20%, #f9a8d4 40%, #f472b6 60%, #ec4899 80%, #db2777 100%);
}

/* Rainbow Unicorn Theme - Magical & Enchanting */
body.theme-rainbow-unicorn {
    --theme-primary: #f472b6;
    --theme-secondary: #a78bfa;
    --theme-accent: #60a5fa;
    --theme-gradient-start: #f472b6;
    --theme-gradient-end: #a78bfa;
    background: 
        radial-gradient(ellipse at 10% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 80%, rgba(255, 255, 255, 0.3) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.2) 0%, transparent 60%),
        linear-gradient(135deg, 
            #ff9a9e 0%, 
            #fecfef 15%, 
            #fecfef 15%,
            #a18cd1 30%, 
            #fbc2eb 45%, 
            #a6c1ee 60%, 
            #c2e9fb 75%, 
            #d4fc79 90%, 
            #96e6a1 100%
        );
    background-size: 100% 100%, 100% 100%, 100% 100%, 400% 400%;
    animation: rainbowShift 12s ease infinite, shimmer 3s ease-in-out infinite alternate;
    position: relative;
}

body.theme-rainbow-unicorn::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(2px 2px at 130px 80px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 160px 30px, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(2px 2px at 200px 60px, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(1px 1px at 50px 100px, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(2px 2px at 100px 120px, rgba(255, 255, 255, 0.8), transparent);
    background-size: 250px 150px;
    animation: sparkle 4s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

body.theme-rainbow-unicorn > * {
    position: relative;
    z-index: 1;
}

@keyframes rainbowShift {
    0% { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 50%; }
    25% { background-position: 0% 0%, 0% 0%, 0% 0%, 50% 100%; }
    50% { background-position: 0% 0%, 0% 0%, 0% 0%, 100% 50%; }
    75% { background-position: 0% 0%, 0% 0%, 0% 0%, 50% 0%; }
    100% { background-position: 0% 0%, 0% 0%, 0% 0%, 0% 50%; }
}

@keyframes shimmer {
    0% { filter: brightness(1) saturate(1); }
    100% { filter: brightness(1.05) saturate(1.1); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Purple Theme - Mystical & Elegant */
body.theme-purple {
    --theme-primary: #a78bfa;
    --theme-secondary: #8b5cf6;
    --theme-accent: #7c3aed;
    --theme-gradient-start: #a78bfa;
    --theme-gradient-end: #8b5cf6;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(167, 139, 250, 0.3) 0%, transparent 50%),
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.08) 10px,
            rgba(255, 255, 255, 0.08) 11px
        ),
        repeating-linear-gradient(
            -60deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.06) 10px,
            rgba(255, 255, 255, 0.06) 11px
        ),
        linear-gradient(135deg, #c4b5fd 0%, #a78bfa 25%, #8b5cf6 50%, #7c3aed 75%, #6d28d9 100%);
    background-size: 100% 100%, 100% 100%, 20px 35px, 20px 35px, 100% 100%;
}

/* Orange Theme - Warm & Energetic */
body.theme-orange {
    --theme-primary: #fb923c;
    --theme-secondary: #f97316;
    --theme-accent: #ea580c;
    --theme-gradient-start: #fb923c;
    --theme-gradient-end: #f97316;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(251, 146, 60, 0.4) 0%, transparent 50%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 15px,
            rgba(255, 255, 255, 0.12) 15px,
            rgba(255, 255, 255, 0.12) 16px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 15px,
            rgba(255, 255, 255, 0.08) 15px,
            rgba(255, 255, 255, 0.08) 16px
        ),
        linear-gradient(135deg, #fed7aa 0%, #fdba74 20%, #fb923c 40%, #f97316 60%, #ea580c 80%, #c2410c 100%);
    background-size: 100% 100%, 100% 100%, 30px 30px, 30px 30px, 100% 100%;
}

/* Ocean Theme - Deep & Serene */
body.theme-ocean {
    --theme-primary: #06b6d4;
    --theme-secondary: #0891b2;
    --theme-accent: #0e7490;
    --theme-gradient-start: #06b6d4;
    --theme-gradient-end: #0891b2;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(6, 182, 212, 0.3) 0%, transparent 50%),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 50px,
            rgba(255, 255, 255, 0.03) 50px,
            rgba(255, 255, 255, 0.03) 100px
        ),
        radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.15) 0%, transparent 60%),
        linear-gradient(180deg, #67e8f9 0%, #22d3ee 20%, #06b6d4 40%, #0891b2 60%, #0e7490 80%, #155e75 100%);
    background-size: 100% 100%, 100% 100%, 100px 100%, 100% 100%, 100% 100%;
    animation: oceanWave 15s ease-in-out infinite;
}

@keyframes oceanWave {
    0%, 100% { background-position: 0% 0%, 0% 0%, 0 0, 0% 0%, 0% 0%; }
    50% { background-position: 0% 0%, 0% 0%, 50px 0, 0% 0%, 0% 0%; }
}

/* Sunset Theme - Warm & Dreamy */
body.theme-sunset {
    --theme-primary: #f97316;
    --theme-secondary: #f59e0b;
    --theme-accent: #dc2626;
    --theme-gradient-start: #f97316;
    --theme-gradient-end: #f59e0b;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(220, 38, 38, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 60%, rgba(251, 191, 36, 0.25) 0%, transparent 50%),
        linear-gradient(180deg, #fef3c7 0%, #fde68a 15%, #fbbf24 30%, #f59e0b 45%, #f97316 60%, #ea580c 75%, #dc2626 90%, #991b1b 100%);
}

/* Space Theme - Cosmic & Mysterious */
body.theme-space {
    --theme-primary: #6366f1;
    --theme-secondary: #4f46e5;
    --theme-accent: #4338ca;
    --theme-gradient-start: #1e1b4b;
    --theme-gradient-end: #312e81;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(99, 102, 241, 0.25) 0%, transparent 50%),
        radial-gradient(2px 2px at 10% 20%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(2px 2px at 30% 50%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 50% 30%, rgba(255, 255, 255, 0.95), transparent),
        radial-gradient(2px 2px at 70% 60%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 90% 40%, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(2px 2px at 20% 80%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 60% 90%, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(2px 2px at 80% 15%, rgba(255, 255, 255, 0.65), transparent),
        radial-gradient(1px 1px at 40% 70%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 15% 45%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 85% 85%, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(1px 1px at 55% 10%, rgba(255, 255, 255, 0.9), transparent),
        linear-gradient(180deg, #020617 0%, #0f172a 20%, #1e1b4b 40%, #312e81 60%, #3730a3 80%, #4338ca 100%);
    background-size: 100% 100%, 100% 100%, 200px 200px, 180px 180px, 150px 150px, 220px 220px, 170px 170px, 250px 250px, 190px 190px, 160px 160px, 210px 210px, 230px 230px, 140px 140px, 200px 200px, 100% 100%;
    animation: twinkle 4s ease-in-out infinite alternate, starMove 60s linear infinite;
}

@keyframes twinkle {
    0% { filter: brightness(0.95); }
    100% { filter: brightness(1.05); }
}

@keyframes starMove {
    0% { 
        background-position: 
            0% 0%, 0% 0%,
            0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%,
            0% 0%;
    }
    25% { 
        background-position: 
            0% 0%, 0% 0%,
            25% 15%, 20% 25%, 15% 20%, 30% 10%, 10% 30%, 35% 20%, 20% 35%, 25% 25%, 30% 15%, 15% 30%, 20% 20%, 25% 30%,
            0% 0%;
    }
    50% { 
        background-position: 
            0% 0%, 0% 0%,
            50% 30%, 40% 50%, 30% 40%, 60% 20%, 20% 60%, 70% 40%, 40% 70%, 50% 50%, 60% 30%, 30% 60%, 40% 40%, 50% 60%,
            0% 0%;
    }
    75% { 
        background-position: 
            0% 0%, 0% 0%,
            75% 45%, 60% 75%, 45% 60%, 90% 30%, 30% 90%, 100% 60%, 60% 100%, 75% 75%, 90% 45%, 45% 90%, 60% 60%, 75% 90%,
            0% 0%;
    }
    100% { 
        background-position: 
            0% 0%, 0% 0%,
            100% 60%, 80% 100%, 60% 80%, 120% 40%, 40% 120%, 130% 80%, 80% 130%, 100% 100%, 120% 60%, 60% 120%, 80% 80%, 100% 120%,
            0% 0%;
    }
}

/* Forest Theme - Lush & Tranquil */
body.theme-forest {
    --theme-primary: #22c55e;
    --theme-secondary: #16a34a;
    --theme-accent: #15803d;
    --theme-gradient-start: #22c55e;
    --theme-gradient-end: #16a34a;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(134, 239, 172, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(255, 255, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(34, 197, 94, 0.2) 0%, transparent 50%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(255, 255, 255, 0.04) 3px,
            rgba(255, 255, 255, 0.04) 6px
        ),
        linear-gradient(180deg, #86efac 0%, #4ade80 20%, #22c55e 40%, #16a34a 60%, #15803d 80%, #166534 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 20px 20px, 100% 100%;
}

/* Candy Theme - Sweet & Playful */
body.theme-candy {
    --theme-primary: #f472b6;
    --theme-secondary: #ec4899;
    --theme-accent: #db2777;
    --theme-gradient-start: #fce7f3;
    --theme-gradient-end: #fbcfe8;
    background: 
        radial-gradient(circle at 15% 25%, rgba(244, 114, 182, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 45% 65%, rgba(168, 85, 247, 0.35) 4px, transparent 4px),
        radial-gradient(circle at 75% 35%, rgba(96, 165, 250, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 25% 75%, rgba(52, 211, 153, 0.35) 4px, transparent 4px),
        radial-gradient(circle at 85% 85%, rgba(251, 191, 36, 0.4) 3px, transparent 3px),
        radial-gradient(circle at 55% 15%, rgba(236, 72, 153, 0.35) 4px, transparent 4px),
        radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #fdf2f8 0%, #fce7f3 20%, #fbcfe8 40%, #f9a8d4 60%, #f472b6 80%, #ec4899 100%);
    background-size: 60px 60px, 80px 80px, 70px 70px, 90px 90px, 65px 65px, 75px 75px, 100% 100%, 100% 100%, 100% 100%;
    background-position: 0 0, 30px 40px, 15px 20px, 45px 10px, 25px 55px, 50px 30px, 0 0, 0 0, 0 0;
}

/* Galaxy Theme - Deep & Cosmic with Nebula */
body.theme-galaxy {
    --theme-primary: #a78bfa;
    --theme-secondary: #c084fc;
    --theme-accent: #8b5cf6;
    --theme-gradient-start: #581c87;
    --theme-gradient-end: #7c3aed;
    background: 
        /* Large glowing stars */
        radial-gradient(3px 3px at 20% 30%, rgba(255, 255, 255, 1), transparent),
        radial-gradient(2px 2px at 45% 55%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(4px 4px at 70% 25%, rgba(255, 255, 255, 0.95), transparent),
        radial-gradient(2px 2px at 85% 70%, rgba(255, 255, 255, 0.85), transparent),
        radial-gradient(3px 3px at 30% 80%, rgba(255, 255, 255, 0.9), transparent),
        /* Small twinkling stars */
        radial-gradient(1px 1px at 15% 20%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 60% 40%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 75% 60%, rgba(255, 255, 255, 0.75), transparent),
        /* Nebula clouds - pink/purple */
        radial-gradient(ellipse 400px 300px at 25% 30%, rgba(236, 72, 153, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 350px 250px at 70% 65%, rgba(168, 85, 247, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse 300px 200px at 50% 50%, rgba(139, 92, 246, 0.2) 0%, transparent 50%),
        /* Spiral galaxy effect */
        conic-gradient(from 45deg at 50% 50%, transparent 0deg, rgba(139, 92, 246, 0.15) 90deg, transparent 180deg, rgba(236, 72, 153, 0.12) 270deg, transparent 360deg),
        /* Base gradient - warmer purples */
        linear-gradient(135deg, #1e1b4b 0%, #312e81 20%, #581c87 40%, #7c3aed 60%, #a78bfa 80%, #c084fc 100%);
    background-size: 
        250px 250px, 200px 200px, 300px 300px, 220px 220px, 270px 270px,
        150px 150px, 180px 180px, 160px 160px,
        100% 100%, 100% 100%, 100% 100%,
        200% 200%,
        100% 100%;
    animation: twinkle 5s ease-in-out infinite alternate, galaxyStarMove 80s linear infinite, galaxyRotate 120s linear infinite;
}

@keyframes galaxyStarMove {
    0% { 
        background-position: 
            0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%,
            0% 0%, 0% 0%, 0% 0%,
            0% 0%, 0% 0%, 0% 0%,
            0% 0%,
            0% 0%;
    }
    25% { 
        background-position: 
            15% 12%, 20% 18%, 25% 10%, 18% 22%, 12% 25%,
            10% 8%, 25% 20%, 30% 15%,
            5% 5%, 8% 10%, 3% 8%,
            0% 0%,
            0% 0%;
    }
    50% { 
        background-position: 
            30% 24%, 40% 36%, 50% 20%, 36% 44%, 24% 50%,
            20% 16%, 50% 40%, 60% 30%,
            10% 10%, 16% 20%, 6% 16%,
            0% 0%,
            0% 0%;
    }
    75% { 
        background-position: 
            45% 36%, 60% 54%, 75% 30%, 54% 66%, 36% 75%,
            30% 24%, 75% 60%, 90% 45%,
            15% 15%, 24% 30%, 9% 24%,
            0% 0%,
            0% 0%;
    }
    100% { 
        background-position: 
            60% 48%, 80% 72%, 100% 40%, 72% 88%, 48% 100%,
            40% 32%, 100% 80%, 120% 60%,
            20% 20%, 32% 40%, 12% 32%,
            0% 0%,
            0% 0%;
    }
}

@keyframes galaxyRotate {
    0% { 
        background-position: 
            0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%,
            0% 0%, 0% 0%, 0% 0%,
            0% 0%, 0% 0%, 0% 0%,
            0% 0%,
            0% 0%;
    }
    100% { 
        background-position: 
            0% 0%, 0% 0%, 0% 0%, 0% 0%, 0% 0%,
            0% 0%, 0% 0%, 0% 0%,
            0% 0%, 0% 0%, 0% 0%,
            100% 100%,
            0% 0%;
    }
}

/* Neon Theme - Bright & Electric */
body.theme-neon {
    --theme-primary: #06b6d4;
    --theme-secondary: #8b5cf6;
    --theme-accent: #ec4899;
    --theme-gradient-start: #06b6d4;
    --theme-gradient-end: #8b5cf6;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(6, 182, 212, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(236, 72, 153, 0.4) 0%, transparent 60%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 20px,
            rgba(255, 255, 255, 0.1) 20px,
            rgba(255, 255, 255, 0.1) 21px
        ),
        linear-gradient(135deg, #06b6d4 0%, #8b5cf6 30%, #ec4899 60%, #f59e0b 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 40px 40px, 100% 100%;
    animation: neonPulse 3s ease-in-out infinite alternate;
}

@keyframes neonPulse {
    0% { filter: brightness(1) saturate(1); }
    100% { filter: brightness(1.2) saturate(1.3); }
}

/* Lavender Theme - Soft & Dreamy */
body.theme-lavender {
    --theme-primary: #c4b5fd;
    --theme-secondary: #a78bfa;
    --theme-accent: #8b5cf6;
    --theme-gradient-start: #e9d5ff;
    --theme-gradient-end: #c4b5fd;
    background: 
        radial-gradient(ellipse at 25% 25%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 75%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(196, 181, 253, 0.3) 0%, transparent 70%),
        linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 25%, #ddd6fe 50%, #c4b5fd 75%, #a78bfa 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

/* Mint Theme - Fresh & Cool */
body.theme-mint {
    --theme-primary: #34d399;
    --theme-secondary: #10b981;
    --theme-accent: #059669;
    --theme-gradient-start: #a7f3d0;
    --theme-gradient-end: #34d399;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(52, 211, 153, 0.3) 0%, transparent 50%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 3px,
            rgba(255, 255, 255, 0.05) 3px,
            rgba(255, 255, 255, 0.05) 6px
        ),
        linear-gradient(180deg, #d1fae5 0%, #a7f3d0 30%, #6ee7b7 60%, #34d399 90%, #10b981 100%);
    background-size: 100% 100%, 100% 100%, 20px 20px, 100% 100%;
}

/* Coral Theme - Warm & Cheerful */
body.theme-coral {
    --theme-primary: #fb7185;
    --theme-secondary: #f43f5e;
    --theme-accent: #e11d48;
    --theme-gradient-start: #fda4af;
    --theme-gradient-end: #fb7185;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(251, 113, 133, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 182, 193, 0.3) 0%, transparent 60%),
        linear-gradient(135deg, #fef2f2 0%, #fee2e2 20%, #fecdd3 40%, #fda4af 60%, #fb7185 80%, #f43f5e 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

/* Sky Theme - Light & Airy */
body.theme-sky {
    --theme-primary: #38bdf8;
    --theme-secondary: #0ea5e9;
    --theme-accent: #0284c7;
    --theme-gradient-start: #bae6fd;
    --theme-gradient-end: #38bdf8;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(56, 189, 248, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(186, 230, 253, 0.4) 0%, transparent 60%),
        linear-gradient(180deg, #e0f2fe 0%, #bae6fd 25%, #7dd3fc 50%, #38bdf8 75%, #0ea5e9 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

/* Fire Theme - Hot & Energetic */
body.theme-fire {
    --theme-primary: #f97316;
    --theme-secondary: #ea580c;
    --theme-accent: #c2410c;
    --theme-gradient-start: #f97316;
    --theme-gradient-end: #ea580c;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(249, 115, 22, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 60%, rgba(234, 88, 12, 0.4) 0%, transparent 50%),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 15px,
            rgba(255, 255, 255, 0.1) 15px,
            rgba(255, 255, 255, 0.1) 16px
        ),
        linear-gradient(180deg, #fff7ed 0%, #ffedd5 20%, #fed7aa 40%, #fdba74 60%, #fb923c 80%, #f97316 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 30px 30px, 100% 100%;
    animation: fireFlicker 4s ease-in-out infinite alternate;
}

@keyframes fireFlicker {
    0% { filter: brightness(1) hue-rotate(0deg); }
    100% { filter: brightness(1.1) hue-rotate(5deg); }
}

/* Ice Theme - Cool & Crisp */
body.theme-ice {
    --theme-primary: #06b6d4;
    --theme-secondary: #0891b2;
    --theme-accent: #0e7490;
    --theme-gradient-start: #cffafe;
    --theme-gradient-end: #06b6d4;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(6, 182, 212, 0.3) 0%, transparent 50%),
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 10px,
            rgba(255, 255, 255, 0.15) 10px,
            rgba(255, 255, 255, 0.15) 11px
        ),
        linear-gradient(135deg, #ecfeff 0%, #cffafe 25%, #a5f3fc 50%, #67e8f9 75%, #06b6d4 100%);
    background-size: 100% 100%, 100% 100%, 20px 35px, 100% 100%;
}

/* Gold Theme - Rich & Shiny */
body.theme-gold {
    --theme-primary: #fbbf24;
    --theme-secondary: #f59e0b;
    --theme-accent: #d97706;
    --theme-gradient-start: #fef3c7;
    --theme-gradient-end: #fbbf24;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(251, 191, 36, 0.5) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(254, 243, 199, 0.4) 0%, transparent 60%),
        linear-gradient(135deg, #fffbeb 0%, #fef3c7 25%, #fde68a 50%, #fcd34d 75%, #fbbf24 100%);
    background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
    animation: goldShine 5s ease-in-out infinite alternate;
}

@keyframes goldShine {
    0% { filter: brightness(1) saturate(1); }
    100% { filter: brightness(1.15) saturate(1.2); }
}

/* Berry Theme - Deep & Rich */
body.theme-berry {
    --theme-primary: #ec4899;
    --theme-secondary: #db2777;
    --theme-accent: #be185d;
    --theme-gradient-start: #f9a8d4;
    --theme-gradient-end: #ec4899;
    background: 
        radial-gradient(ellipse at 25% 25%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 75%, rgba(236, 72, 153, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 15% 35%, rgba(219, 39, 119, 0.3) 4px, transparent 4px),
        radial-gradient(circle at 55% 65%, rgba(190, 24, 93, 0.3) 3px, transparent 3px),
        radial-gradient(circle at 85% 25%, rgba(236, 72, 153, 0.35) 4px, transparent 4px),
        linear-gradient(135deg, #fdf2f8 0%, #fce7f3 20%, #fbcfe8 40%, #f9a8d4 60%, #f472b6 80%, #ec4899 100%);
    background-size: 100% 100%, 100% 100%, 50px 50px, 60px 60px, 55px 55px, 100% 100%;
    background-position: 0 0, 0 0, 0 0, 25px 30px, 15px 20px, 0 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
    position: relative;
}

.header-top {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 10px;
}

.btn-theme {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.btn-theme:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.btn-stars-header {
    background: rgba(255, 215, 0, 0.3);
    color: white;
    border: 2px solid rgba(255, 215, 0, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: default;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.btn-stars-header:hover {
    background: rgba(255, 215, 0, 0.4);
    transform: scale(1.05);
}

.btn-stars-header span:first-child {
    font-size: 1.1em;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
    animation: starGlow 2s ease-in-out infinite;
}

@keyframes starGlow {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) brightness(1);
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.6)) brightness(1.3);
    }
}

.btn-leaderboard-header {
    background: rgba(251, 191, 36, 0.3);
    color: white;
    border: 2px solid rgba(251, 191, 36, 0.5);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.btn-leaderboard-header:hover {
    background: rgba(251, 191, 36, 0.4);
    transform: scale(1.05);
}

.btn-profile-header {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}

.btn-profile-header:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.logo {
    max-width: 150px;
    height: auto;
    margin-bottom: 10px;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.tagline {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Game Area */
.game-area {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* Level Selector */
.level-selector h2 {
    margin-bottom: 20px;
    color: var(--theme-primary);
    text-align: center;
}

/* Progress Overview */
.progress-overview {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    color: white;
}

.progress-overview h2 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.8em;
}

.overall-progress {
    margin-top: 15px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-text {
    font-size: 1.1em;
    font-weight: 600;
}

.progress-percentage {
    font-size: 1.5em;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
}

.overall-progress-bar {
    width: 100%;
    height: 25px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.overall-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.5);
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.level-card {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid transparent;
}

.level-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.level-card.locked {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.level-card.completed {
    border-color: #4ade80;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
}

.level-card-number {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 5px;
}

.level-card-title {
    font-size: 0.9em;
    opacity: 0.9;
}

.level-card-stars {
    font-size: 0.8em;
    margin-top: 8px;
    line-height: 1;
    letter-spacing: 2px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Treasure Card */
.treasure-card {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    color: white;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid #92400e;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(217, 119, 6, 0.4);
}

.treasure-card::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 8px;
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 100%);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

.treasure-card:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(217, 119, 6, 0.6);
}

.treasure-card.locked {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    border-color: #374151;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
}

.treasure-card.locked::before {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
}

.treasure-card.unlocked {
    animation: treasureGlow 2s ease-in-out infinite;
}

@keyframes treasureGlow {
    0%, 100% {
        box-shadow: 0 5px 15px rgba(217, 119, 6, 0.4);
        border-color: #92400e;
    }
    50% {
        box-shadow: 0 5px 25px rgba(251, 191, 36, 0.8);
        border-color: #fbbf24;
    }
}

.treasure-card-icon {
    font-size: 3em;
    margin-bottom: 10px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: treasureBounce 2s ease-in-out infinite;
}

.treasure-card.unlocked .treasure-card-icon {
    animation: treasureBounce 2s ease-in-out infinite, treasureSparkle 3s ease-in-out infinite;
}

@keyframes treasureBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-5px) scale(1.1);
    }
}

@keyframes treasureSparkle {
    0%, 100% {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) brightness(1);
    }
    50% {
        filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.8)) brightness(1.3);
    }
}

.treasure-card-title {
    font-size: 1em;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.level-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.level-badge {
    background: var(--theme-primary);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
}

.level-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
}

.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-back {
    background: #6b7280;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: background 0.2s;
}

.btn-back:hover {
    background: #4b5563;
}

.btn-debug {
    background: #f59e0b;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.2s;
    opacity: 0.8;
    border: 2px dashed rgba(255, 255, 255, 0.5);
}

.btn-debug:hover {
    background: #d97706;
    opacity: 1;
    transform: scale(1.05);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.stat {
    flex: 1;
    min-width: 120px;
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.8em;
    font-weight: bold;
    color: var(--theme-primary);
}

.stat-value.score {
    color: #f59e0b;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

/* Typing Area */
.typing-area {
    margin-bottom: 30px;
}

.text-display {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 30px;
    min-height: 180px;
    font-size: 2em;
    line-height: 2.2;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    word-break: normal;
    overflow-wrap: normal;
}

.text-display .word {
    display: inline-block;
}

.text-display .char {
    display: inline-block;
}

.text-display .char.correct {
    color: #22c55e;
    background: #dcfce7;
}

.text-display .char.incorrect {
    color: #ef4444;
    background: #fee2e2;
    text-decoration: underline;
}

.text-display .char.current {
    background: #dbeafe;
    border-left: 3px solid #3b82f6;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { border-left-color: #3b82f6; }
    51%, 100% { border-left-color: transparent; }
}

.input-area {
    margin-top: 15px;
}

#typingInput {
    width: 100%;
    padding: 15px;
    font-size: 1.8em;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    text-align: center;
    transition: border-color 0.2s;
}

#typingInput:focus {
    outline: none;
    border-color: var(--theme-primary);
}

#typingInput:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Keyboard */
.keyboard-container {
    margin-top: 30px;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #f3f4f6;
    padding: 15px;
    border-radius: 12px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    background: white;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    padding: 12px 8px;
    min-width: 45px;
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    color: #374151;
    transition: all 0.15s;
    position: relative;
    user-select: none;
}

.key.wide {
    min-width: 80px;
}

.key.space {
    min-width: 300px;
}

.key.active {
    background: var(--theme-primary);
    color: white;
    border-color: var(--theme-primary);
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.4);
}

.key.highlight {
    background: #fef3c7;
    border-color: #fbbf24;
    animation: pulse 1s infinite;
}

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

.key.locked {
    opacity: 0.3;
    background: #e5e7eb;
}

/* Game Message */
.game-message {
    text-align: center;
    margin-top: 20px;
    min-height: 30px;
    font-size: 1.1em;
    font-weight: 600;
}

.game-message.success {
    color: #22c55e;
}

.game-message.error {
    color: #ef4444;
}

.game-message.info {
    color: #3b82f6;
}

/* Level Complete */
.level-complete {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.level-complete h2 {
    font-size: 2.5em;
    color: var(--theme-primary);
    margin-bottom: 30px;
}

.completion-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.completion-stat {
    display: flex;
    flex-direction: column;
}

.completion-label {
    font-size: 0.9em;
    color: #6b7280;
    margin-bottom: 10px;
}

.completion-value {
    font-size: 2.5em;
    font-weight: bold;
    color: var(--theme-primary);
}

.total-score {
    margin: 30px 0;
    padding: 20px;
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    border-radius: 15px;
    color: white;
}

.total-score-label {
    font-size: 1.2em;
    margin-right: 15px;
    opacity: 0.9;
}

.total-score-value {
    font-size: 2.5em;
    font-weight: bold;
}

.completion-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.completion-actions .btn-primary,
.completion-actions .btn-secondary {
    min-width: 150px;
    padding: 15px 30px;
    font-size: 1.1em;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background: #d1d5db;
}

/* Leaderboard Modal */
.leaderboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.leaderboard-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.leaderboard-content h3 {
    font-size: 2em;
    color: var(--theme-primary);
    margin-bottom: 20px;
    text-align: center;
}

.leaderboard-sort {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.leaderboard-sort-select {
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: border-color 0.2s;
}

.leaderboard-sort-select:focus {
    outline: none;
    border-color: var(--theme-primary);
}

.leaderboard-list {
    margin: 20px 0;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 5px;
}

.leaderboard-list::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: var(--theme-primary);
    border-radius: 10px;
}

.leaderboard-list::-webkit-scrollbar-thumb:hover {
    background: var(--theme-secondary);
}

.leaderboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    font-size: 1.1em;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: #f9fafb;
    border-radius: 12px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.leaderboard-item:hover {
    background: #f3f4f6;
    transform: translateX(5px);
}

.leaderboard-item.current-player {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    border-color: var(--theme-primary);
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.2);
}

.leaderboard-rank {
    font-size: 1.5em;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
    color: var(--theme-primary);
}

.leaderboard-name {
    flex: 1;
    font-size: 1.1em;
    font-weight: 600;
    color: #374151;
}

.you-badge {
    font-size: 0.8em;
    color: var(--theme-primary);
    font-weight: 600;
    margin-left: 5px;
}

.leaderboard-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.leaderboard-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-size: 0.85em;
    color: #6b7280;
}

.stat-value {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--theme-primary);
}

.leaderboard-stat-secondary {
    display: flex;
    gap: 15px;
    font-size: 0.85em;
    color: #6b7280;
}

.leaderboard-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

/* Profile Section */
.profile-section {
    /* Container for the profile modal only now */
}

.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.profile-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.profile-content h3 {
    margin-bottom: 20px;
    color: var(--theme-primary);
}

.profile-form label {
    display: block;
    margin-bottom: 15px;
}

.profile-form input {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1em;
}

.profile-form input:focus {
    outline: none;
    border-color: var(--theme-primary);
}

.profile-stats {
    margin: 20px 0;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

.profile-stats p {
    margin: 8px 0;
}

.profile-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

/* Welcome Modal */
.welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.welcome-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welcome-content h2 {
    font-size: 2.5em;
    color: var(--theme-primary);
    margin-bottom: 15px;
}

.welcome-text {
    font-size: 1.2em;
    color: #374151;
    margin-bottom: 25px;
}

.welcome-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 15px;
}

.welcome-form input {
    padding: 15px;
    font-size: 1.2em;
    border: 3px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    transition: border-color 0.2s;
}

.welcome-form input:focus {
    outline: none;
    border-color: var(--theme-primary);
}

.welcome-note {
    font-size: 0.9em;
    color: #6b7280;
    font-style: italic;
}

/* Break Modal */
.break-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.break-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.break-content h2 {
    font-size: 2.5em;
    color: var(--theme-primary);
    margin-bottom: 15px;
}

.break-text {
    font-size: 1.3em;
    color: #374151;
    margin-bottom: 15px;
    font-weight: 600;
}

.break-subtext {
    font-size: 1em;
    color: #6b7280;
    margin-bottom: 30px;
    font-style: italic;
}

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

.break-actions .btn-primary,
.break-actions .btn-secondary {
    padding: 15px 30px;
    font-size: 1.1em;
    width: 100%;
}

@media (min-width: 600px) {
    .break-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .break-actions .btn-primary,
    .break-actions .btn-secondary {
        width: auto;
        min-width: 180px;
    }
}

/* Home Row Video Modal (before Level 1) */
.home-row-video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.home-row-video-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 640px;
    width: 95%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.home-row-video-content h2 {
    font-size: 1.6em;
    color: var(--theme-primary);
    margin-bottom: 10px;
}

.home-row-video-text {
    font-size: 1.1em;
    color: #374151;
    margin-bottom: 20px;
}

.home-row-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 20px;
    background: #000;
}

.home-row-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.home-row-video-dont-show {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    color: #6b7280;
    margin-bottom: 20px;
    cursor: pointer;
}

.home-row-video-dont-show input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.home-row-video-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.home-row-video-actions .btn-primary,
.home-row-video-actions .btn-secondary {
    padding: 14px 24px;
    font-size: 1.05em;
    width: 100%;
}

@media (min-width: 500px) {
    .home-row-video-actions {
        flex-direction: row;
        justify-content: center;
    }
    
    .home-row-video-actions .btn-primary,
    .home-row-video-actions .btn-secondary {
        width: auto;
        min-width: 160px;
    }
}

/* Treasure Box Modal */
.treasure-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    backdrop-filter: blur(10px);
}

.treasure-content {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    padding: 50px 40px;
    border-radius: 30px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    animation: treasureAppear 0.6s ease-out;
    border: 4px solid rgba(255, 255, 255, 0.3);
}

@keyframes treasureAppear {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.treasure-box-container {
    margin: 20px 0 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    height: 200px;
}

.treasure-box {
    position: relative;
    width: 150px;
    height: 120px;
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 -10px 20px rgba(0, 0, 0, 0.3);
    border: 3px solid #92400e;
    animation: treasureBounce 2s ease-in-out infinite;
}

@keyframes treasureBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

.treasure-box::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 8px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(251, 191, 36, 0.5);
}

.treasure-lid {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%) rotateX(0deg);
    transform-origin: bottom center;
    width: 150px;
    height: 40px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    border-radius: 10px 10px 5px 5px;
    border: 3px solid #92400e;
    border-bottom: none;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    transition: transform 1s ease-out;
}

.treasure-box.open .treasure-lid {
    transform: translateX(-50%) rotateX(-120deg);
}

.treasure-sparkles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.treasure-sparkles .sparkle {
    position: absolute;
    font-size: 2em;
    opacity: 0;
    animation: sparkleFloat 2s ease-out infinite;
}

.treasure-box.open .sparkle {
    opacity: 1;
}

.sparkle-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0.5s;
}

.sparkle-2 {
    top: 30%;
    right: 15%;
    animation-delay: 0.7s;
}

.sparkle-3 {
    bottom: 25%;
    left: 20%;
    animation-delay: 0.9s;
}

.sparkle-4 {
    bottom: 30%;
    right: 10%;
    animation-delay: 1.1s;
}

.sparkle-5 {
    top: 50%;
    left: 50%;
    animation-delay: 1.3s;
}

.sparkle-6 {
    top: 15%;
    left: 50%;
    animation-delay: 1.5s;
}

@keyframes sparkleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8) rotate(360deg);
    }
}

.treasure-content h2 {
    font-size: 2.5em;
    color: white;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: titlePulse 2s ease-in-out infinite;
}

.treasure-stars-container {
    margin: 25px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.treasure-stars-label {
    font-size: 1.2em;
    color: white;
    font-weight: 600;
    margin-bottom: 15px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.treasure-stars {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.treasure-star {
    font-size: 1.8em;
    display: inline-block;
    opacity: 0;
    transform: scale(0) rotate(0deg);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    animation: starPopIn 0.6s ease-out forwards, starTwinkle 2s ease-in-out infinite;
}

.treasure-star:nth-child(1) { animation-delay: 0.1s, 0.1s; }
.treasure-star:nth-child(2) { animation-delay: 0.15s, 0.2s; }
.treasure-star:nth-child(3) { animation-delay: 0.2s, 0.3s; }
.treasure-star:nth-child(4) { animation-delay: 0.25s, 0.4s; }
.treasure-star:nth-child(5) { animation-delay: 0.3s, 0.5s; }
.treasure-star:nth-child(6) { animation-delay: 0.35s, 0.6s; }
.treasure-star:nth-child(7) { animation-delay: 0.4s, 0.7s; }
.treasure-star:nth-child(8) { animation-delay: 0.45s, 0.8s; }
.treasure-star:nth-child(9) { animation-delay: 0.5s, 0.9s; }
.treasure-star:nth-child(10) { animation-delay: 0.55s, 1s; }
.treasure-star:nth-child(11) { animation-delay: 0.6s, 1.1s; }
.treasure-star:nth-child(12) { animation-delay: 0.65s, 1.2s; }
.treasure-star:nth-child(13) { animation-delay: 0.7s, 1.3s; }
.treasure-star:nth-child(14) { animation-delay: 0.75s, 1.4s; }
.treasure-star:nth-child(15) { animation-delay: 0.8s, 1.5s; }
.treasure-star:nth-child(16) { animation-delay: 0.85s, 1.6s; }
.treasure-star:nth-child(17) { animation-delay: 0.9s, 1.7s; }
.treasure-star:nth-child(18) { animation-delay: 0.95s, 1.8s; }
.treasure-star:nth-child(19) { animation-delay: 1s, 1.9s; }
.treasure-star:nth-child(20) { animation-delay: 1.05s, 2s; }

@keyframes starPopIn {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes starTwinkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)) brightness(1);
    }
    25% {
        transform: scale(1.15) rotate(5deg);
        filter: drop-shadow(0 3px 6px rgba(255, 215, 0, 0.6)) brightness(1.3);
    }
    50% {
        transform: scale(1.1) rotate(-5deg);
        filter: drop-shadow(0 3px 6px rgba(255, 215, 0, 0.6)) brightness(1.2);
    }
    75% {
        transform: scale(1.15) rotate(5deg);
        filter: drop-shadow(0 3px 6px rgba(255, 215, 0, 0.6)) brightness(1.3);
    }
}

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

.treasure-message {
    font-size: 1.5em;
    color: white;
    margin-bottom: 10px;
    font-weight: 600;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.treasure-submessage {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 30px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.treasure-achievements {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.achievement-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    animation: achievementAppear 0.8s ease-out;
    animation-fill-mode: both;
}

.achievement-item:nth-child(1) {
    animation-delay: 0.2s;
}

.achievement-item:nth-child(2) {
    animation-delay: 0.4s;
}

.achievement-item:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes achievementAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.achievement-icon {
    font-size: 2.5em;
    animation: iconSpin 3s ease-in-out infinite;
}

@keyframes iconSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-10deg) scale(1.1); }
    75% { transform: rotate(10deg) scale(1.1); }
}

.achievement-text {
    color: white;
    font-weight: 600;
    font-size: 0.9em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.treasure-actions {
    margin-top: 30px;
}

.treasure-actions .btn-primary {
    padding: 15px 40px;
    font-size: 1.2em;
    font-weight: 700;
    background: white;
    color: #d97706;
    border: 3px solid white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: buttonPulse 2s ease-in-out infinite;
}

.treasure-actions .btn-primary:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

@keyframes buttonPulse {
    0%, 100% { box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 5px 30px rgba(255, 255, 255, 0.5); }
}

@media (max-width: 768px) {
    .treasure-content {
        padding: 40px 25px;
    }
    
    .treasure-content h2 {
        font-size: 2em;
    }
    
    .treasure-message {
        font-size: 1.3em;
    }
    
    .treasure-submessage {
        font-size: 1.1em;
    }
    
    .treasure-box {
        width: 120px;
        height: 100px;
    }
    
    .treasure-lid {
        width: 120px;
        height: 35px;
    }
    
    .treasure-achievements {
        flex-direction: column;
        gap: 15px;
    }
}

.completion-greeting {
    font-size: 1.5em;
    color: var(--theme-primary);
    font-weight: 600;
    margin: 10px 0 20px 0;
    animation: bounce 0.5s ease;
    position: relative;
    display: inline-block;
    cursor: default;
    padding: 10px 20px;
    border-radius: 10px;
    transition: background 0.3s;
}

.completion-greeting:hover {
    background: rgba(0, 0, 0, 0.05);
}

.completion-greeting:hover::before,
.completion-greeting:hover::after {
    content: '';
    position: absolute;
    pointer-events: none;
    z-index: 1000;
    display: block;
}

.completion-greeting:hover::before {
    content: '🍍';
    font-size: 2.5em;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    animation: pineappleRoll 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.completion-greeting:hover::after {
    content: '🐨🍌';
    font-size: 2.2em;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    margin-left: 100px;
    animation: koalaRun 3s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes pineappleRoll {
    0% {
        transform: translateX(-50%) translateY(0) rotate(0deg);
    }
    20% {
        transform: translateX(-40px) translateY(-15px) rotate(72deg);
    }
    40% {
        transform: translateX(0) translateY(-5px) rotate(144deg);
    }
    60% {
        transform: translateX(40px) translateY(-15px) rotate(216deg);
    }
    80% {
        transform: translateX(20px) translateY(-5px) rotate(288deg);
    }
    100% {
        transform: translateX(-50%) translateY(0) rotate(360deg);
    }
}

@keyframes koalaRun {
    0% {
        transform: translateX(-50%) translateY(0) scaleX(1);
    }
    20% {
        transform: translateX(-90px) translateY(-8px) scaleX(1);
    }
    40% {
        transform: translateX(-120px) translateY(0) scaleX(-1);
    }
    60% {
        transform: translateX(-90px) translateY(-8px) scaleX(-1);
    }
    80% {
        transform: translateX(-60px) translateY(-5px) scaleX(-1);
    }
    100% {
        transform: translateX(-50%) translateY(0) scaleX(1);
    }
}

.stars-earned {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0;
    font-size: 2.5em;
}

.star-icon {
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    animation: starTwinkle 2s ease-in-out infinite;
}

.star-icon:nth-child(1) { animation-delay: 0s; }
.star-icon:nth-child(2) { animation-delay: 0.2s; }
.star-icon:nth-child(3) { animation-delay: 0.4s; }
.star-icon:nth-child(4) { animation-delay: 0.6s; }
.star-icon:nth-child(5) { animation-delay: 0.8s; }

@keyframes starTwinkle {
    0%, 100% { 
        transform: scale(1) rotate(0deg);
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) brightness(1);
    }
    50% { 
        transform: scale(1.2) rotate(10deg);
        filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.6)) brightness(1.3);
    }
}

.stars-message {
    font-size: 1.2em;
    color: var(--theme-primary);
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Theme Selector Modal */
.theme-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.theme-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.theme-content h3 {
    font-size: 2em;
    color: var(--theme-primary);
    margin-bottom: 25px;
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

@media (min-width: 600px) {
    .themes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 900px) {
    .themes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.theme-option {
    cursor: pointer;
    transition: transform 0.2s;
    padding: 10px;
    border-radius: 15px;
    border: 3px solid transparent;
}

.theme-option:hover {
    transform: translateY(-5px);
    background: #f9fafb;
}

.theme-option.active {
    border-color: var(--theme-primary);
    background: rgba(96, 165, 250, 0.1);
}

.theme-preview {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-light-blue {
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #87ceeb 0%, #60a5fa 25%, #3b82f6 50%, #2563eb 75%, #1d4ed8 100%);
}

.theme-light-green {
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #6ee7b7 0%, #34d399 30%, #10b981 60%, #059669 100%);
}

.theme-pink {
    background: 
        radial-gradient(ellipse at 25% 25%, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse at 75% 75%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        linear-gradient(135deg, #fce7f3 0%, #fbcfe8 20%, #f9a8d4 40%, #f472b6 60%, #ec4899 80%, #db2777 100%);
}

.theme-rainbow-unicorn {
    background: 
        radial-gradient(ellipse at 10% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 80%, rgba(255, 255, 255, 0.3) 0%, transparent 40%),
        linear-gradient(135deg, 
            #ff9a9e 0%, 
            #fecfef 15%, 
            #a18cd1 30%, 
            #fbc2eb 45%, 
            #a6c1ee 60%, 
            #c2e9fb 75%, 
            #d4fc79 90%, 
            #96e6a1 100%
        );
    background-size: 100% 100%, 100% 100%, 400% 400%;
    animation: rainbowShift 8s ease infinite;
}

.theme-purple {
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(167, 139, 250, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #c4b5fd 0%, #a78bfa 25%, #8b5cf6 50%, #7c3aed 75%, #6d28d9 100%);
}

.theme-orange {
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(251, 146, 60, 0.4) 0%, transparent 50%),
        linear-gradient(135deg, #fed7aa 0%, #fdba74 20%, #fb923c 40%, #f97316 60%, #ea580c 80%, #c2410c 100%);
}

.theme-ocean {
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(6, 182, 212, 0.3) 0%, transparent 50%),
        linear-gradient(180deg, #67e8f9 0%, #22d3ee 20%, #06b6d4 40%, #0891b2 60%, #0e7490 80%, #155e75 100%);
}

.theme-sunset {
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 20% 80%, rgba(220, 38, 38, 0.2) 0%, transparent 50%),
        linear-gradient(180deg, #fef3c7 0%, #fde68a 15%, #fbbf24 30%, #f59e0b 45%, #f97316 60%, #ea580c 75%, #dc2626 90%, #991b1b 100%);
}

.theme-space {
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(139, 92, 246, 0.3) 0%, transparent 50%),
        radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.95), transparent),
        radial-gradient(2px 2px at 80% 70%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(1px 1px at 60% 20%, rgba(255, 255, 255, 0.85), transparent),
        linear-gradient(180deg, #020617 0%, #0f172a 20%, #1e1b4b 40%, #312e81 60%, #3730a3 80%, #4338ca 100%);
    background-size: 100% 100%, 40px 40px, 30px 30px, 50px 50px, 35px 35px, 100% 100%;
}

.theme-forest {
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255, 255, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(134, 239, 172, 0.25) 0%, transparent 50%),
        linear-gradient(180deg, #86efac 0%, #4ade80 20%, #22c55e 40%, #16a34a 60%, #15803d 80%, #166534 100%);
}

.theme-candy {
    background: 
        radial-gradient(circle at 15% 25%, rgba(244, 114, 182, 0.5) 3px, transparent 3px),
        radial-gradient(circle at 55% 65%, rgba(168, 85, 247, 0.45) 3px, transparent 3px),
        radial-gradient(circle at 85% 35%, rgba(96, 165, 250, 0.5) 3px, transparent 3px),
        radial-gradient(ellipse at 30% 30%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(135deg, #fdf2f8 0%, #fce7f3 20%, #fbcfe8 40%, #f9a8d4 60%, #f472b6 80%, #ec4899 100%);
    background-size: 30px 30px, 40px 40px, 35px 35px, 100% 100%, 100% 100%;
    background-position: 0 0, 15px 20px, 10px 10px, 0 0, 0 0;
}

.theme-galaxy {
    background: 
        radial-gradient(3px 3px at 20% 30%, rgba(255, 255, 255, 1), transparent),
        radial-gradient(2px 2px at 50% 50%, rgba(255, 255, 255, 0.9), transparent),
        radial-gradient(ellipse 200px 150px at 30% 30%, rgba(236, 72, 153, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 150px 100px at 70% 70%, rgba(168, 85, 247, 0.3) 0%, transparent 60%),
        linear-gradient(135deg, #1e1b4b 0%, #312e81 20%, #581c87 40%, #7c3aed 60%, #a78bfa 80%, #c084fc 100%);
    background-size: 40px 40px, 30px 30px, 100% 100%, 100% 100%, 100% 100%;
}

.theme-neon {
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(6, 182, 212, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(139, 92, 246, 0.5) 0%, transparent 50%),
        linear-gradient(135deg, #06b6d4 0%, #8b5cf6 30%, #ec4899 60%, #f59e0b 100%);
}

.theme-lavender {
    background: 
        radial-gradient(ellipse at 25% 25%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 25%, #ddd6fe 50%, #c4b5fd 75%, #a78bfa 100%);
}

.theme-mint {
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.35) 0%, transparent 50%),
        linear-gradient(180deg, #d1fae5 0%, #a7f3d0 30%, #6ee7b7 60%, #34d399 90%, #10b981 100%);
}

.theme-coral {
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #fef2f2 0%, #fee2e2 20%, #fecdd3 40%, #fda4af 60%, #fb7185 80%, #f43f5e 100%);
}

.theme-sky {
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(180deg, #e0f2fe 0%, #bae6fd 25%, #7dd3fc 50%, #38bdf8 75%, #0ea5e9 100%);
}

.theme-fire {
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(180deg, #fff7ed 0%, #ffedd5 20%, #fed7aa 40%, #fdba74 60%, #fb923c 80%, #f97316 100%);
}

.theme-ice {
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.5) 0%, transparent 50%),
        linear-gradient(135deg, #ecfeff 0%, #cffafe 25%, #a5f3fc 50%, #67e8f9 75%, #06b6d4 100%);
}

.theme-gold {
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.4) 0%, transparent 50%),
        linear-gradient(135deg, #fffbeb 0%, #fef3c7 25%, #fde68a 50%, #fcd34d 75%, #fbbf24 100%);
}

.theme-berry {
    background: 
        radial-gradient(ellipse at 25% 25%, rgba(255, 255, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 15% 35%, rgba(219, 39, 119, 0.3) 4px, transparent 4px),
        linear-gradient(135deg, #fdf2f8 0%, #fce7f3 20%, #fbcfe8 40%, #f9a8d4 60%, #f472b6 80%, #ec4899 100%);
    background-size: 100% 100%, 30px 30px, 100% 100%;
}

.theme-name {
    display: block;
    font-weight: 600;
    color: #374151;
    font-size: 1em;
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2em;
    }
    
    .game-area {
        padding: 20px;
    }
    
    .progress-overview {
        padding: 20px;
    }
    
    .progress-overview h2 {
        font-size: 1.5em;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .progress-percentage {
        font-size: 1.3em;
    }
    
    .levels-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .stats-bar {
        flex-direction: column;
    }
    
    .keyboard-row {
        flex-wrap: wrap;
    }
    
    .key.space {
        min-width: 200px;
    }
    
    .completion-stats {
        flex-direction: column;
        gap: 20px;
    }
    
    .leaderboard-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .leaderboard-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .leaderboard-stats {
        align-items: flex-start;
        width: 100%;
    }
    
    .header-top {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-leaderboard-header,
    .btn-stars-header,
    .btn-theme,
    .btn-profile-header {
        font-size: 0.8em;
        padding: 6px 12px;
    }
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: white;
    font-size: 0.95em;
    opacity: 0.9;
}

.site-footer p {
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.heart-icon {
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s;
}

.heart-icon:hover {
    animation: heartPulse 0.6s ease-in-out infinite;
}

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