* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #00ffff;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100dvh; /* exact dynamic viewport height: excludes Android nav bar */
    overflow: hidden; /* zero scroll in any direction */
    overscroll-behavior: none;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    /* Neon cyber background with animated gradients and more colors */
    background: 
        radial-gradient(circle at 20% 80%, #ff00ff 0%, transparent 30%),
        radial-gradient(circle at 80% 20%, #00ffff 0%, transparent 30%),
        radial-gradient(circle at 40% 40%, #ff0080 0%, transparent 40%),
        radial-gradient(circle at 60% 70%, #00ff88 0%, transparent 35%),
        radial-gradient(circle at 10% 30%, #8800ff 0%, transparent 25%),
        linear-gradient(135deg, #000510 0%, #001020 50%, #001530 100%);
    animation: backgroundPulse 4s ease-in-out infinite alternate;
}

/* Enhanced animated background pulse effect */
@keyframes backgroundPulse {
    0% { filter: brightness(0.8) hue-rotate(0deg); }
    50% { filter: brightness(1.0) hue-rotate(10deg); }
    100% { filter: brightness(1.2) hue-rotate(20deg); }
}

/* 3D Perspective container for hologram effect */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 255, 0.03) 2px,
            rgba(0, 255, 255, 0.03) 4px
        );
    pointer-events: none;
    z-index: 1;
}

/* 3D hologram container with perspective */
.game-container {
    position: relative;
    background: rgba(0, 20, 40, 0.9);
    border: 2px solid #00ffff;
    border-radius: 20px;
    padding: 20px;
    /* Safe-area bottom pad so buttons always clear the Android nav bar */
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
    max-width: 500px;
    width: 100%;
    /* Hard-cap the container to the dynamic viewport so nothing overflows */
    max-height: 100dvh;
    /* Flex column lets the game board shrink while controls stay fixed */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 2;
    
    /* 3D transforms for hologram effect */
    perspective: 1000px;
    transform-style: preserve-3d;
    transform: rotateX(5deg) rotateY(0deg);
    transition: transform 0.1s ease-out;
    
    /* Neon glow effects */
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(0, 255, 255, 0.1),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    
    /* Animated border glow */
    animation: containerGlow 2s ease-in-out infinite alternate;
}

@keyframes containerGlow {
    0% { 
        box-shadow: 
            0 0 20px rgba(0, 255, 255, 0.6),
            0 0 40px rgba(0, 255, 255, 0.4),
            0 0 60px rgba(0, 255, 255, 0.2),
            inset 0 0 20px rgba(0, 255, 255, 0.1);
    }
    100% { 
        box-shadow: 
            0 0 30px rgba(255, 0, 255, 0.8),
            0 0 50px rgba(255, 0, 255, 0.6),
            0 0 70px rgba(255, 0, 255, 0.4),
            inset 0 0 25px rgba(255, 0, 255, 0.2);
    }
}

/* Game header with neon styling */
.game-header {
    text-align: center;
    margin-bottom: 15px;
    transform: translateZ(10px);
    flex-shrink: 0; /* never compress the header */
}

.game-header h1 {
    font-size: 28px;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 30px #00ffff;
    margin-bottom: 10px;
    animation: titleGlow 1.5s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% { 
        text-shadow: 
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 30px #00ffff,
            0 0 40px #00ffff;
    }
    100% { 
        text-shadow: 
            0 0 15px #ff00ff,
            0 0 25px #ff00ff,
            0 0 35px #ff00ff,
            0 0 45px #ff00ff;
    }
}

.game-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.score {
    font-size: 16px;
    font-weight: bold;
    color: #00ffff;
    background: rgba(0, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 15px;
    display: inline-block;
    border: 1px solid #00ffff;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    transform: translateZ(5px);
}

/* Effects-disabled mode: flat dark look — no glow, no animation, no colour cycling */
body.effects-disabled {
    animation: none !important;
    background: #000a14 !important;
}
body.effects-disabled .game-container {
    box-shadow: none !important;
}
body.effects-disabled .game-header h1 {
    text-shadow: none !important;
    animation: none !important;
    color: #00ffff;
}
body.effects-disabled .score,
body.effects-disabled .game-stats,
body.effects-disabled .control-btn,
body.effects-disabled .control-toggle {
    text-shadow: none !important;
}

/* 3D game board with hologram effect */
.game-board {
    position: relative;
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    transform-style: preserve-3d;
    transform: translateZ(20px);
    /* Grow to fill remaining space and shrink if viewport is small */
    flex: 1 1 0%;
    min-height: 0;
    overflow: hidden;
}

/* 3D canvas with neon styling */
#gameCanvas {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ffff;
    border-radius: 8px;
    display: block;
    transform-style: preserve-3d;
    touch-action: none; /* prevent scroll/zoom on canvas during gameplay */
    /* Scale canvas down to fit available board height on small/phone screens */
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.4),
        0 0 40px rgba(0, 255, 255, 0.2),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    position: relative;
}

/* Add hologram scan lines effect */
#gameCanvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 255, 0.1) 2px,
        rgba(0, 255, 255, 0.1) 4px
    );
    pointer-events: none;
    border-radius: 6px;
    animation: scanlines 2s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* Semi-transparent backdrop that sits behind the game-over panel and above everything else */
.game-over-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 10, 0.75);
    z-index: 9999;
    backdrop-filter: blur(3px);
}

/* Neon game over screen — direct child of body, above 3D-transformed game elements */
.game-over {
    /* Fixed overlay — direct body child, never inside a 3D transform context */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000; /* above .fullscreen (9999) and backdrop (9999) */

    /* Wide enough for comfortable reading */
    width: min(94vw, 540px);
    max-height: calc(100dvh - 40px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;

    background: rgba(0, 10, 30, 0.98);
    color: #00ffff;
    padding: 28px 24px;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #00ffff;
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.7),
        0 0 70px rgba(0, 255, 255, 0.4),
        inset 0 0 24px rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(12px);
}

.game-over h2 {
    font-size: 24px;
    margin-bottom: 15px;
    text-shadow: 
        0 0 10px #ff00ff,
        0 0 20px #ff00ff;
    animation: gameOverGlow 1s ease-in-out infinite alternate;
}

@keyframes gameOverGlow {
    0% { 
        text-shadow: 
            0 0 10px #ff00ff,
            0 0 20px #ff00ff;
    }
    100% { 
        text-shadow: 
            0 0 15px #00ffff,
            0 0 25px #00ffff;
    }
}

.game-over p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #00ffff;
}

/* Optional sign-in prompt inside game-over panel */
.signin-prompt {
    margin: 8px 0 12px;
}

.signin-btn {
    background: rgba(255, 165, 0, 0.15);
    border-color: #ffa500;
    color: #ffa500;
    box-shadow: 0 0 12px rgba(255, 165, 0, 0.4), inset 0 0 8px rgba(255, 165, 0, 0.1);
    width: 100%;
    font-size: 13px;
    padding: 10px 16px;
}

.signin-btn:hover {
    background: rgba(255, 165, 0, 0.25);
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.6), inset 0 0 12px rgba(255, 165, 0, 0.15);
}

.hidden {
    display: none !important;
}

/* 3D game controls with neon styling */
.game-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: translateZ(10px);
    flex-shrink: 0; /* never compress controls — they must always be fully visible */
}

.top-controls {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

/* Neon control buttons */
.control-btn {
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    border: 2px solid #00ffff;
    border-radius: 8px;
    padding: 12px 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    
    box-shadow: 
        0 0 15px rgba(0, 255, 255, 0.3),
        inset 0 0 15px rgba(0, 255, 255, 0.1);
    
    transform: translateZ(5px);
    position: relative;
}

.control-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    border-color: #ff00ff;
    color: #ff00ff;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.5),
        inset 0 0 20px rgba(255, 0, 255, 0.1);
    transform: translateZ(8px) translateY(-2px);
}

.control-btn:active {
    transform: translateZ(3px) translateY(1px);
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.4),
        inset 0 0 10px rgba(0, 255, 255, 0.2);
}

.direction-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transform-style: preserve-3d;
}

.direction-row {
    display: flex;
    gap: 8px;
}

/* 3D direction buttons with neon glow */
.direction-btn {
    background: rgba(255, 0, 255, 0.1);
    color: #ff00ff;
    border: 2px solid #ff00ff;
    border-radius: 8px;
    width: 104px;
    height: 104px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    touch-action: none; /* prevent scroll on direction buttons */
    
    box-shadow: 
        0 0 15px rgba(255, 0, 255, 0.4),
        inset 0 0 15px rgba(255, 0, 255, 0.1);
    
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateZ(8px);
    position: relative;
}

.direction-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.8),
        0 0 50px rgba(0, 255, 255, 0.4),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    transform: translateZ(12px) scale(1.05);
}

.direction-btn:active {
    transform: translateZ(5px) scale(0.95);
    box-shadow: 
        0 0 15px rgba(255, 0, 255, 0.5),
        inset 0 0 15px rgba(255, 0, 255, 0.2);
}

/* Control toggle styling */
.control-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #00ffff;
    font-size: 12px;
    font-weight: bold;
}

.toggle-input {
    appearance: none;
    width: 40px;
    height: 20px;
    background: rgba(255, 0, 255, 0.2);
    border: 2px solid #ff00ff;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 10px rgba(255, 0, 255, 0.3),
        inset 0 0 10px rgba(255, 0, 255, 0.1);
}

.toggle-input:checked {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
}

.toggle-input::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    background: #ff00ff;
    border-radius: 50%;
    top: 1px;
    left: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.6);
}

.toggle-input:checked::before {
    background: #00ffff;
    transform: translateX(18px);
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.6);
}

.toggle-text {
    text-shadow: 0 0 10px currentColor;
}

/* Responsive design for neon theme */
@media (max-width: 600px) {
    .game-container {
        margin: 0;
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        transform: rotateX(3deg) rotateY(0deg);
        border-radius: 0;
    }
    
    #gameCanvas {
        max-width: 100%;
        max-height: 100%; /* let flex layout control height, not a fixed pixel cap */
    }
    
    .direction-btn {
        width: 91px;
        height: 91px;
        font-size: 26px;
    }
}

/* Enhanced fullscreen neon styles */
.fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100dvh !important; /* dvh excludes Android nav bar in fullscreen */
    max-width: none !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    z-index: 9999;
    transform: none !important;
}

.fullscreen #gameCanvas {
    max-width: 80dvh;
    max-height: 80dvh;
}

/* Neon version badge */
.version {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    padding: 8px 12px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid #00ffff;
    box-shadow: 
        0 0 10px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    z-index: 10;
}

/* ===== SPLASH SCREEN ===== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background:
        radial-gradient(circle at 25% 75%, rgba(255, 0, 255, 0.4) 0%, transparent 45%),
        radial-gradient(circle at 75% 25%, rgba(0, 255, 255, 0.4) 0%, transparent 45%),
        radial-gradient(circle at 50% 50%, rgba(136, 0, 255, 0.2) 0%, transparent 60%),
        linear-gradient(135deg, #000000 0%, #000a14 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: splashPulse 3s ease-in-out infinite alternate;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.splash-screen.fade-out {
    animation: fadeOut 0.4s ease-out forwards;
}

@keyframes fadeOut {
    to { opacity: 0; pointer-events: none; }
}

@keyframes splashPulse {
    0% { filter: brightness(0.8); }
    100% { filter: brightness(1.15); }
}

.splash-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 36px;
    padding: 30px 20px;
}

.splash-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.splash-title {
    font-size: 56px;
    font-weight: bold;
    letter-spacing: 10px;
    line-height: 1.1;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    animation: splashTitleGlow 2s ease-in-out infinite alternate;
}

@keyframes splashTitleGlow {
    0% {
        text-shadow: 0 0 20px #00ffff, 0 0 50px #00ffff, 0 0 80px #00ffff;
        color: #00ffff;
    }
    100% {
        text-shadow: 0 0 20px #ff00ff, 0 0 50px #ff00ff, 0 0 90px #ff00ff;
        color: #ff00ff;
    }
}

.splash-subtitle {
    font-size: 14px;
    letter-spacing: 5px;
    color: rgba(0, 255, 255, 0.6);
    font-family: 'Courier New', monospace;
}

/* Animated snake segments in splash */
.splash-snake-preview {
    display: flex;
    gap: 8px;
    animation: snakeFloat 1.2s ease-in-out infinite;
}

@keyframes snakeFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.preview-segment {
    width: 28px;
    height: 28px;
    border: 2px solid #00ffff;
    border-radius: 5px;
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 12px #00ffff, inset 0 0 8px rgba(0, 255, 255, 0.1);
}

.preview-segment.head {
    border-color: #ff00ff;
    background: rgba(255, 0, 255, 0.15);
    box-shadow: 0 0 18px #ff00ff, inset 0 0 8px rgba(255, 0, 255, 0.1);
}

.preview-segment.b1 { border-color: #00ffff; }
.preview-segment.b2 { border-color: #00ff88; box-shadow: 0 0 12px #00ff88; }
.preview-segment.b3 { border-color: #8800ff; box-shadow: 0 0 12px #8800ff; }

.splash-tap-text {
    font-size: 18px;
    letter-spacing: 4px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    animation: tapBlink 1.5s ease-in-out infinite;
}

@keyframes tapBlink {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; text-shadow: 0 0 20px #00ffff, 0 0 40px #00ffff; }
}

/* Splash screen menu buttons */
.splash-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 280px;
    align-items: center;
}

.splash-menu-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: rgba(0, 255, 255, 0.08);
    border: 2px solid #00ffff;
    border-radius: 10px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.25);
}

.splash-menu-btn:hover,
.splash-menu-btn:focus {
    background: rgba(0, 255, 255, 0.18);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.55), inset 0 0 10px rgba(0, 255, 255, 0.1);
    transform: translateY(-2px);
    color: #fff;
}

.splash-menu-btn:active {
    transform: translateY(0);
}

.splash-menu-btn--primary {
    background: rgba(255, 0, 255, 0.12);
    border-color: #ff00ff;
    color: #ff00ff;
    box-shadow: 0 0 18px rgba(255, 0, 255, 0.35);
    font-size: 18px;
}

.splash-menu-btn--primary:hover {
    background: rgba(255, 0, 255, 0.25);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.6), inset 0 0 12px rgba(255, 0, 255, 0.15);
    color: #fff;
}

.splash-menu-btn--link {
    /* anchor styled as button — override default link colour */
    color: #00ffff;
}

.splash-menu-btn--back {
    margin-top: 8px;
    font-size: 14px;
    opacity: 0.8;
}

/* How to Play panel inside splash */
.splash-info-panel {
    width: 100%;
    max-width: 320px;
    text-align: left;
}

.splash-info-title {
    color: #ff00ff;
    font-family: 'Courier New', monospace;
    font-size: 17px;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 14px;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.6);
}

.splash-info-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.splash-info-list li {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: rgba(0, 255, 255, 0.9);
    padding-left: 14px;
    position: relative;
    line-height: 1.5;
}

.splash-info-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #ff00ff;
}

.splash-info-list strong {
    color: #ffff00;
}

/* ===== SETUP MODAL ===== */
.setup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    background: rgba(0, 0, 15, 0.93);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 20px));
    backdrop-filter: blur(12px);
    overflow-y: auto;
}

.setup-panel {
    background: rgba(0, 15, 35, 0.97);
    border: 2px solid #00ffff;
    border-radius: 16px;
    padding: 28px 22px;
    max-width: 460px;
    width: 100%;
    box-shadow:
        0 0 40px rgba(0, 255, 255, 0.5),
        0 0 80px rgba(0, 255, 255, 0.2),
        inset 0 0 20px rgba(0, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.setup-title {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 5px;
    color: #ff00ff;
    text-align: center;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 12px #ff00ff, 0 0 25px #ff00ff;
}

.setup-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.setup-section-label {
    font-size: 11px;
    letter-spacing: 3px;
    color: rgba(0, 255, 255, 0.55);
    font-family: 'Courier New', monospace;
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.15);
}

/* Speed option buttons */
.setup-speed-options {
    display: flex;
    gap: 8px;
}

.setup-speed-btn {
    flex: 1;
    background: rgba(255, 0, 255, 0.05);
    border: 2px solid rgba(255, 0, 255, 0.25);
    border-radius: 10px;
    padding: 12px 6px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    color: rgba(255, 0, 255, 0.5);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-height: 85px;
    justify-content: center;
}

.setup-speed-btn.selected {
    background: rgba(255, 0, 255, 0.15);
    border-color: #ff00ff;
    color: #ff00ff;
    box-shadow: 0 0 18px rgba(255, 0, 255, 0.45), inset 0 0 10px rgba(255, 0, 255, 0.1);
}

.setup-speed-btn:hover:not(.selected) {
    border-color: rgba(255, 0, 255, 0.55);
    color: rgba(255, 0, 255, 0.75);
}

.setup-option-name {
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 2px;
}

.setup-option-value {
    font-size: 24px;
    font-weight: bold;
}

.setup-option-points {
    font-size: 10px;
    opacity: 0.85;
    letter-spacing: 1px;
}

/* Control option buttons */
.setup-control-options {
    display: flex;
    gap: 12px;
}

.setup-control-btn {
    flex: 1;
    background: rgba(0, 255, 255, 0.05);
    border: 2px solid rgba(0, 255, 255, 0.25);
    border-radius: 10px;
    padding: 16px 10px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    color: rgba(0, 255, 255, 0.5);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 95px;
    justify-content: center;
}

.setup-control-btn.selected {
    background: rgba(0, 255, 255, 0.15);
    border-color: #00ffff;
    color: #00ffff;
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.45), inset 0 0 10px rgba(0, 255, 255, 0.1);
}

.setup-control-btn:hover:not(.selected) {
    border-color: rgba(0, 255, 255, 0.55);
    color: rgba(0, 255, 255, 0.75);
}

.setup-control-icon {
    font-size: 20px;
    letter-spacing: 2px;
}

.setup-control-name {
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    text-align: center;
    line-height: 1.5;
}

/* Tilt notice (shown when tilt controls selected) */
.tilt-notice {
    background: rgba(255, 200, 0, 0.08);
    border: 1px solid rgba(255, 200, 0, 0.45);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #ffc800;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.55;
}

.tilt-notice-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: -2px;
}

/* Begin game button */
.begin-btn {
    background: rgba(0, 255, 255, 0.08);
    border: 2px solid #00ffff;
    border-radius: 10px;
    padding: 16px;
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 17px;
    font-weight: bold;
    letter-spacing: 4px;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
    text-shadow: 0 0 10px #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.25), inset 0 0 15px rgba(0, 255, 255, 0.05);
}

.begin-btn:hover {
    background: rgba(0, 255, 255, 0.18);
    box-shadow: 0 0 35px rgba(0, 255, 255, 0.55), inset 0 0 20px rgba(0, 255, 255, 0.1);
    transform: translateY(-2px);
}

.begin-btn:active {
    transform: translateY(0);
}
/* Instructions accordion */
.setup-section-label--toggle {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s;
}

.setup-section-label--toggle:hover {
    color: rgba(0, 255, 255, 0.85);
}

.toggle-chevron {
    font-size: 10px;
    opacity: 0.7;
}

.setup-instructions {
    padding: 10px 4px 4px;
}

.instructions-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 0;
}

.instructions-list li {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: rgba(0, 255, 255, 0.75);
    line-height: 1.55;
    padding-left: 14px;
    position: relative;
}

.instructions-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #00ffff;
    opacity: 0.5;
}

.instructions-list li strong {
    color: #00ffff;
}

/* Contact link in setup modal */
.setup-contact-link {
    display: block;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 2px;
    color: rgba(0, 255, 255, 0.5);
    text-decoration: none;
    padding: 8px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.setup-contact-link:hover {
    color: #00ffff;
    border-color: rgba(0, 255, 255, 0.55);
    background: rgba(0, 255, 255, 0.07);
    text-shadow: 0 0 10px #00ffff;
}

/* Game over buttons layout */
.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.game-over-replay-btn {
    width: 100%;
    background: rgba(255, 0, 255, 0.12);
    border-color: #ff00ff;
    color: #ff00ff;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.35);
}

.game-over-replay-btn:hover {
    background: rgba(255, 0, 255, 0.22);
    box-shadow: 0 0 25px rgba(255, 0, 255, 0.55);
}

.game-over-contact-btn {
    width: 100%;
    text-decoration: none;
    text-align: center;
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid rgba(0, 255, 255, 0.45);
    color: rgba(0, 255, 255, 0.7);
    background: rgba(0, 255, 255, 0.07);
    transition: all 0.2s ease;
    cursor: pointer;
}

.game-over-contact-btn:hover {
    border-color: #00ffff;
    color: #00ffff;
    background: rgba(0, 255, 255, 0.14);
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.4);
}

/* ===== LEADERBOARD STYLES (neon theme) ===== */

/* Sales pitch box on game-over screen */
#sales-pitch {
    margin: 12px 0;
    padding: 12px 16px;
    background: rgba(255, 100, 0, 0.10);
    border: 1px solid rgba(255, 100, 0, 0.45);
    border-radius: 8px;
    text-align: center;
}

.cta-text {
    color: #ff8800;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
    margin: 0;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 8px rgba(255, 136, 0, 0.5);
}

/* Leaderboard panel inside game-over screen */
#leaderboard-panel {
    margin: 12px 0;
    padding: 14px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.25);
    border-radius: 8px;
    text-align: left;
}

#leaderboard-panel h3 {
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    margin: 0 0 10px;
    text-align: center;
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.5);
}

#leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.lb-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 4px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.lb-entry:last-child { border-bottom: none; }

.lb-rank {
    color: #00ffff;
    font-weight: bold;
    min-width: 22px;
    text-shadow: 0 0 6px rgba(0, 255, 255, 0.5);
}

.lb-name {
    flex: 1;
    text-align: left;
    padding: 0 8px;
    color: rgba(0, 255, 255, 0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-score {
    color: #ffff00;
    font-weight: bold;
    text-shadow: 0 0 6px rgba(255, 255, 0, 0.5);
}

.lb-loading, .lb-empty {
    color: rgba(0, 255, 255, 0.4);
    font-style: italic;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    text-align: center;
    padding: 4px 0;
}

.lb-status {
    font-size: 10px;
    color: rgba(0, 255, 255, 0.4);
    margin-top: 6px;
    text-align: center;
    font-family: 'Courier New', monospace;
}

/* Share button in game-over screen */
.game-over-share-btn {
    width: 100%;
    background: rgba(0, 255, 136, 0.1);
    border-color: #00ff88;
    color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.game-over-share-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.5);
}

/* Standalone leaderboard overlay */
#leaderboard-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 5, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    backdrop-filter: blur(8px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

#leaderboard-modal {
    background: rgba(0, 10, 25, 0.98);
    border: 2px solid #00ffff;
    border-radius: 16px;
    padding: 28px;
    min-width: 280px;
    max-width: 380px;
    width: 90%;
    box-shadow:
        0 0 30px rgba(0, 255, 255, 0.3),
        0 0 60px rgba(0, 255, 255, 0.1),
        inset 0 0 20px rgba(0, 255, 255, 0.05);
}

#leaderboard-modal h2 {
    color: #00ffff;
    font-family: 'Courier New', monospace;
    text-align: center;
    margin: 0 0 16px;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
    letter-spacing: 3px;
}

#leaderboard-overlay-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

#closeLeaderboardBtn {
    display: block;
    margin: 0 auto;
    background: rgba(255, 0, 255, 0.1);
    border: 2px solid #ff00ff;
    color: #ff00ff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 12px rgba(255, 0, 255, 0.3);
}

#closeLeaderboardBtn:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 22px rgba(255, 0, 255, 0.5);
    transform: translateY(-2px);
}

/* Neon toast notification */
#neon-toast {
    position: fixed;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 10, 25, 0.95);
    border: 1px solid rgba(0, 255, 255, 0.5);
    color: #00ffff;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 500;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

#neon-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
