/* The player: one chrome for desktop, phone and TV. Kept apart from the rest
   of the stylesheet because it has its own tokens and its own rules. */
.player-modal .hidden { display:none; }
#subtitle-track { pointer-events:auto; max-width:150px; min-height:44px; border:1px solid rgb(255 255 255/.18); border-radius:10px; background:rgb(0 0 0/.55); color:#fff; font-size:13px; padding:6px 10px; }
.player-modal { position:fixed;z-index:100;inset:0;background:#050505;display:flex;align-items:center;justify-content:center;padding:var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l); }.player-modal video{width:100%;height:100%;min-height:0;object-fit:contain}.player-top{position:absolute;z-index:2;left:0;right:0;top:0;pointer-events:none;padding:calc(16px + var(--safe-t)) calc(20px + var(--safe-r)) 40px calc(20px + var(--safe-l));background:linear-gradient(#000c,transparent);display:flex;justify-content:space-between;align-items:start;gap:16px}.player-top div{display:flex;flex-direction:column;min-width:0}.player-top strong,.player-top span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.player-top span{font-size:12px;color:#aaa}
/* ── Player overlay, episode progress, empty states ────────────────────────── */
.player-top .icon-btn { pointer-events:auto; }
.player-top .player-top-actions { flex-direction:row;align-items:center;gap:8px;min-width:auto; }
#toggle-fullscreen svg { width:45%;height:45%;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.fs-exit { display:none; }
.player-modal.fullscreen .fs-enter { display:none; }
.player-modal.fullscreen .fs-exit { display:block; }
/* ── Player chrome tokens ───────────────────────────────────────────────────
   One layout for desktop, phone and TV; only these numbers change per
   breakpoint. --pc-hit is the invisible catch zone of the playbar — a jittery
   TV pointer needs a fat target far more than a fat line. */
.player-modal {
  --pc-btn:56px;          /* round buttons (arrows, ±30s) */
  --pc-btn-lg:78px;       /* the central play/pause */
  --pc-icon:25px; --pc-icon-lg:34px;
  --pc-gap:clamp(28px,7vw,72px);
  --pc-edge:16px;         /* edge distance of the episode arrows */
  --pc-bar:6px; --pc-bar-active:10px; --pc-thumb:18px; --pc-hit:48px;
  --pc-fade:.2s; --pc-quick:.15s;
  --pc-focus:3px;
  --pc-glass:rgb(0 0 0/.45); --pc-glass-hover:rgb(0 0 0/.72);
  --pc-line:rgb(255 255 255/.14); --pc-line-hover:rgb(255 255 255/.28);
}
@media (hover:none){.player-modal{--pc-btn:60px;--pc-btn-lg:82px}}
/* A phone in portrait is the one place the row can collide with the episode
   arrows at the edges, so everything steps down one size and moves closer. */
@media (max-width:520px){.player-modal{--pc-btn:48px;--pc-btn-lg:66px;--pc-icon:21px;--pc-icon-lg:28px;--pc-gap:14px}}
/* TV: watched from meters away, clicked with a trembling pointer remote. */
@media (min-width:1920px){.player-modal{--pc-btn:72px;--pc-btn-lg:104px;--pc-icon:32px;--pc-icon-lg:44px;--pc-edge:28px;--pc-bar:8px;--pc-bar-active:13px;--pc-thumb:24px;--pc-hit:64px;--pc-focus:4px}}

.player-modal :is(.icon-btn,.player-nav,.center-btn,.time-toggle,.playbar):focus-visible { outline:var(--pc-focus) solid var(--accent);outline-offset:3px; }
.player-top .icon-btn { width:44px;height:44px;min-width:44px;min-height:44px;flex-basis:44px;font-size:19px; }
@media (min-width:1920px){.player-top .icon-btn{width:56px;height:56px;min-width:56px;min-height:56px;flex-basis:56px;font-size:24px}}

/* ── Episode arrows ─────────────────────────────────────────────────────────
   Two edge targets, vertically centred. They live in the modal rather than
   the <video>, which is the whole reason fullscreen is taken on the modal. */
.player-nav { position:absolute;z-index:2;top:50%;translate:0 -50%;width:var(--pc-btn);height:var(--pc-btn);border-radius:50%;padding:0;cursor:pointer;display:grid;place-items:center;color:#fff;background:var(--pc-glass);border:1px solid var(--pc-line);backdrop-filter:blur(8px);transition:opacity var(--pc-fade) ease,background var(--pc-quick) ease,border-color var(--pc-quick) ease,transform var(--pc-quick) ease; }
.player-nav.prev { left:calc(var(--pc-edge) + var(--safe-l)); }
.player-nav.next { right:calc(var(--pc-edge) + var(--safe-r)); }
.player-nav svg { width:var(--pc-icon);height:var(--pc-icon);fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
/* A class-level display:grid outranks the UA rule behind the hidden attribute. */
.player-nav[hidden] { display:none; }
@media (hover:hover){.player-nav:hover{background:var(--pc-glass-hover);border-color:var(--pc-line-hover);transform:scale(1.06)}}

/* The episode title only on a deliberate hover — the arrow alone already says
   what the button does. */
.player-nav-label { position:absolute;top:50%;translate:0 -50%;max-width:min(260px,24vw);padding:7px 12px;border-radius:999px;font-size:13px;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:rgb(0 0 0/.62);border:1px solid var(--pc-line);backdrop-filter:blur(8px);opacity:0;pointer-events:none;transition:opacity var(--pc-quick) ease; }
.player-nav.prev .player-nav-label { left:calc(100% + 10px); }
.player-nav.next .player-nav-label { right:calc(100% + 10px); }
@media (hover:hover){.player-nav:hover .player-nav-label,.player-nav:focus-visible .player-nav-label{opacity:1}}
@media (hover:none){.player-nav-label{display:none}}

/* ── Center transport ───────────────────────────────────────────────────────
   Play/pause in the middle of the picture, ±30s on either side. The strip is
   click-through; only the round buttons themselves are targets, so a click on
   the empty space between them still reaches the video. */
.player-center { position:absolute;z-index:2;top:50%;left:50%;translate:-50% -50%;display:flex;align-items:center;gap:var(--pc-gap);pointer-events:none;transition:opacity var(--pc-fade) ease; }
.center-btn { pointer-events:auto;width:var(--pc-btn);height:var(--pc-btn);border-radius:50%;padding:0;cursor:pointer;display:grid;place-items:center;color:#fff;background:var(--pc-glass);border:1px solid var(--pc-line);backdrop-filter:blur(8px);transition:background var(--pc-quick) ease,border-color var(--pc-quick) ease,transform var(--pc-quick) ease; }
.center-btn svg { width:var(--pc-icon);height:var(--pc-icon);fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round; }
.center-btn text { stroke:none;fill:currentColor;font-size:7.5px;font-weight:700;text-anchor:middle;font-family:inherit;letter-spacing:-.3px; }
.center-btn.play-toggle { width:var(--pc-btn-lg);height:var(--pc-btn-lg); }
.center-btn.play-toggle svg { width:var(--pc-icon-lg);height:var(--pc-icon-lg);fill:currentColor;stroke:none; }
.play-toggle .pt-pause { display:none; }
.player-modal.playing .play-toggle .pt-play { display:none; }
.player-modal.playing .play-toggle .pt-pause { display:block; }
.center-btn:active { transform:scale(.94); }
@media (hover:hover){.center-btn:hover{background:var(--pc-glass-hover);border-color:var(--pc-line-hover);transform:scale(1.06)}}

/* ── Playbar and clock ──────────────────────────────────────────────────────
   The bar itself is thin; the .playbar box around it is the real target, at
   least --pc-hit tall, and grows the visible line under attention. The scrim
   beneath keeps white text and a thin line readable over a bright picture. */
.player-bottom { position:absolute;z-index:2;left:0;right:0;bottom:0;display:flex;align-items:center;gap:10px;padding:28px calc(20px + var(--safe-r)) calc(10px + var(--safe-b)) calc(20px + var(--safe-l));background:linear-gradient(transparent,rgb(0 0 0/.42) 45%,rgb(0 0 0/.78));transition:opacity var(--pc-fade) ease; }
.playbar { position:relative;flex:1;min-width:0;height:var(--pc-hit);display:flex;align-items:center;cursor:pointer;touch-action:none;border-radius:10px; }
.playbar-track { position:relative;width:100%;height:var(--pc-bar);border-radius:999px;background:rgb(255 255 255/.24);transition:height var(--pc-quick) ease; }
.playbar:hover .playbar-track,.playbar:focus-visible .playbar-track,.playbar.scrubbing .playbar-track { height:var(--pc-bar-active); }
.playbar-fill { position:absolute;left:0;top:0;bottom:0;width:0;border-radius:inherit;background:var(--accent); }
.playbar-thumb { position:absolute;top:50%;left:0;width:var(--pc-thumb);height:var(--pc-thumb);border-radius:50%;background:#fff;translate:-50% -50%;box-shadow:0 1px 6px rgb(0 0 0/.6);transition:transform var(--pc-quick) ease; }
.playbar:hover .playbar-thumb,.playbar.scrubbing .playbar-thumb { transform:scale(1.18); }
.playbar-tip { position:absolute;bottom:calc(50% + var(--pc-thumb) + 4px);left:0;translate:-50% 0;padding:5px 10px;border-radius:8px;font-size:12px;font-variant-numeric:tabular-nums;white-space:nowrap;color:#fff;background:rgb(0 0 0/.85);border:1px solid var(--pc-line);pointer-events:none; }
.time-toggle { flex:none;min-width:5.5ch;min-height:44px;border:0;border-radius:9px;padding:10px 12px;font-size:14px;font-variant-numeric:tabular-nums;text-align:right;color:#fff;background:none;cursor:pointer;transition:background var(--pc-quick) ease; }
.time-toggle:hover { background:rgb(255 255 255/.14); }
@media (min-width:1920px){.player-bottom{gap:16px;padding-inline:calc(32px + var(--safe-l)) calc(32px + var(--safe-r))}.playbar-tip{font-size:16px;padding:7px 13px}.time-toggle{font-size:20px;padding:12px 16px}}

/* Title bar, arrows, transport and playbar come and go as one: any sign of
   life brings them back; a paused or finished picture, a scrub in progress or
   a pointer resting on a control never let them leave. */
.player-top { transition:opacity var(--pc-fade) ease; }
.player-modal.idle { cursor:none; }
.player-modal.idle :is(.player-top,.player-nav,.player-center,.center-btn,.player-bottom,.playbar) { opacity:0;pointer-events:none; }
@media(max-width:520px){ #subtitle-track{max-width:100px} }
.player-note { position:absolute;z-index:4;left:50%;translate:-50% 0;top:calc(72px + var(--safe-t));width:min(520px,calc(100% - 32px));display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:14px;font-size:13px;line-height:1.45;color:#fff;background:rgb(0 0 0/.78);border:1px solid rgb(255 255 255/.14);backdrop-filter:blur(8px);box-shadow:0 18px 50px rgb(0 0 0/.5);cursor:pointer;animation:dialog-in .16s ease-out; }
.player-note b { display:block;margin-bottom:2px; }
.player-note span { color:var(--fg-muted); }
.player-overlay { position:absolute;z-index:3;inset:0;display:grid;place-items:center;background:rgb(0 0 0/.72);backdrop-filter:blur(6px);padding:calc(20px + var(--safe-t)) calc(20px + var(--safe-r)) calc(20px + var(--safe-b)) calc(20px + var(--safe-l)); }
.overlay-card { width:min(420px,100%);display:flex;flex-direction:column;gap:10px;align-items:start;text-align:left;background:var(--bg-elevated);border:1px solid var(--border);border-radius:18px;padding:24px;box-shadow:0 24px 80px rgb(0 0 0/.55);animation:dialog-in .16s ease-out; }
.overlay-card strong { font-size:20px;letter-spacing:-.02em;line-height:1.2; }
.overlay-card p { color:var(--fg-muted);font-size:14px; }

/* ── Television ─────────────────────────────────────────────────────────────
   While the picture is on the television, the phone shows the title's
   backdrop, where it plays, and the way back — between the same controls. */
.player-top .cast-btn .icon { width:22px;height:22px; }
.player-top .cast-btn.on { color:var(--amber);background:rgb(255 181 71/.14);border-color:rgb(255 181 71/.35); }
.cast-btn[hidden] { display:none; }
.player-modal.casting video { visibility:hidden; }
.cast-stage { position:absolute;z-index:1;inset:0;overflow:hidden;background:hsl(var(--hue,215) 30% 10%); }
.cast-stage[hidden] { display:none; }
.cast-art { position:absolute;inset:0;background:linear-gradient(160deg,hsl(var(--hue,215) 40% 22%),hsl(calc(var(--hue,215) + 40) 35% 8%)); }
.cast-art img { width:100%;height:100%;object-fit:cover;filter:blur(28px) saturate(1.3) brightness(.42);transform:scale(1.15); }
.cast-art::after { content:"";position:absolute;inset:0;background:radial-gradient(70% 55% at 50% 45%,transparent,rgb(0 0 0/.55)); }
.cast-copy { position:absolute;left:50%;top:calc(50% - var(--pc-btn-lg) / 2 - 32px);translate:-50% -100%;width:min(440px,calc(100% - 40px));display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;color:#fff; }
.cast-badge { display:grid;place-items:center;width:60px;height:60px;margin-bottom:8px;border-radius:50%;color:var(--amber);background:rgb(255 181 71/.12);box-shadow:0 0 0 1px rgb(255 181 71/.3),0 0 40px rgb(255 181 71/.18); }
.cast-badge .icon { width:28px;height:28px; }
.cast-copy strong { font-size:20px;line-height:1.25;text-wrap:balance; }
.cast-copy small { font-size:14px;color:rgb(255 255 255/.68); }
.cast-leave { position:absolute;left:50%;top:calc(50% + var(--pc-btn-lg) / 2 + 32px);translate:-50% 0;z-index:2;min-height:44px;padding:0 20px;border-radius:999px;border:1px solid rgb(255 255 255/.24);background:rgb(255 255 255/.08);color:#fff;font:600 15px/1 var(--body);white-space:nowrap;backdrop-filter:blur(8px);cursor:pointer;transition:background var(--pc-quick) ease; }
.cast-leave:hover { background:rgb(255 255 255/.16); }
.cast-leave:focus-visible { outline:var(--pc-focus) solid var(--accent);outline-offset:3px; }
@media (max-height:520px) {
  .cast-badge { display:none; }
  .cast-copy small { display:none; }
  .cast-copy { top:calc(50% - var(--pc-btn-lg) / 2 - 18px); }
  .cast-leave { top:calc(50% + var(--pc-btn-lg) / 2 + 14px); }
}
.player-note[data-loading] { cursor:default; flex-wrap:wrap; }
.player-note[data-loading] > div { flex:1; min-width:160px; }
