/* Zeno
   Baseplate blue, Golden Weapon gold. Tall condensed titles
   (Big Shoulders Display) over Atkinson Hyperlegible, which stays
   readable from the couch. */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("/public/fonts/big-shoulders-display-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Big Shoulders Display";
  src: url("/public/fonts/big-shoulders-display-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/public/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/public/fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/public/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Ninjargon";
  src: url("/public/fonts/Ninjargon-Regular.otf") format("opentype");
  font-display: swap;
}

:root {
  --bg: #0f1b27;
  --bg-deep: #0a131c;
  --raised: #16263a;
  --raised-2: #1d3148;
  --line: #243a52;
  --text: #e8eef3;
  --text-2: #9aabbb;
  --text-3: #687f94;

  --accent: #e6e9ec;
  --accent-rgb: 230, 233, 236;
  --on-accent: #0b141d;
  --accent-text: var(--accent);
  --danger: #e2583f;
  --convert: #f0a35e;

  --display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif;
  --text-font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;

  --nav-w: 92px;
  --gutter: clamp(16px, 4vw, 56px);
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 14px;

  --fs-xs: 13px;
  --fs-sm: 14px;
  --fs: 16px;
  --fs-md: 18px;
  --fs-lg: 22px;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #e8edf1;
  --bg-deep: #dce3e9;
  --raised: #f7f9fb;
  --raised-2: #ffffff;
  --line: #c9d4de;
  --text: #13222f;
  --text-2: #4a5f71;
  --text-3: #71869a;
  --on-accent: #0b141d;
  --accent-text: color-mix(in srgb, var(--accent) 62%, #0b141d);
  --convert: #b3561a;
  color-scheme: light;
}

/* Plain is near-white, which vanishes on the light theme: flip it to ink. */
:root[data-theme="light"][data-accent="plain"] {
  --accent: #16202a !important;
  --on-accent: #ffffff;
  --accent-text: #16202a;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"][data-accent="plain"] {
    --accent: #16202a !important;
    --on-accent: #ffffff;
    --accent-text: #16202a;
  }
}

@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #e8edf1;
    --bg-deep: #dce3e9;
    --raised: #f7f9fb;
    --raised-2: #ffffff;
    --line: #c9d4de;
    --text: #13222f;
    --text-2: #4a5f71;
    --text-3: #71869a;
    --accent-text: color-mix(in srgb, var(--accent) 62%, #0b141d);
    color-scheme: light;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--line) transparent;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--text-font);
  font-size: var(--fs);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.no-scroll {
  overflow: hidden;
}

h1, h2, h3, p, dl, dd, ol, ul, figure {
  margin: 0;
}

ol, ul {
  padding: 0;
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

svg {
  fill: currentColor;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 14px;
  border-radius: var(--r);
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

.display {
  font-family: var(--display);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: 0.005em;
}

/* ------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border-radius: var(--r);
  font-weight: 700;
  font-size: var(--fs);
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, transform 0.1s;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, white);
}

.btn-ghost {
  background: color-mix(in srgb, var(--text) 10%, transparent);
  color: var(--text);
}

.btn-ghost:hover {
  background: color-mix(in srgb, var(--text) 17%, transparent);
}

.btn-sm {
  min-height: 38px;
  padding: 0 16px;
  font-size: var(--fs-sm);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: inherit;
  flex-shrink: 0;
  transition: background-color 0.15s;
}

.icon-btn:hover {
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
}

/* ---------------------------------------------------------------- nav */

.nav {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--nav-w);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 0 18px;
  background: var(--bg-deep);
  border-right: 1px solid var(--line);
}

.nav-brand {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  color: var(--accent-text);
  margin-bottom: 26px;
  letter-spacing: 0.02em;
}

.nav-links,
.nav-end {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.nav-end {
  margin-top: auto;
}

.nav-link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  width: 100%;
  transition: color 0.15s;
}

.nav-link svg {
  width: 24px;
  height: 24px;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.active {
  color: var(--text);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.nav-link.active svg {
  color: var(--accent-text);
}

/* Order / Stats / Remote are tools, not things to watch: set them apart. */
@media (min-width: 761px) {
  .nav-link[data-route="order"] {
    margin-top: 14px;
  }

  .nav-link[data-route="order"]::after {
    content: "";
    position: absolute;
    top: -9px;
    left: 26px;
    right: 26px;
    height: 1px;
    background: var(--line);
  }
}

/* A ninja hood in the chosen colour: a skin-tone eye slit with two eyes. */
.avatar {
  position: relative;
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--avatar, var(--accent));
  overflow: hidden;
  flex-shrink: 0;
}

.avatar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 36%;
  height: 26%;
  background:
    radial-gradient(circle at 34% 55%, #16202a 0 13%, transparent 15%),
    radial-gradient(circle at 66% 55%, #16202a 0 13%, transparent 15%),
    #f0cfa4;
}

.avatar-lg {
  width: 68px;
  height: 68px;
}

.avatar.has-pic {
  background-size: cover;
  background-position: center 28%;
}

.avatar.has-pic::before {
  display: none;
}

.avatar-pics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.avatar-pics:empty {
  display: none;
}

.avatar-pic {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-size: cover;
  background-position: center 28%;
  background-color: var(--bg);
}

.avatar-pic[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--raised), 0 0 0 5px var(--accent);
}

.hint code {
  font-family: inherit;
  font-weight: 700;
  color: var(--text-2);
}

/* --------------------------------------------------------------- page */

.page {
  margin-left: var(--nav-w);
  min-height: 100vh;
  padding-bottom: 72px;
}

.page-head {
  padding: 48px var(--gutter) 8px;
}

.page-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(44px, 6vw, 76px);
  line-height: 0.95;
}

.page-lede {
  margin-top: 12px;
  color: var(--text-2);
  max-width: 60ch;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  color: var(--text-3);
  font-size: var(--fs-sm);
  margin-bottom: 14px;
}

.crumbs a {
  color: var(--text-2);
}

.crumbs a:hover {
  color: var(--text);
  text-decoration: underline;
}

.crumbs span[aria-hidden] {
  color: var(--text-3);
}

.empty {
  padding: 32px var(--gutter);
  color: var(--text-2);
  max-width: 60ch;
}

.empty strong {
  display: block;
  color: var(--text);
  font-size: var(--fs-md);
  margin-bottom: 4px;
}

.loading {
  display: grid;
  place-items: center;
  min-height: 50vh;
}

.spinner,
.loading::after {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 50%;
  /* same thin iPhone-style ring as the player's spinner */
  border: 2.5px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
  animation: spin 1.4s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------- hero */

.hero {
  position: relative;
  min-height: min(82vh, 760px);
  display: flex;
  align-items: flex-end;
  padding: 0 var(--gutter) 64px;
  overflow: hidden;
  isolation: isolate;
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  opacity: 0;
  transition: opacity 0.9s ease;
}

.hero-art img.shown {
  opacity: 1;
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 26%, transparent 60%),
    linear-gradient(to right, var(--bg) 0%, color-mix(in srgb, var(--bg) 82%, transparent) 30%, transparent 72%);
}

.hero-body {
  position: relative;
  max-width: min(760px, 100%);
}

.hero-kicker {
  color: var(--text-2);
  font-size: var(--fs-md);
  margin-bottom: 10px;
}

.hero-kicker strong {
  color: var(--text);
}

.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(56px, 9.5vw, 148px);
  line-height: 0.86;
  letter-spacing: -0.005em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.hero-title.is-long {
  font-size: clamp(44px, 7vw, 108px);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 18px;
  color: var(--text-2);
  font-size: var(--fs);
}

.hero-meta .rating {
  border: 1px solid color-mix(in srgb, var(--text) 40%, transparent);
  color: var(--text);
  padding: 0 6px;
  border-radius: 3px;
  font-size: var(--fs-xs);
  line-height: 22px;
  align-self: center;
}

.hero-desc {
  margin-top: 14px;
  max-width: 56ch;
  color: color-mix(in srgb, var(--text) 86%, transparent);
  font-size: var(--fs-md);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-credits {
  margin-top: 8px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  max-width: 64ch;
}

.hero-credits span {
  color: var(--text-3);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* The one loud thing: where you stopped, as a line across the whole hero. */
.hero-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

.hero-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.55);
  transition: width 0.6s ease;
}

.hero-switch {
  position: absolute;
  right: var(--gutter);
  bottom: 64px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.hero-switch button {
  color: var(--text-3);
  font-size: var(--fs-sm);
  padding: 4px 0;
  text-align: right;
  transition: color 0.2s;
}

.hero-switch button:hover {
  color: var(--text-2);
}

.hero-switch button[aria-current="true"] {
  color: var(--text);
  font-weight: 700;
}

.hero-switch button[aria-current="true"]::after {
  content: "";
  display: inline-block;
  width: 16px;
  height: 2px;
  background: var(--accent);
  margin-left: 10px;
  vertical-align: middle;
}

.hero-fade {
  animation: heroIn 0.6s ease both;
}

@keyframes heroIn {
  from { opacity: 0; transform: translateY(8px); }
}

/* ---------------------------------------------------------------- rows */

.row {
  margin-top: 44px;
}

.row-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 0 var(--gutter);
  margin-bottom: 14px;
}

.row-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
}

a.row-title:hover {
  color: var(--accent-text);
}

.row-count {
  color: var(--text-3);
  font-size: var(--fs-sm);
  padding-bottom: 3px;
}

.row-nav {
  margin-left: auto;
  display: flex;
  gap: 4px;
}

.row-nav .icon-btn {
  width: 36px;
  height: 36px;
  color: var(--text-2);
  border: 1px solid var(--line);
}

.row-nav .icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.row-nav .icon-btn svg {
  width: 18px;
  height: 18px;
}

.strip {
  display: grid;
  grid-auto-flow: column;
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  padding: 4px var(--gutter) 10px;
  scrollbar-width: none;
}

.strip::-webkit-scrollbar {
  display: none;
}

.strip > * {
  scroll-snap-align: start;
}

.strip-posters {
  grid-auto-columns: clamp(132px, 14vw, 196px);
}

.strip-wide {
  grid-auto-columns: clamp(240px, 24vw, 340px);
}

.grid {
  display: grid;
  gap: 28px 18px;
  padding: 8px var(--gutter);
}

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

.grid-wide {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.grid-images {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* --------------------------------------------------------------- cards */

.card {
  display: block;
  min-width: 0;
  border-radius: var(--r);
  color: inherit;
}

.card-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--raised);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, filter 0.2s;
}

.card-media .card-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.card:hover .card-media img {
  filter: brightness(1.08);
}

.card:hover .card-name {
  color: var(--accent-text);
}

.poster .card-media {
  aspect-ratio: 2 / 3;
}

.wide .card-media {
  aspect-ratio: 16 / 9;
}

.square .card-media {
  aspect-ratio: 1;
}

.card-text {
  padding-top: 10px;
}

.card-name {
  font-weight: 700;
  line-height: 1.3;
  transition: color 0.15s;
  overflow-wrap: anywhere;
}

.card-sub {
  color: var(--text-2);
  font-size: var(--fs-sm);
  margin-top: 2px;
}

.card-sub + .card-sub {
  margin-top: 0;
}

/* Posters without art: a frame from the video with the title set over it. */
.poster-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 14px 12px;
  background: var(--raised-2);
}

.poster-fallback img {
  position: absolute;
  inset: 0;
  opacity: 0.55;
}

.poster-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, var(--bg-deep) 8%, transparent 75%);
}

.poster-fallback span {
  position: relative;
  z-index: 2;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(22px, 2vw, 28px);
  line-height: 0.95;
  overflow-wrap: normal;
}

.poster-fallback small {
  position: relative;
  z-index: 2;
  display: block;
  color: var(--accent-text);
  font-family: var(--display);
  font-weight: 700;
  font-size: 17px;
  margin-bottom: 4px;
}

.card-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(0, 0, 0, 0.55);
}

.card-progress span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.card-time {
  position: absolute;
  right: 8px;
  bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(8, 14, 20, 0.78);
  color: #fff;
}

.card-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 34px;
  height: 34px;
  background: rgba(8, 14, 20, 0.72);
  color: #fff;
  opacity: 0;
  transition: opacity 0.15s;
}

.card-remove svg {
  width: 18px;
  height: 18px;
}

.card:hover .card-remove,
.card:focus-within .card-remove {
  opacity: 1;
}

@media (hover: none) {
  .card-remove {
    opacity: 1;
  }
}

.card-remove:hover {
  background: var(--danger);
}

.folder-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 112px;
  padding: 16px;
  border-radius: var(--r);
  background: var(--raised);
  border: 1px solid var(--line);
  transition: border-color 0.15s, background-color 0.15s;
}

.folder-card:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: var(--raised-2);
}

.folder-card.has-poster {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px;
}

.folder-poster {
  width: 60px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
}

.folder-card .card-name {
  font-family: var(--display);
  font-size: 24px;
  line-height: 1.05;
}

.folder-card:hover .card-name {
  color: var(--text);
}

.folder-card .card-sub {
  margin-top: 10px;
}

.image-card {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--r-sm);
  background: var(--raised);
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ------------------------------------------------------------- title page */

.title-hero {
  position: relative;
  min-height: min(70vh, 640px);
  display: flex;
  align-items: flex-end;
  padding: 80px var(--gutter) 40px;
  overflow: hidden;
  isolation: isolate;
}

.title-hero .hero-art img {
  opacity: 1;
}

.title-hero .hero-desc {
  -webkit-line-clamp: unset;
}

.title-logo {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(22px, 2.4vw, 30px);
  color: var(--accent-text);
  line-height: 1;
  margin-bottom: 8px;
}

.seasons {
  position: sticky;
  top: 0;
  z-index: 5;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.seasons-scroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 0 var(--gutter);
  scrollbar-width: none;
  scroll-padding: 0 60px;
  user-select: none;
}

.seasons-arrow {
  position: absolute;
  top: 0;
  bottom: 1px;
  width: 64px;
  display: none;
  align-items: center;
  color: var(--text);
  z-index: 1;
}

.seasons-arrow svg {
  width: 30px;
  height: 30px;
  padding: 5px;
  border-radius: 50%;
  background: var(--raised-2);
  border: 1px solid var(--line);
}

.seasons-arrow:hover svg {
  border-color: var(--accent);
}

.seasons-prev {
  left: 0;
  padding-left: 12px;
  background: linear-gradient(to right, var(--bg) 40%, transparent);
}

.seasons-next {
  right: 0;
  justify-content: flex-end;
  padding-right: 12px;
  background: linear-gradient(to left, var(--bg) 40%, transparent);
}

.seasons.can-prev .seasons-prev,
.seasons.can-next .seasons-next {
  display: flex;
}

@media (hover: none) {
  .seasons-arrow {
    pointer-events: none;
    width: 36px;
  }

  .seasons-arrow svg {
    display: none;
  }
}

.seasons-scroll::-webkit-scrollbar {
  display: none;
}

.season-tab {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 16px 14px 14px;
  color: var(--text-3);
  transition: color 0.15s;
  max-width: 280px;
}

.season-tab:hover {
  color: var(--text-2);
}

.season-tab b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  line-height: 1;
}

.season-tab span {
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.season-tab[aria-selected="true"] {
  color: var(--text);
}

.season-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 3px;
  background: var(--accent);
}

.season-bar {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  padding: 28px var(--gutter) 10px;
  max-width: calc(1180px + var(--gutter) * 2);
}

.season-poster {
  width: 96px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--raised);
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.season-facts {
  flex: 1;
  min-width: 0;
}

.season-num {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.season-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  margin-bottom: 6px;
}

.season-name:empty {
  display: none;
}

.season-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 16px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.season-convert {
  color: var(--convert);
}

.season-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.chapter-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  color: var(--text-2);
  padding: 22px var(--gutter) 0;
}

/* ---------------------------------------------------------- episode list */

.episodes {
  padding: 8px var(--gutter) 0;
  max-width: 1180px;
}

.episode {
  display: grid;
  grid-template-columns: 56px minmax(150px, 240px) 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background-color 0.15s;
}

.episode + .episode {
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.episode:hover,
.episode:focus-visible {
  background: var(--raised);
}

.episode:hover + .episode {
  border-top-color: transparent;
}

.episode-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  color: var(--text-3);
  text-align: right;
}

.episode.is-current .episode-num {
  color: var(--accent-text);
}

.episode-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--raised-2);
}

.episode-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 12, 18, 0.45);
  opacity: 0;
  transition: opacity 0.15s;
  color: #fff;
}

.episode-play svg {
  width: 38px;
  height: 38px;
}

.episode:hover .episode-play,
.episode:focus-visible .episode-play {
  opacity: 1;
}

.episode-body {
  min-width: 0;
}

.episode-top {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.episode-title {
  font-weight: 700;
  font-size: var(--fs-md);
  line-height: 1.3;
}

.episode-len {
  color: var(--text-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.episode-desc {
  margin-top: 4px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
  max-width: 72ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.desc-more {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-2);
  padding: 2px 0;
}

.desc-more:hover {
  color: var(--accent-text);
}

.episode-desc.open {
  -webkit-line-clamp: unset;
}

.episode-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 6px;
}

.episode-state {
  font-size: var(--fs-xs);
  color: var(--text-2);
}

.conv-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--convert);
}

.conv-tag::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.conv-tag[data-state="queued"] {
  color: var(--text-2);
}

.conv-tag[data-state="converting"]::before {
  animation: pulse 1s ease-in-out infinite alternate;
}

.conv-tag[data-state="done"] {
  color: var(--text-3);
}

.conv-tag[data-state="done"]::before {
  background: none;
  width: auto;
  height: auto;
  content: "✓";
}

@keyframes pulse {
  to { opacity: 0.25; }
}

.episode-state.is-watched {
  color: var(--text-3);
}

.watch-toggle {
  width: 40px;
  height: 40px;
  color: var(--text-3);
  border: 1.5px solid var(--line);
}

.watch-toggle svg {
  width: 18px;
  height: 18px;
}

.watch-toggle[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
  color: var(--accent);
}

.episode.is-watched .episode-thumb img {
  filter: saturate(0.5) brightness(0.8);
}

/* compact list rows (tracks, books, folders inside a title page) */

.list {
  padding: 8px var(--gutter);
  max-width: 980px;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  text-align: left;
  padding: 14px 12px;
  margin: 0 -12px;
  border-radius: var(--r);
  transition: background-color 0.15s;
}

.list-row + .list-row {
  border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}

.list-row:hover {
  background: var(--raised);
}

.list-row b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  color: var(--text-3);
  min-width: 36px;
  text-align: right;
}

.list-row .list-name {
  flex: 1;
  min-width: 0;
  font-weight: 700;
}

.list-row .list-meta {
  color: var(--text-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.list-row.is-playing b,
.list-row.is-playing .list-name {
  color: var(--accent);
}

.list-row svg {
  width: 20px;
  height: 20px;
  color: var(--text-3);
}

/* ------------------------------------------------------------ watch order */

.order {
  padding: 24px var(--gutter) 0;
  max-width: 900px;
  counter-reset: none;
}

.order-entry {
  display: grid;
  grid-template-columns: 72px 1fr 76px;
  column-gap: 20px;
  position: relative;
}

.order-poster {
  padding-top: 18px;
}

.order-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 3px;
}

.order-sub.is-missing {
  color: var(--text-3);
}

.order-entry::before {
  content: "";
  position: absolute;
  left: 71px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--line);
}

.order-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  text-align: right;
  padding: 16px 12px 0 0;
  color: var(--text-3);
}

.order-body {
  padding: 16px 0 18px 12px;
  min-width: 0;
}

.order-title {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.25;
}

a.order-title:hover,
a.order-sub:hover {
  color: var(--accent);
}

a.order-sub::after {
  align-self: center;
  transform: rotate(45deg);
  margin-left: 4px;
}

a.order-title::after,
a.order-sub::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.6;
}

.order-era {
  color: var(--text-3);
  font-size: var(--fs-sm);
  margin-top: 2px;
}

.order-subs {
  margin-top: 8px;
  display: grid;
  gap: 2px;
}

.order-sub {
  display: flex;
  gap: 10px;
  color: var(--text-2);
  font-size: var(--fs);
  line-height: 1.6;
}

.order-sub i {
  font-style: normal;
  color: var(--text-3);
  min-width: 22px;
}

.order-entry:has(a.order-title) .order-num {
  color: var(--text-2);
}

.order-divider {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  padding: 40px 0 8px 104px;
  color: var(--accent-text);
}

/* --------------------------------------------------------------- search */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 97%, transparent);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  animation: sheetIn 0.18s ease;
}

@keyframes sheetIn {
  from { opacity: 0; }
}

.search-bar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 28px var(--gutter) 18px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  max-width: 1100px;
  margin: 0 auto;
}

.search-bar > svg {
  width: 28px;
  height: 28px;
  color: var(--text-3);
  flex-shrink: 0;
}

.search-bar input {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  padding: 4px 0;
}

.search-bar input:focus-visible {
  outline: none;
}

.search-bar:focus-within {
  border-bottom-color: var(--accent);
}

.search-bar input::placeholder {
  color: var(--text-3);
}

.search-bar input::-webkit-search-cancel-button {
  display: none;
}

.search-results {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px var(--gutter) 60px;
}

.search-group {
  margin-top: 26px;
}

.search-group h3 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  margin-bottom: 6px;
  color: var(--text-2);
}

.result {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  margin: 0 -12px;
  border-radius: var(--r);
  text-align: left;
  width: calc(100% + 24px);
}

.result:hover,
.result:focus-visible {
  background: var(--raised);
}

.result-thumb {
  width: 128px;
  aspect-ratio: 16 / 9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--raised-2);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--text-3);
}

.result-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.result-thumb svg {
  width: 26px;
  height: 26px;
}

.result-text {
  min-width: 0;
}

.result-name {
  font-weight: 700;
}

.result-name mark {
  background: none;
  color: var(--accent);
}

.result-path {
  color: var(--text-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-hint {
  color: var(--text-3);
  padding-top: 24px;
}

/* --------------------------------------------------------------- player */

.player {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: #000;
  color: #fff;
  --text: #fff;
}

.player-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: none;
}

.player.show-ui .player-stage {
  cursor: default;
}

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

.player-top,
.player-bottom {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.player.show-ui .player-top,
.player.show-ui .player-bottom {
  opacity: 1;
  pointer-events: auto;
}

.player-top {
  top: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 70px max(14px, env(safe-area-inset-left));
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.35) 60%, transparent);
}

.player-titles {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}

.player-show {
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--fs-sm);
}

.player-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-title small {
  font-size: 0.72em;
  color: var(--accent);
  margin-right: 12px;
}

.player-desc {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.74);
  font-size: var(--fs-sm);
  max-width: 70ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.player-times {
  display: grid;
  gap: 4px;
  text-align: right;
  padding-top: 6px;
  flex-shrink: 0;
}

.player-times div {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: baseline;
}

.player-times dt {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.62);
}

.player-times dd {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.player-bottom {
  bottom: 0;
  padding: 60px max(22px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.4) 55%, transparent);
}

.scrub {
  position: relative;
  height: 26px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.scrub-track {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transition: height 0.12s;
}

.scrub:hover .scrub-track,
.scrub.dragging .scrub-track {
  height: 6px;
}

.scrub-buffer,
.scrub-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
}

.scrub-buffer {
  background: rgba(255, 255, 255, 0.28);
}

.scrub-fill {
  background: var(--accent);
}

.scrub-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.12s;
}

.scrub:hover .scrub-knob,
.scrub.dragging .scrub-knob,
.scrub:focus-visible .scrub-knob {
  transform: scale(1);
}

.scrub-tip {
  position: absolute;
  bottom: 28px;
  left: 0;
  transform: translateX(-50%);
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(10, 18, 26, 0.92);
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}

.scrub:hover .scrub-tip,
.scrub.dragging .scrub-tip {
  opacity: 1;
}

.controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.controls .icon-btn svg {
  width: 26px;
  height: 26px;
}

.controls-spacer {
  flex: 1;
}

.text-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: 22px;
  font-weight: 700;
  font-size: var(--fs-sm);
  white-space: nowrap;
  transition: background-color 0.15s;
}

.text-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.text-btn svg {
  width: 20px;
  height: 20px;
}

.text-btn.on {
  color: var(--accent);
}

.time {
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-sm);
  margin-left: 8px;
  white-space: nowrap;
}

.i-pause,
.i-mute,
.i-fs-exit {
  display: none;
}

.player.playing .i-play,
.player.muted .i-vol,
.player.fullscreen .i-fs {
  display: none;
}

.player.playing .i-pause,
.player.muted .i-mute,
.player.fullscreen .i-fs-exit {
  display: block;
}

.volume {
  display: flex;
  align-items: center;
}

.volume-slider {
  width: 0;
  opacity: 0;
  transition: width 0.2s, opacity 0.2s;
  accent-color: var(--accent);
}

.volume:hover .volume-slider,
.volume:focus-within .volume-slider {
  width: 90px;
  opacity: 1;
  margin: 0 6px;
}

.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  bottom: 52px;
  right: 0;
  min-width: 130px;
  padding: 6px;
  border-radius: var(--r);
  background: rgba(14, 24, 34, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
}

.menu button {
  text-align: left;
  padding: 9px 12px;
  border-radius: 5px;
  font-size: var(--fs-sm);
}

.menu button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu button[aria-checked="true"] {
  color: var(--accent);
  font-weight: 700;
}

.player-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 84px;
  height: 84px;
  margin: -42px 0 0 -42px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

.player-flash svg {
  width: 38px;
  height: 38px;
}

.player-flash.go {
  animation: flash 0.55s ease-out;
}

@keyframes flash {
  0% { opacity: 1; transform: scale(0.9); }
  100% { opacity: 0; transform: scale(1.25); }
}

.player-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  margin: -26px 0 0 -26px;
  animation: spinner-in 0.25s ease 0.4s both;  /* short buffering blips never show it */
}

/* Thin iPhone-style ring: a light arc that eases round a faint track. */
.player-spinner span {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
  animation: spin 1.4s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

@keyframes spinner-in { from { opacity: 0; } }

.player-notice {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  transform: translate(-50%, 40px);
  max-width: min(520px, 86vw);
  padding: 14px 18px;
  border-radius: var(--r);
  background: rgba(12, 22, 32, 0.94);
  border-left: 3px solid var(--accent);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.player-notice.is-error {
  border-left-color: var(--danger);
}

.player-notice strong {
  display: block;
  font-size: var(--fs);
  margin-bottom: 2px;
}

.player-captions {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: var(--cap-bottom, 90px);
  transform: translateX(-50%);
  max-width: 84%;
  padding: 4px 12px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  font-size: var(--cap-size, 22px);
  line-height: 1.35;
  text-align: center;
  white-space: pre-line;
  pointer-events: none;
  transition: bottom 0.25s;
}

.player-captions:empty {
  display: none;
}

.player.show-ui .player-captions {
  bottom: calc(var(--cap-bottom, 90px) + 40px);
}

.upnext {
  position: absolute;
  z-index: 4;
  right: max(22px, env(safe-area-inset-right));
  bottom: 130px;
  width: min(340px, 80vw);
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: rgba(12, 22, 32, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: sheetIn 0.25s ease;
}

.upnext-label {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.65);
}

.upnext-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.05;
  margin: 2px 0 12px;
}

.upnext-actions {
  display: flex;
  gap: 8px;
}

.upnext .btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* Episodes drawer: sits beside the picture, which shrinks to make room. */
:root {
  --drawer-w: min(440px, 38vw);
}

.player-stage {
  transition: right 0.25s ease;
}

.player.drawer-open .player-stage {
  right: var(--drawer-w);
}

.drawer {
  position: absolute;
  z-index: 6;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--drawer-w);
  display: flex;
  flex-direction: column;
  background: #0b141d;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  animation: drawerIn 0.25s ease;
  cursor: default;
  --bg: #0b141d;
  --raised-2: #1a2a3b;
  --line: rgba(255, 255, 255, 0.12);
  --text-2: rgba(255, 255, 255, 0.66);
  --text-3: rgba(255, 255, 255, 0.45);
}

@keyframes drawerIn {
  from { transform: translateX(40px); opacity: 0; }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: max(20px, env(safe-area-inset-top)) 12px 8px 22px;
}

.drawer-heading {
  flex: 1;
  min-width: 0;
}

.drawer-show {
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-show:empty {
  display: none;
}

.drawer-title {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1;
  margin-top: 2px;
}

.seasons-compact {
  position: relative;
  top: auto;
  background: transparent;
  backdrop-filter: none;
  border-bottom: 1px solid var(--line);
}

.seasons-compact .seasons-scroll {
  padding: 0 14px;
}

.seasons-compact .season-tab {
  padding: 12px 10px 10px;
  gap: 6px;
}

.seasons-compact .season-tab b {
  font-size: 22px;
}

.seasons-compact .season-tab span {
  font-size: var(--fs-xs);
  max-width: 150px;
}

.seasons-compact .season-tab[aria-selected="true"]::after {
  left: 10px;
  right: 10px;
}

.seasons-compact .seasons-arrow {
  width: 44px;
}

.seasons-compact .seasons-arrow svg {
  width: 26px;
  height: 26px;
}

.drawer-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 14px;
  padding: 14px 22px 6px;
  color: var(--text-2);
  font-size: var(--fs-xs);
}

.drawer-summary:empty {
  display: none;
}

.drawer-summary-name {
  width: 100%;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  color: var(--text);
}

.drawer-summary-name:empty {
  display: none;
}

.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 10px 24px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.drawer-group {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  color: var(--text-2);
  padding: 16px 12px 6px;
}

.drawer-item {
  position: relative;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--r);
  text-align: left;
  transition: background-color 0.15s;
}

.drawer-item:hover,
.drawer-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.drawer-item.is-current {
  background: rgba(var(--accent-rgb), 0.12);
}

.drawer-item.is-current::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}

.drawer-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 4px;
  overflow: hidden;
  background: var(--raised-2);
}

.drawer-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-item.is-watched .drawer-thumb img {
  filter: saturate(0.5) brightness(0.75);
}

.drawer-playing {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(6, 12, 18, 0.45);
  color: #fff;
}

.drawer-playing svg {
  width: 30px;
  height: 30px;
}

.drawer-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--on-accent);
}

.drawer-check svg {
  width: 14px;
  height: 14px;
}

.drawer-text {
  min-width: 0;
}

.drawer-item-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.drawer-num {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
  color: var(--text-3);
  flex-shrink: 0;
}

.drawer-item.is-current .drawer-num {
  color: var(--accent);
}

.drawer-item-title {
  font-weight: 700;
  font-size: var(--fs-sm);
  line-height: 1.3;
}

.drawer-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  margin-top: 4px;
  color: var(--text-2);
  font-size: 12px;
}

.drawer-now {
  color: var(--accent);
  font-weight: 700;
}

.drawer-item-desc {
  margin-top: 6px;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drawer-item:hover .drawer-item-desc,
.drawer-item.is-current .drawer-item-desc {
  color: var(--text-2);
}

.drawer .conv-tag {
  font-size: 12px;
}

@media (max-width: 1100px) {
  .drawer-item {
    grid-template-columns: 120px 1fr;
  }

  .drawer-item-desc {
    display: none;
  }
}

/* --------------------------------------------------------------- viewer */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) var(--gutter) 10px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.viewer-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viewer-count {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.viewer-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.viewer-body iframe {
  flex: 1;
  border: 0;
  background: #fff;
}

/* ---------------------------------------------------------------- book */

/* The reader sits on a dark desk; the open book gets a spine shadow and a
   soft drop shadow so it reads as paper, not a document viewer. */
.book {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: radial-gradient(ellipse at 50% 40%, #1b2530, #0b1016 75%);
}

.book-view {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

/* Scrolls when zoomed in; "safe" keeps the top of a tall spread reachable. */
.book-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  justify-items: center;
  align-items: safe center;
  padding: 16px 0;
  user-select: none;
  scrollbar-width: thin;
}

.book-stage.is-loading::after {
  content: "";
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.14);
  border-top-color: rgba(255, 255, 255, 0.9);
  box-sizing: border-box;
  animation: spin 1.4s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.book-spread {
  position: relative;
  display: flex;
  perspective: 2600px;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.55));
}

.book-page {
  position: relative;
  flex: 1;
  height: 100%;
  overflow: hidden;
  background: #f4f1ea;
}

.book-page.is-left {
  border-radius: 3px 0 0 3px;
}

.book-page.is-right {
  border-radius: 0 3px 3px 0;
}

.book-spread.is-single .book-page.is-left {
  display: none;
}

.book-spread.is-single .book-page.is-right {
  border-radius: 3px;
}

.book-page.is-blank {
  visibility: hidden;
}

.book-page img,
.leaf-face img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

/* Spine: pages darken toward the fold. */
.book-page::after,
.leaf-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.book-page.is-left::after {
  background: linear-gradient(to left, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.06) 5%, transparent 14%);
}

.book-page.is-right::after {
  background: linear-gradient(to right, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.06) 5%, transparent 14%);
}

.book-spread.is-single .book-page.is-right::after {
  background: none;
}

/* The page being read aloud gets a thin marker along its bottom edge. */
.book-page.is-reading::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -9px;
  height: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.book-page.is-reading {
  overflow: visible;
}

/* Read-along highlight, drawn over the page in multiply so the ink stays crisp. */
.book-hl {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.book-hl .hl {
  position: absolute;
  border-radius: 3px;
  mix-blend-mode: multiply;
  transition: left 0.12s, top 0.12s, width 0.12s, height 0.12s;
}

.book-hl .hl.is-line {
  margin: -0.25% -0.6%;
  padding: 0.25% 0.6%;
  box-sizing: content-box;
  background: rgba(120, 165, 230, 0.16);
}

.book-hl .hl.is-word {
  margin: -0.15% -0.3%;
  padding: 0.15% 0.3%;
  box-sizing: content-box;
  background: rgba(80, 140, 235, 0.42);
}

/* The turning leaf. */
.book-leaf {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 5;
  transform-style: preserve-3d;
  animation-duration: 0.9s;
  animation-timing-function: cubic-bezier(0.45, 0.05, 0.3, 1);
  animation-fill-mode: forwards;
}

/* Single page: the leaf is the whole page, hinged on its left edge. */
.book-leaf.is-single.is-fwd,
.book-leaf.is-single.is-in {
  left: 0;
  width: 100%;
  transform-origin: left center;
}

.book-leaf.is-single.is-in {
  animation-name: leaf-in;
}

@keyframes leaf-in {
  from { transform: rotateY(-180deg); }
  to { transform: rotateY(0); }
}

/* The leaf darkens as it stands up off the page, like paper catching shadow. */
.book-leaf .leaf-face:not(.is-blank) {
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.35);
  animation: leaf-shade 0.9s ease-in-out forwards;
}

@keyframes leaf-shade {
  50% { filter: brightness(0.7); }
}

.book-leaf.is-fwd {
  left: 50%;
  transform-origin: left center;
  animation-name: leaf-fwd;
}

.book-leaf.is-back {
  left: 0;
  transform-origin: right center;
  animation-name: leaf-back;
}

.leaf-face,
.leaf-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
}

.leaf-face {
  background: #f4f1ea;
}

.leaf-face.is-blank {
  background: transparent;
}

.leaf-back {
  transform: rotateY(180deg);
}

@keyframes leaf-fwd {
  to { transform: rotateY(-180deg); }
}

@keyframes leaf-back {
  to { transform: rotateY(180deg); }
}

.book-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.06);
  transition: background-color 0.15s, color 0.15s;
}

.book-nav:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.book-nav svg {
  width: 26px;
  height: 26px;
}

.book-nav.is-prev {
  left: 12px;
}

.book-nav.is-next {
  right: 12px;
}

.listen-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 10px var(--gutter) max(14px, env(safe-area-inset-bottom));
  font-size: var(--fs-sm);
}

.listen-where {
  color: var(--text-2);
  white-space: nowrap;
}

.listen-page {
  width: 4.5em;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-deep);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.listen-speed {
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-deep);
  color: var(--text);
  font: inherit;
}

.listen-status {
  color: var(--text-2);
}

.listen-status:empty {
  display: none;
}

.pages {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  min-height: 0;
}

.pages img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.pages-nav {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: var(--text-2);
}

.pages-nav svg {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  opacity: 0;
  transition: opacity 0.15s;
}

.pages-nav:hover svg,
.pages-nav:focus-visible svg {
  opacity: 1;
}

.pages-prev {
  left: 0;
}

.pages-next {
  right: 0;
  justify-content: flex-end;
}

.listen {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 48px;
  padding: 48px var(--gutter);
  overflow-y: auto;
  align-content: start;
}

.listen-art {
  aspect-ratio: 1;
  border-radius: var(--r);
  background: var(--raised);
  display: grid;
  place-items: center;
  color: var(--text-3);
  overflow: hidden;
}

.listen-art svg {
  width: 30%;
  height: 30%;
}

.listen-now {
  margin-top: 20px;
}

.listen-album {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.listen-track {
  font-family: var(--display);
  font-weight: 800;
  font-size: 36px;
  line-height: 1;
  margin: 4px 0 16px;
}

.listen audio {
  width: 100%;
}

.listen .list {
  padding: 0;
}

/* --------------------------------------------------------------- modals */

.modal {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--raised);
  color: var(--text);
}

.modal::backdrop {
  background: rgba(4, 9, 14, 0.66);
}

.modal[open] {
  animation: modalIn 0.2s ease;
}

.modal.fallback-open {
  display: block;
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 60;
  height: fit-content;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px); }
}

.modal-inner {
  padding: 24px 26px 22px;
  display: grid;
  gap: 22px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: -6px -10px -6px 0;
}

.modal-head h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.modal-foot-end {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.card-code {
  color: var(--accent-text);
  font-weight: 700;
  margin-right: 8px;
}

.field {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span,
.field legend {
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text-2);
  padding: 0;
  margin-bottom: 8px;
}

.field > span {
  margin-bottom: 0;
}

.field input[type="text"] {
  height: 46px;
  padding: 0 14px;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--line);
  width: 100%;
}

.field input[type="text"]:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.hint {
  color: var(--text-3);
  font-size: var(--fs-sm);
  margin-top: 8px;
}

.segmented {
  display: flex;
  padding: 3px;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--line);
}

.segmented button {
  flex: 1;
  height: 40px;
  border-radius: 6px;
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.segmented button[aria-pressed="true"] {
  background: var(--raised-2);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
  position: relative;
}

.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 3px var(--raised), 0 0 0 5px var(--c);
}

.swatches-named {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.swatch-named {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-2);
}

.swatch-named::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--c);
  flex-shrink: 0;
}

.swatch-named[aria-pressed="true"] {
  border-color: var(--c);
  color: var(--text);
  background: color-mix(in srgb, var(--c) 12%, transparent);
}

.conv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.conv-actions:not(:has(button:not([hidden]))) {
  display: none;
}

.profile-id {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-id .field {
  flex: 1;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.stats div {
  background: var(--raised);
  padding: 14px 16px;
}

.stats dt {
  color: var(--text-2);
  font-size: var(--fs-xs);
}

.stats dd {
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.05;
}

.stats .stat-wide {
  grid-column: 1 / -1;
}

.stats .stat-wide dd {
  font-size: 24px;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle input {
  appearance: none;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--line);
  position: relative;
  margin: 0;
  cursor: pointer;
  transition: background-color 0.15s;
}

.toggle input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s;
}

.toggle input:checked {
  background: var(--accent);
}

.toggle input:checked::after {
  transform: translateX(18px);
}

.version {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.kicked {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 8px;
  background: var(--bg-deep);
  padding: 24px;
}

.kicked h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 56px;
}

.kicked p {
  color: var(--text-2);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 70;
  transform: translateX(-50%);
  padding: 12px 18px;
  border-radius: var(--r);
  background: var(--raised-2);
  border: 1px solid var(--line);
  font-weight: 700;
  font-size: var(--fs-sm);
  animation: sheetIn 0.2s ease;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* ----------------------------------------------------------- Ninjargon */

/* The font only has capitals, so titles are uppercased when it's on. */
body.ninjargon .hero-title,
body.ninjargon .page-title,
body.ninjargon .row-title,
body.ninjargon .poster-fallback span,
body.ninjargon .title-logo {
  font-family: "Ninjargon", var(--display);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------- TV mode */

body.tv-mode {
  --fs: 20px;
  --fs-sm: 17px;
  --fs-xs: 15px;
  --fs-md: 22px;
  --nav-w: 120px;
}

body.tv-mode .nav-link {
  font-size: 15px;
}

body.tv-mode .nav-link svg {
  width: 30px;
  height: 30px;
}

body.tv-mode .strip-posters {
  grid-auto-columns: 220px;
}

body.tv-mode .strip-wide {
  grid-auto-columns: 380px;
}

body.tv-mode :focus-visible,
body.tv-mode .card:focus {
  outline: 4px solid var(--accent);
  outline-offset: 4px;
}

body.tv-mode .card:focus .card-media {
  transform: scale(1.04);
}

body.tv-mode .card-media {
  transition: transform 0.2s;
}

/* ----------------------------------------------------------------- small */

@media (max-width: 900px) {
  .episode {
    grid-template-columns: minmax(120px, 180px) 1fr auto;
    gap: 14px;
  }

  .episode-num {
    display: none;
  }

  .episode-title::before {
    content: attr(data-num) ". ";
    color: var(--text-3);
  }

  .listen {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .listen-art {
    max-width: 260px;
  }

  .text-btn span:not(#speedLabel):not(#qualityLabel) {
    display: none;
  }

  .text-btn:has(svg) {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
}

@media (max-width: 760px) {
  :root {
    --nav-w: 0px;
  }

  .nav {
    inset: auto 0 0 0;
    width: auto;
    height: calc(62px + env(safe-area-inset-bottom));
    flex-direction: row;
    padding: 0 4px env(safe-area-inset-bottom);
    border-right: 0;
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-deep) 94%, transparent);
    backdrop-filter: blur(10px);
  }

  .nav-brand {
    display: none;
  }

  .nav-links,
  .nav-end {
    display: contents;
  }

  .nav-link {
    width: auto;
    min-width: 0;
    flex: 1 1 0;
    padding: 8px 2px;
    font-size: 11px;
  }

  .nav-link.active::before {
    top: 0;
    bottom: auto;
    left: 14px;
    right: 14px;
    width: auto;
    height: 3px;
    border-radius: 0 0 3px 3px;
  }

  #settingsBtn,
  .nav-extra {
    display: none;
  }

  .page {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .hero,
  .title-hero {
    min-height: 0;
    padding-top: 50vw;
    padding-bottom: 32px;
  }

  .hero-art {
    bottom: auto;
    height: 72vw;
  }

  .hero-art img {
    object-position: center;
  }

  .hero-art::after {
    background: linear-gradient(to top, var(--bg) 0%, color-mix(in srgb, var(--bg) 55%, transparent) 30%, transparent 60%);
  }

  .hero-kicker {
    font-size: var(--fs);
  }

  .hero-kicker-lead {
    display: none;
  }

  .hero-switch {
    display: none;
  }

  .hero-actions .btn {
    flex: 1;
  }

  .hero-desc {
    font-size: var(--fs);
  }

  .row {
    margin-top: 34px;
  }

  .row-title {
    font-size: 28px;
  }

  .row-nav {
    display: none;
  }

  .strip {
    gap: 12px;
  }

  .strip-posters {
    grid-auto-columns: 38vw;
  }

  .strip-wide {
    grid-auto-columns: 72vw;
  }

  .grid-posters {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 22px 12px;
  }

  .page-head {
    padding-top: 36px;
  }

  .episode {
    grid-template-columns: 132px 1fr;
    align-items: start;
    gap: 12px;
    padding: 12px;
  }

  .episode .watch-toggle {
    display: none;
  }

  .episode-title {
    font-size: var(--fs);
  }

  .episode-top {
    flex-direction: column;
    gap: 0;
  }

  .episode-desc {
    -webkit-line-clamp: 3;
  }

  .season-bar {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .season-poster {
    width: 72px;
  }

  .season-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .order-entry {
    grid-template-columns: 48px 1fr 52px;
  }

  .order-entry {
    grid-template-columns: 48px 1fr 52px;
    column-gap: 12px;
  }

  .order-entry::before {
    left: 47px;
  }

  .order-num {
    font-size: 32px;
    padding-right: 8px;
  }

  .order-title {
    font-size: var(--fs-md);
  }

  .order-divider {
    padding-left: 60px;
  }

  .result-thumb {
    width: 96px;
  }

  .player-times {
    display: none;
  }

  .player-title {
    font-size: 24px;
  }

  .player-desc {
    display: none;
  }

  .controls {
    gap: 0;
  }

  .volume-slider,
  #backTenBtn,
  #fwdTenBtn,
  #pipBtn {
    display: none;
  }

  .time {
    font-size: var(--fs-xs);
  }

  .upnext {
    bottom: 110px;
  }

  :root {
    --drawer-w: 100vw;
  }

  .player.drawer-open .player-stage {
    right: 0;
  }

  .drawer-item {
    grid-template-columns: 128px 1fr;
  }

  .modal-inner {
    padding: 20px 18px;
  }

  .toast {
    bottom: calc(80px + env(safe-area-inset-bottom));
  }
}

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

/* ------------------------------------------------- skip intro, previews */

.skip-btn {
  position: absolute;
  z-index: 4;
  right: max(22px, env(safe-area-inset-right));
  bottom: 130px;
  height: 48px;
  padding: 0 22px;
  border-radius: var(--r);
  background: rgba(12, 22, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  font-weight: 700;
  font-size: var(--fs);
  animation: sheetIn 0.25s ease;
  transition: background-color 0.15s, border-color 0.15s;
}

.skip-btn:hover,
.skip-btn:focus-visible {
  background: #fff;
  border-color: #fff;
  color: #0a131c;
}

.scrub-preview {
  position: absolute;
  bottom: 58px;
  left: 0;
  width: 208px;
  height: 117px;
  transform: translateX(-50%);
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
}

.scrub-preview div {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
}

.scrub:hover .scrub-preview,
.scrub.dragging .scrub-preview {
  opacity: 1;
}

/* --------------------------------------------- watch party, other screens */

.party-chip {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.controls .icon-btn.on {
  color: var(--accent);
}

.together-menu {
  width: 290px;
  padding: 12px;
  gap: 2px;
}

.together-head {
  font-weight: 700;
  font-size: var(--fs-sm);
  padding: 4px 4px 0;
}

.together-head:not(:first-child) {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.together-note {
  margin: 0;
  padding: 2px 4px 6px;
  font-size: var(--fs-xs);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.66);
}

.together-menu button {
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  margin-top: 4px;
}

.together-devices {
  display: grid;
}

.party-banner,
.cast-bar {
  position: fixed;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--raised-2);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.party-banner[hidden],
.cast-bar[hidden] {
  display: none;
}

.party-banner {
  top: 18px;
  right: 18px;
  max-width: min(440px, calc(100vw - 36px));
  padding: 12px 12px 12px 16px;
  border-radius: var(--r-lg);
  border-left: 4px solid var(--accent);
  animation: sheetIn 0.25s ease;
}

.party-banner-text {
  min-width: 0;
  display: grid;
  gap: 2px;
  font-size: var(--fs-sm);
}

.party-banner-text span {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.party-banner .icon-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.party-banner .icon-btn svg {
  width: 18px;
  height: 18px;
}

.cast-bar {
  left: calc(var(--nav-w) + 18px);
  right: 18px;
  bottom: 18px;
  padding: 10px 12px 10px 18px;
  border-radius: var(--r-lg);
}

.cast-bar-text {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: var(--fs-sm);
}

.cast-bar-text span {
  color: var(--text-2);
}

.cast-bar-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.is-casting .page {
  padding-bottom: 96px;
}

body.player-open .party-banner,
body.player-open .cast-bar {
  display: none;
}

/* ---------------------------------------------------------------- remote */

.remote-body {
  max-width: 520px;
}

.remote-list {
  display: grid;
  gap: 10px;
}

.remote-device {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line);
  transition: border-color 0.15s, background-color 0.15s;
}

.remote-device:hover,
.remote-device:focus-visible {
  border-color: var(--accent);
  background: var(--raised-2);
}

.remote-device-name {
  font-weight: 700;
  font-size: var(--fs-md);
}

.remote-device-what {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.remote-device-id {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.remote-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line);
}

.remote-card [hidden] {
  display: none;
}

.remote-target {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.remote-target strong {
  flex: 1;
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remote-show {
  color: var(--accent-text);
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-bottom: -10px;
}

.remote-show:empty {
  display: none;
}

.remote-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(28px, 7vw, 38px);
  line-height: 1.02;
}

.remote-idle {
  margin: -6px 0 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.remote-scrub {
  display: grid;
  gap: 4px;
}

.remote-seek,
.remote-vol {
  width: 100%;
  accent-color: var(--accent);
  height: 28px;
}

.remote-time {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.remote-keys {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.remote-btn {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  transition: background-color 0.15s, transform 0.1s;
}

.remote-btn:active {
  transform: scale(0.94);
}

.remote-btn:hover {
  background: var(--raised-2);
}

.remote-btn svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.remote-btn.remote-play {
  width: 76px;
  height: 76px;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

.remote-btn.remote-play svg {
  width: 34px;
  height: 34px;
}

.remote-btn.remote-btn-sm {
  width: 44px;
  height: 44px;
}

.remote-volume {
  display: flex;
  align-items: center;
  gap: 12px;
}

.remote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
}

.remote-actions .btn {
  margin-top: 8px;
}

.remote-actions .btn-primary {
  flex: 1 1 100%;
}

/* ----------------------------------------------------------------- stats */

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.stat-tile {
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line);
}

.stat-label {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.stat-value {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(44px, 6vw, 64px);
  line-height: 1;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-note {
  color: var(--text-3);
  font-size: var(--fs-sm);
  margin-top: 6px;
}

.stat-section {
  margin-top: 40px;
}

.stat-heading {
  font-family: var(--display);
  font-weight: 800;
  font-size: 28px;
  margin: 0 0 14px;
}

.stat-days {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  gap: 6px;
  height: 190px;
  padding: 16px 16px 12px;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line);
}

.stat-day {
  display: grid;
  grid-template-rows: 18px 1fr 20px;
  gap: 4px;
  min-width: 0;
  text-align: center;
}

.stat-day-value {
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

.stat-day-bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
}

.stat-day-bar span {
  display: block;
  width: min(100%, 34px);
  border-radius: 4px 4px 0 0;
  background: color-mix(in srgb, var(--accent) 55%, var(--raised));
}

.stat-day.is-today .stat-day-bar span {
  background: var(--accent);
}

.stat-day-name {
  font-size: var(--fs-xs);
  color: var(--text-3);
}

.stat-day.is-today .stat-day-name {
  color: var(--text);
  font-weight: 700;
}

.stat-facts {
  margin: 12px 2px 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.stat-bars {
  display: grid;
  gap: 10px;
}

.stat-bar,
.stat-show summary,
.stat-season {
  display: grid;
  grid-template-columns: minmax(120px, 280px) 1fr 76px;
  align-items: center;
  gap: 14px;
}

.stat-bar-name,
.stat-show-name,
.stat-season-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-bar-track {
  display: block;
  height: 8px;
  border-radius: 4px;
  background: var(--bg-deep);
  overflow: hidden;
}

.stat-bar-track span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}

.stat-bar-value,
.stat-show-count {
  text-align: right;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-show {
  border-bottom: 1px solid var(--line);
}

.stat-show summary {
  padding: 14px 2px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.stat-show summary::-webkit-details-marker {
  display: none;
}

.stat-show summary:hover .stat-show-name {
  color: var(--accent-text);
}

.stat-seasons {
  display: grid;
  gap: 2px;
  padding: 0 0 14px;
}

.stat-season {
  padding: 7px 2px 7px 16px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-2);
}

.stat-season:hover {
  background: var(--raised);
  color: var(--text);
}

.stat-season.is-done .stat-season-name {
  color: var(--text);
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ------------------------------------------------------------ story order */

.order-play {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-bottom: 28px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--raised);
  border: 1px solid var(--line);
}

.order-play .btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.order-next {
  flex: 1 1 220px;
  min-width: 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}

/* ------------------------------------------------------- Ninjargon extras */

/* Point at (or tap) a Ninjargon title to read it. */
body.ninjargon .hero-title:hover,
body.ninjargon .page-title:hover,
body.ninjargon .row-title:hover,
body.ninjargon .title-logo:hover {
  font-family: var(--display);
  letter-spacing: normal;
}

.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--line);
  color: inherit;
  font: inherit;
  resize: vertical;
}

.field textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.ninjargon-out {
  min-height: 92px;
  padding: 18px;
  border-radius: var(--r);
  background: var(--bg-deep);
  border: 1px solid var(--line);
  font-family: "Ninjargon", var(--display);
  font-size: 34px;
  line-height: 1.35;
  letter-spacing: 0.06em;
  color: var(--accent-text);
  overflow-wrap: anywhere;
}

.ninjargon-out.is-empty {
  opacity: 0.35;
}

.ninjargon-keys {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px;
}

.ninjargon-key {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  border-radius: var(--r);
  background: var(--bg);
  border: 1px solid var(--line);
  transition: border-color 0.12s, background-color 0.12s;
}

.ninjargon-key:hover,
.ninjargon-key:focus-visible {
  border-color: var(--accent);
  background: var(--raised-2);
}

.ninjargon-key b {
  font-family: "Ninjargon", var(--display);
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
}

.ninjargon-key i {
  font-style: normal;
  font-size: 11px;
  color: var(--text-3);
}

.ninjargon-key.is-wide {
  grid-column: span 3;
  font-size: var(--fs-sm);
  font-weight: 700;
  align-content: center;
}

@media (max-width: 760px) {
  .skip-btn {
    bottom: 112px;
    height: 44px;
    padding: 0 16px;
  }

  .scrub-preview {
    width: 144px;
    height: 81px;
  }

  .party-chip {
    display: none;
  }

  .together-menu {
    right: -60px;
    width: min(290px, 88vw);
  }

  .party-banner {
    top: 10px;
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .cast-bar {
    left: 10px;
    right: 10px;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body.is-casting .page {
    padding-bottom: 150px;
  }

  .remote-btn {
    width: 50px;
    height: 50px;
  }

  .stat-days {
    gap: 3px;
    padding: 12px 8px 10px;
  }

  .stat-day-value {
    display: none;
  }

  .stat-day {
    grid-template-rows: 1fr 20px;
  }

  .stat-day-name {
    font-size: 10px;
    overflow: hidden;
  }

  .stat-bar,
  .stat-show summary,
  .stat-season {
    grid-template-columns: minmax(0, 1.4fr) minmax(40px, 1fr) 58px;
    gap: 10px;
  }
}

/* Page gutters for the newer pages. */
.stat-tiles,
.stat-section,
.remote-body {
  margin-left: var(--gutter);
  margin-right: var(--gutter);
}

.stat-tiles {
  margin-top: 20px;
}

.stats-page {
  max-width: 1180px;
}

.remote-body {
  margin-top: 20px;
}

.remote-body .empty {
  padding-left: 0;
  padding-right: 0;
}

.order-play {
  margin: 20px var(--gutter) 0;
  max-width: calc(900px - var(--gutter));
}

@media (max-width: 760px) {
  /* Down by the thumb, clear of page titles. */
  .party-banner {
    top: auto;
    bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body.is-casting .party-banner {
    bottom: calc(138px + env(safe-area-inset-bottom));
  }
}

/* Intro and credits marked on the seek bar. */
.scrub-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.62);
}

.scrub-zone[hidden] {
  display: none;
}

.scrub-fill {
  z-index: 1;
  opacity: 0.92;
}

/* The whole site in Ninjargon. The font only has capitals. */
body.ninjargon-all,
body.ninjargon-all *:not(#ninjargonInput):not(.ninjargon-key i):not(code) {
  font-family: "Ninjargon", var(--text-font) !important;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body.ninjargon-all .player-desc,
body.ninjargon-all .ep-desc,
body.ninjargon-all .hint,
body.ninjargon-all .page-lede {
  line-height: 1.7;
}
