/* UnReel: deep indigo, violet light, rounded glass panels. */
:root {
  --bg: #0d0b1e;
  --bg-2: #141130;
  --surface: #1b1740;
  --surface-2: #262153;
  --line: rgba(196, 186, 255, .12);
  --text: #eeecff;
  --dim: #a19dc9;
  --faint: #6f6a99;
  --accent: #7c5cff;
  --accent-hi: #9d85ff;
  --gold: #f5c518;
  --danger: #ff7a8a;

  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --rail: 84px;
  --top: 72px;
  --pad: clamp(16px, 2.6vw, 36px);
  --poster-w: clamp(118px, 11.5vw, 176px);
  --still-w: clamp(240px, 22vw, 320px);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: 400 15px/1.55 var(--font);
  background:
    radial-gradient(60vw 50vh at 85% -10%, rgba(124, 92, 255, .16), transparent 70%),
    radial-gradient(50vw 50vh at -10% 110%, rgba(64, 120, 255, .10), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { letter-spacing: -.02em; }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.boot { min-height: 100vh; }
.note { color: var(--dim); font-size: .9rem; margin: 0; }
.note.big { font-size: 1.05rem; padding: 40px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  height: 48px; padding: 0 1.5em; border-radius: 999px; border: 0;
  font-weight: 700; font-size: .95rem; white-space: nowrap;
  transition: background-color .15s, color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn-play { background: var(--accent); color: #fff; box-shadow: 0 8px 24px -8px rgba(124, 92, 255, .8); }
.btn-play:hover { background: var(--accent-hi); }
.btn-ghost { background: rgba(255, 255, 255, .08); color: var(--text); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }
.btn-ghost[aria-pressed="true"] { color: var(--accent-hi); background: rgba(124, 92, 255, .18); }
.btn-danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px currentColor; }
.btn-small { height: 38px; padding: 0 1.1em; font-size: .85rem; }
.btn.grow { flex: 1; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: var(--dim);
  transition: background-color .15s, color .15s;
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }
.ghost-round { width: 48px; height: 48px; background: rgba(255, 255, 255, .08); color: var(--text); }

/* ---------- shell ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: calc(var(--safe-top) + 14px) 0 20px;
}
.rail-logo { display: block; width: 42px; height: 42px; margin-bottom: 26px; }
.rail-logo svg, .top-logo svg { width: 100%; height: 100%; }
.rail-link {
  position: relative; display: grid; justify-items: center; gap: 4px;
  width: 64px; padding: 10px 0 8px; border-radius: var(--r);
  color: var(--faint); font-size: .68rem; font-weight: 600;
  transition: color .15s, background-color .15s;
}
.rail-link svg { width: 26px; height: 26px; }
.rail-link:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.rail-link[aria-current="page"] { color: var(--text); }
.rail-link[aria-current="page"] svg { color: var(--accent-hi); filter: drop-shadow(0 0 10px rgba(124, 92, 255, .9)); }
.rail-link[aria-current="page"]::before {
  content: ''; position: absolute; left: -10px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--accent);
}

.topbar {
  position: fixed; top: 0; left: var(--rail); right: 0; z-index: 25;
  height: calc(var(--top) + var(--safe-top)); padding: var(--safe-top) var(--pad) 0;
  display: grid; grid-template-columns: 1fr minmax(0, 560px) 1fr; align-items: center; gap: 16px;
  transition: background-color .2s, backdrop-filter .2s;
}
.topbar.solid { background: rgba(13, 11, 30, .78); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); }
.top-logo { display: none; width: 36px; height: 36px; }
.search-pill {
  grid-column: 2; display: flex; align-items: center; height: 46px; padding: 0 6px 0 22px;
  border-radius: 999px; background: rgba(28, 24, 60, .55); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  transition: border-color .15s, background-color .15s;
}
.search-pill:focus-within { border-color: rgba(157, 133, 255, .6); background: rgba(38, 33, 83, .75); }
.search-pill input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: .95rem; }
.search-pill input::placeholder { color: var(--faint); }
.search-pill input::-webkit-search-cancel-button { filter: invert(.7); }
.search-pill button { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--dim); }
.search-pill button svg { width: 20px; height: 20px; }
.top-actions { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 6px; position: relative; }
.avatar { background: var(--surface-2); color: var(--text); font-weight: 700; font-size: .95rem; }
.menu {
  position: absolute; right: 0; top: 52px; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 20px 40px -12px rgba(0, 0, 0, .6);
}
.menu p { margin: 8px 10px 10px; color: var(--dim); font-size: .85rem; overflow-wrap: anywhere; }
.menu button, .menu a { display: block; width: 100%; text-align: left; padding: 10px; border: 0; border-radius: var(--r-sm); background: none; font-size: .95rem; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }

.content { margin-left: var(--rail); padding: calc(var(--top) + var(--safe-top)) var(--pad) 56px; min-height: 100vh; }
.tabbar { display: none; }

/* ---------- home ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; align-items: flex-end; min-height: min(62vh, 640px);
  border-radius: var(--r-lg); padding: clamp(24px, 4vw, 56px); margin-top: 8px;
  background: var(--surface);
}
.hero-art { position: absolute; inset: 0; z-index: -1; }
.hero-art picture { display: contents; }
.hero-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; }
.hero-art::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(13, 11, 30, .92) 0%, rgba(13, 11, 30, .55) 40%, rgba(13, 11, 30, 0) 72%),
    linear-gradient(0deg, rgba(13, 11, 30, .8) 0%, rgba(13, 11, 30, 0) 50%);
}
.hero-body { max-width: 600px; }
.hero h1 { margin: 0 0 14px; }
.title-text { display: block; font-weight: 800; font-size: clamp(2.4rem, 5vw, 4.2rem); line-height: 1; letter-spacing: -.035em; text-wrap: balance; }
.title-logo { max-width: min(440px, 80%); max-height: 150px; width: auto; filter: drop-shadow(0 4px 24px rgba(0, 0, 0, .6)); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; color: var(--dim); font-weight: 600; font-size: .92rem; margin: 0 0 16px; }
.cert { border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; font-size: .78rem; line-height: 1.55; }
.rating { display: inline-flex; align-items: center; gap: 5px; color: var(--text); }
.rating svg { width: 16px; height: 16px; color: var(--gold); }
.hero-overview { margin: 0 0 24px; max-width: 52ch; color: rgba(238, 236, 255, .85); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.rows { padding-top: 34px; }
.row { margin-bottom: 34px; }
.row-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.row-head h2 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.row-head a { color: var(--dim); font-size: .85rem; font-weight: 600; }
.row-head a:hover { color: var(--accent-hi); }
.strip-wrap { position: relative; margin: 0 calc(var(--pad) * -1); }
.strip {
  display: flex; gap: 16px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad);
  padding: 6px var(--pad) 10px; scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip > * { scroll-snap-align: start; flex: none; }
.row-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  display: none; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0;
  background: rgba(27, 23, 64, .9); color: var(--text); box-shadow: 0 6px 20px rgba(0, 0, 0, .5);
}
.row-arrow svg { width: 22px; height: 22px; }
.row-arrow.prev { left: 12px; } .row-arrow.next { right: 12px; }
@media (hover: hover) and (min-width: 721px) {
  .row:hover .row-arrow { display: grid; }
  .row-arrow:hover { background: var(--accent); }
}

/* posters */
.poster { display: block; width: var(--poster-w); border-radius: var(--r); }
.poster-art {
  position: relative; aspect-ratio: 2 / 3; border-radius: var(--r); overflow: hidden; background: var(--surface);
  box-shadow: 0 0 0 0 transparent; transition: transform .2s ease, box-shadow .2s ease;
}
.poster-art img { width: 100%; height: 100%; object-fit: cover; }
.poster:hover .poster-art { transform: translateY(-4px); box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .8); }
.poster.selected .poster-art { box-shadow: 0 0 0 3px #fff, 0 14px 34px -10px rgba(124, 92, 255, .7); transform: scale(1.02); }
.poster:focus-visible { outline: none; }
.poster:focus-visible .poster-art { box-shadow: 0 0 0 3px var(--accent-hi); }
.fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 14px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface) 70%);
}
.fallback strong { font-weight: 800; font-size: clamp(1rem, 1.4vw, 1.25rem); line-height: 1.1; overflow-wrap: anywhere; }
.fallback span { color: var(--dim); font-size: .8rem; margin-top: 6px; }

/* stills */
.still { width: var(--still-w); }
.still-art { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.still-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.still:hover .still-art img, .ep:hover .still-art img { transform: scale(1.04); }
.play-badge {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(13, 11, 30, .55); color: #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .25);
  opacity: 0; transition: opacity .15s, background-color .15s;
}
.play-badge svg { width: 18px; height: 18px; margin-left: 2px; }
.still:hover .play-badge, .ep:hover .play-badge, .still:focus-visible .play-badge { opacity: 1; background: var(--accent); border-color: var(--accent); }
@media (hover: none) { .play-badge { opacity: 1; } }
.bar { height: 4px; background: rgba(255, 255, 255, .2); }
.still-art .bar { position: absolute; left: 10px; right: 10px; bottom: 10px; border-radius: 4px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent-hi); border-radius: 4px; }
.still-text { margin-top: 10px; }
.still-text strong { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.still-text span { display: block; color: var(--dim); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- discover ---------- */
.discover { display: grid; gap: 28px; align-items: start; }
@media (min-width: 1100px) { .discover { grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 420px); } }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 6px 0 24px; }
.select-pill { position: relative; display: inline-flex; align-items: center; }
.select-pill select {
  appearance: none; -webkit-appearance: none; height: 42px; padding: 0 44px 0 20px; min-width: 150px;
  border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .07);
  font-weight: 600; font-size: .9rem; cursor: pointer;
}
.select-pill select:hover { background: rgba(255, 255, 255, .11); }
.select-pill select option { background: var(--surface); }
.select-pill svg { position: absolute; right: 16px; width: 16px; height: 16px; pointer-events: none; color: var(--dim); }
.reset { border: 0; background: none; color: var(--faint); font-size: .85rem; font-weight: 600; padding: 8px 6px; }
.reset:hover { color: var(--text); }
.grid { display: grid; gap: 22px 16px; grid-template-columns: repeat(auto-fill, minmax(var(--poster-w), 1fr)); }
.grid .poster { width: auto; }

.panel { display: none; }
@media (min-width: 1100px) {
  .panel {
    position: sticky; top: calc(var(--top) + var(--safe-top) + 6px);
    display: flex; flex-direction: column; height: calc(100vh - var(--top) - var(--safe-top) - 28px);
    border-radius: var(--r-lg); overflow: hidden; isolation: isolate;
    background: rgba(27, 23, 64, .72); border: 1px solid var(--line);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  }
}
.panel-art { position: absolute; inset: 0 0 auto 0; height: 340px; z-index: -1; }
.panel-art img { width: 100%; height: 100%; object-fit: cover; opacity: .38; filter: blur(1px) saturate(1.1); }
.panel-art::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(27, 23, 64, .2), rgba(27, 23, 64, 1)); }
.panel-body { flex: 1; overflow-y: auto; padding: 36px 30px 12px; scrollbar-width: thin; }
.panel h2 { margin: 0 0 24px; text-align: center; }
.panel .title-text { font-size: 2.1rem; }
.panel .title-logo { max-height: 110px; max-width: 86%; margin: 0 auto; }
.panel .meta { justify-content: space-between; margin-bottom: 20px; }
.panel-overview { margin: 0 0 26px; color: rgba(238, 236, 255, .85); font-size: .92rem; line-height: 1.7; }
.chips-block h3 { margin: 0 0 10px; color: var(--faint); font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.chips-block { margin-bottom: 22px; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: .85rem; font-weight: 500; }
.panel-actions { display: flex; gap: 10px; padding: 16px 22px 22px; }
.panel-actions .btn-ghost { padding: 0 1.1em; }
.panel-actions [aria-busy] { opacity: .5; }

/* ---------- pages ---------- */
.page { padding-top: 12px; }
.page-title { margin: 6px 0 26px; font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 800; }
.results-head { margin: 6px 0 22px; font-size: 1.15rem; font-weight: 700; color: var(--dim); }
.empty { max-width: 48ch; color: var(--dim); padding-top: 40px; }
.empty h1 { color: var(--text); font-size: 1.8rem; margin: 0 0 8px; }
.empty code { display: block; margin-top: 16px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-size: .85rem; overflow-x: auto; white-space: nowrap; }

/* ---------- title page ---------- */
.content-title { position: relative; }
.backdrop { position: fixed; inset: 0 0 auto var(--rail); height: 92vh; z-index: -1; pointer-events: none; }
.backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.backdrop::after {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(13, 11, 30, .7) 42%, rgba(13, 11, 30, .15) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(13, 11, 30, 0) 55%);
}
.title-page { display: grid; gap: 48px; padding-top: clamp(20px, 8vh, 90px); }
.title-info { max-width: 640px; }
.title-info h1 { margin: 0 0 18px; }
.title-text.big { font-size: clamp(2.6rem, 6vw, 4.8rem); }
.title-logo.big { max-height: 180px; }
.tagline { margin: 0 0 10px; color: var(--accent-hi); font-weight: 600; }
.overview { margin: 0 0 24px; font-size: 1.02rem; line-height: 1.7; color: rgba(238, 236, 255, .9); max-width: 60ch; }
.progress-line { display: flex; align-items: center; gap: 12px; max-width: 340px; color: var(--dim); font-size: .88rem; margin-bottom: 18px; }
.progress-line .bar { flex: 1; border-radius: 4px; overflow: hidden; }
.title-chips { display: grid; gap: 0 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 30px; }

.episodes { max-width: 1100px; }
.episodes-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.episodes-head h2 { margin: 0; font-size: 1.5rem; font-weight: 800; }
.ep-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ep {
  display: grid; grid-template-columns: minmax(150px, 260px) 1fr; gap: 22px; align-items: center;
  padding: 12px; border-radius: var(--r-lg); transition: background-color .15s;
}
.ep:hover { background: rgba(255, 255, 255, .05); }
.ep-info h3 { margin: 0 0 4px; font-size: 1.02rem; font-weight: 700; display: flex; gap: 12px; align-items: baseline; }
.ep-num { color: var(--accent-hi); font-weight: 800; min-width: 1.4ch; }
.ep-meta { margin: 0 0 6px; color: var(--faint); font-size: .85rem; font-weight: 600; }
.ep-overview { margin: 0; color: var(--dim); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.watched { color: var(--accent-hi); }

.manage { border-top: 1px solid var(--line); padding-top: 24px; max-width: 760px; }
.manage summary { cursor: pointer; color: var(--dim); font-weight: 600; width: fit-content; }
.manage summary:hover { color: var(--text); }
.manage-body { display: grid; gap: 24px; margin-top: 18px; }
.manage-body .note { margin-bottom: 10px; }
.match-results { display: grid; gap: 8px; margin-top: 12px; }
.match {
  display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; text-align: left;
  padding: 8px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
}
.match:hover { border-color: var(--accent); }
.match img, .match .ph { width: 46px; aspect-ratio: 2/3; border-radius: 6px; object-fit: cover; background: var(--surface-2); }
.match small { color: var(--dim); display: block; }
.field-row { display: flex; gap: 8px; flex-wrap: wrap; }
.input {
  height: 46px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06); flex: 1; min-width: 200px;
}
.input:focus { outline: none; border-color: var(--accent-hi); }

/* ---------- login ---------- */
.login {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding: calc(var(--safe-top) + 24px) 20px calc(var(--safe-bottom) + 24px);
}
.login-card {
  width: 100%; max-width: 400px; padding: 40px 32px 32px; border-radius: var(--r-lg);
  background: rgba(27, 23, 64, .65); border: 1px solid var(--line);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px -30px rgba(124, 92, 255, .45);
}
.login-brand { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 2.2rem; font-weight: 800; letter-spacing: -.04em; }
.login-brand svg { width: 46px; height: 46px; }
.login-sub { text-align: center; color: var(--dim); margin: 6px 0 30px; }
.login form { display: grid; gap: 14px; }
.login label { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--dim); }
.login .input { height: 50px; font-size: 1rem; color: var(--text); }
.login .btn { margin-top: 8px; height: 52px; }
.form-error { color: var(--danger); margin: 0; font-size: .9rem; min-height: 1.4em; }

/* ---------- player ---------- */
.player { position: fixed; inset: 0; z-index: 50; background: #000; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.surface { position: absolute; inset: 0; }
.player:not(.show-ui) { cursor: none; }

.player-top, .controls { transition: opacity .25s ease, transform .25s ease; }
.player:not(.show-ui) .player-top { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.player:not(.show-ui) .controls { opacity: 0; transform: translateY(8px); pointer-events: none; }

.player-top {
  position: absolute; inset: 0 0 auto 0; display: flex; align-items: center; gap: 14px;
  padding: calc(var(--safe-top) + 16px) 20px 60px;
  background: linear-gradient(rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); pointer-events: none;
}
.player-top > * { pointer-events: auto; }
.player-name { min-width: 0; }
.player-name strong { display: block; font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.player-name span { display: block; color: rgba(238, 236, 255, .7); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.controls {
  position: absolute; inset: auto 0 0 0; padding: 70px 22px calc(var(--safe-bottom) + 14px);
  background: linear-gradient(0deg, rgba(8, 6, 20, .92) 0%, rgba(8, 6, 20, .55) 55%, rgba(8, 6, 20, 0) 100%);
}
.ctrl-row { display: flex; align-items: center; gap: 4px; }
.ctrl-row .grow { flex: 1; }
.pbtn {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  border: 0; border-radius: 50%; background: transparent; color: #fff;
  transition: background-color .15s, color .15s, transform .1s;
}
.pbtn svg { width: 26px; height: 26px; }
.pbtn:hover { background: rgba(255, 255, 255, .12); }
.pbtn:active { transform: scale(.92); }
.pbtn.on { color: var(--accent-hi); }
.pbtn.speed { width: auto; min-width: 46px; padding: 0 10px; border-radius: 999px; font-weight: 800; font-size: .92rem; }
.player-top .pbtn { background: rgba(255, 255, 255, .1); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.player-top .pbtn:hover { background: rgba(255, 255, 255, .2); }
.time {
  border: 0; background: none; color: rgba(238, 236, 255, .85); padding: 6px 10px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.time:hover { background: rgba(255, 255, 255, .1); color: #fff; }

/* seek bar */
.scrub { position: relative; height: 26px; display: flex; align-items: center; cursor: pointer; touch-action: none; margin: 0 4px 2px; }
.scrub:focus-visible { outline: none; }
.scrub:focus-visible .scrub-track { box-shadow: 0 0 0 2px var(--accent-hi); }
.scrub-track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .22); transition: height .15s; }
.scrub:hover .scrub-track, .is-scrubbing .scrub-track { height: 7px; }
.scrub-track i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; }
.scrub-track .buffered { background: rgba(255, 255, 255, .3); }
.scrub-track .hover { background: rgba(255, 255, 255, .25); }
.scrub-track .played { background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.knob {
  position: absolute; top: 50%; left: 0; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 0 0 4px rgba(124, 92, 255, .45), 0 2px 8px rgba(0, 0, 0, .5);
  transform: translate(-50%, -50%) scale(0); transition: transform .15s;
}
.scrub:hover .knob, .is-scrubbing .knob, .touch .knob { transform: translate(-50%, -50%) scale(1); }
.scrub-tip {
  position: absolute; bottom: 30px; transform: translateX(-50%); padding: 5px 10px; border-radius: 8px;
  background: rgba(27, 23, 64, .95); border: 1px solid var(--line); font-size: .85rem; font-weight: 700;
  font-variant-numeric: tabular-nums; pointer-events: none; white-space: nowrap;
}

/* volume */
.vol { display: flex; align-items: center; }
.vol input {
  -webkit-appearance: none; appearance: none; width: 0; opacity: 0; height: 4px; margin: 0; border-radius: 4px; cursor: pointer;
  background: linear-gradient(90deg, #fff var(--fill, 100%), rgba(255, 255, 255, .25) var(--fill, 100%));
  transition: width .2s ease, opacity .2s ease, margin .2s ease;
}
.vol:hover input, .vol:focus-within input { width: 90px; opacity: 1; margin: 0 10px 0 4px; }
.vol input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.vol input::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 0; }
.touch .vol input { display: none; }
.touch .hide-touch { display: none; }

/* menus */
.pmenu {
  position: absolute; right: 22px; bottom: calc(var(--safe-bottom) + 72px); min-width: 220px; max-height: 60vh; overflow-y: auto;
  padding: 8px; border-radius: var(--r); background: rgba(22, 19, 52, .96); border: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, .7);
}
.pmenu h4 { margin: 6px 12px 8px; font-size: .78rem; color: var(--faint); font-weight: 700; }
.pmenu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: var(--r-sm);
  background: none; text-align: left; font-weight: 600; font-size: .92rem;
}
.pmenu button:hover, .pmenu button:focus-visible { background: rgba(255, 255, 255, .08); outline: none; }
.pmenu button svg { width: 18px; height: 18px; color: var(--accent-hi); visibility: hidden; }
.pmenu button[aria-checked="true"] svg { visibility: visible; }

/* centre: play button, buffering ring, double-tap feedback */
.big-play {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  display: grid; place-items: center; border: 0; color: #fff;
  background: rgba(124, 92, 255, .85); box-shadow: 0 10px 40px -6px rgba(124, 92, 255, .8);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transform: scale(.85); pointer-events: none; transition: opacity .2s, transform .2s, background-color .15s;
}
.big-play svg { width: 34px; height: 34px; margin-left: 4px; }
.big-play:hover { background: var(--accent-hi); }
.is-paused:not(.is-waiting) .big-play { opacity: 1; transform: scale(1); pointer-events: auto; }
.spinner {
  position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, .15); border-top-color: var(--accent-hi);
  opacity: 0; transition: opacity .2s; pointer-events: none; animation: spin .8s linear infinite;
}
.is-waiting .spinner { opacity: 1; transition-delay: .25s; }
@keyframes spin { to { transform: rotate(360deg); } }
.skip-flash {
  position: absolute; top: 0; bottom: 0; width: 38%; display: grid; place-content: center; justify-items: center; gap: 6px;
  color: #fff; font-size: .85rem; font-weight: 700; pointer-events: none; opacity: 0;
}
.skip-flash svg { width: 44px; height: 44px; }
.skip-flash.left { left: 0; background: radial-gradient(circle at 0% 50%, rgba(255, 255, 255, .14) 0 60%, transparent 61%); }
.skip-flash.right { right: 0; background: radial-gradient(circle at 100% 50%, rgba(255, 255, 255, .14) 0 60%, transparent 61%); }
.skip-flash.on { animation: flash .6s ease-out; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }

/* casting */
.cast-slot { display: grid; place-items: center; width: 46px; height: 46px; flex: none; }
.cast-slot[hidden] { display: none; }
google-cast-launcher { display: block; width: 26px; height: 26px; cursor: pointer; --disconnected-color: #fff; --connected-color: var(--accent-hi); }
.cast-banner {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; pointer-events: none;
  background: radial-gradient(60% 60% at 50% 45%, rgba(124, 92, 255, .25), rgba(8, 6, 20, .85));
}
.cast-banner svg { width: 64px; height: 64px; color: var(--accent-hi); }
.cast-banner p { margin: 0; color: var(--dim); font-size: 1.05rem; }
.cast-banner strong { display: block; color: var(--text); font-size: 1.4rem; font-weight: 800; }
.is-casting video { opacity: .15; }
.is-casting .big-play { top: auto; bottom: 30%; }
.is-casting [data-act="pip"], .is-casting [data-act="speed"], .is-casting .spinner { display: none; }

/* subtitles sit above the controls while they're showing */
.player video::cue { background: rgba(8, 6, 20, .7); color: #fff; font-family: var(--font); font-size: 1.05em; }
.player video::-webkit-media-text-track-container { transition: transform .25s ease; }
.player.show-ui video::-webkit-media-text-track-container { transform: translateY(-96px); }

.next-up, .skip-intro { position: absolute; right: 24px; bottom: calc(var(--safe-bottom) + 120px); z-index: 3; }
.next-up .btn, .skip-intro .btn { box-shadow: 0 10px 30px -6px rgba(0, 0, 0, .6); }
.skip-intro .btn, .next-up .btn-ghost { background: rgba(13, 11, 30, .72); border: 1px solid rgba(255, 255, 255, .35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.next-actions { display: flex; gap: 12px; align-items: center; }
.next-up [data-nu="go"] { position: relative; overflow: hidden; isolation: isolate; }
.next-up [data-nu="go"] > span { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .55em; }
.next-up .fill { position: absolute; top: 0; bottom: 0; left: 0; width: 0; background: rgba(255, 255, 255, .28); }
.next-up.counting .fill { animation: next-fill var(--count, 10s) linear forwards; }
.player.is-paused .next-up .fill { animation-play-state: paused; }
@keyframes next-fill { to { width: 100%; } }
.countdown { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(13, 11, 30, .88); text-align: center; padding: 24px; }
.countdown p { color: var(--dim); margin: 0 0 8px; }
.countdown h2 { margin: 0 0 24px; font-size: clamp(1.5rem, 3.5vw, 2.4rem); font-weight: 800; }
.countdown .actions { justify-content: center; }
.player-error { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: rgba(13, 11, 30, .92); }
.player-error p { color: var(--dim); max-width: 44ch; margin: 0 auto 20px; }

@media (max-width: 720px) {
  .controls { padding: 60px 10px calc(var(--safe-bottom) + 8px); }
  .pbtn { width: 42px; height: 42px; }
  .pbtn svg { width: 24px; height: 24px; }
  .time { font-size: .8rem; padding: 6px; }
  .ctrl-row [data-act="back10"], .ctrl-row [data-act="fwd10"] { display: none; } /* double-tap the sides instead */
  .pmenu { right: 10px; left: 10px; min-width: 0; }
  .player-top { padding: calc(var(--safe-top) + 10px) 12px 50px; }
  .player-name strong { font-size: 1rem; }
  .next-up, .skip-intro { right: 12px; bottom: calc(var(--safe-bottom) + 100px); }
}

/* ---------- badges, toasts, small controls ---------- */
.badge {
  position: absolute; top: 4px; right: 10px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: #fff; font-size: .68rem; font-weight: 800; line-height: 18px; text-align: center;
}
.seg .badge { position: static; margin-left: 8px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-bottom) + 28px); z-index: 60; transform: translate(-50%, 20px);
  padding: 12px 20px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .7); font-weight: 600; font-size: .92rem;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.link { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 3px; }
.icon-btn.danger:hover { color: var(--danger); background: rgba(255, 122, 138, .1); }
.icon-btn:disabled { opacity: .3; pointer-events: none; }
.select-plain {
  height: 42px; padding: 0 36px 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); font-weight: 600;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background: rgba(255, 255, 255, .06) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23a19dc9' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
}
.select-plain option, .select-plain optgroup { background: var(--surface); }
.select-plain.wide { width: 100%; max-width: 560px; }
textarea.input { height: auto; padding: 12px 16px; resize: vertical; line-height: 1.5; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .06); cursor: pointer; font-weight: 600; font-size: .9rem; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.pending-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; padding: 12px 14px 12px 16px;
  border-radius: var(--r); background: rgba(124, 92, 255, .16); border: 1px solid rgba(157, 133, 255, .4); font-weight: 600; font-size: .92rem;
}
.pending-banner svg { width: 20px; height: 20px; color: var(--accent-hi); }
.pending-banner span { flex: 1; min-width: 180px; }

/* ---------- manage area ---------- */
.admin { max-width: 1100px; }
.seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 28px; border-radius: 999px; background: rgba(255, 255, 255, .05); width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg a { display: inline-flex; align-items: center; padding: 9px 18px; border-radius: 999px; color: var(--dim); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.seg a:hover { color: var(--text); }
.seg a[aria-current="page"] { background: var(--surface-2); color: var(--text); box-shadow: 0 4px 14px -6px rgba(0, 0, 0, .6); }

.drop {
  border-radius: var(--r-lg); border: 2px dashed rgba(157, 133, 255, .35); background: rgba(124, 92, 255, .05);
  transition: border-color .15s, background-color .15s; outline: none;
}
.drop.over, .drop:focus-visible { border-color: var(--accent-hi); background: rgba(124, 92, 255, .14); }
.drop-inner { display: grid; justify-items: center; text-align: center; gap: 8px; padding: clamp(28px, 6vw, 56px) 20px; }
.drop-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: rgba(124, 92, 255, .2); color: var(--accent-hi); margin-bottom: 6px; }
.drop-icon svg { width: 32px; height: 32px; }
.drop h2 { margin: 0; font-size: 1.35rem; font-weight: 800; }
.drop .note { max-width: 52ch; margin-bottom: 14px; }
.drop label.btn { cursor: pointer; }
.upload-settings { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 18px 0 24px; }
.inline-field { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; font-size: .9rem; color: var(--dim); }

.queue { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.q-item {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 16px; border-radius: var(--r); background: rgba(27, 23, 64, .6); border: 1px solid var(--line);
}
.q-item.done { border-color: rgba(157, 133, 255, .35); }
.q-item.error { border-color: rgba(255, 122, 138, .4); }
.q-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .06); color: var(--dim); }
.q-icon svg { width: 22px; height: 22px; }
.q-title { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.q-file { margin: 2px 0 8px; color: var(--faint); font-size: .82rem; overflow-wrap: anywhere; }
.q-status { margin: 0; color: var(--dim); font-size: .88rem; display: flex; align-items: center; gap: 6px; }
.q-status svg { width: 16px; height: 16px; }
.q-status.ok { color: var(--accent-hi); font-weight: 600; }
.q-status.err { color: var(--danger); }
.q-status.warn { color: var(--gold); }
.q-bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 4px 0 8px; }
.q-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); transition: width .3s ease; }
.q-actions { display: flex; align-items: center; gap: 4px; }
.q-form, .edit-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 14px; }
.q-form label, .edit-form label { display: grid; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--dim); }
.q-form .wide, .edit-form .wide { grid-column: 1 / -1; }
.q-form .input, .edit-form .input { min-width: 0; height: 42px; }
.q-form .select-plain { width: 100%; }
.q-form-actions { grid-column: 1 / -1; display: flex; gap: 8px; }
.queue-done {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; border-radius: var(--r);
  background: rgba(124, 92, 255, .14); font-weight: 600;
}
.queue-done span { flex: 1; min-width: 200px; }

.review-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.review-list { display: grid; gap: 16px; }
.review-card {
  display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 22px; padding: 18px; border-radius: var(--r-lg);
  background: rgba(27, 23, 64, .6); border: 1px solid var(--line); transition: opacity .25s, transform .25s;
}
.review-card.leaving { opacity: 0; transform: translateX(20px); }
.rc-poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--r); overflow: hidden; background: var(--surface); }
.rc-poster img { width: 100%; height: 100%; object-fit: cover; }
.rc-kind { display: inline-block; padding: 3px 10px; border-radius: 999px; background: rgba(124, 92, 255, .2); color: var(--accent-hi); font-size: .75rem; font-weight: 800; }
.review-card h2 { margin: 8px 0 4px; font-size: 1.4rem; font-weight: 800; }
.review-card h2 span { color: var(--dim); font-weight: 600; }
.rc-meta { margin: 0 0 10px; color: var(--dim); font-size: .88rem; font-weight: 600; }
.rc-overview { margin: 0 0 12px; color: rgba(238, 236, 255, .85); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 70ch; }
.rc-warn { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0 10px; color: var(--gold); font-size: .88rem; }
.rc-warn svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.rc-eps { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rc-eps a { display: block; padding: 5px 12px; border-radius: 999px; background: rgba(255, 255, 255, .07); font-size: .82rem; font-weight: 600; }
.rc-eps a:hover { background: rgba(255, 255, 255, .14); }
.rc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rc-actions .btn { height: 42px; padding: 0 1.1em; font-size: .88rem; }
.rc-actions .icon-btn { margin-left: auto; }
.rc-panel { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

.new-collection { max-width: 560px; margin-bottom: 26px; }
.collections { display: grid; gap: 18px; }
.coll { padding: 18px; border-radius: var(--r-lg); background: rgba(27, 23, 64, .6); border: 1px solid var(--line); }
.coll-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.coll-name { flex: 1; min-width: 0; border: 0; background: none; font-size: 1.2rem; font-weight: 800; padding: 6px 8px; margin-left: -8px; border-radius: var(--r-sm); }
.coll-name:hover, .coll-name:focus { background: rgba(255, 255, 255, .06); outline: none; }
.coll-items { list-style: none; margin: 0 0 14px; padding: 0; display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.coll-items li { flex: none; width: 112px; cursor: grab; }
.coll-items li.dragging { opacity: .4; }
.ci-poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.ci-poster img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ci-name { display: block; margin-top: 6px; font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci-tools { display: flex; justify-content: space-between; }
.ci-tools .icon-btn { width: 32px; height: 32px; }
.ci-tools .icon-btn svg { width: 18px; height: 18px; }
.coll-add { max-width: 460px; }
.coll-results { display: grid; gap: 6px; margin-top: 8px; }

.layout-block { margin-bottom: 30px; }
.layout-block h2 { margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; }
.layout-block .note { margin-bottom: 12px; }
.layout-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 640px; }
.layout-rows li {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 6px; border-radius: var(--r);
  background: rgba(27, 23, 64, .6); border: 1px solid var(--line); cursor: grab; transition: opacity .15s;
}
.layout-rows li.off .lr-name { color: var(--faint); text-decoration: line-through; }
.layout-rows li.dragging { opacity: .4; }
.grip { display: grid; place-items: center; width: 28px; color: var(--faint); }
.grip svg { width: 18px; height: 18px; }
.lr-name { flex: 1; font-weight: 700; }
.lr-name em { font-style: normal; font-size: .72rem; color: var(--accent-hi); background: rgba(124, 92, 255, .18); padding: 2px 8px; border-radius: 999px; margin-left: 6px; }
.icon-btn.flip svg { transform: rotate(180deg); }
.switch { position: relative; width: 46px; height: 26px; flex: none; margin-left: 6px; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 13px; background: rgba(255, 255, 255, .15); transition: background-color .15s; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent-hi); outline-offset: 2px; }

/* ---------- account ---------- */
.account { max-width: 760px; }
.panel-block { padding: 22px; margin-bottom: 18px; border-radius: var(--r-lg); background: rgba(27, 23, 64, .6); border: 1px solid var(--line); }
.panel-block h2 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 800; }
.panel-block > .note { margin-bottom: 14px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.stack { display: grid; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--dim); flex: 1; min-width: 200px; }
.stack .input { color: var(--text); font-weight: 500; font-size: .95rem; }
.stack .input:disabled { opacity: .6; }
.stack .sub { font-weight: 500; }
.panel-block .field-row { align-items: flex-end; margin-top: 12px; }
.pw-form { display: grid; gap: 14px; max-width: 420px; }
.pw-form .btn { justify-self: start; }
.rows-list { list-style: none; margin: 0; padding: 0; }
.rows-list li { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.rows-list li:first-child { border-top: 0; }
.rows-list strong { font-weight: 700; }
.sub { display: block; color: var(--faint); font-size: .82rem; margin-top: 2px; }
.tag { font-style: normal; font-size: .7rem; font-weight: 800; color: var(--accent-hi); background: rgba(124, 92, 255, .18); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.row-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.add-person { margin-top: 14px; }
.add-person summary { list-style: none; width: fit-content; cursor: pointer; }
.add-person summary::-webkit-details-marker { display: none; }
.add-person[open] summary { margin-bottom: 16px; }

/* ---------- storage ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 22px; }
.stat { padding: 18px 20px; border-radius: var(--r-lg); background: rgba(27, 23, 64, .6); border: 1px solid var(--line); }
.stat b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--dim); font-size: .85rem; font-weight: 600; }
.meter { height: 10px; border-radius: 10px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 6px 0 8px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-hi)); }
.size-list { list-style: none; margin: 0; padding: 0; }
.size-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.size-list li:first-child { border-top: 0; }
.size-list .thumb { width: 36px; aspect-ratio: 2 / 3; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.size-list .thumb img { width: 100%; height: 100%; object-fit: cover; }
.size-list .bar-cell { min-width: 0; }
.size-list .bar-cell a { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.size-list .bar-cell a:hover { color: var(--accent-hi); }
.size-list .size { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--dim); white-space: nowrap; }

/* ---------- sign in a TV (phone side) ---------- */
.link-page { max-width: 560px; }
.big-note { font-size: 1.05rem; margin-bottom: 18px; }
.link-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.code-input { flex: 1; min-width: 200px; height: 58px; font-size: 1.6rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; text-align: center; }
.link-form .btn { height: 58px; }
.link-confirm p { margin: 0 0 12px; font-size: 1.05rem; }
.link-confirm .note { font-size: .9rem; }

/* ---------- TV mode ---------- */
.tv-login .tv-login-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 56px; align-items: center;
  width: min(1100px, 92vw); padding: 56px; border-radius: 32px;
  background: rgba(27, 23, 64, .65); border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px rgba(124, 92, 255, .45);
}
.tv-login .login-brand { justify-content: flex-start; margin-bottom: 26px; }
.tv-login h1 { margin: 0 0 18px; font-size: 2.4rem; font-weight: 800; }
.tv-login ol { margin: 0 0 26px; padding-left: 1.3em; color: var(--dim); font-size: 1.2rem; line-height: 1.7; }
.tv-login ol strong { color: var(--text); }
.tv-code { margin: 0 0 8px; font-size: 4.2rem; font-weight: 800; letter-spacing: .12em; color: var(--text); font-variant-numeric: tabular-nums; }
.tv-status { font-size: 1.05rem; margin-bottom: 26px; }
.tv-qr { width: 300px; height: 300px; padding: 0; border-radius: 22px; background: #fff; overflow: hidden; display: grid; place-items: center; }
.tv-qr svg { width: 100%; height: 100%; display: block; }
@media (max-width: 900px) {
  .tv-login .tv-login-card { grid-template-columns: 1fr; padding: 32px; gap: 28px; }
  .tv-qr { width: 220px; height: 220px; }
  .tv-code { font-size: 3rem; }
}

html.tv { font-size: 17px; }
.tv { --poster-w: 196px; --still-w: 380px; --rail: 96px; }
.tv .row-arrow { display: none !important; }
.tv .row { margin-bottom: 44px; }
.tv :focus { outline: none; }
.tv .btn:focus, .tv .icon-btn:focus, .tv .rail-link:focus, .tv .seg a:focus, .tv select:focus, .tv input:focus, .tv .match:focus, .tv .ep:focus, .tv summary:focus, .tv .check:focus-within {
  box-shadow: 0 0 0 4px #fff, 0 0 30px 4px rgba(124, 92, 255, .7); outline: none;
}
.tv .btn-play:focus { background: var(--accent-hi); transform: scale(1.06); }
.tv .poster:focus .poster-art { transform: scale(1.09); box-shadow: 0 0 0 4px #fff, 0 20px 40px -10px rgba(124, 92, 255, .8); z-index: 2; }
.tv .still:focus .still-art { box-shadow: 0 0 0 4px #fff, 0 20px 40px -10px rgba(124, 92, 255, .8); transform: scale(1.04); transition: transform .2s; }
.tv .still:focus .play-badge { opacity: 1; background: var(--accent); }
.tv .strip { padding-top: 16px; padding-bottom: 20px; }
.tv .ep:focus { background: rgba(255, 255, 255, .08); }
.tv .player .pbtn:focus { background: rgba(255, 255, 255, .22); box-shadow: 0 0 0 3px #fff; }
.tv .player .scrub-track { height: 7px; }
.tv .player .knob { transform: translate(-50%, -50%) scale(1); }
.tv .next-up, .tv .skip-intro { right: 64px; bottom: 150px; }
.tv .next-up .btn, .tv .skip-intro .btn { height: auto; padding: 18px 32px; font-size: 1.3rem; }

/* shown instead of the app when the browser is too old */
.too-old { min-height: 100vh; display: grid; place-items: center; padding: 40px; text-align: center; }
.too-old div { max-width: 640px; }
.too-old h1 { font-size: 2rem; margin: 0 0 16px; }
.too-old p { color: var(--dim); font-size: 1.15rem; line-height: 1.7; }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  :root { --top: 64px; --poster-w: 112px; --still-w: 250px; }
  .rail { display: none; }
  .topbar { left: 0; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; }
  .top-logo { display: block; grid-column: 1; }
  .search-pill { height: 42px; padding-left: 16px; }
  .hide-mobile { display: none; }
  .content { margin-left: 0; padding-bottom: calc(var(--safe-bottom) + 90px); }
  .tabbar {
    position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(4, 1fr);
    padding: 8px 6px calc(var(--safe-bottom) + 8px);
    background: rgba(13, 11, 30, .9); border-top: 1px solid var(--line);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .tabbar.five { grid-template-columns: repeat(5, 1fr); }
  .tabbar a { position: relative; display: grid; justify-items: center; gap: 3px; padding: 4px 0; color: var(--faint); font-size: .68rem; font-weight: 600; }
  .tabbar a svg { width: 25px; height: 25px; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar a[aria-current="page"] svg { color: var(--accent-hi); }

  .hero { min-height: 68vh; margin: 4px calc(var(--pad) * -1) 0; border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 24px 20px; text-align: center; justify-content: center; }
  .hero-art::after { background: linear-gradient(0deg, rgba(13, 11, 30, .95) 5%, rgba(13, 11, 30, .2) 55%, rgba(13, 11, 30, .3) 100%); }
  .hero-body { display: grid; justify-items: center; }
  .hero .meta, .hero .actions { justify-content: center; }
  .hero-overview { display: none; }
  .hero .actions .btn { flex: 1; max-width: 170px; }
  .title-logo { margin: 0 auto; }

  .row-head h2 { font-size: 1.08rem; }
  .strip { gap: 12px; }
  .filters { gap: 8px; margin: 4px calc(var(--pad) * -1) 18px; padding: 0 var(--pad); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters > * { flex: none; }
  .select-pill select { min-width: 0; height: 38px; padding: 0 36px 0 14px; font-size: .85rem; }
  .select-pill svg { right: 12px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }

  .backdrop { left: 0; height: 60vh; }
  .backdrop::after { background: linear-gradient(0deg, var(--bg) 2%, rgba(13, 11, 30, .45) 60%, rgba(13, 11, 30, .25) 100%); }
  .title-page { padding-top: 28vh; gap: 32px; }
  .title-info { text-align: center; }
  .title-info .meta, .title-info .actions { justify-content: center; }
  .title-info .actions .btn { flex: 1; }
  .title-chips, .tagline, .overview { text-align: left; }
  .ep { grid-template-columns: 130px 1fr; gap: 14px; padding: 8px; margin: 0 -8px; }
  .ep-overview { -webkit-line-clamp: 2; font-size: .85rem; }
  .tabbar .badge { top: 0; right: calc(50% - 22px); }
  .seg { width: 100%; }
  .seg a { flex: 1; justify-content: center; padding: 8px 10px; font-size: .82rem; }
  .review-card { grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 14px; }
  .review-card h2 { font-size: 1.15rem; }
  .rc-actions .btn { flex: 1 1 auto; }
  .q-item { grid-template-columns: minmax(0, 1fr) auto; padding: 14px; }
  .q-icon { display: none; }
  .rows-list li { flex-wrap: wrap; }
  .panel-block { padding: 18px; }
  .drop .actions { flex-direction: column; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- intros and credits (Manage this title) ---------- */
.markers-box:not(:empty) { margin-top: 14px; }
.markers-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.markers-form { overflow-x: auto; }
.markers { border-collapse: collapse; width: 100%; min-width: 560px; margin-bottom: 12px; font-size: .88rem; }
.markers th, .markers td { padding: 6px 8px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
.markers thead th { border-top: 0; color: var(--faint); font-weight: 700; font-size: .78rem; }
.markers tbody th { font-weight: 700; white-space: nowrap; }
.markers tbody th .sub { display: block; font-weight: 500; color: var(--faint); font-size: .8rem; white-space: normal; max-width: 220px; }
.markers .input { width: 90px; height: 36px; padding: 0 10px; text-align: center; }
