@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Color — cinematic dark identity */
  --bg-0: #000000;
  --bg-50: #0a0a0b;
  --bg-100: #141416;
  --bg-200: #1f1f23;
  --bg-300: #2a2a30;
  --bg-400: #3a3a42;
  --bg-500: #4d4d57;

  --tx-1: #ffffff;
  --tx-2: #c7c7cf;
  --tx-3: #8e8e99;
  --tx-inv: #0a0a0b;

  --brand-300: #ff6b74;
  --brand-400: #f23b46;
  --brand-500: #e50914;
  --brand-600: #c70810;
  --brand-700: #9d060c;
  --brand-glow: rgba(229, 9, 20, 0.42);
  --brand-glow-strong: rgba(229, 9, 20, 0.65);

  --ok: #46d369;
  --warn: #ffb800;

  --line-subtle: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.13);
  --line-strong: rgba(255, 255, 255, 0.24);
  --glass: rgba(28, 28, 32, 0.72);
  --glass-strong: rgba(12, 12, 14, 0.86);

  /* Gradients */
  --grad-brand: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  --grad-fade-b: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.92) 82%, var(--bg-0) 100%);
  --grad-fade-t: linear-gradient(180deg, rgba(0,0,0,.62) 0%, rgba(0,0,0,.18) 26%, rgba(0,0,0,0) 48%);
  --grad-card-shine: linear-gradient(160deg, rgba(255,255,255,.09) 0%, rgba(255,255,255,0) 38%);

  /* Type */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fs-2xs: 0.6875rem;
  --fs-xs: 0.78125rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-hero-min: 2rem;
  --fs-hero-max: 4.25rem;

  --w-med: 500;
  --w-semi: 600;
  --w-bold: 700;
  --w-xbold: 800;
  --w-black: 900;

  /* Space & shape */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-full: 999px;

  /* Elevation */
  --sh-1: 0 2px 8px rgba(0,0,0,.45);
  --sh-2: 0 8px 24px rgba(0,0,0,.55);
  --sh-3: 0 16px 48px rgba(0,0,0,.65);
  --sh-focus: 0 0 0 3px var(--bg-0), 0 0 0 6px var(--brand-500);
  --sh-tv-focus: 0 0 0 4px var(--bg-0), 0 0 0 8px var(--brand-500), 0 0 42px var(--brand-glow-strong);

  /* Motion */
  --t-fast: 140ms cubic-bezier(.4,0,.2,1);
  --t-med: 260ms cubic-bezier(.4,0,.2,1);
  --t-slow: 420ms cubic-bezier(.22,.61,.36,1);

  /* Layout */
  --gutter: clamp(20px, 3.2vw, 56px);
  --header-h: 68px;
  --bottomnav-h: 0px;
  --rail-gap: 14px;
  --cpv: 6;
  --cpvw: 3.4;
  --gcols: 5;
  --safe-l: 0px;
  --safe-r: 0px;
  --safe-b: 0px;

  /* Z */
  --z-header: 100;
  --z-drawer: 300;
  --z-search: 400;
  --z-player: 600;
  --z-modal: 700;
  --z-toast: 900;
}

html[data-theme="light"] {
  --bg-0: #f4f4f6;
  --bg-50: #ffffff;
  --bg-100: #ececef;
  --bg-200: #dfdfe4;
  --bg-300: #cfcfd6;
  --bg-400: #b9b9c2;
  --bg-500: #9a9aa5;
  --tx-1: #101014;
  --tx-2: #3d3d46;
  --tx-3: #71717c;
  --tx-inv: #ffffff;
  --line-subtle: rgba(0,0,0,.08);
  --line: rgba(0,0,0,.14);
  --line-strong: rgba(0,0,0,.26);
  --glass: rgba(255,255,255,.78);
  --glass-strong: rgba(250,250,252,.92);
  --grad-fade-b: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(244,244,246,.65) 55%, rgba(244,244,246,.95) 85%, var(--bg-0) 100%);
  --grad-fade-t: linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,.12) 30%, rgba(0,0,0,0) 50%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--bg-400) transparent;
}

body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--tx-1);
  background: var(--bg-0);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 { font-weight: var(--w-bold); letter-spacing: -0.015em; line-height: 1.15; }
::selection { background: rgba(229,9,20,.35); color: #fff; }
html[data-theme="light"] ::selection { color: #101014; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-400); border-radius: var(--r-full); border: 2px solid var(--bg-0); }
::-webkit-scrollbar-thumb:hover { background: var(--bg-500); }

:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--brand-500);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
html[data-spatial="1"] :focus-visible,
html[data-device="tv"] :focus-visible {
  outline-width: 4px;
  outline-offset: 4px;
  box-shadow: 0 0 34px var(--brand-glow);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

.section { content-visibility: auto; contain-intrinsic-size: auto 400px; }
.rail { content-visibility: auto; contain-intrinsic-size: auto 280px; }
.grid { content-visibility: auto; contain-intrinsic-size: auto 600px; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: calc(var(--z-toast) + 10);
  background: var(--brand-500); color: #fff;
  padding: 10px 18px; border-radius: var(--r-md); font-weight: var(--w-semi);
  transition: top var(--t-fast);
}
.skip-link:focus-visible { top: 12px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px;
  font-size: var(--fs-md); font-weight: var(--w-bold);
  border-radius: var(--r-md); white-space: nowrap;
  user-select: none; -webkit-user-select: none;
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn svg { flex-shrink: 0; }
.btn:active { transform: scale(.97); }
.btn--white { background: #fff; color: #0d0d0f; }
.btn--white:hover { background: rgba(255,255,255,.86); }
.btn--glass {
  background: rgba(109,110,113,.6);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn--glass:hover { background: rgba(130,131,135,.5); }
.btn--brand { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-1); }
.btn--brand:hover { box-shadow: 0 0 26px var(--brand-glow); }
.btn--ghost { background: transparent; color: var(--tx-2); border: 1px solid var(--line); }
.btn--ghost:hover { color: var(--tx-1); border-color: var(--line-strong); background: rgba(255,255,255,.06); }
.btn--lg { min-height: 50px; padding: 0 26px; font-size: var(--fs-md); border-radius: var(--r-lg); }
.btn--lg svg { width: 20px; height: 20px; }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn--icon { min-height: 42px; min-width: 42px; padding: 0; border-radius: var(--r-full); }
.btn[disabled] { opacity: .4; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: var(--r-full);
  color: var(--tx-1); position: relative;
  transition: background var(--t-fast), transform var(--t-fast);
}
html[data-theme="light"] .icon-btn { text-shadow: none; }
.icon-btn:hover { background: rgba(255,255,255,.12); }
.icon-btn:active { transform: scale(.94); }

/* Chips / badges */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 15px; border-radius: var(--r-full);
  border: 1px solid var(--line); color: var(--tx-2);
  font-size: var(--fs-sm); font-weight: var(--w-med);
  background: rgba(255,255,255,.04);
  white-space: nowrap;
  transition: all var(--t-fast);
}
.chip:hover { color: var(--tx-1); border-color: var(--line-strong); }
.chip.is-on { background: var(--tx-1); color: var(--tx-inv); border-color: var(--tx-1); font-weight: var(--w-semi); }

.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: var(--r-sm);
  font-size: var(--fs-2xs); font-weight: var(--w-bold);
  letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line-strong); color: var(--tx-2);
}
.tag--quality { color: #e5c07b; border-color: rgba(229,192,123,.45); }
.tag--live { color: #ff5a68; border-color: rgba(255,90,104,.5); }

.dot-sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .55; vertical-align: middle; }

.match { color: var(--ok); font-weight: var(--w-bold); }

.rating-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,.72);
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(4px);
  color: #ffd75e; font-weight: var(--w-bold); font-size: var(--fs-xs);
  padding: 3px 8px; border-radius: var(--r-sm);
}
.rating-chip svg { width: 11px; height: 11px; }

/* Layout containers */
.container { padding-inline: var(--gutter); max-width: 2200px; margin-inline: auto; }

.section { margin-block: clamp(28px, 4vw, 56px); }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s4); margin-bottom: 6px; padding-inline: var(--gutter);
}
.section__title { font-size: clamp(var(--fs-xl), 1rem + 1vw, var(--fs-2xl)); font-weight: var(--w-xbold); }
.section__more {
  font-size: var(--fs-sm); font-weight: var(--w-semi); color: var(--tx-3);
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  transition: color var(--t-fast);
}
.section__more:hover { color: var(--brand-300); }
.section__more svg { width: 14px; height: 14px; }

/* Empty state */
.empty {
  display: grid; place-items: center; text-align: center;
  padding: clamp(48px, 9vh, 120px) var(--gutter); color: var(--tx-3);
}
.empty__icon { width: 64px; height: 64px; margin-bottom: var(--s4); opacity: .5; }
.empty__title { font-size: var(--fs-xl); color: var(--tx-1); margin-bottom: var(--s2); }
.empty p { max-width: 420px; margin-bottom: var(--s5); }

/* Skeleton */
.sk {
  background: linear-gradient(100deg, var(--bg-200) 40%, var(--bg-300) 50%, var(--bg-200) 60%);
  background-size: 200% 100%;
  animation: sk 1.4s ease-in-out infinite;
  border-radius: var(--r-md);
}
@keyframes sk { from { background-position: 180% 0; } to { background-position: -20% 0; } }

/* ===== HEADER ===== */
.header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: var(--z-header);
  transition: background var(--t-med), backdrop-filter var(--t-med), border-color var(--t-med);
  background: linear-gradient(180deg, rgba(0,0,0,.62), rgba(0,0,0,0));
  padding-left: var(--safe-l); padding-right: var(--safe-r);
}
html[data-theme="light"] .header { background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(255,255,255,0)); }
.header.is-scrolled {
  background: var(--glass-strong);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--line-subtle);
}
.header__inner {
  height: 100%;
  display: flex; align-items: center; gap: var(--s5);
  padding-inline: var(--gutter);
}
.logo {
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-size: clamp(var(--fs-lg), .9rem + .6vw, 1.5rem);
  font-weight: var(--w-black); letter-spacing: -.03em;
}
.logo__icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  box-shadow: 0 4px 18px var(--brand-glow);
}
.logo__icon svg { width: 20px; height: 20px; color: #fff; }
.logo__text em { font-style: normal; color: var(--brand-500); }
.header__nav { display: flex; align-items: center; gap: 2px; margin-inline: auto; }
.nav-link {
  position: relative;
  padding: 10px 15px; border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: var(--w-semi); color: var(--tx-2);
  white-space: nowrap; transition: color var(--t-fast), background var(--t-fast);
}
.nav-link:hover { color: var(--tx-1); background: rgba(255,255,255,.07); }
.nav-link.is-active { color: var(--tx-1); }
.nav-link.is-active::after {
  content: ''; position: absolute; left: 15px; right: 15px; bottom: 2px;
  height: 3px; border-radius: var(--r-full); background: var(--brand-500);
}
.header__actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.notif-btn {}
.notif-dot {
  position: absolute; top: 8px; right: 8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-full); background: var(--brand-500);
  color: #fff; font-size: 10px; font-weight: var(--w-bold);
  display: grid; place-items: center; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg-0);
}
.avatar-btn { display: flex; align-items: center; gap: 7px; padding: 4px; border-radius: var(--r-full); transition: background var(--t-fast); }
.avatar-btn:hover { background: rgba(255,255,255,.1); }
.avatar {
  width: 34px; height: 34px; border-radius: var(--r-md);
  background: var(--grad-brand); color: #fff;
  display: grid; place-items: center;
  font-weight: var(--w-bold); font-size: var(--fs-sm);
}
.avatar-btn svg { width: 14px; height: 14px; color: var(--tx-2); transition: transform var(--t-fast); }
.avatar-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.burger { display: none; }

/* Dropdown menus */
.menu-wrap { position: relative; }
.menu {
  position: absolute; top: calc(100% + 12px); right: 0;
  min-width: 300px; max-width: min(92vw, 380px);
  background: var(--glass-strong);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast);
  z-index: calc(var(--z-header) + 5);
}
.menu.is-open { opacity: 1; visibility: visible; transform: none; }
.menu__head { padding: 12px 14px 10px; border-bottom: 1px solid var(--line-subtle); margin-bottom: 6px; }
.menu__title { font-size: var(--fs-sm); font-weight: var(--w-bold); }
.menu__sub { font-size: var(--fs-xs); color: var(--tx-3); }
.menu__item {
  display: flex; align-items: flex-start; gap: 12px; width: 100%;
  padding: 11px 14px; border-radius: var(--r-md); text-align: left;
  font-size: var(--fs-sm); color: var(--tx-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.menu__item:hover, .menu__item:focus-visible { background: rgba(255,255,255,.08); color: var(--tx-1); }
.menu__item svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.menu__item b { display: block; color: var(--tx-1); font-weight: var(--w-semi); }
.menu__item small { color: var(--tx-3); font-size: var(--fs-xs); }
.menu__item .menu__thumb { width: 44px; height: 30px; border-radius: var(--r-sm); object-fit: cover; flex-shrink: 0; }
.menu__sep { height: 1px; background: var(--line-subtle); margin: 6px 8px; }
.menu__foot { padding: 10px 14px 8px; font-size: var(--fs-2xs); color: var(--tx-3); text-align: center; }
.notif-item.is-unread b::after {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand-500); margin-left: 8px; vertical-align: middle;
}

/* ===== DRAWER (mobile / tablet nav) ===== */
.drawer-scrim {
  position: fixed; inset: 0; z-index: calc(var(--z-drawer) - 1);
  background: rgba(0,0,0,.6); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity var(--t-med), visibility var(--t-med);
}
.drawer-scrim.is-open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; z-index: var(--z-drawer);
  width: min(86vw, 360px);
  background: var(--glass-strong);
  border-left: 1px solid var(--line);
  backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px);
  transform: translateX(105%);
  transition: transform var(--t-med);
  display: flex; flex-direction: column;
  padding: calc(var(--header-h) + 8px) 22px calc(22px + var(--safe-b));
  overflow-y: auto;
}
.drawer.is-open { transform: none; }
.drawer__label { font-size: var(--fs-2xs); letter-spacing: .14em; text-transform: uppercase; color: var(--tx-3); margin: 14px 4px 8px; }
.drawer__link {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 12px; border-radius: var(--r-md);
  font-size: var(--fs-lg); font-weight: var(--w-semibold); color: var(--tx-2);
  transition: background var(--t-fast), color var(--t-fast);
}
.drawer__link svg { width: 20px; height: 20px; }
.drawer__link:hover { background: rgba(255,255,255,.07); color: var(--tx-1); }
.drawer__link.is-active { color: var(--tx-1); background: rgba(255,255,255,.06); box-shadow: inset 3px 0 0 var(--brand-500); }
.drawer__close { position: absolute; top: 14px; right: 14px; }

/* ===== BOTTOM NAV (phones) ===== */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: calc(var(--z-header) + 2);
  height: calc(62px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--glass-strong);
  border-top: 1px solid var(--line-subtle);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  display: none;
  grid-auto-flow: column; justify-content: space-around; align-items: stretch;
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 56px; color: var(--tx-3); font-size: 10.5px; font-weight: var(--w-semi);
  transition: color var(--t-fast);
}
.bnav-item svg { width: 23px; height: 23px; }
.bnav-item:hover { color: var(--tx-2); }
.bnav-item.is-active { color: var(--brand-400); }

/* ===== HERO CAROUSEL ===== */
.hero {
  position: relative;
  height: clamp(480px, calc(100vh - var(--header-h)), 860px);
  overflow: hidden;
  background: var(--bg-100);
}
.hero__slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden; transform: scale(1.045);
  transition: opacity 900ms ease, transform 6500ms linear, visibility 900ms;
  pointer-events: none;
}
.hero__slide.is-active { opacity: 1; visibility: visible; transform: scale(1); pointer-events: auto; }
.hero__bg { position: absolute; inset: 0; }
.hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.hero__shade, .hero__shade-t { position: absolute; inset: 0; }
.hero__shade { background: var(--grad-fade-b); }
.hero__shade-t { background: var(--grad-fade-t); }
.hero__content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 var(--gutter) clamp(48px, 9vh, 96px);
  max-width: 860px;
}
.hero__kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: var(--s3); }
.hero__top10 {
  display: inline-flex; align-items: center; gap: 7px;
  font-weight: var(--w-xbold); font-size: var(--fs-xs); letter-spacing: .04em;
}
.hero__top10 i {
  font-style: normal; background: var(--brand-500); color: #fff;
  border-radius: 4px; padding: 2px 5px; font-size: 10px;
}
.hero__title {
  font-size: clamp(var(--fs-hero-min), 1rem + 4.2vw, var(--fs-hero-max));
  font-weight: var(--w-black); line-height: .98; letter-spacing: -.025em;
  text-shadow: 0 4px 34px rgba(0,0,0,.65);
  margin-bottom: var(--s3);
  overflow-wrap: break-word;
}
.hero__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  font-size: var(--fs-sm); font-weight: var(--w-semi); color: var(--tx-2);
  margin-bottom: var(--s3);
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
}
.hero__desc {
  color: #e8e8ee; max-width: 580px;
  font-size: clamp(var(--fs-sm), .82rem + .35vw, var(--fs-lg));
  line-height: 1.55;
  text-shadow: 0 1px 10px rgba(0,0,0,.85);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: var(--s5);
}
html[data-theme="light"] .hero__desc, html[data-theme="light"] .hero__meta { color: #f2f2f5; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s3); }

.hero__dots {
  position: absolute; right: var(--gutter); bottom: clamp(52px, 9vh, 100px);
  display: flex; flex-direction: column; gap: 10px; z-index: 3;
}
.hero__dot {
  width: 26px; height: 5px; border-radius: var(--r-full);
  background: rgba(255,255,255,.32); transition: all var(--t-med);
}
.hero__dot:hover { background: rgba(255,255,255,.6); }
.hero__dot.is-active { background: var(--brand-500); width: 38px; }
.hero__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 50px; height: 50px; border-radius: var(--r-full);
  background: rgba(20,20,22,.5); color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  display: none; place-items: center;
  transition: background var(--t-fast), transform var(--t-fast);
}
.hero__arrow:hover { background: rgba(40,40,45,.75); }
.hero__arrow--l { left: calc(var(--gutter) / 2); }
.hero__arrow--r { right: calc(var(--gutter) / 2); }
@media (hover: hover) and (pointer: fine) {
  .hero:hover .hero__arrow { display: grid; }
}

/* ===== RAILS & CARDS ===== */
.rail-wrap { position: relative; }
.rail {
  display: flex; gap: var(--rail-gap);
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 22px var(--gutter) 26px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

.pcard {
  position: relative; flex: 0 0 auto;
  width: calc((100% - (var(--cpv) - 1) * var(--rail-gap)) / var(--cpv));
  display: block; border-radius: var(--r-md);
  outline-offset: 5px;
}
.pcard__frame {
  position: relative; display: block; aspect-ratio: 2 / 3; border-radius: inherit;
  overflow: hidden; background: var(--bg-200);
  isolation: isolate;
  transition: transform var(--t-med), box-shadow var(--t-med);
  box-shadow: var(--sh-1);
}
.pcard__frame::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255,255,255,.07); }
.pcard__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow); }
.pcard__hover {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(185deg, rgba(10,10,12,.1) 20%, rgba(10,10,12,.88) 90%);
  opacity: 0; transition: opacity var(--t-med);
}
.pcard__play {
  width: 54px; height: 54px; border-radius: var(--r-full);
  background: rgba(255,255,255,.94); color: #0c0c0e;
  display: grid; place-items: center;
  transform: translateY(10px) scale(.85); transition: transform var(--t-med);
  box-shadow: var(--sh-2);
}
.pcard__play svg { width: 22px; height: 22px; margin-left: 3px; }
.pcard__genres {
  font-size: var(--fs-xs); color: #dcdce2; text-align: center;
  padding-inline: 10px; font-weight: var(--w-med);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
  transform: translateY(8px); transition: transform var(--t-med);
}
.pcard__badges { position: absolute; top: 9px; left: 9px; right: 9px; display: flex; justify-content: space-between; align-items: flex-start; z-index: 3; pointer-events: none; }
.pcard__rank {
  min-width: 27px; height: 27px; padding: 0 6px;
  border-radius: 8px; background: var(--grad-brand);
  color: #fff; font-size: var(--fs-xs); font-weight: var(--w-xbold);
  display: grid; place-items: center; box-shadow: var(--sh-1);
}
.pcard__type {
  padding: 3px 7px; border-radius: 6px;
  background: rgba(0,0,0,.66); border: 1px solid rgba(255,255,255,.14);
  color: #e3e3ea; font-size: 10px; font-weight: var(--w-bold); letter-spacing: .08em; text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.pcard__progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: rgba(255,255,255,.22); z-index: 3;
}
.pcard__progress i { display: block; height: 100%; background: var(--brand-500); }
.pcard__caption { padding: 9px 3px 0; }
.pcard__name {
  font-size: var(--fs-sm); font-weight: var(--w-semi);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pcard__sub { font-size: var(--fs-xs); color: var(--tx-3); display: flex; align-items: center; gap: 7px; margin-top: 2px; }

/* Wide continue-watching variant */
.pcard--wide { width: calc((100vw - (var(--gutter) * 2) - (var(--cpvw) - 1) * var(--rail-gap)) / var(--cpvw)); max-width: 420px; }
.pcard--wide .pcard__frame { aspect-ratio: 16 / 9; }
.pcard--wide .pcard__left {
  position: absolute; left: 10px; bottom: 12px; z-index: 3;
  font-size: var(--fs-xs); font-weight: var(--w-bold); color: #fff;
  background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: var(--r-sm);
  backdrop-filter: blur(4px);
}

@media (hover: hover) and (pointer: fine) {
  .pcard:hover .pcard__frame, .pcard:focus-visible .pcard__frame {
    transform: scale(1.05);
    box-shadow: var(--sh-3);
    z-index: 4;
  }
  .pcard:hover .pcard__img, .pcard:focus-visible .pcard__img { transform: scale(1.09); }
  .pcard:hover .pcard__hover, .pcard:focus-visible .pcard__hover { opacity: 1; }
  .pcard:hover .pcard__play, .pcard:hover .pcard__genres,
  .pcard:focus-visible .pcard__play, .pcard:focus-visible .pcard__genres { transform: none; }
}

.rail-arrow {
  position: absolute; top: 50%; z-index: 6;
  transform: translateY(-50%) scale(.92);
  width: 46px; height: 46px; border-radius: var(--r-full);
  background: var(--glass-strong); color: #fff;
  border: 1px solid var(--line);
  backdrop-filter: blur(8px);
  display: grid; place-items: center;
  opacity: .45; pointer-events: auto;
  transition: opacity var(--t-fast), transform var(--t-fast), background var(--t-fast);
  box-shadow: var(--sh-2);
}
.rail-arrow svg { width: 22px; height: 22px; }
.rail-arrow:hover { background: rgba(50,50,56,.95); transform: translateY(-50%) scale(1); opacity: 1; }
.rail-arrow:active { opacity: 1; transform: translateY(-50%) scale(.95); }
.rail-arrow--l { left: 4px; }
.rail-arrow--r { right: 4px; }
.rail-arrow[disabled] { opacity: 0 !important; pointer-events: none !important; }
@media (hover: hover) and (pointer: fine) and (min-width: 900px) {
  .rail-arrow { opacity: 0; pointer-events: none; }
  .rail-wrap:hover .rail-arrow:not([disabled]) { opacity: 1; pointer-events: auto; }
  .rail-arrow:hover { opacity: 1; }
}

/* ===== SEARCH OVERLAY ===== */
.search-layer {
  position: fixed; inset: 0; z-index: var(--z-search);
  background: var(--glass-strong);
  backdrop-filter: blur(26px) saturate(1.25); -webkit-backdrop-filter: blur(26px) saturate(1.25);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(-12px);
  transition: opacity var(--t-med), transform var(--t-med), visibility var(--t-med);
  padding-left: var(--safe-l); padding-right: var(--safe-r);
}
.search-layer.is-open { opacity: 1; visibility: visible; transform: none; }
.search-bar {
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--gutter); height: var(--header-h);
  border-bottom: 1px solid var(--line-subtle);
  flex-shrink: 0;
}
.search-bar svg { width: 24px; height: 24px; color: var(--tx-3); flex-shrink: 0; }
.search-input {
  flex: 1; min-width: 0; background: transparent; border: none; outline: none;
  font-size: clamp(var(--fs-lg), 1rem + 1vw, 1.6rem); font-weight: var(--w-medium); color: var(--tx-1);
}
.search-input::placeholder { color: var(--tx-3); }
.search-body { flex: 1; overflow-y: auto; padding: var(--s6) 0 calc(var(--s10) + var(--safe-b)); }
.search-section { margin-bottom: var(--s8); }
.search-section h3 {
  font-size: var(--fs-xs); letter-spacing: .13em; text-transform: uppercase;
  color: var(--tx-3); margin-bottom: var(--s4); padding-inline: var(--gutter);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; padding-inline: var(--gutter); }
.mini-rail { display: flex; gap: var(--s4); overflow-x: auto; padding: 4px var(--gutter) 14px; scrollbar-width: none; }
.mini-rail::-webkit-scrollbar { display: none; }
.mini-card { flex: 0 0 128px; }
.mini-card .pcard__frame { aspect-ratio: 2/3; }
.mini-card .pcard__caption { display: block; }
.result-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--s4); padding-inline: var(--gutter);
}
.search-empty { text-align: center; color: var(--tx-3); padding: var(--s16) var(--gutter); }

/* ===== MODAL ===== */
.modal-layer {
  position: fixed; inset: 0; z-index: var(--z-modal);
  display: grid; place-items: center; padding: var(--s5);
  background: rgba(0,0,0,.72); backdrop-filter: blur(6px);
  opacity: 0; visibility: hidden; transition: opacity var(--t-med), visibility var(--t-med);
}
.modal-layer.is-open { opacity: 1; visibility: visible; }
.modal {
  width: min(94vw, 520px); max-height: min(86vh, 720px); overflow-y: auto;
  background: var(--bg-100); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  transform: translateY(14px) scale(.97); transition: transform var(--t-med);
  padding: var(--s6);
}
.modal-layer.is-open .modal { transform: none; }
.modal__title { font-size: var(--fs-xl); margin-bottom: var(--s4); }
.modal__body { font-size: var(--fs-sm); color: var(--tx-2); line-height: 1.65; }
.modal__close { float: right; margin: -10px -10px 0 0; }

/* ===== TOASTS ===== */
.toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(76px + var(--safe-b)); z-index: var(--z-toast);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: max-content; max-width: 92vw;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass-strong); border: 1px solid var(--line);
  border-radius: var(--r-full); padding: 11px 20px;
  font-size: var(--fs-sm); font-weight: var(--w-semi); color: var(--tx-1);
  box-shadow: var(--sh-2);
  animation: toast-in var(--t-med) cubic-bezier(.34,1.4,.64,1);
  max-width: 92vw;
}
.toast svg { width: 17px; height: 17px; flex-shrink: 0; }
.toast--ok svg { color: var(--ok); }
.toast--info svg { color: var(--brand-400); }
.toast.is-out { opacity: 0; transform: translateY(8px); transition: all var(--t-med); }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.94); } to { opacity: 1; } }

/* ===== FEATURE STRIP + FOOTER ===== */
.feature-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4);
  padding: var(--s8) var(--gutter);
  border-top: 1px solid var(--line-subtle);
  margin-top: var(--s12);
}
.feat { display: flex; align-items: flex-start; gap: 14px; }
.feat svg { width: 26px; height: 26px; color: var(--brand-400); flex-shrink: 0; margin-top: 2px; }
.feat b { display: block; font-size: var(--fs-sm); font-weight: var(--w-bold); }
.feat span { font-size: var(--fs-xs); color: var(--tx-3); }

.footer { border-top: 1px solid var(--line-subtle); padding: var(--s10) 0 calc(var(--s8) + var(--safe-b)); }
.footer__grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s8);
  padding-inline: var(--gutter);
}
.footer__brand p { font-size: var(--fs-sm); color: var(--tx-3); max-width: 320px; margin-top: var(--s3); }
.footer__social { display: flex; gap: 8px; margin-top: var(--s4); }
.footer__social a {
  width: 38px; height: 38px; border-radius: var(--r-full);
  border: 1px solid var(--line); display: grid; place-items: center; color: var(--tx-3);
  transition: all var(--t-fast);
}
.footer__social a:hover { color: var(--tx-1); border-color: var(--line-strong); transform: translateY(-2px); }
.footer__social svg { width: 17px; height: 17px; }
.footer__col h4 { font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--tx-3); margin-bottom: var(--s4); }
.footer__col a { display: block; padding: 6px 0; font-size: var(--fs-sm); color: var(--tx-2); transition: color var(--t-fast); }
.footer__col a:hover { color: var(--brand-300); }
.footer__base {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s6) var(--gutter) 0; margin-top: var(--s8);
  border-top: 1px solid var(--line-subtle);
  font-size: var(--fs-xs); color: var(--tx-3);
}

/* ===== PAGE SHELL ===== */
.page { padding-top: calc(var(--header-h) + var(--s5)); padding-bottom: var(--s10); min-height: 60vh; }
.page--flush { padding-top: var(--header-h); }

.page-head { padding-inline: var(--gutter); margin-bottom: var(--s6); }
.page-head h1 { font-size: clamp(var(--fs-2xl), .9rem + 2.4vw, 3rem); font-weight: var(--w-black); letter-spacing: -.03em; }
.page-head p { color: var(--tx-3); margin-top: 6px; max-width: 640px; }

/* ===== BROWSE / CATALOG ===== */
.browse-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3);
  padding-inline: var(--gutter); margin-bottom: var(--s5);
}
.chip-scroller {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  flex: 1; min-width: 0; padding-block: 4px;
}
.chip-scroller::-webkit-scrollbar { display: none; }
.sort-select {
  appearance: none; -webkit-appearance: none;
  background: var(--bg-200) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e8e99' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line); color: var(--tx-1);
  border-radius: var(--r-full); padding: 8px 38px 8px 16px;
  font-size: var(--fs-sm); font-weight: var(--w-semi); cursor: pointer;
}
.sort-select:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 2px; }

.grid {
  display: grid;
  grid-template-columns: repeat(var(--gcols), minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 26px) var(--rail-gap);
  padding-inline: var(--gutter);
}
.grid .pcard { width: auto; }
.result-count { padding-inline: var(--gutter); color: var(--tx-3); font-size: var(--fs-sm); margin-bottom: var(--s4); }

/* ===== DETAIL PAGE ===== */
.detail-hero { position: relative; min-height: clamp(420px, 62vh, 760px); display: flex; align-items: flex-end; overflow: hidden; }
.detail-hero__bg { position: absolute; inset: 0; }
.detail-hero__bg img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.detail-hero__shade { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.06) 30%, rgba(0,0,0,.25) 62%, rgba(0,0,0,.94) 92%, var(--bg-0) 100%),
  linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 55%);
}
html[data-theme="light"] .detail-hero__shade { background:
  linear-gradient(180deg, rgba(10,10,12,.5) 0%, rgba(10,10,12,.05) 32%, rgba(10,10,12,.22) 60%, rgba(244,244,246,.95) 94%, var(--bg-0) 100%),
  linear-gradient(90deg, rgba(10,10,12,.5) 0%, rgba(10,10,12,0) 55%);
}
.detail-wrap {
  position: relative; z-index: 2;
  width: 100%; padding: 0 var(--gutter) var(--s8);
  display: grid; grid-template-columns: 1fr; gap: var(--s6); align-items: end;
}
.detail-poster {
  width: clamp(150px, 22vw, 260px); aspect-ratio: 2/3;
  border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--sh-3), 0 0 0 1px rgba(255,255,255,.09);
  background: var(--bg-300);
}
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-main { max-width: 720px; padding-bottom: 4px; }
.back-link {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: var(--fs-sm); font-weight: var(--w-semi); color: var(--tx-2);
  margin-bottom: var(--s4); transition: color var(--t-fast);
}
.back-link:hover { color: var(--tx-1); }
.back-link svg { width: 17px; height: 17px; }
.detail-title { font-size: clamp(var(--fs-2xl), 1rem + 3.4vw, 3.6rem); font-weight: var(--w-black); letter-spacing: -.028em; line-height: 1.02; text-shadow: 0 3px 28px rgba(0,0,0,.6); margin-bottom: var(--s3); }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 13px; font-size: var(--fs-sm); font-weight: var(--w-semi); color: #dcdce2; margin-bottom: var(--s4); }
html[data-theme="light"] .detail-meta { color: #33333c; }
.detail-genres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--s4); }
.genre-pill {
  font-size: var(--fs-xs); font-weight: var(--w-semibold); color: #e4e4ea;
  padding: 5px 13px; border-radius: var(--r-full);
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(4px);
  transition: all var(--t-fast);
}
.genre-pill:hover { background: rgba(255,255,255,.2); }
.detail-desc {
  font-size: clamp(var(--fs-sm), .85rem + .3vw, var(--fs-lg));
  line-height: 1.6; color: #e9e9ef; max-width: 640px;
  text-shadow: 0 1px 8px rgba(0,0,0,.7);
  margin-bottom: var(--s5);
}
html[data-theme="light"] .detail-desc { color: #232329; }
.detail-actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s5); }
.list-btn.is-in { background: rgba(70,211,105,.18); border-color: rgba(70,211,105,.5); color: #7dedA0; }
.cast-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.cast-chip { font-size: var(--fs-xs); color: var(--tx-3); padding: 5px 11px; border-radius: var(--r-full); background: var(--bg-100); border: 1px solid var(--line-subtle); }

/* Cast section with photos */
.cast-sec { margin-top: var(--s6); margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding-left: var(--gutter); }
.cast-rail-wrap { position: relative; }
.cast-rail-wrap .rail-arrow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cast-rail-wrap:hover .rail-arrow:not([disabled]) { display: grid; }
}
.cast-row { display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-bottom: var(--s4); padding-right: var(--gutter); scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.cast-row::-webkit-scrollbar { display: none; }
.cast-card { flex: 0 0 auto; width: 100px; text-align: center; scroll-snap-align: start; }
.cast-img {
  width: 100px; height: 100px; border-radius: 50%; object-fit: cover;
  display: block; margin: 0 auto 8px;
  background: var(--bg-200); border: 2px solid rgba(255,255,255,.06);
}
.cast-img--ph {
  display: grid; place-items: center; font-size: 28px; font-weight: 700;
  color: rgba(255,255,255,.3); background: linear-gradient(135deg, var(--bg-200), var(--bg-300));
}
.cast-name { display: block; font-size: var(--fs-xs); font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-role { display: block; font-size: 11px; color: var(--tx-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.detail-body { padding: var(--s6) var(--gutter) 0; display: grid; gap: var(--s10); max-width: 1100px; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--s5); }
.fact b { display: block; font-size: var(--fs-xs); letter-spacing: .1em; text-transform: uppercase; color: var(--tx-3); margin-bottom: 5px; }
.fact span { font-size: var(--fs-sm); color: var(--tx-1); font-weight: var(--w-medium); }

/* Seasons & episodes */
.seasons-bar { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: var(--s5); }
.episodes { display: grid; grid-template-columns: 1fr; gap: var(--s4); }
.ep-card {
  display: grid; grid-template-columns: minmax(150px, 240px) 1fr; gap: var(--s4);
  background: var(--bg-50); border: 1px solid var(--line-subtle);
  border-radius: var(--r-lg); overflow: hidden;
  transition: transform var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
}
.ep-thumb { position: relative; aspect-ratio: 16/9; background: var(--bg-300); }
.ep-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow); }
.ep-num {
  position: absolute; left: 8px; bottom: 8px; z-index: 2;
  background: rgba(0,0,0,.72); color: #fff;
  font-size: var(--fs-xs); font-weight: var(--w-bold);
  padding: 3px 9px; border-radius: var(--r-sm); backdrop-filter: blur(4px);
}
.ep-info { padding: var(--s4) var(--s4) var(--s4) 0; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.ep-title { font-size: var(--fs-md); font-weight: var(--w-bold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-overview {
  font-size: var(--fs-sm); color: var(--tx-3);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ep-runtime { font-size: var(--fs-xs); color: var(--tx-3); display: flex; align-items: center; gap: 8px; }
@media (hover:hover) and (pointer:fine) {
  .ep-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--sh-2); }
  .ep-card:hover .ep-thumb img { transform: scale(1.06); }
}

/* ===== PLAYER ===== */
.player-layer { position: fixed; inset: 0; z-index: var(--z-player); background: #000; display: none; }
.player-layer.is-open { display: block; }
.player-stage { position: absolute; inset: 0; }
.player-stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-error {
  position: absolute; inset: 0; display: none; place-content: center; justify-items: center; gap: var(--s4);
  text-align: center; padding: var(--s5); color: var(--tx-2);
}
.player-error.is-shown { display: grid; }
.player-loading {
  position: absolute; inset: 0; z-index: 5; display: none; place-content: center; justify-items: center; gap: 14px;
  background: rgba(0,0,0,.6); color: #fff; font-size: var(--fs-sm); font-weight: var(--w-medium);
}
.player-loading.is-shown { display: grid; }
.player-loading-spinner {
  width: 36px; height: 36px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--brand-500);
  border-radius: 50%; animation: pspin .7s linear infinite;
}
@keyframes pspin { to { transform: rotate(360deg); } }
.player-ui {
  position: absolute; inset: 0; z-index: 2;
  opacity: 1; transition: opacity var(--t-med);
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, transparent 22%, transparent 74%, rgba(0,0,0,.78) 100%);
  pointer-events: none;
}
.player-ui > * { pointer-events: auto; }
.player-ui.is-hidden { opacity: 0; }
.player-ui.is-hidden .player-controls, .player-ui.is-hidden .player-top { pointer-events: none; }
.player-top { display: flex; align-items: center; gap: var(--s4); padding: var(--s4) var(--gutter); }
.player-tit b { display: block; font-size: var(--fs-md); font-weight: var(--w-bold); color: #fff; }
.player-tit span { font-size: var(--fs-xs); color: #b9b9c2; }
.player-bottom { padding: 0 var(--gutter) var(--s5); display: grid; gap: 10px; }
.seek { position: relative; height: 20px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.seek__track { position: relative; width: 100%; height: 5px; border-radius: var(--r-full); background: rgba(255,255,255,.22); overflow: visible; transition: height var(--t-fast); }
.seek:hover .seek__track { height: 8px; }
.seek__buf { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: inherit; background: rgba(255,255,255,.35); width: 0%; }
.seek__fill { position: absolute; inset: 0 auto 0 0; height: 100%; border-radius: inherit; background: var(--brand-500); width: 0%; }
.seek__knob {
  position: absolute; top: 50%; left: 0%;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--brand-500); transform: translate(-50%, -50%) scale(0);
  transition: transform var(--t-fast); box-shadow: 0 0 12px var(--brand-glow);
}
.seek:hover .seek__knob, .seek:focus-within .seek__knob { transform: translate(-50%, -50%) scale(1); }
.player-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pbtn {
  width: 46px; height: 46px; border-radius: var(--r-full);
  display: grid; place-items: center; color: #fff;
  transition: background var(--t-fast), transform var(--t-fast);
}
.pbtn svg { width: 23px; height: 23px; }
.pbtn:hover, .pbtn:focus-visible { background: rgba(255,255,255,.14); }
.pbtn--play { width: 58px; height: 58px; background: #fff; color: #000; }
.pbtn--play svg { width: 27px; height: 27px; }
.pbtn--play:hover { background: #f0f0f0; }
.pbtn--back { margin-right: 4px; }
.p-time { font-size: var(--fs-sm); color: #d5d5dc; font-variant-numeric: tabular-nums; padding-inline: 8px; white-space: nowrap; }
.player-spacer { flex: 1; }
.vol-group { display: flex; align-items: center; }
.vol-range { width: 0; opacity: 0; transition: all var(--t-med); accent-color: var(--brand-500); height: 4px; cursor: pointer; }
.vol-group:hover .vol-range, .vol-range:focus-visible { width: 88px; opacity: 1; margin-inline: 8px; }
.player-top-spacer { flex: 1; }

/* Player slide-in panel */
.player-panel { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.panel-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.6); opacity: 0; transition: opacity var(--t-med); pointer-events: none; }
.panel-overlay.is-open { opacity: 1; pointer-events: auto; }
.panel-body {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(380px, 85vw); background: rgba(12,12,16,.96);
  backdrop-filter: blur(16px); border-left: 1px solid rgba(255,255,255,.08);
  transform: translateX(100%); transition: transform var(--t-med);
  overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s5) var(--s4);
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
  pointer-events: auto; z-index: 6;
  touch-action: pan-y;
}
.panel-overlay.is-open ~ .panel-body { transform: translateX(0); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s4); }
.panel-head h3 { color: #fff; font-size: var(--fs-md); font-weight: var(--w-bold); margin: 0; }
.panel-close { background: none; border: none; color: #999; cursor: pointer; padding: 4px; }
.panel-close:hover { color: #fff; }
.panel-close svg { width: 20px; height: 20px; }

/* Episode list inside panel */
.ep-season-tabs { display: flex; gap: 6px; margin-bottom: var(--s4); overflow-x: auto; scrollbar-width: none; }
.ep-season-tabs::-webkit-scrollbar { display: none; }
.ep-tab {
  flex-shrink: 0; padding: 6px 14px; border-radius: var(--r-full);
  background: rgba(255,255,255,.08); color: #b9b9c2; border: none;
  font-size: var(--fs-xs); font-weight: var(--w-semi); cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}
.ep-tab:hover { background: rgba(255,255,255,.14); color: #fff; }
.ep-tab.is-on { background: var(--brand-500); color: #fff; }
.ep-list { display: flex; flex-direction: column; gap: 6px; }
.ep-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--r-sm); padding: 8px; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
  text-align: left; color: #d5d5dc; width: 100%;
}
.ep-card:hover { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.12); }
.ep-card.is-playing { border-color: var(--brand-500); background: rgba(229,9,20,.12); }
.ep-card.is-unreleased { opacity: .55; cursor: default; }
.ep-card.is-unreleased:hover { background: transparent; border-color: rgba(255,255,255,.06); }
.ep-airdate { font-size: 11px; color: var(--brand-500); font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; margin-top: 2px; }
.ep-thumb { width: 100px; height: 56px; border-radius: 4px; object-fit: cover; flex-shrink: 0; }
.ep-thumb--ph {
  display: grid; place-items: center; background: rgba(255,255,255,.08);
  font-weight: 700; font-size: var(--fs-lg); color: #666;
}
.ep-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ep-num { font-size: 10px; font-weight: 700; color: #888; text-transform: uppercase; letter-spacing: .5px; }
.ep-name { font-size: var(--fs-xs); font-weight: var(--w-semi); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-desc { font-size: 11px; color: #777; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep-now { font-size: 10px; color: var(--brand-500); font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.ep-now svg { width: 12px; height: 12px; }
.ep-loading { color: #666; font-size: var(--fs-sm); padding: var(--s6) 0; text-align: center; }

/* Settings groups inside panel */
.set-group { margin-bottom: var(--s5); }
.set-group label { display: block; font-size: var(--fs-xs); font-weight: 600; color: #888; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.set-options { display: flex; flex-wrap: wrap; gap: 6px; }
.set-option {
  padding: 8px 16px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.06); color: #b9b9c2; border: 1px solid rgba(255,255,255,.08);
  font-size: var(--fs-xs); font-weight: 500; cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.set-option:hover { background: rgba(255,255,255,.1); color: #fff; }
.set-option.is-active { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }
.set-note { font-size: var(--fs-xs); color: #555; margin-top: var(--s4); }

/* Server buttons in settings */
.server-btn {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
  color: #b9b9c2; cursor: pointer; text-align: left;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.server-btn:hover { background: rgba(255,255,255,.08); }
.server-btn.is-active { border-color: var(--brand-500); background: rgba(229,9,20,.1); }
.server-name { font-size: var(--fs-sm); font-weight: 600; color: #fff; }
.server-label { font-size: 11px; color: #777; }
.server-check { margin-left: auto; color: var(--brand-500); }
.server-check svg { width: 16px; height: 16px; }
.server-list { flex-direction: column; }

/* Subtitle upload */
.sub-upload-label {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 12px 14px; border-radius: var(--r-sm);
  background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.2);
  color: #b9b9c2; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.sub-upload-label:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); }
.sub-upload-icon svg { width: 18px; height: 18px; }
.sub-upload-text { font-size: var(--fs-sm); }

.sub-search-row { display: flex; gap: 6px; }
.sub-search-input {
  flex: 1; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15);
  color: #fff; border-radius: var(--r-sm); padding: 10px 12px; font-size: var(--fs-sm);
}
.sub-search-input::placeholder { color: #666; }
.sub-search-input:focus { border-color: var(--brand-500); outline: none; }
.sub-search-btn {
  background: var(--brand-500); color: #fff; border: none; border-radius: var(--r-sm);
  padding: 10px 16px; font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
  transition: background var(--t-fast);
}
.sub-search-btn:hover { background: var(--brand-600); }
.sub-results { max-height: 200px; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.sub-results::-webkit-scrollbar { width: 4px; }
.sub-results::-webkit-scrollbar-track { background: transparent; }
.sub-results::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 4px; }
.sub-result-item {
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast); text-align: left;
}
.sub-result-item:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.2); }
.sub-result-item.is-loading { opacity: .5; pointer-events: none; }
.sub-result-name { font-size: var(--fs-sm); color: #fff; font-weight: 500; }
.sub-result-meta { font-size: 11px; color: #888; }
.sub-offset-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sub-offset-btn {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15);
  color: #ccc; border-radius: var(--r-sm); padding: 6px 12px; font-size: 12px;
  cursor: pointer; transition: background var(--t-fast), color var(--t-fast);
}
.sub-offset-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.sub-offset-reset { color: var(--brand-400); border-color: rgba(255,100,100,.25); }
.sub-offset-reset:hover { background: rgba(255,100,100,.1); }
.sub-offset-val { font-size: var(--fs-sm); color: #fff; font-weight: 600; min-width: 50px; text-align: center; }

.sub-lang-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-lang-chip {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  color: #aaa; border-radius: 20px; padding: 6px 14px; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all var(--t-fast);
}
.sub-lang-chip:hover { background: rgba(255,255,255,.1); color: #fff; }
.sub-lang-chip.is-active { background: var(--brand-500); color: #fff; border-color: var(--brand-500); }
.sub-auto-status {
  display: flex; align-items: center; gap: 8px; padding: 12px 0;
  font-size: var(--fs-xs); color: #888;
}
.sub-auto-status:empty { display: none; }
.sub-spinner {
  width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.15);
  border-top-color: var(--brand-500); border-radius: 50%;
  animation: subspin .6s linear infinite;
}
@keyframes subspin { to { transform: rotate(360deg); } }
.sub-auto-result { margin-top: 4px; }
.sub-auto-result:empty { display: none; }
.sub-auto-btn {
  display: flex; flex-direction: column; gap: 4px; width: 100%;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--r-sm); padding: 12px 14px; cursor: pointer;
  transition: all var(--t-fast); text-align: left;
}
.sub-auto-btn:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.25); }
.sub-auto-btn.is-loading { opacity: .6; pointer-events: none; }
.sub-auto-name { font-size: var(--fs-sm); color: #fff; font-weight: 500; }
.sub-auto-meta { font-size: 11px; color: #888; }
.sub-auto-load { font-size: 11px; color: var(--brand-400); font-weight: 600; margin-top: 2px; }

/* ===== SEARCH RESULTS PAGE / MY LIST / 404 reuse grid ===== */
.kv-note { padding-inline: var(--gutter); color: var(--tx-3); font-size: var(--fs-sm); margin-bottom: var(--s5); }

/* ===== REQUEST FORM ===== */
.request-form { display: flex; flex-direction: column; gap: var(--s5); margin-bottom: var(--s8); }
.req-field { display: flex; flex-direction: column; gap: 6px; }
.req-field label { font-size: var(--fs-sm); font-weight: var(--w-semi); color: var(--tx-2); }
.req-field input,
.req-field select,
.req-field textarea {
  background: var(--bg-200); border: 1px solid var(--line); color: var(--tx-1);
  border-radius: var(--r-md); padding: 12px 16px; font-size: var(--fs-md);
  transition: border-color var(--t-fast);
}
.req-field input:focus,
.req-field select:focus,
.req-field textarea:focus { border-color: var(--brand-500); outline: none; }
.req-field textarea { resize: vertical; min-height: 80px; }
.req-field select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e8e99' stroke-width='2.4'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
  padding-right: 40px;
}
.req-history { margin-top: var(--s6); }
.req-history h3 { font-size: var(--fs-lg); font-weight: var(--w-bold); margin-bottom: var(--s4); }
.req-list { display: flex; flex-direction: column; gap: 8px; }
.req-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--r-md);
  background: var(--bg-100); border: 1px solid var(--line-subtle);
}
.req-item-title { font-weight: var(--w-semi); font-size: var(--fs-md); }
.req-item-meta { font-size: var(--fs-xs); color: var(--tx-3); }
.req-item-date { font-size: var(--fs-xs); color: var(--tx-3); margin-left: auto; }

/* ============================================================
   ADAPTIVE LAYER — one design system, four presentations
   Modes are driven by BOTH fluid breakpoints and the
   capability attributes set by js/device.js:
     html[data-device="mobile|tablet|desktop|tv"]
     html[data-input="touch|mouse|hybrid"]
     html[data-orientation="portrait|landscape"]
     html[data-density="sd|hd|4k"]
     html[data-spatial="1"]
   ============================================================ */

/* ---------- FLUID CARD DENSITY ---------- */
:root { --cpv: 2; --cpvw: 1.45; --gcols: 2; }

@media (min-width: 480px) {
  :root { --cpv: 2.35; --cpvw: 1.7; --gcols: 3; }
}
@media (min-width: 768px) {
  :root { --cpv: 3.2; --cpvw: 2.35; --gcols: 4; --header-h: 64px; }
}
@media (min-width: 768px) and (max-width: 1023px) and (orientation: landscape),
       (min-width: 900px) and (max-width: 1023px) {
  :root { --cpv: 4.3; --cpvw: 3; }
}
@media (min-width: 1024px) { :root { --cpv: 5; --cpvw: 3.4; --gcols: 5; } }
@media (min-width: 1280px) { :root { --cpv: 6; --gcols: 6; } }
@media (min-width: 1440px) { :root { --cpv: 7; --gcols: 7; } }
@media (min-width: 1920px) { :root { --cpv: 8; --cpvw: 3.8; --gcols: 8; } }

/* ---------- MOBILE (presentation <= 767px) ---------- */
@media (max-width: 899px) {
  .header__nav { display: none; }
  .burger { display: inline-flex; }
}

@media (max-width: 767px) {
  :root {
    --header-h: 58px;
    --fs-hero-min: 1.75rem;
    --fs-hero-max: 2.6rem;
    --gutter: 18px;
    --rail-gap: 12px;
  }

  .bottom-nav { display: grid; }
  body { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }

  .logo__icon { width: 31px; height: 31px; border-radius: 8px; }
  .logo__icon svg { width: 17px; height: 17px; }
  .avatar-btn svg.chev { display: none; }
  .icon-btn { width: 41px; height: 41px; }

  .hero { height: clamp(440px, calc(100svh - var(--header-h)), 660px); }
  .hero__content { bottom: 0; padding-bottom: 30px; }
  .hero__desc { -webkit-line-clamp: 3; margin-bottom: 18px; }
  .hero__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .hero__actions .btn--lg,
  .hero__actions > .btn { min-height: 42px; padding: 0 16px; font-size: var(--fs-sm); border-radius: var(--r-md); }
  .hero__actions > .btn:first-child { grid-column: 1 / -1; }
  .hero__actions > .btn svg { width: 18px; height: 18px; }
  .hero__dots {
    position: static; flex-direction: row; justify-content: center;
    padding: 14px 0 4px;
  }
  .hero__dot { width: 18px; }
  .hero__dot.is-active { width: 30px; }

  .pcard--wide { max-width: 340px; }
  .section { margin-block: 26px; }
  .toasts { bottom: calc(74px + env(safe-area-inset-bottom)); }

  .footer__grid { grid-template-columns: repeat(2, 1fr); gap: var(--s6); }
  .feature-strip { grid-template-columns: 1fr; gap: var(--s5); padding-block: var(--s6); }

  .detail-actions { gap: 8px; }
  .detail-actions .btn--lg,
  .detail-actions > .btn { min-height: 40px; padding: 0 14px; font-size: var(--fs-sm); border-radius: var(--r-md); }
  .detail-actions > .btn svg { width: 18px; height: 18px; }

  .cast-card { width: 80px; }
  .cast-img { width: 80px; height: 80px; }
  .cast-img--ph { font-size: 22px; }
  .cast-name { font-size: 11px; }
  .cast-role { font-size: 10px; }

  .ep-card { grid-template-columns: 1fr; }
  .ep-info { padding: 0 var(--s4) var(--s4); }

  /* Player mobile compact */
  .player-controls { gap: 2px; }
  .pbtn { width: 38px; height: 38px; }
  .pbtn svg { width: 20px; height: 20px; }
  .pbtn--play { width: 46px; height: 46px; }
  .pbtn--play svg { width: 22px; height: 22px; }
  .pbtn--back { margin-right: 2px; }
  .player-bottom { padding: 0 10px var(--s4); gap: 6px; }
  .vol-group { display: none; }
  .p-time { font-size: 11px; padding-inline: 4px; }
  .player-tit b { font-size: var(--fs-sm); }
  .player-tit span { font-size: 11px; }
  .player-top { padding: var(--s4) 10px; gap: 6px; }
  .panel-body { width: 100vw; }
  .ep-season-tabs { gap: 4px; }
  .ep-tab { padding: 5px 10px; font-size: 11px; }

  /* Cast rail arrows always visible on mobile (touch) */
  .cast-rail-wrap .rail-arrow { display: grid; opacity: .85; }
  .cast-rail-wrap .rail-arrow:active { opacity: 1; }
  .cast-row { padding-left: 4px; }

  /* Request form mobile */
  .request-form .btn { width: 100%; }
}

/* Large-phone refinement */
@media (min-width: 480px) and (max-width: 767px) {
  :root { --gutter: 22px; }
}

/* Phone landscape — reclaim vertical space */
@media (max-height: 460px) and (orientation: landscape) {
  :root { --header-h: 50px; --cpv: 2.6; }
  .bottom-nav { height: 52px; padding-bottom: 0; }
  body { padding-bottom: 52px; }
  .bnav-item span { display: none; }
  .bnav-item svg { width: 21px; height: 21px; }
  .hero { height: clamp(380px, 100svh, 620px); }
  .hero__content { padding-bottom: 22px; max-width: none; padding-right: 130px; }
  .hero__title { margin-bottom: 8px; }
  .hero__desc { -webkit-line-clamp: 2; margin-bottom: 14px; }
  .hero__actions { display: flex; }
  .hero__dots { position: absolute; right: 22px; bottom: 30px; flex-direction: column; }
  .section { margin-block: 18px; }
}

/* ---------- TABLET (768 – 1023) ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
  :root { --gutter: 28px; --fs-hero-min: 2.1rem; --fs-hero-max: 3.4rem; }
  .hero { height: clamp(500px, calc(100svh - var(--header-h)), 760px); }
  .hero__desc { -webkit-line-clamp: 3; }
  .nav-link { padding: 9px 11px; font-size: var(--fs-xs); }
  .header__inner { gap: var(--s3); }
  .feature-strip { grid-template-columns: repeat(3, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) and (max-width: 1023px) {
  .nav-link { padding: 10px 14px; font-size: var(--fs-sm); }
}

/* ---------- DESKTOP (1024 – 1919) ---------- */
@media (min-width: 1024px) {
  :root { --fs-hero-min: 2.3rem; --fs-hero-max: 4.25rem; }
  .hero { height: clamp(520px, calc(100vh - var(--header-h)), 900px); }
  .detail-wrap { grid-template-columns: auto 1fr; align-items: end; }
}

/* ---------- LARGE DESKTOP (1440 – 1919) ---------- */
@media (min-width: 1440px) {
  :root { --gutter: clamp(32px, 3vw, 64px); }
}

/* ---------- LARGE SCREEN / TV (>=1920 or detected) ---------- */
@media (min-width: 1920px) {
  :root {
    --rail-gap: 16px;
    --gutter: clamp(48px, 3.4vw, 96px);
  }
  .logo { font-size: 1.65rem; }
  .nav-link { font-size: var(--fs-md); padding: 11px 18px; }
  .section__title { font-size: var(--fs-2xl); }
  .pcard__name { font-size: var(--fs-md); }
  .pcard__sub { font-size: var(--fs-xs); }
  .hero__meta, .hero__desc { font-size: var(--fs-lg); }
}

html[data-device="tv"] {
  --safe-l: clamp(28px, 2.6vw, 80px);
  --safe-r: clamp(28px, 2.6vw, 80px);
  --safe-b: clamp(20px, 2.2vh, 44px);
  --gutter: calc(clamp(48px, 3.6vw, 104px));
  --header-h: 84px;
  font-size: 18px;
  scroll-padding-top: calc(var(--header-h) + 24px);
}
html[data-device="tv"] body { overscroll-behavior: none; }
html[data-device="tv"] .header,
html[data-device="tv"] .search-layer { padding-left: var(--safe-l); padding-right: var(--safe-r); }
html[data-device="tv"] .hero__content { padding-left: calc(var(--gutter) + var(--safe-l)); padding-right: calc(var(--gutter) + var(--safe-r)); padding-bottom: clamp(60px, 11vh, 120px); }
html[data-device="tv"] .section__head,
html[data-device="tv"] .page-head,
html[data-device="tv"] .browse-toolbar,
html[data-device="tv"] .result-count,
html[data-device="tv"] .chip-row,
html[data-device="tv"] .mini-rail,
html[data-device="tv"] .grid,
html[data-device="tv"] .search-section h3,
html[data-device="tv"] .kv-note,
html[data-device="tv"] .detail-wrap,
html[data-device="tv"] .detail-body,
html[data-device="tv"] .feature-strip,
html[data-device="tv"] .footer__grid,
html[data-device="tv"] .footer__base { padding-left: calc(var(--gutter) + var(--safe-l)); padding-right: calc(var(--gutter) + var(--safe-r)); }
html[data-device="tv"] .rail { padding-left: calc(var(--gutter) + var(--safe-l)); padding-right: calc(var(--gutter) + var(--safe-r)); padding-top: 30px; padding-bottom: 38px; }
html[data-device="tv"] .hero__arrow,
html[data-device="tv"] .rail-arrow { display: none !important; }
html[data-device="tv"] .hero { height: clamp(620px, 88vh, 1120px); }
html[data-device="tv"] .hero__dot { width: 42px; height: 7px; }
html[data-device="tv"] .hero__dot.is-active { width: 62px; }
html[data-device="tv"] :focus-visible { outline-offset: 5px; }
html[data-device="tv"] .pcard:focus-visible { outline: none; }
html[data-device="tv"] .pcard:focus-visible .pcard__frame {
  transform: scale(1.045);
  box-shadow: var(--sh-tv-focus);
}
html[data-device="tv"] .pcard:focus-visible .pcard__hover { opacity: 1; }
html[data-device="tv"] .pcard:focus-visible .pcard__play { background: #fff; }
html[data-device="tv"] .btn { min-height: 54px; padding: 0 30px; font-size: var(--fs-lg); }
html[data-device="tv"] .btn--lg { min-height: 64px; padding: 0 42px; font-size: var(--fs-xl); }
html[data-device="tv"] .icon-btn { width: 52px; height: 52px; }
html[data-device="tv"] .menu { min-width: 400px; }
html[data-device="tv"] .menu__item { padding: 15px 18px; font-size: var(--fs-md); }
html[data-device="tv"] .ep-card:hover, html[data-device="tv"] .ep-card:focus-visible { border-color: var(--brand-500); box-shadow: var(--sh-tv-focus); }

/* ---------- 4K / ULTRA DENSITY ---------- */
@media (min-width: 3000px) {
  html { font-size: 21px; }
  :root {
    --header-h: 100px;
    --rail-gap: 24px;
    --gutter: clamp(80px, 4vw, 200px);
    --fs-hero-min: 3rem;
    --fs-hero-max: 6rem;
  }
  html[data-device="tv"] { --header-h: 116px; }
  .logo__icon { width: 48px; height: 48px; }
  .avatar { width: 44px; height: 44px; }
  .btn { min-height: 58px; }
  .hero { height: clamp(700px, 86vh, 1250px); }
  .rail { padding-top: 36px; padding-bottom: 44px; }
}
html[data-density="4k"] { font-size: 21px; }
html[data-density="4k"] :root,
html[data-density="4k"] { --header-h: 100px; --rail-gap: 24px; }

/* ---------- TOUCH INPUT MODE ---------- */
html[data-input="touch"] .pcard__hover { display: none; }
html[data-input="touch"] .pcard__frame::after { box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); }
html[data-input="touch"] .btn, html[data-input="touch"] .chip { -webkit-tap-highlight-color: rgba(229,9,20,.25); }

/* ---------- SPATIAL / KEYBOARD MODE ---------- */
html[data-spatial="1"] .pcard:focus-visible .pcard__frame { transform: scale(1.04); box-shadow: var(--sh-tv-focus); }
html[data-spatial="1"] .pcard:focus-visible .pcard__hover { opacity: 1; }

/* ---------- SHORT DESKTOPS / SMALL LAPTOPS ---------- */
@media (min-width: 1024px) and (max-height: 700px) {
  .hero { height: clamp(460px, 92vh, 700px); }
  .hero__content { padding-bottom: 40px; }
  .hero__desc { -webkit-line-clamp: 2; }
}

/* ---------- HIGH CONTRAST ---------- */
@media (prefers-contrast: more) {
  :root { --line: rgba(255,255,255,.4); --tx-2: #e8e8ee; --tx-3: #c3c3cc; }
  .pcard__frame::after { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
  :focus-visible { outline-width: 4px; }
}

/* ---------- PRINT ---------- */
@media print {
  .header, .bottom-nav, .drawer, .drawer-scrim, .search-layer, .player-layer,
  .modal-layer, .toasts, .hero__dots, .hero__arrow, .rail-arrow, .feature-strip { display: none !important; }
  body { background: #fff; color: #000; }
  .page { padding-top: 0; }
}

/* ============================================================
   XORVAULT — bridge layer
   Small additions for shell elements introduced during final
   integration. Loads LAST on purpose; keeps core files clean.
   ============================================================ */

html.scroll-locked {
  overflow: hidden;
}

/* ---- boot splash ---- */
.boot-splash {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--text-dim, #9aa0ab);
}
.boot-mark {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand, #e50914), #7a0410);
  color: #fff;
  font-weight: 900;
  font-size: 30px;
  display: grid;
  place-items: center;
  animation: bootpulse 1.2s ease-in-out infinite;
}
@keyframes bootpulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.94); opacity: 0.75; }
}
.boot-splash p { font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ---- header menus ---- */
.menu--notif { width: min(380px, 94vw); }
.menu--profile { width: min(280px, 90vw); }
.linklike {
  margin-left: auto;
  background: none;
  border: 0;
  color: var(--brand, #e50914);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.linklike:hover { text-decoration: underline; }

.profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.avatar--lg {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 18px;
}
.profile-meta { display: flex; flex-direction: column; line-height: 1.35; }
.profile-meta small { color: var(--text-dim, #9aa0ab); font-size: 12px; }

.menu__item--danger { color: #ff6b6b; }

/* ---- notifications list ---- */
.notif-list { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.notif-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 16px; text-decoration: none; color: inherit;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s;
}
.notif-item:hover { background: rgba(255,255,255,.04); }
.notif-item:last-child { border-bottom: 0; }
.notif-poster { width: 44px; height: 62px; border-radius: 6px; object-fit: cover; flex-shrink: 0; background: rgba(255,255,255,.06); }
.notif-text { flex: 1; min-width: 0; }
.notif-text b { display: block; font-size: 13px; margin-bottom: 2px; position: relative; }
.notif-item.is-unread .notif-text b::after {
  content: '';
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--brand, #e50914);
  margin-left: 6px; vertical-align: middle;
}
.notif-text small { display: block; color: var(--text-dim, #b6bcc8); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-text time { display: block; margin-top: 4px; color: var(--text-dim, #78808d); font-size: 11px; letter-spacing: 0.04em; }
.notif-badge { display: inline-block; font-size: 11px; font-weight: 600; color: var(--brand-500, #e50914); background: rgba(229,9,20,.1); padding: 2px 8px; border-radius: var(--r-full, 999px); margin: 2px 0 3px; }

/* ---- search overlay extras ---- */
.search-kbd {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim, #9aa0ab);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 3px 7px;
  white-space: nowrap;
}
.search-hint {
  margin: 22px 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim, #9aa0ab);
}
.search-body .grid { margin-top: 4px; }

/* ---- toasts ---- */
.toasts .toast {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toasts .toast.in {
  opacity: 1;
  transform: none;
}

/* ---- footer device readout ---- */
.footer__base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
#foot-device { color: var(--text-dim, #8a919d); font-size: 12px; letter-spacing: 0.03em; }
.footer__socials { display: flex; gap: 8px; margin-top: 12px; }
.footer-social {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.06); color: var(--text-dim, #9aa0ab);
  transition: background .2s, color .2s, transform .2s;
}
.footer-social:hover { background: rgba(255,255,255,.12); color: #fff; transform: translateY(-2px); }
.footer-social svg { width: 18px; height: 18px; }
.footer-social--donate { background: rgba(0,112,186,.1); color: #6ab1f7; }
.footer-social--donate:hover { background: rgba(0,112,186,.2); color: #3a9cf7; }

/* ---- detail page additions ---- */
.tagline {
  color: var(--text-dim, #c3c9d4);
  font-style: italic;
  font-size: 15px;
  margin: 0 0 6px;
}
.related-sec { margin-top: 48px; }
.detail-main .detail-actions { margin-top: 20px; }

/* ---- empty states sizing ---- */
.empty--lg { padding: 72px 24px; }
.empty--lg .empty__icon svg { width: 44px; height: 44px; }
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

/* ---- catalog toolbar breathing room ---- */
.browse-toolbar { row-gap: 10px; }
.result-count { margin: 14px 0 18px; }

