/* ================================================================
   WAVEMIRROR - DESIGN SYSTEM
   Aesthetic: neutral near-black, one accent, flat surfaces, no glow.
   Typography: Inter Tight (Display) + Inter (UI / Body)
   Colour is information here, never decoration: the accent marks
   what is selected, semantics mark state, everything else is grey.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400..800&family=Inter:opsz,wght@14..32,300..800&display=swap');

:root {
    /* ---- Surfaces: a neutral ramp, each step a real elevation ---- */
    --bg: #0a0a0b;               /* page */
    --surface-1: #121214;        /* cards, rails */
    --surface-2: #1a1a1d;        /* hover / raised */
    --surface-3: #232327;        /* inputs, chips, wells */
    --scrim: rgba(10, 10, 11, 0.72);

    /* ---- Lines ---- */
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);

    /* ---- Ink ---- */
    --text-main: #fafafa;        /* primary copy */
    --text-soft: #b4b4ba;        /* secondary copy / paragraphs */
    --text-muted: #86868e;       /* metadata, captions */
    --text-dim: #5c5c65;         /* tertiary, timestamps */

    /* ---- One accent. Selection and focus only, never decoration ---- */
    --accent: #6366f1;
    --accent-hover: #7c7ff5;
    --accent-quiet: rgba(99, 102, 241, 0.14);

    /* ---- Semantic: these earn their colour by meaning something ---- */
    --rating: #e5a53d;           /* score / star */
    --danger: #f2555a;           /* destructive */
    --online: #34c759;           /* live, connected */

    /* ---- Legacy aliases: old names, new values. One source of truth. ---- */
    --bg-dark: var(--bg);
    --bg-darker: #060607;
    --bg-card: var(--surface-1);
    --bg-card-hover: var(--surface-2);
    --bg-glass: rgba(10, 10, 11, 0.86);
    --bg-glass-heavy: rgba(10, 10, 11, 0.96);
    --border-glass: var(--line);
    --border-glow: var(--line-strong);
    --primary-neon: var(--accent);
    --primary-indigo: var(--accent);
    --primary-cyan: var(--accent);
    --primary-violet: var(--accent);
    --primary-gold: var(--rating);
    --accent-red: var(--danger);
    --accent-gold: var(--rating);
    --accent-emerald: var(--online);

    /* ---- Typography: families ---- */
    --font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-heading: var(--font-display);
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', 'Cascadia Mono', Menlo, Consolas, monospace;

    /* ---- Typography: fluid scale ---- */
    --fs-micro: 0.6875rem;                            /* 11px  - badges, keycaps */
    --fs-2xs:   0.75rem;                              /* 12px  - chips, tags */
    --fs-xs:    0.8125rem;                            /* 13px  - metadata */
    --fs-sm:    0.875rem;                             /* 14px  - UI labels, nav */
    --fs-base:  0.9375rem;                            /* 15px  - body copy */
    --fs-md:    1.0625rem;                            /* 17px  - lead copy */
    --fs-lg:    clamp(1.125rem, 0.4vw + 1.03rem, 1.3rem);
    --fs-xl:    clamp(1.35rem, 0.9vw + 1.1rem, 1.75rem);
    --fs-2xl:   clamp(1.7rem, 1.8vw + 1.2rem, 2.5rem);
    --fs-3xl:   clamp(2.25rem, 4vw + 1rem, 3.75rem);  /* hero display */

    /* ---- Typography: tracking (optical, tightens as size grows) ---- */
    --track-display: -0.035em;
    --track-tight: -0.022em;
    --track-snug: -0.014em;
    --track-normal: -0.006em;
    --track-caps: 0.085em;

    /* ---- Typography: leading ---- */
    --leading-display: 1.04;
    --leading-tight: 1.16;
    --leading-snug: 1.35;
    --leading-normal: 1.6;
    --leading-loose: 1.72;

    /* ---- Radii: four steps, consistently applied ---- */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    /* ---- Elevation: shadow describes height, not mood. Black only. ---- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-card: var(--shadow-md);
    --shadow-glow: var(--shadow-md);       /* legacy name, no glow */
    --shadow-glow-cyan: var(--shadow-md);  /* legacy name, no glow */

    /* ---- Space: a 4pt rhythm ---- */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* ---- Motion: short, linear-ish, never bouncy ---- */
    --ease: cubic-bezier(0.2, 0, 0, 1);
    --dur-fast: 120ms;
    --dur: 180ms;
    --transition: all var(--dur) var(--ease);
    --transition-smooth: all 260ms var(--ease);

    /* ---- Layout ---- */
    --nav-h: 60px;
    --container: 1440px;
    --gutter: clamp(1rem, 3vw, 2.5rem);
}

/* Reset & Global Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-body);
    font-size: 100%;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    font-weight: 400;
    font-optical-sizing: auto;
    font-synthesis-weight: none;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    padding-bottom: 96px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: var(--fs-base);
    font-weight: 400;
    line-height: var(--leading-normal);
    letter-spacing: var(--track-normal);
    text-rendering: optimizeLegibility;
    font-feature-settings: 'cv05' 1, 'cv11' 1, 'ss03' 1, 'calt' 1, 'liga' 1;
}

/* ================================================================
   TYPOGRAPHY SYSTEM
   One family, four jobs: display, title, body, label.
   ================================================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    color: var(--text-main);
    line-height: var(--leading-tight);
    letter-spacing: var(--track-tight);
    font-weight: 600;
    text-wrap: balance;
}
h1 { font-size: var(--fs-2xl); letter-spacing: var(--track-display); line-height: var(--leading-display); font-weight: 700; }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); letter-spacing: var(--track-snug); }
h5 { font-size: var(--fs-base); letter-spacing: var(--track-snug); }
h6 { font-size: var(--fs-sm); letter-spacing: var(--track-snug); }

p {
    color: var(--text-soft);
    line-height: var(--leading-normal);
    text-wrap: pretty;
}

small { font-size: var(--fs-xs); }

strong, b { font-weight: 600; }

a { color: inherit; }

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    letter-spacing: inherit;
}

/* Numerals in metadata rows stay column-aligned and never wobble */
.hero-meta, .movie-subinfo, .continue-card-sub, .meta-badge,
.rating-imdb, .card-badge-top, .footer-bottom, .badge-count {
    font-variant-numeric: tabular-nums;
}

/* Eyebrow / micro-label: the only place uppercase is allowed */
.eyebrow {
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
    color: var(--text-muted);
}

/* Lead paragraph under a section title */
.lead {
    font-size: var(--fs-md);
    line-height: var(--leading-normal);
    color: var(--text-soft);
    font-weight: 400;
    max-width: 62ch;
}

::selection {
    background: var(--accent);
    color: #fff;
}

/* ================================================================
   INTERACTION BASE
   Every control is reachable by keyboard and says so.
   ================================================================ */

/* One focus ring, one place. Visible on dark, never on mouse click. */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* Skip link: first tab stop on the page */
.skip-link {
    position: absolute;
    left: var(--space-4);
    top: -100px;
    z-index: 100000;
    padding: 0.7rem 1.1rem;
    background: var(--text-main);
    color: var(--bg);
    font-size: var(--fs-sm);
    font-weight: 550;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-4); }

/* Pointer only where something actually happens */
button, [role="button"], summary { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }

/* Honour the system setting. Motion is a preference, not a feature. */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Quiet, neutral scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-full);
    border: 3px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.26);
    background-clip: content-box;
}
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.18) transparent; }

/* ================================================================
   CINEMATIC LINE-BY-LINE CURTAIN LOADING SCREEN
   ================================================================ */
.curtain-loader {
    position: fixed;
    inset: 0;
    z-index: 100000;
    overflow: hidden;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.curtain-loader.curtain-revealed {
    pointer-events: none !important;
}
.curtain-loader.hidden {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* 12 Vertical Curtain Stripes (Line-by-Line Reveal) */
.curtain-stripes {
    position: absolute;
    inset: 0;
    display: flex;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.curtain-stripe {
    flex: 1;
    height: 100%;
    background: linear-gradient(180deg, #07080b 0%, #0d0f16 50%, #07080b 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
    transform: translateY(0);
    transition: transform 0.75s cubic-bezier(0.77, 0, 0.175, 1);
    transition-delay: calc(var(--stripe-idx) * 0.045s);
    will-change: transform;
}

/* Staggered Line-by-Line Retraction */
.curtain-loader.curtain-revealed .curtain-stripe:nth-child(odd) {
    transform: translateY(-102%);
}
.curtain-loader.curtain-revealed .curtain-stripe:nth-child(even) {
    transform: translateY(102%);
}

/* Center Curtain Branding & Progress */
.curtain-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.curtain-loader.curtain-revealed .curtain-content {
    opacity: 0;
    transform: scale(0.92);
    pointer-events: none;
}

.curtain-logo-wrap {
    position: relative;
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.curtain-logo-img {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    object-fit: cover;
    z-index: 2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    animation: curtainPulse 2s ease-in-out infinite alternate;
}
.curtain-logo-halo {
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.45) 0%, rgba(244, 63, 94, 0.25) 50%, transparent 70%);
    filter: blur(14px);
    z-index: 1;
    animation: curtainHaloRotate 4s linear infinite;
}

.curtain-brand {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
}
.curtain-brand-accent {
    color: var(--accent);
    text-shadow: 0 0 16px rgba(99, 102, 241, 0.5);
}

.curtain-progress-track {
    width: 180px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
}
.curtain-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #6366f1, #06b6d4, #f43f5e, #6366f1);
    background-size: 300% 100%;
    animation: curtainLaserProgress 1.4s infinite linear;
}

.curtain-tagline {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

@keyframes curtainPulse {
    0% { transform: scale(0.96); filter: brightness(0.95); }
    100% { transform: scale(1.04); filter: brightness(1.15); }
}
@keyframes curtainHaloRotate {
    0% { transform: rotate(0deg) scale(0.9); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(0.9); }
}
@keyframes curtainLaserProgress {
    0% { background-position: 0% 0; }
    100% { background-position: 300% 0; }
}

/* ================================================================
   SKELETON SHIMMER LOADERS
   ================================================================ */
.skeleton-card {
    background: var(--surface-1);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.04);
    min-height: 280px;
    pointer-events: none;
}
.skeleton-poster-wrap {
    width: 100%;
    aspect-ratio: 2 / 3;
    background: #13141a;
    position: relative;
    overflow: hidden;
}
.skeleton-shimmer {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.02) 100%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.6s infinite ease-in-out;
}
.skeleton-info {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.skeleton-line {
    border-radius: 4px;
    height: 12px;
}
.skeleton-line.title {
    width: 82%;
    height: 14px;
}
.skeleton-subinfo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.2rem;
}
.skeleton-line.sub {
    width: 38%;
    height: 10px;
}
.skeleton-line.rating {
    width: 25%;
    height: 10px;
}
@keyframes skeletonShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------------- Navigation Bar ---------------- */
.navbar {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    min-height: 64px;
    padding: 0 var(--gutter, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-5, 1rem);
    background: var(--bg-glass);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid transparent;
    transition: background var(--dur, 0.2s) var(--ease, ease), border-color var(--dur, 0.2s) var(--ease, ease);
    transform: translate3d(0, 0, 0);
}
/* The bar only asserts itself once content slides under it */
.navbar.scrolled {
    background: var(--bg-glass-heavy);
    border-bottom-color: var(--line);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-width: 0;
}
.brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    cursor: pointer;
}
.brand-logo-img {
    height: 36px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    border-radius: var(--radius-xs);
    transition: opacity var(--dur) var(--ease);
}
.brand-logo:hover .brand-logo-img {
    opacity: 0.8;
}

.brand-title {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    letter-spacing: var(--track-display);
    line-height: 1;
    color: #fff;
}
.brand-badge {
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
    padding: 2px 7px;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    color: var(--text-muted);
    vertical-align: middle;
    white-space: nowrap;
    line-height: 1.6;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    list-style: none;
    min-width: 0;
}
.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 450;
    letter-spacing: var(--track-normal);
    white-space: nowrap;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}
.nav-link:hover {
    color: var(--text-main);
}
.nav-link.active {
    color: var(--text-main);
    font-weight: 550;
}
/* Position marker, not a highlight */
.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0.7rem;
    right: 0.7rem;
    height: 2px;
    background: var(--text-main);
    border-radius: var(--radius-full);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* In-App Predictive Search Bar */
.search-wrapper {
    position: relative;
    width: 260px;
}
.search-input {
    width: 100%;
    height: 36px;
    padding: 0 2.4rem 0 2.3rem;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: var(--fs-sm);
    font-family: var(--font-body);
    letter-spacing: var(--track-normal);
    outline: none;
    transition: var(--transition);
}
.search-input::placeholder {
    color: var(--text-dim);
    font-weight: 400;
}
.search-input:focus {
    background: var(--surface-3);
    border-color: var(--line-strong);
    outline: none;
}
.search-wrapper:focus-within .search-icon {
    color: var(--text-main);
}
.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}
.search-shortcut-badge {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    font-size: var(--fs-micro);
    font-weight: 500;
    padding: 2px 6px;
    border-radius: 5px;
    font-family: var(--font-mono);
    letter-spacing: 0;
    pointer-events: none;
}

/* Nav Action Icon Buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-icon:hover {
    background: var(--surface-2);
    color: var(--text-main);
}
.badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg);
}

.social-pill {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    height: 36px;
    padding: 0 0.8rem;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: var(--track-normal);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}
.social-pill:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--text-main);
}

/* ---------------- Hero Spotlight Slider ---------------- */
.hero-section {
    position: relative;
    height: min(72vh, 620px);
    min-height: 460px;
    margin-top: var(--nav-h);
    overflow: hidden;
    background: var(--bg);
    contain: layout style;
}
.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
}
.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    transform: translate3d(0,0,0);
}
.hero-slide.active {
    opacity: 1;
    visibility: visible;
}
.hero-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.68);
    transform: scale(1);
    transition: transform 7s ease-out;
}
.hero-slide.active .hero-backdrop {
    transform: scale(1.04);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(0deg, var(--bg) 2%, rgba(10, 10, 11, 0.55) 45%, rgba(10, 10, 11, 0.15) 100%),
        linear-gradient(90deg, rgba(10, 10, 11, 0.9) 0%, rgba(10, 10, 11, 0.45) 45%, transparent 75%);
}

.hero-content {
    position: absolute;
    bottom: 12%;
    left: 5%;
    max-width: 660px;
    z-index: 10;
}
.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-soft);
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
    margin-bottom: 0.85rem;
}
.hero-title {
    font-family: var(--font-display);
    font-size: var(--fs-3xl);
    font-weight: 700;
    line-height: var(--leading-display);
    letter-spacing: var(--track-display);
    margin-bottom: 0.85rem;
    color: #fff;
    text-wrap: balance;
    /* legibility over imagery, not decoration */
    text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55);
}
.hero-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 1rem;
    font-size: var(--fs-xs);
    font-weight: 450;
    letter-spacing: 0;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.meta-badge {
    padding: 0.15rem 0.45rem;
    background: transparent;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    color: var(--text-soft);
    font-weight: 500;
    font-size: var(--fs-2xs);
    letter-spacing: 0;
}
.rating-imdb {
    color: var(--primary-gold);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.hero-overview {
    font-size: var(--fs-base);
    line-height: var(--leading-normal);
    letter-spacing: var(--track-normal);
    color: var(--text-soft);
    margin-bottom: 1.7rem;
    max-width: 54ch;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 400;
}
.hero-actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

/* Icons inside controls never shrink and never drift */
.btn-primary svg, .btn-secondary svg, .btn-tool svg,
.btn-icon svg, .nav-link svg, .mobile-nav-item svg {
    flex-shrink: 0;
    display: block;
}

/* ================================================================
   BUTTONS
   Exactly two ranks. Primary is white because nothing on a black
   page is louder, and it needs no gradient to prove it.
   ================================================================ */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 42px;
    padding: 0 1.35rem;
    background: var(--text-main);
    color: var(--bg);
    font-family: var(--font-body);
    font-weight: 550;
    font-size: var(--fs-sm);
    letter-spacing: var(--track-normal);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--dur) var(--ease), opacity var(--dur) var(--ease);
    text-decoration: none;
}
.btn-primary:hover { background: #fff; opacity: 0.88; }
.btn-primary:active { opacity: 0.76; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 42px;
    padding: 0 1.15rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    color: var(--text-main);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: var(--fs-sm);
    letter-spacing: var(--track-normal);
    border-radius: var(--radius-sm);
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
    text-decoration: none;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: var(--line-strong);
}
.btn-secondary:active { background: rgba(255, 255, 255, 0.06); }

.hero-controls {
    position: absolute;
    bottom: 2.5rem;
    right: var(--gutter);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    z-index: 10;
}
/* 6px of paint, 24px of target */
.hero-dot {
    width: 24px;
    height: 24px;
    padding: 9px 0;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
}
.hero-dot::after {
    content: '';
    display: block;
    height: 6px;
    width: 6px;
    margin: 0 auto;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.35);
    transition: background var(--dur) var(--ease), width var(--dur) var(--ease);
}
.hero-dot:hover::after { background: rgba(255, 255, 255, 0.6); }
.hero-dot.active {
    width: 36px;
}
.hero-dot.active::after {
    width: 22px;
    background: var(--text-main);
}

/* ---------------- Main Layout & Headers ---------------- */
.main-container {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-7) var(--gutter) var(--space-8);
    width: 100%;
}
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-4);
    gap: var(--space-4);
    flex-wrap: wrap;
}
.section-head-text { min-width: 0; }

.section-title {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 600;
    line-height: var(--leading-tight);
    letter-spacing: var(--track-display);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-wrap: balance;
}
.section-subtitle {
    font-size: var(--fs-xs);
    line-height: var(--leading-snug);
    letter-spacing: var(--track-normal);
    color: var(--text-muted);
    margin-top: 0.35rem;
    max-width: 58ch;
}

/* ---------------- Continue Watching / Pick Up Shelf ---------------- */
.continue-watching-section {
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    margin-bottom: var(--space-7);
    position: relative;
    overflow: hidden;
}

.continue-watching-grid {
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    padding: 0.5rem 0 0.8rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.continue-watching-grid::-webkit-scrollbar {
    height: 4px;
}
.continue-watching-grid::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: var(--radius-full);
}

.continue-card {
    min-width: 240px;
    max-width: 240px;
    flex-shrink: 0;
    position: relative;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.continue-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-3);
}

.continue-thumbnail-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--surface-2);
    overflow: hidden;
}
.continue-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.continue-card:hover .continue-thumbnail {
    transform: scale(1.05);
}

.continue-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 9, 14, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}
.continue-card:hover .continue-overlay {
    opacity: 1;
}
.continue-play-badge {
    padding: 0.45rem 0.9rem;
    background: var(--text-main);
    color: var(--bg);
    font-size: var(--fs-2xs);
    font-weight: 550;
    letter-spacing: var(--track-normal);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.continue-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.16);
}
.continue-progress-fill {
    height: 100%;
    background: var(--accent);
}

.continue-card-info {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.continue-card-title {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 550;
    letter-spacing: var(--track-snug);
    line-height: var(--leading-tight);
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.continue-card-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--fs-2xs);
    letter-spacing: 0;
    color: var(--text-muted);
}
.continue-tag {
    background: rgba(6, 182, 212, 0.15);
    color: var(--primary-cyan);
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 550;
    font-size: var(--fs-micro);
    letter-spacing: 0;
}
.continue-delete-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}
.continue-delete-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    transform: scale(1.1);
}

/* ---------------- Top 10 Ranked Rail ---------------- */
.top10-grid {
    display: flex;
    gap: 1.4rem;
    overflow-x: auto;
    padding: 0.5rem 0 1.2rem;
    margin-bottom: 3.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.top10-grid::-webkit-scrollbar {
    display: none;
}
.top10-card {
    min-width: 195px;
    max-width: 195px;
    position: relative;
    flex-shrink: 0;
}
.top10-card .movie-card {
    margin-left: 20px;
}
/* The title block is a fixed two lines so the numeral can align to the
   poster's bottom edge instead of colliding with the text under it. */
.top10-card .movie-info {
    height: 40px;
    overflow: hidden;
}
.rank-number {
    position: absolute;
    bottom: calc(40px + var(--space-2));
    left: -6px;
    font-family: var(--font-display);
    font-size: 5.5rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.06em;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--bg);
    -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.32);
    z-index: 5;
    pointer-events: none;
    user-select: none;
}

/* ---------------- Filter & Genre Bar ---------------- */
.genre-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    overflow-x: auto;
    padding-bottom: 0.8rem;
    margin-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.genre-bar::-webkit-scrollbar {
    display: none;
}
.genre-chip {
    height: 34px;
    padding: 0 0.95rem;
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: var(--track-normal);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}
.genre-chip:hover {
    background: var(--surface-2);
    border-color: var(--line-strong);
    color: var(--text-main);
}
/* Selected reads instantly, without shouting */
.genre-chip.active {
    background: var(--text-main);
    border-color: var(--text-main);
    color: var(--bg);
    font-weight: 550;
}

/* ---------------- Movie & Series Grid ---------------- */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: var(--space-5) var(--space-4);
    margin-bottom: var(--space-7);
}

.movie-card {
    position: relative;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    content-visibility: auto;
    contain-intrinsic-size: 280px;
}
/* Only the artwork responds. No lift, no jitter, no reflow. */
.movie-card .poster-wrapper {
    border-radius: var(--radius-md);
    transition: box-shadow var(--dur) var(--ease);
}
.movie-card:hover .poster-wrapper {
    box-shadow: 0 0 0 2px var(--text-main);
}
.movie-card:focus-visible,
.top10-card:focus-visible { outline: none; }
.movie-card:focus-visible .poster-wrapper,
.top10-card:focus-visible .poster-wrapper {
    box-shadow: 0 0 0 2px var(--accent);
}

.poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
    background: var(--surface-2);
}
.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}
.movie-card:hover .poster-img {
    transform: scale(1.06);
}

.card-badge-top {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(10, 10, 11, 0.72);
    border: none;
    color: var(--text-main);
    font-size: var(--fs-micro);
    font-weight: 550;
    letter-spacing: 0;
    padding: 3px 7px;
    border-radius: var(--radius-xs);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.card-quality-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(10, 10, 11, 0.72);
    color: var(--text-soft);
    font-size: var(--fs-micro);
    font-weight: 600;
    letter-spacing: var(--track-caps);
    text-transform: uppercase;
    padding: 3px 7px;
    border-radius: var(--radius-xs);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 11, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--dur) var(--ease);
}
.movie-card:hover .card-overlay {
    opacity: 1;
}
.play-icon-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--text-main);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.92);
    transition: transform 0.2s ease;
}
.movie-card:hover .play-icon-btn {
    transform: scale(1);
}

.movie-info {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.movie-title {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 550;
    letter-spacing: var(--track-snug);
    line-height: var(--leading-tight);
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.movie-subinfo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--fs-2xs);
    font-weight: 450;
    letter-spacing: 0;
    color: var(--text-muted);
}

/* ---------------- Redesigned In-App Player Modal & Stream Engine ---------------- */
@keyframes playerModalIn {
    0% {
        opacity: 0;
        transform: scale(0.97) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.35;
        transform: scale(1);
    }
    50% {
        opacity: 0.65;
        transform: scale(1.02);
    }
}

@keyframes statusDotPulse {
    0%, 100% {
        opacity: 0.6;
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--online) 60%, transparent);
    }
    50% {
        opacity: 1;
        box-shadow: 0 0 0 5px transparent;
    }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(6, 6, 7, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, background 0.3s ease;
}
.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-backdrop.cinema-lights-dim {
    background: rgba(1, 2, 4, 0.985);
}
.modal-backdrop.cinema-lights-dim .modal-details {
    opacity: 0.2;
    transition: opacity 0.3s ease;
}
.modal-backdrop.cinema-lights-dim .modal-details:hover {
    opacity: 1;
}

.modal-box {
    position: relative;
    width: 100%;
    max-width: 980px;
    max-height: 92vh;
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translate3d(0,0,0);
    transition: max-width 0.3s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.3s ease;
}
.modal-backdrop.active .modal-box {
    animation: playerModalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    will-change: transform, opacity;
}
.modal-box.theater-mode {
    max-width: 96vw;
    width: 96vw;
    max-height: 96vh;
    border-color: var(--line);
    box-shadow: var(--shadow-lg);
}

.modal-close-btn {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 30;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: rgba(10, 10, 11, 0.8);
    border: 1px solid var(--line);
    color: #fff;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}
.modal-close-btn:hover {
    background: var(--surface-3);
    border-color: var(--line-strong);
}

/* Ambient Player Glow & Frame */
.player-ambient-wrap {
    position: relative;
    width: 100%;
    background: #000;
}
.player-ambient-glow {
    position: absolute;
    inset: -12px;
    display: none;
}

.player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-bottom: 1px solid var(--border-glass);
    z-index: 1;
    overflow: hidden;
}
.player-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    display: block;
}

/* Resume Prompt Banner inside player */
.resume-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.4rem;
    background: var(--surface-2);
    border-bottom: 1px solid var(--line);
    gap: 1rem;
    flex-wrap: wrap;
    z-index: 2;
    position: relative;
}
.resume-text {
    font-size: var(--fs-sm);
    font-weight: 450;
    letter-spacing: var(--track-normal);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.resume-actions {
    display: flex;
    gap: 0.6rem;
}

.modal-details {
    padding: 1.6rem;
    transition: opacity 0.3s ease;
}

/* Shield & Control Deck */
.shield-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1.2rem;
    background: var(--surface-1);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    gap: 0.6rem;
    z-index: 2;
    position: relative;
}
.shield-status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: var(--fs-micro);
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
    color: var(--primary-cyan);
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: var(--radius-full);
}
.status-dot-live {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--online);
    display: inline-block;
    animation: statusDotPulse 2s infinite ease-in-out;
}

.player-quick-tools {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}
.btn-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    color: var(--text-main);
    font-size: var(--fs-2xs);
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: var(--track-normal);
    cursor: pointer;
    transition: var(--transition);
}
.btn-tool:hover {
    background: var(--surface-3);
    border-color: var(--line-strong);
    color: var(--text-main);
}
.btn-tool.active {
    background: var(--accent-quiet);
    border-color: var(--accent);
    color: var(--text-main);
}

/* Redesigned Server Switcher */
.server-switcher {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    overflow-x: auto;
    padding: 0.3rem 0;
    scrollbar-width: none;
}
.server-switcher::-webkit-scrollbar {
    display: none;
}
.server-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.05rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    font-size: var(--fs-xs);
    font-family: var(--font-body);
    font-weight: 500;
    letter-spacing: var(--track-normal);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.server-btn:hover {
    background: var(--surface-3);
    border-color: var(--line-strong);
    color: var(--text-main);
}
.server-btn.active {
    background: var(--text-main);
    color: var(--bg);
    border-color: var(--text-main);
    font-weight: 550;
}
.server-tag {
    font-size: var(--fs-micro);
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-weight: 550;
    letter-spacing: 0;
}
.server-btn.active .server-tag {
    background: rgba(255, 255, 255, 0.25);
}

/* TV Controls & Dropdowns */
.select-dropdown {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0.45rem 0.85rem;
    font-size: var(--fs-xs);
    font-weight: 450;
    font-family: var(--font-body);
    outline: none;
    cursor: pointer;
    transition: var(--transition);
}
.select-dropdown:focus, .select-dropdown:hover {
    border-color: var(--primary-cyan);
}
.select-dropdown option {
    background: #0d1222;
    color: #fff;
}

/* Bookmark & Time Scrubber Bar */
.bookmark-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.1rem;
    margin-top: 1rem;
    margin-bottom: 1.2rem;
    gap: 0.8rem;
    flex-wrap: wrap;
}
.time-jump-btn {
    padding: 0.32rem 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.time-jump-btn:hover {
    background: var(--surface-3);
    border-color: var(--line-strong);
    color: var(--text-main);
}
.bookmark-input {
    padding: 0.4rem 0.8rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.8rem;
    outline: none;
    width: 130px;
    transition: var(--transition);
}
.bookmark-input:focus {
    border-color: var(--primary-cyan);
    box-shadow: none;
}

/* ---------------- Watchlist Drawer Panel ---------------- */
.drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 8000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 390px;
    max-width: 90vw;
    z-index: 8050;
    background: #0a0d18;
    border-left: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.7);
}
.drawer-backdrop.active .drawer-panel {
    transform: translateX(0);
}

.drawer-header {
    padding: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-glass);
}
.drawer-title {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: 600;
    letter-spacing: var(--track-tight);
}
.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.watchlist-item {
    display: flex;
    gap: 0.85rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    align-items: center;
    transition: var(--transition);
}
.watchlist-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary-cyan);
}
.watchlist-thumb {
    width: 55px;
    height: 75px;
    border-radius: 4px;
    object-fit: cover;
}
.watchlist-info {
    flex: 1;
}
.watchlist-title {
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 550;
    letter-spacing: var(--track-snug);
    line-height: var(--leading-tight);
    margin-bottom: 0.3rem;
}
.remove-btn {
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.4);
    color: var(--accent-red);
    padding: 0.3rem 0.65rem;
    border-radius: var(--radius-xs);
    font-size: var(--fs-2xs);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}
.remove-btn:hover {
    background: var(--accent-red);
    color: #fff;
}

/* ---------------- Info Glass Cards & Free Pass ---------------- */
.info-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3.5rem;
}

.glass-box {
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
}

.faq-item {
    border-bottom: 1px solid var(--border-glass);
    padding: 1.1rem 0;
}
.faq-question {
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: 550;
    letter-spacing: var(--track-snug);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.faq-answer {
    font-size: var(--fs-sm);
    color: var(--text-soft);
    margin-top: 0.7rem;
    line-height: var(--leading-normal);
    max-width: 68ch;
    display: none;
}
.faq-item.open .faq-answer {
    display: block;
}

.vip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.4rem;
    margin-top: 1.5rem;
}
.vip-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.8rem 1.4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
}
.vip-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-2);
}
.vip-card.featured {
    border-color: var(--text-main);
    background: var(--surface-2);
}
.price-tag {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: 600;
    letter-spacing: var(--track-display);
    line-height: 1;
    font-variant-numeric: lining-nums tabular-nums;
    margin: 0.8rem 0;
    color: var(--primary-cyan);
}

/* ---------------- Footer ---------------- */
.footer {
    background: #040509;
    border-top: 1px solid var(--border-glass);
    padding: 3rem 2rem 2rem;
    margin-top: auto;
}
.footer-container {
    max-width: 1420px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 2.5rem;
    margin-bottom: 2rem;
}
.footer-col h4 {
    font-family: var(--font-body);
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
    margin-bottom: 1.1rem;
    color: var(--text-muted);
}
.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.footer-col a {
    color: var(--text-soft);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: 400;
    letter-spacing: var(--track-normal);
    cursor: pointer;
    transition: var(--transition);
}
.footer-col a:hover {
    color: var(--primary-cyan);
}

.footer-bottom {
    max-width: 1420px;
    margin: 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--fs-xs);
    color: var(--text-dim);
    flex-wrap: wrap;
    gap: 1rem;
}

/* ---------------- Toast Notification ---------------- */
.toast-container {
    position: fixed;
    bottom: 1.8rem;
    right: 1.8rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.toast {
    padding: 0.85rem 1.3rem;
    background: var(--surface-3);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: var(--track-normal);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-lg);
    animation: toastSlideIn 0.3s ease;
}
@keyframes toastSlideIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ---------------- Watch Party Theater View ---------------- */
.party-container {
    display: flex;
    gap: 2rem;
    max-width: 1420px;
    margin: 0 auto;
    padding: 2rem 2rem 5rem;
    width: 100%;
}
.party-theater-section {
    flex: 1 1 70%;
    min-width: 0;
}
.party-sidebar-section {
    flex: 0 0 30%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.party-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.party-title-area {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.live-indicator {
    color: var(--primary-gold);
    font-family: var(--font-body);
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
@keyframes partyPulse {
    0%, 100% { opacity: 1; }
}

.party-code-area {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}
.room-code-label {
    font-size: var(--fs-micro);
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
    font-weight: 600;
    color: var(--text-muted);
}
.room-code-value {
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.12em;
    font-variant-numeric: tabular-nums;
}

.party-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
}
.party-iframe {
    width: 100%;
    height: calc(100% - 40px);
    border: none;
}

.party-card-box {
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
}

.member-list-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 160px;
    overflow-y: auto;
}
.member-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.45rem 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
}
.member-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}
.member-name {
    font-size: var(--fs-xs);
    font-weight: 500;
    letter-spacing: var(--track-normal);
    color: #fff;
}
.member-badge {
    font-size: var(--fs-micro);
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
}
.member-badge.host {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--primary-gold);
}
.member-badge.guest {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.voice-status-badge {
    font-size: var(--fs-micro);
    font-weight: 550;
    letter-spacing: 0;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.04);
    color: var(--text-muted);
}
.voice-status-badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.voice-controls-row {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    margin-top: 0.6rem;
}

.party-chat-box {
    background: var(--surface-1);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    height: 380px;
}
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}
.chat-message-item {
    display: flex;
    gap: 0.5rem;
    align-items: flex-start;
}
.chat-message-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    border-top-left-radius: 0;
    padding: 0.5rem 0.85rem;
    max-width: 90%;
}
.chat-message-user {
    font-size: var(--fs-micro);
    font-weight: 600;
    letter-spacing: var(--track-normal);
    margin-bottom: 0.2rem;
    display: block;
}
.chat-message-text {
    font-size: var(--fs-xs);
    color: var(--text-main);
    line-height: var(--leading-snug);
    letter-spacing: var(--track-normal);
    word-break: break-word;
}
.chat-system-message {
    font-size: var(--fs-micro);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-glass);
    padding: 0.35rem;
    text-align: center;
    font-style: italic;
    width: 100%;
}
.chat-input-row {
    display: flex;
    gap: 0.5rem;
    border-top: 1px solid var(--border-glass);
    padding-top: 0.6rem;
}
.chat-input-row input {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    color: #fff;
    font-size: var(--fs-xs);
    letter-spacing: var(--track-normal);
    outline: none;
    transition: var(--transition);
}
.chat-input-row input:focus {
    border-color: var(--line-strong);
    background: var(--surface-3);
}

.emoji-opt {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-glass);
    font-size: 1.2rem;
    padding: 0.4rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}
.emoji-opt:hover, .emoji-opt.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-neon);
}

.color-opt {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: var(--transition);
}
.color-opt:hover, .color-opt.active {
    transform: scale(1.15);
    border-color: #fff;
}

.theme-opt {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease;
}
.theme-opt:hover {
    transform: scale(1.2);
}
.theme-opt.active {
    border-color: var(--primary-gold) !important;
    box-shadow: 0 0 10px var(--primary-gold);
    transform: scale(1.1);
}

/* Settings Accent Pickers */
.settings-accent-opt {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.settings-accent-opt:hover {
    transform: scale(1.15);
}
.settings-accent-opt.active {
    border-color: #fff !important;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
}

/* Settings Switches */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 24px;
}
.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: rgba(255,255,255,0.12);
    transition: .3s;
    border-radius: 24px;
    border: 1px solid var(--border-glass);
}
.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--primary-neon);
}
input:checked + .slider:before {
    transform: translateX(22px);
}

/* Cookie Banner */
.cookie-banner {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    width: calc(100% - 48px);
    max-width: 600px;
    background: var(--bg-glass-heavy);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    padding: 1.2rem;
    z-index: 10000;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    opacity: 0;
}
.cookie-banner.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.cookie-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.cookie-banner-content p {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.4;
    margin: 0;
}

/* Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(7, 9, 14, 0.95);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-top: 1px solid var(--border-glass);
    z-index: 999;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.7);
}
.mobile-nav-item {
    background: none;
    border: none;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 12px;
    flex: 1;
    min-height: 48px;
}
.mobile-nav-item span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
}
.mobile-nav-item:active { color: var(--text-main); }
.mobile-nav-item label {
    font-size: var(--fs-micro);
    font-family: var(--font-body);
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0;
}

/* ================================================================
   NAVBAR: PROGRESSIVE DISCLOSURE
   Drop ornament first, then optional section links. Controls and
   primary sections survive to the mobile breakpoint.
   ================================================================ */
@media (max-width: 1700px) {
    .brand-badge { display: none; }
    .social-pill span { display: none; }
    .social-pill { padding: 0 0.55rem; }
    .search-wrapper { width: 210px; }
}
@media (max-width: 1450px) {
    .nav-item-optional { display: none; }
    .search-wrapper { width: 180px; }
    .nav-left { gap: 1rem; }
}
@media (max-width: 1150px) {
    .tv-mode-btn { font-size: 0; gap: 0; padding: 0 0.55rem !important; }
    .tv-mode-btn svg { margin: 0; }
    .search-wrapper { width: 150px; }
}
/* Below this the section links no longer fit honestly, so the bar becomes
   brand + actions and the page itself carries the navigation. */
@media (max-width: 950px) {
    .nav-links { display: none; }
}

/* ---------------- Responsive Styles ---------------- */
@media (max-width: 992px) {
    .party-container {
        flex-direction: column;
    }
    .party-theater-section, .party-sidebar-section {
        width: 100%;
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .navbar, .navbar.scrolled {
        padding: 0 var(--gutter);
    }
    .nav-links { display: none; }
    .brand-logo-img { height: 30px; }
    .brand-title { font-size: 1.15rem; }
    .brand-badge { display: none; }
    .social-pill span { display: none; }
    .social-pill { padding: 0.4rem; }

    /* The bottom tab bar already offers these, so the top bar drops them
       instead of stacking two copies of the same five actions. */
    .nav-dup-of-tabbar { display: none; }
    .social-pill { display: none; }
    .tv-mode-btn { display: none; }

    .search-wrapper { flex: 1; width: auto; min-width: 0; max-width: none; }
    .search-shortcut-badge { display: none; }
    .brand-title { display: none; }
    .nav-right { flex: 1; gap: 0.35rem; }

    .hero-section { height: min(62vh, 520px); min-height: 400px; }
    .hero-overview { -webkit-line-clamp: 2; }
    .hero-content {
        left: var(--gutter);
        right: var(--gutter);
        bottom: 3.5rem;
        max-width: none;
    }
    .hero-actions { gap: 0.5rem; }
    .hero-actions .btn-primary,
    .hero-actions .btn-secondary { height: 40px; flex: 1 1 auto; }
    /* Dots move below the buttons instead of sitting on top of them */
    .hero-controls {
        bottom: 0.75rem;
        left: var(--gutter);
        right: auto;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: var(--space-4) var(--space-3);
    }
    /* Touch has no hover: don't paint a ring that never clears */
    .movie-card:hover .poster-wrapper { box-shadow: none; }

    .main-container { padding: var(--space-6) var(--gutter) var(--space-7); }
    .continue-watching-section { padding: var(--space-4); }
    
    .modal-box {
        max-height: 95vh;
        border-radius: var(--radius-md);
    }
    .modal-details { padding: 1rem; }

    .mobile-bottom-nav {
        display: flex;
    }
    body {
        padding-bottom: 74px;
    }
    
    .continue-card {
        min-width: 190px;
        max-width: 190px;
    }
}

/* ================================================================
   📺 10-FOOT TV MODE / SMART TV ACCESSIBILITY SYSTEM
   ================================================================ */

body.tv-mode {
    font-size: 20px;
    background: #030508;
    overflow-x: hidden;
    user-select: none;
}

body.tv-mode .navbar {
    height: 90px;
    padding: 1rem 3rem;
}
body.tv-mode .brand-title {
    font-size: 1.8rem;
}
body.tv-mode .brand-logo-img {
    height: 48px;
}
body.tv-mode .nav-link-item {
    font-size: 1.15rem;
    padding: 0.6rem 1.4rem;
}
body.tv-mode .search-wrapper {
    width: 320px;
}
body.tv-mode .search-input {
    font-size: 1.05rem;
    padding: 0.7rem 1rem 0.7rem 2.8rem;
}

/* TV High-Visibility Spatial Focus */
body.tv-mode :focus-visible,
body.tv-mode .tv-focusable:focus,
body.tv-mode .tv-focused,
body.tv-mode .movie-card:focus,
body.tv-mode .top10-card:focus,
body.tv-mode .continue-card:focus,
body.tv-mode .server-btn:focus,
body.tv-mode .btn-primary:focus,
body.tv-mode .btn-secondary:focus,
body.tv-mode .btn-tool:focus,
body.tv-mode .genre-chip:focus,
body.tv-mode .nav-link-item:focus,
body.tv-mode .similar-card:focus,
body.tv-mode .episode-tv-tile:focus {
    outline: none !important;
    border-color: var(--text-main) !important;
    box-shadow: 0 0 0 3px var(--text-main) !important;
    transform: scale(1.06) translateZ(0) !important;
    z-index: 100 !important;
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease) !important;
}

/* TV Mode Grids & Cards */
body.tv-mode .main-container,
body.tv-mode .watch-container {
    max-width: 1720px;
    padding: 2.5rem 3.5rem 6rem;
}
body.tv-mode .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 2.2rem;
}
body.tv-mode .movie-title {
    font-size: 1.15rem;
}
body.tv-mode .movie-subinfo {
    font-size: 0.95rem;
}
body.tv-mode .section-title {
    font-size: 2.2rem;
}
body.tv-mode .section-subtitle {
    font-size: 1.1rem;
}

/* TV Mode Hero Banner */
body.tv-mode .hero-section {
    height: 72vh;
    min-height: 540px;
}
body.tv-mode .hero-title {
    font-size: 3.8rem;
    line-height: 1.1;
}
body.tv-mode .hero-overview {
    font-size: 1.25rem;
    max-width: 850px;
    line-height: 1.6;
}
body.tv-mode .btn-primary,
body.tv-mode .btn-secondary {
    padding: 1rem 2.2rem;
    font-size: 1.15rem;
}

/* TV Mode Continue Watching */
body.tv-mode .continue-card {
    min-width: 320px;
    max-width: 320px;
}
body.tv-mode .continue-card-title {
    font-size: 1.15rem;
}
body.tv-mode .continue-card-sub {
    font-size: 0.95rem;
}

/* TV Mode Top 10 Rail */
body.tv-mode .top10-card {
    min-width: 280px;
    max-width: 280px;
    padding-left: 70px;
}
body.tv-mode .top10-number {
    font-size: 8rem;
    left: -15px;
}

/* TV Mode Watch Page */
body.tv-mode .watch-player-card {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
body.tv-mode .shield-bar {
    padding: 1rem 1.8rem;
}
body.tv-mode .shield-status-pill {
    font-size: 1.05rem;
    padding: 0.4rem 1rem;
}
body.tv-mode .btn-tool {
    font-size: 1rem;
    padding: 0.55rem 1.2rem;
}
body.tv-mode .server-btn {
    font-size: 1.1rem;
    padding: 0.75rem 1.6rem;
}
body.tv-mode .server-tag {
    font-size: 0.8rem;
    padding: 2px 7px;
}
body.tv-mode .bookmark-bar {
    padding: 1rem 1.6rem;
    font-size: 1.05rem;
}
body.tv-mode .time-jump-btn {
    font-size: 1rem;
    padding: 0.5rem 1rem;
}

/* TV Episode Grid (Accessible D-Pad Grid for TV Shows) */
.tv-episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.8rem;
    margin-top: 1rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.4rem;
}
.episode-tv-tile {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0.75rem 0.5rem;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}
.episode-tv-tile:hover, .episode-tv-tile.active {
    background: var(--text-main);
    color: var(--bg);
    border-color: var(--text-main);
}

/* TV Remote Control Navigation Guide Pill (OSD) */
.tv-remote-guide {
    position: fixed;
    bottom: 24px;
    right: 32px;
    z-index: 9999;
    background: rgba(10, 10, 11, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius-full);
    padding: 0.6rem 1.4rem;
    display: none;
    align-items: center;
    gap: 1.2rem;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
    pointer-events: none;
}
body.tv-mode .tv-remote-guide {
    display: flex;
}
.tv-key-badge {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    padding: 2px 7px;
    color: var(--primary-cyan);
    font-family: monospace;
    font-weight: 700;
}

/* ---------------- 📡 Chromecast & TV Casting Controls ---------------- */
.cast-btn {
    border-color: rgba(6, 182, 212, 0.4) !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.4rem !important;
    transition: var(--transition);
}
.cast-btn:hover {
    background: rgba(6, 182, 212, 0.2) !important;
    border-color: var(--primary-cyan) !important;
}
.cast-btn.connected {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: var(--accent-emerald) !important;
    color: var(--accent-emerald) !important;
}
google-cast-launcher {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    display: inline-block;
    --connected-color: var(--accent-emerald);
    --disconnected-color: var(--text-muted);
}

/* ================================================================
   DEDICATED INDEPENDENT APP & MOBILE STREAMING UI SYSTEM
   ================================================================ */

/* App Views & Tab Management */
.app-view {
    display: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.app-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* App Bar & Header Badges */
.app-badge-pro {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(6, 182, 212, 0.4);
    color: var(--primary-cyan);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Horizontal Quick Category Bar */
.app-category-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.6rem 1rem;
    background: var(--bg-glass-heavy);
    border-bottom: 1px solid var(--border-glass);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    position: sticky;
    top: var(--nav-h);
    z-index: 95;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}
.app-category-bar::-webkit-scrollbar {
    display: none;
}
.app-cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    background: var(--surface-1);
    border: 1px solid var(--border-glass);
    color: var(--text-soft);
    font-size: var(--fs-2xs);
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
    user-select: none;
    flex-shrink: 0;
}
.app-cat-pill:hover, .app-cat-pill:focus-visible {
    background: var(--surface-2);
    color: var(--text-main);
    border-color: var(--line-strong);
}
.app-cat-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent-hover);
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.35);
}

/* Floating Frosted Glass Pill Menu Switcher (Apple Liquid Glass) */
.mobile-bottom-nav {
    position: fixed;
    bottom: max(16px, calc(12px + env(safe-area-inset-bottom, 0px)));
    left: 50%;
    transform: translateX(-50%);
    width: min(calc(100% - 28px), 430px);
    height: 64px;
    background: rgba(14, 15, 22, 0.74);
    backdrop-filter: blur(40px) saturate(210%);
    -webkit-backdrop-filter: blur(40px) saturate(210%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 9999px;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), 
                inset 0 1px 1px rgba(255, 255, 255, 0.35), 
                inset 0 -1px 2px rgba(0, 0, 0, 0.45);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    overflow: visible;
}

/* Chromatic Refractive Apple Liquid Glass Slider Bubble */
.pill-slider-thumb {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 6px;
    width: calc((100% - 12px) / 5);
    border-radius: 9999px;
    background: radial-gradient(ellipse at var(--glass-glow-x, 50%) 30%, 
                rgba(255, 255, 255, 0.38) 0%, 
                rgba(244, 63, 94, 0.32) 40%, 
                rgba(6, 182, 212, 0.26) 75%, 
                rgba(99, 102, 241, 0.38) 100%);
    backdrop-filter: blur(28px) saturate(220%);
    -webkit-backdrop-filter: blur(28px) saturate(220%);
    border: 1.5px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55), 
                inset 0 2.5px 4px rgba(255, 255, 255, 0.9), 
                inset 0 -2.5px 6px rgba(6, 182, 212, 0.7), 
                0 0 28px rgba(244, 63, 94, 0.45);
    pointer-events: none;
    z-index: 1;
    transform: translate3d(var(--drag-x, 0px), 0, 0) scale(var(--drag-scale-x, 1), var(--drag-scale-y, 1)) skewX(var(--drag-skew, 0deg));
    transition: transform 0.42s cubic-bezier(0.19, 1, 0.22, 1), box-shadow 0.3s ease, opacity 0.25s ease;
    will-change: transform, box-shadow;
    transform-origin: center center;
}

/* Iridescent Prismatic Glints on Top & Bottom */
.pill-slider-thumb::before {
    content: '';
    position: absolute;
    top: 1.5px;
    left: 12%;
    right: 12%;
    height: 3px;
    background: linear-gradient(var(--glint-deg, 90deg), transparent, rgba(255, 255, 255, 0.95), rgba(6, 182, 212, 0.9), transparent);
    border-radius: 9999px;
    filter: blur(0.5px);
}
.pill-slider-thumb::after {
    content: '';
    position: absolute;
    bottom: 1.5px;
    left: 18%;
    right: 18%;
    height: 2.5px;
    background: linear-gradient(var(--glint-deg, 90deg), transparent, rgba(244, 63, 94, 0.9), rgba(255, 215, 0, 0.85), transparent);
    border-radius: 9999px;
    filter: blur(0.5px);
}

/* Live Dragging State: Organic Dynamic Fluid Stretch & Glow */
.pill-slider-thumb.is-dragging {
    transition: transform 0.04s cubic-bezier(0, 0, 0.2, 1), box-shadow 0.2s ease !important;
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.75), 
                inset 0 3px 6px rgba(255, 255, 255, 0.95), 
                inset 0 -3px 8px rgba(6, 182, 212, 0.85), 
                0 0 42px rgba(244, 63, 94, 0.7);
    border-color: rgba(255, 255, 255, 0.75);
}

/* Neutral Drag Cancellation State */
.pill-slider-thumb.is-canceling {
    opacity: 0.45;
    transform: translate3d(var(--drag-x, 0px), 0, 0) scale(0.88, 0.88) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
    filter: grayscale(0.6);
}

/* Nav Item Buttons with Apple Magnification Optical Lens Effect */
.mobile-nav-item,
.mobile-bottom-nav * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    -webkit-touch-callout: none !important;
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 6px 4px;
    border-radius: 9999px;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    z-index: 2;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex: 1;
    height: 100%;
    transform: translateY(var(--lens-ty, 0px)) scale(var(--lens-scale, 1));
    transition: color 0.18s ease, transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: transform, color;
}
.mobile-nav-item svg {
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), stroke 0.2s ease, filter 0.2s ease;
    filter: drop-shadow(0 0 calc(var(--lens-glow, 0) * 10px) rgba(255, 255, 255, 0.8));
}
.mobile-nav-item label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.2s ease;
    text-shadow: 0 0 calc(var(--lens-glow, 0) * 8px) rgba(255, 255, 255, 0.65);
}
.mobile-nav-item:hover, .mobile-nav-item.is-hovered {
    color: var(--text-main);
}
.mobile-nav-item.active {
    color: #fff;
}
.mobile-nav-item.active svg {
    transform: translateY(-1px) scale(1.06);
    stroke: #fff;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.7));
}
.mobile-nav-item.active label {
    color: #fff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

/* Discover Engine Deck */
.discover-filter-deck {
    background: var(--surface-1);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.discover-filter-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}
.discover-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 140px;
}
.discover-filter-group label {
    font-size: var(--fs-2xs);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: var(--track-caps);
}
.discover-select {
    height: 40px;
    background: var(--surface-2);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 0 0.85rem;
    font-size: var(--fs-xs);
    outline: none;
    font-family: var(--font-body);
    transition: var(--transition);
}
.discover-select:focus {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

/* Library Shelf Cards & Downloader Stations */
.library-hero-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.library-stat-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface-2);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    color: var(--text-main);
    font-weight: 600;
}
.download-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}
.download-hub-card {
    background: var(--surface-1);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: var(--transition);
}
.download-hub-card:hover {
    background: var(--surface-2);
    border-color: var(--border-glow);
    transform: translateY(-2px);
}
.download-hub-title {
    font-size: var(--fs-sm);
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.download-hub-desc {
    font-size: var(--fs-2xs);
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---------------- 📱 Download App Showcase Section ---------------- */
.app-download-showcase {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(6, 182, 212, 0.1), rgba(18, 18, 20, 0.9));
    border: 1px solid rgba(6, 182, 212, 0.3);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.25rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 3.5rem;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.app-download-content {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 2.5rem;
    align-items: center;
}
.app-download-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(6, 182, 212, 0.35);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 600;
    margin-bottom: 1.25rem;
    letter-spacing: 0.01em;
    flex-wrap: wrap;
    transition: var(--transition);
}
.app-download-badge:hover {
    border-color: rgba(6, 182, 212, 0.6);
    box-shadow: 0 6px 24px rgba(6, 182, 212, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.live-dot-glow {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 10px #10b981, 0 0 20px #10b981;
    animation: livePulse 2s infinite ease-in-out;
}
@keyframes livePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
        box-shadow: 0 0 8px #10b981;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.75;
        box-shadow: 0 0 16px #10b981, 0 0 24px #10b981;
    }
}
.gh-release-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    color: var(--primary-cyan);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.gh-release-chip:hover {
    background: rgba(6, 182, 212, 0.2);
    border-color: var(--primary-cyan);
    color: #fff;
    transform: translateY(-1px);
}
.gh-release-chip svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}
.app-download-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 2vw + 1rem, 2.3rem);
    color: #fff;
    margin-bottom: 0.6rem;
    line-height: 1.2;
}
.app-download-subtitle {
    color: var(--text-soft);
    font-size: var(--fs-base);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.app-download-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
}
.app-download-feat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface-2);
    border: 1px solid var(--border-glass);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: var(--fs-2xs);
    color: var(--text-main);
    font-weight: 600;
}
.app-download-cta-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.app-download-preview-box {
    background: var(--surface-1);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.75rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    position: relative;
}
.app-download-qr-badge {
    width: 130px;
    height: 130px;
    background: #fff;
    border-radius: var(--radius-sm);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.app-download-qr-badge img, .app-download-qr-badge svg {
    width: 100%;
    height: 100%;
}
@media (max-width: 900px) {
    .app-download-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .app-download-showcase {
        padding: 2rem 1.5rem;
    }
}

/* ---------------- Global Announcement Ticker & Cloud Status ---------------- */
.announcement-ticker,
.announcement-banner {
    position: relative;
    background: linear-gradient(90deg, rgba(30, 27, 75, 0.9) 0%, rgba(15, 23, 42, 0.95) 50%, rgba(17, 24, 39, 0.9) 100%);
    border-bottom: 1px solid rgba(255, 215, 0, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    z-index: 110;
    overflow: hidden;
    animation: slideDownBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDownBanner {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.announcement-ticker.hidden,
.announcement-banner.hidden {
    display: none !important;
}
.ticker-badge,
.announcement-pill {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.45);
    white-space: nowrap;
    flex-shrink: 0;
}
.ticker-dot {
    width: 6px;
    height: 6px;
    background: #000;
    border-radius: 50%;
    animation: pulseDot 1.5s infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(0.7); }
}
.ticker-viewport {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    mask-image: linear-gradient(90deg, transparent 0%, #000 2%, #000 98%, transparent 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 2%, #000 98%, transparent 100%);
}
.ticker-track {
    display: inline-flex;
    gap: 4rem;
    white-space: nowrap;
    animation: tickerMarquee 28s linear infinite;
}
.ticker-track:hover {
    animation-play-state: paused;
}
@keyframes tickerMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
.ticker-item,
.announcement-msg {
    font-size: 0.88rem;
    color: #ffffff;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.ticker-close,
.announcement-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.15rem;
    cursor: pointer;
    line-height: 1;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.ticker-close:hover,
.announcement-close:hover {
    color: #fff;
    background: rgba(239, 68, 68, 0.4);
    border-color: rgba(239, 68, 68, 0.6);
    transform: scale(1.08);
}

.sync-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.3);
}
.sync-status-badge.synced {
    border-color: rgba(16, 185, 129, 0.4);
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
}
.sync-status-badge.syncing {
    border-color: rgba(6, 182, 212, 0.4);
    color: #38bdf8;
    background: rgba(6, 182, 212, 0.1);
}
.sync-status-badge.offline {
    border-color: rgba(245, 158, 11, 0.4);
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
}



