@view-transition { navigation: auto; }
/* --tint is the main colour of the current series' cover ("r g b"); registered so it can animate. */
@property --tint { syntax: '<number>+'; inherits: true; initial-value: 255 77 125; }
html, .hero { transition: --tint 0.9s ease; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.16s; }

:root {
  --bg: #0b0b0f;
  --panel: #15151b;
  --panel-2: #1e1e26;
  --line: #2a2a34;
  --text: #f2f2f6;
  --muted: #9b9ba8;
  --accent: #ff4d7d;
  --accent-2: #ff8a5c;
  --violet: #8b5cf6;
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --glow: 0 8px 28px rgb(var(--tint) / 0.38);
  --ok: #3ccf8e;
  --warn: #f5b548;
  --bad: #ff6b6b;
  --radius: 14px;
  color-scheme: dark;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { -webkit-font-smoothing: antialiased; min-height: 100dvh; }
body:not(.watch):not(.bare) {
  background:
    radial-gradient(1000px 520px at 10% -8%, rgb(var(--tint) / 0.17), transparent 62%),
    radial-gradient(820px 480px at 94% 2%, rgb(139 92 246 / 0.13), transparent 62%),
    radial-gradient(760px 520px at 55% 112%, rgb(255 138 92 / 0.08), transparent 62%),
    var(--bg);
  background-attachment: fixed;
}
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0 0 6px; line-height: 1.15; }
h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 10px; }
img { display: block; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }
kbd { font: inherit; font-size: 0.75rem; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--panel-2); margin: 0 1px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; transition: transform 0.12s, background 0.15s, border-color 0.15s, filter 0.15s; }
.btn:hover { border-color: #46465a; background: #272733; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn.primary:hover { filter: brightness(1.1) saturate(1.1); box-shadow: 0 10px 34px rgb(var(--tint) / 0.5); }
.btn.ghost { background: transparent; }
.pill { padding: 6px 14px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); font-weight: 600; font-size: 0.85rem; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0; }
.row.center { justify-content: center; }

/* shell */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 24px; background: rgba(11, 11, 15, 0.78); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); border-bottom: 1px solid rgba(255, 255, 255, 0.06); }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.01em; }
.brand.big { font-size: 1.6rem; justify-content: center; margin-bottom: 18px; }
.brand-mark { width: 13px; height: 22px; border-radius: 3px; background: linear-gradient(160deg, var(--accent), var(--accent-2)); box-shadow: 0 0 18px rgba(255, 77, 125, 0.5); }
.search { position: relative; flex: 1; max-width: 460px; margin-left: auto; display: flex; align-items: center; }
.search svg { position: absolute; left: 13px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 9px 38px 9px 38px; transition: border-color 0.15s, background 0.15s; -webkit-appearance: none; appearance: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search input:focus { outline: none; border-color: var(--accent); background: var(--panel-2); }
.search-hint { position: absolute; right: 12px; color: var(--muted); pointer-events: none; }
.search input:focus ~ .search-hint { display: none; }
.suggest { position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6); max-height: 70vh; overflow: auto; }
.suggest[hidden] { display: none; }
.sg { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 10px; }
.sg:hover, .sg.on { background: var(--panel-2); }
.sg img, .sg .sg-blank { width: 34px; height: 46px; border-radius: 6px; object-fit: cover; background: var(--panel-2); flex: none; }
.sg b { display: block; font-weight: 650; }
.sg-empty { padding: 14px; color: var(--muted); text-align: center; }
.content { max-width: 1240px; margin: 0 auto; padding: 22px 24px 60px; }
.foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 24px; opacity: 0.6; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 14px; }
.section-head h2 { display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ''; width: 4px; height: 1.05em; border-radius: 3px; background: var(--grad); }
.back { display: inline-flex; gap: 6px; color: var(--muted); margin-bottom: 14px; min-width: 0; }
.back:hover { color: var(--text); }
.notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 12px; background: rgba(245, 181, 72, 0.1); border: 1px solid rgba(245, 181, 72, 0.35); color: var(--warn); }
.empty { text-align: center; padding: 80px 16px; max-width: 460px; margin: 0 auto; }
.empty.full { padding-top: 18vh; }

/* hero */
.hero { position: relative; border-radius: 26px; overflow: hidden; margin: 4px 0 8px; border: 1px solid rgb(var(--tint) / 0.28); box-shadow: 0 30px 80px -34px rgb(var(--tint) / 0.55); isolation: isolate; }
.hero-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(46px) saturate(1.5); opacity: 0.38; z-index: -1; transform: scale(1.1); }
.hero-body { display: flex; gap: 28px; align-items: flex-end; padding: 28px; }
.hero-poster { width: 170px; flex: none; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); }
.hero-text { min-width: 0; max-width: 640px; }
.eyebrow { display: inline-block; padding: 3px 11px; border-radius: 999px; background: rgb(var(--tint) / 0.18); border: 1px solid rgb(var(--tint) / 0.35); color: #fff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.desc { color: #cfcfda; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.series-hero { position: relative; isolation: isolate; overflow: hidden; display: flex; gap: 26px; align-items: flex-end; margin-bottom: 26px; padding: 26px; border-radius: 26px; border: 1px solid rgb(var(--tint) / 0.25); box-shadow: 0 30px 80px -34px rgb(var(--tint) / 0.5); }
.series-hero .desc { -webkit-line-clamp: 6; max-width: 70ch; }

/* posters and cards */
.poster { position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: linear-gradient(110deg, var(--panel-2) 8%, #272733 18%, var(--panel-2) 33%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border: 1px solid rgba(255, 255, 255, 0.07); }
.poster img { width: 100%; height: 100%; object-fit: cover; position: relative; background: var(--panel-2); transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.poster-blank { position: relative; width: 100%; height: 100%; display: grid; place-items: center; font-size: 3rem; font-weight: 800; color: var(--muted); background: var(--panel-2); }
@keyframes shimmer { to { background-position-x: -200%; } }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 22px 18px; }
.card { display: block; transition: transform 0.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
.card:hover { transform: translateY(-5px); }
.card:hover .poster img { transform: scale(1.05); }
.card:hover .poster { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 77, 125, 0.35); }
.card:active { transform: scale(0.98); }
.card-title { margin-top: 10px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { position: absolute; left: 8px; bottom: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(6px); font-size: 0.75rem; font-weight: 700; }
.count i { font-style: normal; opacity: 0.6; }
.prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.2); }
.prog[hidden] { display: none; }
.prog i { display: block; height: 100%; background: var(--grad); }
.chips, .tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.chip { padding: 5px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; font-weight: 600; text-transform: capitalize; transition: all 0.15s; }
.chip:hover { color: var(--text); border-color: #46465a; }
.chip.on { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 16px rgb(var(--tint) / 0.3); }
.rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; padding-bottom: 8px; scrollbar-width: thin; }
.rail .card { flex: 0 0 150px; scroll-snap-align: start; }
.continue[hidden] { display: none; }

/* episodes */
.episodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.ep { display: block; transition: transform 0.18s; }
a.ep:hover { transform: translateY(-4px); }
.thumb { position: relative; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: var(--panel-2); border: 1px solid rgba(255, 255, 255, 0.07); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-badge { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.7); font-size: 0.75rem; font-weight: 700; }
.done { position: absolute; right: 8px; top: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(60, 207, 142, 0.92); color: #04130c; font-size: 0.7rem; font-weight: 800; }
.done[hidden] { display: none; }
.play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; background: rgba(0, 0, 0, 0.38); opacity: 0; transition: opacity 0.15s; }
a.ep:hover .play { opacity: 1; }
.ep.wait { opacity: 0.55; }
.wait-note { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; }

/* player: phone first. The video fills the screen, the controls sit on it, and the episodes open as a
   bottom sheet. From 761px up (tablets, laptops, landscape phones) the list sits beside the video. */
body.watch { background: #050507; overflow: hidden; }
.player-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #050507; overflow: hidden; }
.player-top { display: none; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid #16161c; }
.player-top .back { margin: 0; }
.now { font-weight: 700; text-align: center; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.88rem; color: var(--muted); white-space: nowrap; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { width: 34px; height: 20px; border-radius: 999px; background: var(--line); position: relative; transition: background 0.15s; flex: none; }
.switch-track::after { content: ''; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.player-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.stage-wrap { position: relative; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.stage { position: relative; z-index: 1; width: 100%; height: 100%; background: #000; overflow: hidden; touch-action: none; }
.stage video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.nav-btn { position: relative; z-index: 1; flex: none; width: 56px; height: 72px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; font-size: 1.1rem; cursor: pointer; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: border-color 0.15s, transform 0.1s; }
.nav-btn small { font-size: 0.7rem; color: var(--muted); }
.nav-btn:hover:not(:disabled) { border-color: var(--accent); }
.nav-btn:active:not(:disabled) { transform: scale(0.94); }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.toast { position: absolute; top: calc(env(safe-area-inset-top) + 64px); left: 50%; transform: translateX(-50%); z-index: 6; padding: 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.75); font-weight: 600; pointer-events: none; white-space: nowrap; }
.spinner { position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
[hidden] { display: none !important; }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; background: rgba(0, 0, 0, 0.74); backdrop-filter: blur(4px); }
.overlay-title { font-size: 1.25rem; font-weight: 800; }
.count-ring { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--accent); display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; margin: 6px 0; }

/* control bar (controls.js) */
.chrome { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.chrome .fade { opacity: 0; visibility: hidden; transition: opacity 0.22s, visibility 0s 0.22s; }
.stage.ui-on .chrome .fade { opacity: 1; visibility: visible; transition: opacity 0.22s; }
.stage.ui-on.scrubbing .chrome .c-mid, .stage.ui-on.skipping .chrome .c-mid, .stage.ui-on.scrubbing .chrome .c-row { opacity: 0; }
.cbtn, .seek, .c-vol { pointer-events: auto; }
.cbtn { flex: none; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #fff; display: inline-grid; place-items: center; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background 0.15s, transform 0.1s, opacity 0.2s; }
.cbtn:active:not(:disabled) { transform: scale(0.92); }
.cbtn:disabled { opacity: 0.3; cursor: default; }
.cbtn .ic { width: 26px; height: 26px; fill: currentColor; display: block; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5)); }
.stage.is-playing .on-paused, .stage:not(.is-playing) .on-playing, .stage.is-muted .on-sound, .stage:not(.is-muted) .on-muted, .stage.is-full .on-win, .stage:not(.is-full) .on-full { display: none; }
.cbtn.pill-btn { display: inline-flex; align-items: center; justify-content: center; width: auto; padding: 0 14px 0 10px; gap: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-weight: 650; font-size: 0.9rem; }
.cbtn.pill-btn .ic { width: 20px; height: 20px; }
.cbtn.chip { width: auto; min-width: 46px; height: 30px; padding: 0 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); font-weight: 750; font-size: 0.82rem; font-variant-numeric: tabular-nums; }

.c-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px; padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 28px max(8px, env(safe-area-inset-left)); background: linear-gradient(rgba(0, 0, 0, 0.7), transparent); }
.c-label { flex: 1; min-width: 0; font-weight: 700; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.stage.is-full .c-back, .stage.is-full .c-eps { display: none; }
.stage.is-full .c-label { padding-left: 10px; }
.c-mid { position: absolute; left: 0; right: 0; top: 50%; display: flex; align-items: center; justify-content: center; gap: 34px; transform: translateY(-50%); transition: opacity 0.15s; }
.c-mid .cbtn { width: 54px; height: 54px; background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.c-mid .cbtn.big { width: 76px; height: 76px; }
.c-mid .cbtn.big .ic { width: 40px; height: 40px; }
.stage.loading .c-mid .cbtn.big { opacity: 0; }
.c-bot { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
.c-bot::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 170px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55) 40%, rgba(0, 0, 0, 0.88)); opacity: 0; transition: opacity 0.22s; pointer-events: none; }
.stage.ui-on .c-bot::before { opacity: 1; }
.c-row { position: relative; display: flex; align-items: center; gap: 2px; padding: 0 max(6px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.c-play-sm { display: none; }
.c-time { font-size: 0.88rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); }
.c-time i { font-style: normal; opacity: 0.65; }
.spacer { flex: 1; }
.c-vol { display: none; width: 78px; accent-color: var(--accent); }

.stage { container-type: inline-size; }
@container (max-width: 320px) {
  .c-row .chip, .c-row .c-vol, .c-row .c-time i, #t-dur { display: none; }
}

/* the scrubber is always on screen (a thin line while the controls are hidden) and always grabbable */
.seek { position: relative; height: 40px; margin: 0 max(16px, env(safe-area-inset-left)); display: flex; align-items: center; touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.seek:focus-visible { outline-offset: -2px; }
.seek-track { position: relative; width: 100%; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.3); overflow: hidden; transition: height 0.12s; }
.seek-buf, .seek-fill { position: absolute; inset: 0; transform-origin: left center; display: block; }
.seek-buf { background: rgba(255, 255, 255, 0.42); transform: scaleX(var(--b, 0)); }
.seek-fill { background: var(--accent); transform: scaleX(var(--p, 0)); }
.stage.ui-on .seek-track { height: 5px; }
.stage.scrubbing .seek-track { height: 8px; }
.seek-thumb { position: absolute; top: 50%; left: calc(var(--p, 0) * 100%); width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px rgb(255 77 125 / 0.35), 0 2px 6px rgba(0, 0, 0, 0.5); transform: scale(0); transition: transform 0.12s; pointer-events: none; }
.stage.ui-on .seek-thumb { transform: scale(1); }
.stage.scrubbing .seek-thumb { transform: scale(1.5); }
.seek-tip { position: absolute; bottom: 36px; left: calc(var(--tp, 0) * 100%); transform: translateX(-50%); padding: 4px 11px; border-radius: 999px; background: rgba(0, 0, 0, 0.78); font-size: 0.95rem; font-weight: 750; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity 0.12s; pointer-events: none; }
.stage.scrubbing .seek-tip { opacity: 1; }

/* episodes: a bottom sheet on phones */
.ep-list { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: min(78dvh, 680px); padding: 0 12px calc(14px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; background: var(--panel); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; transform: translateY(102%); visibility: hidden; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.3s; box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.65); }
body.eps-open .ep-list { transform: none; visibility: visible; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet-scrim { position: fixed; inset: 0; z-index: 39; background: rgba(0, 0, 0, 0.6); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
body.eps-open .sheet-scrim { opacity: 1; pointer-events: auto; }
.ep-list-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 20px 4px 10px; background: inherit; font-weight: 700; }
.ep-list-head::before { content: ''; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(255, 255, 255, 0.22); }
.ep-list-title { flex: 1; min-width: 0; }
.sheet-close { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--panel-2); color: var(--text); font: inherit; font-size: 1rem; cursor: pointer; }
.ep-row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 8px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background 0.12s; }
.ep-row:hover { background: var(--panel-2); }
.ep-row.current { background: rgb(var(--tint) / 0.14); border-color: rgb(var(--tint) / 0.55); }
.ep-thumb { position: relative; width: 46px; aspect-ratio: 9 / 16; border-radius: 6px; overflow: hidden; background: var(--panel-2); flex: none; }
.ep-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ep-thumb .prog { height: 3px; }
.ep-info { min-width: 0; font-weight: 600; }
.ep-part { padding: 10px 8px 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; color: var(--muted); }
.hints { display: none; padding: 8px 20px; border-top: 1px solid #16161c; color: var(--muted); font-size: 0.8rem; text-align: center; }

/* wide: the episode list beside the video */
@media (min-width: 761px) {
  .player-top { display: grid; }
  .player-body { grid-template-columns: minmax(0, 1fr) 310px; }
  .stage-wrap { gap: 22px; padding: 16px; }
  .stage { --vgap: 130px; width: auto; height: min(calc(100dvh - var(--vgap)), calc((100vw - 498px) * 16 / 9)); aspect-ratio: 9 / 16; max-width: 100%; border-radius: 18px; box-shadow: 0 24px 70px rgba(0, 0, 0, 0.7); }
  .stage.is-full { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; box-shadow: none; }
  .nav-btn { display: flex; }
  .toast { top: 18px; }
  .c-top, .c-mid, .cbtn.c-eps { display: none; }
  .stage.is-full .c-top { display: flex; }
  .c-play-sm { display: inline-grid; }
  .ep-list { position: relative; z-index: auto; height: auto; padding: 0 12px 12px; border-radius: 0; border-left: 1px solid #16161c; background: #07070a; transform: none; visibility: visible; transition: none; box-shadow: none; }
  body.eps-open .ep-list { transition: none; }
  .ep-list-head { padding: 14px 6px 10px; }
  .ep-list-head::before, .sheet-scrim, .sheet-close { display: none; }
  .ep-thumb { width: 42px; }
  .hints { display: block; }
}
@media (min-width: 761px) and (max-height: 520px) {
  /* a landscape phone: no room for the header, the back link moves onto the video */
  .player-top, .hints { display: none; }
  .c-top { display: flex; }
  .stage-wrap { padding: 8px 16px; }
  .stage { --vgap: 16px; }
}
@media (min-width: 761px) and (hover: hover) and (pointer: fine) {
  .c-vol { display: block; }
}

@media (max-width: 900px) {
  .hero-body { padding: 20px; gap: 18px; }
  .hero-poster { width: 120px; }
}
@media (max-width: 640px) {
  .topbar { padding: 10px 16px; gap: 10px; }
  .brand span:not(.brand-mark) { display: none; }
  .brand { font-size: 0; }
  .content { padding: 16px 16px 50px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 18px 14px; }
  .episodes { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
  .hero-body, .series-hero { flex-direction: column; align-items: flex-start; }
  .hero-poster { width: 130px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  @view-transition { navigation: none; }
}


/* ---------- new: interaction and colour ---------- */
.glow { display: none; position: absolute; left: 50%; top: 50%; width: min(640px, 82%); height: 92%; transform: translate(-50%, -50%); background: radial-gradient(closest-side, rgb(var(--tint) / 0.65), rgb(var(--tint) / 0.2) 62%, transparent); filter: blur(54px); opacity: 0.95; pointer-events: none; z-index: 0; transition: opacity 0.6s; }
body.watch { background: radial-gradient(900px 500px at 50% 0%, rgb(var(--tint) / 0.08), transparent 70%), #050507; }
@media (min-width: 761px) { .glow { display: block; } }
.gesture { position: absolute; inset: 0; z-index: 2; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.skipfx { position: absolute; top: 0; bottom: 0; width: 44%; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 800; background: rgba(255, 255, 255, 0.16); pointer-events: none; }
.skipfx.left { left: 0; border-radius: 0 60% 60% 0 / 0 50% 50% 0; }
.skipfx.right { right: 0; border-radius: 60% 0 0 60% / 50% 0 0 50%; }
.skipfx.pop { animation: skipfx 0.7s ease-out both; }
@keyframes skipfx { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
.skip-arrows { font-size: 2rem; letter-spacing: 0.1em; line-height: 1; }
.swipe-info { position: absolute; top: 42%; left: 50%; z-index: 4; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; padding: 12px 24px; border-radius: 18px; background: rgba(0, 0, 0, 0.62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: none; }
.swipe-info b { font-size: 1.9rem; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.swipe-info span { color: var(--muted); font-weight: 700; }
.burst { position: absolute; top: 50%; left: 50%; z-index: 4; transform: translate(-50%, -50%); min-width: 74px; height: 74px; padding: 0 20px; border-radius: 999px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(8px); font-size: 1.35rem; font-weight: 800; letter-spacing: 0.02em; pointer-events: none; }
.burst.pop { animation: burst 0.62s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes burst { 0% { opacity: 0; scale: 0.6; } 25% { opacity: 1; scale: 1.08; } 100% { opacity: 0; scale: 1.25; } }
.overlay { z-index: 5; }
.overlay.soft { background: rgba(0, 0, 0, 0.38); backdrop-filter: none; }
.overlay .row.wrap { flex-wrap: wrap; }
.big-play { position: relative; width: 88px; height: 88px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 2rem; padding-left: 6px; cursor: pointer; box-shadow: var(--glow); transition: transform 0.15s; }
.big-play:hover { transform: scale(1.06); } .big-play:active { transform: scale(0.95); }
.big-play::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgb(var(--tint) / 0.8); animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { to { transform: scale(1.7); opacity: 0; } }
.upnext { overflow: hidden; }
.up-bg { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(26px) brightness(0.45) saturate(1.4); z-index: -1; }
.up-body { display: grid; gap: 10px; justify-items: center; }
.ring { position: relative; width: 92px; height: 92px; margin: 4px 0 6px; }
.ring svg { position: relative; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--accent-2); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 176; stroke-dashoffset: 0; }
.ring::before { content: ''; position: absolute; inset: -16px; border-radius: 50%; background: radial-gradient(closest-side, rgb(var(--tint) / 0.4), transparent); }
.ring.counting .ring-fg { animation: drain 3s linear forwards; }
@keyframes drain { to { stroke-dashoffset: 176; } }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.9rem; font-weight: 800; }
.ep-dur { margin-left: auto; padding-left: 8px; color: var(--muted); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.dur { position: absolute; right: 8px; bottom: 8px; padding: 1px 7px; border-radius: 6px; background: rgba(0, 0, 0, 0.68); font-size: 0.72rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 650; padding: 4px 13px; border-radius: 999px; cursor: pointer; transition: all 0.15s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--grad); color: #fff; box-shadow: 0 3px 12px rgb(var(--tint) / 0.3); }
.btn.heart svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill 0.2s, stroke 0.2s; }
.btn.heart.on { border-color: rgb(var(--tint) / 0.6); background: rgb(var(--tint) / 0.14); }
.btn.heart.on svg { fill: var(--accent); stroke: var(--accent); }
.btn.heart.pop svg { animation: heart 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes heart { 0% { scale: 1; } 40% { scale: 1.5; } 100% { scale: 1; } }
.card:focus-visible .poster, .ep:focus-visible .thumb { outline: 2px solid var(--accent); outline-offset: 3px; }
.hidden-empty[hidden] { display: none; }

@media (max-width: 640px) { .series-hero { padding: 18px; } }
