/* ============================================================
   FLY STREAM — a late-night cinema marquee, translated to web
   ============================================================ */

:root {
  /* -- palette: near-black + red marquee bulbs -- */
  --bg: #0a0a0c;
  --bg-alt: #131316;
  --bg-raised: #1c1c20;
  --wine: #4a3038;
  --wine-deep: #232327;
  --gold: #e5372a;
  --gold-bright: #ff5c47;
  --cream: #f3e9dd;
  --muted: #a5919a;
  --muted-dim: #7d6b73;
  --rating-high: #7fae6b;
  --rating-mid: #d4a24e;
  --rating-low: #b3616a;

  /* -- type -- */
  --font-display: "Bebas Neue", "Oswald", sans-serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;

  --radius-sm: 6px;
  --radius-md: 12px;
  --header-h: 68px;
  --ticker-h: 34px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-alt); }
::-webkit-scrollbar-thumb { background: var(--wine); border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 28px;
  background: transparent;
}
/* Movie/TV detail pages render their own back button over the video
   background (see .detail__back-btn) — the persistent nav/search header
   would sit at the same spot, so it's hidden there entirely. */
body.detail-route .site-header { display: none; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 1px;
  color: #fff;
  flex-shrink: 0;
}
.brand__mark { color: var(--gold); font-size: 28px; }
.brand__tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  display: none;
}
@media (min-width: 640px) { .brand__tag { display: inline; } }

.main-nav {
  /* Centered on the viewport, which lines up with the 1400px content
     column's own center (it's margin:0 auto within the same viewport)
     regardless of window width — same idea as the hero title/Top 10
     alignment fix. */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
@media (min-width: 900px) { .main-nav { display: flex; } }

.main-nav > a, .nav-item > button.nav-trigger {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: #fff;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
}
.main-nav > a:hover, .nav-item > button.nav-trigger:hover { color: #fff; background: var(--bg-raised); }
.main-nav > a.is-active { color: var(--gold-bright); }

.nav-item { position: relative; }
.nav-trigger { display: flex; align-items: center; gap: 6px; }
.nav-trigger__caret { font-size: 10px; opacity: 0.7; transition: transform 0.15s; }
.nav-item:hover .nav-trigger__caret { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 40px));
  max-height: 340px;
  overflow-y: auto;
  background: rgba(20, 18, 22, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.15s ease;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.nav-item--right .nav-dropdown { left: auto; right: 0; }
.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown a {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.nav-dropdown a:hover { background: var(--wine-deep); color: var(--gold-bright); }
.nav-dropdown__quicklinks {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--wine-deep);
}
.nav-dropdown__quicklinks a {
  background: var(--wine-deep);
  color: var(--gold-bright);
  font-size: 12px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2px;
}
.header-icon-btn {
  background: transparent;
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.08); color: var(--gold-bright); }

/* ---- Browse dropdown: content/personal tile menu ---- */
.nav-dropdown--browse {
  display: block;
  min-width: 280px;
  max-width: 280px;
  padding: 16px;
}
.browse-menu__title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--cream);
}
.browse-menu__label {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted-dim);
}
.browse-menu__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.browse-menu__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.browse-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 6px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  white-space: normal;
}
.browse-tile:hover { background: rgba(255,255,255,0.06); color: var(--cream); }
.browse-tile__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(229,55,42,0.15);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/* ---- Search overlay ---- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
}
.search-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,3,4,0.8);
  backdrop-filter: blur(4px);
}
.search-overlay__panel {
  position: relative;
  z-index: 1;
  width: min(600px, calc(100vw - 32px));
  max-height: min(640px, calc(100vh - 80px));
  margin: 9vh auto 0;
  background: rgba(20, 18, 22, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
}
.search-overlay__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.search-overlay__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.5px;
  color: var(--cream);
}
.search-overlay__close {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.search-overlay__close:hover { background: rgba(255,255,255,0.08); color: var(--cream); }

.search-type { position: relative; flex-shrink: 0; }
.search-type__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-alt);
  border: 1px solid var(--wine-deep);
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.search-type__toggle:hover { color: var(--cream); }
.search-type__caret { font-size: 9px; opacity: 0.7; }
.search-type__menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 170px;
  background: var(--bg-alt);
  border: 1px solid var(--wine-deep);
  border-radius: var(--radius-sm);
  padding: 6px;
  flex-direction: column;
  gap: 2px;
  z-index: 2;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.search-type__menu.is-open { display: flex; }
.search-type__menu button {
  background: transparent;
  border: none;
  color: var(--muted);
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.search-type__menu button:hover { background: var(--wine-deep); color: var(--cream); }
.search-type__menu button.is-active { color: var(--gold-bright); font-weight: 600; }

.search-overlay__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--wine-deep);
  border-radius: 999px;
  padding: 10px 14px;
  margin-bottom: 12px;
  flex-shrink: 0;
  color: var(--muted-dim);
}
.search-overlay__input-wrap:focus-within { border-color: var(--gold); }
.search-overlay__input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--cream);
  font-family: inherit;
  /* iOS Safari auto-zooms the page on focus for any input with a computed
     font-size under 16px — this is what caused the "zooms in a little"
     on tap. 16px is the actual fix; visual size is still controlled the
     same as before via this rule, no design change intended. */
  font-size: 16px;
}
@media (min-width: 640px) {
  .search-overlay__input-wrap input { font-size: 14px; }
}
.search-overlay__input-wrap input::placeholder { color: var(--muted-dim); }
.search-overlay__clear {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.search-overlay__clear:hover { color: var(--cream); }

.search-overlay__body { overflow-y: auto; flex: 1; min-height: 0; }

.search-recent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  color: var(--muted-dim);
  margin-bottom: 6px;
  padding: 0 4px;
}
.search-recent__head button {
  background: none;
  border: none;
  color: var(--muted-dim);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: normal;
  cursor: pointer;
  text-transform: none;
}
.search-recent__head button:hover { color: var(--gold-bright); }
.search-recent__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  text-align: left;
  padding: 10px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.search-recent__item:hover { background: var(--bg-alt); color: var(--cream); }

.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--cream);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 4px;
}
.search-result:hover { background: rgba(255,255,255,0.08); }
.search-result__poster {
  width: 44px;
  height: 62px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-alt);
  flex-shrink: 0;
}
.search-result__info { flex: 1; min-width: 0; }
.search-result__title {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-result__meta { margin: 0; font-size: 12px; color: var(--muted); }
.search-result__rating { color: var(--gold-bright); }
.search-result__chevron { color: var(--muted-dim); font-size: 20px; flex-shrink: 0; }

.search-loading, .search-empty {
  padding: 32px 8px;
  text-align: center;
  color: var(--muted-dim);
  font-size: 14px;
}

.browse-tile--wide {
  flex-direction: row;
  justify-content: flex-start;
  padding: 12px 14px;
  font-size: 13.5px;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  padding: 8px;
}
@media (min-width: 900px) { .menu-toggle { display: none; } }
.menu-toggle span { width: 20px; height: 2px; background: var(--cream); border-radius: 2px; }

/* ============================================================
   MOBILE MENU
   ============================================================ */

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(78vw, 320px);
  height: 100%;
  background: var(--bg-raised);
  z-index: 200;
  padding: 24px 20px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
  border-left: 1px solid var(--wine-deep);
}
body.menu-open .mobile-menu { transform: translateX(0); }
.mobile-menu a { display: block; padding: 10px 0; font-weight: 600; color: var(--cream); }
.mobile-menu h3 { font-family: var(--font-display); letter-spacing: 1px; color: var(--gold); font-size: 15px; margin: 20px 0 4px; }
.mobile-menu .mobile-genres { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.mobile-menu .mobile-genres a { font-size: 13px; padding: 6px 0; color: var(--muted); font-weight: 500; }

.menu-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
body.menu-open .menu-scrim { opacity: 1; visibility: visible; }

/* ---- Mobile bottom tab bar ---- */
.mobile-tabbar {
  display: none;
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 150;
  align-items: center;
  gap: 2px;
  background: rgba(19, 10, 14, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
@media (max-width: 860px) {
  .mobile-tabbar { display: flex; }
  .site-footer { padding-bottom: 90px; }
  /* Bottom tab bar replaces the hamburger drawer entirely at this width —
     having both was redundant. */
  .menu-toggle { display: none; }
}
.mobile-tabbar__item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.mobile-tabbar__item:hover,
.mobile-tabbar__item:active { background: rgba(255,255,255,0.08); color: var(--cream); }
.mobile-tabbar__item.is-active { color: var(--gold-bright); background: rgba(229,55,42,0.16); }
.mobile-tabbar__item.is-active::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-bright);
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: flex-end;
  background-color: var(--bg-alt);
  background-image: var(--hero-img, none);
  background-size: cover;
  background-position: center 20%;
  overflow: hidden;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10,10,12,0.05) 0%, rgba(10,10,12,0.25) 45%, rgba(10,10,12,0.7) 75%, var(--bg) 100%),
    linear-gradient(90deg, rgba(10,10,12,0.95) 0%, rgba(10,10,12,0.35) 55%, rgba(10,10,12,0.1) 100%);
}
.hero__sprockets {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 14px;
  background-image: repeating-linear-gradient(90deg, var(--bg) 0 8px, transparent 8px 22px);
  background-color: rgba(19,10,14,0.85);
  mask-image: radial-gradient(circle at center, transparent 4px, black 5px);
  -webkit-mask-image: radial-gradient(circle at center, transparent 4px, black 5px);
  mask-size: 22px 14px;
  -webkit-mask-size: 22px 14px;
  mask-repeat: repeat-x;
  -webkit-mask-repeat: repeat-x;
}
.hero__content {
  /* Matches .page-container's box (max-width:1400px, centered) so the hero
     title lines up with row titles below it on wide viewports — a plain
     640px cap here made hero text hug the true left edge while
     .page-container's content got centered with a big gap. width:100% is
     required because .hero__content is a flex item (child of .hero), and
     flex items don't fill the main axis by default the way a normal block
     element does — without it, max-width+margin:auto here centers the box
     within its own shrunk-to-content size instead of the full hero width,
     which pushed the title toward the middle instead of the left edge. */
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 48px 28px 40px;
}
.hero__title, .hero__meta, .hero__overview, .hero__actions, .hero__genres { max-width: 640px; }
.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin: 0 0 8px;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(36px, 6vw, 64px);
  line-height: 0.95;
  letter-spacing: 0.5px;
  margin: 0 0 14px;
  color: var(--cream);
  text-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.hero__meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}
.hero__overview {
  color: var(--muted);
  font-size: 15px;
  max-width: 52ch;
  margin: 0 0 24px;
}
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   BUTTONS / CHIPS / PILLS
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  border: 1px solid transparent;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--gold { background: var(--gold); color: #241407; }
.btn--gold:hover { background: var(--gold-bright); }
.btn--ghost { background: rgba(243,233,221,0.06); color: var(--cream); border-color: var(--wine); }
.btn--ghost:hover { background: rgba(243,233,221,0.12); }
.btn--lg { padding: 14px 28px; font-size: 15px; }

.chip-grid { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 28px 0; }
.chip {
  background: var(--bg-raised);
  border: 1px solid var(--wine-deep);
  color: var(--cream);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.chip:hover { border-color: var(--gold); color: var(--gold-bright); }

.pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-raised);
  border: 1px solid var(--wine-deep);
  color: var(--muted);
  margin: 0 8px 8px 0;
}
.pill:hover { color: var(--gold-bright); border-color: var(--gold); }

/* ============================================================
   SECTIONS / ROWS
   ============================================================ */

.page-container { max-width: 1400px; margin: 0 auto; padding: 8px 28px 60px; }
/* Header is position:absolute (floats over hero/detail backgrounds), so
   plain pages need real top padding to clear it instead of overlapping. */
.page-container--top { padding-top: calc(var(--header-h) + 28px); }

.section__head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 40px 28px 14px;
  max-width: 1400px;
  margin: 0 auto;
}
.page-container .section__head { padding-left: 0; padding-right: 0; }

.dropdown-row__label { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 4px; }
.dropdown-caret {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.15s;
}
.dropdown-caret[aria-expanded="true"] { transform: rotate(180deg); }
.dropdown-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  min-width: 220px;
  background: rgba(20, 18, 22, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  z-index: 10;
}
.dropdown-menu.is-open { display: flex; }
.dropdown-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: var(--cream);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.dropdown-menu__item:hover { background: var(--bg-alt); }
.dropdown-menu__item.is-active { color: var(--gold-bright); }
.dropdown-menu__badge { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dropdown-menu__badge svg { width: 15px; height: 15px; }
.section__title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.5px;
  margin: 0;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section__title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 0.8em;
  background: var(--gold);
  border-radius: 2px;
  flex-shrink: 0;
}
.section__title--sm { font-size: 22px; padding: 0 0 14px; }
.section__titles { position: relative; }
.section__subtitle { margin: 2px 0 0; font-size: 13px; color: var(--muted-dim); }
.section__seeall {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  padding-bottom: 4px;
}
.section__seeall:hover { color: var(--gold-bright); }

.row { position: relative; }
.row__track-wrap { position: relative; }
.row__track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 28px 12px;
  scrollbar-width: none;
}
.page-container .row__track { padding-left: 0; padding-right: 0; }
.row__track::-webkit-scrollbar { display: none; }

.row__nav {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(19,10,14,0.85);
  border: 1px solid var(--wine);
  color: var(--cream);
  z-index: 5;
  font-size: 13px;
  display: none;
  align-items: center;
  justify-content: center;
}
@media (min-width: 720px) { .row__nav { display: flex; } }
.row__nav--prev { left: 4px; }
.row__nav--next { right: 4px; }
.row__nav:hover { background: var(--gold); color: #241407; border-color: var(--gold); }

/* ============================================================
   CARDS
   ============================================================ */

.card {
  flex: 0 0 160px;
  scroll-snap-align: start;
  display: block;
}
@media (min-width: 720px) { .card { flex-basis: 190px; } }

.card--landscape { flex-basis: 260px; }
@media (min-width: 720px) { .card--landscape { flex-basis: 320px; } }
.card--landscape .card__poster-wrap { aspect-ratio: 16 / 9; }

.card__poster-wrap {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--bg-alt);
  border: 1px solid var(--wine-deep);
  transition: border-color 0.15s, transform 0.15s;
}
/* Grid-based pages (Browse, category listings) get a glass/frosted card
   treatment instead of the plain solid background rows use. */
.card:hover .card__poster-wrap { transform: translateY(-4px); }
.card__poster { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s; }
.card:hover .card__poster { transform: scale(1.08); }
.card__trailer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  animation: card-trailer-in 0.25s ease-out;
}
@keyframes card-trailer-in { from { opacity: 0; } to { opacity: 1; } }
.card__trailer-mute {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(19,10,14,0.65);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
}
.card__trailer-mute:hover { background: rgba(19,10,14,0.9); color: var(--gold-bright); }

.icon-play {
  vertical-align: -0.05em;
  margin-right: 0.35em;
}

.card__rank {
  position: absolute;
  top: 10px;
  left: 0;
  background: var(--gold);
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13px;
  line-height: 1.1;
  text-align: center;
  padding: 3px 9px 4px 7px;
  border-radius: 0 6px 6px 0;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  z-index: 2;
  pointer-events: none;
  user-select: none;
}
.card__rank::before {
  content: "TOP";
  display: block;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0.9;
}

.rating-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--bg);
  border: 2px solid var(--rating-mid);
  color: var(--cream);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  padding: 3px 5px;
  border-radius: 6px;
  line-height: 1;
}
.rating-badge small { font-size: 8px; opacity: 0.7; }

.star-rating { color: var(--gold-bright); font-weight: 600; }
.star-rating--empty { color: var(--muted-dim); font-weight: 500; }

.rating-badge--high { border-color: var(--rating-high); }
.rating-badge--low { border-color: var(--rating-low); }
.rating-badge--empty { border-color: var(--muted-dim); color: var(--muted-dim); font-size: 10px; }

.card__meta { padding: 10px 2px 0; }
.card__title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cream);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  transition: color 0.15s;
}
.card:hover .card__title { color: var(--gold-bright); }
.card__submeta { margin: 2px 0 0; font-size: 12px; color: var(--muted-dim); font-family: var(--font-mono); }

/* ============================================================
   SKELETONS / EMPTY STATES
   ============================================================ */

.skeleton-hero { height: 460px; background: linear-gradient(90deg, var(--bg-alt) 25%, var(--bg-raised) 37%, var(--bg-alt) 63%); background-size: 400% 100%; animation: shimmer 1.6s infinite; }
.skeleton-row { display: flex; gap: 18px; padding: 40px 28px; overflow: hidden; }
.page-container .skeleton-row { padding-left: 0; padding-right: 0; }
.skeleton-card { flex: 0 0 190px; aspect-ratio: 2/3; border-radius: var(--radius-md); background: linear-gradient(90deg, var(--bg-alt) 25%, var(--bg-raised) 37%, var(--bg-alt) 63%); background-size: 400% 100%; animation: shimmer 1.6s infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.empty-state { padding: 80px 20px; text-align: center; color: var(--muted); font-size: 15px; }
.empty-state a { color: var(--gold); font-weight: 700; }

/* ============================================================
   LISTING / GRID PAGES
   ============================================================ */

.listing-head { padding: 10px 0 24px; }
.listing-title { font-family: var(--font-display); font-size: 34px; letter-spacing: 0.5px; margin: 0; }

.card__type-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--wine);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 3px 6px;
  border-radius: 4px;
}

/* ---- Browse filter bar: genre pills + sort/year/rating ---- */
.filter-bar { margin-bottom: 28px; }
.pill-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.pill-filter {
  background: var(--bg-raised);
  border: 1px solid var(--wine-deep);
  color: var(--muted);
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.pill-filter:hover { color: var(--cream); border-color: var(--gold); }
.pill-filter.is-active {
  background: var(--gold);
  border-color: var(--gold);
  color: #241407;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--wine-deep);
  border-radius: var(--radius-md);
  padding: 18px 22px;
}
.filter-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-control span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted-dim);
}
.filter-control select {
  background: var(--bg-raised);
  border: 1px solid var(--wine-deep);
  color: var(--cream);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  min-width: 160px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.filter-control select:focus { border-color: var(--gold); outline: none; }

/* ---- Browse page: unified sort + genre tab row ---- */
.browse-tabs-wrap {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--wine-deep);
}
.browse-tabs {
  position: relative;
  display: flex;
  flex-wrap: nowrap;
  overflow: hidden;
  gap: 26px;
  min-width: 0;
  flex: 1;
}
.browse-tabs .browse-tab.is-overflowed { display: none; }
.browse-tabs-more {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  padding: 0 4px 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.browse-tabs-more:hover { color: var(--cream); }
.dropdown-caret-wrap { position: relative; flex-shrink: 0; }
.dropdown-caret-wrap .dropdown-menu { right: 0; left: auto; }
.browse-tab {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  padding: 0 0 12px;
  cursor: pointer;
  flex-shrink: 0;
}
.browse-tab:hover { color: var(--cream); }
.browse-tab.is-active { color: var(--cream); }
/* One shared underline that slides between tabs instead of each tab having
   its own static border — position/width set by collapseBrowseTabs() in
   js/pages.js to match whichever tab is currently active. */
.browse-tabs__indicator {
  position: absolute;
  bottom: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 1px;
  transition: left 0.25s ease, width 0.25s ease, opacity 0.15s;
  opacity: 0;
  pointer-events: none;
}
.browse-tabs__indicator::after {
  content: "";
  position: absolute;
  inset: -3px 8% -1px;
  background: var(--gold);
  filter: blur(7px);
  opacity: 0.65;
  border-radius: 50%;
}

.grid.grid--landscape { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); }
.filter-control:focus-within select { border-color: var(--gold-bright); }

/* first filter-control (Sort By) gets the gold focus ring shown in the reference */
.filter-controls .filter-control:first-child select { border-color: var(--gold); }

/* ---- TV episode picker on detail page ---- */
.episode-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-top: 6px;
}
.episode-picker select {
  background: var(--bg-raised);
  border: 1px solid var(--wine-deep);
  color: var(--cream);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  max-width: 260px;
}
.episode-picker .btn { margin-bottom: 1px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px 18px;
}

.load-more-wrap { display: flex; justify-content: center; padding: 36px 0 10px; }

/* ============================================================
   DETAIL / WATCH PAGE
   ============================================================ */

.detail {
  position: relative;
  min-height: 560px;
  background-color: var(--bg-alt);
  background-image: var(--hero-img, none);
  background-size: cover;
  background-position: center 15%;
  padding-top: 40px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.detail__video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.detail__video-bg iframe {
  /* Sized ~15% past a plain 16:9 cover-fit so the cropped-away margin
     pushes YouTube's title/channel bar and control strip outside the
     visible area (see .card__trailer for the same technique/reasoning). */
  position: absolute;
  top: 50%;
  left: 50%;
  width: 115%;
  height: 64.7vw; /* 56.25vw * 1.15 */
  min-height: 115%;
  min-width: 204.4vh; /* 177.78vh * 1.15 */
  transform: translate(-50%, -50%);
  border: 0;
}
.detail__back-btn,
.detail__mute-btn {
  position: absolute;
  top: calc(var(--header-h) + 16px);
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(19,10,14,0.6);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.detail__back-btn:hover,
.detail__mute-btn:hover { background: rgba(19,10,14,0.85); color: var(--gold-bright); }
.detail__back-btn { left: 20px; }
.detail__mute-btn { right: 20px; }
.detail__scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(19,10,14,0.25) 0%, rgba(19,10,14,0.55) 55%, var(--bg) 96%);
}
.detail__content {
  position: relative;
  z-index: 2;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 28px 48px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
}
.detail__content--full { grid-template-columns: 1fr; }
.detail__content--full .detail__poster { display: none; }
.detail__logo { max-width: 380px; max-height: 150px; object-fit: contain; object-position: left bottom; filter: drop-shadow(0 8px 24px rgba(0,0,0,0.6)); margin-bottom: 10px; }
.detail__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 640px) { .detail__content { grid-template-columns: 1fr; } .detail__poster { max-width: 200px; margin: 0 auto; } }
.detail__poster img { border-radius: var(--radius-md); border: 1px solid var(--wine-deep); box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
.detail__title { font-family: var(--font-display); font-size: clamp(30px, 5vw, 48px); margin: 0 0 4px; }
.detail__tagline { font-style: italic; color: var(--gold-bright); margin: 0 0 14px; font-size: 15px; }
.detail__meta { display: flex; gap: 14px; align-items: center; font-family: var(--font-mono); font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.detail__genres { margin-bottom: 16px; }
.detail__overview { color: var(--muted); max-width: 68ch; margin-bottom: 24px; font-size: 15px; }

.player-slot { margin: 8px 0 48px; }
.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--wine);
  box-shadow: 0 0 0 6px var(--bg-raised), 0 20px 50px rgba(0,0,0,0.5);
  background: #000;
}
.player-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.server-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.server-switcher__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted-dim);
  margin-right: 4px;
}
.server-pill {
  background: var(--bg-raised);
  border: 1px solid var(--wine-deep);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
}
.server-pill:hover { color: var(--cream); border-color: var(--gold); }
.server-pill.is-active { background: var(--gold); border-color: var(--gold); color: #241407; }

.strict-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12px;
  color: var(--muted-dim);
  cursor: pointer;
  user-select: none;
}
.strict-toggle input { accent-color: var(--gold); width: 15px; height: 15px; cursor: pointer; }
.strict-toggle:hover span { color: var(--muted); }

.cast-track { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 20px; }
.cast-card { flex: 0 0 100px; text-align: center; }
.cast-card__photo { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 2px solid var(--wine-deep); margin-bottom: 8px; }
.cast-card__name { font-size: 12.5px; font-weight: 700; margin: 0; color: var(--cream); }
.cast-card__role { font-size: 11.5px; color: var(--muted-dim); margin: 2px 0 0; }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  border-top: 1px solid var(--wine-deep);
  padding: 32px 28px 40px;
  text-align: center;
  color: var(--muted-dim);
  font-size: 12.5px;
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--gold); font-weight: 600; }

/* ============================================================
   CUSTOM PLAYER (Real-Debrid)
   ============================================================ */

.player-wrap--native { background: #000; }
.player-wrap--native video {
  position: absolute; inset: 0; width: 100%; height: 100%; background: #000;
}
.player-loading {
  padding: 48px 20px; text-align: center; color: var(--muted); font-size: 15px;
}
.debrid-setup {
  background: var(--bg-alt); border: 1px solid var(--wine-deep);
  border-radius: var(--radius-md); padding: 28px 32px; max-width: 560px; margin: 20px auto;
}
.debrid-setup h3 {
  font-family: var(--font-display); font-size: 22px; margin: 0 0 12px; color: var(--gold-bright);
}
.debrid-setup p { color: var(--muted); margin: 0 0 14px; }
.debrid-setup ol { margin: 0; padding-left: 20px; color: var(--cream); }
.debrid-setup li { margin-bottom: 8px; }
.debrid-setup code {
  background: var(--bg-raised); padding: 2px 6px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 12px;
}
.debrid-setup a { color: var(--gold); font-weight: 600; }

.stream-picker { margin-top: 18px; }
.stream-list__label {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--muted-dim); margin: 0 0 10px;
}
.stream-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--bg-raised); border: 1px solid var(--wine-deep);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 8px;
  color: var(--cream); font-family: inherit; font-size: 13.5px;
  transition: border-color 0.12s, background 0.12s;
}
.stream-item:hover { border-color: var(--gold); }
.stream-item.is-active {
  border-color: var(--gold); background: rgba(212, 162, 78, 0.12);
}
.stream-item__badge {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 3px 7px; border-radius: 4px; background: var(--wine); color: var(--cream); flex-shrink: 0;
}
.stream-item--rd .stream-item__badge { background: var(--gold); color: #241407; }
.stream-item__quality {
  font-family: var(--font-mono); font-weight: 700; color: var(--gold-bright); min-width: 52px;
}
.stream-item__name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted);
}
.stream-item__size {
  font-family: var(--font-mono); font-size: 12px; color: var(--muted-dim); flex-shrink: 0;
}
.player-actions { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }

/* Plyr inside Fly Stream player */
.player-wrap--native .plyr {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  --plyr-color-main: #d4a24e;
  --plyr-video-background: #000;
  --plyr-audio-controls-background: #1d1116;
  --plyr-range-fill-background: #d4a24e;
  --plyr-video-control-color: #f3e9dd;
  --plyr-video-control-background-hover: rgba(212, 162, 78, 0.35);
  --plyr-control-radius: 6px;
  --plyr-font-family: Inter, system-ui, sans-serif;
}
.player-wrap--native .plyr video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.player-wrap--native .plyr--full-ui input[type=range] {
  color: #d4a24e;
}


/* Stream quality dropdowns */
.stream-list--dropdowns .stream-selects {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stream-select {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--wine-deep);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.stream-select__q {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold-bright);
  min-width: 52px;
}
.stream-select__input {
  flex: 1;
  background: var(--bg-alt);
  border: 1px solid var(--wine-deep);
  border-radius: 6px;
  color: var(--cream);
  font-family: inherit;
  font-size: 13px;
  padding: 8px 10px;
  min-width: 0;
}
.stream-select__input:focus {
  outline: none;
  border-color: var(--gold);
}
.stream-select__input:disabled {
  opacity: 0.5;
}

/* ============================================================
   REEL PLAYER — custom Netflix-style player (js/player.js)
   ============================================================ */
.reel-player-mount { width: 100%; }

.rp {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  outline: none;
  cursor: default;
  user-select: none;
}
.rp--fullscreen { border-radius: 0; aspect-ratio: unset; height: 100%; }

.rp__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  cursor: pointer;
}

.rp__video::cue {
  background: rgba(0, 0, 0, 0.7);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1.05em;
}

.rp__dim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.rp--paused .rp__dim { opacity: 1; }

.rp__spinner {
  position: absolute; inset: 0; margin: auto; width: 46px; height: 46px;
  border: 3px solid rgba(243, 233, 221, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: rp-spin 0.8s linear infinite;
  pointer-events: none;
}
@keyframes rp-spin { to { transform: rotate(360deg); } }

.rp__status {
  position: absolute; left: 0; right: 0; bottom: calc(50% - 46px);
  text-align: center;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.85em;
  opacity: 0.8;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.rp__big-play {
  position: absolute; inset: 0; margin: auto;
  width: 74px; height: 74px; border-radius: 50%;
  background: rgba(19, 10, 14, 0.55);
  border: 2px solid var(--gold);
  color: var(--gold-bright);
  display: none; align-items: center; justify-content: center;
  font-size: 26px;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}
.rp__big-play.is-visible { display: flex; }
.rp__big-play:hover { background: rgba(19, 10, 14, 0.75); transform: scale(1.05); }

.rp__top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 20px 24px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent);
  opacity: 1;
  transition: opacity 0.25s;
  pointer-events: none;
}
.rp__title {
  font-family: var(--font-display);
  letter-spacing: 0.5px;
  font-size: 20px;
  color: var(--cream);
  text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.rp__controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 24px 20px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.45) 60%, transparent 100%);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.25s, transform 0.25s;
}

.rp--idle .rp__controls,
.rp--idle .rp__top { opacity: 0; pointer-events: none; }
.rp--idle { cursor: none; }
.rp--idle .rp__video { cursor: none; }

.rp__progress {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.22);
  margin-bottom: 16px;
  cursor: pointer;
  touch-action: none;
}
.rp__progress-buffered {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%; background: rgba(255,255,255,0.35);
  border-radius: 3px;
}
.rp__progress-played {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0%; background: var(--gold);
  border-radius: 3px;
}
.rp__progress-handle {
  position: absolute; top: 50%; left: 0%;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(229,55,42,0.25);
  opacity: 0;
  transition: opacity 0.15s;
}
.rp__progress:hover .rp__progress-handle { opacity: 1; }

.rp__row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.rp__btn {
  background: transparent;
  border: none;
  color: var(--cream);
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  transition: background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.rp__btn:hover { background: rgba(229,55,42,0.18); color: var(--gold-bright); }
.rp__skip-back, .rp__skip-fwd { width: 40px; }

.rp__volume { display: flex; align-items: center; gap: 4px; }
.rp__volume-slider {
  width: 0;
  opacity: 0;
  transition: width 0.18s, opacity 0.18s, margin 0.18s;
  accent-color: var(--gold);
  height: 4px;
}
.rp__volume:hover .rp__volume-slider,
.rp__volume:focus-within .rp__volume-slider {
  width: 80px;
  opacity: 1;
  margin-left: 4px;
}

.rp__time {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--cream);
  white-space: nowrap;
  margin-left: 8px;
}

.rp__spacer { flex: 1; }

.rp__download {
  text-decoration: none;
  font-size: 15px;
}

.rp__menu { position: relative; }
.rp__menu-toggle.rp__quality-label,
.rp__menu-toggle.rp__audio-label { width: auto; padding: 0 10px; }
.rp__menu-list {
  position: absolute;
  bottom: 46px;
  right: 0;
  min-width: 130px;
  background: var(--bg-raised);
  border: 1px solid var(--wine-deep);
  border-radius: var(--radius-sm);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  max-height: 220px;
  overflow-y: auto;
}
.rp__menu.is-open .rp__menu-list { display: flex; }
.rp__menu-item {
  background: transparent;
  border: none;
  color: var(--cream);
  text-align: left;
  padding: 8px 10px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 13px;
  cursor: pointer;
}
.rp__menu-item:hover { background: rgba(255,255,255,0.08); }
.rp__menu-item.is-active { color: var(--gold-bright); font-weight: 600; }
.rp__menu-item--disabled {
  display: block;
  color: var(--muted-dim);
  cursor: default;
  font-style: italic;
}
.rp__menu-item--disabled:hover { background: transparent; }

.rp:focus-visible { box-shadow: 0 0 0 2px var(--gold); }

@media (max-width: 640px) {
  .rp__title { font-size: 16px; }
  .rp__time { display: none; }
  .rp__volume:hover .rp__volume-slider,
  .rp__volume:focus-within .rp__volume-slider { width: 50px; }

  /* Smaller, tighter control row — the full desktop 48px buttons packed
     into a narrow screen were the "stretching" complaint. */
  .rp__controls { padding: 8px 10px 10px; }
  .rp__row { gap: 0; }
  .rp__btn { width: 36px; height: 36px; font-size: 13px; }
  .rp__skip-back, .rp__skip-fwd { width: 32px; }
  .rp__menu-toggle.rp__quality-label,
  .rp__menu-toggle.rp__audio-label { padding: 0 6px; font-size: 12px; }
  .rp__download { font-size: 13px; }
  /* No hover on touch, and it ate horizontal space for no benefit — mobile
     already has hardware volume buttons. */
  .rp__volume-slider { display: none; }

  /* The visual bar stays thin, but the actual tap/drag target grows a lot —
     on a cramped mobile control row, missing the 6px-tall bar meant the tap
     landed on the raw <video> element instead, which toggles play/pause.
     That's the "accidentally unpausing instead of seeking" bug. */
  .rp__progress { height: 26px; margin-bottom: 4px; display: flex; align-items: center; }
  .rp__progress-buffered,
  .rp__progress-played {
    top: 50%; bottom: auto; height: 5px; transform: translateY(-50%);
  }
}

.rp__sub-sync {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--wine-deep);
}
.rp__sub-sync-btn {
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--cream);
  width: 24px; height: 24px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.rp__sub-sync-btn:hover { background: rgba(229,55,42,0.25); color: var(--gold-bright); }
.rp__sub-sync-val {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

/* Play triangle is optically off-center inside round buttons — the default
   .icon-play margin is tuned for sitting next to inline text, not for
   flex-centering alone inside a circle. */
.rp__big-play .icon-play,
.rp__play .icon-play {
  margin: 0;
}

/* ---- Up Next (Netflix-style autoplay-next, TV episodes only) ---- */
.rp__upnext {
  position: absolute;
  right: 24px;
  bottom: 100px;
  z-index: 5;
  max-width: min(420px, calc(100% - 48px));
}
.rp__upnext-card {
  position: relative;
  display: flex;
  gap: 14px;
  background: var(--bg-raised);
  border: 1px solid var(--wine-deep);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  animation: rp-upnext-in 0.25s ease-out;
}
@keyframes rp-upnext-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.rp__upnext-dismiss {
  position: absolute; top: -10px; right: -10px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-alt);
  border: 1px solid var(--wine-deep);
  color: var(--cream);
  font-size: 15px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.rp__upnext-dismiss:hover { color: var(--gold-bright); border-color: var(--gold); }
.rp__upnext-thumb {
  width: 140px; height: 79px;
  flex-shrink: 0;
  border-radius: 8px;
  background-color: var(--bg-alt);
  background-position: center;
  background-size: cover;
}
.rp__upnext-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  min-width: 0;
}
.rp__upnext-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}
.rp__upnext-title {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.rp__upnext-play {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 0;
}
.rp__upnext-play:hover { color: var(--gold-bright); }
.rp__upnext-ring {
  --pct: 1;
  position: relative;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: conic-gradient(var(--gold-bright) calc(var(--pct) * 360deg), rgba(255, 255, 255, 0.2) 0deg);
  flex-shrink: 0;
  transition: background 0.1s linear;
}
.rp__upnext-ring-mask {
  position: absolute; inset: 2.5px;
  border-radius: 50%;
  background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
}
.rp__upnext-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--cream);
}
@media (max-width: 640px) {
  .rp__upnext { right: 12px; bottom: 84px; }
  .rp__upnext-thumb { width: 96px; height: 54px; }
  .rp__upnext-title { max-width: 140px; }
}
