/* ═══════════════════════════════════════════════════════════════
   CINÉMATHÈQUE — Stylesheet  (Refined)
   ═══════════════════════════════════════════════════════════════ */

/* ─── Design Tokens ─────────────────────────────────────────── */
:root {
    /* Palette — richer depth, more tonal range */
    --bg-primary:      #060607;
    --bg-secondary:    #0e0e10;
    --bg-card:         #141416;
    --bg-card-hover:   #1c1c20;
    --bg-overlay:      rgba(6, 6, 7, 0.94);
    --bg-header:       rgba(6, 6, 7, 0.82);
    --bg-glass:        rgba(255, 255, 255, 0.035);
    --bg-glass-hover:  rgba(255, 255, 255, 0.065);

    --text-primary:    #f0ece4;
    --text-secondary:  #8a877e;
    --text-muted:      #504e48;
    --text-on-gold:    #0a0a08;

    /* Gold — warm, cinematic */
    --accent-gold:     #c9a84c;
    --accent-gold-bright: #dbbf5c;
    --accent-gold-dim: rgba(201, 168, 76, 0.14);
    --accent-gold-glow:rgba(201, 168, 76, 0.30);
    --accent-red:      #b53526;
    --accent-red-dim:  rgba(181, 53, 38, 0.18);

    --border-subtle:   rgba(255, 255, 255, 0.06);
    --border-mid:      rgba(255, 255, 255, 0.10);
    --border-gold:     rgba(201, 168, 76, 0.28);

    /* Shadows — deeper, cinematic */
    --shadow-sm:    0 2px 6px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md:    0 8px 28px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.3);
    --shadow-lg:    0 20px 60px rgba(0,0,0,0.7), 0 6px 16px rgba(0,0,0,0.4);
    --shadow-gold:  0 0 24px rgba(201,168,76,0.18), 0 0 6px rgba(201,168,76,0.12);

    /* Geometry */
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --radius-pill: 50px;

    /* Typography */
    --font-serif:  'Cormorant Garamond', 'Georgia', serif;
    --font-sans:   'Outfit', system-ui, sans-serif;

    /* Motion */
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --dur-fast:    0.16s;
    --dur-mid:     0.3s;
    --dur-slow:    0.5s;

    /* Fx */
    --scanline-opacity: 0.38;
    --grain-opacity:    0.028;
}

/* ─── Light Theme — warm parchment ──────────────────────────── */
[data-theme="light"] {
    --bg-primary:      #f5f2eb;
    --bg-secondary:    #eae6dc;
    --bg-card:         #ffffff;
    --bg-card-hover:   #faf8f4;
    --bg-overlay:      rgba(245, 242, 235, 0.97);
    --bg-header:       rgba(245, 242, 235, 0.88);
    --bg-glass:        rgba(0, 0, 0, 0.025);
    --bg-glass-hover:  rgba(0, 0, 0, 0.055);

    --text-primary:    #1c1b17;
    --text-secondary:  #6e6b60;
    --text-muted:      #a8a49a;
    --text-on-gold:    #fff;

    --accent-gold:     #a98a24;
    --accent-gold-bright: #bfa02e;
    --accent-gold-dim: rgba(169, 138, 36, 0.10);
    --accent-gold-glow:rgba(169, 138, 36, 0.20);

    --border-subtle:   rgba(0, 0, 0, 0.06);
    --border-mid:      rgba(0, 0, 0, 0.11);
    --border-gold:     rgba(169, 138, 36, 0.25);

    --shadow-sm:    0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md:    0 4px 16px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg:    0 12px 40px rgba(0,0,0,0.12), 0 4px 10px rgba(0,0,0,0.06);
    --shadow-gold:  0 0 16px rgba(169,138,36,0.12);

    --scanline-opacity: 0;
    --grain-opacity:    0.015;
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background var(--dur-mid) var(--ease-smooth), color var(--dur-mid) var(--ease-smooth);
    line-height: 1.6;
    font-feature-settings: 'kern' 1, 'liga' 1;
}

/* Ambient glow — deeper, directional */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 10% 15%, rgba(201,168,76,0.06) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 88% 80%, rgba(181,53,38,0.035) 0%, transparent 55%),
        radial-gradient(ellipse 70% 30% at 50% 105%, rgba(201,168,76,0.04) 0%, transparent 45%);
    pointer-events: none;
    z-index: 0;
}

/* Scanlines — finer */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        transparent 0px, transparent 3px,
        rgba(255,255,255,0.008) 3px, rgba(255,255,255,0.008) 4px
    );
    pointer-events: none;
    z-index: 1;
    opacity: var(--scanline-opacity);
}

/* Film grain */
.grain {
    position: fixed;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: var(--grain-opacity);
    pointer-events: none;
    z-index: 2;
}

@keyframes grain {
    0%,100% { transform: translate(0,0) }
    10%  { transform: translate(-5%,-10%) }
    20%  { transform: translate(-15%,5%) }
    30%  { transform: translate(7%,-25%) }
    40%  { transform: translate(-5%,25%) }
    50%  { transform: translate(-15%,10%) }
    60%  { transform: translate(15%,0%) }
    70%  { transform: translate(0%,15%) }
    80%  { transform: translate(3%,35%) }
    90%  { transform: translate(-10%,10%) }
}
@media (min-width: 1024px) {
    .grain { animation: grain 8s steps(10) infinite; }
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-mid);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-gold); }
* { scrollbar-width: thin; scrollbar-color: var(--border-mid) transparent; }

/* Focus */
:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

.container { position: relative; z-index: 3; }

/* ─── Keyframes ──────────────────────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.96) translateY(16px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

@keyframes toastIn {
    from { transform: translateX(-50%) translateY(80px) scale(0.9); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0)    scale(1);   opacity: 1; }
}

@keyframes pulseGold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0.35); }
    50%      { box-shadow: 0 0 0 6px rgba(201,168,76,0); }
}

/* ─── Toast ──────────────────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px) scale(0.9);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-gold);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 500;
    z-index: 9999;
    box-shadow: var(--shadow-md), var(--shadow-gold);
    opacity: 0;
    white-space: nowrap;
    pointer-events: none;
    transition:
        transform var(--dur-mid) var(--ease-spring),
        opacity var(--dur-fast) ease;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    letter-spacing: 0.01em;
}
.toast.show {
    transform: translateX(-50%) translateY(0) scale(1);
    opacity: 1;
}

/* ─── Header ─────────────────────────────────────────────────── */
header {
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--dur-mid) var(--ease-smooth), border-color var(--dur-mid) var(--ease-smooth);
}

/* Gold accent line */
header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 5%,
        var(--accent-gold) 35%,
        var(--accent-gold-bright) 50%,
        var(--accent-gold) 65%,
        transparent 95%);
    opacity: 0.22;
    pointer-events: none;
}

@media (max-width: 1023px) {
    header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg-secondary); }
    .search-container { backdrop-filter: none; }
    .card-watchlist { backdrop-filter: none; }
}

/* ─── Logo ───────────────────────────────────────────────────── */
.logo {
    font-family: var(--font-serif);
    font-size: 1.35rem;
    font-weight: 300;
    letter-spacing: 0.24em;
    color: var(--accent-gold);
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    transition: opacity var(--dur-fast) ease, filter var(--dur-fast) ease;
    user-select: none;
}
.logo:hover { opacity: 0.82; filter: brightness(1.1); }
.logo-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 4px rgba(201,168,76,0.3));
}

/* ─── Header Right ───────────────────────────────────────────── */
.header-right {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur-fast) var(--ease-out);
    flex-shrink: 0;
}
.icon-btn:hover {
    border-color: var(--accent-gold);
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
    transform: scale(1.1);
    box-shadow: var(--shadow-gold);
}

.menu-btn {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0.5rem;
    display: none;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

/* ─── Watchlist Button ───────────────────────────────────────── */
.watchlist-btn {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.watchlist-btn:hover {
    border-color: var(--border-gold);
    background: var(--accent-gold-dim);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

.watchlist-count {
    background: var(--accent-red);
    color: #fff;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.68rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.3rem;
    transition: transform var(--dur-fast) var(--ease-spring);
}
.watchlist-btn:hover .watchlist-count { transform: scale(1.18); }

/* ─── Nav ────────────────────────────────────────────────────── */
nav {
    display: flex;
    gap: 0.15rem;
    font-size: 0.82rem;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    padding: 0.45rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all var(--dur-fast) var(--ease-out);
    white-space: nowrap;
    position: relative;
    letter-spacing: 0.01em;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: calc(100% - 1.6rem);
    height: 1px;
    background: var(--accent-gold);
    transition: transform var(--dur-mid) var(--ease-out);
    transform-origin: center;
}

nav a:hover {
    color: var(--text-primary);
    background: var(--bg-glass);
}
nav a:hover::after { transform: translateX(-50%) scaleX(1); }
nav a:active { transform: scale(0.97); }

/* ─── Mobile Menu ────────────────────────────────────────────── */
.mobile-menu {
    position: fixed;
    top: 0; right: -100%;
    width: 290px;
    height: 100vh;
    height: 100dvh;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-subtle);
    z-index: 200;
    transition: right var(--dur-mid) var(--ease-out);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}
.mobile-menu.active { right: 0; }

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 199;
    display: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.mobile-menu-overlay.active { display: block; }

.mobile-menu-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mobile-menu-header .logo { font-size: 1.15rem; letter-spacing: 0.15em; }
.mobile-menu-header .logo-icon { width: 24px; height: 24px; }

.mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--dur-fast) ease;
}
.mobile-menu-close:hover { background: var(--bg-glass-hover); color: var(--text-primary); }

.mobile-menu-content { padding: 1.25rem 1.5rem; }
.mobile-menu-section { margin-bottom: 2rem; }

.mobile-menu-title {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    font-weight: 500;
}

.mobile-menu-links { display: flex; flex-direction: column; gap: 0.2rem; }

.mobile-menu-link {
    color: var(--text-primary);
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-md);
    transition: all var(--dur-fast) var(--ease-out);
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
}
.mobile-menu-link:hover { background: var(--bg-glass-hover); color: var(--accent-gold); }
.mobile-menu-link:active { transform: scale(0.98); }

/* ─── Search ─────────────────────────────────────────────────── */
.search-container {
    position: sticky;
    top: 58px;
    background: var(--bg-primary);
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    z-index: 99;
    transition: background var(--dur-mid) var(--ease-smooth);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    border-radius: var(--radius-pill);
    transition: all var(--dur-mid) var(--ease-out);
}
.search-box:focus-within {
    border-color: var(--accent-gold);
    background: var(--accent-gold-dim);
    box-shadow: 0 0 0 3px var(--accent-gold-dim), var(--shadow-gold);
}

.search-icon { color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }

#search-input, #search-input-desktop {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font-sans);
    outline: none;
    flex: 1;
    min-width: 0;
}
#search-input::placeholder, #search-input-desktop::placeholder { color: var(--text-muted); }

#search-button, #search-button-desktop {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 44px;
    min-height: 36px;
    font-family: var(--font-sans);
    transition: all var(--dur-fast) var(--ease-out);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
#search-button:hover, #search-button-desktop:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(201,168,76,0.35);
}
#search-button:active, #search-button-desktop:active {
    transform: scale(0.98);
}

/* ─── Sections ───────────────────────────────────────────────── */
.section { padding: 2rem 1.5rem; }

.section-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 0.015em;
    line-height: 1.12;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 2.8rem;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    border-radius: 2px;
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ─── Filter Dashboard ───────────────────────────────────────── */
.filter-dashboard {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: background var(--dur-mid) var(--ease-smooth), border-color var(--dur-mid) var(--ease-smooth);
}

/* --- Shared row --- */
.fd-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1rem;
}

/* ── Row 1 — Primary: type toggle + genre + sort + view ────── */
.fd-row--primary {
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.fd-content-toggle { flex-shrink: 0; }

.fd-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.fd-filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.fd-filter-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    white-space: nowrap;
}

.fd-select,
.genre-filter {
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.45rem 2rem 0.45rem 0.75rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    height: 36px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%238a877e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
    min-width: 0;
    max-width: 100%;
}
.fd-select:hover,
.genre-filter:hover { border-color: var(--border-gold); }
.fd-select:focus,
.genre-filter:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 3px var(--accent-gold-dim); outline: none; }

/* Content type pill toggle */
.content-type-toggle {
    display: flex;
    gap: 0.2rem;
    padding: 0.2rem;
    background: var(--bg-glass);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-subtle);
    width: fit-content;
    flex-shrink: 0;
}

.content-type-btn {
    padding: 0.4rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all var(--dur-fast) var(--ease-out);
    height: 32px;
    line-height: 1;
    display: flex;
    align-items: center;
}
.content-type-btn.active {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    box-shadow: 0 2px 10px rgba(201,168,76,0.35);
}
.content-type-btn:not(.active):hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.15rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.2rem;
    flex-shrink: 0;
    margin-left: auto;
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur-fast) var(--ease-out);
}
.view-btn:hover { color: var(--text-primary); background: var(--bg-glass-hover); }
.view-btn.active {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    box-shadow: 0 1px 4px rgba(201,168,76,0.25);
}

/* ── Row 2 — Mood: surprise + divider + mood pills ─────────── */
.fd-row--mood {
    border-bottom: 1px solid var(--border-subtle);
    overflow: hidden;
}

.fd-surprise-btn {
    background: linear-gradient(135deg, var(--accent-gold) 0%, #b8862d 100%);
    color: var(--text-on-gold);
    border: none;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    height: 36px;
    white-space: nowrap;
    transition: all var(--dur-fast) var(--ease-out);
    box-shadow: 0 2px 8px rgba(201,168,76,0.25);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.fd-surprise-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(201,168,76,0.4);
    filter: brightness(1.08);
}
.fd-surprise-btn:active { transform: scale(0.97); }

/* Old class for mobile menu */
.surprise-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.55rem 1.15rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    min-height: 38px;
    transition: all var(--dur-fast) var(--ease-out);
    white-space: nowrap;
}
.surprise-btn:hover {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-gold);
    transform: scale(1.04);
}
.surprise-btn:active { transform: scale(0.98); }

.fd-divider {
    width: 1px;
    height: 22px;
    background: var(--border-mid);
    flex-shrink: 0;
}

.fd-mood-area {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.fd-mood-area::-webkit-scrollbar { display: none; }

.fd-mood-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    flex-shrink: 0;
}

/* Backward compat */
.filter-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.mood-pills {
    display: flex;
    gap: 0.3rem;
    flex-wrap: nowrap;
}

.mood-pill {
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.8rem;
    height: 34px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all var(--dur-fast) var(--ease-out);
    color: var(--text-secondary);
}
.mood-pill:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}
.mood-pill:active { transform: scale(0.97); }
.mood-pill.active {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    border-color: var(--accent-gold);
    box-shadow: 0 2px 10px rgba(201,168,76,0.35);
}
[data-theme="light"] .mood-pill:hover { background: rgba(0,0,0,0.04); }

/* ── Row 3 — Footer: trending + scroll toggle ──────────────── */
.fd-row--footer {
    justify-content: space-between;
    background: var(--bg-glass);
}

.fd-trending-btn {
    background: transparent;
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-md);
    font-family: var(--font-sans);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    height: 36px;
    transition: all var(--dur-fast) var(--ease-out);
    white-space: nowrap;
    display: flex;
    align-items: center;
}
.fd-trending-btn:hover {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 2px 10px rgba(181,53,38,0.3);
}
.fd-trending-btn:active { transform: scale(0.97); }

.fd-toggle-group {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.fd-toggle-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 450;
}

.fd-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}
.fd-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.fd-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-pill);
    transition: all var(--dur-fast) var(--ease-out);
}
.fd-slider::before {
    content: '';
    position: absolute;
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) ease;
}
.fd-switch input:checked + .fd-slider {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}
.fd-switch input:checked + .fd-slider::before {
    transform: translateX(20px);
    background: var(--text-on-gold);
}

/* ── Mobile (< 1024px) ─────────────────────────────────────── */
@media (max-width: 1023px) {
    /* Row 1: content toggle + genre fill the line, view toggle at end */
    .fd-row--primary { gap: 0.5rem; }
    .fd-filters { flex: 1; }
    .fd-filter-group { flex: 1; min-width: 0; }
    .fd-filter-group .fd-select,
    .fd-filter-group .genre-filter { flex: 1; min-width: 0; }
    .fd-filter-group--sort { display: none; }

    /* Row 2: no surprise btn or divider; pills scroll full width */
    .fd-surprise-btn,
    .fd-divider { display: none; }
    .fd-mood-area {
        -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
        mask-image: linear-gradient(to right, black 88%, transparent 100%);
    }

    /* Row 3: no trending; toggle pushed right */
    .fd-trending-btn { display: none; }
    .fd-row--footer { justify-content: flex-end; }
}

/* ── Desktop (≥ 1024px) ────────────────────────────────────── */
@media (min-width: 1024px) {
    .filter-dashboard { box-shadow: var(--shadow-md); }
    .fd-row { padding: 0.85rem 1.5rem; }

    /* Row 1: hide content toggle (it's in header), rest single-line */
    .fd-row--primary { flex-wrap: nowrap; gap: 1rem; }
    .fd-content-toggle { display: none; }
    .fd-filters { gap: 1rem; flex-wrap: nowrap; }
    .fd-filter-group--sort { display: flex; }

    /* Row 2: everything on one line */
    .fd-row--mood { flex-wrap: nowrap; }
    .fd-mood-area { -webkit-mask-image: none; mask-image: none; }
    .mood-pills { flex-wrap: wrap; }
}

/* Backward compat — old toggle if used elsewhere */
.scroll-mode-toggle { display: flex; align-items: center; }

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color var(--dur-fast) ease;
}
.toggle-label:hover { color: var(--text-primary); }
.toggle-label input { display: none; }

.toggle-track {
    width: 38px;
    height: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-pill);
    position: relative;
    transition: all var(--dur-fast) ease;
    flex-shrink: 0;
}
.toggle-track::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 14px; height: 14px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: transform var(--dur-fast) var(--ease-spring), background var(--dur-fast) ease;
}
.toggle-label input:checked + .toggle-track {
    background: var(--accent-gold);
    border-color: var(--accent-gold);
}
.toggle-label input:checked + .toggle-track::after {
    transform: translateX(18px);
    background: var(--text-on-gold);
}
/* ─── Cards Grid ─────────────────────────────────────────────── */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

/* ─── Continue Watching Horizontal Scroll ───────────────────── */
.continue-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding-bottom: 0.5rem;
    margin-top: 1rem;
    -webkit-overflow-scrolling: touch;
}
.continue-scroll::-webkit-scrollbar {
    height: 6px;
}
.continue-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.continue-scroll::-webkit-scrollbar-thumb {
    background: rgba(201,168,76,0.3);
    border-radius: 3px;
}
.continue-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(201,168,76,0.5);
}
.continue-scroll .card {
    flex: 0 0 140px;
    min-width: 140px;
}
@media (min-width: 640px) {
    .continue-scroll .card {
        flex: 0 0 170px;
        min-width: 170px;
    }
}
@media (min-width: 1024px) {
    .continue-scroll .card {
        flex: 0 0 200px;
        min-width: 200px;
    }
}

/* ─── List View ──────────────────────────────────────────────── */
.cards-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.cards-list .card {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    align-items: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background var(--dur-fast) ease;
}
.cards-list .card:hover {
    border-color: var(--border-gold);
    box-shadow: var(--shadow-sm);
    background: var(--bg-card-hover);
}
.cards-list .card-image {
    width: 68px;
    min-width: 68px;
    aspect-ratio: 2/3;
    margin-bottom: 0;
}
.cards-list .card-title {
    font-size: 1rem;
    -webkit-line-clamp: 3;
}
.cards-list .card-meta { margin-top: 0.3rem; }

/* ─── Card ───────────────────────────────────────────────────── */
.card {
    cursor: pointer;
    transition: transform var(--dur-mid) var(--ease-out);
    transform: translateZ(0);
    will-change: transform;
    animation: fadeUp var(--dur-slow) var(--ease-out) both;
}

/* Stagger animation */
.cards-grid .card:nth-child(1)  { animation-delay: 0.02s; }
.cards-grid .card:nth-child(2)  { animation-delay: 0.05s; }
.cards-grid .card:nth-child(3)  { animation-delay: 0.08s; }
.cards-grid .card:nth-child(4)  { animation-delay: 0.11s; }
.cards-grid .card:nth-child(5)  { animation-delay: 0.14s; }
.cards-grid .card:nth-child(6)  { animation-delay: 0.17s; }
.cards-grid .card:nth-child(7)  { animation-delay: 0.20s; }
.cards-grid .card:nth-child(8)  { animation-delay: 0.23s; }
.cards-grid .card:nth-child(n+9){ animation-delay: 0.25s; }

.card:active { transform: scale(0.97) translateZ(0); }

.card-image {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    margin-bottom: 0.7rem;
    transform: translateZ(0);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--dur-mid) var(--ease-out);
}

/* Image zoom on hover */
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateZ(0);
    transition: transform var(--dur-slow) var(--ease-out), filter var(--dur-slow) ease;
    display: block;
}

/* Play overlay */
.card-image::after {
    content: '\25B6';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.82) 0%,
        rgba(0,0,0,0.35) 35%,
        transparent 65%
    );
    color: white;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--dur-mid) var(--ease-out);
    z-index: 1;
    padding-bottom: 2rem;
    letter-spacing: 0;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.card-watchlist {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    font-size: 1.1rem;
    transition: all var(--dur-fast) var(--ease-spring);
    border: 1px solid rgba(255,255,255,0.12);
}
.card-watchlist:hover { transform: scale(1.14); }
.card-watchlist.in-watchlist {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    border-color: transparent;
    box-shadow: 0 0 12px rgba(201,168,76,0.45);
    animation: pulseGold 2s ease-in-out 1;
}

.card-dismiss {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(0,0,0,0.55);
    color: rgba(255,255,255,0.5);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    font-size: 0.7rem;
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0;
    transition: all var(--dur-fast) ease;
}
.card-dismiss:hover { background: var(--accent-red); color: #fff; border-color: transparent; }

.card-watched {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.55);
    color: rgba(255,255,255,0.5);
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 3; font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.1);
    opacity: 0; transition: all var(--dur-fast) ease;
}
.card:hover .card-watched { opacity: 1; }
.card-watched:hover { transform: scale(1.14); }
.card-watched.is-watched {
    opacity: 1;
    background: rgba(76,175,80,0.85);
    color: #fff; border-color: transparent;
    box-shadow: 0 0 12px rgba(76,175,80,0.4);
}

.card-continue-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(201,168,76,0.92));
    color: var(--text-on-gold);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1.5rem 0.5rem 0.5rem;
    text-align: center;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 2;
}

.card-remove-continue {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255,255,255,0.7);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 4;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    border: 1px solid rgba(255,255,255,0.12);
    opacity: 0;
    transition: all var(--dur-fast) ease;
}
.card:hover .card-remove-continue { opacity: 1; }
.card-remove-continue:hover {
    background: var(--accent-red, #e53935);
    color: #fff;
    border-color: transparent;
    transform: scale(1.14);
}
@media (hover: none) {
    .card-remove-continue { opacity: 0.8; }
}

.card-rating {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.82);
    color: var(--accent-gold-bright);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1.5px solid rgba(201,168,76,0.5);
    flex-direction: column;
    gap: 0.05rem;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.card-rating-value { font-size: 0.85rem; line-height: 1; }
.card-rating-star  { font-size: 0.55rem; opacity: 0.65; }

.card-user-rating {
    position: absolute;
    top: 2.9rem;
    left: 0.5rem;
    background: rgba(201,168,76,0.92);
    color: var(--text-on-gold);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.45rem;
    border-radius: var(--radius-pill);
    z-index: 3;
    display: none;
    backdrop-filter: blur(4px);
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 400;
    margin-bottom: 0.35rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color var(--dur-fast) var(--ease-out);
}

.card-meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.card-meta span + span::before {
    content: '\00B7';
    margin-right: 0.5rem;
    opacity: 0.45;
}

/* Desktop card hover — lift + glow */
@media (min-width: 1024px) {
    .card:hover .card-image img { transform: translateZ(0) scale(1.07); }
    .card:hover .card-image::after { opacity: 1; }
    .card:hover .card-image { box-shadow: var(--shadow-md), 0 0 20px rgba(201,168,76,0.08); }
    .card:hover .card-dismiss { opacity: 1; }
    .card:hover .card-title { color: var(--accent-gold); }
    .card:hover { transform: translateY(-10px); }
}

/* ─── Skeleton Loader ────────────────────────────────────────── */
.skeleton-card { cursor: default; animation: none; }

.skeleton-card .card-image,
.skeleton-text {
    background: linear-gradient(
        90deg,
        var(--bg-card) 0%,
        var(--bg-card) 20%,
        rgba(201,168,76,0.06) 50%,
        var(--bg-card) 80%,
        var(--bg-card) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

.skeleton-card .card-image { border-radius: var(--radius-md); }

.skeleton-text {
    height: 13px;
    margin-bottom: 0.5rem;
}
.skeleton-text.short { width: 52%; }

/* ─── Pagination ─────────────────────────────────────────────── */
.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    margin-top: 3.5rem;
    padding: 1rem;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pagination button {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    transition: all var(--dur-fast) var(--ease-out);
}
.pagination button:hover:not(:disabled) {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    border-color: var(--accent-gold);
    box-shadow: var(--shadow-gold);
    transform: scale(1.04);
}
.pagination button:disabled { opacity: 0.2; cursor: not-allowed; }

.page-info {
    color: var(--text-muted);
    font-size: 0.82rem;
    padding: 0 0.75rem;
    letter-spacing: 0.03em;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.items-per-page select {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 0.45rem 2rem 0.45rem 0.85rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    min-height: 38px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23888' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
}
.items-per-page select:hover { border-color: var(--border-gold); }

/* ─── Video Player Modal ─────────────────────────────────────── */
.video-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    overflow-y: auto;
}
.video-modal.active { display: block; }

.video-modal-close {
    position: fixed;
    top: 1rem; right: 1rem;
    background: rgba(255,255,255,0.08);
    color: #fff;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.12);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur-fast) var(--ease-out);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.video-modal-close:hover {
    background: rgba(255,255,255,0.18);
    transform: scale(1.1) rotate(90deg);
}

.video-player-container { padding: 1rem; }

.video-player-wrapper {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-lg);
}

.video-player { width: 100%; aspect-ratio: 16/9; }
.video-player iframe { width: 100%; height: 100%; border: none; display: block; }

.video-controls {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.video-info { margin-bottom: 1.25rem; }

.video-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: #fff;
}

.video-meta {
    display: flex;
    gap: 1rem;
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
}

.episode-controls {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.control-group { display: flex; flex-direction: column; gap: 0.4rem; }

.control-label {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 500;
}

.control-input {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 1rem;
    min-height: 44px;
    transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.control-input:focus { border-color: var(--accent-gold); box-shadow: 0 0 0 2px var(--accent-gold-dim); outline: none; }

.episode-nav { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.6rem; }

.episode-nav button {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.7);
    padding: 0.7rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    min-height: 44px;
    transition: all var(--dur-fast) var(--ease-out);
}
.episode-nav button:hover {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    border-color: transparent;
    box-shadow: 0 2px 10px rgba(201,168,76,0.3);
}

/* ─── Seasons Browser ────────────────────────────────────────── */
.seasons-browser {
    margin-top: 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 1.25rem;
}

.seasons-tabs {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.85rem;
}

.season-tab {
    padding: 0.4rem 0.9rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    font-family: var(--font-sans);
    transition: all var(--dur-fast) var(--ease-out);
    min-height: 32px;
    letter-spacing: 0.04em;
}
.season-tab:hover { border-color: rgba(201,168,76,0.45); color: #fff; }
.season-tab.active {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(201,168,76,0.3);
}

.episodes-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.4rem;
    max-height: 210px;
    overflow-y: auto;
    padding-right: 4px;
}

.episode-item {
    padding: 0.55rem 0.65rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all var(--dur-fast) var(--ease-out);
    min-height: 44px;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.episode-item:hover { border-color: rgba(201,168,76,0.4); background: rgba(201,168,76,0.07); }
.episode-item.active {
    background: var(--accent-gold);
    border-color: transparent;
    box-shadow: 0 1px 6px rgba(201,168,76,0.25);
}
.episode-item.active .episode-num,
.episode-item.active .episode-name { color: var(--text-on-gold); opacity: 1; }

.episode-num  { font-weight: 700; font-size: 0.8rem; color: rgba(255,255,255,0.85); }
.episode-name { color: rgba(255,255,255,0.35); font-size: 0.68rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Server select */
.server-select { margin-top: 1.25rem; }
.server-options { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.server-option {
    padding: 0.6rem 1.1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease-out);
    font-size: 0.8rem;
    font-family: var(--font-sans);
    color: rgba(255,255,255,0.55);
    min-height: 38px;
}
.server-option:hover { border-color: rgba(201,168,76,0.4); color: #fff; }
.server-option.active {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(201,168,76,0.3);
}

/* ─── Details Modal ──────────────────────────────────────────── */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.94);
    z-index: 1000;
    overflow-y: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.modal.active {
    display: block;
    animation: modalIn var(--dur-mid) var(--ease-out);
}

.modal-close {
    position: fixed;
    top: 1rem; right: 1rem;
    background: rgba(0,0,0,0.65);
    color: #fff;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.10);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--dur-fast) var(--ease-out);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.modal-close:hover { background: rgba(255,255,255,0.15); transform: scale(1.1) rotate(90deg); }

.modal-content { margin-top: 2.5rem; }

.modal-hero {
    min-height: 52vh;
    position: relative;
    background-size: cover;
    background-position: center top;
    overflow: hidden;
}

/* Multi-layer gradient */
.modal-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.15) 55%, transparent 80%),
        linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.3) 40%, transparent 100%);
    z-index: 1;
}

/* Vignette */
.modal-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.35) 100%);
    z-index: 1;
    pointer-events: none;
}

/* Trailer overlay */
.trailer-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 10;
    display: flex;
    flex-direction: column;
}
.trailer-overlay iframe { flex: 1; border: none; width: 100%; display: block; }

.trailer-close-btn {
    background: rgba(0,0,0,0.9);
    color: rgba(255,255,255,0.75);
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 0.85rem 2rem;
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.82rem;
    text-align: center;
    transition: all var(--dur-fast) ease;
    flex-shrink: 0;
    letter-spacing: 0.04em;
}
.trailer-close-btn:hover { background: rgba(201,168,76,0.12); color: var(--accent-gold); }

.modal-hero-content {
    position: absolute;
    bottom: 1.5rem;
    left: 1.5rem;
    right: 1.5rem;
    z-index: 5;
}

/* Badges */
.modal-badges {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.22rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.badge-content-rating {
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.88);
}
.badge-type {
    background: rgba(201,168,76,0.18);
    border: 1px solid rgba(201,168,76,0.35);
    color: var(--accent-gold-bright);
}
.badge-seasons {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.75);
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    font-weight: 300;
    margin-bottom: 0.85rem;
    line-height: 1.12;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,0.6), 0 0 40px rgba(0,0,0,0.3);
}

.modal-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    flex-wrap: wrap;
    align-items: center;
}
.modal-meta span + span::before {
    content: '\00B7';
    margin-right: 0.75rem;
    opacity: 0.35;
}

.modal-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    align-items: center;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
    padding: 0.7rem 1.2rem;
    border: none;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all var(--dur-fast) var(--ease-out);
    font-family: var(--font-sans);
    min-height: 42px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.02em;
}
.btn:active { transform: scale(0.96) !important; }

.btn-primary {
    background: var(--accent-gold);
    color: var(--text-on-gold);
    box-shadow: 0 2px 14px rgba(201,168,76,0.35);
}
.btn-primary:hover {
    filter: brightness(1.12);
    box-shadow: 0 4px 24px rgba(201,168,76,0.5);
    transform: translateY(-2px);
}

.btn-trailer {
    background: rgba(255,255,255,0.08);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
}
.btn-trailer:hover { background: rgba(255,255,255,0.16); transform: translateY(-2px); }

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(8px);
}
.btn-secondary:hover { background: rgba(255,255,255,0.13); transform: translateY(-2px); }

.btn-share {
    background: transparent;
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.10);
    font-size: 0.78rem;
}
.btn-share:hover { color: rgba(255,255,255,0.88); border-color: rgba(255,255,255,0.25); }

.btn-dismiss {
    background: transparent;
    color: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.75rem;
    padding: 0.6rem 0.9rem;
}
.btn-dismiss:hover { color: rgba(255,255,255,0.65); border-color: rgba(181,53,38,0.45); }

/* ─── User Rating Bar ────────────────────────────────────────── */
.user-rating-bar {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.5rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--dur-mid) var(--ease-smooth);
}

.user-rating-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.star-rating { display: flex; gap: 0.12rem; }

.star {
    font-size: 1.55rem;
    color: rgba(255,255,255,0.10);
    cursor: pointer;
    transition: color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-spring), filter var(--dur-fast) ease;
    line-height: 1;
}
[data-theme="light"] .star { color: rgba(0,0,0,0.08); }

.star:hover { transform: scale(1.22); }
.star.active, .star.hover-active {
    color: var(--accent-gold-bright);
    filter: drop-shadow(0 0 6px rgba(201,168,76,0.65));
}

.user-rating-value {
    font-size: 0.8rem;
    color: var(--accent-gold);
    font-weight: 600;
    min-width: 50px;
    letter-spacing: 0.02em;
}

/* ─── Modal Body ─────────────────────────────────────────────── */
.modal-body {
    padding: 2rem 1.5rem;
    background: var(--bg-primary);
    transition: background var(--dur-mid) var(--ease-smooth);
}

.modal-section { margin-bottom: 2.5rem; }

.modal-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
}

.modal-section-title {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    font-weight: 400;
    margin-bottom: 1.15rem;
    color: var(--accent-gold);
    letter-spacing: 0.02em;
    position: relative;
    padding-bottom: 0.65rem;
}
.modal-section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 2.2rem;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-gold), transparent);
    opacity: 0.5;
}

/* ─── Similar Grid ───────────────────────────────────────────── */
.similar-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
}

.similar-card {
    cursor: pointer;
    transition: transform var(--dur-fast) var(--ease-out);
}
.similar-card:hover { transform: translateY(-5px); }
.similar-card:active { transform: scale(0.97); }

.similar-card-image {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.6rem;
    position: relative;
    box-shadow: var(--shadow-sm);
}
.similar-card-image img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform var(--dur-mid) var(--ease-out);
    display: block;
}
.similar-card:hover .similar-card-image img { transform: scale(1.06); }

.similar-card-title {
    font-size: 0.88rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

.similar-card-meta { font-size: 0.72rem; color: var(--text-muted); }

/* ─── Cast Grid ──────────────────────────────────────────────── */
.cast-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
}

.cast-item { text-align: center; }

.cast-image {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 0.5rem;
    box-shadow: var(--shadow-sm);
}
.cast-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cast-name      { font-size: 0.82rem; font-weight: 600; margin-bottom: 0.2rem; }
.cast-character { font-size: 0.72rem; color: var(--text-muted); }

/* ─── Loading / Empty States ─────────────────────────────────── */
.loading {
    text-align: center;
    padding: 3.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    color: var(--text-muted);
    animation: fadeUp var(--dur-slow) var(--ease-out);
}
.empty-state-icon  {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
    display: block;
    filter: grayscale(0.35);
}
.empty-state-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 300;
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
}
.empty-state-text  { font-size: 0.88rem; line-height: 1.6; }

/* ─── Footer ─────────────────────────────────────────────────── */
footer {
    border-top: 1px solid var(--border-subtle);
    padding: 2.5rem 1.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 8rem;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
    opacity: 0.3;
}

footer a { color: var(--accent-gold); text-decoration: none; transition: opacity var(--dur-fast) ease; }
footer a:hover { text-decoration: underline; opacity: 0.8; }

.footer-actions {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.footer-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    transition: all var(--dur-fast) var(--ease-out);
    min-height: 38px;
}
.footer-btn:hover {
    border-color: var(--border-gold);
    color: var(--accent-gold);
    background: var(--accent-gold-dim);
    box-shadow: 0 0 0 3px var(--accent-gold-dim);
}

/* ─── Responsive — Tablet ────────────────────────────────────── */
@media (min-width: 600px) {
    .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
    .cast-grid  { grid-template-columns: repeat(4, 1fr); }
    .similar-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ─── Responsive — Mobile Only ───────────────────────────────── */
@media (max-width: 1023px) {
    .card, .mood-pill, .btn, button { transition-duration: var(--dur-fast); }
    .surprise-btn { display: none; }
    .cards-grid .card { animation-delay: 0s !important; }
}

/* ─── Responsive — Desktop ───────────────────────────────────── */
@media (min-width: 1024px) {
    header { padding: 1rem 4rem; }

    .logo { font-size: 1.7rem; letter-spacing: 0.28em; }
    .logo-icon { width: 34px; height: 34px; }

    .menu-btn { display: none !important; }
    .search-container { display: none; }
    .search-box { padding: 0.55rem 0.6rem 0.55rem 1.2rem; }
    #search-input-desktop { width: 200px; transition: width var(--dur-mid) var(--ease-out); }
    #search-input-desktop:focus { width: 280px; }

    #movies-btn, #tv-btn { display: none; }

    .section { padding: 3rem 4rem; }
    .section-title { font-size: 2.6rem; }

    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
        gap: 1.5rem;
    }

    .header-right .content-type-toggle { display: flex; }

    .similar-grid { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }

    .video-player-container { max-width: 1600px; margin: 1.5rem auto; padding: 0 2.5rem; }
    .video-title { font-size: 2.25rem; }

    .episode-controls { flex-direction: row; align-items: flex-end; gap: 1.25rem; }
    .control-row { display: contents; }
    .episode-nav { flex: 1; }

    .modal-content { max-width: 1380px; margin: 2rem auto; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
    .modal-hero { min-height: 68vh; }
    .modal-hero-content { bottom: 3rem; left: 3.5rem; right: 3.5rem; }
    .modal-title { font-size: 3.8rem; }
    .modal-body { padding: 3rem 3.5rem; }

    .user-rating-bar { padding: 1rem 3.5rem; }

    .cast-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1.25rem; }

    .video-modal-close, .modal-close { top: 1.5rem; right: 1.5rem; width: 46px; height: 46px; }
}

/* ─── Mobile nav/header hidden elements ─────────────────────── */
@media (max-width: 1023px) {
    .menu-btn { display: flex; }
    nav { display: none; }
    .header-right .search-box { display: none; }
    .watchlist-btn span:not(.watchlist-count) { display: none; }
    .header-right .content-type-toggle { display: none; }
}

/* ── User button + Login modal ──────────────────────────── */
.user-btn.is-authed {
    background: var(--accent, #c9a84c);
    color: #1a1a1a;
    font-weight: 700;
    font-size: 0.95rem;
}
.login-modal-content {
    max-width: 420px;
    margin: 10vh auto 2rem;
    background: var(--card, #141416);
    border: 1px solid var(--border, #26262a);
    border-radius: 16px;
    padding: 2rem 1.75rem 1.75rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-modal-content .close-btn {
    position: absolute;
    top: 0.75rem; right: 1rem;
    font-size: 1.8rem;
    color: var(--muted, #8a8a90);
    cursor: pointer;
    line-height: 1;
    transition: color var(--dur-fast, 150ms) ease;
}
.login-modal-content .close-btn:hover { color: var(--text, #e8e8ea); }
.login-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 2rem;
    color: var(--accent, #c9a84c);
    margin-bottom: 0.35rem;
}
.login-subtitle {
    color: var(--muted, #8a8a90);
    font-size: 0.88rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}
#login-form { display: flex; flex-direction: column; gap: 0.65rem; }
#login-form input {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border, #26262a);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    color: var(--text, #e8e8ea);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color var(--dur-fast, 150ms) ease;
}
#login-form input:focus {
    outline: none;
    border-color: var(--accent, #c9a84c);
}
.login-error {
    color: #d25454;
    font-size: 0.82rem;
    min-height: 1em;
}
.login-submit-btn {
    background: var(--accent, #c9a84c);
    color: #1a1a1a;
    border: none;
    padding: 0.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: opacity var(--dur-fast, 150ms) ease, transform var(--dur-fast, 150ms) ease;
    margin-top: 0.25rem;
}
.login-submit-btn:hover { transform: translateY(-1px); opacity: 0.9; }
.login-divider {
    text-align: center;
    color: var(--muted, #8a8a90);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 1.25rem 0 0.85rem;
    position: relative;
}
.login-divider::before, .login-divider::after {
    content: '';
    position: absolute;
    top: 50%; width: 42%;
    height: 1px;
    background: var(--border, #26262a);
}
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }
.login-request-btn {
    width: 100%;
    background: transparent;
    color: var(--text, #e8e8ea);
    border: 1px solid var(--border, #26262a);
    padding: 0.75rem;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--dur-fast, 150ms) ease;
}
.login-request-btn:hover { border-color: var(--accent, #c9a84c); color: var(--accent, #c9a84c); }
.login-guest-note {
    margin-top: 1.25rem;
    font-size: 0.76rem;
    color: var(--muted, #8a8a90);
    text-align: center;
    line-height: 1.5;
}

/* Login modal animation */
#login-modal.active .login-modal-content,
#account-modal.active .login-modal-content {
    animation: loginIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes loginIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Subtle gold glow on title */
.login-title {
    position: relative;
    text-shadow: 0 0 24px rgba(201, 168, 76, 0.18);
}

/* Input hover */
#login-form input:hover { border-color: rgba(201, 168, 76, 0.35); }
#login-form input::placeholder { color: rgba(138, 138, 144, 0.7); }

/* ── Episodes Watched Modal ────────────────────────────── */
.ep-watched-content {
    max-width: 1100px;
    width: calc(100% - 2rem);
    margin: 5vh auto 2rem;
    background: var(--card, #141416);
    border: 1px solid var(--border, #26262a);
    border-radius: 16px;
    padding: 1.75rem 1.75rem 1.5rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
}
#episodes-watched-modal.active .ep-watched-content {
    animation: loginIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.ep-watched-content .close-btn {
    position: absolute;
    top: 0.75rem; right: 1rem;
    font-size: 1.8rem;
    color: var(--muted, #8a8a90);
    cursor: pointer;
    line-height: 1;
    transition: color var(--dur-fast, 150ms) ease;
    z-index: 2;
}
.ep-watched-content .close-btn:hover { color: var(--text, #e8e8ea); }
.ep-watched-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 1.8rem;
    color: var(--accent, #c9a84c);
    margin: 0 2.5rem 1rem 0;
    padding-right: 2rem;
    line-height: 1.2;
}
.ep-watched-seasons {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    padding-bottom: 0.85rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--border, #26262a);
    scrollbar-width: thin;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
.ep-watched-seasons::-webkit-scrollbar { height: 6px; }
.ep-watched-seasons::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.3); border-radius: 3px; }
.ep-season-tab {
    background: rgba(255,255,255,0.04);
    color: var(--text, #e8e8ea);
    border: 1px solid var(--border, #26262a);
    padding: 0.45rem 0.95rem;
    border-radius: 50px;
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--dur-fast, 150ms) ease;
}
.ep-season-tab:hover { border-color: var(--accent, #c9a84c); }
.ep-season-tab.active {
    background: var(--accent, #c9a84c);
    color: #1a1a1a;
    border-color: var(--accent, #c9a84c);
}
.ep-watched-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.9rem;
    overflow-y: auto;
    padding: 0.25rem 0.25rem 0.5rem 0;
    scrollbar-width: thin;
}
.ep-watched-grid::-webkit-scrollbar { width: 8px; }
.ep-watched-grid::-webkit-scrollbar-thumb { background: rgba(201, 168, 76, 0.3); border-radius: 4px; }
.ep-watched-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted, #8a8a90);
    font-size: 0.9rem;
}
.ep-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border, #26262a);
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color var(--dur-fast, 150ms) ease, transform var(--dur-fast, 150ms) ease;
}
.ep-card:hover { border-color: rgba(201, 168, 76, 0.45); transform: translateY(-2px); }
.ep-card.is-watched { border-color: rgba(201, 168, 76, 0.6); }
.ep-card-img {
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
    position: relative;
}
.ep-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-card.is-watched .ep-card-img::after {
    content: '✓';
    position: absolute;
    top: 6px; right: 6px;
    width: 24px; height: 24px;
    background: var(--accent, #c9a84c);
    color: #1a1a1a;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.ep-card-body {
    padding: 0.65rem 0.7rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
}
.ep-card-num {
    font-size: 0.7rem;
    color: var(--accent, #c9a84c);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.ep-card-name {
    font-size: 0.82rem;
    color: var(--text, #e8e8ea);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}
.ep-card-btn {
    background: transparent;
    color: var(--text, #e8e8ea);
    border: 1px solid var(--border, #26262a);
    padding: 0.45rem 0.6rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--dur-fast, 150ms) ease;
    margin-top: auto;
}
.ep-card-btn:hover { border-color: var(--accent, #c9a84c); color: var(--accent, #c9a84c); }
.ep-card-btn.watched {
    background: var(--accent, #c9a84c);
    color: #1a1a1a;
    border-color: var(--accent, #c9a84c);
}
.ep-card-btn.watched:hover { opacity: 0.88; color: #1a1a1a; }

@media (max-width: 640px) {
    .ep-watched-content { padding: 1.25rem 1rem 1rem; margin: 3vh auto 1rem; }
    .ep-watched-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 0.65rem; }
    .ep-watched-title { font-size: 1.4rem; }
}

/* ── New Episode badge in Continue Watching ─────────────── */
.new-episode-badge {
    display: inline-block;
    vertical-align: middle;
    margin-left: 0.4rem;
    padding: 2px 7px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #1a1a1a;
    background: linear-gradient(135deg, #e2c97a, #c9a84c);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(201, 168, 76, 0.4);
    animation: newEpPulse 2.4s ease-in-out infinite;
    white-space: nowrap;
}
@keyframes newEpPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(201, 168, 76, 0.4); }
    50%      { box-shadow: 0 0 16px rgba(201, 168, 76, 0.75); }
}