/* Kinovra — cinema-at-night look for iPhone.
   Palette: true black for OLED, two raised greys, warm projector amber as the only colour. */
:root {
  --ink: #000;
  --s1: #141414;
  --s2: #232323;
  --line: #2c2c2c;
  --text: #f5f5f1;
  --muted: #9c9c96;
  --amber: #f3b33d;
  --ok: #46d36a;
  --bad: #ff7b7b;
  /* names the settings screen uses */
  --bg: var(--ink); --panel: var(--s1); --accent: var(--amber);
  --top: env(safe-area-inset-top); --bottom: env(safe-area-inset-bottom);
  --gutter: 16px;
  --marquee: "Big Shoulders Display", "Arial Narrow", sans-serif-condensed, sans-serif;
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { touch-action: pan-x pan-y; margin: 0; background: var(--ink); color: var(--text); }
body { padding-bottom: calc(58px + var(--bottom)); overscroll-behavior-y: none; }
a { color: inherit; text-decoration: none; }
img { display: block; }
button, input, textarea, select { font: inherit; font-size: 16px; color: var(--text); }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.muted { color: var(--muted); }
.status { color: var(--muted); padding: 20px var(--gutter); }
.status.error, .error { color: var(--bad); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.4; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.sep { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .55; margin: 0 8px; vertical-align: middle; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border: 0; border-radius: 6px;
  font-size: 16px; font-weight: 700; letter-spacing: .01em; cursor: pointer;
}
.btn:active { transform: scale(.98); }
.btn.white { background: #fff; color: #000; }
.btn.grey { background: rgba(109,109,110,.55); color: #fff; }
.btn.wide { display: flex; width: 100%; }
.btn.big { height: 50px; font-size: 17px; }
.iconbtn { background: none; border: 0; padding: 6px; color: var(--text); display: inline-flex; }
.textbtn { background: none; border: 0; padding: 6px 0; color: var(--amber); font-size: 15px; font-weight: 600; }
.primary { background: var(--amber); color: #111; border: 0; border-radius: 6px; padding: 10px 16px; font-weight: 700; }

/* ---------- header ---------- */
#top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; gap: 4px;
  padding: calc(8px + var(--top)) 12px 8px;
  background: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,0));
  transition: background-color .25s;
}
#top.solid { background: rgba(0,0,0,.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.wordmark {
  font-family: var(--marquee); font-weight: 900; font-size: 30px; line-height: 1;
  letter-spacing: .03em; text-transform: uppercase; color: var(--amber); padding: 4px;
}
body:not(.overlay) main { padding-top: calc(56px + var(--top)); }

/* ---------- tab bar ---------- */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
  padding-bottom: var(--bottom); background: rgba(0,0,0,.94);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid #1c1c1c;
}
#tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 6px; font-size: 10.5px; color: #8c8c8c; }
#tabs svg { width: 24px; height: 24px; }
#tabs a.active { color: var(--text); }

/* ---------- home hero ---------- */
.hero { position: relative; height: min(76vh, 640px); min-height: 440px; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0; background: center 20% / cover no-repeat var(--s1);
  opacity: 0; transform: scale(1.06); transition: opacity 1s ease, transform 1.6s ease;
}
.hero.ready .hero-bg { opacity: 1; transform: none; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 25%, rgba(0,0,0,0) 45%, rgba(0,0,0,.75) 75%, #000 100%);
}
.hero-body { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 1; display: flex; flex-direction: column; align-items: center; padding: 0 var(--gutter); text-align: center; }
.hero-logo { max-width: 74%; max-height: 120px; object-fit: contain; filter: drop-shadow(0 2px 12px rgba(0,0,0,.6)); }
.hero-tags { margin: 14px 0 16px; font-size: 14px; font-weight: 500; color: #e5e5e5; }
.hero-actions { display: flex; gap: 10px; }
.hero-actions .btn { min-width: 128px; }
.marquee {
  font-family: var(--marquee); font-weight: 900; text-transform: uppercase;
  font-size: clamp(40px, 13vw, 72px); line-height: .92; letter-spacing: .01em; margin: 0;
  text-shadow: 0 2px 16px rgba(0,0,0,.6);
}

/* ---------- rows ---------- */
.row { margin-top: 22px; }
.hero + .row { margin-top: 6px; }
.rowhead { display: flex; align-items: center; gap: 2px; margin: 0 0 8px; padding: 0 var(--gutter); font-size: 18px; font-weight: 700; }
.rowhead svg { color: var(--muted); }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: min(29vw, 150px); gap: 8px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
  padding: 0 var(--gutter); scroll-padding: 0 var(--gutter); scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.for-you-card { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.for-you-card .poster { width: 100%; flex: none; }
.suggestion-kind { color: var(--amber); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.suggestion-empty { padding: 0 var(--gutter); color: var(--muted); font-size: 14px; }
.rail.wide { grid-auto-columns: min(62vw, 300px); }
.rail > * { scroll-snap-align: start; }
.poster { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 6px; overflow: hidden; background: var(--s1); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster:active, .landscape:active { transform: scale(.97); }
.noart { position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center; font-family: var(--marquee); font-weight: 800; font-size: 20px; line-height: 1; text-transform: uppercase; color: var(--muted); }
.landscape { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--s1); }
.landscape img { width: 100%; height: 100%; object-fit: cover; }
.landscape::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.85), rgba(0,0,0,0) 55%); }
.lsname, .lssub { position: absolute; left: 10px; right: 10px; z-index: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lsname { bottom: 24px; font-weight: 700; font-size: 15px; }
.lssub { bottom: 7px; font-size: 12px; color: var(--amber); font-weight: 600; }
.binge-card .lsname { font-size: 17px; }
.binge-row .rail { gap: 12px; }
@media (min-width: 900px) { .binge-row .rail { grid-auto-columns: 340px; } }

/* ---------- search & grids ---------- */
.page { padding: 8px var(--gutter) 24px; }
.pagetitle { font-family: var(--marquee); font-weight: 900; text-transform: uppercase; font-size: 36px; line-height: 1; margin: 6px 0 16px; }
.searchbar { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; background: var(--s2); border-radius: 8px; color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: none; }
.subhead { font-size: 18px; font-weight: 700; margin: 22px 0 10px; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 700px) { .pgrid { grid-template-columns: repeat(5, 1fr); } }
.genres { display: flex; flex-wrap: wrap; gap: 8px; }
.genres a { padding: 11px 16px; background: var(--s2); border-radius: 6px; font-weight: 600; font-size: 15px; }

/* ---------- title page ---------- */
.tbanner { position: relative; height: min(58vh, 500px); overflow: hidden; }
.tbanner-bg { position: absolute; inset: 0; background: center 20% / cover no-repeat var(--s1); }
.tbanner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 28%, rgba(0,0,0,.2) 55%, #000 100%); }
.tbody { position: relative; z-index: 1; margin-top: -96px; padding: 0 var(--gutter) 28px; max-width: 760px; }
.tlogo { max-width: 72%; max-height: 110px; object-fit: contain; filter: drop-shadow(0 2px 12px rgba(0,0,0,.6)); }
.tfacts { display: flex; align-items: center; flex-wrap: wrap; margin: 12px 0 14px; font-size: 14px; color: #d2d2d2; }
.rate { color: var(--amber); font-weight: 700; }
.rating-extra { display: inline-flex; align-items: center; }
.rt-rating { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.tbody .btn.wide + .btn.wide { margin-top: 8px; }
.tdesc { margin: 16px 0 10px; font-size: 15px; line-height: 1.45; color: #e8e8e8; max-width: 65ch; }
.tcredits { margin: 4px 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.tcredits span { color: #6f6f6b; margin-right: 4px; }

.epshead { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 14px; border-top: 1px solid var(--line); padding-top: 18px; }
.seasonpick select {
  -webkit-appearance: none; appearance: none; background: var(--s2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f1' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6' /%3E%3C/svg%3E") no-repeat right 10px center / 18px;
  border: 0; border-radius: 6px; padding: 10px 38px 10px 14px; font-weight: 700;
}
.eplist { display: flex; flex-direction: column; gap: 20px; }
.ep { display: grid; grid-template-columns: 136px 1fr; gap: 6px 12px; align-items: center; width: 100%; padding: 0; background: none; border: 0; text-align: left; }
.epthumb { position: relative; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: var(--s2); }
.epthumb img { width: 100%; height: 100%; object-fit: cover; }
.epplay { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid #fff; background: rgba(0,0,0,.45); color: #fff; }
.epplay svg { width: 16px; height: 16px; margin-left: 2px; }
.ep.current .epthumb { outline: 2px solid var(--amber); outline-offset: -2px; }
.eptext { display: flex; flex-direction: column; gap: 3px; font-size: 15px; }
.eptext .muted { font-size: 12.5px; }
.epdesc { grid-column: 1 / -1; font-size: 13px; line-height: 1.4; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- player ---------- */
#player {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: #000; color: var(--text);
}
#player[open] { display: flex; flex-direction: column; }
#player::backdrop { background: #000; }
.pbar { display: flex; align-items: center; gap: 6px; padding: calc(6px + var(--top)) 10px 6px; position: relative; z-index: 2; }
.ptitle { display: flex; flex-direction: column; min-width: 0; }
.ptitle strong { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptitle span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage { position: relative; flex: 1; display: grid; place-items: center; overflow: hidden; }
.pbackdrop { position: absolute; inset: 0; background: center / cover no-repeat; opacity: .28; }
.pbackdrop::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(0,0,0,.2), #000 85%); }
#video { position: relative; z-index: 1; width: 100%; max-height: 100%; background: #000; }
.finding, .external { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px; text-align: center; }
.finding { color: #d8d8d8; font-size: 15px; }
.finding.failed > svg { display: none; }
.external { width: min(360px, 100%); }
.external p { margin: 0 0 4px; color: #e0e0e0; font-size: 15px; line-height: 1.4; }
.external .btn.big { width: 100%; }
.extrow { display: flex; gap: 8px; width: 100%; }
.extrow .btn { flex: 1; padding: 0 10px; }
.pfoot { padding: 10px var(--gutter) calc(14px + var(--bottom)); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; position: relative; z-index: 2; }
.pfoot .hint { margin: 0; }
.pfoot .textbtn { flex: none; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--amber); animation: spin .9s linear infinite; }
.spinner.small { display: inline-block; width: 16px; height: 16px; border-width: 2px; vertical-align: -3px; margin-right: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- stream sheet ---------- */
#sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 640px; max-height: 84vh;
  padding: 6px var(--gutter) calc(16px + var(--bottom)); border: 0; border-radius: 14px 14px 0 0;
  background: #181818; color: var(--text); overflow-y: auto;
}
#sheet::backdrop { background: rgba(0,0,0,.6); }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: #4a4a4a; margin: 4px auto 8px; }
.sheethead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; font-size: 17px; }
.speedline { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.slist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sitem { display: block; width: 100%; text-align: left; padding: 12px; background: var(--s2); border: 1px solid transparent; border-radius: 8px; }
.sitem.best { border-color: var(--amber); }
.sitem.slow { opacity: .55; }
.sbadges { display: flex; flex-wrap: wrap; gap: 4px; }
.sdesc { display: block; margin: 7px 0 3px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.sfile { display: block; font-size: 12px; color: var(--muted); word-break: break-all; }
.ssrc { display: block; margin-top: 4px; font-size: 11px; color: #75756f; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.badge.ok { background: rgba(70,211,106,.16); color: var(--ok); }
.badge.warn { background: rgba(243,179,61,.14); color: var(--amber); }
.badge.bad { background: rgba(255,123,123,.14); color: var(--bad); }
.badge.gold { background: var(--amber); color: #111; }

@media (prefers-reduced-motion: reduce) {
  .hero-bg { transition: opacity .3s; transform: none; }
  .spinner { animation-duration: 2.5s; }
  .btn:active, .poster:active, .landscape:active { transform: none; }
}

/* toast (update notices) */
#toast {
  position: fixed; left: 12px; right: 12px; bottom: calc(76px + var(--bottom)); z-index: 20;
  display: flex; gap: 10px; align-items: center; justify-content: space-between;
  max-width: 520px; margin: 0 auto; padding: 12px 14px; border-radius: 12px;
  background: #23283a; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.45); font-size: 15px;
}
#toast[hidden] { display: none; }
#toast button { flex: none; padding: 6px 12px; font-size: 14px; background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- settings: iOS-style grouped list ---------- */
.settings-page { max-width: 640px; margin: 0 auto; }
.settings-page h1 { margin-bottom: 4px; }
.grp { font-size: 13px; font-weight: 500; color: var(--muted); margin: 26px 16px 8px; letter-spacing: 0; }
.group { background: var(--panel); border-radius: 14px; overflow: hidden; }
.cell {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px;
  padding: 12px 16px; font-size: 16px; color: var(--text); background: none; border: 0; border-radius: 0;
}
.cell + .cell, .cell + details, .group > .cell:not(:first-child) { box-shadow: inset 0 1px 0 var(--line); }
.cell.stack { flex-direction: column; align-items: stretch; gap: 10px; }
.lbl { font-size: 16px; }
.cap { margin: -2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.35; min-height: 1.35em; }
.muted { color: var(--muted); }
.row-between { justify-content: space-between; }

/* segmented control: one choice per setting */
.seg { display: flex; padding: 3px; gap: 3px; background: #0c0e12; border-radius: 11px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg label { flex: 1 0 auto; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; text-align: center; white-space: nowrap; padding: 8px 10px; border-radius: 8px;
  font-size: 15px; color: var(--muted); transition: background .15s, color .15s;
}
.seg input:checked + span { background: #2b3350; color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.4); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

/* switch rows */
.switchrow { justify-content: space-between; cursor: pointer; }
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: #3a3f4b; border-radius: 31px; transition: background .2s; pointer-events: none; }
.switch i::before { content: ""; position: absolute; width: 27px; height: 27px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .2s; }
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::before { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

.selectrow { justify-content: space-between; }
.selectrow select {
  font: inherit; font-size: 16px; color: var(--accent); background: none; border: 0; padding: 4px 0;
  text-align: right; text-align-last: right; -webkit-appearance: none; appearance: none; cursor: pointer;
}

/* TorBox key */
.keyline { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5b616d; flex: none; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px rgba(62,207,142,.18); }
.keyrow { display: flex; gap: 8px; }
.keyrow input { flex: 1; min-width: 0; background: var(--bg); }
.keyrow button { flex: none; }
.settings-page textarea { width: 100%; background: var(--bg); resize: vertical; }

/* chips (providers) */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips[hidden] { display: none; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--muted); }
.chip input:checked + span { background: #2b3350; border-color: var(--accent); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); }
.cell.stack .switchrow { padding: 0; min-height: 0; box-shadow: none; }

/* advanced (collapsed) */
.advanced { margin-top: 26px; }
.advanced summary {
  list-style: none; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--muted); padding: 0 16px 8px;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::after { content: " ›"; display: inline-block; transition: transform .2s; }
.advanced[open] summary::after { transform: rotate(90deg); }

.linkcell { color: var(--accent); cursor: pointer; text-align: left; justify-content: flex-start; }
.linkcell.danger { color: var(--bad); }
@media (prefers-reduced-motion: reduce) { .seg span, .switch i, .switch i::before, .advanced summary::after { transition: none; } }


/* settings on the new palette */
.settings-page { padding: 4px var(--gutter) 24px; }
.settings-page h1 { font-family: var(--marquee); font-weight: 900; text-transform: uppercase; font-size: 36px; line-height: 1; margin: 6px 0 4px; }
.seg input:checked + span { background: #3a3a3a; }
.chip input:checked + span { background: #3a3a3a; border-color: var(--amber); }
.settings-page input:not([type=checkbox]):not([type=radio]), .settings-page textarea { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.settings-page .keyrow button, .settings-page .cell.stack > button { border-radius: 6px; padding: 10px 14px; border: 0; background: var(--s2); }
.settings-page .keyrow .primary { background: var(--amber); color: #111; }
#toast { bottom: calc(70px + var(--bottom)); background: #262626; border-color: #333; }
#toast button { background: var(--amber); border-color: var(--amber); color: #111; font-weight: 700; border-radius: 6px; }

/* episodes: missing art + not aired yet */
.epthumb img.fallback { opacity: .45; filter: grayscale(.4); }
.ep.upcoming { cursor: default; }
.ep.upcoming .epthumb, .ep.upcoming strong { opacity: .5; }
.ep.upcoming .epdesc { opacity: .7; }
.coming { font-size: 12.5px; font-weight: 600; color: var(--amber); }
.btn:disabled { opacity: .7; cursor: default; transform: none; }

/* ======================================================================
   Responsive: phone (default) → tablet / computer / TV (≥ 900 px wide)
   ====================================================================== */
#topnav { display: none; }
.hero-desc { display: none; }
.tactions { display: block; }

@media (min-width: 900px) {
  :root { --gutter: 4vw; }
  body { padding-bottom: 0; }
  #tabs { display: none; }
  #top { padding: calc(14px + var(--top)) var(--gutter) 14px; gap: 10px; }
  .wordmark { font-size: 34px; }
  #topnav { display: flex; gap: 22px; margin-left: 26px; }
  #topnav a { color: #d6d6d6; font-size: 15px; font-weight: 500; padding: 4px 0; }
  #topnav a.active { color: #fff; font-weight: 700; }
  body:not(.overlay) main { padding-top: calc(76px + var(--top)); }

  /* hero: left-aligned, description shown, rows overlap its bottom edge */
  .hero { height: 86vh; min-height: 520px; max-height: none; }
  .hero::after {
    background:
      linear-gradient(77deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 38%, rgba(0,0,0,0) 62%),
      linear-gradient(to bottom, rgba(0,0,0,.4) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 60%, #000 100%);
  }
  .hero-body { left: var(--gutter); right: auto; bottom: 26vh; width: min(580px, 42vw); align-items: flex-start; text-align: left; padding: 0; }
  .hero-logo { max-width: 100%; max-height: 22vh; object-position: left bottom; }
  .hero-tags { margin: 18px 0 10px; font-size: 15px; }
  .hero-desc {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    margin: 0 0 22px; font-size: 17px; line-height: 1.45; color: #e8e8e8; text-shadow: 0 1px 8px rgba(0,0,0,.6);
  }
  .hero-actions .btn { height: 50px; padding: 0 30px; font-size: 18px; min-width: 0; }
  .hero + .row { margin-top: -14vh; position: relative; z-index: 2; }

  .row { margin-top: 34px; }
  .rowhead { font-size: 21px; margin-bottom: 10px; }
  .rail { grid-auto-columns: clamp(150px, 12.5vw, 250px); gap: 10px; padding-block: 6px; }
  .rail.wide { grid-auto-columns: clamp(280px, 22vw, 440px); }
  .pgrid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
  .pagetitle, .settings-page h1 { font-size: 46px; }

  /* title page: info on the left over the artwork */
  .tbanner { height: 82vh; max-height: none; }
  .tbanner::after {
    background:
      linear-gradient(77deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.45) 40%, rgba(0,0,0,0) 65%),
      linear-gradient(to bottom, rgba(0,0,0,.4) 0%, rgba(0,0,0,0) 20%, rgba(0,0,0,0) 55%, #000 100%);
  }
  .tbody { margin-top: -58vh; padding: 0 var(--gutter) 48px; max-width: none; }
  .tinfo { width: min(640px, 46vw); }
  .tlogo { max-height: 20vh; max-width: 100%; }
  .tfacts { font-size: 15px; }
  .tactions { display: flex; gap: 10px; }
  .tactions .btn.wide { display: inline-flex; width: auto; padding: 0 30px; height: 50px; font-size: 17px; }
  .tbody .btn.wide + .btn.wide { margin-top: 0; }
  .tdesc { font-size: 17px; }
  .tcredits { font-size: 14px; }
  #eps { max-width: 1120px; }
  .epshead { margin-top: 40px; }
  .ep { grid-template-columns: 280px 1fr; gap: 6px 20px; align-items: start; }
  .epthumb { grid-row: span 2; }
  .eptext { font-size: 17px; padding-top: 6px; }
  .epdesc { grid-column: 2; font-size: 15px; }
  .epplay { width: 46px; height: 46px; }

  /* stream chooser becomes a centred panel */
  #sheet { inset: 0; margin: auto; height: fit-content; max-height: 80vh; border-radius: 14px; padding-top: 14px; }
  .grabber { display: none; }
}

/* TV: viewed from across the room */
html.tv .rowhead { font-size: 26px; }
html.tv .hero-desc { font-size: 22px; }
html.tv .hero-tags, html.tv .tfacts { font-size: 19px; }
html.tv .btn { height: 58px; font-size: 21px; padding: 0 34px; }
html.tv .rail { grid-auto-columns: clamp(170px, 14vw, 300px); padding-block: 12px; }
html.tv .tdesc { font-size: 21px; }
html.tv .tcredits { font-size: 17px; }
html.tv #topnav a { font-size: 20px; }
html.tv .eptext { font-size: 21px; }
html.tv .epdesc { font-size: 18px; }

@media (min-width: 900px) {
  .hero-logo, .tlogo { width: auto; height: auto; object-fit: initial; }
}
.darklogo { filter: brightness(0) invert(1) drop-shadow(0 2px 12px rgba(0,0,0,.6)) !important; }
/* episode rows on wide screens: description sits right under the date */
@media (min-width: 900px) { .ep { grid-template-rows: auto 1fr; } }

/* ======================================================================
   Loading
   ====================================================================== */
.loader { display: grid; place-items: center; min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px); }
.lmark { width: 56px; height: 56px; }
.ltrack { fill: none; stroke: rgba(255,255,255,.1); stroke-width: 3; }
.larc { fill: none; stroke: var(--amber); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 32 126; transform-origin: 24px 24px; animation: spin 1s linear infinite; }
.ltri { fill: var(--text); opacity: .9; }

.skel { display: block; background: #161616; border-radius: 6px; position: relative; overflow: hidden; }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.05) 50%, transparent 80%);
  transform: translateX(-100%); animation: shimmer 1.6s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-hero { background: radial-gradient(ellipse at 70% 30%, #1a1a1a, #000 70%); }
.skel-banner { background: radial-gradient(ellipse at 70% 30%, #1a1a1a, #000 70%); }
.skel-logo { width: 62%; max-width: 360px; height: 64px; margin-bottom: 14px; }
.skel-line { width: 100%; max-width: 560px; height: 14px; margin: 10px 0; }
.skel-line.short { width: 40%; }
.skel-btn { width: 128px; height: 44px; }
.skel-btn.wide { width: 100%; margin-top: 8px; }
.skel-head { width: 150px; height: 18px; margin: 0 var(--gutter) 10px; }
.skel-poster { aspect-ratio: 2 / 3; }
.skel-land { aspect-ratio: 16 / 9; }
.hero.skel-hero .hero-body { align-items: center; }
@media (min-width: 900px) {
  .hero.skel-hero .hero-body { align-items: flex-start; }
  .skel-btn.wide { width: 170px; height: 50px; margin-top: 0; }
  .skel-head { height: 22px; }
}

/* posters fade in once loaded instead of popping */
.poster img { opacity: 0; transition: opacity .35s ease; }
.poster img.ld { opacity: 1; }

/* ======================================================================
   Remote / keyboard focus — the way TV streaming apps do it:
   no frames. The focused poster grows and lifts; buttons fill white;
   episode rows get a lighter panel. Rows get room so nothing is clipped.
   ====================================================================== */
html.keys :focus { outline: none; }
html.keys .rail { padding-block: 26px; margin-block: -18px; scroll-padding-inline: calc(var(--gutter) + 12px); }
html.keys .poster, html.keys .landscape { transition: transform .22s cubic-bezier(.2,.8,.2,1), box-shadow .22s, filter .22s; transform-origin: center; }
html.keys .poster:focus, html.keys .landscape:focus {
  transform: scale(1.12); z-index: 3; box-shadow: 0 14px 36px rgba(0,0,0,.85);
}
/* the row with focus dims its other titles slightly so the chosen one stands out */
html.keys .rail:focus-within > :not(:focus) { filter: brightness(.6); }

/* buttons: grey until focused, focused = solid white */
html.keys .btn { transition: background-color .15s, color .15s, transform .15s; }
html.keys .btn.white:not(:focus), html.keys .btn.grey:not(:focus) { background: rgba(109,109,110,.55); color: #fff; }
html.keys .btn:focus { background: #fff; color: #000; transform: scale(1.04); }
html.keys .textbtn:focus, html.keys .linkcell:focus { color: #fff; text-decoration: underline; text-underline-offset: 4px; }

/* episodes: lighter panel behind the focused row */
html.keys .ep { border-radius: 8px; transition: background-color .15s, box-shadow .15s; }
html.keys .ep:focus { background: #232323; box-shadow: 0 0 0 10px #232323; }
html.keys .ep:focus .epplay { background: #fff; color: #000; border-color: #fff; }

/* menus, rows, chips, switches, settings */
html.keys #tabs a:focus, html.keys #topnav a:focus { color: #fff; font-weight: 700; text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 2px; text-underline-offset: 8px; }
html.keys .rowhead:focus { color: var(--amber); }
html.keys .genres a:focus, html.keys .seasonpick select:focus, html.keys .searchbar:focus-within { background: #fff; color: #000; }
html.keys .seg input:focus + span { background: #fff; color: #000; }
html.keys .chip input:focus + span { background: #fff; color: #000; border-color: #fff; }
html.keys .switch input:focus + i { box-shadow: 0 0 0 4px rgba(255,255,255,.35); }
html.keys .cell:focus-within { background: #1f1f1f; }
html.keys .sitem:focus { background: #3a3a3a; }
html.keys .iconbtn:focus { background: rgba(255,255,255,.18); border-radius: 50%; }
html.keys video:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  .larc { animation-duration: 2.4s; }
  .skel::after { animation: none; }
  html.keys .poster:focus, html.keys .landscape:focus, html.keys .btn:focus { transform: none; }
}

/* Lucide icons */
.lucide { display: block; flex: none; }
.rate .lucide { display: inline-block; vertical-align: -1px; margin-right: 4px; }
.rowhead .lucide { color: var(--muted); }
.btn .lucide { width: 22px; height: 22px; }
.badge { display: inline-flex; align-items: center; gap: 4px; }
.grp { display: flex; align-items: center; gap: 7px; }
.grp .lucide { color: var(--amber); }
.advanced summary { display: inline-flex; align-items: center; gap: 7px; }
.advanced summary .lucide { color: var(--amber); }
.genres a { display: inline-flex; align-items: center; gap: 8px; }
.genres a .lucide { color: var(--amber); }
.fact { display: inline-flex; align-items: center; gap: 5px; }
.fact .lucide { opacity: .75; }
.coming .lucide { display: inline-block; vertical-align: -2px; margin-right: 4px; }
.textbtn { display: inline-flex; align-items: center; gap: 6px; }
.textbtn .lucide { width: 18px; height: 18px; }
#topnav a { display: inline-flex; align-items: center; gap: 6px; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.linkcell { gap: 10px; }
.rowhead > .lucide:first-child { color: var(--amber); margin-right: 6px; }
html.keys .genres a:focus .lucide { color: #000; }

/* subtitles */
.pbar .ptitle { flex: 1; }
#subsBtn { color: var(--muted); }
#subsBtn.on { color: var(--text); }
.subitem .sdesc { display: flex; align-items: center; gap: 8px; margin: 0; }
.grp-note { margin: 8px 16px 0; }
video::cue { background: rgba(0,0,0,.62); color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.35; }
html.tv video::cue { font-size: 1.5em; }

/* ======================================================================
   Player (our own controls)
   ====================================================================== */
#player { background: #000; }
#player[open] { display: block; }
.stage { position: absolute; inset: 0; display: block; overflow: hidden; background: #000; }
.stage:not(.ui) { cursor: none; }
#video { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: contain; background: transparent; z-index: 1; }
.pbackdrop { z-index: 0; }
.finding { position: absolute; inset: 0; z-index: 4; justify-content: center; }
.external { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 8; }

/* overlay */
.controls {
  position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; justify-content: space-between;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
  background: linear-gradient(to bottom, rgba(0,0,0,.7) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 62%, rgba(0,0,0,.8) 100%);
}
.stage.ui .controls { opacity: 1; }
.stage.ui .controls button, .stage.ui .controls .seek, .stage.ui .controls input { pointer-events: auto; }
.controls .iconbtn { color: #fff; padding: 8px; border-radius: 50%; }
.controls .iconbtn:hover { background: rgba(255,255,255,.12); }

.ctop { display: flex; align-items: flex-start; gap: 6px; padding: calc(10px + var(--top)) calc(10px + env(safe-area-inset-right)) 0 calc(8px + env(safe-area-inset-left)); }
.ptitle { display: flex; flex-direction: column; min-width: 0; padding-top: 6px; }
.ptitle strong { font-size: 17px; }
.ptitle span { font-size: 13px; color: #cfcfcf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#playerHint { color: var(--muted); font-size: 12px; }

.ccenter { display: flex; align-items: center; justify-content: center; gap: clamp(28px, 10vw, 80px); }
.bigplay { width: 84px; height: 84px; justify-content: center; align-items: center; background: rgba(0,0,0,.35) !important; }
.skip { position: relative; }
.skip b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 10px; font-weight: 800; padding-top: 2px; pointer-events: none; }
.ccenter .skip b { font-size: 12px; }
/* computers and TVs: keep the middle clear, like Netflix (big play only while paused) */
@media (hover: hover) { .ccenter .skip, .ccenter .bigplay { display: none; } .stage.paused .ccenter .bigplay { display: flex; } }
html.tv .ccenter .skip, html.tv .ccenter .bigplay { display: none; }

.cbottom { padding: 0 calc(16px + env(safe-area-inset-right)) calc(10px + var(--bottom)) calc(16px + env(safe-area-inset-left)); }
.seekrow { display: flex; align-items: center; gap: 14px; }
.seek { position: relative; flex: 1; height: 28px; display: flex; align-items: center; cursor: pointer; touch-action: none; outline: none; }
.strack { position: relative; width: 100%; height: 4px; background: rgba(255,255,255,.25); border-radius: 2px; overflow: hidden; transition: height .15s; }
.seek:hover .strack, .seek.drag .strack, .seek:focus-visible .strack, html.keys .seek:focus .strack { height: 7px; }
.sbuf { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255,255,255,.4); }
.splayed { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--amber); }
.sthumb { position: absolute; left: 0; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--amber); transform: scale(.85); transition: transform .15s; }
.seek:hover .sthumb, .seek.drag .sthumb, html.keys .seek:focus .sthumb { transform: scale(1.25); }
.sbubble { position: absolute; bottom: 30px; transform: translateX(-50%); padding: 4px 8px; border-radius: 4px; background: rgba(20,20,20,.92); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tremain { font-size: 14px; font-variant-numeric: tabular-nums; color: #e8e8e8; min-width: 64px; text-align: right; }
.crow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }
.cgroup { display: flex; align-items: center; gap: 2px; }
.ctitle { flex: 1; text-align: center; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e8e8e8; }
#subsBtn { color: #fff; }
#subsBtn:not(.on) { color: #bdbdbd; }
.vol { display: flex; align-items: center; }
.vol input { width: 0; opacity: 0; transition: width .2s, opacity .2s; accent-color: var(--amber); }
.vol:hover input, .vol:focus-within input { width: 90px; opacity: 1; margin-left: 4px; }
@media (hover: none) { .vol, .ctitle, .crow .skip { display: none; } }
html.tv .vol { display: none; }
@media (max-width: 520px) { #bPip { display: none; } }

/* buffering + skip flash */
.buffering { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; }
.buffering .lmark { width: 64px; height: 64px; }
.seekflash { position: absolute; top: 50%; z-index: 6; translate: 0 -50%; padding: 10px 16px; border-radius: 999px; background: rgba(0,0,0,.55); font-weight: 700; font-size: 18px; opacity: 0; pointer-events: none; }
.seekflash.left { left: 12%; }
.seekflash.right { right: 12%; }
.seekflash.show { animation: flash .6s ease; }
@keyframes flash { 0% { opacity: 0; scale: .9; } 25% { opacity: 1; scale: 1; } 100% { opacity: 0; } }

/* subtitles we draw ourselves */
.subtext {
  position: absolute; left: 6%; right: 6%; bottom: 7%; z-index: 4; display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-align: center; pointer-events: none; transition: bottom .25s ease;
  font-weight: 600; line-height: 1.3; color: #fff;
  text-shadow: 0 0 4px #000, 0 1px 2px #000, 0 0 12px rgba(0,0,0,.9);
}
.stage.ui .subtext { bottom: calc(110px + var(--bottom)); }
.subtext .cue { white-space: pre-line; }
.subtext.size-s { font-size: clamp(14px, 2.2vw, 26px); }
.subtext.size-m { font-size: clamp(17px, 2.9vw, 36px); }
.subtext.size-l { font-size: clamp(21px, 3.8vw, 48px); }

/* next episode card */
.nextup {
  position: absolute; right: calc(20px + env(safe-area-inset-right)); bottom: calc(120px + var(--bottom)); z-index: 7;
  width: min(340px, 86vw); padding: 16px; border-radius: 10px; background: rgba(24,24,24,.94); box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.nulabel { display: block; font-size: 12px; color: var(--muted); }
.nextup strong { display: block; margin: 4px 0 12px; font-size: 16px; }
.nuactions { display: flex; gap: 8px; }
.nuactions .btn { flex: 1; height: 42px; padding: 0 12px; font-size: 15px; }

/* sheet tools for subtitles */
.subtools { padding: 4px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.subtool { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 15px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper .iconbtn { background: var(--s2); border-radius: 8px; padding: 8px; }
.stepper .step5 { background: var(--s2); border-radius: 8px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
#dVal { min-width: 72px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.subtool .seg { min-width: 220px; }
.rateitem .sdesc { display: flex; align-items: center; gap: 8px; margin: 0; }

/* progress bars */
.pbar-mini { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; height: 3px; background: rgba(255,255,255,.25); }
.pbar-mini i { display: block; height: 100%; background: var(--amber); }
.landscape .pbar-mini { left: 10px; right: 10px; bottom: 4px; border-radius: 2px; overflow: hidden; }
.lsname { bottom: 28px; }
.lssub { bottom: 11px; }

/* remote focus inside the player: same language as the rest of the app */
html.keys .controls .iconbtn:focus { background: #fff; color: #000; }
html.keys .seek:focus .strack { box-shadow: 0 0 0 3px rgba(255,255,255,.25); }
@media (prefers-reduced-motion: reduce) { .controls, .subtext { transition: none; } .seekflash.show { animation: none; opacity: 0; } }

/* full screen: the stage fills the screen */
.stage:fullscreen { width: 100vw; height: 100vh; }
.stage:-webkit-full-screen { width: 100vw; height: 100vh; }

.badge.lang { background: rgba(255,255,255,.1); color: #d8d8d8; }
.subtool > span { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.audioitem .sdesc { display: flex; align-items: center; gap: 8px; margin: 0; }

.ssrc .badge { margin-right: 6px; vertical-align: 1px; }

/* more like this */
#similar { padding-bottom: 28px; }
#similar .row { margin-top: 8px; }
.simhint { padding: 0 var(--gutter) 24px; display: flex; align-items: center; gap: 6px; }
.simhint a { color: var(--amber); text-decoration: underline; }

/* nothing behind the player or a sheet scrolls (and no scrollbar shows through) */
html:has(dialog[open]) { overflow: hidden; }
html:has(#player[open]) body { overflow: hidden; }
#player { overflow: hidden; scrollbar-width: none; }
#player::-webkit-scrollbar { display: none; }

/* ---------- series page: tabs and a calm section under the artwork ---------- */
.tsection { position: relative; z-index: 1; background: #000; padding-bottom: 24px; }
.tsection #eps { padding: 0 var(--gutter); }
.ttabs { display: flex; gap: 22px; padding: 4px var(--gutter) 0; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.ttab { display: inline-flex; align-items: center; gap: 7px; padding: 12px 0 10px; background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  color: var(--muted); font-size: 16px; font-weight: 700; }
.ttab.on { color: var(--text); border-bottom-color: var(--amber); }
.ttab .lucide { width: 18px; height: 18px; }
html.keys .ttab:focus { color: #fff; background: #232323; border-radius: 6px 6px 0 0; }
.tsection .epshead { border-top: 0; margin-top: 14px; padding-top: 0; }
.epshead .muted { color: #b9b9b3; font-size: 14px; }
.epleft { font-size: 12.5px; color: var(--amber); font-weight: 600; }
.tsection #similar .row { margin-top: 14px; }
@media (min-width: 900px) {
  .tbanner { height: 72vh; }
  .tbody { margin-top: -44vh; }
  .tlogo { max-height: 16vh; }
  .ttabs { gap: 30px; }
  .ttab { font-size: 18px; }
  .tsection #eps { max-width: 1180px; }
}

/* ---------- player turned sideways (iPhone and other phones that can't lock orientation) ---------- */
.stage.rot {
  position: fixed; inset: auto; top: 0; left: 0;
  width: 100vh; height: 100vw; width: 100dvh; height: 100dvw;
  transform-origin: top left; transform: rotate(90deg) translateY(-100%);
}
.stage.rot .ctop { padding-top: 10px; }
.stage.rot .cbottom { padding-bottom: 10px; }

.simgrid { padding: 14px var(--gutter) 0; }

/* ======================================================================
   Episode row (all sizes)
   ====================================================================== */
.eprail { grid-auto-columns: min(72vw, 300px); gap: 12px; padding-block: 4px 8px; }
.epcard { display: block; width: 100%; padding: 0; background: none; border: 0; text-align: left; color: var(--text); cursor: pointer; }
.epcard .epthumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: var(--s2); }
.epcard .epthumb img { width: 100%; height: 100%; object-fit: cover; transition: filter .2s; }
.epcard:not(.sel) .epthumb img { filter: brightness(.62); }
.epcard.sel .epthumb::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--amber); z-index: 2; }
.epcard .epplay { width: 40px; height: 40px; opacity: 0; transition: opacity .2s; }
.epcard.sel .epplay, .epcard:hover .epplay { opacity: 1; }
@media (hover: none) { .epcard .epplay { opacity: 1; } }
.epcard .eptext { display: flex; flex-direction: column; gap: 3px; margin-top: 8px; font-size: 14px; }
.epcard .eptext strong { font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.epcard.upcoming { cursor: default; }
.epcard.upcoming .epthumb, .epcard.upcoming strong { opacity: .55; }
.epdone { position: absolute; top: 6px; left: 6px; z-index: 2; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px;
  background: rgba(0,0,0,.7); font-size: 11px; font-weight: 700; color: #d6d6d6; }
.epcard.done .epthumb img { filter: brightness(.45) grayscale(.3); }
.epcard.done.sel .epthumb img { filter: none; }
.epline { margin: 2px 0 12px; font-size: 15px; color: #e6e6e6; }
.epline b { color: var(--amber); margin-right: 4px; }
.tbanner-bg { transition: opacity .3s ease; }
.tbanner-bg.swap { opacity: .35; }
/* remote / keyboard: the focused card lifts, like posters */
html.keys .epcard { transition: transform .2s cubic-bezier(.2,.8,.2,1); }
html.keys .epcard:focus { outline: none; transform: scale(1.06); z-index: 2; }
html.keys .epcard:focus .epthumb { box-shadow: 0 12px 30px rgba(0,0,0,.8); }
html.keys .eprail { padding-block: 16px; margin-block: -10px; }

/* ======================================================================
   Series on TV / computer: the whole page fits one screen, Netflix-TV style.
   Artwork fills the screen, details top-left, episodes along the bottom.
   ====================================================================== */
@media (min-width: 900px) {
  #view.is-series { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  .is-series .tbanner { position: absolute; inset: 0; height: auto; max-height: none; }
  .is-series .tbanner::after {
    background:
      linear-gradient(77deg, rgba(0,0,0,.9) 0%, rgba(0,0,0,.55) 38%, rgba(0,0,0,0) 65%),
      linear-gradient(to bottom, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 18%, rgba(0,0,0,0) 45%, rgba(0,0,0,.85) 72%, #000 100%);
  }
  .is-series .tbody { flex: 1; margin-top: 0; padding-top: calc(84px + var(--top)); padding-bottom: 12px; }
  .is-series .tlogo { max-height: 15vh; }
  .is-series .tdesc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 12px 0 8px; }
  .is-series .tsection { background: transparent; padding-bottom: 18px; }
  .is-series .ttabs { border-bottom-color: rgba(255,255,255,.12); }
  .is-series .tsection .epshead { margin-top: 10px; margin-bottom: 8px; }
  .is-series .tsection #eps { max-width: none; padding: 0; }
  .is-series .epshead { padding: 0 var(--gutter); }
  .is-series .eprail { grid-auto-columns: clamp(230px, 18vw, 340px); }
  .is-series #similar .simgrid { padding-top: 10px; }
  .is-series #similar .pgrid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (min-width: 900px) and (max-height: 760px) {
  .is-series .tlogo { max-height: 12vh; }
  .is-series .tcredits { display: none; }
  .is-series .tdesc { -webkit-line-clamp: 2; }
}
html.tv .is-series .tdesc { -webkit-line-clamp: 3; }
html.tv .is-series .eprail { grid-auto-columns: clamp(260px, 19vw, 380px); }
html.tv .epcard .eptext strong { font-size: 19px; }
html.tv .epline { font-size: 20px; }

/* full-HD artwork: keep it sharp, crossfade on change */
.tbanner-bg { image-rendering: auto; background-size: cover; }

/* sign-in: the lobby */
body.locked #tabs, body.locked #top { display: none; }
body.locked main { padding-top: 0 !important; }
.lobby { position: relative; min-height: 100vh; min-height: 100dvh; display: flex; align-items: flex-end; overflow: hidden; }
.lobby-bg { position: absolute; inset: 0; background: center / cover no-repeat; opacity: .55; }
.lobby-bg[data-empty] { opacity: 0; }
.lobby-bg.fadein { animation: lobbyIn .9s ease both; }
@keyframes lobbyIn { from { opacity: 0; } to { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .lobby-bg.fadein { animation-duration: .01s; } }
.lobby-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.2) 0%, #000 72%), linear-gradient(90deg, #000 0%, rgba(0,0,0,0) 70%); }
.lobby-form { position: relative; width: 100%; max-width: 400px; display: flex; flex-direction: column;
  padding: 0 var(--gutter) calc(32px + var(--bottom)); }
.lobby-mark { font-family: var(--marquee); font-weight: 900; text-transform: uppercase; color: var(--amber);
  font-size: clamp(64px, 19vw, 132px); line-height: .82; letter-spacing: .01em; margin: 0 0 14px -2px; }
.lobby-line { margin: 0 0 26px; font-size: 17px; color: #d2d2d2; }
.lobby-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 600; color: #bdbdbd; }
.lobby-field input { height: 50px; padding: 0 14px; font-size: 17px; color: #fff; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.16); border-radius: 6px; }
.lobby-field input:focus { outline: none; border-color: var(--amber); background: rgba(255,255,255,.1); }
.lobby-msg { min-height: 1.3em; margin: 0 0 10px; font-size: 14px; color: #ff8a80; }
@media (min-width: 900px) {
  .lobby { align-items: center; }
  .lobby-form { margin-left: clamp(40px, 8vw, 140px); padding-bottom: 0; }
  .lobby-bg::after { background: linear-gradient(90deg, #000 18%, rgba(0,0,0,.35) 65%, rgba(0,0,0,.6) 100%); }
}

/* title page: secondary actions */
.tminor { display: flex; gap: 28px; margin-top: 14px; }
.minor { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 64px; padding: 6px 4px;
  background: none; border: 0; color: #d6d6d6; font-size: 12px; font-weight: 600; cursor: pointer; }
.minor.on .lucide { color: var(--amber); }
.minor:active { transform: scale(.94); }
@media (min-width: 900px) { .tminor { margin-top: 18px; } .minor { font-size: 13px; } }
@media (prefers-reduced-motion: reduce) { .minor:active { transform: none; } }

/* settings: account */
.acct { gap: 14px; }
.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: var(--amber); color: #111; font-family: var(--marquee); font-weight: 900; font-size: 22px; }
.acct-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acct-name b { font-size: 17px; }
.acct-name small { font-size: 13px; color: var(--muted); }
.acct .textbtn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.pwbox > summary { list-style: none; box-shadow: inset 0 1px 0 var(--line); }
.pwbox > summary::-webkit-details-marker { display: none; }
.pwbox[open] > summary { color: var(--text); }
#pwForm input { width: 100%; background: var(--bg); }
.settings-page #pwForm > .primary { align-self: flex-start; background: var(--amber); color: #111; font-weight: 700; }

/* my kinovra */
.avatar.me-initial:empty::before { content: "?"; }
.tabavatar { width: 24px; height: 24px; font-size: 14px; border-radius: 6px; }
#tabs a.active .tabavatar { box-shadow: 0 0 0 2px var(--text); }
.melink { display: none; }
.avatar.xl { width: 64px; height: 64px; font-size: 34px; border-radius: 12px; }
.mepage { padding: 8px 0 24px; }
.mehead { display: flex; align-items: center; gap: 14px; padding: 6px var(--gutter) 18px; }
.mename { margin: 0; flex: 1; font-size: 26px; }
.megear { color: var(--text); }
.rowhead .count { color: var(--muted); font-weight: 600; margin-left: 6px; }
.empty { margin: 0; padding: 0 var(--gutter); color: var(--muted); font-size: 15px; line-height: 1.5; }
.empty .lucide { vertical-align: -3px; }
.page .empty { padding: 8px 0; }
@media (min-width: 900px) {
  .melink { display: inline-flex; margin-left: auto; border-radius: 8px; }
  .melink .avatar { width: 34px; height: 34px; font-size: 19px; border-radius: 8px; }
  .melink.active .avatar { box-shadow: 0 0 0 2px #fff; }
  .mepage { padding-top: 12px; }
}
html.keys .melink:focus .avatar { box-shadow: 0 0 0 3px var(--amber); }

/* ---------- netflix-style home ---------- */
.wide-only { display: none !important; }
.hero-poster { display: none; }
#heroList.on .lucide { color: var(--amber); }
/* phone: the billboard is a poster card */
@media (max-width: 899px) {
  .hero { height: auto; min-height: 0; margin: calc(64px + var(--top)) var(--gutter) 0; aspect-ratio: 2 / 2.75; border-radius: 12px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 18px 40px rgba(0,0,0,.6); }
  .hero-bg { display: none; }
  .hero-poster { display: block; position: absolute; inset: 0; background: center / cover no-repeat var(--s1);
    opacity: 0; transition: opacity .6s ease; }
  .hero.ready .hero-poster { opacity: 1; }
  .hero::after { background: linear-gradient(to bottom, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 68%, rgba(0,0,0,.92) 100%); }
  .hero-body { bottom: 16px; }
  .hero-logo, .hero-body .marquee { display: none; }   /* the poster art already carries the title */
  .hero-tags { margin: 10px 0 14px; }
  .hero-actions { width: 100%; }
  .hero-actions .btn { flex: 1; min-width: 0; }
  .hero + .row { margin-top: 22px; }
}
@media (min-width: 900px) { .wide-only { display: inline-flex !important; } .phone-only { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .hero-poster { transition: none; } }

/* Top 10 */
.rail.t10 { grid-auto-columns: auto; gap: 4px; }
.t10item { display: flex; align-items: flex-end; height: calc(min(29vw, 150px) * 1.5); }
.t10n { flex: none; font-family: var(--marquee); font-weight: 900; line-height: .74; letter-spacing: -.04em;
  font-size: calc(min(29vw, 150px) * 1.12); color: #000; -webkit-text-stroke: 2px var(--amber); paint-order: stroke fill;
  margin-right: -14px; position: relative; z-index: 0; user-select: none; }
.t10item img { position: relative; z-index: 1; height: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 6px; background: var(--s1); }
@media (min-width: 900px) {
  .t10item { height: calc(clamp(150px, 12.5vw, 250px) * 1.5); }
  .t10n { font-size: calc(clamp(150px, 12.5vw, 250px) * 1.12); -webkit-text-stroke-width: 3px; margin-right: -30px; }
  .rail.t10 { gap: 4px; }
}
html.keys .t10item:focus img { transform: scale(1.08); box-shadow: 0 10px 30px rgba(0,0,0,.7); }
html.keys .t10item:focus .t10n { color: var(--amber); }

/* ---------- episodes: list on phone / computer (Netflix app + web), row on TV ---------- */
.epsyn { display: none; }
html:not(.wideeps) .eprail { display: flex; flex-direction: column; gap: 22px; overflow: visible; scroll-snap-type: none; padding: 2px 0 8px; }
html:not(.wideeps) .epcard { display: grid; grid-template-columns: minmax(128px, 42%) 1fr; gap: 10px 12px; align-items: center; }
html:not(.wideeps) .epcard .eptext { margin-top: 0; }
html:not(.wideeps) .epcard:not(.sel) .epthumb img { filter: none; }
html:not(.wideeps) .epcard.sel .epthumb::after { display: none; }
html:not(.wideeps) .epcard.sel .eptext strong { color: var(--amber); }
html:not(.wideeps) .epsyn { display: -webkit-box; grid-column: 1 / -1; font-size: 13.5px; line-height: 1.45; color: #a9a9a9;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
html:not(.wideeps) .epcard.upcoming .epsyn { opacity: .7; }
@media (min-width: 900px) {
  html:not(.wideeps) .eprail { max-width: 980px; gap: 0; }
  html:not(.wideeps) .epcard { grid-template-columns: 220px 1fr; grid-template-rows: auto 1fr; gap: 4px 20px; align-items: start;
    padding: 18px 12px; border-bottom: 1px solid var(--line); border-radius: 6px; }
  html:not(.wideeps) .epcard .epthumb { grid-row: 1 / span 2; }
  html:not(.wideeps) .epcard .eptext { padding-top: 6px; flex-direction: row; justify-content: space-between; gap: 16px; }
  html:not(.wideeps) .epsyn { grid-column: 2; }
  html:not(.wideeps) .epcard:hover { background: var(--s1); }
}
@media (min-width: 900px) {
  /* computer (not TV): artwork fills the first screen only; the episode list sits on black (Netflix web) */
  html:not(.wideeps) .is-series .tbanner { bottom: auto; height: 100vh; height: 100dvh; }
  html:not(.wideeps) .is-series .tsection { background: linear-gradient(to bottom, rgba(0,0,0,0) 0, #000 160px); padding-top: 8px; }
  html:not(.wideeps) .is-series .tsection .eprail { padding-inline: var(--gutter); }
}
/* every page fills at least the screen: iOS home-screen apps shrink the viewport (and lift the tab bar) on short pages */
#view { min-height: 100vh; min-height: 100lvh; }

/* in-player subtitle timing */
.subsync { position: absolute; z-index: 6; right: calc(14px + env(safe-area-inset-right)); bottom: calc(118px + var(--bottom)); display: flex; align-items: center; gap: 2px; width: max-content; max-width: calc(100% - 28px); padding: 3px;
  background: rgba(20,20,20,.78); border: 1px solid rgba(255,255,255,.14); border-radius: 999px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.subsync[hidden] { display: none; }
.sslabel { display: inline-flex; align-items: center; gap: 6px; padding: 0 8px 0 10px; font-size: 13px; font-weight: 600; color: #cfcfcf; }
.sslabel .lucide { width: 16px; height: 16px; }
.ssbtn { width: 38px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 999px; background: rgba(255,255,255,.1); color: #fff; touch-action: manipulation; }
.ssbtn .lucide { width: 18px; height: 18px; }
.ssbtn:active { background: rgba(255,255,255,.25); }
.ssval { min-width: 66px; height: 34px; border: 0; background: none; color: #fff; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ssval.moved { color: var(--amber); }
html.keys .ssbtn:focus, html.keys .ssval:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
@media (min-width: 900px) { .sslabel { font-size: 14px; } .ssbtn { width: 42px; height: 36px; } }
.ssbtn.txt { width: 40px; font-size: 13px; font-weight: 700; }
.ssbtn.close { background: none; color: #cfcfcf; margin-left: 2px; }
@media (max-width: 420px) { .sslabel { display: none; } .ssbtn { width: 34px; } .ssbtn.txt { width: 36px; } .ssval { min-width: 58px; } }
/* keep the picture clear of the Dynamic Island / notch (the black margins beside it stay empty, like Netflix) */
#video { top: env(safe-area-inset-top); left: env(safe-area-inset-left); right: auto; bottom: auto;
  width: calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right)); height: calc(100% - env(safe-area-inset-top)); }
/* turned player: leave the status-bar / Dynamic Island strip and the home-indicator strip empty
   (they end up as black margins beside the picture, like YouTube), and fill the rest */
.stage.rot {
  top: env(safe-area-inset-top);
  width: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  width: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}
.stage.rot #video { top: 0; left: 0; width: 100%; height: 100%; }
.stage.rot .ctop { padding-left: 12px; padding-right: 12px; }
.stage.rot .cbottom { padding-left: 16px; padding-right: 16px; }
/* subtitles drawn by the system (Apple's full-screen player): no black box, outlined text — iOS may still use its own caption style */
#video::cue { background: transparent; background-color: rgba(0,0,0,0); color: #fff;
  text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000, 0 0 6px rgba(0,0,0,.8); }

/* Continue watching ⋮ */
.cwcard { position: relative; }
.cwmore { position: absolute; top: 4px; right: 4px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; }
html.keys .cwmore:focus { outline: 2px solid var(--amber); }
/* New episodes */
.newtag { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 3px 7px; border-radius: 4px; background: var(--amber); color: #111; font-size: 11.5px; font-weight: 800; }
/* Trailer */
.trailerdlg { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; }
.trailerdlg::backdrop { background: #000; }
.trframe { position: absolute; inset: 0; display: grid; place-items: center; padding: calc(56px + var(--top)) env(safe-area-inset-right) var(--bottom) env(safe-area-inset-left); }
.trframe iframe { width: 100%; aspect-ratio: 16 / 9; max-height: 100%; border: 0; }
.trclose { position: absolute; z-index: 2; top: calc(8px + var(--top)); right: calc(8px + env(safe-area-inset-right)); color: #fff; }
/* Skip intro / recap */
.skipbtn { position: absolute; z-index: 7; right: calc(20px + env(safe-area-inset-right)); bottom: calc(170px + var(--bottom));
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.55); background: rgba(20,20,20,.72); color: #fff; font-size: 15px; font-weight: 700;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.skipbtn[hidden] { display: none; }
html.keys .skipbtn:focus { background: #fff; color: #000; outline: none; }
.stage.rot .skipbtn { bottom: 150px; }

/* ---------- player header ---------- */
.ctop { align-items: center; gap: 4px; }
#closePlayer { flex: none; width: 44px; height: 44px; }
html:not(.keys) #controls .iconbtn:focus-visible, html:not(.keys) #closePlayer:focus { outline: none; box-shadow: none; }
.ptitle { padding-top: 0; gap: 2px; }
.ptitle strong { font-size: 17px; line-height: 1.2; font-weight: 700; letter-spacing: .005em; }
.psubrow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.psubrow #playerSub { min-width: 0; font-size: 14px; color: #c9c9c9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psubrow #playerSub:empty { display: none; }
.pq { flex: none; font-family: var(--marquee); font-weight: 900; font-size: 13px; line-height: 1; letter-spacing: .04em;
  color: var(--amber); padding: 3px 5px 2px; border: 1px solid rgba(243,179,61,.7); border-radius: 3px; }
.pq[hidden] { display: none; }
#playerHint:empty { display: none; }
.nowplaying { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; font-size: 13.5px; line-height: 1.4; color: #cfcfcf; }
.nowplaying .lucide { flex: none; margin-top: 2px; color: var(--amber); }
@media (min-width: 900px) { .ptitle strong { font-size: 20px; } .psubrow #playerSub { font-size: 15px; } .pq { font-size: 14px; } }
html.tv .ptitle strong { font-size: 26px; } html.tv .psubrow #playerSub { font-size: 19px; } html.tv .pq { font-size: 17px; }

/* ---------- cast (Netflix: a text line + an info sheet) ---------- */
.tcredits a { color: inherit; text-decoration: none; }
.tcredits a:hover, html.keys .tcredits a:focus { text-decoration: underline; }
.morelink { background: none; border: 0; padding: 0; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.infosheet h3 { margin: 6px 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
.infosheet h3:not(:first-child) { margin-top: 18px; }
.infosheet p { margin: 0; font-size: 15px; line-height: 1.5; }
.castlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.castlist li { display: flex; flex-direction: column; gap: 1px; }
.castlist a { color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; }
.castlist span { color: var(--muted); font-size: 13.5px; }
/* person page: small photo + name, then their titles */
.phead { display: flex; align-items: center; gap: 14px; margin: 4px 0 20px; }
.pphoto { position: relative; flex: none; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--s2); display: grid; place-items: center; }
.pphoto img { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; object-position: center top; }
.pphoto b { font-family: var(--marquee); font-size: 24px; color: #9a9a9a; }
.pinfo { min-width: 0; }
.personpage .pagetitle { margin: 0; }
.plife { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
@media (min-width: 900px) { .pphoto { width: 84px; height: 84px; } .phead { gap: 20px; } }
/* touch: no keyboard-focus outlines when a sheet/dialog focuses its first button (remote / keyboard keep them) */
html:not(.keys) dialog :focus-visible { outline: none; box-shadow: none; }

/* ---------- launch splash ---------- */
#splash { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: #000; pointer-events: none; }
#splash img { width: min(46vw, 260px); height: auto; opacity: 0; }
#splash.play img { animation: k-lamp 1.25s cubic-bezier(.2,.7,.2,1) forwards, k-zoom .55s cubic-bezier(.6,0,.9,.4) 1.25s forwards; }
#splash.play { animation: splash-out .45s ease-in 1.4s forwards; }
#splash.quick img { animation: splash-in .25s ease-out forwards; }
#splash.quick { animation: splash-out .3s ease-in .35s forwards; }
/* lamp warming up: two quick flickers, then steady with a warm glow */
@keyframes k-lamp {
  0%   { opacity: 0;   transform: scale(.86); filter: brightness(.6) drop-shadow(0 0 0 rgba(243,179,61,0)); }
  12%  { opacity: .9;  filter: brightness(1.15) drop-shadow(0 0 22px rgba(243,179,61,.55)); }
  18%  { opacity: .25; }
  26%  { opacity: 1;   filter: brightness(1.25) drop-shadow(0 0 34px rgba(243,179,61,.7)); }
  32%  { opacity: .55; }
  42%  { opacity: 1;   transform: scale(.94); filter: brightness(1.1) drop-shadow(0 0 40px rgba(243,179,61,.6)); }
  100% { opacity: 1;   transform: scale(1);   filter: brightness(1) drop-shadow(0 0 28px rgba(243,179,61,.45)); }
}
/* into the screen */
@keyframes k-zoom { to { opacity: 0; transform: scale(7); filter: brightness(1.6) blur(2px) drop-shadow(0 0 60px rgba(243,179,61,.8)); } }
@keyframes splash-in { to { opacity: 1; } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
/* splash v2: the full wordmark — projector light sweeps it on left to right, a warm glow, then it zooms into the app */
#splash img { width: min(80vw, 560px); }
#splash.play img {
  -webkit-mask-image: linear-gradient(90deg, #000 42%, rgba(0,0,0,.35) 48%, transparent 56%); mask-image: linear-gradient(90deg, #000 42%, rgba(0,0,0,.35) 48%, transparent 56%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  animation: w-sweep .95s cubic-bezier(.45,.05,.3,1) forwards, w-glow .5s ease-out .9s forwards, w-zoom .6s cubic-bezier(.6,0,.9,.4) 1.35s forwards;
}
#splash.play { animation: splash-out .45s ease-in 1.6s forwards; }
@keyframes w-sweep {
  0%   { opacity: 1; -webkit-mask-position: 100% 0; mask-position: 100% 0; filter: brightness(1.5) drop-shadow(0 0 18px rgba(243,179,61,.7)); }
  100% { opacity: 1; -webkit-mask-position: 0% 0; mask-position: 0% 0; filter: brightness(1.15) drop-shadow(0 0 26px rgba(243,179,61,.55)); }
}
@keyframes w-glow {
  0%   { opacity: 1; -webkit-mask-position: 0% 0; mask-position: 0% 0; filter: brightness(1.15) drop-shadow(0 0 26px rgba(243,179,61,.55)); }
  40%  { opacity: 1; -webkit-mask-position: 0% 0; mask-position: 0% 0; filter: brightness(1.35) drop-shadow(0 0 44px rgba(243,179,61,.75)); }
  100% { opacity: 1; -webkit-mask-position: 0% 0; mask-position: 0% 0; filter: brightness(1) drop-shadow(0 0 30px rgba(243,179,61,.5)); }
}
@keyframes w-zoom { from { opacity: 1; -webkit-mask-position: 0% 0; mask-position: 0% 0; } to { opacity: 0; -webkit-mask-position: 0% 0; mask-position: 0% 0; transform: scale(5); filter: brightness(1.6) blur(3px) drop-shadow(0 0 60px rgba(243,179,61,.8)); } }
/* splash v3: the light sweeps across a padded frame (room for the glow, no hard edge); the glow sits on the logo itself */
#splash.play img { -webkit-mask-image: none; mask-image: none; opacity: 1; animation: w-lamp 1.35s ease-out forwards; }
#splash .sw { padding: 60px; opacity: 0; }
#splash.play .sw {
  -webkit-mask-image: linear-gradient(90deg, #000 40%, rgba(0,0,0,.4) 47%, transparent 55%); mask-image: linear-gradient(90deg, #000 40%, rgba(0,0,0,.4) 47%, transparent 55%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  animation: sw-sweep .95s cubic-bezier(.45,.05,.3,1) forwards, sw-zoom .6s cubic-bezier(.6,0,.9,.4) 1.35s forwards;
}
#splash.quick .sw { opacity: 1; }
@keyframes sw-sweep { from { opacity: 1; -webkit-mask-position: 100% 0; mask-position: 100% 0; } to { opacity: 1; -webkit-mask-position: 0% 0; mask-position: 0% 0; } }
@keyframes sw-zoom { from { opacity: 1; -webkit-mask-position: 0% 0; mask-position: 0% 0; } to { opacity: 0; -webkit-mask-position: 0% 0; mask-position: 0% 0; transform: scale(5); } }
@keyframes w-lamp {
  0%   { filter: brightness(1.12) drop-shadow(0 0 16px rgba(243,179,61,.6)); }
  70%  { filter: brightness(1.12) drop-shadow(0 0 30px rgba(243,179,61,.65)); }
  85%  { filter: brightness(1.2) drop-shadow(0 0 42px rgba(243,179,61,.75)); }
  100% { filter: brightness(1) drop-shadow(0 0 28px rgba(243,179,61,.5)); }
}
@media (prefers-reduced-motion: reduce) { #splash .sw { opacity: 1; } }
#splash img { width: min(72vw, 520px); }
#splash .sw { padding: 44px 30px; }
/* glow kept inside the frame; colour stays true amber */
@keyframes w-lamp2 {
  0%   { filter: drop-shadow(0 0 10px rgba(243,179,61,.55)); }
  70%  { filter: drop-shadow(0 0 16px rgba(243,179,61,.6)); }
  85%  { filter: brightness(1.06) drop-shadow(0 0 22px rgba(243,179,61,.7)); }
  100% { filter: drop-shadow(0 0 14px rgba(243,179,61,.5)); }
}
#splash.play img { animation: w-lamp2 1.35s ease-out forwards; }

/* ---------- cast faces row (back by request) + genre badges ---------- */
.castrow { margin-top: 10px; }
.castmore { background: none; border: 0; color: var(--text); cursor: pointer; font: inherit; font-size: 18px; font-weight: 700; }
.rail.cast { grid-auto-columns: 92px; gap: 12px; scroll-snap-type: x proximity; padding-block: 6px; }
.castitem { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.castph { position: relative; width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: var(--s2); display: grid; place-items: center; flex: none; }
.castph img { position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: cover; object-position: center top; }
.castph b { font-family: var(--marquee); font-size: 26px; color: #9a9a9a; }
.castname { font-size: 13px; font-weight: 600; line-height: 1.25; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.castchar { font-size: 12px; color: var(--muted); line-height: 1.25; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.keys .castitem:focus .castph { box-shadow: 0 0 0 3px var(--amber); }
@media (min-width: 900px) { .rail.cast { grid-auto-columns: 116px; gap: 16px; } .castph { width: 104px; height: 104px; } .castname { font-size: 14px; } .castmore { font-size: 21px; } }
.gbadges { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 2px; }
.gbadge { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06); color: #e6e6e6; font-size: 13px; font-weight: 600; text-decoration: none; }
.gbadge .lucide { color: var(--amber); }
.gbadge:active { background: rgba(255,255,255,.14); }
html.keys .gbadge:focus { border-color: var(--amber); outline: none; }
@media (min-width: 900px) { .gbadge { height: 32px; font-size: 14px; } }

/* ---------- TV title page, Netflix TV style ---------- */
.stabs { display: none; }
.epnum { display: none; }
html.tv .seasonpick { display: none; }
html.tv .stabs { display: flex; gap: 28px; }
html.tv .stab { background: none; border: 0; padding: 6px 0; color: #9d9d9d; font: inherit; font-size: 22px; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; }
html.tv .stab.on { color: #fff; border-bottom-color: var(--amber); }
html.tv .stab:focus { outline: none; color: #fff; text-decoration: underline; text-decoration-color: var(--amber); text-underline-offset: 8px; }
/* the row sits right under the info, fully on screen */
html.tv .is-series .tbody { flex: none; padding-bottom: 6px; }
html.tv .is-series .tdesc { -webkit-line-clamp: 2; }
html.tv .is-series .tsection { margin-top: 4px; }
/* cards: picture, amber "Episode N", title, short synopsis */
html.tv .epcard .epnum { display: block; font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); margin-top: 10px; }
html.tv .epcard .epn { display: none; }
html.tv .epcard .eptext { margin-top: 2px; }
html.tv .epcard .eptext strong { font-size: 20px; -webkit-line-clamp: 1; }
html.tv .epcard .epsyn { display: -webkit-box; margin-top: 6px; font-size: 15px; line-height: 1.4; color: #b3b3b3; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
html.tv .is-series .eprail { grid-auto-columns: clamp(300px, 21vw, 400px); gap: 18px; padding-bottom: 24px; }
html.tv #castpane .castrow { margin-top: 18px; }
html.tv .epcard .epsyn { -webkit-line-clamp: 2; }
html.tv .is-series .eprail { grid-auto-columns: clamp(280px, 19.5vw, 380px); }
/* ---------- TV title page: sized for the sofa (10-foot) ---------- */
html.tv .tfacts { font-size: 22px; }
html.tv .epline { font-size: 22px; }
html.tv .tminor { gap: 36px; margin-top: 18px; }
html.tv .minor { font-size: 17px; gap: 6px; min-width: 84px; }
html.tv .minor .lucide { width: 32px; height: 32px; }
html.tv .gbadges { gap: 12px; margin-top: 14px; }
html.tv .gbadge { height: 40px; padding: 0 16px 0 13px; font-size: 18px; gap: 8px; }
html.tv .gbadge .lucide { width: 19px; height: 19px; }
html.tv .ttabs { gap: 40px; }
html.tv .ttab { font-size: 24px; gap: 10px; }
html.tv .ttab .lucide { width: 24px; height: 24px; }
html.tv .stab { font-size: 24px; }
html.tv .epshead .muted { font-size: 18px; }
html.tv .epcard .epnum { font-size: 15px; }
html.tv .epcard .eptext strong { font-size: 22px; }
html.tv .epcard .eptext .muted, html.tv .epcard .epleft { font-size: 16px; }
html.tv .epcard .epsyn { font-size: 17px; }
/* Cast tab: the tab is the heading; big faces, close together */
html.tv #castpane .castmore { display: none; }
html.tv #castpane .castrow { margin-top: 26px; }
html.tv .rail.cast { grid-auto-columns: 196px; gap: 26px; padding-block: 8px 20px; }
html.tv .castph { width: 150px; height: 150px; }
html.tv .castname { font-size: 19px; }
html.tv .castchar { font-size: 16px; }
html.tv .castitem { gap: 10px; }
html.keys .castitem:focus .castph { box-shadow: 0 0 0 4px var(--amber); transform: scale(1.06); }
html.keys .castitem:focus .castname { color: var(--amber); }
html.tv .tactions .btn.wide { height: 60px; padding: 0 34px; font-size: 22px; gap: 12px; }
html.tv .tactions .btn .lucide, html.tv .tactions .btn svg { width: 26px; height: 26px; }
/* fit everything on one 1080p screen */
html.tv .is-series .tlogo { max-height: 12vh; }
html.tv .is-series .tbody { padding-top: calc(72px + var(--top)); }
html.tv .is-series .tminor { margin-top: 12px; }
html.tv .is-series .tdesc { margin: 10px 0 6px; }
html.tv .is-series .eprail { grid-auto-columns: clamp(260px, 17.5vw, 340px); }
html.tv .is-series .tsection .epshead { margin-top: 6px; margin-bottom: 10px; }
/* the cast row sits in front of the series backdrop (computer layout), like the info and tabs */
.castrow { position: relative; z-index: 1; }

/* ---------- computer (wide window): the same sideways episode row as TV, sized for a desk ---------- */
html.wideeps .seasonpick { display: none; }
html.wideeps .stabs { display: flex; gap: 26px; }
html.wideeps .stab { background: none; border: 0; padding: 6px 0; color: #9d9d9d; font: inherit; font-weight: 600; cursor: pointer; border-bottom: 3px solid transparent; }
html.wideeps .stab.on { color: #fff; border-bottom-color: var(--amber); }
html.wideeps .stab:hover { color: #fff; }
html.wideeps .epcard .epnum { display: block; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--amber); margin-top: 10px; }
html.wideeps .epcard .epn { display: none; }
html.wideeps .epcard .eptext { margin-top: 2px; }
html.wideeps .epcard .eptext strong { -webkit-line-clamp: 1; }
html.wideeps .epcard .epsyn { display: -webkit-box; margin-top: 6px; line-height: 1.4; color: #b3b3b3; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
html.wideeps .is-series .tbody { flex: none; padding-bottom: 6px; }
html.wideeps .is-series .tdesc { -webkit-line-clamp: 2; }
html.wideeps:not(.tv) .stab { font-size: 18px; }
html.wideeps:not(.tv) .epcard .epnum { font-size: 12.5px; }
html.wideeps:not(.tv) .epcard .eptext strong { font-size: 17px; }
html.wideeps:not(.tv) .epcard .epsyn { font-size: 14px; }
html.wideeps:not(.tv) .is-series .eprail { grid-auto-columns: clamp(240px, 19vw, 330px); gap: 14px; padding-bottom: 20px; }
html.wideeps:not(.tv) #castpane .castmore { display: none; }
/* wide screens: My List / Trailer as round icon buttons beside Play (Netflix web + TV) */
html.wideeps .tactions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
html.wideeps .tinfo .tminor { display: inline-flex; gap: 10px; margin: 0; vertical-align: middle; }
html.wideeps .minor { flex-direction: row; justify-content: center; width: 50px; height: 50px; min-width: 0; padding: 0; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55); background: rgba(30,30,30,.55); }
html.wideeps .minor span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html.wideeps .minor .lucide { width: 24px; height: 24px; }
html.wideeps .minor:hover { border-color: #fff; }
html.wideeps .minor.on { border-color: var(--amber); }
html.tv .minor { width: 60px; height: 60px; } html.tv .minor .lucide { width: 28px; height: 28px; }
html.keys .minor:focus { background: #fff; color: #000; border-color: #fff; outline: none; }
html.keys .minor.on:focus .lucide { color: #000; }
/* one row of actions on wide screens; season tabs keep their sizes */
html.wideeps .tinfo { width: min(820px, 60vw); }
html.wideeps .tactions { flex-wrap: nowrap; }
html.tv .stab { font-size: 24px; }
html.wideeps:not(.tv) .stab { font-size: 18px; }

/* Keep editable controls large enough to avoid iOS focus zoom. */
input, textarea, select { font-size: max(16px, 1em); }
