@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

/* ============================
   NES.CSS DARK THEME OVERRIDE
   ============================ */

:root {
    --bg-color: #1a0f0a;
    --bg-secondary: #2c1810;
    --text-color: #f0e6d2;
    --accent: #ffcc00;
    --hp-green: #92cc41;
    --hp-red: #e76e55;
    --primary: #209cee;
    --border-color: #553322;
}

* {
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    background-color: var(--bg-color);
    /* Pixel pattern background */
    background-image:
        radial-gradient(circle, #2c1810 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-color);
    font-family: 'Press Start 2P', cursive;
    margin: 0;
    padding: 0;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    font-size: 12px;
    --podium-top-gradient: linear-gradient(180deg, #eef7ff 0%, #dbeafe 100%);
    --podium-side-gradient: linear-gradient(90deg, #8bb8e8 0%, #b8d9f7 28%, #d8ecff 50%, #b8d9f7 72%, #8bb8e8 100%);
    --podium-floor-shadow-gradient: radial-gradient(ellipse at center, rgba(26, 44, 79, 0.22) 0%, rgba(26, 44, 79, 0.08) 44%, rgba(26, 44, 79, 0) 78%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #e7f2ff 0%, #d8e9fb 34%, #c8dff7 62%, #b6d2f0 82%, #a9c6e8 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(110, 184, 255, 0.42) 0%, rgba(96, 160, 232, 0.24) 38%, rgba(71, 132, 202, 0.09) 66%, rgba(71, 132, 202, 0) 100%);
    --podium-ground-shadow-gradient: radial-gradient(ellipse at center, rgba(23, 38, 61, 0.36) 0%, rgba(23, 38, 61, 0.15) 58%, rgba(23, 38, 61, 0) 100%);
}

/* ============================
   MUSIC TOGGLE
   ============================ */
.music-btn {
    position: fixed;
    top: 70px;
    right: 10px;
    z-index: 999;
    font-size: 16px;
    padding: 4px 8px !important;
    min-width: 0;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.music-btn:hover {
    opacity: 1;
}

/* ============================
   GAME CONTAINER
   ============================ */
#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 10px;
}

/* ============================
   STATS HEADER
   ============================ */
.stats-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 4px solid var(--border-color);
    image-rendering: pixelated;
}

.profile-pic {
    width: 48px;
    height: 48px;
    background-color: var(--bg-secondary);
    background-size: cover;
    background-position: center;
    border: 4px solid var(--accent);
    cursor: pointer;
    image-rendering: pixelated;
}

.stats-text {
    flex-grow: 1;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-size: 10px;
    line-height: 2;
}

.header-buttons {
    display: flex;
    gap: 6px;
}

.stats-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-version {
    font-size: 9px;
    opacity: 0.6;
    font-family: 'Checkbook', monospace;
    margin-right: 8px;
    white-space: nowrap;
    align-self: center;
    color: rgba(255, 255, 255, 0.5);
}

.icon-btn {
    font-size: 14px !important;
    padding: 4px 8px !important;
    min-width: 0;
}

/* ============================
   ARENA (Cookie Zone)
   ============================ */
.arena {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

/* ============================
   XP STRIP (visible at top)
   ============================ */
.xp-strip {
    width: 100%;
    padding: 2px 10px;
    position: relative;
    box-sizing: border-box;
}

.xp-strip .nes-progress {
    height: 10px !important;
    margin: 0;
}

.xp-strip-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.xp-strip-text {
    font-size: 7px;
    color: #aaa;
}

/* ============================
   SETTINGS BUTTON (round pixel)
   ============================ */
.settings-btn {
    width: 24px;
    height: 24px;
    border: 3px solid #555;
    background: #2a2a3a;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    line-height: 20px;
    text-align: center;
    image-rendering: pixelated;
    clip-path: polygon(30% 0%, 70% 0%,
            100% 30%, 100% 70%,
            70% 100%, 30% 100%,
            0% 70%, 0% 30%);
    transition: background 0.15s;
}

.settings-btn:active {
    background: #444;
}

/* ============================
   SETTINGS MODAL CONTENT
   ============================ */
.settings-section {
    margin: 12px 0;
    padding: 8px 0;
    border-top: 2px dashed #333;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    font-size: 9px;
}

.settings-row input[type="range"] {
    width: 100px;
    accent-color: var(--accent);
}

.settings-row label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 9px;
}

.gfx-picker {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
}

.gfx-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 800;
    color: #eff7ff;
}

.gfx-option input[type="radio"] {
    accent-color: #56b2ff;
}

.gfx-note {
    margin-top: 8px;
    font-size: 10px;
    color: #d0e1f4;
}

/* Background Picker */
.bg-picker {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    justify-content: center;
}

.bg-option {
    width: 50px;
    height: 50px;
    border: 3px solid #444;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s;
}

.bg-option.active {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent);
}

.bg-preview {
    width: 100%;
    height: 100%;
}

.bg-prev-dots {
    background: #1a1a2e;
    background-image: radial-gradient(#333 1px, transparent 1px);
    background-size: 6px 6px;
}

.bg-prev-dark {
    background: linear-gradient(180deg, #0d0d1a, #1a1a2e);
}

.bg-prev-space {
    background: linear-gradient(135deg, #0a0a2e, #1a0a3e, #0a1a4e);
}

.bg-prev-forest {
    background: linear-gradient(180deg, #0a1a0a, #1a2e1a);
}

/* ============================
   BACKGROUND THEMES
   ============================ */
body.bg-dots {
    background-color: #1a1a2e !important;
    background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) !important;
    background-size: 8px 8px !important;
}

body.bg-dark {
    background-color: #0d0d1a !important;
    background-image: linear-gradient(180deg, #0d0d1a 0%, #1a1a2e 50%, #0d0d1a 100%) !important;
    background-size: 100% 100% !important;
}

body.bg-space {
    background-color: #0a0a2e !important;
    background-image: linear-gradient(135deg, #0a0a2e, #1a0a3e 40%, #0a1a4e) !important;
    background-size: 100% 100% !important;
}

body.bg-forest {
    background-color: #0a1a0a !important;
    background-image: linear-gradient(180deg, #0a1a0a 0%, #1a2e1a 50%, #0a1a0a 100%) !important;
    background-size: 100% 100% !important;
}

/* ============================
   COOKIE HP BAR
   ============================ */
.cookie-hp-container {
    width: 220px;
    margin-bottom: 20px;
    text-align: center;
    position: relative;
    z-index: 5;
}

.cookie-hp-container .nes-progress {
    height: 20px;
}

.cookie-hp-text {
    font-size: 10px;
    margin-top: 5px;
    color: #fff;
    text-shadow: 2px 2px 0 #000;
}

/* ============================
   COOKIE (Main Target)
   ============================ */
.cookie-container {
    width: 250px;
    height: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform 0.05s;
    /* FLOATING ANIMATION */
    animation: cookieFloat 3s ease-in-out infinite;
    /* Performance hint */
    will-change: transform;
    /* Composite layer */
    transform: translateZ(0);
}

.cookie-3d-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.cookie-3d-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.cookie-container:active {
    /* Squish on click */
    animation-play-state: paused;
}

/* ============================
   FLOATING ANIMATION
   Smooth sine-wave float
   ============================ */
@keyframes cookieFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-14px);
    }
}

/* Cookie Art - lightweight pseudo-3D fallback */
.cookie-art {
    --cookie-base: #c07030;
    --cookie-light: #e8a04e;
    --cookie-dark: #8b4513;
    --cookie-chip: #3e2723;
    --cookie-glow: rgba(210, 105, 30, 0.3);

    width: 160px;
    height: 160px;
    background:
        radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.34) 0 16%, rgba(255, 255, 255, 0.12) 24%, transparent 38%),
        radial-gradient(circle at 76% 78%, rgba(0, 0, 0, 0.24) 0 20%, transparent 46%),
        radial-gradient(circle at 52% 56%, var(--cookie-light) 0 28%, var(--cookie-base) 56%, var(--cookie-dark) 100%);
    position: relative;
    pointer-events: none;
    image-rendering: auto;
    border-radius: 50%;
    box-shadow:
        inset 0 12px 18px rgba(255, 255, 255, 0.12),
        inset -14px -20px 28px rgba(0, 0, 0, 0.36),
        inset 9px 6px 10px rgba(255, 255, 255, 0.08),
        0 8px 20px rgba(0, 0, 0, 0.28),
        0 0 18px var(--cookie-glow);
    transform: rotate(-4deg);
}

.cookie-art::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 42% 55% 50% 46%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, var(--cookie-chip) 40%, rgba(0, 0, 0, 0.28) 100%);
    top: 30px;
    left: 40px;
    box-shadow:
        56px 18px 0 0 var(--cookie-chip),
        -14px 54px 0 0 var(--cookie-chip),
        30px 76px 0 0 var(--cookie-chip),
        62px 50px 0 0 var(--cookie-chip),
        18px 96px 0 0 var(--cookie-chip),
        72px 86px 0 0 var(--cookie-chip);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}

.cookie-art::after {
    content: '';
    position: absolute;
    inset: 10% 9% 12% 11%;
    border-radius: 50%;
    background:
        radial-gradient(18px 14px at 20% 26%, rgba(255, 255, 255, 0.14) 0 62%, transparent 63%),
        radial-gradient(16px 12px at 72% 22%, rgba(255, 255, 255, 0.11) 0 58%, transparent 59%),
        radial-gradient(22px 18px at 68% 70%, rgba(0, 0, 0, 0.2) 0 60%, transparent 61%),
        radial-gradient(15px 13px at 30% 76%, rgba(0, 0, 0, 0.14) 0 58%, transparent 59%);
    opacity: 0.85;
    pointer-events: none;
}

/* ============================
   COOKIE LEVEL TIERS
   ============================ */

/* Level 1-2: Classic Brown (defaults in .cookie-art) */

/* Level 3-4: Golden */
.cookie-tier-golden .cookie-art {
    --cookie-base: #daa520;
    --cookie-light: #ffd700;
    --cookie-dark: #b8860b;
    --cookie-chip: #8b6914;
    --cookie-glow: rgba(255, 215, 0, 0.4);
}

/* Level 5-6: Ruby Red */
.cookie-tier-ruby .cookie-art {
    --cookie-base: #c0392b;
    --cookie-light: #e74c3c;
    --cookie-dark: #922b21;
    --cookie-chip: #641e16;
    --cookie-glow: rgba(231, 76, 60, 0.4);
}

/* Level 7-8: Cosmic Purple */
.cookie-tier-cosmic .cookie-art {
    --cookie-base: #7d3c98;
    --cookie-light: #a569bd;
    --cookie-dark: #5b2c6f;
    --cookie-chip: #4a235a;
    --cookie-glow: rgba(165, 105, 189, 0.5);
}

/* Level 9-10: Diamond Blue */
.cookie-tier-diamond .cookie-art {
    --cookie-base: #2e86c1;
    --cookie-light: #5dade2;
    --cookie-dark: #1b4f72;
    --cookie-chip: #154360;
    --cookie-glow: rgba(93, 173, 226, 0.5);
}

/* Level 11+: Obsidian with neon glow */
.cookie-tier-obsidian .cookie-art {
    --cookie-base: #1c1c2e;
    --cookie-light: #2d2d44;
    --cookie-dark: #0d0d1a;
    --cookie-chip: #ff006e;
    --cookie-glow: rgba(255, 0, 110, 0.6);
}

/* Glow effect for high-tier cookies — applied to CONTAINER, not art
   because clip-path on .cookie-art clips the shadow */
.cookie-tier-cosmic {
    filter: drop-shadow(0 0 12px rgba(165, 105, 189, 0.5));
}

.cookie-tier-diamond {
    filter: drop-shadow(0 0 15px rgba(93, 173, 226, 0.5));
}

.cookie-tier-obsidian {
    filter: drop-shadow(0 0 18px rgba(255, 0, 110, 0.6));
}

/* Level 13+: Emerald Green */
.cookie-tier-emerald .cookie-art {
    --cookie-base: #1e8449;
    --cookie-light: #2ecc71;
    --cookie-dark: #145a32;
    --cookie-chip: #82e0aa;
    --cookie-glow: rgba(46, 204, 113, 0.6);
}

.cookie-tier-emerald {
    filter: drop-shadow(0 0 18px rgba(46, 204, 113, 0.6));
}

/* Level 15+: Plasma (Neon Cyan/Pink) */
.cookie-tier-plasma .cookie-art {
    --cookie-base: #4a235a;
    --cookie-light: #af7ac5;
    --cookie-dark: #2e0f35;
    --cookie-chip: #00e5ff;
    --cookie-glow: rgba(0, 229, 255, 0.7);
}

.cookie-tier-plasma {
    filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.7));
}

/* Level 17+: Draconic (Deep Red/Black) */
.cookie-tier-draconic .cookie-art {
    --cookie-base: #641e16;
    --cookie-light: #922b21;
    --cookie-dark: #4a0e0e;
    --cookie-chip: #e74c3c;
    --cookie-glow: rgba(231, 76, 60, 0.8);
}

.cookie-tier-draconic {
    filter: drop-shadow(0 0 22px rgba(231, 76, 60, 0.8));
}

/* Level 20+: Void (Pure Black/White High Contrast) */
.cookie-tier-void .cookie-art {
    --cookie-base: #000000;
    --cookie-light: #333333;
    --cookie-dark: #000000;
    --cookie-chip: #ffffff;
    --cookie-glow: rgba(255, 255, 255, 0.9);
}

.cookie-tier-void {
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 1.0));
}

/* Level 30+: Quantum (Cyber Green) */
.cookie-tier-quantum .cookie-art {
    --cookie-base: #004d33;
    --cookie-light: #00cc66;
    --cookie-dark: #003322;
    --cookie-chip: #00ff99;
    --cookie-glow: rgba(0, 255, 153, 0.8);
}

.cookie-tier-quantum {
    filter: drop-shadow(0 0 22px rgba(0, 255, 153, 0.7));
}

/* Level 50+: Galactic (Deep Purple/Violet) */
.cookie-tier-galactic .cookie-art {
    --cookie-base: #2a0a4a;
    --cookie-light: #6a1b9a;
    --cookie-dark: #120524;
    --cookie-chip: #d500f9;
    --cookie-glow: rgba(213, 0, 249, 0.8);
}

.cookie-tier-galactic {
    filter: drop-shadow(0 0 25px rgba(213, 0, 249, 0.8));
}

/* Level 75+: Neutron (Intense Gold/Orange) */
.cookie-tier-neutron .cookie-art {
    --cookie-base: #6e2c00;
    --cookie-light: #d35400;
    --cookie-dark: #4a1d00;
    --cookie-chip: #ffeb3b;
    --cookie-glow: rgba(255, 165, 0, 0.9);
}

.cookie-tier-neutron {
    filter: drop-shadow(0 0 28px rgba(255, 165, 0, 0.9));
}

/* Level 100+: Singularity (Abyssal) */
.cookie-tier-singularity .cookie-art {
    --cookie-base: #000;
    --cookie-light: #111;
    --cookie-dark: #000;
    --cookie-chip: #333;
    --cookie-glow: rgba(100, 100, 255, 0.5);
}

.cookie-tier-singularity {
    filter: drop-shadow(0 0 30px rgba(100, 100, 255, 0.6));
}

/* Level 150+: Multiverse (RGB/Rainbow Vibe) */
.cookie-tier-multiverse .cookie-art {
    --cookie-base: #002244;
    --cookie-light: #ff00ff;
    --cookie-dark: #000033;
    --cookie-chip: #00ffff;
    --cookie-glow: rgba(255, 0, 255, 0.9);
}

.cookie-tier-multiverse {
    filter: drop-shadow(0 0 35px rgba(255, 0, 255, 1.0));
    animation: multiversePulse 2s infinite alternate;
}

@keyframes multiversePulse {
    0% {
        filter: drop-shadow(0 0 30px #ff00ff);
    }

    50% {
        filter: drop-shadow(0 0 35px #00ffff);
    }

    100% {
        filter: drop-shadow(0 0 30px #ffff00);
    }
}

/* Level 200+: Creator (Divine) */
.cookie-tier-creator .cookie-art {
    --cookie-base: #ffffff;
    --cookie-light: #f0f0f0;
    --cookie-dark: #e0e0e0;
    --cookie-chip: #ffd700;
    --cookie-glow: rgba(255, 215, 0, 1.0);
}

.cookie-tier-creator {
    filter: drop-shadow(0 0 50px rgba(255, 215, 0, 0.9));
    animation: godMode 3s infinite ease-in-out;
}

@keyframes godMode {
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 60px #ffffff);
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 40px #ffd700);
    }
}

/* Level 250+: Chronos (Time/Gear) - Rotating Border Effect */
.cookie-tier-chronos .cookie-art {
    --cookie-base: #8b4513;
    --cookie-light: #cd7f32;
    --cookie-dark: #654321;
    --cookie-chip: #ffd700;
    --cookie-glow: rgba(212, 175, 55, 0.8);
}

.cookie-tier-chronos {
    filter: drop-shadow(0 0 30px rgba(212, 175, 55, 0.8));
    animation: chronosSpin 10s linear infinite;
}

@keyframes chronosSpin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Level 300+: Eldritch (Glitch Horror) */
.cookie-tier-eldritch .cookie-art {
    --cookie-base: #2e003e;
    --cookie-light: #7500bc;
    --cookie-dark: #000000;
    --cookie-chip: #00ff00;
    /* Toxic Green */
    --cookie-glow: rgba(138, 43, 226, 0.9);
}

.cookie-tier-eldritch {
    filter: drop-shadow(0 0 30px rgba(138, 43, 226, 0.9));
    animation: eldritchGlitch 0.5s infinite steps(2);
}

@keyframes eldritchGlitch {
    0% {
        transform: translate(0, 0);
    }

    25% {
        transform: translate(-2px, 2px);
    }

    50% {
        transform: translate(2px, -2px);
    }

    75% {
        transform: translate(-1px, -1px);
    }

    100% {
        transform: translate(0, 0);
    }
}

/* Level 350+: Antimatter (Inverted/Negative) */
.cookie-tier-antimatter .cookie-art {
    --cookie-base: #000;
    --cookie-light: #fff;
    --cookie-dark: #333;
    --cookie-chip: #00ffff;
    --cookie-glow: rgba(255, 255, 255, 1);
}

.cookie-tier-antimatter {
    filter: invert(1) drop-shadow(0 0 30px red);
    /* Inverted shadow becomes cyan */
    animation: antimatterPulse 1s infinite alternate;
}

@keyframes antimatterPulse {
    from {
        filter: invert(1) drop-shadow(0 0 20px red);
    }

    to {
        filter: invert(1) drop-shadow(0 0 40px red);
    }
}

/* Level 400+: Primordial (Molten Chaos) */
.cookie-tier-primordial .cookie-art {
    --cookie-base: #2f0000;
    --cookie-light: #ff4500;
    --cookie-dark: #000;
    --cookie-chip: #ffa500;
    --cookie-glow: rgba(255, 69, 0, 1.0);
}

.cookie-tier-primordial {
    filter: drop-shadow(0 0 50px rgba(255, 69, 0, 1.0));
    animation: magmaFlow 2s ease-in-out infinite alternate;
}

@keyframes magmaFlow {
    from {
        filter: drop-shadow(0 0 40px #ff4500) hue-rotate(0deg);
    }

    to {
        filter: drop-shadow(0 0 60px #ff0000) hue-rotate(-20deg);
    }
}

/* Level 450+: Celestial (Starry) */
.cookie-tier-celestial .cookie-art {
    --cookie-base: #000020;
    --cookie-light: #191970;
    --cookie-dark: #000000;
    --cookie-chip: #ffffff;
    --cookie-glow: rgba(135, 206, 235, 0.9);
}

.cookie-tier-celestial {
    filter: drop-shadow(0 0 50px rgba(135, 206, 235, 1.0));
    animation: starTwinkle 3s infinite;
}

@keyframes starTwinkle {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* Level 500+: Infinity (The END) */
.cookie-tier-infinity .cookie-art {
    --cookie-base: #ffffff;
    --cookie-light: #cccccc;
    --cookie-dark: #999999;
    --cookie-chip: #000000;
    --cookie-glow: rgba(255, 255, 255, 1);
}

.cookie-tier-infinity {
    animation: infinityRainbow 2s linear infinite, godMode 5s infinite ease-in-out;
}

@keyframes infinityRainbow {
    0% {
        filter: hue-rotate(0deg) drop-shadow(0 0 50px red);
    }

    100% {
        filter: hue-rotate(360deg) drop-shadow(0 0 50px red);
    }
}

/* Click Animation (applied on click) */
.click-anim {
    animation: squish 0.1s ease-in-out !important;
}

@keyframes squish {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(0.88);
    }

    100% {
        transform: scale(1);
    }
}

/* ============================
   CRUMB PARTICLES (pixel squares)
   ============================ */
.crumb {
    position: fixed;
    width: 8px;
    height: 8px;
    pointer-events: none;
    z-index: 200;
    image-rendering: pixelated;
    animation: crumbFly 0.7s ease-out forwards;
    will-change: transform, opacity;
}

@keyframes crumbFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }

    70% {
        opacity: 0.8;
    }

    100% {
        opacity: 0;
        transform: translate(var(--crumb-x), var(--crumb-y)) rotate(var(--crumb-rot)) scale(0.3);
    }
}

/* ============================
   MODAL STYLES (NES-themed)
   ============================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
    padding: 20px !important;
    background: var(--bg-secondary) !important;
}

.modal-content h2 {
    font-size: 14px;
    margin-bottom: 15px;
}

.close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 24px;
    cursor: pointer;
    color: var(--hp-red);
    z-index: 10;
    line-height: 1;
}

/* ============================
   XP BAR
   ============================ */
.xp-container {
    margin: 10px 0;
    text-align: left;
}

.xp-label {
    font-size: 10px;
    margin-bottom: 5px;
}

/* ============================
   UPGRADE ROWS (Shop)
   ============================ */
.upgrade-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0;
    font-size: 10px;
}

.upgrade-row .nes-btn {
    font-size: 8px !important;
    padding: 4px 8px !important;
}

/* ============================
   LEADERBOARD / CLAN LIST
   ============================ */
.lb-list {
    text-align: left;
    font-size: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.lb-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 5px;
    border-bottom: 4px solid var(--border-color);
}

.lb-item:last-child {
    border-bottom: none;
}

.clan-info {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.join-btn {
    font-size: 8px !important;
    padding: 4px 8px !important;
}

/* ============================
   PARTICLES (Float up effect)
   ============================ */
.particle {
    position: absolute;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    font-size: 16px;
    font-weight: bold;
    color: var(--accent);
    text-shadow: 2px 2px 0 #000;
    z-index: 100;
    will-change: transform, opacity;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-80px) scale(1.3);
        opacity: 0;
    }
}

/* ============================
   HIDE OLD UNUSED ELEMENTS
   ============================ */
.hud,
.score-container,
.header {
    display: none;
}

/* ============================
   AUTOCLICK BUTTON
   ============================ */
.autoclick-btn {
    margin-top: 20px;
    font-size: 10px !important;
    padding: 8px 20px !important;
    transition: all 0.1s;
    z-index: 10;
}

.autoclick-btn.active {
    background-color: #e76e55 !important;
    box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.3) !important;
    transform: translateY(2px);
}

/* ============================
   NES.CSS OVERRIDES FOR DARK THEME
   ============================ */
.nes-container.is-dark {
    background-color: var(--bg-secondary);
    color: var(--text-color);
}

.nes-btn {
    font-family: 'Press Start 2P', cursive;
}

/* Stat row styling */
.stat-row {
    font-size: 10px;
    margin: 4px 0;
}

/* Scrollbar pixel style */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border: 2px solid var(--bg-color);
}

/* ============================
   RESPONSIVE TWEAKS
   ============================ */
@media (max-height: 600px) {
    .cookie-container {
        width: 180px;
        height: 180px;
    }

    .cookie-art {
        width: 120px;
        height: 120px;
    }

    .cookie-art::before {
        width: 10px;
        height: 10px;
        top: 20px;
        left: 28px;
        box-shadow:
            38px 12px 0 0 var(--cookie-chip),
            -10px 38px 0 0 var(--cookie-chip),
            22px 56px 0 0 var(--cookie-chip),
            44px 44px 0 0 var(--cookie-chip),
            12px 70px 0 0 var(--cookie-chip);
    }

    .cookie-art::after {
        inset: 11% 10% 12% 11%;
    }
}

:root {
    --cookie-cream: #f4e7ce;
    --cookie-warm: #ecc898;
    --caramel: #d38542;
    --milk-choco: #8d5a3a;
    --dark-choco: #3a2418;
    --white-choco: #f7efe1;
    --mint-accent: #76ad96;
    --ink-soft: #2e2219;
}

body {
    font-family: 'Manrope', sans-serif;
    color: #f8f1e7;
    background-color: #1c110d;
    background-image:
        radial-gradient(circle at 12% 15%, rgba(240, 194, 134, 0.19) 0, rgba(240, 194, 134, 0) 32%),
        radial-gradient(circle at 88% 86%, rgba(121, 168, 145, 0.16) 0, rgba(121, 168, 145, 0) 26%),
        radial-gradient(circle at 75% 28%, rgba(255, 255, 255, 0.05) 0, rgba(255, 255, 255, 0) 24%),
        linear-gradient(160deg, #1c110d 0%, #24150f 48%, #170f0c 100%);
}

body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

body::before {
    inset: 0;
    background: repeating-linear-gradient(0deg,
            rgba(255, 255, 255, 0.016) 0,
            rgba(255, 255, 255, 0.016) 1px,
            rgba(0, 0, 0, 0) 1px,
            rgba(0, 0, 0, 0) 4px);
    opacity: 0.42;
}

body::after {
    width: 40vmin;
    height: 40vmin;
    top: -12vmin;
    right: -10vmin;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 40%, rgba(244, 231, 206, 0.25) 0%, rgba(244, 231, 206, 0.05) 52%, rgba(244, 231, 206, 0) 72%);
}

#game-container {
    position: relative;
    z-index: 1;
    padding: 8px 12px 14px;
}

.stats-header,
.xp-strip,
.cookie-hp-container,
.autoclick-btn,
.modal-content {
    animation: uiRise 0.55s ease both;
}

.xp-strip {
    animation-delay: 0.08s;
}

.cookie-hp-container {
    animation-delay: 0.14s;
}

.autoclick-btn {
    animation-delay: 0.2s;
}

.stats-header {
    border-radius: 18px;
    padding: 10px 12px;
    border: 2px solid rgba(246, 221, 179, 0.2);
    border-bottom-width: 2px;
    background: linear-gradient(180deg, rgba(63, 40, 27, 0.82) 0%, rgba(44, 29, 20, 0.78) 100%);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(2px);
}

.profile-pic {
    border-radius: 14px;
    border: 2px solid rgba(245, 221, 181, 0.9);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.stat-row {
    font-family: 'Yeseva One', serif;
    letter-spacing: 0.04em;
    font-size: 12px;
}

.xp-strip {
    margin-top: 8px;
    padding: 8px 10px 7px;
    border-radius: 14px;
    border: 1px solid rgba(248, 229, 200, 0.22);
    background: linear-gradient(180deg, rgba(39, 26, 19, 0.76) 0%, rgba(30, 20, 15, 0.78) 100%);
}

.xp-strip-text {
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.03em;
    color: #f5debc;
}

.settings-btn {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255, 241, 214, 0.6);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 22%, #f1d2a2 0%, #d28b47 60%, #a15e2d 100%);
    color: #2b1a10;
    line-height: 26px;
    clip-path: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.settings-btn:active {
    transform: translateY(1px) scale(0.98);
}

.cookie-hp-container {
    width: min(360px, 82vw);
    margin-bottom: 16px;
}

.cookie-hp-text {
    font-family: 'Yeseva One', serif;
    color: #f6e3c5;
    text-shadow: 0 2px 7px rgba(0, 0, 0, 0.45);
}

.cookie-container {
    animation: cookieFloatCartoon 4.2s ease-in-out infinite;
}

.cookie-container::after {
    content: '';
    position: absolute;
    width: 68%;
    height: 14%;
    border-radius: 50%;
    bottom: 7%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.44) 0%, rgba(0, 0, 0, 0.18) 50%, rgba(0, 0, 0, 0) 80%);
    filter: blur(3px);
    z-index: -1;
}

.autoclick-btn,
.nes-btn {
    font-family: 'Manrope', sans-serif !important;
    font-weight: 800 !important;
    border-radius: 13px !important;
    border-width: 3px !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.autoclick-btn {
    min-width: 220px;
    padding: 10px 22px !important;
    background: linear-gradient(180deg, #f0cf9f 0%, #d38a47 100%) !important;
    border-color: #f6e0be !important;
    color: #2b1c12 !important;
    box-shadow: 0 9px 18px rgba(0, 0, 0, 0.31), inset 0 1px 0 rgba(255, 255, 255, 0.55) !important;
}

.autoclick-btn.active {
    background: linear-gradient(180deg, #d56f4e 0%, #b94e34 100%) !important;
}

.modal {
    background: radial-gradient(circle at center, rgba(58, 36, 24, 0.74) 0%, rgba(18, 12, 9, 0.9) 68%);
    backdrop-filter: blur(3px);
}

.modal-content {
    border-radius: 18px !important;
    border: 2px solid rgba(246, 222, 182, 0.25);
    background: linear-gradient(180deg, rgba(50, 31, 23, 0.97) 0%, rgba(32, 21, 17, 0.98) 100%) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.modal-content h2,
.modal-content h3,
.modal-content h4,
.title {
    font-family: 'Yeseva One', serif;
    letter-spacing: 0.03em;
}

.lb-item {
    border-bottom: 1px solid rgba(243, 220, 184, 0.24);
    padding: 10px 6px;
}

.particle {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.56);
}

.crumb {
    border-radius: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

body.bg-dots {
    background-image:
        radial-gradient(circle at 10% 15%, rgba(246, 207, 150, 0.2) 0, rgba(246, 207, 150, 0) 30%),
        radial-gradient(circle at 86% 80%, rgba(113, 167, 145, 0.16) 0, rgba(113, 167, 145, 0) 28%),
        repeating-radial-gradient(circle at center, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 9px),
        linear-gradient(160deg, #1c110d 0%, #24150f 48%, #170f0c 100%) !important;
}

body.bg-dark {
    background-image:
        radial-gradient(circle at 20% 18%, rgba(241, 189, 126, 0.18) 0, rgba(241, 189, 126, 0) 26%),
        linear-gradient(165deg, #180f0c 0%, #100a08 46%, #090705 100%) !important;
}

body.bg-space {
    background-image:
        radial-gradient(circle at 12% 16%, rgba(126, 173, 152, 0.18) 0, rgba(126, 173, 152, 0) 26%),
        radial-gradient(circle at 80% 85%, rgba(236, 196, 134, 0.16) 0, rgba(236, 196, 134, 0) 30%),
        linear-gradient(145deg, #171111 0%, #221912 50%, #151010 100%) !important;
}

body.bg-forest {
    background-image:
        radial-gradient(circle at 15% 12%, rgba(122, 170, 148, 0.2) 0, rgba(122, 170, 148, 0) 28%),
        radial-gradient(circle at 82% 82%, rgba(223, 165, 102, 0.14) 0, rgba(223, 165, 102, 0) 24%),
        linear-gradient(170deg, #141513 0%, #1b231f 52%, #131712 100%) !important;
}

@keyframes uiRise {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cookieFloatCartoon {

    0%,
    100% {
        transform: translateY(0) rotate(-0.7deg) scale(1);
    }

    50% {
        transform: translateY(-11px) rotate(0.9deg) scale(1.012);
    }
}

@media (max-width: 640px) {
    .stats-header {
        border-radius: 14px;
        padding: 8px 9px;
    }

    .xp-strip {
        margin-top: 6px;
        padding: 7px 8px 6px;
    }

    .stat-row {
        font-size: 11px;
    }

    .autoclick-btn {
        min-width: min(240px, 82vw);
    }
}

.msr {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    font-size: 20px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.modal-title {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-title .msr {
    font-size: 18px;
}

.section-title,
.row-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.section-title .msr,
.row-label .msr {
    font-size: 16px;
}

.header-buttons {
    gap: 8px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    padding: 0 !important;
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon-btn .msr {
    font-size: 20px;
}

.nes-btn {
    min-height: 40px;
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

.nes-btn:hover {
    filter: brightness(1.05);
}

.nes-btn:active {
    transform: translateY(1px) scale(0.99);
}

.nes-btn:disabled,
.nes-btn[disabled] {
    opacity: 0.65 !important;
    filter: saturate(0.5);
}

.settings-row {
    min-height: 40px;
}

.upgrade-row {
    gap: 10px;
    padding: 6px 0;
}

.upgrade-row .nes-btn {
    min-width: 98px;
}

.lb-item button,
.member-action-modal .nes-btn,
#member-action-modal .nes-btn {
    min-height: 34px;
}

.close-btn {
    position: sticky;
    top: 0;
    float: right;
    margin-left: auto;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    scrollbar-width: thin;
    scrollbar-color: rgba(241, 208, 158, 0.45) transparent;
}

.modal-content .nes-field,
.modal-content .settings-section {
    text-align: left;
}

#debug {
    display: none !important;
}

*:focus-visible {
    outline: 2px solid rgba(255, 220, 168, 0.9);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===== UI POLISH V3 ===== */
body::before {
    background: repeating-linear-gradient(0deg,
            rgba(255, 255, 255, 0.011) 0,
            rgba(255, 255, 255, 0.011) 1px,
            rgba(0, 0, 0, 0) 1px,
            rgba(0, 0, 0, 0) 6px);
    opacity: 0.2;
}

body.bg-dots {
    background-image:
        radial-gradient(circle at 10% 15%, rgba(246, 207, 150, 0.17) 0, rgba(246, 207, 150, 0) 34%),
        radial-gradient(circle at 86% 80%, rgba(113, 167, 145, 0.13) 0, rgba(113, 167, 145, 0) 30%),
        repeating-radial-gradient(circle at center, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 12px),
        linear-gradient(160deg, #1c110d 0%, #24150f 48%, #170f0c 100%) !important;
}

#game-container {
    padding: 10px 14px 16px;
    gap: 8px;
}

.stats-header {
    border-radius: 16px;
    padding: 10px 11px;
}

.stats-text {
    margin-left: 12px;
    gap: 2px;
}

.stat-row {
    font-size: 11px;
    opacity: 0.92;
}

#level-display,
#crumbs-display {
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.xp-strip {
    margin-top: 4px;
    padding: 8px 10px;
}

.xp-strip .nes-progress {
    height: 11px !important;
}

.xp-strip-text {
    font-size: 12px;
    font-weight: 700;
    color: #f8e8cf;
}

.arena {
    position: relative;
    gap: 10px;
}

.cookie-hp-container {
    width: min(376px, 84vw);
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(246, 222, 182, 0.2);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(45, 29, 21, 0.54) 0%, rgba(32, 21, 16, 0.4) 100%);
}

.cookie-container {
    width: clamp(250px, 62vw, 320px);
    height: clamp(250px, 62vw, 320px);
}

.cookie-container::after {
    width: 72%;
    height: 15%;
    bottom: 6%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0.14) 52%, rgba(0, 0, 0, 0) 82%);
}

.autoclick-btn {
    min-width: min(330px, 86vw);
    margin-top: 8px;
}

.nes-btn {
    border-radius: 12px !important;
    border-width: 2px !important;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.35) !important;
}

.nes-btn.is-warning {
    background: linear-gradient(180deg, #f5d9ac 0%, #dda15b 100%) !important;
    border-color: #f5e2c4 !important;
    color: #2e1f15 !important;
}

.nes-btn.is-success {
    background: linear-gradient(180deg, #d8e9de 0%, #7fb89d 100%) !important;
    border-color: #e7f3ec !important;
    color: #1e2a23 !important;
}

.nes-btn.is-error {
    background: linear-gradient(180deg, #f0d2c6 0%, #cf7858 100%) !important;
    border-color: #f6dfd6 !important;
    color: #2e1c16 !important;
}

.nes-btn.is-primary {
    background: linear-gradient(180deg, #d8e4f3 0%, #8eabce 100%) !important;
    border-color: #e9f1fa !important;
    color: #1c2530 !important;
}

.icon-btn {
    width: 42px;
    height: 42px;
}

.icon-btn .msr {
    font-size: 21px;
}

.modal-content {
    width: min(94vw, 420px);
    max-height: 84vh;
    padding: 18px 16px 16px !important;
}

.close-btn {
    width: 26px;
    height: 26px;
    font-size: 20px;
}

@media (max-width: 640px) {
    #game-container {
        padding: 8px 10px 14px;
    }

    .cookie-container {
        width: clamp(230px, 66vw, 280px);
        height: clamp(230px, 66vw, 280px);
    }

    .stat-row {
        font-size: 10px;
    }

    #level-display,
    #crumbs-display {
        font-size: 14px;
    }

    .autoclick-btn {
        min-width: min(300px, 86vw);
    }
}

/* ===== BRAWL-INSPIRED V4 ===== */
:root {
    --brawl-blue-1: #2aa8ff;
    --brawl-blue-2: #0f65d8;
    --brawl-panel: #0b2b63;
    --brawl-panel-soft: #113f85;
    --brawl-yellow: #ffd54a;
    --brawl-red: #ff6a5c;
    --brawl-green: #44d17a;
    --brawl-ink: #0a1630;
    --brawl-white: #f7fbff;
}

body {
    font-family: 'Nunito', sans-serif;
    color: var(--brawl-white);
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.24) 0, rgba(255, 255, 255, 0) 26%),
        radial-gradient(circle at 85% 78%, rgba(255, 221, 108, 0.18) 0, rgba(255, 221, 108, 0) 22%),
        linear-gradient(165deg, #2db1ff 0%, #1e8ef0 34%, #1468d9 68%, #0d4fbc 100%);
}

body::before {
    opacity: 0.22;
    background:
        radial-gradient(circle, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
    background-size: 9px 9px;
}

body::after {
    opacity: 0.75;
}

.stats-header,
.xp-strip,
.cookie-hp-container {
    border: 0;
    box-shadow: none !important;
    background: transparent !important;
}

.modal-content {
    border: 3px solid #ffffff;
    box-shadow:
        0 10px 0 rgba(6, 23, 54, 0.4),
        0 16px 28px rgba(2, 13, 36, 0.36),
        inset 0 1px 0 rgba(255, 255, 255, 0.45) !important;
}

.stats-header {
    border-radius: 0;
}



.stat-row {
    font-family: 'Bangers', cursive;
    letter-spacing: 0.06em;
    font-size: 14px;
}

#level-display,
#crumbs-display,
.xp-strip-text {
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    color: #ffffff;
}

.profile-pic {
    border: 3px solid #ffffff;
    border-radius: 14px;
}

.icon-btn,
.settings-btn {
    border-radius: 12px !important;
    border: 3px solid #ffffff !important;
    box-shadow: 0 5px 0 rgba(8, 19, 46, 0.45), 0 9px 18px rgba(5, 15, 38, 0.34) !important;
}

.icon-btn {
    background: linear-gradient(180deg, #ffd84f 0%, #f0b30e 100%) !important;
    color: #1b1b1b !important;
}

.settings-btn {
    background: linear-gradient(180deg, #ffd87a 0%, #f2b24a 100%);
    color: #1f1b18;
}



.cookie-hp-container .nes-progress {
    border: 2px solid #ffffff;
}

.cookie-container {
    width: clamp(270px, 64vw, 340px);
    height: clamp(270px, 64vw, 340px);
}

.autoclick-btn,
.nes-btn {
    font-family: 'Nunito', sans-serif !important;
    font-weight: 900 !important;
    letter-spacing: 0.04em;
    border: 3px solid #ffffff !important;
    border-radius: 14px !important;
    box-shadow: 0 6px 0 rgba(7, 23, 52, 0.45), 0 12px 20px rgba(6, 20, 46, 0.35) !important;
}

.autoclick-btn {
    min-width: min(344px, 86vw);
    background: linear-gradient(180deg, #ffe06f 0%, #f5bd1a 100%) !important;
    color: #1c1d21 !important;
}

.autoclick-btn.active,
.nes-btn:active {
    transform: translateY(2px) scale(0.99);
}

.nes-btn.is-warning {
    background: linear-gradient(180deg, #ffe173 0%, #f5be24 100%) !important;
    color: #1f1d1a !important;
}

.nes-btn.is-primary {
    background: linear-gradient(180deg, #8cd3ff 0%, #4b9ff0 100%) !important;
    color: #0f213f !important;
}

.nes-btn.is-success {
    background: linear-gradient(180deg, #88efac 0%, #35c76e 100%) !important;
    color: #103223 !important;
}

.nes-btn.is-error {
    background: linear-gradient(180deg, #ff9f92 0%, #f45a4a 100%) !important;
    color: #3b1313 !important;
}

.modal {
    background: radial-gradient(circle at center, rgba(8, 26, 64, 0.63) 0%, rgba(4, 14, 39, 0.88) 76%);
}

.modal-content {
    background: linear-gradient(180deg, #1b4f9f 0%, #0f3a84 100%) !important;
    border-radius: 18px !important;
}

.modal-content h2,
.modal-content h3,
.modal-content h4,
.title {
    font-family: 'Bangers', cursive;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.lb-item {
    border-bottom: 2px solid rgba(255, 255, 255, 0.28);
}

@media (max-width: 640px) {
    .stat-row {
        font-size: 12px;
    }

    .icon-btn,
    .settings-btn {
        width: 40px;
        height: 40px;
    }

    .cookie-container {
        width: clamp(238px, 68vw, 300px);
        height: clamp(238px, 68vw, 300px);
    }

    .autoclick-btn {
        min-width: min(304px, 86vw);
    }
}

/* Remove NES-style right/bottom bevel stripes */
.nes-btn::after,
.nes-btn:hover::after,
.nes-btn:focus::after,
.nes-btn:active::after,
.nes-btn.is-primary::after,
.nes-btn.is-success::after,
.nes-btn.is-warning::after,
.nes-btn.is-error::after {
    box-shadow: none !important;
}

/* Brawl-like background pack (replaces old themes) */
.bg-option {
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.72);
    overflow: hidden;
    box-shadow: 0 4px 0 rgba(8, 23, 56, 0.34), 0 8px 14px rgba(8, 20, 46, 0.24);
}

.bg-option.active {
    border-color: #ffd84f;
    box-shadow: 0 0 0 2px rgba(8, 25, 61, 0.86), 0 0 14px rgba(255, 216, 79, 0.65);
}

.bg-prev-dots {
    background:
        radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0) 26%),
        radial-gradient(circle at 82% 82%, rgba(255, 220, 110, 0.45) 0, rgba(255, 220, 110, 0) 30%),
        linear-gradient(165deg, #38b8ff 0%, #208df0 48%, #125fd0 100%);
}

.bg-prev-dark {
    background:
        radial-gradient(circle at 20% 16%, rgba(156, 127, 255, 0.45) 0, rgba(156, 127, 255, 0) 30%),
        radial-gradient(circle at 82% 80%, rgba(87, 225, 255, 0.34) 0, rgba(87, 225, 255, 0) 24%),
        linear-gradient(160deg, #1f2c86 0%, #122267 55%, #0a1748 100%);
}

.bg-prev-space {
    background:
        radial-gradient(circle at 16% 20%, rgba(255, 135, 215, 0.48) 0, rgba(255, 135, 215, 0) 28%),
        radial-gradient(circle at 80% 78%, rgba(106, 248, 255, 0.42) 0, rgba(106, 248, 255, 0) 26%),
        linear-gradient(160deg, #2d49bf 0%, #1a2f94 40%, #12226f 100%);
}

.bg-prev-forest {
    background:
        radial-gradient(circle at 22% 18%, rgba(172, 255, 127, 0.45) 0, rgba(172, 255, 127, 0) 30%),
        radial-gradient(circle at 84% 82%, rgba(255, 224, 116, 0.34) 0, rgba(255, 224, 116, 0) 28%),
        linear-gradient(165deg, #37ab5d 0%, #1e8748 50%, #126439 100%);
}

.bg-prev-sunset {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 225, 145, 0.52) 0, rgba(255, 225, 145, 0) 30%),
        radial-gradient(circle at 82% 80%, rgba(255, 119, 129, 0.38) 0, rgba(255, 119, 129, 0) 30%),
        linear-gradient(165deg, #ffb45f 0%, #ff7b72 48%, #b34fcd 100%);
}

.bg-prev-ice {
    background:
        radial-gradient(circle at 18% 22%, rgba(225, 250, 255, 0.56) 0, rgba(225, 250, 255, 0) 34%),
        radial-gradient(circle at 82% 82%, rgba(143, 214, 255, 0.36) 0, rgba(143, 214, 255, 0) 30%),
        linear-gradient(165deg, #bdefff 0%, #89d0ff 45%, #5ba8e9 100%);
}

.bg-prev-lava {
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 179, 120, 0.5) 0, rgba(255, 179, 120, 0) 30%),
        radial-gradient(circle at 80% 82%, rgba(255, 90, 67, 0.36) 0, rgba(255, 90, 67, 0) 32%),
        linear-gradient(165deg, #ff8f4f 0%, #e44337 45%, #6f2038 100%);
}

.bg-prev-aurora {
    background:
        radial-gradient(circle at 18% 20%, rgba(164, 255, 229, 0.48) 0, rgba(164, 255, 229, 0) 30%),
        radial-gradient(circle at 84% 82%, rgba(174, 152, 255, 0.36) 0, rgba(174, 152, 255, 0) 30%),
        linear-gradient(165deg, #47d7ba 0%, #2e8fd8 46%, #4f58c8 100%);
}

.bg-prev-dune {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 235, 176, 0.52) 0, rgba(255, 235, 176, 0) 32%),
        radial-gradient(circle at 82% 84%, rgba(255, 169, 106, 0.36) 0, rgba(255, 169, 106, 0) 30%),
        linear-gradient(165deg, #f3cc7f 0%, #dc9f60 48%, #9e6847 100%);
}

.bg-prev-coral {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 213, 190, 0.52) 0, rgba(255, 213, 190, 0) 32%),
        radial-gradient(circle at 82% 82%, rgba(255, 131, 155, 0.36) 0, rgba(255, 131, 155, 0) 30%),
        linear-gradient(165deg, #ffb185 0%, #ff7c8f 46%, #d74d80 100%);
}

.bg-prev-twilight {
    background:
        radial-gradient(circle at 18% 18%, rgba(187, 196, 255, 0.52) 0, rgba(187, 196, 255, 0) 30%),
        radial-gradient(circle at 82% 84%, rgba(107, 184, 255, 0.34) 0, rgba(107, 184, 255, 0) 30%),
        linear-gradient(165deg, #5a68c9 0%, #394ba4 48%, #212f72 100%);
}

.bg-prev-volt {
    background:
        radial-gradient(circle at 18% 18%, rgba(233, 255, 113, 0.52) 0, rgba(233, 255, 113, 0) 30%),
        radial-gradient(circle at 82% 82%, rgba(91, 255, 221, 0.35) 0, rgba(91, 255, 221, 0) 30%),
        linear-gradient(165deg, #74d640 0%, #2fb383 46%, #1f7175 100%);
}

body.bg-dots {
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 255, 255, 0.24) 0, rgba(255, 255, 255, 0) 24%),
        radial-gradient(circle at 84% 84%, rgba(255, 216, 106, 0.18) 0, rgba(255, 216, 106, 0) 22%),
        radial-gradient(circle, rgba(255, 255, 255, 0.14) 1.15px, transparent 1.15px),
        linear-gradient(165deg, #31b3ff 0%, #1f8ceb 40%, #1260d1 100%) !important;
    background-size: auto, auto, 11px 11px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #edf6ff 0%, #d4e9ff 100%);
    --podium-side-gradient: linear-gradient(90deg, #79aee6 0%, #a7cff6 28%, #d3ebff 50%, #a7cff6 72%, #79aee6 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #e9f5ff 0%, #d9ebff 34%, #c8e0fb 62%, #b6d3f0 82%, #a2c3e7 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(106, 179, 255, 0.44) 0%, rgba(81, 152, 229, 0.25) 38%, rgba(65, 128, 201, 0.1) 66%, rgba(65, 128, 201, 0) 100%);
}

body.bg-dark {
    background:
        radial-gradient(circle at 15% 16%, rgba(142, 112, 255, 0.22) 0, rgba(142, 112, 255, 0) 26%),
        radial-gradient(circle at 80% 80%, rgba(66, 211, 255, 0.16) 0, rgba(66, 211, 255, 0) 22%),
        radial-gradient(circle, rgba(255, 255, 255, 0.11) 1px, transparent 1px),
        linear-gradient(162deg, #1f2a86 0%, #14206a 45%, #0b1649 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #d7def9 0%, #b8c4ea 100%);
    --podium-side-gradient: linear-gradient(90deg, #4e5f96 0%, #6f82be 28%, #9bb0df 50%, #6f82be 72%, #4e5f96 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #b9c7f0 0%, #9fb0df 34%, #8294c9 62%, #6e7fb2 82%, #5a699d 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(116, 130, 214, 0.46) 0%, rgba(93, 109, 193, 0.28) 38%, rgba(70, 84, 166, 0.12) 66%, rgba(70, 84, 166, 0) 100%);
    --podium-ground-shadow-gradient: radial-gradient(ellipse at center, rgba(7, 11, 28, 0.44) 0%, rgba(7, 11, 28, 0.2) 58%, rgba(7, 11, 28, 0) 100%);
}

body.bg-space {
    background:
        radial-gradient(circle at 14% 18%, rgba(255, 121, 214, 0.25) 0, rgba(255, 121, 214, 0) 24%),
        radial-gradient(circle at 82% 82%, rgba(89, 244, 255, 0.19) 0, rgba(89, 244, 255, 0) 24%),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(165deg, #2a45be 0%, #1a2f90 50%, #112164 100%) !important;
    background-size: auto, auto, 13px 13px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #f2e8ff 0%, #d3c9ff 100%);
    --podium-side-gradient: linear-gradient(90deg, #6b67bb 0%, #8d8cda 28%, #b5b4f1 50%, #8d8cda 72%, #6b67bb 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #d9d2ff 0%, #c4c0fb 34%, #a5a7e8 62%, #888fd0 82%, #767cc0 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(154, 143, 255, 0.5) 0%, rgba(123, 115, 232, 0.28) 38%, rgba(95, 91, 189, 0.12) 66%, rgba(95, 91, 189, 0) 100%);
}

body.bg-forest {
    background:
        radial-gradient(circle at 18% 16%, rgba(176, 255, 126, 0.25) 0, rgba(176, 255, 126, 0) 24%),
        radial-gradient(circle at 84% 84%, rgba(255, 215, 110, 0.18) 0, rgba(255, 215, 110, 0) 24%),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(165deg, #38ab60 0%, #228749 50%, #146539 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #eef8dd 0%, #d1e8b0 100%);
    --podium-side-gradient: linear-gradient(90deg, #7ca55f 0%, #9bc07d 28%, #c4dea8 50%, #9bc07d 72%, #7ca55f 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #e2f2c8 0%, #cadeb3 34%, #b1cc9a 62%, #93b07f 82%, #799765 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(141, 196, 108, 0.42) 0%, rgba(114, 170, 82, 0.24) 38%, rgba(79, 126, 58, 0.09) 66%, rgba(79, 126, 58, 0) 100%);
}

body.bg-sunset {
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 229, 150, 0.24) 0, rgba(255, 229, 150, 0) 26%),
        radial-gradient(circle at 84% 86%, rgba(255, 133, 156, 0.2) 0, rgba(255, 133, 156, 0) 24%),
        radial-gradient(circle, rgba(255, 255, 255, 0.09) 1px, transparent 1px),
        linear-gradient(165deg, #ffb868 0%, #ff806f 42%, #a34bd0 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #ffe8d2 0%, #ffcda9 100%);
    --podium-side-gradient: linear-gradient(90deg, #d59176 0%, #eba882 28%, #fbc59e 50%, #eba882 72%, #d59176 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #ffd9c1 0%, #ffc4ac 34%, #f2aa97 62%, #d88e8c 82%, #b36ca1 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(255, 153, 128, 0.46) 0%, rgba(235, 117, 128, 0.28) 38%, rgba(176, 80, 151, 0.12) 66%, rgba(176, 80, 151, 0) 100%);
}

body.bg-ice {
    background:
        radial-gradient(circle at 14% 16%, rgba(228, 250, 255, 0.26) 0, rgba(228, 250, 255, 0) 26%),
        radial-gradient(circle at 86% 82%, rgba(141, 214, 255, 0.2) 0, rgba(141, 214, 255, 0) 26%),
        radial-gradient(circle, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(165deg, #b8ecff 0%, #87ccff 48%, #5ba4e9 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #f1fcff 0%, #d6f2ff 100%);
    --podium-side-gradient: linear-gradient(90deg, #8fbdd9 0%, #a9d7ef 28%, #d6f4ff 50%, #a9d7ef 72%, #8fbdd9 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #e9faff 0%, #d4f0ff 34%, #b9def5 62%, #96bddb 82%, #78a0c1 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(148, 222, 255, 0.48) 0%, rgba(118, 190, 228, 0.3) 38%, rgba(84, 141, 181, 0.12) 66%, rgba(84, 141, 181, 0) 100%);
}

body.bg-lava {
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 188, 124, 0.24) 0, rgba(255, 188, 124, 0) 26%),
        radial-gradient(circle at 84% 84%, rgba(255, 96, 72, 0.2) 0, rgba(255, 96, 72, 0) 26%),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(165deg, #ff8d4d 0%, #e54538 48%, #6f2137 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #ffe0c8 0%, #f4be9e 100%);
    --podium-side-gradient: linear-gradient(90deg, #b87360 0%, #d18970 28%, #efaa8b 50%, #d18970 72%, #b87360 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #ffc9aa 0%, #f5ad90 34%, #e28779 62%, #be5d68 82%, #8f3f5e 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(255, 145, 109, 0.52) 0%, rgba(221, 88, 85, 0.34) 38%, rgba(132, 47, 84, 0.14) 66%, rgba(132, 47, 84, 0) 100%);
    --podium-ground-shadow-gradient: radial-gradient(ellipse at center, rgba(62, 16, 22, 0.45) 0%, rgba(62, 16, 22, 0.2) 58%, rgba(62, 16, 22, 0) 100%);
}

body.bg-aurora {
    background:
        radial-gradient(circle at 16% 14%, rgba(168, 255, 228, 0.24) 0, rgba(168, 255, 228, 0) 26%),
        radial-gradient(circle at 84% 84%, rgba(177, 157, 255, 0.2) 0, rgba(177, 157, 255, 0) 26%),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(165deg, #46d4b9 0%, #2d8cd7 48%, #4e58c7 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #defef4 0%, #bceee4 100%);
    --podium-side-gradient: linear-gradient(90deg, #5ca6b2 0%, #77bcc5 28%, #9cdae2 50%, #77bcc5 72%, #5ca6b2 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #d8f7f0 0%, #c0ece4 34%, #95d0d5 62%, #739fbb 82%, #626eaf 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(108, 233, 198, 0.42) 0%, rgba(86, 169, 214, 0.27) 38%, rgba(88, 101, 195, 0.12) 66%, rgba(88, 101, 195, 0) 100%);
}

body.bg-dune {
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 238, 186, 0.26) 0, rgba(255, 238, 186, 0) 26%),
        radial-gradient(circle at 84% 84%, rgba(255, 171, 117, 0.2) 0, rgba(255, 171, 117, 0) 26%),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(165deg, #f3ca7d 0%, #dd9e5f 48%, #9f6947 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #fff0d9 0%, #f7d9b2 100%);
    --podium-side-gradient: linear-gradient(90deg, #b99166 0%, #cfab7e 28%, #e8c59b 50%, #cfab7e 72%, #b99166 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #ffe5c3 0%, #f6cda5 34%, #e4b388 62%, #be8f6f 82%, #956a57 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(245, 195, 122, 0.4) 0%, rgba(219, 154, 88, 0.25) 38%, rgba(145, 98, 73, 0.11) 66%, rgba(145, 98, 73, 0) 100%);
}

body.bg-coral {
    background:
        radial-gradient(circle at 16% 14%, rgba(255, 216, 194, 0.26) 0, rgba(255, 216, 194, 0) 26%),
        radial-gradient(circle at 84% 84%, rgba(255, 132, 155, 0.2) 0, rgba(255, 132, 155, 0) 26%),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(165deg, #ffb083 0%, #ff7c8f 48%, #d54e80 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #ffe8dc 0%, #ffc8c6 100%);
    --podium-side-gradient: linear-gradient(90deg, #c98388 0%, #de9aa0 28%, #f3bcc2 50%, #de9aa0 72%, #c98388 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #ffd8d5 0%, #fcb8bd 34%, #e993ad 62%, #c66997 82%, #a34d87 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(255, 169, 138, 0.42) 0%, rgba(242, 108, 132, 0.3) 38%, rgba(171, 66, 124, 0.14) 66%, rgba(171, 66, 124, 0) 100%);
}

body.bg-twilight {
    background:
        radial-gradient(circle at 16% 14%, rgba(186, 196, 255, 0.24) 0, rgba(186, 196, 255, 0) 26%),
        radial-gradient(circle at 84% 84%, rgba(110, 190, 255, 0.2) 0, rgba(110, 190, 255, 0) 26%),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(165deg, #5b68c8 0%, #384aa2 48%, #212f73 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #dce2ff 0%, #becaf3 100%);
    --podium-side-gradient: linear-gradient(90deg, #58679f 0%, #7486ba 28%, #98abd8 50%, #7486ba 72%, #58679f 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #ced7fb 0%, #b6c1ea 34%, #98a7d4 62%, #7687b8 82%, #5e6da0 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(132, 149, 247, 0.44) 0%, rgba(104, 122, 208, 0.28) 38%, rgba(72, 89, 162, 0.12) 66%, rgba(72, 89, 162, 0) 100%);
}

body.bg-volt {
    background:
        radial-gradient(circle at 16% 14%, rgba(236, 255, 132, 0.24) 0, rgba(236, 255, 132, 0) 26%),
        radial-gradient(circle at 84% 84%, rgba(100, 255, 224, 0.2) 0, rgba(100, 255, 224, 0) 26%),
        radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(165deg, #75d53f 0%, #2fb282 48%, #1f7174 100%) !important;
    background-size: auto, auto, 12px 12px, auto !important;
    --podium-top-gradient: linear-gradient(180deg, #efffd9 0%, #d3f7bc 100%);
    --podium-side-gradient: linear-gradient(90deg, #6fa870 0%, #89c38b 28%, #acdda9 50%, #89c38b 72%, #6fa870 100%);
    --podium-floor-base-gradient: radial-gradient(ellipse at 50% 30%, #e1fcca 0%, #c8efb1 34%, #9fce97 62%, #73a987 82%, #4f7b76 100%);
    --podium-aura-gradient: radial-gradient(ellipse at 50% 34%, rgba(157, 236, 115, 0.44) 0%, rgba(78, 197, 142, 0.27) 38%, rgba(42, 126, 127, 0.12) 66%, rgba(42, 126, 127, 0) 100%);
}

body.bg-dots::before,
body.bg-dark::before,
body.bg-space::before,
body.bg-forest::before,
body.bg-sunset::before,
body.bg-ice::before,
body.bg-lava::before,
body.bg-aurora::before,
body.bg-dune::before,
body.bg-coral::before,
body.bg-twilight::before,
body.bg-volt::before {
    opacity: 0.08;
    background-image: linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px 4px);
    background-size: 100% 4px;
}

body.bg-dots::after,
body.bg-dark::after,
body.bg-space::after,
body.bg-forest::after,
body.bg-sunset::after,
body.bg-ice::after,
body.bg-lava::after,
body.bg-aurora::after,
body.bg-dune::after,
body.bg-coral::after,
body.bg-twilight::after,
body.bg-volt::after {
    width: 44vmin;
    height: 44vmin;
    top: -12vmin;
    right: -11vmin;
    background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.24) 0%, rgba(255, 255, 255, 0.08) 52%, rgba(255, 255, 255, 0) 76%);
    opacity: 0.45;
}

/* Responsive stability on very small viewports */
#game-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden !important;
    gap: 8px;
    padding: 8px 10px calc(env(safe-area-inset-bottom, 0px) + 14px);
}

#game-container::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.stats-header,
.xp-strip,
.arena {
    width: 100%;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

.arena {
    flex: 1 1 auto;
    min-height: 0;
    justify-content: flex-start;
    gap: clamp(8px, 1.8vh, 16px);
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
}

.cookie-hp-container {
    width: min(92vw, 360px);
    margin-bottom: 0;
}

.cookie-container {
    width: clamp(210px, 55vw, 280px);
    height: clamp(210px, 55vw, 280px);
    margin-top: -44px;
}

.autoclick-btn {
    width: min(86vw, 330px);
    min-width: 0;
    margin-top: 4px;
    margin-bottom: 0;
    padding: 10px 16px !important;
}

@media (max-height: 760px) {
    #game-container {
        gap: 6px;
        padding-top: 6px;
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 10px);
    }

    .cookie-container {
        width: clamp(190px, 52vw, 244px);
        height: clamp(190px, 52vw, 244px);
        margin-top: -36px;
    }

    .cookie-hp-container .nes-progress {
        height: 16px;
    }

    .cookie-hp-text {
        font-size: 11px;
    }

    .autoclick-btn {
        width: min(84vw, 310px);
        padding: 8px 14px !important;
        min-height: 38px;
    }
}

@media (max-height: 680px) {
    .cookie-container {
        width: clamp(170px, 48vw, 216px);
        height: clamp(170px, 48vw, 216px);
        margin-top: -32px;
    }

    .icon-btn,
    .settings-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }

    .header-buttons {
        gap: 6px;
    }

    .stat-row,
    .xp-strip-text {
        font-size: 11px;
    }
}

@media (max-width: 380px) {
    .stats-header {
        padding: 8px;
    }

    .profile-pic {
        width: 42px;
        height: 42px;
    }

    .stats-text {
        margin-left: 8px;
    }

    .stat-row {
        font-size: 10px;
    }

    .cookie-hp-container {
        width: min(94vw, 340px);
    }

    .autoclick-btn {
        width: min(88vw, 292px);
        font-size: 13px !important;
    }
}

/* Top HUD: white translucent panel for readability */
.stats-header,
.xp-strip {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0.16) 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.72) !important;
    box-shadow: 0 6px 14px rgba(8, 20, 46, 0.2) !important;
    backdrop-filter: blur(2px);
}

.stats-header {
    border-radius: 14px;
}

.xp-strip {
    border-radius: 12px;
}

.stats-header .stat-row,
.stats-header #level-display,
.stats-header #crumbs-display,
.xp-strip-text {
    color: #123466 !important;
    text-shadow: none;
}

/* Cookie shadow logic: fixed ground shadow + scale by height */
.cookie-container {
    z-index: 2;
}

.cookie-container::after {
    display: none !important;
}

.cookie-ground-shadow {
    position: absolute;
    width: clamp(128px, 37vw, 194px);
    height: clamp(24px, 7.2vw, 38px);
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center;
    border-radius: 999px;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(ellipse at center,
            rgba(2, 12, 34, 0.36) 0%,
            rgba(2, 12, 34, 0.22) 48%,
            rgba(2, 12, 34, 0) 82%);
    filter: blur(2.2px);
    opacity: 0.34;
    animation: cookieGroundShadowPulse 4.2s ease-in-out infinite;
}

@keyframes cookieGroundShadowPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1.08);
        opacity: 0.35;
    }

    50% {
        transform: translate(-50%, -50%) scale(0.78);
        opacity: 0.2;
    }
}

/* ===== Bars/Buttons cleanup ===== */
.xp-strip {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 2px 2px 0 !important;
    margin-top: 2px;
}

.xp-strip-row {
    margin-top: 6px;
    padding: 0 2px;
}

.settings-btn {
    border: 0 !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #1b4e98 !important;
    box-shadow: 0 3px 10px rgba(7, 20, 45, 0.22) !important;
}

.settings-btn .msr {
    font-size: 20px;
}

.settings-btn:active {
    transform: translateY(1px) scale(0.96);
    box-shadow: 0 2px 6px rgba(7, 20, 45, 0.2) !important;
}

#xp-bar-top.nes-progress,
#xp-bar-progress.nes-progress,
#cookie-hp-progress.nes-progress {
    -webkit-appearance: none;
    appearance: none;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 999px !important;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.34) !important;
    box-shadow: inset 0 1px 2px rgba(9, 23, 53, 0.24) !important;
}

#xp-bar-top.nes-progress {
    height: 12px !important;
}

#cookie-hp-progress.nes-progress {
    height: 20px !important;
    background-color: rgba(255, 255, 255, 0.72) !important;
}

#xp-bar-top::-webkit-progress-bar,
#xp-bar-progress::-webkit-progress-bar,
#cookie-hp-progress::-webkit-progress-bar {
    background: transparent;
    border-radius: 999px;
}

#xp-bar-top::-moz-progress-bar,
#xp-bar-progress::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #8fe3ff 0%, #58b7ff 50%, #2f8eeb 100%);
}

#cookie-hp-progress::-moz-progress-bar {
    border-radius: 999px;
    background: linear-gradient(90deg, #ff9e8a 0%, #f36b57 52%, #d94136 100%);
}

#xp-bar-top::-webkit-progress-value,
#xp-bar-progress::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, #8fe3ff 0%, #58b7ff 50%, #2f8eeb 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 8px rgba(83, 190, 255, 0.4);
}

#cookie-hp-progress::-webkit-progress-value {
    border-radius: 999px;
    background: linear-gradient(90deg, #ff9e8a 0%, #f36b57 52%, #d94136 100%);
    box-shadow: inset 0 1px 0 rgba(255, 240, 235, 0.7), 0 0 8px rgba(243, 104, 88, 0.35);
}

.xp-strip.xp-gain #xp-bar-top::-webkit-progress-value,
.xp-strip.xp-gain #xp-bar-top::-moz-progress-bar {
    animation: xpGainPulse 0.42s ease;
}

.xp-strip.xp-gain .xp-strip-text {
    animation: xpTextPop 0.42s ease;
}

.cookie-hp-container,
#cookie-hp-progress {
    visibility: visible !important;
    opacity: 1 !important;
}

#cookie-hp-progress {
    display: block;
}

.cookie-hp-container.hp-damage {
    box-shadow: 0 0 0 2px rgba(255, 110, 110, 0.28), 0 0 16px rgba(255, 90, 90, 0.2);
    transition: box-shadow 0.22s ease;
}

.cookie-hp-container.hp-heal {
    box-shadow: 0 0 0 2px rgba(108, 255, 171, 0.28), 0 0 14px rgba(108, 255, 171, 0.2);
    transition: box-shadow 0.24s ease;
}

.cookie-hp-container.hp-damage .cookie-hp-text {
    color: #ffd4cc;
}

.cookie-hp-container.hp-heal .cookie-hp-text {
    color: #d8ffe7;
}

@keyframes xpGainPulse {
    0% {
        filter: brightness(1);
    }

    45% {
        filter: brightness(1.35);
    }

    100% {
        filter: brightness(1);
    }
}

@keyframes xpTextPop {
    0% {
        transform: translateY(0) scale(1);
    }

    40% {
        transform: translateY(-1px) scale(1.06);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

.nes-btn:active::before,
.nes-btn:active::after,
.icon-btn:active::before,
.icon-btn:active::after,
.autoclick-btn:active::before,
.autoclick-btn:active::after {
    box-shadow: none !important;
    border: 0 !important;
}

/* Peeking yellow crumbs tab (top-left of HUD) */
.stats-header {
    position: relative;
    overflow: visible;
}

.crumbs-peek-tab {
    position: absolute;
    top: -14px;
    left: 10px;
    height: 30px;
    min-width: 98px;
    padding: 0 10px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.82);
    background: linear-gradient(180deg, #ffe27e 0%, #f9c939 100%);
    color: #2a2a21;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: 'Nunito', sans-serif;
    font-weight: 900;
    font-size: 13px;
    box-shadow: 0 6px 14px rgba(7, 22, 47, 0.28);
    z-index: 6;
    pointer-events: none;
}

.crumbs-peek-tab .msr {
    font-size: 18px;
}

.crumbs-peek-tab::after {
    content: '';
    position: absolute;
    right: -1px;
    bottom: -8px;
    width: 26px;
    height: 10px;
    border-radius: 0 0 8px 8px;
    background: rgba(249, 201, 57, 0.55);
    filter: blur(0.6px);
}

@media (max-width: 420px) {
    .crumbs-peek-tab {
        top: -12px;
        left: 8px;
        min-width: 90px;
        height: 28px;
        font-size: 12px;
    }
}

/* Autoclick UI moved to long-press on cookie */
.autoclick-btn {
    display: none !important;
}

.cookie-container.autoclick-active {
    filter: drop-shadow(0 0 10px rgba(255, 226, 126, 0.55));
}

.autoclick-ring {
    position: absolute;
    width: clamp(260px, 68vw, 340px);
    height: clamp(260px, 68vw, 340px);
    top: 42%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    border-radius: 50%;
    border: 3px solid #ffffff;
    pointer-events: none;
    opacity: 0;
    z-index: 0;
    box-shadow: 0 0 14px rgba(255, 255, 255, 0.4);
}

.autoclick-ring.active {
    animation: autoclickHoldRing 0.9s ease-in-out infinite;
}

@keyframes autoclickHoldRing {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.52;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
        opacity: 0.9;
    }
}

/* ===== Final UX pass ===== */

/* 1) Settings moved to header buttons */
.header-buttons {
    align-items: center;
}

.header-buttons .settings-btn.icon-btn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffffff !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #9fd4ff 0%, #69a8ea 100%) !important;
    color: #102845 !important;
    box-shadow: 0 5px 0 rgba(7, 23, 52, 0.42), 0 10px 18px rgba(6, 20, 46, 0.28) !important;
}

.header-buttons .settings-btn.icon-btn .msr {
    font-size: 21px;
}

.xp-strip .settings-btn {
    display: none !important;
}

/* 2) XP text inside the bar */
.xp-strip {
    padding: 0 !important;
    margin-top: 2px;
}

.xp-top-wrap {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

#xp-bar-top.nes-progress {
    height: 18px !important;
    border-radius: 999px !important;
    background-color: rgba(255, 255, 255, 0.28) !important;
    border: 3px solid #ffffff !important;
    /* Thick white border like music buttons */
    box-shadow: 0 4px 0 rgba(10, 19, 42, 0.28) !important;
}

.xp-top-wrap .xp-strip-text {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 2px rgba(6, 16, 40, 0.45);
    pointer-events: none;
    margin: 0;
    z-index: 5;
}

/* 3) Shop crumbs tab + current stats */
#shop-modal .modal-content {
    position: relative;
    width: min(98vw, 560px);
    max-width: min(98vw, 560px) !important;
    height: min(88vh, 760px);
    max-height: 88vh !important;
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    padding: 16px 10px 10px !important;
}

.shop-crumbs-tab {
    position: absolute;
    top: -14px;
    left: 14px;
    height: 30px;
    min-width: 94px;
    padding: 0 10px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.86);
    background: linear-gradient(180deg, #ffe27e 0%, #f9c939 100%);
    color: #2c2418;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 900;
    box-shadow: 0 8px 14px rgba(8, 24, 56, 0.28);
}

.shop-current-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 6px 0 12px;
}

.shop-current-stats span {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    padding: 4px 9px;
    font-size: 11px;
    color: #f4fbff;
}

.shop-current-stats b {
    color: #ffe680;
}


.shop-layout {
    display: grid;
    grid-template-columns: 108px 1fr;
    gap: 10px;
    align-items: start;
    flex: 1 1 auto;
    min-height: 0;
}

.shop-sidebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shop-tabs {
    margin: 2px 0 0;
}

.shop-tab-btn {
    font-size: 10px !important;
    min-height: 32px;
    padding: 4px 6px !important;
    width: 100%;
}

.shop-tab-btn.active {
    box-shadow: 0 0 0 2px rgba(255, 225, 105, 0.65), 0 6px 12px rgba(8, 22, 56, 0.28);
}

.shop-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    padding-left: 10px;
}

.shop-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 0 8px;
}

#shop-inventory-search,
#shop-inventory-filter {
    height: 32px;
    font-size: 11px;
}

#shop-inventory-filter {
    width: 100%;
}

.shop-pane {
    display: none;
    min-height: 0;
}

.shop-pane.active {
    display: block;
    flex: 1 1 auto;
    overflow-y: auto;
    padding-right: 4px;
}

.shop-goods-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.shop-goods-grid .skin-card {
    aspect-ratio: 1 / 1;
    padding: 6px;
    gap: 4px;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.42);
}

.shop-goods-grid .skin-card.skeleton {
    position: relative;
    overflow: hidden;
    pointer-events: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.shop-goods-grid .skin-card.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.22) 48%, rgba(255, 255, 255, 0) 100%);
    animation: shopSkeletonShimmer 1.1s ease-in-out infinite;
}

.shop-skeleton-block,
.shop-skeleton-line {
    background: rgba(234, 242, 255, 0.18) !important;
    border-radius: 8px;
}

.shop-skeleton-line {
    width: 88%;
    height: 12px;
    margin: 2px auto;
}

.shop-skeleton-line.short {
    width: 62%;
}

@keyframes shopSkeletonShimmer {
    100% {
        transform: translateX(100%);
    }
}

.shop-goods-grid .skin-card.selectable {
    cursor: pointer;
}

.shop-goods-grid .skin-card.locked {
    opacity: 0.72;
    filter: saturate(0.8);
}

.shop-goods-grid .skin-card.selected {
    border-color: rgba(125, 255, 177, 0.95) !important;
    box-shadow: 0 0 0 2px rgba(125, 255, 177, 0.44), 0 8px 14px rgba(22, 68, 49, 0.24);
}

.shop-goods-grid .skin-preview {
    height: 42%;
    min-height: 34px;
}

.shop-goods-grid .skin-name {
    font-size: 10px;
    line-height: 1.08;
}

.shop-goods-grid .skin-meta {
    font-size: 9px;
    line-height: 1.08;
    min-height: 20px;
    color: rgba(244, 250, 255, 0.9);
}

.goods-preview-music {
    background:
        radial-gradient(circle at 28% 30%, rgba(255, 255, 255, 0.42) 0, rgba(255, 255, 255, 0) 30%),
        linear-gradient(145deg, #8756ff 0%, #4d79f8 40%, #2eaecf 100%);
}

.goods-preview-bg {
    border: 1px solid rgba(255, 255, 255, 0.38);
}

/* 4) Cookie shadow clearly under cookie */
.cookie-container {
    z-index: 4;
    animation: none !important;
    width: clamp(242px, 64vw, 320px);
    height: clamp(242px, 64vw, 320px);
    will-change: transform;
}

.cookie-ground-shadow {
    z-index: 3;
    width: clamp(164px, 44vw, 248px);
    height: clamp(28px, 8.2vw, 44px);
    opacity: 0.52;
    filter: blur(2.6px);
    animation: none !important;
    will-change: transform, opacity;
}

.corner-gif {
    position: fixed;
    right: 8px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 76px);
    width: 64px;
    height: auto;
    z-index: 16;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 0.92;
    filter: drop-shadow(0 2px 8px rgba(7, 20, 44, 0.45));
}

@media (max-width: 420px) {
    .corner-gif {
        width: 56px;
        right: 6px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 72px);
    }
}

/* 5) HP delayed yellow bar + spark effects */
.cookie-hp-container {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.hp-bar-shell {
    position: relative;
    width: 100%;
    height: 20px;
    border-radius: 999px;
    overflow: visible;
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid #ffffff !important;
    /* Thick white border like music buttons */
    box-shadow: 0 4px 0 rgba(10, 19, 42, 0.28);
}

.hp-bar-trail {
    position: absolute;
    inset: 0;
    width: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffd96a 0%, #ffbf42 45%, #ff8f27 100%);
    box-shadow: inset 0 1px 0 rgba(255, 240, 186, 0.72), 0 0 6px rgba(255, 193, 74, 0.32);
    z-index: 1;
}

.hp-bar-current {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 8px;
    border-radius: 999px;
    z-index: 3;
    background: linear-gradient(90deg, #ff9488 0%, #f0594a 55%, #d93b2f 100%);
    box-shadow: inset 0 1px 0 rgba(255, 242, 235, 0.68), 0 0 9px rgba(240, 90, 74, 0.35);
}

.hp-bar-current[data-empty="1"] {
    min-width: 0;
}

.hp-bar-sparks {
    position: absolute;
    inset: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 2;
}

.hp-spark {
    position: absolute;
    background: linear-gradient(180deg, rgba(255, 249, 196, 0.98) 0%, rgba(255, 198, 84, 0.95) 58%, rgba(255, 141, 38, 0.95) 100%);
    clip-path: polygon(50% 0%, 62% 34%, 100% 50%, 62% 66%, 50% 100%, 38% 66%, 0% 50%, 38% 34%);
    box-shadow: 0 0 4px rgba(255, 186, 82, var(--hp-spark-glow, 0.4));
    opacity: 0;
    will-change: transform, opacity;
}

.hp-spark.active-a,
.hp-spark.active-b {
    animation: hpSparkFly linear forwards;
}

@keyframes hpSparkFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--hp-spark-x, 0px), var(--hp-spark-y, -16px)) scale(0.12);
    }
}

@media (max-width: 420px) {
    .shop-crumbs-tab {
        top: -12px;
        left: 10px;
        height: 28px;
        min-width: 86px;
        font-size: 12px;
    }

    .shop-current-stats span {
        font-size: 10px;
    }

    .shop-tabs {
        margin-top: 0;
    }

    .shop-layout {
        grid-template-columns: 90px 1fr;
        gap: 8px;
    }

    .shop-main {
        padding-left: 8px;
    }

    .shop-goods-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .shop-goods-grid .skin-name {
        font-size: 9px;
    }

    .shop-goods-grid .skin-meta {
        font-size: 8px;
        min-height: 18px;
    }

    #xp-bar-top.nes-progress {
        height: 17px !important;
    }

    .xp-top-wrap .xp-strip-text {
        font-size: 10px;
    }

    .cookie-container {
        width: clamp(214px, 66vw, 272px);
        height: clamp(214px, 66vw, 272px);
    }
}

/* 6) Bottom ad placeholder block */
#game-container {
    padding-top: calc(env(safe-area-inset-top, 0px) + 56px) !important;
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 146px) !important;
}

.ad-placeholder {
    position: fixed;
    left: 0;
    right: 0;
    top: env(safe-area-inset-top, 0px);
    height: 44px;
    background: #ffffff;
    color: #4b5f7a;
    border-bottom: 1px solid rgba(13, 28, 58, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    letter-spacing: 0.04em;
    z-index: 50;
}

/* Mobile-first bottom controls layout */
.stats-header {
    margin-top: 16px;
}

.arena {
    justify-content: center;
    padding: 0 0 14px;
}

.bottom-stack {
    position: fixed;
    left: 0;
    right: 0;
    bottom: env(safe-area-inset-bottom, 0px);
    z-index: 40;
    isolation: isolate;
    padding: 8px 10px 10px;
    background: none;
    backdrop-filter: none;
    overflow: visible;
}

.bottom-stack .cookie-hp-container,
.bottom-stack .xp-strip,
.bottom-stack .bottom-nav {
    width: var(--hud-lane-width);
    margin-left: auto;
    margin-right: auto;
}

.bottom-stack .cookie-hp-container {
    margin-bottom: 6px;
}

.bottom-stack .xp-strip {
    margin-bottom: 8px;
}

.bottom-stack .bottom-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.bottom-stack .bottom-nav .icon-btn {
    width: 100%;
    min-width: 0;
}

@media (max-width: 420px) {
    #game-container {
        padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 138px) !important;
    }

    .bottom-stack {
        padding-left: 8px;
        padding-right: 8px;
    }

    .bottom-stack .bottom-nav {
        gap: 6px;
    }
}

/* Header + bottom nav cleanup */
.stats-header {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 6px 8px 4px !important;
    align-items: flex-start;
    gap: 10px;
}

.stats-text {
    margin-left: 0 !important;
    padding-top: 0;
}

.stats-header .profile-pic {
    margin-top: 0 !important;
}

.stats-header .stat-row,
.stats-header #level-display,
.stats-header #crumbs-display {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(10, 27, 58, 0.45);
}

.bottom-stack {
    background: none;
}

.bottom-stack .bottom-nav .icon-btn,
.bottom-stack .bottom-nav .settings-btn.icon-btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    border: 3px solid #ffffff !important;
    border-radius: 13px !important;
    background: linear-gradient(180deg, #b8ddff 0%, #72afea 100%) !important;
    color: #0f2a48 !important;
    box-shadow: 0 5px 0 rgba(7, 23, 52, 0.4), 0 9px 16px rgba(6, 20, 46, 0.24) !important;
}

.bottom-stack .bottom-nav #shop-btn {
    background: linear-gradient(180deg, #ffe173 0%, #f5be24 100%) !important;
    color: #1f1d1a !important;
}

.bottom-stack .bottom-nav #clans-btn {
    background: linear-gradient(180deg, #ffe173 0%, #f5be24 100%) !important;
    color: #1f1d1a !important;
}

.bottom-stack .bottom-nav #leaderboard-btn {
    background: linear-gradient(180deg, #88efac 0%, #35c76e 100%) !important;
    color: #103223 !important;
}

.bottom-stack .bottom-nav #settings-btn {
    background: linear-gradient(180deg, #b8ddff 0%, #72afea 100%) !important;
    color: #0f2a48 !important;
}

.bottom-stack .bottom-nav .icon-btn .msr,
.bottom-stack .bottom-nav .settings-btn.icon-btn .msr {
    font-size: 21px;
}

/* Skins inventory/shop */
.inventory-title {
    margin: 8px 0 6px;
    font-size: 12px;
    font-family: 'Bangers', cursive;
    letter-spacing: 0.05em;
}

.skins-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.skin-card {
    padding: 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.09);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.skin-preview {
    width: 100%;
    height: 42px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    background: radial-gradient(circle at 35% 35%, #f1d2a2 0%, #d59a57 45%, #9b6134 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.skin-preview.cookie-tier-classic {
    background: radial-gradient(circle at 35% 35%, #f1d2a2 0%, #d59a57 45%, #9b6134 100%);
}

.skin-preview.cookie-tier-golden {
    background: radial-gradient(circle at 35% 35%, #ffe78f 0%, #e2b53a 48%, #9f6f18 100%);
}

.skin-preview.cookie-tier-ruby {
    background: radial-gradient(circle at 35% 35%, #ffb2a8 0%, #e65a4b 48%, #8f241d 100%);
}

.skin-preview.cookie-tier-anime {
    background: radial-gradient(circle at 35% 35%, #ffccea 0%, #ff8cc6 48%, #ff4d9e 100%);
}

.anime-skin-video {
    position: absolute;
    /* Relative to game-container */
    bottom: 115px;
    /* Adjusted to sit on HP bar */
    left: 24px;
    /* Shifted right to hide edge */
    width: 80px;
    /* Even smaller */
    height: auto;
    z-index: 6;
    pointer-events: auto;
    opacity: 0.9;
    mix-blend-mode: normal;
    display: none;
}

.skin-preview.cookie-tier-cosmic {
    background: radial-gradient(circle at 35% 35%, #d6b0ff 0%, #8753cc 48%, #3e2368 100%);
}

.skin-preview.cookie-tier-diamond {
    background: radial-gradient(circle at 35% 35%, #c5ecff 0%, #6fbbe8 48%, #2c6fa1 100%);
}

.skin-preview.cookie-tier-emerald {
    background: radial-gradient(circle at 35% 35%, #b8ffd8 0%, #4dcf86 48%, #1f7b4d 100%);
}

.skin-preview.cookie-tier-obsidian {
    background: radial-gradient(circle at 35% 35%, #9fa0b8 0%, #484b6f 48%, #1a1b2f 100%);
}

.skin-card.selected {
    border-color: rgba(125, 255, 177, 0.9);
    box-shadow: 0 0 0 1px rgba(125, 255, 177, 0.35);
}

.skin-card.owned {
    border-color: rgba(255, 235, 148, 0.8);
}

.skin-name {
    font-weight: 900;
    font-size: 12px;
}

.skin-meta {
    font-size: 10px;
    color: rgba(241, 248, 255, 0.85);
}

.skins-grid .nes-btn.is-small {
    min-height: 30px;
    font-size: 10px;
    padding: 4px 8px !important;
}

@media (max-width: 420px) {
    .skins-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Final merged HUD/nav alignment pass */
:root {
    --hud-lane-left: 12px;
    --hud-lane-right: 12px;
    --hud-lane-width: calc(100% - var(--hud-lane-left) - var(--hud-lane-right));
    --hud-music-btn-size: 58px;
}

.stats-header {
    display: flex;
    align-items: center !important;
    justify-content: space-between;
    gap: 8px;
    min-height: 58px;
    padding: 6px 10px !important;
}

.stats-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    transform: translateY(0);
}

.stats-header-main .profile-pic {
    align-self: center;
    margin-bottom: 0 !important;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    border: 3px solid #ffffff !important;
    box-shadow: 0 4px 0 rgba(25, 61, 104, 0.56), 0 8px 14px rgba(13, 39, 76, 0.22);
}

.stats-header-main .stats-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding-bottom: 0;
}

.stats-header-main .stat-row {
    margin: 0;
    line-height: 1.02;
    font-weight: 900;
    text-shadow: 0 2px 0 rgba(36, 76, 125, 0.44), 0 0 2px rgba(255, 255, 255, 0.28);
}

.top-music-strip {
    width: var(--hud-lane-width);
    margin: 2px auto 6px;
    display: grid;
    grid-template-columns: var(--hud-music-btn-size) minmax(0, 1fr) var(--hud-music-btn-size);
    gap: 6px;
    align-items: center;
    z-index: 12;
}

.music-nav-btn {
    width: 100%;
    min-width: 0;
    height: 32px;
    border: 3px solid #ffffff !important;
    border-radius: 10px;
    background: linear-gradient(180deg, #91c8ff 0%, #5d9ce3 100%);
    color: #0f2a48;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 0 rgba(10, 19, 42, 0.28) !important;
    padding: 0;
}

.music-nav-btn:disabled {
    opacity: 0.45;
}

.music-track-title {
    width: 100%;
    min-width: 0;
    height: 32px;
    border-radius: 10px;
    border: 3px solid #ffffff !important;
    background: rgba(14, 45, 88, 0.42);
    color: #f5fbff;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 0 rgba(10, 19, 42, 0.28) !important;
    text-shadow: 0 1px 2px rgba(7, 20, 46, 0.5);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    padding: 0 8px;
}

.stats-header-controls {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    margin-left: auto;
}

.stats-header-controls .settings-btn.icon-btn {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    border-radius: 14px !important;
    border: 3px solid #ffffff !important;
    background: linear-gradient(180deg, #9ec3e8 0%, #6f9fd0 100%) !important;
    color: #2b527d !important;
    box-shadow: 0 4px 0 rgba(25, 61, 104, 0.56), 0 8px 14px rgba(13, 39, 76, 0.22) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.stats-header-controls #settings-btn {
    background: linear-gradient(180deg, #b8ddff 0%, #73b0ea 100%) !important;
    color: #0f2a48 !important;
}

.stats-header-controls .settings-btn.icon-btn .msr {
    font-size: 24px;
}

.sound-state-badge {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    background: rgba(37, 78, 122, 0.9);
    color: rgba(255, 255, 255, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 6px rgba(12, 36, 73, 0.42);
    opacity: 0.98;
    transform: none;
    position: absolute;
    right: -7px;
    bottom: -7px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.sound-state-badge .msr {
    font-size: 12px;
}

.sound-state-badge.is-muted {
    background: rgba(11, 26, 53, 0.52);
    color: rgba(255, 255, 255, 0.95);
}

.sound-state-badge.is-on {
    background: rgba(22, 130, 89, 0.28);
    border-color: rgba(208, 255, 229, 0.72);
    color: rgba(221, 255, 233, 0.95);
}

.sound-state-badge.is-hidden {
    opacity: 0;
    transform: translateY(-3px);
}

.bottom-stack .cookie-hp-container {
    margin-bottom: 7px;
}

.cookie-hp-container .hp-bar-shell {
    position: relative;
    overflow: visible;
    z-index: 10;
}

.cookie-hp-container .cookie-hp-text {
    position: absolute;
    inset: 0;
    z-index: 6;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 2px rgba(6, 16, 40, 0.45);
    pointer-events: none;
}

.xp-top-wrap .xp-strip-text,
.cookie-hp-container .cookie-hp-text {
    font-family: 'Nunito', sans-serif;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-shadow: 0 1px 2px rgba(6, 16, 40, 0.45);
}

.bottom-stack .bottom-nav {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.bottom-stack .bottom-nav .icon-btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    height: 44px;
    border: 3px solid #ffffff !important;
    border-radius: 13px !important;
    box-shadow: 0 5px 0 rgba(7, 23, 52, 0.4), 0 9px 16px rgba(6, 20, 46, 0.24) !important;
}

.bottom-stack .bottom-nav #shop-btn {
    background: linear-gradient(180deg, #ffe173 0%, #f5be24 100%) !important;
    color: #1f1d1a !important;
}

.bottom-stack .bottom-nav #clans-btn {
    background: linear-gradient(180deg, #9fddff 0%, #4b9ef5 100%) !important;
    color: #0f2a48 !important;
}

.bottom-stack .bottom-nav #leaderboard-btn {
    background: linear-gradient(180deg, #88efac 0%, #35c76e 100%) !important;
    color: #103223 !important;
}

@media (max-width: 420px) {
    :root {
        --hud-lane-left: 8px;
        --hud-lane-right: 8px;
        --hud-music-btn-size: 50px;
    }

    .stats-header {
        min-height: 58px;
        padding: 6px 8px 2px !important;
    }

    .stats-header-main {
        transform: translateY(0);
    }

    .stats-header-controls {
        transform: translateY(0);
        width: 50px;
        min-width: 50px;
        min-height: 50px;
    }

    .stats-header-controls .settings-btn.icon-btn {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        min-height: 50px !important;
        border-radius: 14px !important;
    }

    .top-music-strip {
        gap: 5px;
    }

    .music-nav-btn,
    .music-track-title {
        height: 30px;
    }

    .music-track-title {
        font-size: 10px;
    }

    .stats-header-main .profile-pic {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }

    .cookie-hp-container .cookie-hp-text,
    .xp-top-wrap .xp-strip-text {
        font-size: 10px;
    }
}

/* CSS podium under cookie (large floor, no wall) */
.arena {
    overflow: visible !important;
}

.arena::before {
    content: none;
}

.arena::after {
    content: none;
}

.cookie-podium {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    width: clamp(196px, 52vw, 286px);
    height: clamp(40px, 10.6vw, 56px);
    transform: translate(-50%, -50%) translateY(29px);
    transform-origin: center;
    will-change: transform;
}

.cookie-podium::before {
    content: '';
    position: absolute;
    top: calc(-1 * clamp(20px, 5.2vw, 28px));
    left: 0;
    width: 100%;
    height: clamp(40px, 10.8vw, 56px);
    background: var(--podium-top-gradient);
    border-radius: 50%;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -2px 4px rgba(164, 164, 164, 0.17);
    z-index: 3;
}

.cookie-podium::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--podium-side-gradient);
    border-radius: 0 0 50% 50% / 0 0 clamp(20px, 5.2vw, 30px) clamp(20px, 5.2vw, 30px);
    box-shadow: inset 0 -2px 3px rgba(128, 128, 128, 0.15);
    z-index: 2;
}

.cookie-podium-floor-shadow {
    position: absolute;
    bottom: calc(-1 * clamp(18px, 4.7vw, 26px));
    left: 5%;
    width: 90%;
    height: clamp(20px, 5.2vw, 28px);
    background: var(--podium-floor-shadow-gradient);
    border-radius: 50%;
    filter: blur(5px);
    z-index: 1;
}

.cookie-podium-floor-shadow::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(-1 * clamp(102px, 26vw, 156px));
    transform: translateX(-50%);
    width: 278%;
    height: clamp(176px, 44vw, 260px);
    background: var(--podium-aura-gradient);
    pointer-events: none;
    z-index: -2;
}

.cookie-podium-floor-shadow::before {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(-1 * clamp(126px, 32vw, 188px));
    transform: translateX(-50%);
    width: 248%;
    height: clamp(162px, 41vw, 242px);
    border-radius: 50%;
    background: var(--podium-floor-base-gradient);
    pointer-events: none;
    z-index: -3;
}

.cookie-podium-ring {
    display: none;
}

@keyframes podiumRingSpin {
    from {
        transform: translateX(-50%) rotate(0deg);
    }

    to {
        transform: translateX(-50%) rotate(360deg);
    }
}

.cookie-ground-shadow {
    z-index: 4 !important;
    width: clamp(124px, 33vw, 184px);
    height: clamp(15px, 4vw, 22px);
    border-radius: 50%;
    background: var(--podium-ground-shadow-gradient);
    filter: blur(1.2px) !important;
    opacity: 0.3;
    animation: none !important;
    will-change: transform, opacity;
}

@media (max-width: 420px) {
    .cookie-podium {
        width: clamp(168px, 50vw, 228px);
        height: clamp(34px, 9.8vw, 46px);
    }

    .cookie-podium::before {
        top: calc(-1 * clamp(16px, 4.9vw, 23px));
        height: clamp(34px, 10vw, 46px);
    }

    .cookie-podium-floor-shadow {
        filter: blur(4px);
    }

    .cookie-podium-floor-shadow::after {
        width: 250%;
        height: clamp(138px, 40vw, 210px);
        bottom: calc(-1 * clamp(88px, 25vw, 138px));
    }

    .cookie-podium-floor-shadow::before {
        width: 224%;
        height: clamp(128px, 37vw, 188px);
        bottom: calc(-1 * clamp(94px, 28vw, 138px));
    }

    .cookie-podium-ring {
        border-width: 1px;
    }

    .cookie-ground-shadow {
        width: clamp(108px, 31vw, 156px);
        height: clamp(12px, 3.7vw, 18px);
    }
}

/* ===== Modal + shop fit fixes ===== */
.modal .modal-content {
    position: relative !important;
    overflow-x: hidden !important;
    border: 3px solid rgba(233, 245, 255, 0.94) !important;
    border-radius: 16px !important;
    border-image: none !important;
    box-shadow: 0 10px 22px rgba(7, 22, 52, 0.36) !important;
    outline: none !important;
}

.modal .modal-content.nes-container,
.modal .modal-content.nes-container.is-rounded {
    border-image: none !important;
    box-shadow: 0 10px 22px rgba(7, 22, 52, 0.36) !important;
    border-radius: 16px !important;
}

.modal .modal-content::before,
.modal .modal-content::after {
    content: none !important;
    display: none !important;
}

.modal .modal-content.nes-container::before,
.modal .modal-content.nes-container::after,
.modal .modal-content.nes-container.is-rounded::before,
.modal .modal-content.nes-container.is-rounded::after {
    content: none !important;
    display: none !important;
}

.modal .close-btn.modal-close-floating {
    position: fixed !important;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid #ffffff;
    background: linear-gradient(180deg, #9fd4ff 0%, #69a8ea 100%);
    color: #f46056;
    box-shadow: 0 4px 0 rgba(7, 23, 52, 0.42), 0 8px 14px rgba(6, 20, 46, 0.24);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 23px;
    font-weight: 900;
    line-height: 1;
    z-index: 50;
    cursor: pointer;
    transform: translate(0, 0);
    user-select: none;
    opacity: 0;
    pointer-events: none;
    will-change: left, top, opacity;
    transition: left 120ms ease-out, top 120ms ease-out, opacity 110ms ease-out;
}

.modal .modal-content h2,
.modal .modal-content h3,
.modal .modal-content h4 {
    padding-right: 10px;
}

#shop-modal .modal-content {
    padding-top: 44px !important;
    overflow-y: hidden !important;
}

.shop-crumbs-tab {
    top: 8px;
    left: 12px;
    z-index: 35;
}

.shop-pane.active {
    padding: 3px 6px 8px 3px;
}

.shop-goods-grid {
    padding: 1px;
}

.shop-goods-grid .skin-card {
    position: relative;
    border-width: 2px;
    box-sizing: border-box;
    opacity: 0;
    animation: slideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    animation-delay: calc(var(--i) * 0.04s);
}

@keyframes slideIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.shop-goods-grid .skin-card.selected {
    border-color: rgba(125, 255, 177, 0.96) !important;
    box-shadow: inset 0 0 0 1px rgba(125, 255, 177, 0.62);
}

.shop-goods-grid .goods-kind-icon {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    background: rgba(12, 34, 73, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 2px 5px rgba(6, 16, 36, 0.24);
    z-index: 3;
    pointer-events: none;
}

/* Background cards must mirror actual themes */
.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-dots {
    background:
        radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.5) 0, rgba(255, 255, 255, 0) 26%),
        radial-gradient(circle at 82% 82%, rgba(255, 220, 110, 0.45) 0, rgba(255, 220, 110, 0) 30%),
        linear-gradient(165deg, #38b8ff 0%, #208df0 48%, #125fd0 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-dark {
    background:
        radial-gradient(circle at 20% 16%, rgba(156, 127, 255, 0.45) 0, rgba(156, 127, 255, 0) 30%),
        radial-gradient(circle at 82% 80%, rgba(87, 225, 255, 0.34) 0, rgba(87, 225, 255, 0) 24%),
        linear-gradient(160deg, #1f2c86 0%, #122267 55%, #0a1748 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-space {
    background:
        radial-gradient(circle at 16% 20%, rgba(255, 135, 215, 0.48) 0, rgba(255, 135, 215, 0) 28%),
        radial-gradient(circle at 80% 78%, rgba(106, 248, 255, 0.42) 0, rgba(106, 248, 255, 0) 26%),
        linear-gradient(160deg, #2d49bf 0%, #1a2f94 40%, #12226f 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-forest {
    background:
        radial-gradient(circle at 22% 18%, rgba(172, 255, 127, 0.45) 0, rgba(172, 255, 127, 0) 30%),
        radial-gradient(circle at 84% 82%, rgba(255, 224, 116, 0.34) 0, rgba(255, 224, 116, 0) 28%),
        linear-gradient(165deg, #37ab5d 0%, #1e8748 50%, #126439 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-sunset {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 225, 145, 0.52) 0, rgba(255, 225, 145, 0) 30%),
        radial-gradient(circle at 82% 80%, rgba(255, 119, 129, 0.38) 0, rgba(255, 119, 129, 0) 30%),
        linear-gradient(165deg, #ffb45f 0%, #ff7b72 48%, #b34fcd 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-ice {
    background:
        radial-gradient(circle at 18% 22%, rgba(225, 250, 255, 0.56) 0, rgba(225, 250, 255, 0) 34%),
        radial-gradient(circle at 82% 82%, rgba(143, 214, 255, 0.36) 0, rgba(143, 214, 255, 0) 30%),
        linear-gradient(165deg, #bdefff 0%, #89d0ff 45%, #5ba8e9 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-lava {
    background:
        radial-gradient(circle at 18% 20%, rgba(255, 179, 120, 0.5) 0, rgba(255, 179, 120, 0) 30%),
        radial-gradient(circle at 80% 82%, rgba(255, 90, 67, 0.36) 0, rgba(255, 90, 67, 0) 32%),
        linear-gradient(165deg, #ff8f4f 0%, #e44337 45%, #6f2038 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-aurora {
    background:
        radial-gradient(circle at 18% 16%, rgba(168, 255, 228, 0.45) 0, rgba(168, 255, 228, 0) 30%),
        radial-gradient(circle at 80% 82%, rgba(177, 157, 255, 0.36) 0, rgba(177, 157, 255, 0) 30%),
        linear-gradient(165deg, #46d4b9 0%, #2d8cd7 48%, #4e58c7 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-dune {
    background:
        radial-gradient(circle at 18% 16%, rgba(255, 238, 186, 0.48) 0, rgba(255, 238, 186, 0) 30%),
        radial-gradient(circle at 80% 82%, rgba(255, 171, 117, 0.36) 0, rgba(255, 171, 117, 0) 30%),
        linear-gradient(165deg, #f3ca7d 0%, #dd9e5f 48%, #9f6947 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-coral {
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 213, 190, 0.52) 0, rgba(255, 213, 190, 0) 32%),
        radial-gradient(circle at 82% 82%, rgba(255, 131, 155, 0.36) 0, rgba(255, 131, 155, 0) 30%),
        linear-gradient(165deg, #ffb185 0%, #ff7c8f 46%, #d74d80 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-twilight {
    background:
        radial-gradient(circle at 18% 18%, rgba(187, 196, 255, 0.52) 0, rgba(187, 196, 255, 0) 30%),
        radial-gradient(circle at 82% 84%, rgba(107, 184, 255, 0.34) 0, rgba(107, 184, 255, 0) 30%),
        linear-gradient(165deg, #5a68c9 0%, #394ba4 48%, #212f72 100%) !important;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-volt {
    background:
        radial-gradient(circle at 18% 18%, rgba(233, 255, 113, 0.52) 0, rgba(233, 255, 113, 0) 30%),
        radial-gradient(circle at 82% 82%, rgba(91, 255, 221, 0.35) 0, rgba(91, 255, 221, 0) 30%),
        linear-gradient(165deg, #74d640 0%, #2fb383 46%, #1f7175 100%) !important;
}

@media (max-width: 640px) {
    .modal .close-btn.modal-close-floating {
        width: 32px;
        height: 32px;
        font-size: 21px;
    }
}

/* === LOW POWER MODE OVERRIDES === */
body.low-power .glass-panel,
body.low-power .modal-content {
    backdrop-filter: none !important;
    background: rgba(30, 30, 40, 0.95) !important;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5) !important;
}

body.low-power .cookie-ground-shadow {
    filter: none !important;
    opacity: 0.3 !important;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.4) 0%, transparent 70%);
}

body.low-power .crumb {
    box-shadow: none !important;
}

body.low-power .particle {
    text-shadow: 1px 1px 0 #000 !important;
}

/* Reduced animation complexity */
body.low-power * {
    animation-duration: 0s !important;
    transition-duration: 0s !important;
}

/* Except crucial ones */
body.low-power .particle,
body.low-power .crumb {
    animation-duration: 0.7s !important;
    /* Restore particle anims */
}

/* === GLOBAL BUTTON STANDARDIZATION === */
.nes-btn,
.icon-btn,
.settings-btn,
.music-nav-btn {
    border-width: 3px !important;
    transition: transform 0.1s, box-shadow 0.1s !important;
}

.nes-btn:active,
.icon-btn:active,
.settings-btn:active,
.music-nav-btn:active {
    transform: translateY(3px) scale(0.98) !important;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2) !important;
}

/* Anime Background Preview */
.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-anime {
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 225, 145, 0.52) 0, rgba(255, 225, 145, 0) 30%),
        radial-gradient(circle at 82% 80%, rgba(255, 119, 129, 0.38) 0, rgba(255, 119, 129, 0) 30%),
        linear-gradient(165deg, #ffb45f 0%, #ff7b72 48%, #b34fcd 100%) !important;
    position: relative;
    overflow: hidden;
}

.shop-goods-grid .skin-preview.goods-preview-bg.bg-prev-anime::after {
    content: "愛";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: inherit;
    font-weight: 900;
    font-size: 20px;
    color: #40ceff;
    opacity: 0.8;
    text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* ============================
   BAN OVERLAY
   ============================ */
.ban-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(40, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 20px;
}

.ban-content {
    background: #000;
    border: 8px solid #ff0000;
    padding: 40px 20px;
    max-width: 90%;
    box-shadow: 0 0 30px #ff0000;
}

.ban-title {
    color: #ff0000;
    font-size: 24px !important;
    margin-bottom: 20px;
    font-family: 'Press Start 2P', cursive;
    text-shadow: 4px 4px 0 #330000;
}

.ban-message {
    color: #fff;
    font-size: 10px;
    line-height: 1.8;
    margin-bottom: 30px;
    font-family: 'Press Start 2P', cursive;
}

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

.ban-actions .nes-btn {
    width: 100%;
}

/* === Shop Preview Enhancements === */
.goods-preview-currency {
    background: radial-gradient(circle at center, #ffe173, #f5be24) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.goods-preview-chat {
    background: radial-gradient(circle at center, #9fddff, #4b9ef5) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.goods-preview-music {
    background: radial-gradient(circle at center, #f5cece, #ea7979) !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

/* === UPGRADE BUTTONS TEXT SIZE === */
.skins-market-block .upgrade-row .nes-btn {
    font-size: 16px !important;
    /* Increased from default */
    font-weight: bold;
    letter-spacing: 0.5px;
}