:root {
    --primary-red: #ff0000;
    --accent-red: #cc0000;
    --bg-black: #000000;
    --card-bg: rgba(20, 20, 20, 0.8);
    --text-white: #ffffff;
    --text-gray: #a0a0a0;
    --glass-border: rgba(255, 0, 0, 0.2);
    --neon-glow: 0 0 20px rgba(255, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
    background-color: var(--bg-black);
    font-family: 'Outfit', sans-serif;
    color: var(--text-white);
}

/* Background Layers */
#hero-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url('../assets/hero-left.png'), 
        url('../assets/hero-right.png');
    background-position: 
        left center, 
        right center;
    background-repeat: no-repeat;
    background-size: auto 100%;
    background-color: #000;
    z-index: -1;
}

#hero-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(circle at center, black, transparent 90%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 90%);
}

#overlay-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    z-index: -2;
    pointer-events: none;
}

#main-ui {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh; /* Fixed height to enable internal scroll */
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 5vh;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
    opacity: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* When game is active, we hide main-ui via class added in JS or simple display:none */
#main-ui.hidden {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

/* Header */
#app-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-text {
    font-family: 'Syncopate', 'Arial Black', sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 10px;
    background: linear-gradient(to bottom, #fff 50%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.4));
}

.accent-red {
    -webkit-text-fill-color: var(--primary-red);
}

.tagline {
    font-size: 0.9rem;
    letter-spacing: 5px;
    color: var(--text-gray);
    margin-top: 5px;
    font-weight: 300;
}

/* Game Selection */
#menu-container {
    width: 100%;
    max-width: 1000px;
    padding: 0 20px;
}

#game-selection {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}

.game-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary-red);
    opacity: 0.3;
    transition: opacity 0.4s;
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-red);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(255, 0, 0, 0.1);
}

.game-card:hover::before {
    opacity: 1;
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.game-card h2 {
    font-family: 'Syncopate', 'Arial Black', sans-serif;
    font-size: 1.4rem;
    margin: 0 0 15px 0;
    color: var(--text-white);
    letter-spacing: 2px;
}

.game-rules {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
    text-align: left;
}

.game-rules li {
    font-size: 0.95rem;
    color: var(--text-gray);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--primary-red);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Action Buttons */
.action-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-family: 'Syncopate', 'Arial Black', sans-serif;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 2px;
    cursor: pointer;
    background: #fff;
    color: #000;
    transition: all 0.3s ease;
}

.game-card:hover .action-btn {
    background: var(--primary-red);
    color: #fff;
    box-shadow: var(--neon-glow);
}

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

/* Locked & Secret Card Styles */
.game-card.locked {
    filter: grayscale(1) opacity(0.5);
    cursor: not-allowed;
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.game-card.secret {
    background: rgba(10, 10, 10, 0.9);
    border: 2px dashed rgba(255, 0, 0, 0.3);
    opacity: 0.8;
    filter: none;
    position: relative;
}

.game-card.secret .card-content {
    pointer-events: none;
}

.game-card.locked:hover {
    transform: none;
    box-shadow: none;
}

.game-card.locked::before {
    display: none;
}

.action-btn.disabled {
    background: #222 !important;
    color: #444 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}
#video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease;
}

#video-container:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

video, canvas {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    transform: scaleX(-1);
}

/* Overlays */
#fps-overlay {
    position: fixed;
    top: 25px;
    left: 25px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    padding: 8px 15px;
    border-radius: 10px;
    font-family: 'Syncopate', sans-serif;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--text-gray);
    z-index: 100;
    border-left: 3px solid var(--primary-red);
}

.divider {
    margin: 0 8px;
    opacity: 0.3;
}

.fps-val {
    color: #fff;
    font-weight: bold;
}

/* Home Button */
.home-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    padding: 0 22px;
    height: 50px;
    border-radius: 12px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    font-family: 'Syncopate', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

.home-btn svg {
    transition: transform 0.3s ease;
}

.home-btn:hover {
    background: var(--primary-red);
    border-color: #fff;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
    transform: translateY(-2px);
}

.home-btn:hover svg {
    transform: translateX(-4px);
}

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

#status {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-gray);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 4px;
    z-index: 100;
}

/* Score Overlay */
#score-container {
    position: fixed;
    top: 25px;
    right: 25px;
    text-align: right;
    z-index: 100;
}

.score-label {
    display: block;
    font-family: 'Syncopate', sans-serif;
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--primary-red);
    margin-bottom: 2px;
}

#score-val {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

/* Gameplay Elements */
#countdown {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18vw;
    font-weight: 900;
    font-family: 'Syncopate', sans-serif;
    color: white;
    z-index: 1000;
    pointer-events: none;
}

@keyframes countdown-pulse {
    0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; filter: blur(20px); }
    30% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; filter: blur(0px); }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; filter: blur(5px); }
}

.countdown-animate {
    animation: countdown-pulse 1s ease-out forwards;
}

/* FOOTER STEERING */
footer {
    position: relative;
    width: 100%;
    margin-top: auto;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    padding: 8px 20px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0;
    z-index: 10;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.footer-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.footer-row .footer-item + .footer-item::before,
.footer-row.row-1 + .footer-row.row-2::before {
    content: '|';
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.1);
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    line-height: normal; /* Back to normal but with flex centering */
}

.footer-item span, .footer-item a {
    display: inline-flex;
    align-items: center;
}

.footer-icon {
    margin-right: 4px;
    font-size: 1.1em;
    line-height: 0;
}

footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--primary-red);
}

.badge-img {
    height: 16px;
    opacity: 0.6;
}

/* Hidden canvas for processing */
#hidden-canvas {
    display: none;
}

.hidden {
    display: none !important;
}

/* Mobile Responsive */
@media (max-width: 800px) {
    #hero-bg {
        background-size: auto 60%;
        background-position: left bottom, right bottom;
        opacity: 0.7;
    }

    #app-header {
        position: relative;
        top: auto;
        z-index: 10;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border-bottom: none;
        margin-bottom: 20px;
        padding-top: 40px;
    }

    #game-selection {
        display: grid;
        grid-template-columns: 1fr;
        padding: 0 20px;
        gap: 20px;
    }
    
    .logo-text {
        font-size: 1.8rem;
        letter-spacing: 4px;
    }
    
    #main-ui {
        position: relative;
        padding-top: 0;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        -webkit-overflow-scrolling: touch;
    }

    #menu-container {
        padding-bottom: 20px;
    }

    #status {
        position: relative;
        bottom: auto;
        left: auto;
        transform: none;
        margin: 40px auto 20px auto;
        text-align: center;
    }

    footer {
        flex-direction: column; 
        padding: 10px 10px calc(8px + env(safe-area-inset-bottom)) 10px;
        font-size: 9px;
        gap: 8px;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    .footer-row {
        gap: 0;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    #fps-overlay {
        top: auto;
        bottom: 25px;
        right: 25px;
        left: auto;
        border-left: none;
        border-right: 3px solid var(--primary-red);
    }

    .footer-row.row-1 + .footer-row.row-2::before {
        display: none;
    }

    .footer-item {
        white-space: normal; 
        text-align: center;
        justify-content: center;
    }
}

/* Score Highlights for Rules */
.pts {
    font-weight: 900;
    font-family: 'Syncopate', sans-serif;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
.pts-up {
    color: #00ffcc;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.5);
}
.pts-down {
    color: #ff9900;
    text-shadow: 0 0 10px rgba(255, 153, 0, 0.5);
}
.pts-penalty {
    color: #ff0055;
    text-shadow: 0 0 10px rgba(255, 0, 85, 0.5);
}

/* Timer Selector Styles */
.timer-selector-container {
    margin-bottom: 20px;
    text-align: left;
}

.timer-label {
    display: block;
    font-family: 'Syncopate', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--primary-red);
    margin-bottom: 8px;
    padding-left: 5px;
    opacity: 0.9;
}

.timer-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 14px;
}

.timer-btn {
    flex: 1;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-gray);
    padding: 8px 0;
    border-radius: 10px;
    font-family: 'Syncopate', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.timer-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.1);
}

.timer-btn.active {
    background: var(--primary-red);
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

/* Infinity symbol specific styling */
.timer-btn[data-time="0"] {
    font-size: 1.3rem;
    line-height: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* On-Game Timer Display */
#game-timer {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 10px 25px;
    border-radius: 12px;
    font-family: 'Syncopate', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-white);
    border: 1px solid var(--glass-border);
    letter-spacing: 2px;
    z-index: 100;
}

/* Game Over Overlay */
#game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.game-over-content {
    text-align: center;
    padding: 40px;
    border: 2px solid var(--primary-red);
    border-radius: 30px;
    background: radial-gradient(circle at center, #1a0000 0%, #000 100%);
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.2);
    max-width: 90%;
    width: 400px;
}

.glitch-text {
    font-family: 'Syncopate', sans-serif;
    font-size: 2.5rem;
    margin: 0 0 30px 0;
    color: #fff;
    text-shadow: 3px 3px var(--primary-red);
    letter-spacing: 5px;
}

.final-score-container {
    margin-bottom: 40px;
}

.final-score-container .label {
    display: block;
    color: var(--text-gray);
    font-size: 0.8rem;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

/* Critical Timer Pulse */
.timer-critical {
    color: var(--primary-red) !important;
    border-color: var(--primary-red) !important;
    animation: timer-pulse 0.5s ease-in-out infinite alternate;
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.4);
}

@keyframes timer-pulse {
    from { transform: translateX(-50%) scale(1); }
    to { transform: translateX(-50%) scale(1.1); }
}

#final-score-val {
    font-size: 5.5rem;
    font-weight: 900;
    color: var(--primary-red);
    text-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
    line-height: 1;
    margin-top: 10px;
    display: block;
}

.game-stats {
    margin: 20px 0 30px 0;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.stat-row:last-child {
    border-bottom: none;
}

/* Header Top & Ghost Button */
#menu-toggle {
    position: absolute;
    top: 20px;
    left: 30px;
    z-index: 200;
}

.header-top {
    position: absolute;
    top: 80px;
    left: 30px;
    z-index: 100;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-closed {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-15px);
}

.menu-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 55px;
}

.nav-label {
    font-family: 'Syncopate', sans-serif;
    font-size: 0.5rem;
    font-weight: 700;
    color: var(--primary-red);
    opacity: 0.8;
    letter-spacing: 1px;
}

.ghost-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-gray);
    padding: 0 16px;
    height: 36px;
    border-radius: 8px;
    font-family: 'Syncopate', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ghost-btn:hover {
    border-color: var(--primary-red);
    color: #fff;
    background: rgba(255, 0, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.2);
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    border: 1px solid var(--primary-red);
    color: var(--primary-red);
    background: rgba(255, 0, 0, 0.05);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) {
    .icon-btn:hover {
        background: var(--primary-red);
        color: #fff !important;
        box-shadow: 0 0 15px var(--primary-red);
        transform: translateY(-2px);
    }
}

.icon-btn.menu-active {
    background: var(--primary-red);
    color: #fff !important;
    box-shadow: 0 0 20px var(--primary-red);
}

.icon-btn svg line {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.menu-active .line-1 {
    transform: translateY(6px) rotate(45deg);
}

.menu-active .line-2 {
    opacity: 0;
    transform: scaleX(0);
}

.menu-active .line-3 {
    transform: translateY(-6px) rotate(-45deg);
}

.icon-btn svg {
    display: block;
    fill: currentColor;
}

.icon-btn svg[stroke="currentColor"] {
    stroke: currentColor;
    fill: none;
}

/* About & Privacy Overlays */
#about-overlay, #privacy-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 3000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.about-content {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    width: 100%;
    max-width: 500px;
    padding: 40px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modal-fade-in 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-fade-in {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.about-title {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 30px;
    letter-spacing: 2px;
    text-align: center;
}

.about-section {
    margin-bottom: 25px;
}

.about-section h3 {
    font-family: 'Syncopate', sans-serif;
    font-size: 0.8rem;
    color: var(--primary-red);
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.about-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-gray);
    margin: 0;
}

.highlights {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 20px;
    margin: 30px 0;
}

.highlight-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.highlight-item .icon {
    font-size: 1.2rem;
}

.highlight-item small {
    display: block;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.about-footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-gray);
    font-style: italic;
    opacity: 0.7;
    margin-top: 30px;
}

.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-modal-btn:hover {
    background: var(--primary-red);
    transform: rotate(90deg);
}

@media (max-width: 800px) {
    #app-header {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 25px 0 0 0;
    }

    .logo-text { order: 1; margin: 0; font-size: 1.5rem; letter-spacing: 2px; }
    .tagline { order: 2; margin-top: 5px; font-size: 0.75rem; }

    #menu-toggle {
        position: absolute;
        top: 15px;
        left: 10px;
        z-index: 1000;
        background: transparent;
        backdrop-filter: none;
    }

    .header-top {
        order: 3;
        position: relative;
        top: auto;
        right: auto;
        left: auto;
        margin-top: 10px;
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 20px;
        padding: 0;
        border-top: 1px solid rgba(255, 0, 0, 0);
        border-bottom: 1px solid rgba(255, 0, 0, 0);
        background: rgba(255, 0, 0, 0);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .menu-closed {
        /* Already handled by base state on mobile */
    }

    .menu-open {
        max-height: 120px;
        opacity: 1;
        padding: 20px 0;
        margin-top: 25px;
        border-top: 1px solid rgba(255, 0, 0, 0.4);
        border-bottom: 1px solid rgba(255, 0, 0, 0.4);
        background: rgba(255, 0, 0, 0.05);
    }
    
    .nav-group {
        gap: 4px;
        min-width: 50px;
    }

    .nav-label {
        font-size: 0.45rem;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
    }
    
    .about-content {
        padding: 40px 20px 30px 20px;
        margin: 20px 0;
        max-height: none;
    }
    
    #about-overlay, #privacy-overlay {
        align-items: flex-start;
        overflow-y: auto;
        padding: 20px;
    }
    
    .highlights {
        grid-template-columns: 1fr;
    }
}

.stat-label {
    color: var(--text-gray);
    text-transform: uppercase;
}

.stat-value {
    font-weight: 700;
    color: var(--text-white);
}

.stat-value.pos { color: #00ffcc; }
.stat-value.neg { color: #ff0055; }

/* Tutorial Overlay Styles */
#tutorial-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000; /* Above everything */
    opacity: 0;
    animation: fadeIn 0.4s ease forwards;
}

#tutorial-overlay.hidden {
    display: none !important;
}

.tutorial-content {
    background: linear-gradient(135deg, rgba(30, 0, 0, 0.95) 0%, rgba(10, 10, 10, 0.95) 100%);
    border: 2px solid var(--primary-red);
    border-radius: 32px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 0, 0, 0.2);
    transform: translateY(20px);
    animation: slideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

#tutorial-title {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.5rem;
    letter-spacing: 5px;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.tutorial-media {
    width: 100%;
    aspect-ratio: 1/1;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

#tutorial-gif {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#tutorial-instructions {
    font-size: 1rem;
    color: var(--text-gray);
    line-height: 1.6;
    margin-bottom: 30px;
}

#tutorial-instructions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#tutorial-instructions li {
    margin-bottom: 8px;
}

#tutorial-ok-btn {
    background: var(--primary-red);
    color: #fff;
    font-size: 1rem;
    padding: 18px;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

#tutorial-ok-btn:hover {
    background: #fff;
    color: #000;
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Mobile adjustments for tutorial */
@media (max-width: 600px) {
    .tutorial-content {
        padding: 25px;
    }
    #tutorial-title {
        font-size: 1.2rem;
    }
}

/* Interlock Fingers Overlay Styles */
#interlock-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 1500;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: fadeIn 0.4s ease forwards;
}

.interlock-content {
    text-align: center;
    padding: 35px 40px;
    border: 2px solid var(--primary-red);
    border-radius: 24px;
    background: radial-gradient(circle at center, #1a0000 0%, #000000 100%);
    box-shadow: 0 0 55px rgba(255, 0, 0, 0.25);
    max-width: 90%;
    width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: slideUp 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

.interlock-img {
    width: 160px;
    height: auto;
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.35));
    animation: interlock-pulse 1.6s ease-in-out infinite alternate;
}

.interlock-text {
    font-family: 'Syncopate', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
    margin: 0;
}

.interlock-subtext {
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    color: var(--text-gray);
    letter-spacing: 1px;
    margin: 0;
}

@keyframes interlock-pulse {
    from {
        transform: scale(0.96) rotate(-1deg);
        filter: drop-shadow(0 0 12px rgba(255, 0, 0, 0.25));
    }
    to {
        transform: scale(1.04) rotate(1deg);
        filter: drop-shadow(0 0 25px rgba(255, 0, 0, 0.55));
    }
}
