* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

:root {
    --bg-color: #e0e0e0;
    --grid-color: #ccc;
    --cyan: #0088aa;
    --yellow: #cc9900;
    --purple: #6600aa;
    --green: #00aa44;
    --red: #cc2222;
    --blue: #2255cc;
    --orange: #cc6600;
    --pink: #cc0088;
}

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

body {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    font-family: 'Press Start 2P', cursive;
    color: #111;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.short-i-fix {
    display: inline-block;
    line-height: 1;
    vertical-align: baseline;
    transform: translateY(0.02em) scale(1.1, 1.12);
    transform-origin: 50% 100%;
}

.short-i-fix-lower {
    transform: translateY(0.01em) scale(1.06, 1.08);
}

.crt-effect {
    position: relative;
    image-rendering: pixelated;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-wrapper {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

canvas#gameCanvas {
    display: block;
    background: #ffffff;
    border: 4px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    image-rendering: pixelated;
    transition: transform 45ms linear, box-shadow 120ms ease;
    will-change: transform, box-shadow;
}

.crt-effect::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.05) 100%);
    pointer-events: none;
    z-index: 100;
}

.scanlines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 120;
    opacity: 0;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(170, 255, 146, 0.08) 0,
            rgba(170, 255, 146, 0.08) 1px,
            rgba(5, 14, 8, 0.04) 1px,
            rgba(5, 14, 8, 0.04) 3px
        );
    mix-blend-mode: screen;
    transition: opacity 0.2s ease;
}

@keyframes scanline-move {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

.game-wrapper {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 190px;
    height: 100vh;
    justify-content: flex-start;
    padding: 10px 0;
}

body.in-menu .left-panel {
    display: none;
}

body.in-menu .hold-box,
body.in-menu .bonus-box {
    display: none;
}

.panel-box {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #ccc;
    border-radius: 4px;
    padding: 14px 12px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.1);
    min-width: 190px;
}

.panel-box h3 {
    font-size: 0.5rem;
    color: #666;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.panel-box .value {
    font-size: 0.9rem;
    color: var(--cyan);
    text-shadow: 0 0 10px var(--cyan);
}

.panel-box .value.best {
    color: var(--yellow);
    text-shadow: 0 0 10px var(--yellow);
}

.panel-box .value.level {
    color: var(--green);
    text-shadow: 0 0 10px var(--green);
}

.panel-box .value.timer {
    color: var(--orange);
    text-shadow: 0 0 10px var(--orange);
}

.panel-box.hidden {
    display: none;
}

.game-container {
    position: relative;
}

canvas#gameCanvas {
    display: block;
    background: rgba(240, 244, 250, 0.86);
    border: 4px solid #ccc;
    border-radius: 4px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.2),
        inset 0 0 50px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
}

canvas#nextCanvas {
    display: block;
    margin: 0 auto;
    background: #f0f0f0;
    border: 2px solid #ccc;
    border-radius: 4px;
    image-rendering: pixelated;
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    z-index: 50;
    border-radius: 4px;
}

.game-container .overlay {
    z-index: 60;
}

#menuOverlay {
    background: rgba(244, 249, 255, 0.72);
    backdrop-filter: blur(1.5px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 18px 12px;
    gap: 8px;
}

body.theme-neon #menuOverlay {
    background:
        radial-gradient(circle at 50% 18%, rgba(57, 246, 127, 0.2), transparent 42%),
        linear-gradient(180deg, rgba(6, 10, 20, 0.88), rgba(3, 7, 14, 0.9));
    backdrop-filter: blur(2px);
}

body.theme-neon #menuOverlay .title {
    color: #7cf8ff;
    text-shadow: 0 0 14px rgba(124, 248, 255, 0.75);
}

body.theme-neon #menuOverlay .subtitle {
    color: #ff6fb3;
    text-shadow: 0 0 10px rgba(255, 111, 179, 0.55);
}

body.theme-neon #menuOverlay .hint,
body.theme-neon #menuOverlay .controls-hint {
    color: #d0e9ff;
    text-shadow: 0 0 7px rgba(116, 208, 255, 0.35);
}

body.theme-neon #menuOverlay .mode-btn {
    background: rgba(7, 14, 26, 0.62);
    box-shadow: 0 0 0 1px rgba(110, 246, 255, 0.18) inset;
}

body.theme-neon #menuOverlay .mode-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 14px rgba(116, 248, 255, 0.35),
        0 0 0 1px rgba(110, 246, 255, 0.32) inset;
}

body.theme-neon #menuOverlay .mode-classic-btn:hover {
    background: linear-gradient(180deg, #63dcff, #2ca7d5);
    color: #07131f;
    border-color: #8ae8ff;
    box-shadow:
        0 0 20px rgba(99, 220, 255, 0.62),
        0 0 0 1px rgba(212, 250, 255, 0.72) inset;
}

body.theme-neon #menuOverlay .mode-sprint-btn:hover {
    background: linear-gradient(180deg, #ffc66b, #ff9f2f);
    color: #241101;
    border-color: #ffd99d;
    box-shadow:
        0 0 20px rgba(255, 183, 88, 0.62),
        0 0 0 1px rgba(255, 238, 204, 0.68) inset;
}

body.theme-neon #menuOverlay .mode-zombie-btn:hover {
    background: linear-gradient(180deg, #83f58f, #4bbd50);
    color: #041606;
    border-color: #a9ffb3;
    box-shadow:
        0 0 20px rgba(93, 245, 121, 0.6),
        0 0 0 1px rgba(220, 255, 225, 0.7) inset;
}

body.theme-paper #menuOverlay {
    background:
        radial-gradient(circle at 50% 16%, rgba(255, 236, 191, 0.42), transparent 45%),
        linear-gradient(180deg, rgba(252, 245, 232, 0.92), rgba(242, 231, 212, 0.92));
    backdrop-filter: blur(0.8px);
}

body.theme-paper #menuOverlay .title {
    color: #8a4f2c;
    text-shadow: 0 0 8px rgba(170, 107, 60, 0.35);
}

body.theme-paper #menuOverlay .subtitle {
    color: #b06a4a;
    text-shadow: 0 0 6px rgba(176, 106, 74, 0.25);
}

body.theme-paper #menuOverlay .hint,
body.theme-paper #menuOverlay .controls-hint {
    color: #7b5a3b;
}

body.theme-paper #menuOverlay .mode-btn {
    background: rgba(255, 249, 238, 0.78);
    box-shadow: 0 0 0 1px rgba(170, 128, 88, 0.22) inset;
}

body.theme-paper #menuOverlay .mode-btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 10px rgba(168, 130, 94, 0.22),
        0 0 0 1px rgba(170, 128, 88, 0.34) inset;
}

/* Keep main-menu structure consistent across all themes. */
body.theme-crt #menuOverlay,
body.theme-neon #menuOverlay,
body.theme-paper #menuOverlay {
    padding-top: 20px;
    padding-bottom: 20px;
    justify-content: center;
    overflow-y: auto;
    gap: 0;
}

body.theme-crt #menuOverlay .title,
body.theme-neon #menuOverlay .title,
body.theme-paper #menuOverlay .title {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding-inline: 14px;
    font-size: clamp(1.02rem, 4.2vw, 1.82rem);
    margin-top: 10px;
    margin-bottom: 12px;
    white-space: nowrap;
    line-height: 1.05;
    letter-spacing: 0.2px;
    text-align: center;
}

body.theme-crt #menuOverlay .subtitle,
body.theme-neon #menuOverlay .subtitle,
body.theme-paper #menuOverlay .subtitle {
    margin-bottom: 20px;
}

body.theme-crt #menuOverlay .menu-buttons,
body.theme-neon #menuOverlay .menu-buttons,
body.theme-paper #menuOverlay .menu-buttons {
    margin-top: 16px;
    margin-bottom: 14px;
    gap: 12px;
}

body.theme-crt #menuOverlay .menu-secondary,
body.theme-neon #menuOverlay .menu-secondary,
body.theme-paper #menuOverlay .menu-secondary {
    margin: 10px 0 0;
}

body.theme-crt #menuOverlay .menu-leaderboard,
body.theme-neon #menuOverlay .menu-leaderboard,
body.theme-paper #menuOverlay .menu-leaderboard {
    margin-top: 30px;
    min-height: 252px;
    padding: 10px 12px;
}

body.theme-crt #menuOverlay .lb-head,
body.theme-neon #menuOverlay .lb-head,
body.theme-paper #menuOverlay .lb-head {
    margin-bottom: 6px;
}

body.theme-crt #menuOverlay .lb-list,
body.theme-neon #menuOverlay .lb-list,
body.theme-paper #menuOverlay .lb-list {
    gap: 6px;
}

body.theme-crt #menuOverlay .lb-row,
body.theme-neon #menuOverlay .lb-row,
body.theme-paper #menuOverlay .lb-row {
    padding: 6px 9px;
}

body.theme-crt #menuOverlay .lb-best,
body.theme-neon #menuOverlay .lb-best,
body.theme-paper #menuOverlay .lb-best {
    margin-top: 6px;
    gap: 5px;
}

body.theme-crt #menuOverlay .lb-best-item,
body.theme-neon #menuOverlay .lb-best-item,
body.theme-paper #menuOverlay .lb-best-item {
    padding: 5px 3px;
}

/* Neon main-menu panel styles to match classic-level polish */
body.theme-neon #menuOverlay .secondary-btn {
    border-color: #45ef9a;
    color: #91ffc8;
    background: rgba(6, 19, 14, 0.54);
}

body.theme-neon #menuOverlay .secondary-btn:hover {
    background: #45ef9a;
    color: #032013;
    box-shadow: 0 0 14px rgba(69, 239, 154, 0.52);
}

body.theme-neon #menuOverlay .menu-leaderboard {
    background: linear-gradient(180deg, rgba(6, 24, 22, 0.86), rgba(3, 16, 15, 0.86));
    border-color: rgba(85, 229, 168, 0.42);
    color: #9ff2d2;
    box-shadow:
        0 0 0 1px rgba(128, 255, 199, 0.13) inset,
        0 12px 24px rgba(0, 0, 0, 0.34);
}

body.theme-neon #menuOverlay .lb-head strong,
body.theme-neon #menuOverlay .lb-sub {
    color: #87ddb9;
}

/* Paper main-menu panel styles to match classic-level polish */
body.theme-paper #menuOverlay .secondary-btn {
    border-color: #b9895f;
    color: #946447;
    background: rgba(255, 247, 229, 0.74);
}

body.theme-paper #menuOverlay .secondary-btn:hover {
    background: #c99769;
    color: #2f1b0d;
    box-shadow: 0 0 12px rgba(187, 137, 95, 0.46);
}

body.theme-paper #menuOverlay .menu-leaderboard {
    background: linear-gradient(180deg, rgba(255, 249, 236, 0.88), rgba(245, 234, 214, 0.88));
    border-color: rgba(168, 124, 84, 0.46);
    color: #7a5438;
    box-shadow:
        0 0 0 1px rgba(181, 134, 92, 0.12) inset,
        0 10px 22px rgba(83, 56, 35, 0.2);
}

body.theme-paper #menuOverlay .lb-head strong,
body.theme-paper #menuOverlay .lb-sub {
    color: #855636;
}

.overlay.hidden {
    display: none;
}

.overlay h1.title {
    font-size: 2rem;
    color: var(--cyan);
    animation: title-pulse 2s ease-in-out infinite;
    margin-bottom: 5px;
}

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

.overlay h2 {
    font-size: 1.2rem;
    color: var(--red);
    text-shadow: 0 0 10px var(--red);
    margin-bottom: 20px;
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.overlay h2.gameover-title {
    color: var(--red);
    animation: none;
}

.subtitle {
    font-size: 0.6rem;
    color: var(--pink);
    margin-bottom: 30px;
    letter-spacing: 4px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 12px;
}

.menu-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.6rem;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid var(--cyan);
    color: var(--cyan);
    cursor: pointer;
    transition: all 0.1s;
    border-radius: 4px;
}

.menu-btn:hover {
    background: var(--cyan);
    color: #000;
    box-shadow: 0 0 20px var(--cyan);
}

.menu-btn:active {
    transform: scale(0.95);
}

.hint {
    font-size: 0.5rem;
    color: #444;
    animation: blink 1.5s step-end infinite;
    margin: 8px 0 0;
    text-align: center;
}

.controls-hint {
    font-size: 0.4rem;
    color: #333;
    text-align: center;
}

.final-score {
    text-align: center;
    margin-bottom: 20px;
}

.final-score p {
    font-size: 0.6rem;
    color: #888;
    margin: 8px 0;
}

.final-score span {
    color: var(--yellow);
}

.sound-btn {
    font-size: 1rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.1s;
}

.sound-btn:active {
    transform: scale(0.9);
}

.bonus-icons {
    display: flex;
    gap: 5px;
    justify-content: center;
    flex-wrap: wrap;
    min-height: 30px;
}

.bonus-icon {
    font-size: 1rem;
    animation: bonus-pop 0.3s ease-out;
}

@keyframes bonus-pop {
    0% { transform: scale(0); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.mobile-controls {
    display: none;
    position: fixed;
    bottom: 10px;
    left: 0;
    right: 0;
    padding: 0 12px;
    z-index: 200;
    pointer-events: none;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.mobile-left, .mobile-right, .mobile-center {
    display: flex;
    gap: 8px;
    pointer-events: auto;
}

.mobile-btn {
    font-family: 'Press Start 2P', cursive;
    font-size: 0.78rem;
    width: 56px;
    height: 56px;
    background: color-mix(in srgb, var(--panel-bg) 80%, black 20%);
    border: 2px solid var(--panel-border);
    border-radius: 10px;
    color: var(--panel-label);
    cursor: pointer;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 70ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.24);
}

.mobile-btn.is-pressed,
.mobile-btn:active {
    transform: translateY(1px) scale(0.97);
    background: color-mix(in srgb, var(--panel-bg) 65%, var(--accent-main) 35%);
    border-color: var(--accent-main);
    box-shadow: 0 0 16px color-mix(in srgb, var(--accent-main) 40%, transparent);
}

.mobile-right .mobile-btn.big {
    width: 84px;
    font-size: 0.58rem;
    letter-spacing: 0.4px;
}

.mobile-btn.big {
    width: 68px;
    height: 68px;
    font-size: 0.92rem;
}

@media (max-width: 600px) {
    .game-wrapper {
        flex-direction: column;
        align-items: center;
    }
    
    .side-panel {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        min-width: auto;
    }
    
    .panel-box {
        min-width: 70px;
        padding: 8px;
    }
    
    .panel-box .value {
        font-size: 0.7rem;
    }
    
    canvas#gameCanvas {
        width: 240px;
        height: 400px;
    }
}

@media (max-width: 900px), (pointer: coarse) {
    .mobile-controls {
        display: flex;
    }
}

.particles-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 0;
}

@keyframes particle-fly {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) rotate(720deg);
    }
}

.level-up-flash {
    animation: level-flash 0.5s ease-out;
}

@keyframes level-flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(2); }
    100% { filter: brightness(1); }
}

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

body {
    margin: 0;
    min-height: 100vh;
    align-items: stretch;
}

.crt-effect {
    width: 100vw;
    height: 100vh;
}

.game-wrapper {
    width: 100%;
    height: 100%;
    padding: 0;
    gap: 12px;
    align-items: stretch;
    justify-content: center;
}

.game-container {
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.game-container::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, rgba(244, 248, 255, 0.02) 40%, rgba(58, 79, 108, 0.22) 100%),
        linear-gradient(90deg, rgba(48, 72, 102, 0.26) 0%, rgba(48, 72, 102, 0.06) 16%, rgba(48, 72, 102, 0.06) 84%, rgba(48, 72, 102, 0.26) 100%),
        linear-gradient(180deg, rgba(244, 248, 255, 0.98), rgba(228, 236, 247, 0.98));
}

.game-container::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
    background-image:
        linear-gradient(rgba(73, 101, 136, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(73, 101, 136, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
}

body.mode-classic .game-container::after {
    opacity: 0.52;
    background-image:
        radial-gradient(circle at 50% 22%, rgba(86, 201, 255, 0.14), transparent 34%),
        linear-gradient(rgba(73, 101, 136, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(73, 101, 136, 0.06) 1px, transparent 1px);
    background-size: auto, 24px 24px, 24px 24px;
}

body.mode-classic.theme-crt {
    --bg-color: #0a120c;
    --panel-bg: rgba(13, 21, 14, 0.92);
    --panel-border: #4e7751;
    --panel-label: #99bb87;
    --accent-main: #a1db80;
    --accent-alt: #d0b66f;
    --board-bg: #0b160d;
    --grid-line: rgba(142, 201, 129, 0.13);
    --preview-bg: #09120b;
    --modal-bg: linear-gradient(180deg, rgba(12, 22, 13, 0.96), rgba(8, 15, 9, 0.96));
    --modal-border: #85bf6f;
    --modal-title: #bde59f;
    --modal-text: #d7efc8;
    --modal-subtext: #9fc089;
    --modal-panel-bg: rgba(10, 20, 11, 0.82);
    --modal-panel-border: rgba(122, 167, 102, 0.5);
    --modal-accent: #bde59f;
    --modal-danger: #cf7f68;
}

body.mode-sprint .game-container::after {
    opacity: 0.86;
    background-image:
        radial-gradient(circle at 52% 44%, rgba(255, 166, 74, 0.2), rgba(95, 45, 12, 0.08) 52%, transparent 78%),
        repeating-linear-gradient(125deg, rgba(255, 169, 63, 0.13) 0 12px, rgba(255, 111, 36, 0.07) 12px 24px),
        linear-gradient(rgba(221, 132, 74, 0.11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(221, 132, 74, 0.11) 1px, transparent 1px);
    background-size: auto, auto, 26px 26px, 26px 26px;
    animation: sprintCenterFlow 0.95s linear infinite;
}

body.mode-zombie .game-container::after {
    opacity: 0.86;
    background-image:
        radial-gradient(circle at 50% 52%, rgba(139, 255, 120, 0.23), rgba(19, 58, 21, 0.14) 48%, transparent 78%),
        repeating-linear-gradient(0deg, rgba(126, 229, 113, 0.1) 0 2px, rgba(10, 26, 12, 0) 2px 6px),
        linear-gradient(rgba(124, 197, 111, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 197, 111, 0.12) 1px, transparent 1px);
    background-size: auto, auto, 28px 28px, 28px 28px;
    animation: zombieCenterPulse 1.3s ease-in-out infinite;
}

@keyframes sprintCenterFlow {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 180px 0, 0 0, 0 0; }
}

@keyframes zombieCenterPulse {
    0%, 100% { opacity: 0.52; }
    50% { opacity: 0.72; }
}

.game-container > canvas {
    position: relative;
    z-index: 1;
}

canvas#gameCanvas {
    width: calc(100vh / 2);
    height: 100vh;
    max-height: 100vh;
}

.overlay {
    border-radius: 0;
}

@media (max-width: 900px) {
    .left-panel {
        position: fixed;
        top: 8px;
        left: 8px;
        right: 8px;
        z-index: 95;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
        min-width: 0;
        height: auto;
        padding: 0;
    }

    .left-panel .panel-box {
        min-width: 0;
        padding: 7px 4px 6px;
    }

    .left-panel .panel-box h3 {
        font-size: 0.35rem;
        letter-spacing: 0.8px;
        margin-bottom: 4px;
    }

    .left-panel .panel-box .value {
        font-size: 0.56rem;
    }

    .left-panel .combo-indicator {
        display: none;
    }

    .right-panel {
        display: none;
    }

    canvas#gameCanvas {
        width: min(100vw, calc(100vh / 2));
    }
}

body.theme-crt {
    --bg-color: #d8dadc;
    --panel-bg: rgba(248, 248, 248, 0.92);
    --panel-border: #b5b8bd;
    --panel-label: #5a6270;
    --accent-main: #0b8cb5;
    --accent-alt: #d18416;
    --board-bg: #f1f3f4;
    --grid-line: rgba(70, 82, 91, 0.15);
    --preview-bg: #0d1220;
    --modal-bg: linear-gradient(180deg, rgba(17, 29, 45, 0.94), rgba(9, 17, 30, 0.94));
    --modal-border: #4bb6ff;
    --modal-title: #66d4ff;
    --modal-text: #d8edff;
    --modal-subtext: #9ecbe7;
    --modal-panel-bg: rgba(8, 15, 25, 0.6);
    --modal-panel-border: rgba(98, 151, 196, 0.45);
    --modal-accent: #65ecff;
    --modal-danger: #ff6b7a;
}

body.theme-neon {
    --bg-color: #060b18;
    --panel-bg: rgba(8, 14, 28, 0.86);
    --panel-border: #22d1e8;
    --panel-label: #8ef4ff;
    --accent-main: #37f67f;
    --accent-alt: #ff6f91;
    --board-bg: #040915;
    --grid-line: rgba(55, 246, 127, 0.24);
    --preview-bg: #03060f;
    --modal-bg: linear-gradient(180deg, rgba(5, 11, 23, 0.95), rgba(2, 7, 16, 0.95));
    --modal-border: #37f67f;
    --modal-title: #7affbd;
    --modal-text: #d6ffe8;
    --modal-subtext: #9cf4c5;
    --modal-panel-bg: rgba(5, 18, 16, 0.62);
    --modal-panel-border: rgba(55, 246, 127, 0.46);
    --modal-accent: #42ffd2;
    --modal-danger: #ff5e96;
}

body.theme-paper {
    --bg-color: #f2e9de;
    --panel-bg: rgba(255, 250, 240, 0.94);
    --panel-border: #b6895d;
    --panel-label: #7a5330;
    --accent-main: #c7542f;
    --accent-alt: #4770b5;
    --board-bg: #fff8ef;
    --grid-line: rgba(126, 94, 66, 0.15);
    --preview-bg: #f2e4d0;
    --modal-bg: linear-gradient(180deg, rgba(255, 248, 234, 0.96), rgba(244, 232, 209, 0.96));
    --modal-border: #b6895d;
    --modal-title: #8a4f2c;
    --modal-text: #6e4f36;
    --modal-subtext: #8c6442;
    --modal-panel-bg: rgba(255, 246, 226, 0.72);
    --modal-panel-border: rgba(169, 126, 84, 0.45);
    --modal-accent: #c7542f;
    --modal-danger: #b54b4b;
}

body {
    background: var(--bg-color);
}

.crt-effect {
    background:
        radial-gradient(circle at 25% 18%, rgba(255, 255, 255, 0.25), transparent 42%),
        linear-gradient(170deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.08));
}

.crt-effect::before {
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.12));
}

.crt-effect::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.75;
}

body.mode-classic .crt-effect::after {
    background:
        radial-gradient(circle at 20% 25%, rgba(120, 203, 255, 0.16), transparent 30%),
        radial-gradient(circle at 80% 75%, rgba(168, 255, 204, 0.16), transparent 34%);
    animation: classicDrift 16s ease-in-out infinite alternate;
}

body.mode-classic.theme-crt .scanlines {
    opacity: 0.9;
    animation: scanline-move 8s linear infinite;
}

body.mode-classic.theme-crt .crt-effect {
    background:
        radial-gradient(circle at 50% 16%, rgba(138, 214, 120, 0.14), transparent 36%),
        radial-gradient(circle at 50% 78%, rgba(48, 88, 52, 0.26), transparent 48%),
        linear-gradient(180deg, rgba(7, 14, 8, 0.96), rgba(3, 8, 4, 0.96));
}

body.mode-classic.theme-crt .game-container::before {
    background:
        radial-gradient(circle at 50% 24%, rgba(172, 245, 146, 0.07), transparent 42%),
        linear-gradient(180deg, rgba(9, 17, 10, 0.88), rgba(4, 10, 6, 0.9));
}

body.mode-classic.theme-crt .game-container::after {
    opacity: 0.86;
    background-image:
        repeating-linear-gradient(0deg, rgba(147, 209, 129, 0.07) 0 2px, rgba(7, 16, 9, 0) 2px 4px),
        linear-gradient(rgba(147, 209, 129, 0.11) 1px, transparent 1px),
        linear-gradient(90deg, rgba(147, 209, 129, 0.11) 1px, transparent 1px);
    background-size: auto, 32px 32px, 32px 32px;
    animation: none;
}

body.mode-classic.theme-crt #menuOverlay {
    background:
        radial-gradient(circle at 50% 18%, rgba(160, 230, 140, 0.15), transparent 34%),
        linear-gradient(180deg, rgba(8, 17, 10, 0.78), rgba(6, 12, 7, 0.84));
    backdrop-filter: blur(1px);
}

body.mode-classic.theme-crt #menuOverlay .title {
    color: #b2df8f;
    text-shadow: 0 0 12px rgba(166, 228, 129, 0.55);
}

body.mode-classic.theme-crt #menuOverlay .subtitle {
    color: #d8c27e;
    text-shadow: 0 0 8px rgba(216, 194, 126, 0.35);
}

body.mode-classic.theme-crt #menuOverlay .hint,
body.mode-classic.theme-crt #menuOverlay .controls-hint {
    color: #b2cba4;
}

body.mode-classic.theme-crt .panel-box {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.2), 0 10px 18px rgba(0, 0, 0, 0.38);
}

body.mode-classic.theme-crt .mode-classic-btn {
    border-color: #9dcb79;
    color: #bde59f;
    background: rgba(16, 31, 17, 0.62);
}

body.mode-classic.theme-crt .mode-classic-btn:hover {
    background: #9dcb79;
    color: #0d1a0e;
}

body.mode-classic.theme-crt .mode-sprint-btn,
body.mode-classic.theme-crt .mode-zombie-btn {
    background: rgba(13, 24, 14, 0.5);
}

body.mode-sprint .crt-effect::after {
    background:
        repeating-linear-gradient(115deg, rgba(255, 190, 109, 0.08) 0 14px, rgba(0, 0, 0, 0.02) 14px 28px),
        linear-gradient(90deg, rgba(255, 168, 79, 0.3), rgba(255, 106, 58, 0.18));
    animation: sprintRush 0.85s linear infinite;
}

body.mode-sprint {
    --panel-bg: rgba(33, 19, 11, 0.9);
    --panel-border: #d47c2d;
    --panel-label: #ffc188;
    --accent-main: #ff9c3f;
    --accent-alt: #ffe078;
    --board-bg: #1a100a;
    --grid-line: rgba(255, 169, 91, 0.16);
    --preview-bg: #170d08;
    background: radial-gradient(circle at 50% 44%, #4b230d 0%, #231208 52%, #120905 100%);
}

body.mode-sprint .scanlines {
    opacity: 0.72;
    animation: scanline-move 4s linear infinite;
}

body.mode-sprint .crt-effect {
    background:
        radial-gradient(circle at 20% 24%, rgba(255, 167, 77, 0.2), transparent 38%),
        radial-gradient(circle at 80% 74%, rgba(255, 126, 58, 0.18), transparent 42%),
        linear-gradient(180deg, rgba(43, 20, 10, 0.9), rgba(20, 10, 6, 0.95));
}

body.mode-sprint .game-container::before {
    background:
        radial-gradient(circle at 50% 22%, rgba(255, 171, 98, 0.14), transparent 42%),
        linear-gradient(180deg, rgba(31, 17, 10, 0.85), rgba(16, 9, 6, 0.9));
}

body.mode-sprint canvas#gameCanvas {
    box-shadow:
        0 0 18px rgba(255, 151, 68, 0.24),
        inset 0 0 30px rgba(148, 68, 26, 0.34);
    border-color: #d47c2d;
}

body.mode-sprint .timer-box .value.timer {
    color: #ffb347;
    text-shadow: 0 0 12px rgba(255, 158, 66, 0.7);
}

body.mode-zombie .crt-effect::after {
    background:
        radial-gradient(circle at 52% 46%, rgba(155, 255, 122, 0.2), rgba(8, 28, 10, 0.8) 55%),
        radial-gradient(circle at 14% 22%, rgba(76, 198, 86, 0.28), transparent 30%),
        radial-gradient(circle at 86% 76%, rgba(108, 255, 142, 0.22), transparent 32%),
        repeating-linear-gradient(0deg, rgba(136, 244, 114, 0.14) 0 2px, rgba(7, 20, 8, 0.04) 2px 7px);
    animation: zombiePulse 1.8s ease-in-out infinite;
}

body.mode-zombie {
    --panel-bg: rgba(7, 19, 11, 0.92);
    --panel-border: #4f8a49;
    --panel-label: #a6de97;
    --accent-main: #97ff7f;
    --accent-alt: #d8ef73;
    --board-bg: #071109;
    --grid-line: rgba(149, 223, 128, 0.19);
    --preview-bg: #060f08;
    background:
        radial-gradient(circle at 50% 50%, #1d3f22 0%, #0d2112 40%, #061209 70%, #030904 100%),
        repeating-linear-gradient(135deg, rgba(111, 199, 104, 0.05) 0 24px, rgba(0, 0, 0, 0.06) 24px 48px);
}

body.mode-zombie .crt-effect {
    background:
        radial-gradient(circle at 18% 24%, rgba(132, 255, 116, 0.22), transparent 36%),
        radial-gradient(circle at 84% 70%, rgba(72, 209, 96, 0.2), transparent 38%),
        radial-gradient(circle at 46% 82%, rgba(54, 132, 62, 0.28), transparent 42%),
        linear-gradient(180deg, rgba(8, 26, 11, 0.94), rgba(4, 12, 6, 0.96));
}

body.mode-zombie .scanlines {
    opacity: 0.82;
    animation: scanline-move 6s linear infinite;
}

body.mode-zombie .game-container::before {
    background:
        radial-gradient(circle at 52% 24%, rgba(138, 235, 114, 0.18), transparent 40%),
        radial-gradient(circle at 30% 78%, rgba(63, 140, 70, 0.18), transparent 44%),
        linear-gradient(180deg, rgba(8, 18, 10, 0.9), rgba(4, 10, 6, 0.92));
}

body.mode-zombie canvas#gameCanvas {
    box-shadow:
        0 0 22px rgba(132, 240, 114, 0.28),
        0 0 40px rgba(86, 194, 83, 0.16),
        inset 0 0 36px rgba(50, 123, 53, 0.42);
    border-color: #5b9a55;
}

body.mode-zombie .meter-fill {
    background: linear-gradient(90deg, #6fd65c, #b5da5b, #ff8058);
}

@keyframes classicDrift {
    0% { transform: translateY(-8px); }
    100% { transform: translateY(8px); }
}

@keyframes sprintRush {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 240px 0, 0 0; }
}

@keyframes zombiePulse {
    0%, 100% { opacity: 0.55; }
    50% { opacity: 0.9; }
}

.game-wrapper, .game-container, .side-panel, .panel-box {
    position: relative;
    z-index: 1;
}

.panel-box {
    background: var(--panel-bg);
    border: 2px solid var(--panel-border);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08), 0 10px 22px rgba(0, 0, 0, 0.18);
}

.panel-box h3 {
    color: var(--panel-label);
    font-size: 0.56rem;
}

.panel-box .value {
    color: var(--accent-main);
    text-shadow: 0 0 10px color-mix(in srgb, var(--accent-main) 55%, transparent);
}

.panel-box .value.best {
    color: var(--accent-alt);
    text-shadow: 0 0 10px color-mix(in srgb, var(--accent-alt) 50%, transparent);
}

canvas#nextCanvas,
canvas#holdCanvas {
    border: 2px solid color-mix(in srgb, var(--panel-border) 80%, black 20%);
    background: var(--preview-bg);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.35);
}

.next-box h3, .hold-box h3 {
    font-size: 0.64rem;
    letter-spacing: 1.6px;
}

.combo-indicator {
    min-height: 14px;
    margin-top: 8px;
    font-size: 0.42rem;
    color: transparent;
    transition: all 120ms ease;
}

.combo-indicator.active {
    color: var(--accent-alt);
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent-alt) 45%, transparent);
    transform: scale(1.04);
}

.combo-indicator.combo-fx {
    --combo-power: 1;
    animation: combo-pop 180ms ease-out;
    filter: saturate(calc(1 + var(--combo-power) * 0.08));
}

.combo-indicator.combo-fx-b2b {
    color: #ffe171;
    text-shadow: 0 0 10px rgba(255, 225, 113, 0.55), 0 0 18px rgba(255, 241, 171, 0.42);
}

@keyframes combo-pop {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }
    50% {
        transform: scale(calc(1 + var(--combo-power) * 0.045));
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

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

.sound-meter {
    height: 16px;
    display: flex;
    align-items: flex-end;
    gap: 3px;
}

.sound-bar {
    width: 4px;
    border-radius: 2px 2px 0 0;
    background: color-mix(in srgb, var(--panel-border) 60%, transparent);
}

.sound-bar:nth-child(1) { height: 5px; }
.sound-bar:nth-child(2) { height: 8px; }
.sound-bar:nth-child(3) { height: 12px; }
.sound-bar:nth-child(4) { height: 9px; }
.sound-bar:nth-child(5) { height: 6px; }

.sound-bar.active {
    background: var(--accent-main);
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent-main) 70%, transparent);
}

.sound-btn.muted {
    opacity: 0.5;
}

.theme-select {
    width: 100%;
    background: color-mix(in srgb, var(--panel-bg) 88%, black 12%);
    color: var(--panel-label);
    border: 2px solid var(--panel-border);
    font-family: 'Press Start 2P', cursive;
    font-size: 0.5rem;
    padding: 6px 4px;
    outline: none;
}

.mode-btn {
    display: grid;
    gap: 8px;
    min-width: 300px;
    text-align: center;
    border-width: 3px;
    padding: 20px 24px;
}

.mode-name {
    font-size: 1.02rem;
}

.mode-desc {
    font-size: 0.58rem;
    opacity: 0.9;
    letter-spacing: 1.6px;
}

.mode-classic-btn {
    border-color: #2ca7d5;
    color: #2ca7d5;
}

.mode-sprint-btn {
    border-color: #ff9f2f;
    color: #ff9f2f;
}

.mode-zombie-btn {
    border-color: #4bbd50;
    color: #4bbd50;
}

.mode-classic-btn:hover {
    background: #2ca7d5;
    color: #0d1219;
}

.mode-sprint-btn:hover {
    background: #ff9f2f;
    color: #1f1305;
}

.mode-zombie-btn:hover {
    background: #4bbd50;
    color: #0a1609;
}


#gameoverOverlay {
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 50% 12%, rgba(255, 236, 171, 0.2), transparent 38%),
        linear-gradient(180deg, rgba(12, 18, 26, 0.78), rgba(8, 12, 18, 0.84));
    backdrop-filter: blur(2px);
}

.gameover-card {
    width: min(100%, 332px);
    border: 4px solid #ffd36a;
    background:
        linear-gradient(180deg, rgba(255, 252, 241, 0.96), rgba(239, 244, 252, 0.96));
    box-shadow:
        0 0 0 3px #223348 inset,
        0 16px 30px rgba(0, 0, 0, 0.42);
    padding: 16px 14px 14px;
    display: grid;
    gap: 12px;
    position: relative;
}

.gameover-card::after {
    content: '';
    position: absolute;
    inset: 8px;
    border: 2px dashed rgba(32, 56, 82, 0.35);
    pointer-events: none;
}

.gameover-kicker {
    text-align: center;
    font-size: 0.42rem;
    letter-spacing: 2.5px;
    color: #3f5f86;
    margin-top: 2px;
}

.overlay h2.gameover-title {
    margin: 0 auto;
    text-align: center;
    font-size: 1.14rem;
    color: #f7f9ff;
    background: linear-gradient(90deg, #2d4f79, #335d92);
    border: 3px solid #1a304d;
    padding: 8px 16px 6px;
    text-shadow: none;
}

.overlay h2.gameover-title.sprint-ended {
    font-size: 0.84rem;
    white-space: nowrap;
    letter-spacing: 0.4px;
}

.gameover-grid {
    display: grid;
    gap: 8px;
}

.gameover-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 3px solid rgba(54, 85, 124, 0.55);
    padding: 9px 10px 8px;
    background: linear-gradient(90deg, rgba(235, 242, 252, 0.96), rgba(220, 232, 247, 0.96));
}

.stat-label {
    font-size: 0.48rem;
    color: #38567a;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 0.74rem;
    color: #1a2f4e;
    text-shadow: none;
}

.gameover-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gameover-btn {
    width: 100%;
    font-size: 0.58rem;
    border-width: 3px;
    padding: 10px 10px;
}

.restart-btn {
    border-color: #1f8f66;
    color: #1f8f66;
}

.restart-btn:hover {
    background: #1f8f66;
    color: #eafff7;
}

.menu-return-btn {
    border-color: #2f6fb3;
    color: #2f6fb3;
}

.menu-return-btn:hover {
    background: #2f6fb3;
    color: #f3f9ff;
}

@media (max-width: 520px) {
    .gameover-actions {
        grid-template-columns: 1fr;
    }
}

.menu-secondary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 14px 0;
}

.secondary-btn {
    font-size: 0.5rem;
    padding: 10px 13px;
}

#sprintGoalBtn {
    border-color: #ffb347;
    color: #ffb347;
}

#sprintGoalBtn:hover {
    background: #ffb347;
    color: #1f1305;
    box-shadow: 0 0 14px rgba(255, 179, 71, 0.45);
}

.menu-leaderboard,
.menu-achievements {
    width: min(98%, 620px);
    font-size: 0.52rem;
    color: #33506f;
    text-align: left;
    line-height: 1.6;
    background: rgba(255, 255, 255, 0.45);
    border: 2px solid rgba(102, 133, 170, 0.25);
    padding: 16px 18px;
    margin-top: 22px;
}

.menu-leaderboard {
    min-height: 286px;
    display: flex;
    flex-direction: column;
}

.menu-achievements {
    margin-top: 12px;
    margin-bottom: 8px;
}

.lb-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.lb-sub {
    font-size: 0.42rem;
    letter-spacing: 1px;
    opacity: 0.75;
}

.lb-list {
    display: grid;
    gap: 8px;
    flex: 1;
    align-content: start;
}

.lb-row {
    display: grid;
    grid-template-columns: 58px 1fr auto 58px;
    gap: 8px;
    align-items: center;
    border: 2px solid rgba(101, 130, 162, 0.24);
    background: rgba(255, 255, 255, 0.62);
    padding: 8px 11px;
}

body.theme-crt #menuOverlay {
    padding-top: 20px;
    padding-bottom: 20px;
    justify-content: center;
    overflow-y: auto;
    gap: 0;
}

body.theme-crt #menuOverlay .title {
    margin-top: 10px;
    margin-bottom: 12px;
}

body.theme-crt #menuOverlay .subtitle {
    margin-bottom: 20px;
}

body.theme-crt #menuOverlay .menu-buttons {
    margin-top: 16px;
    margin-bottom: 14px;
    gap: 12px;
}

body.theme-crt #menuOverlay .mode-btn {
    background: linear-gradient(180deg, rgba(20, 38, 23, 0.78), rgba(12, 23, 14, 0.78));
    box-shadow: 0 0 0 1px rgba(128, 189, 120, 0.22) inset;
}

body.theme-crt #menuOverlay .mode-btn:hover {
    transform: translateY(-1px);
    text-shadow: none;
}

body.theme-crt #menuOverlay .mode-classic-btn:hover {
    background: linear-gradient(180deg, #c4f0a9, #9fda86);
    color: #0d2411;
    border-color: #c6f8a8;
    box-shadow:
        0 0 18px rgba(170, 245, 145, 0.55),
        0 0 0 1px rgba(233, 255, 224, 0.65) inset;
}

body.theme-crt #menuOverlay .mode-sprint-btn:hover {
    background: linear-gradient(180deg, #ffc15d, #ff9f2f);
    color: #2b1304;
    border-color: #ffd38f;
    box-shadow:
        0 0 18px rgba(255, 183, 88, 0.55),
        0 0 0 1px rgba(255, 232, 190, 0.62) inset;
}

body.theme-crt #menuOverlay .mode-zombie-btn:hover {
    background: linear-gradient(180deg, #86eb8c, #4fc86a);
    color: #0b2410;
    border-color: #a6f3ad;
    box-shadow:
        0 0 18px rgba(109, 240, 132, 0.5),
        0 0 0 1px rgba(220, 255, 224, 0.62) inset;
}

body.theme-crt #menuOverlay .hint {
    margin-bottom: 8px;
}

body.theme-crt #menuOverlay .controls-hint {
    color: #8dac86;
}

body.theme-crt #menuOverlay .menu-secondary {
    margin: 10px 0 0;
}

body.theme-crt #menuOverlay .secondary-btn {
    border-color: #6dbb65;
    color: #9edb90;
    background: rgba(11, 24, 14, 0.58);
}

body.theme-crt #menuOverlay .secondary-btn:hover {
    background: #6dbb65;
    color: #0c180f;
    box-shadow: 0 0 12px rgba(128, 220, 110, 0.45);
}

body.theme-crt #menuOverlay .menu-leaderboard {
    margin-top: 30px;
    max-height: none;
    background: linear-gradient(180deg, rgba(13, 24, 15, 0.82), rgba(9, 18, 11, 0.82));
    border-color: rgba(112, 170, 102, 0.42);
    color: #9fc597;
    box-shadow:
        0 0 0 1px rgba(148, 212, 128, 0.12) inset,
        0 12px 24px rgba(0, 0, 0, 0.32);
}

body.theme-crt #menuOverlay .menu-leaderboard {
    min-height: 252px;
    padding: 10px 12px;
}

body.theme-crt #menuOverlay .lb-head {
    margin-bottom: 6px;
}

body.theme-crt #menuOverlay .lb-list {
    gap: 6px;
}

body.theme-crt #menuOverlay .lb-row {
    padding: 6px 9px;
}

body.theme-crt #menuOverlay .lb-best {
    margin-top: 6px;
    gap: 5px;
}

body.theme-crt #menuOverlay .lb-best-item {
    padding: 5px 3px;
}

body.theme-crt #menuOverlay .lb-head strong,
body.theme-crt #menuOverlay .lb-sub {
    color: #8eb789;
}

body.theme-crt #menuOverlay .lb-row {
    background: linear-gradient(180deg, rgba(18, 32, 20, 0.92), rgba(14, 25, 16, 0.92));
    border-color: rgba(112, 168, 102, 0.35);
}

body.theme-crt #menuOverlay .lb-list .lb-row:nth-child(1) {
    border-color: rgba(193, 166, 93, 0.5);
    background: linear-gradient(90deg, rgba(46, 43, 23, 0.92), rgba(24, 32, 19, 0.92));
}

body.theme-crt #menuOverlay .lb-list .lb-row:nth-child(2) {
    border-color: rgba(125, 152, 116, 0.5);
    background: linear-gradient(90deg, rgba(27, 41, 30, 0.92), rgba(20, 30, 22, 0.92));
}

body.theme-crt #menuOverlay .lb-list .lb-row:nth-child(3) {
    border-color: rgba(142, 127, 89, 0.5);
    background: linear-gradient(90deg, rgba(42, 34, 24, 0.92), rgba(24, 28, 18, 0.92));
}

body.theme-crt #menuOverlay .lb-rank,
body.theme-crt #menuOverlay .lb-lines,
body.theme-crt #menuOverlay .lb-best-item b {
    color: #8bb586;
}

body.theme-crt #menuOverlay .lb-score,
body.theme-crt #menuOverlay .lb-best-item em {
    color: #b7d8ab;
}

body.theme-crt #menuOverlay .lb-best-item {
    background: rgba(16, 29, 18, 0.9);
    border-color: rgba(108, 165, 98, 0.35);
}

.lb-list .lb-row:nth-child(1) {
    border-color: rgba(225, 174, 66, 0.55);
    background: linear-gradient(90deg, rgba(255, 240, 198, 0.86), rgba(255, 249, 230, 0.7));
}

.lb-list .lb-row:nth-child(2) {
    border-color: rgba(140, 160, 186, 0.55);
    background: linear-gradient(90deg, rgba(236, 243, 252, 0.9), rgba(246, 250, 255, 0.72));
}

.lb-list .lb-row:nth-child(3) {
    border-color: rgba(187, 132, 96, 0.55);
    background: linear-gradient(90deg, rgba(245, 227, 214, 0.86), rgba(252, 241, 233, 0.72));
}

.lb-rank {
    font-size: 0.5rem;
    color: #395a7f;
    font-weight: 700;
}

.lb-score {
    font-size: 0.68rem;
    color: #1f466d;
    letter-spacing: 0.4px;
}

.lb-mode {
    font-size: 0.43rem;
    padding: 3px 6px;
    border: 2px solid currentColor;
    border-radius: 3px;
    text-align: center;
    white-space: nowrap;
    font-weight: 700;
}

.lb-mode-classic { color: #2ca7d5; }
.lb-mode-sprint { color: #ff9f2f; }
.lb-mode-zombie { color: #4bbd50; }

.lb-lines {
    font-size: 0.46rem;
    text-align: right;
    color: #45668d;
    font-weight: 700;
}

.lb-empty {
    text-align: center;
    font-size: 0.46rem;
    padding: 10px;
    border: 2px dashed rgba(101, 130, 162, 0.35);
}

.lb-best {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.lb-best-item {
    display: grid;
    gap: 3px;
    padding: 6px 4px;
    text-align: center;
    border: 2px solid rgba(101, 130, 162, 0.24);
    background: rgba(255, 255, 255, 0.62);
}

.lb-best-item b {
    font-size: 0.38rem;
    color: #45668d;
    font-weight: 400;
}

.lb-best-item em {
    font-size: 0.62rem;
    color: #1f466d;
    font-style: normal;
    letter-spacing: 0.4px;
}

.lb-best-sprint em {
    display: grid;
    gap: 2px;
    font-size: 0.48rem;
    line-height: 1.2;
    letter-spacing: 0.1px;
}

.sprint-best-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.sprint-best-label {
    min-width: 30px;
    text-align: right;
    opacity: 0.88;
}

.sprint-best-value {
    min-width: 42px;
    text-align: left;
}

body.theme-neon .lb-row,
body.theme-neon .lb-best-item {
    background: rgba(8, 23, 34, 0.85);
    border-color: rgba(86, 236, 187, 0.35);
}

body.theme-neon .lb-list .lb-row:nth-child(1),
body.theme-neon .lb-list .lb-row:nth-child(2),
body.theme-neon .lb-list .lb-row:nth-child(3) {
    background: rgba(9, 27, 41, 0.92);
}

body.theme-neon .lb-rank,
body.theme-neon .lb-lines,
body.theme-neon .lb-best-item b {
    color: #8ecce8;
}

body.theme-neon .lb-score,
body.theme-neon .lb-best-item em {
    color: #c9f2ff;
}

body.theme-paper .lb-row,
body.theme-paper .lb-best-item {
    background: rgba(255, 248, 234, 0.92);
    border-color: rgba(150, 108, 72, 0.35);
}

body.theme-paper .lb-rank,
body.theme-paper .lb-lines,
body.theme-paper .lb-best-item b {
    color: #7f5739;
}

body.theme-paper .lb-score,
body.theme-paper .lb-best-item em {
    color: #5e3f28;
}

.achievements-card {
    width: min(96%, 620px);
    max-height: min(84dvh, 720px);
    gap: 12px;
}

.achievements-card h2 {
    text-align: center;
}

.achievements-card .menu-achievements {
    width: 100%;
    max-height: min(62dvh, 560px);
    margin: 0;
    overflow-y: auto;
    padding: 14px;
}

.achievements-card .menu-achievements > strong {
    display: block;
    text-align: center;
}

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

.achievement-card {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 2px solid rgba(87, 121, 160, 0.45);
    background: rgba(248, 252, 255, 0.88);
}

.achievement-card.done {
    border-color: color-mix(in srgb, var(--accent-main) 68%, transparent);
    background: color-mix(in srgb, var(--accent-main) 16%, rgba(250, 255, 255, 0.94));
}

.achievement-title {
    font-size: 0.52rem;
    color: #1d3f62;
    line-height: 1.35;
    text-align: center;
}

.achievement-desc {
    font-size: 0.44rem;
    color: #3e5f7f;
    line-height: 1.5;
}

.achievement-status {
    font-size: 0.42rem;
    color: #204e7a;
    line-height: 1.45;
    font-weight: 700;
}

.achievement-card.done .achievement-status {
    color: #13895b;
}

body.theme-neon .achievement-card {
    border-color: rgba(101, 255, 197, 0.6);
    background: rgba(7, 25, 36, 0.9);
}

body.theme-neon .achievement-title {
    color: #96ffd3;
}

body.theme-neon .achievement-desc,
body.theme-neon .achievement-status {
    color: #d1ecff;
}

body.theme-paper .achievement-card {
    border-color: rgba(146, 102, 63, 0.52);
    background: rgba(255, 249, 236, 0.92);
}

body.theme-paper .achievement-title {
    color: #7a4d2f;
}

body.theme-paper .achievement-desc,
body.theme-paper .achievement-status {
    color: #6f4b31;
}

@media (max-width: 900px) {
    .achievement-grid {
        grid-template-columns: 1fr;
    }

    .achievement-title {
        font-size: 0.56rem;
    }

    .achievement-desc {
        font-size: 0.46rem;
    }

    .achievement-status {
        font-size: 0.44rem;
    }
}

.achievement-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 300;
    display: grid;
    gap: 8px;
    pointer-events: none;
}

.achievement-toast {
    min-width: 220px;
    max-width: 280px;
    padding: 10px 12px;
    border: 2px solid var(--accent-main);
    background: color-mix(in srgb, var(--panel-bg) 88%, black 12%);
    color: var(--accent-main);
    font-size: 0.44rem;
    line-height: 1.5;
    transform: translateX(30px);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.achievement-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.achievement-toast-label {
    display: block;
    font-size: 0.34rem;
    letter-spacing: 1.1px;
    opacity: 0.8;
}

.pause-theme-wrap {
    margin: 10px 0;
    display: grid;
    gap: 6px;
    width: min(88%, 260px);
}

.pause-theme-wrap label {
    font-size: 0.45rem;
    color: #cfe6ff;
    text-align: center;
}

#pauseOverlay {
    backdrop-filter: blur(2px);
}

.pause-card {
    width: min(92%, 380px);
    gap: 12px;
    border-color: var(--modal-border);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.42),
        0 0 16px color-mix(in srgb, var(--modal-border) 24%, transparent);
}

.pause-card h2 {
    margin: 0;
    animation: none;
    color: var(--modal-title);
    text-shadow: none;
    text-align: center;
}

.pause-subtitle {
    text-align: center;
    font-size: 0.42rem;
    letter-spacing: 1px;
    color: var(--modal-subtext);
}

.pause-actions {
    display: grid;
    gap: 8px;
}

@media (min-width: 480px) {
    .pause-actions {
        grid-template-columns: 1fr 1fr;
    }
}

.modal-card {
    width: min(92%, 360px);
    background: var(--modal-bg);
    border: 3px solid var(--modal-border);
    padding: 14px 14px 12px;
    display: grid;
    gap: 10px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.modal-card h2 {
    animation: none;
    margin: 0 0 6px 0;
    color: var(--modal-title);
    text-shadow: none;
}

.tutorial-list {
    list-style: none;
    font-size: 0.48rem;
    color: var(--modal-text);
    display: grid;
    gap: 7px;
    line-height: 1.5;
}

.settings-row {
    display: grid;
    gap: 6px;
}

.settings-row-inline {
    grid-template-columns: 1fr auto;
    align-items: center;
}

.settings-row label {
    font-size: 0.46rem;
    color: var(--modal-text);
}

.settings-row input,
.settings-row select {
    width: 100%;
}

.settings-card {
    width: min(94%, 430px);
    gap: 12px;
    border-color: var(--modal-border);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 16px color-mix(in srgb, var(--modal-border) 26%, transparent);
}

.settings-subtitle {
    font-size: 0.4rem;
    letter-spacing: 1px;
    color: var(--modal-subtext);
}

.settings-group {
    border: 2px solid var(--modal-panel-border);
    background: var(--modal-panel-bg);
    padding: 10px;
    display: grid;
    gap: 8px;
}

.settings-value {
    font-size: 0.48rem;
    color: var(--modal-accent);
}

.settings-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.danger-btn {
    border-color: var(--modal-danger);
    color: var(--modal-danger);
}

.danger-btn:hover {
    background: var(--modal-danger);
    color: #20070b;
}

.tutorial-card .menu-btn,
.settings-card .menu-btn,
.achievements-card .menu-btn {
    border-color: var(--modal-border);
    color: var(--modal-border);
}

.tutorial-card h2,
.settings-card h2 {
    text-align: center;
}

.tutorial-card .menu-btn:hover,
.settings-card .menu-btn:hover,
.achievements-card .menu-btn:hover {
    background: var(--modal-border);
    color: color-mix(in srgb, var(--modal-bg) 72%, #000 28%);
    box-shadow: 0 0 14px color-mix(in srgb, var(--modal-border) 55%, transparent);
}

#tutorialOverlay,
#settingsOverlay,
#achievementsOverlay,
#pauseOverlay {
    backdrop-filter: blur(2px);
}

body.theme-crt #tutorialOverlay,
body.theme-crt #settingsOverlay,
body.theme-crt #achievementsOverlay,
body.theme-crt #pauseOverlay {
    background:
        radial-gradient(circle at 50% 16%, rgba(94, 192, 255, 0.18), transparent 36%),
        linear-gradient(180deg, rgba(9, 15, 24, 0.72), rgba(7, 13, 23, 0.8));
}

body.theme-neon #tutorialOverlay,
body.theme-neon #settingsOverlay,
body.theme-neon #achievementsOverlay,
body.theme-neon #pauseOverlay {
    background:
        radial-gradient(circle at 50% 14%, rgba(55, 246, 127, 0.18), transparent 38%),
        radial-gradient(circle at 82% 72%, rgba(63, 214, 255, 0.13), transparent 44%),
        linear-gradient(180deg, rgba(3, 9, 17, 0.78), rgba(2, 7, 14, 0.86));
}

body.theme-paper #tutorialOverlay,
body.theme-paper #settingsOverlay,
body.theme-paper #achievementsOverlay,
body.theme-paper #pauseOverlay {
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 216, 156, 0.24), transparent 40%),
        linear-gradient(180deg, rgba(99, 75, 52, 0.26), rgba(88, 65, 43, 0.32));
}

/* PAPER THEME ENHANCEMENTS */
body.theme-paper {
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 251, 240, 0.8), transparent 36%),
        radial-gradient(circle at 85% 80%, rgba(220, 193, 152, 0.36), transparent 44%),
        linear-gradient(165deg, #f8efdf 0%, #f1e2c8 52%, #e8d4b2 100%);
}

body.theme-paper .crt-effect {
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 250, 238, 0.7), transparent 34%),
        linear-gradient(160deg, rgba(160, 124, 80, 0.09), rgba(255, 255, 255, 0.16));
}

body.theme-paper .crt-effect::before {
    background:
        radial-gradient(circle at 20% 80%, rgba(172, 130, 86, 0.1), transparent 42%),
        linear-gradient(180deg, rgba(136, 102, 66, 0.05), rgba(80, 58, 35, 0.08));
    opacity: 0.85;
}

body.theme-paper .crt-effect::after {
    background-image:
        radial-gradient(circle at 30% 16%, rgba(255, 255, 255, 0.14), transparent 32%),
        radial-gradient(circle at 82% 70%, rgba(173, 133, 93, 0.14), transparent 38%),
        repeating-linear-gradient(8deg, rgba(118, 91, 63, 0.055) 0 1px, rgba(255, 255, 255, 0) 1px 4px);
    opacity: 0.62;
    animation: paperGrainDrift 15s linear infinite;
}

body.theme-paper .scanlines {
    opacity: 0;
}

body.theme-paper .game-container::before {
    background:
        radial-gradient(ellipse at 50% 8%, rgba(255, 255, 255, 0.62), transparent 48%),
        linear-gradient(90deg, rgba(169, 132, 90, 0.09) 0, rgba(255, 247, 229, 0.32) 16%, rgba(255, 247, 229, 0.32) 84%, rgba(169, 132, 90, 0.09) 100%),
        linear-gradient(180deg, rgba(255, 247, 230, 0.96), rgba(241, 225, 195, 0.96));
}

body.theme-paper .game-container::after {
    opacity: 0.65;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(155, 119, 82, 0.08), transparent 34%),
        repeating-linear-gradient(0deg, rgba(147, 112, 75, 0.08) 0 1px, rgba(255, 255, 255, 0) 1px 22px),
        repeating-linear-gradient(90deg, rgba(147, 112, 75, 0.04) 0 1px, rgba(255, 255, 255, 0) 1px 26px);
    background-size: auto, auto, auto;
}

body.theme-paper .panel-box {
    background:
        linear-gradient(180deg, rgba(255, 250, 239, 0.96), rgba(245, 232, 204, 0.93));
    border: 3px solid rgba(149, 108, 71, 0.7);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.5),
        0 8px 14px rgba(97, 68, 40, 0.16);
    transform: rotate(-0.15deg);
}

body.theme-paper .panel-box h3 {
    color: #7a4f2f;
    text-shadow: none;
    letter-spacing: 1.3px;
}

body.theme-paper .panel-box .value {
    color: #935830;
    text-shadow: 0 1px 0 rgba(255, 245, 227, 0.75);
}

body.theme-paper .panel-box .value.best {
    color: #526e95;
}

body.theme-paper canvas#gameCanvas {
    border-color: #a97d53;
    border-width: 5px;
    border-radius: 6px;
    box-shadow:
        0 10px 24px rgba(101, 72, 45, 0.25),
        inset 0 0 0 1px rgba(255, 252, 242, 0.35);
}

body.theme-paper .theme-select,
body.theme-paper .menu-btn {
    border-color: #a47449;
    color: #75482a;
    background: color-mix(in srgb, #fff8ea 82%, #d0b183 18%);
}

body.theme-paper .menu-btn:hover {
    background: color-mix(in srgb, #fff8ea 56%, #d6b78b 44%);
    box-shadow: 0 0 0 1px rgba(131, 93, 58, 0.28), 0 5px 10px rgba(117, 82, 49, 0.2);
}

body.theme-paper .combo-indicator.active {
    color: #7d5030;
    text-shadow: 0 0 0 rgba(0, 0, 0, 0), 0 1px 0 rgba(255, 245, 225, 0.86);
}

body.theme-paper .combo-indicator.combo-fx {
    animation: paperStamp 190ms ease-out;
    filter: none;
}

body.theme-paper .combo-indicator.combo-fx-b2b {
    color: #70401f;
    text-shadow: 0 1px 0 rgba(255, 240, 217, 0.88);
}

body.theme-paper .combo-indicator.combo-paper {
    padding: 3px 4px;
    border: 1px dashed rgba(128, 90, 56, 0.55);
    background: rgba(255, 245, 226, 0.56);
    border-radius: 3px;
    display: inline-block;
    transform-origin: center;
}

@keyframes paperStamp {
    0% {
        transform: scale(0.84) rotate(-2deg);
        opacity: 0.68;
    }
    60% {
        transform: scale(1.05) rotate(0.8deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes paperGrainDrift {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 0 0, 0 0, 80px 110px; }
}

/* Keep paper palette in every mode (sprint/zombie should not go dark). */
body.mode-sprint.theme-paper,
body.mode-zombie.theme-paper {
    --bg-color: #f2e9de;
    --panel-bg: rgba(255, 250, 240, 0.94);
    --panel-border: #b6895d;
    --panel-label: #7a5330;
    --accent-main: #c7542f;
    --accent-alt: #4770b5;
    --board-bg: #fff8ef;
    --grid-line: rgba(126, 94, 66, 0.15);
    --preview-bg: #f2e4d0;
    --modal-bg: linear-gradient(180deg, rgba(255, 248, 234, 0.96), rgba(244, 232, 209, 0.96));
    --modal-border: #b6895d;
    --modal-title: #8a4f2c;
    --modal-text: #6e4f36;
    --modal-subtext: #8c6442;
    --modal-panel-bg: rgba(255, 246, 226, 0.72);
    --modal-panel-border: rgba(169, 126, 84, 0.45);
    --modal-accent: #c7542f;
    --modal-danger: #b54b4b;
    background:
        radial-gradient(circle at 15% 10%, rgba(255, 251, 240, 0.8), transparent 36%),
        radial-gradient(circle at 85% 80%, rgba(220, 193, 152, 0.36), transparent 44%),
        linear-gradient(165deg, #f8efdf 0%, #f1e2c8 52%, #e8d4b2 100%);
}

body.mode-sprint.theme-paper .scanlines,
body.mode-zombie.theme-paper .scanlines {
    opacity: 0;
}

body.mode-sprint.theme-paper .crt-effect,
body.mode-zombie.theme-paper .crt-effect {
    background:
        radial-gradient(circle at 18% 14%, rgba(255, 250, 238, 0.7), transparent 34%),
        linear-gradient(160deg, rgba(160, 124, 80, 0.09), rgba(255, 255, 255, 0.16));
}

body.mode-sprint.theme-paper .crt-effect::after,
body.mode-zombie.theme-paper .crt-effect::after {
    background-image:
        radial-gradient(circle at 30% 16%, rgba(255, 255, 255, 0.14), transparent 32%),
        radial-gradient(circle at 82% 70%, rgba(173, 133, 93, 0.14), transparent 38%),
        repeating-linear-gradient(8deg, rgba(118, 91, 63, 0.055) 0 1px, rgba(255, 255, 255, 0) 1px 4px);
    opacity: 0.62;
    animation: paperGrainDrift 15s linear infinite;
}

body.mode-sprint.theme-paper .game-container::before,
body.mode-zombie.theme-paper .game-container::before {
    background:
        radial-gradient(ellipse at 50% 8%, rgba(255, 255, 255, 0.62), transparent 48%),
        linear-gradient(90deg, rgba(169, 132, 90, 0.09) 0, rgba(255, 247, 229, 0.32) 16%, rgba(255, 247, 229, 0.32) 84%, rgba(169, 132, 90, 0.09) 100%),
        linear-gradient(180deg, rgba(255, 247, 230, 0.96), rgba(241, 225, 195, 0.96));
}

body.mode-sprint.theme-paper .game-container::after,
body.mode-zombie.theme-paper .game-container::after {
    opacity: 0.65;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(155, 119, 82, 0.08), transparent 34%),
        repeating-linear-gradient(0deg, rgba(147, 112, 75, 0.08) 0 1px, rgba(255, 255, 255, 0) 1px 22px),
        repeating-linear-gradient(90deg, rgba(147, 112, 75, 0.04) 0 1px, rgba(255, 255, 255, 0) 1px 26px);
    animation: none;
}

body.mode-sprint.theme-paper canvas#gameCanvas,
body.mode-zombie.theme-paper canvas#gameCanvas {
    border-color: #a97d53;
    box-shadow:
        0 10px 24px rgba(101, 72, 45, 0.25),
        inset 0 0 0 1px rgba(255, 252, 242, 0.35);
}

/* Neon mode-specific variants (distinct from neon classic). */
body.mode-sprint.theme-neon {
    --panel-bg: rgba(16, 9, 31, 0.9);
    --panel-border: #7a59ff;
    --panel-label: #ceb8ff;
    --accent-main: #57d8ff;
    --accent-alt: #ff7acb;
    --board-bg: #0a0620;
    --grid-line: rgba(109, 176, 255, 0.2);
    --preview-bg: #080419;
    background:
        radial-gradient(circle at 50% 42%, #2b1460 0%, #13082f 44%, #070314 100%),
        linear-gradient(135deg, rgba(95, 55, 255, 0.2), rgba(255, 89, 191, 0.18));
}

body.mode-sprint.theme-neon .scanlines {
    opacity: 0.78;
    animation: scanline-move 3.2s linear infinite;
}

body.mode-sprint.theme-neon .crt-effect {
    background:
        radial-gradient(circle at 22% 20%, rgba(100, 216, 255, 0.2), transparent 38%),
        radial-gradient(circle at 78% 74%, rgba(196, 92, 255, 0.2), transparent 42%),
        linear-gradient(180deg, rgba(18, 10, 42, 0.93), rgba(7, 5, 21, 0.96));
}

body.mode-sprint.theme-neon .crt-effect::after {
    background:
        repeating-linear-gradient(112deg, rgba(96, 225, 255, 0.12) 0 12px, rgba(0, 0, 0, 0.02) 12px 24px),
        linear-gradient(90deg, rgba(87, 216, 255, 0.25), rgba(255, 122, 203, 0.2));
    animation: sprintRush 0.72s linear infinite;
}

body.mode-sprint.theme-neon .game-container::before {
    background:
        radial-gradient(circle at 50% 20%, rgba(126, 206, 255, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(18, 10, 44, 0.86), rgba(8, 5, 22, 0.92));
}

body.mode-sprint.theme-neon .game-container::after {
    opacity: 0.88;
    background-image:
        radial-gradient(circle at 50% 44%, rgba(124, 210, 255, 0.2), rgba(30, 15, 73, 0.05) 52%, transparent 78%),
        repeating-linear-gradient(125deg, rgba(117, 255, 253, 0.11) 0 10px, rgba(255, 123, 214, 0.08) 10px 22px),
        linear-gradient(rgba(120, 181, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 181, 255, 0.12) 1px, transparent 1px);
    background-size: auto, auto, 24px 24px, 24px 24px;
    animation: sprintCenterFlow 0.8s linear infinite;
}

body.mode-sprint.theme-neon canvas#gameCanvas {
    border-color: #6f66ff;
    box-shadow:
        0 0 20px rgba(94, 203, 255, 0.3),
        0 0 34px rgba(188, 88, 255, 0.18),
        inset 0 0 28px rgba(74, 48, 152, 0.3);
}

body.mode-sprint.theme-neon .timer-box .value.timer {
    color: #8ce7ff;
    text-shadow: 0 0 12px rgba(109, 219, 255, 0.8);
}

body.mode-zombie.theme-neon {
    --panel-bg: rgba(6, 22, 17, 0.92);
    --panel-border: #3de08f;
    --panel-label: #9dffd1;
    --accent-main: #58ff9f;
    --accent-alt: #65f8ff;
    --board-bg: #04140f;
    --grid-line: rgba(100, 255, 196, 0.2);
    --preview-bg: #03100d;
    background:
        radial-gradient(circle at 50% 50%, #0f3f32 0%, #071e18 45%, #030b08 100%),
        repeating-linear-gradient(140deg, rgba(86, 255, 172, 0.08) 0 20px, rgba(0, 0, 0, 0.06) 20px 40px);
}

body.mode-zombie.theme-neon .scanlines {
    opacity: 0.84;
    animation: scanline-move 4.4s linear infinite;
}

body.mode-zombie.theme-neon .crt-effect {
    background:
        radial-gradient(circle at 18% 24%, rgba(101, 255, 180, 0.24), transparent 36%),
        radial-gradient(circle at 84% 72%, rgba(80, 250, 255, 0.2), transparent 38%),
        radial-gradient(circle at 44% 82%, rgba(41, 143, 117, 0.28), transparent 42%),
        linear-gradient(180deg, rgba(6, 30, 23, 0.94), rgba(3, 12, 10, 0.97));
}

body.mode-zombie.theme-neon .crt-effect::after {
    background:
        radial-gradient(circle at 52% 46%, rgba(101, 255, 180, 0.22), rgba(4, 37, 28, 0.75) 55%),
        radial-gradient(circle at 14% 22%, rgba(70, 255, 165, 0.28), transparent 30%),
        radial-gradient(circle at 86% 76%, rgba(78, 231, 255, 0.22), transparent 32%),
        repeating-linear-gradient(0deg, rgba(119, 255, 187, 0.12) 0 2px, rgba(7, 20, 8, 0.04) 2px 7px);
    animation: zombiePulse 1.5s ease-in-out infinite;
}

body.mode-zombie.theme-neon .game-container::before {
    background:
        radial-gradient(circle at 52% 24%, rgba(112, 255, 186, 0.18), transparent 40%),
        radial-gradient(circle at 30% 78%, rgba(64, 166, 142, 0.18), transparent 44%),
        linear-gradient(180deg, rgba(6, 25, 19, 0.9), rgba(3, 12, 9, 0.93));
}

body.mode-zombie.theme-neon .game-container::after {
    opacity: 0.9;
    background-image:
        radial-gradient(circle at 50% 52%, rgba(105, 255, 191, 0.25), rgba(8, 64, 47, 0.13) 48%, transparent 78%),
        repeating-linear-gradient(0deg, rgba(95, 255, 180, 0.1) 0 2px, rgba(10, 26, 12, 0) 2px 6px),
        linear-gradient(rgba(95, 220, 178, 0.13) 1px, transparent 1px),
        linear-gradient(90deg, rgba(95, 220, 178, 0.13) 1px, transparent 1px);
    background-size: auto, auto, 26px 26px, 26px 26px;
    animation: zombieCenterPulse 1.15s ease-in-out infinite;
}

body.mode-zombie.theme-neon canvas#gameCanvas {
    border-color: #3de08f;
    box-shadow:
        0 0 22px rgba(94, 255, 181, 0.3),
        0 0 38px rgba(89, 244, 255, 0.16),
        inset 0 0 34px rgba(45, 146, 122, 0.38);
}

body.mode-zombie.theme-neon .meter-fill {
    background: linear-gradient(90deg, #51ffa8, #73f6ff, #ff81d2);
}

.hold-action-btn {
    margin-top: 8px;
    width: 100%;
    font-size: 0.5rem;
    padding: 8px 8px;
}

.pause-action-btn {
    width: 100%;
    font-size: 0.48rem;
    padding: 9px 8px;
}

.hold-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.meter-track {
    width: 100%;
    height: 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--panel-border);
}

.meter-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #67e66f, #f2d23f, #ff5f57);
    transition: width 0.15s linear;
}

.sprint-summary {
    display: grid;
    gap: 7px;
}

.floating-hold-btn {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 40;
    font-size: 0.48rem;
    padding: 8px 10px;
    display: none;
}

@media (max-width: 900px) {
    .floating-hold-btn {
        display: block;
    }

    .mobile-controls {
        z-index: 130;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    }
}

/* Final mobile override: keep layout stable on phones */
@media (max-width: 900px) {
    .game-wrapper {
        height: 100dvh;
        min-height: 100dvh;
        padding-top: 58px;
        padding-bottom: 136px;
        align-items: center;
        justify-content: center;
    }

    .game-container {
        height: auto;
        overflow: visible;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    canvas#gameCanvas {
        width: min(92vw, 360px) !important;
        height: auto !important;
        max-height: calc(100dvh - 210px);
        aspect-ratio: 1 / 2;
        margin: 0 auto;
    }

    .left-panel {
        top: 6px;
        left: 6px;
        right: 6px;
        gap: 5px;
    }

    .left-panel .panel-box {
        padding: 6px 4px;
    }

    .left-panel .panel-box h3 {
        font-size: 0.33rem;
        margin-bottom: 3px;
    }

    .left-panel .panel-box .value {
        font-size: 0.5rem;
    }

    .mobile-controls {
        bottom: max(8px, env(safe-area-inset-bottom, 0px));
        padding: 0 8px;
        gap: 6px;
    }

    .mobile-left, .mobile-right, .mobile-center {
        gap: 6px;
    }

    .mobile-btn {
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }

    .mobile-btn.big {
        width: 60px;
        height: 60px;
        font-size: 0.82rem;
    }

    .mobile-right .mobile-btn.big {
        width: 74px;
        font-size: 0.54rem;
    }

    .floating-hold-btn {
        right: 8px;
        bottom: 92px;
        font-size: 0.44rem;
        padding: 7px 9px;
        z-index: 145;
    }
}
