:root {
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --primary-yellow: #FBBF24;
    --primary-yellow-glow: rgba(251, 191, 36, 0.4);
    --text-white: #ffffff;
    --text-gray: #a3a3a3;
    --font-main: 'Outfit', sans-serif;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography Utilities */
.text-center { text-align: center; }
.pb-4 { padding-bottom: 2rem; }

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}
.section-padding {
    padding: 6rem 1.5rem;
}

/* Navigation */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 10000; /* Higher than transitions if needed, but menu usually needs to be higher */
    transition: background-color 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
    padding: 1.5rem 0;
    background-color: transparent;
}

header.scrolled {
    background-color: rgba(8, 8, 8, 0.97);
    backdrop-filter: blur(14px);
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--glass-border);
}

/* Compact logo in scrolled state */
header.scrolled .logo-img {
    height: 36px;
}

/* Compact nav links in scrolled state */
header.scrolled .nav-links {
    gap: 1.2rem;
}

header.scrolled .nav-links a {
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 700;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.logo span {
    color: var(--primary-yellow);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--primary-yellow);
    transition: width 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-yellow);
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 800px;
    padding: 0 1.5rem;
}

.hero h2 {
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, #fff, #a3a3a3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.desktop-only {
    display: inline-block;
}

.mobile-hero-links {
    display: none;
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    max-width: 320px;
    margin: 2.5rem auto 0;
}

.mobile-btn {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-white);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--primary-yellow);
}

.mobile-btn:active {
    background: var(--primary-yellow);
    color: var(--bg-dark);
    transform: scale(0.96);
}

.btn-icon {
    font-size: 1.4rem;
    margin-right: 1rem;
    background: rgba(255,255,255,0.05);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.btn-text {
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.85rem;
}


.hero p {
    font-size: 1.25rem;
    color: var(--text-gray);
    margin-bottom: 2.5rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: var(--primary-yellow);
    color: var(--bg-dark);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 15px var(--primary-yellow-glow);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--primary-yellow-glow);
}

/* Hero Background Elements */
.hero-bg-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.circle-1 {
    width: 500px;
    height: 500px;
    background-color: var(--primary-yellow);
    top: -100px;
    right: -100px;
    animation: float 10s ease-in-out infinite alternate;
}

.circle-2 {
    width: 400px;
    height: 400px;
    background-color: #ffffff;
    bottom: -100px;
    left: -100px;
    animation: float 8s ease-in-out infinite alternate-reverse;
}

/* Games Section */
.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-top: 2rem;
}

.game-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    backdrop-filter: blur(10px);
}

.game-card:hover {
    transform: translateY(-10px);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.card-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
    background-color: #1a1a1a;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.game-card:hover .card-image img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--primary-yellow);
    color: var(--bg-dark);
    padding: 0.25rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 0 10px var(--primary-yellow-glow);
}

.card-body {
    padding: 2rem;
}

.card-body h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-white);
}

.card-body p {
    color: var(--text-gray);
    font-size: 1rem;
}

/* About Section */
.about-section {
    background-color: var(--bg-darker);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-content p {
    font-size: 1.25rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

.highlight-text {
    color: var(--primary-yellow) !important;
    font-weight: 700;
    font-style: italic;
}

/* Footer */
footer {
    padding: 3rem 0;
    background-color: var(--bg-dark);
}

footer h3 {
    font-size: 1.5rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

footer p {
    color: #555;
    font-size: 0.9rem;
}

/* Animations */
@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(30px, 50px); }
}

.slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.8s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in {
    /* Visible by default — JS will handle the animation */
    opacity: 1;
    transform: none;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Only hide elements when JS is confirmed running */
.js-ready .fade-in {
    opacity: 0;
    transform: translateY(20px);
}

.js-ready .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }

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

/* Dynamic Games Page Styling */
.dynamic-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-color: var(--bg-dark);
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.25);
    transform: scale(1.1);
    z-index: 0;                          /* 0, not -1 — avoids falling behind body bg */
    pointer-events: none;                /* NEVER intercept clicks */
    transition: background-image 1s ease-in-out, opacity 1s ease-in-out;
    opacity: 0;
}

.games-scroll-container {
    position: relative;
    z-index: 10;
}

/* ======= TIMELINE ======= */
.timeline-container {
    position: fixed;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.timeline-track {
    position: absolute;
    left: 7px;
    top: 0;
    width: 3px;
    height: 100%;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.timeline-progress {
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, #FBBF24, #FFF176);
    border-radius: 3px;
    transition: height 0.1s linear;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
}

.timeline-node {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
    cursor: default;
}

.node-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.4s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.node-dot.active {
    background: #FBBF24;
    border-color: #FBBF24;
    box-shadow: 0 0 14px rgba(251,191,36,0.9), 0 0 30px rgba(251,191,36,0.4);
    transform: scale(1.3);
}

.node-label {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    opacity: 0.4;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateX(-5px);
}

.timeline-node:has(.node-dot.active) .node-label {
    opacity: 1;
    transform: translateX(0);
}

.node-date {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #FBBF24;
    text-transform: uppercase;
}

.node-title {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .timeline-container { display: none; }
}

.game-showcase-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 1.5rem;
    position: relative;
}

/* ===== SHOWCASE ENTRY ANIMATIONS ===== */
/* Only hide showcase children when JS is running */
.js-ready .game-showcase-section .fade-in .showcase-text,
.js-ready .game-showcase-section .fade-in .showcase-image {
    opacity: 0;
    transition: none;
}

/* Text slides in from the left */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Image glides in from the right */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(60px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Triggered when IntersectionObserver adds .visible to the parent .fade-in */
.js-ready .game-showcase-section .fade-in.visible .showcase-text {
    animation: slideInLeft 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.js-ready .game-showcase-section .fade-in.visible .showcase-image {
    animation: slideInRight 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards;
}


.showcase-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.showcase-text h2 {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.showcase-text p {
    font-size: 1.25rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
}

.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 1rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.showcase-image img {
    width: 100%;
    border-radius: 12px;
    display: block;
}


@media (max-width: 900px) {
    .showcase-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ===== GLURBUS WIPE PAGE TRANSITION ===== */

.page-transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--bg-darker);
    z-index: 999999;
    pointer-events: none; /* Always allow clicks to pass through by default */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.7s cubic-bezier(0.76, 0, 0.24, 1);
}

/* Glurbus Transition Logo */
.transition-logo {
    width: 12vh;
    height: auto;
    max-width: 120px;
    filter: drop-shadow(0 0 12px rgba(251, 191, 36, 0.5));
    transform: scale(0);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                opacity 0.4s ease;
}

/* ── Swipe IN: covers the screen when LEAVING ── */
.page-transition-overlay.swipe-in {
    transform: translateY(100%);
    border-top: 4px solid var(--primary-yellow);
}

.page-transition-overlay.swipe-in .transition-logo {
    transform: scale(0);
    opacity: 0;
}

.page-transition-overlay.swipe-in.active {
    transform: translateY(0);
    pointer-events: all;
}

.page-transition-overlay.swipe-in.active .transition-logo {
    transform: scale(1);
    opacity: 1;
    transition-delay: 0.15s;
}

/* ── Swipe OUT: reveals the screen on LOAD ── */
.page-transition-overlay.swipe-out {
    transform: translateY(0);
    border-bottom: 4px solid var(--primary-yellow);
    pointer-events: none; /* DO NOT block touches while the curtain is rising */
}

.page-transition-overlay.swipe-out .transition-logo {
    transform: scale(1);
    opacity: 1;
}

.page-transition-overlay.swipe-out.active {
    transform: translateY(-100%);
}

.page-transition-overlay.swipe-out.active .transition-logo {
    transform: scale(0);
    opacity: 0;
    transition-delay: 0s;
}

/* Custom Subpage Styles */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 90px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.logo:hover .logo-img {
    transform: scale(1.05);
}

.subpage-hero {
    position: relative;
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 80px; /* Offset for navbar */
    border-bottom: 1px solid var(--glass-border);
}

.subpage-hero-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-size: cover;
    background-position: center;
    filter: blur(8px) brightness(0.3);
    z-index: 1;
}

.subpage-hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 1.5rem;
}

.subpage-hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    background: linear-gradient(135deg, #FBBF24, #FFF);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
    font-weight: 900;
}

.subpage-hero-content p {
    font-size: 1.25rem;
    color: var(--text-white);
    max-width: 600px;
    margin: 0 auto;
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 12px;
    overflow: hidden;
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== EXPANDING THIN LINE VIDEOS ===== */
.thin-strip-video {
    padding-bottom: 0 !important;
    height: 120px !important;
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.thin-strip-video:hover {
    transform: scale(1.02);
    border-color: var(--yellow);
    box-shadow: 0 0 20px rgba(251,191,36,0.3);
}

.strip-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.3s ease, opacity 0.3s ease;
}

.thin-strip-video:hover .strip-overlay {
    background: rgba(0,0,0,0.4);
}

.play-hint {
    color: var(--yellow);
    font-weight: 700;
    letter-spacing: 0.1em;
    font-size: 1.2rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    transition: transform 0.3s ease;
}

.thin-strip-video:hover .play-hint {
    transform: scale(1.1);
}

/* THEATER MODE OVERLAY */
.theater-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5,5,5,0.95);
    backdrop-filter: blur(15px);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.theater-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.close-theater {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: #fff;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.3s, transform 0.3s;
    line-height: 1;
}

.close-theater:hover {
    color: var(--yellow);
    transform: scale(1.1);
}

/* When the video goes fullscreen */
.video-container.expanded-theater {
    position: fixed;
    z-index: 10000;
    /* Dimensions will be set via JS inline initially for FLIP, then changed to: */
    width: 90vw !important;
    max-width: 1200px !important;
    height: auto !important;
    padding-bottom: calc(90vw * 0.5625) !important; /* 16:9 ratio fallback */
    max-height: 80vh !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    cursor: default;
}

@media (min-width: 1200px) {
    .video-container.expanded-theater {
        padding-bottom: calc(1200px * 0.5625) !important;
    }
}

.video-container.expanded-theater:hover {
    transform: translate(-50%, -50%) !important; /* nullify hover effect */
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
}

.video-container.expanded-theater .strip-overlay {
    opacity: 0;
    pointer-events: none;
}

.download-section {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Base styles override for links on cards */
a.game-card {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ===== GLURBUS TV CINEMATIC LAYOUT ===== */
.tv-page-body {
    background-color: var(--bg-dark);
    position: relative;
    overflow-x: hidden;
}

/* Background Marquee */
.tv-marquee-bg {
    position: fixed;
    top: 50%;
    left: 0;
    width: 100vw;
    transform: translateY(-50%) rotate(-5deg) scale(1.2);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    z-index: 0;
    pointer-events: none;
    opacity: 0.03;
    color: var(--yellow);
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 900;
    white-space: nowrap;
    user-select: none;
}

.marquee-track {
    display: flex;
    animation: scrollMarquee 40s linear infinite;
}

.marquee-track.reverse {
    animation: scrollMarqueeReverse 35s linear infinite;
}

@keyframes scrollMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes scrollMarqueeReverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

/* TV Typography & Hero */
.pt-huge {
    padding-top: 15vh;
    padding-bottom: 5vh;
    position: relative;
    z-index: 10;
}

.tv-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 900;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-shadow: 0 5px 20px rgba(0,0,0,0.8);
}

.tv-subtitle {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

/* TV Grid Layout */
.tv-grid {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    padding-bottom: 4rem;
}

.tv-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(20, 20, 20, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.tv-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(251, 191, 36, 0.1);
}

/* Info Section */
.tv-info h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.tv-info p {
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    line-height: 1.7;
}

.tv-badge {
    display: inline-block;
    background: rgba(251,191,36,0.1);
    color: var(--yellow);
    border: 1px solid var(--yellow);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    animation: tvPulse 2s infinite;
}

@keyframes tvPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 10px rgba(251,191,36,0.3); }
    50% { opacity: 0.6; box-shadow: none; }
}

/* Player Wrapper & Ambilight Effect */
.tv-player-wrapper {
    position: relative;
    width: 100%;
}

.tv-ambilight {
    position: absolute;
    inset: -15px;
    background: var(--yellow);
    filter: blur(40px);
    opacity: 0.2;
    z-index: -1;
    border-radius: 20px;
    animation: ambilightGlow 4s ease-in-out infinite alternate;
}

@keyframes ambilightGlow {
    from { opacity: 0.15; transform: scale(0.98); }
    to { opacity: 0.35; transform: scale(1.02); }
}

.tv-glass-frame {
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.8);
    padding: 10px;    /* Creating a bezel */
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.8);
}

.tv-glass-frame iframe {
    border-radius: 8px; /* Inner screen rounded */
}

.tv-footer {
    position: relative;
    z-index: 10;
    background: transparent;
    border-top: 1px solid var(--glass-border);
}

/* ========== HAMBURGER BUTTON ========== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1100;
    position: relative;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-white);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* X animation when open */
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ========== MOBILE NAV DRAWER ========== */
@media (max-width: 768px) {
    .hamburger { display: flex; }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: rgba(8, 8, 8, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        border-left: 1px solid var(--glass-border);
    }

    .nav-links.mobile-open {
        right: 0;
    }

    .nav-links li { list-style: none; }

    .nav-links a {
        font-size: 1.6rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        display: block;
        padding: 1rem 2rem; /* Larger hit target for thumbs */
        touch-action: manipulation;
    }

    /* Dim overlay behind the drawer */
    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 1040;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s ease;
    }

    .nav-overlay.visible {
        opacity: 1;
        pointer-events: all;
    }

    /* General mobile layout fixes */
    .hero h2 { font-size: 2.2rem; }
    .hero p  { font-size: 1rem; }

    .section-padding { padding: 4rem 1rem; }

    /* Game cards stack on mobile */
    .games-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Subpage hero shorter */
    .subpage-hero { height: 40vh; margin-top: 70px; }
    .subpage-hero-content h1 { font-size: 2rem; }

    /* Timeline hidden on phones (already targeted but reaffirm) */
    .timeline-container { display: none !important; }

    /* Showcase stacks vertically */
    .showcase-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .showcase-text h2 { font-size: 2rem; }
    .showcase-text p  { font-size: 1rem; }

    /* Logo sizing in scrolled state on mobile */
    header.scrolled .logo-img { height: 30px; }

    .tv-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .tv-card {
        min-height: 250px;
    }

    .category-header h2 {
        font-size: 1.8rem;
    }

    footer .footer-content p {
        font-size: 0.8rem;
        padding: 0 1rem;
    }

    /* Home Hero Mobile Quick Links Only */
    .desktop-only {
        display: none !important;
    }

    .mobile-hero-links {
        display: flex !important;
    }

    .mobile-btn {
        animation: slideInLeft 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
        opacity: 0;
    }

    .mobile-btn:nth-child(1) { animation-delay: 0.2s; }
    .mobile-btn:nth-child(2) { animation-delay: 0.3s; }
    .mobile-btn:nth-child(3) { animation-delay: 0.4s; }
    .mobile-btn:nth-child(4) { animation-delay: 0.5s; }
    .mobile-btn:nth-child(5) { animation-delay: 0.6s; }
}

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