/* Preset D — Interactive Voice Matrix Map + Sticky Preview (#0d1016 + #f2b84b) */
:root {
  --bg: #0d1016;
  --surface: #141922;
  --surface-2: #1b212c;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #eef1f5;
  --text-body: #c4ccd8;
  --muted: #919cad;
  --accent: #f2b84b;
  --accent-hover: #f7c768;
  --accent-ink: #1a1305;
  --accent-soft: rgba(242, 184, 75, 0.15);
  --accent-border: rgba(242, 184, 75, 0.38);
  --spoiler-title: #f5ca74;
  --hdr-bg: rgba(13, 16, 22, 0.94);
  --hdr-text: #eef1f5;
  --hdr-muted: #919cad;
  --hdr-border: rgba(255, 255, 255, 0.08);
  --mob-nav-bg: #11161f;
  --mob-nav-text: #a5b0c0;
  --ok: #38b87c;
  --err: #f28b82;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --v-c0: #f2b84b;
  --v-c1: #4fc2b4;
  --v-c2: #ff7a59;
  --v-c3: #8fb0ff;
  --v-c4: #c3cad6;
  --v-c5: #a993ff;
  --v-c6: #68d391;
  --v-c7: #f687b3;
  --cell: 28px;
  --gap: 4px;
  --font-head: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', 'Cascadia Mono', Consolas, monospace;
}

.mono { font-family: var(--font-mono); }
.brand small { font: 600 12px var(--font-mono); color: var(--muted); font-weight: 600; }

/* Page Head + Progress Bar */
.head { padding: 24px 0 18px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.head h1 { margin: 0; font-family: var(--font-head); font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15; letter-spacing: -0.015em; font-weight: 800; max-width: 34ch; text-wrap: balance; }
.head-lead { margin: 8px 0 0; font-size: 15px; color: var(--text-body); max-width: 68ch; }
.facts { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin-top: 8px; }
.facts b { color: var(--text); font-weight: 600; }
.resume { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); font-size: 14px; }
.resume .bar { width: 110px; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.resume .bar i { display: block; height: 100%; width: 0%; background: var(--accent); transition: width 200ms ease; }
.resume a { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* Main Matrix Stage */
.stage { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; padding-bottom: 36px; }
.stage > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); }

.map { padding: 18px 20px 16px; }
.map-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.map-top h2 { margin: 0; font-family: var(--font-head); font-size: 18px; font-weight: 700; }
.map-top p { margin: 0; font-size: 13px; color: var(--muted); }
.voices { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.vbtn {
  --c: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.vbtn::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex-shrink: 0; }
.vbtn .n { font: 600 12px var(--font-mono); color: var(--muted); }
.vbtn:hover { border-color: var(--c); }
.vbtn[aria-pressed="true"] { background: color-mix(in srgb, var(--c) 18%, transparent); border-color: var(--c); }
.vbtn[data-all]::before { background: conic-gradient(var(--v-c0) 0 25%, var(--v-c1) 0 50%, var(--v-c2) 0 75%, var(--v-c3) 0); }

.map-grid-wrap { overflow-x: auto; max-width: 100%; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.grid { display: grid; grid-template-columns: 58px repeat(var(--ep-cols, 23), var(--cell)); gap: var(--gap); align-items: center; width: max-content; }
.grid .hd { font: 600 11px var(--font-mono); color: var(--muted); text-align: center; }
.row-lbl { font: 600 12px var(--font-mono); color: var(--muted); display: flex; flex-direction: column; line-height: 1.15; }
.row-lbl:hover { color: var(--accent); }
.row-lbl small { font-size: 10px; font-weight: 500; opacity: 0.78; }
.cell {
  width: var(--cell);
  height: var(--cell);
  border-radius: 5px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  display: grid;
  place-items: center;
  font: 600 11px var(--font-mono);
  color: rgba(255, 255, 255, 0.36);
  padding: 0;
  position: relative;
}
.cell.on { border: 0; background: var(--c); color: rgba(10, 12, 16, 0.85); }
.cell.on.lvl3 { background: color-mix(in srgb, var(--c) 48%, var(--surface)); color: #eef1f5; }
.cell.on.lvl4 { background: color-mix(in srgb, var(--c) 65%, var(--surface)); color: #0d1016; }
.cell.on.lvl5 { background: color-mix(in srgb, var(--c) 84%, var(--surface)); color: #0d1016; }
.cell.seen::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 3px; height: 2px; border-radius: 1px; background: rgba(10, 12, 16, 0.6); }
.cell:hover { outline: 2px solid var(--text); outline-offset: 1px; }
.cell.sel { outline: 2px solid #ffffff; outline-offset: 2px; }
.map-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.insight { color: var(--text); }
.insight b { color: var(--c, var(--accent)); font-weight: 600; }
.legend { display: flex; gap: 14px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Sticky Episode Preview Card */
.ep { overflow: hidden; position: sticky; top: 76px; }
.ep-still { position: relative; aspect-ratio: 16 / 9; background: #07090d; }
.ep-still img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep-still .code { position: absolute; left: 12px; top: 12px; font: 600 12px var(--font-mono); background: rgba(10, 12, 16, 0.82); color: #eef1f5; padding: 4px 8px; border-radius: 5px; }
.ep-still .play { position: absolute; right: 14px; bottom: -26px; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.ep-still .play:hover { background: var(--accent-hover); }
.ep-body { padding: 18px; }
.ep-preview-title { margin: 0 0 4px; font-family: var(--font-head); font-size: 19px; line-height: 1.25; font-weight: 700; padding-right: 56px; color: var(--text); }
.ep-body .orig { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.ep-body p { margin: 0 0 14px; font-size: 14px; color: var(--text-body); line-height: 1.55; }
.ep-lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ep-voices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.ep-voices .vbtn { height: 34px; font-size: 13px; padding: 0 10px; }
.watch {
  display: flex;
  width: 100%;
  height: 46px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--r-md);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 15px;
  border: 0;
}
.watch:hover { background: var(--accent-hover); }
.ep-nav { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: var(--muted); }
.ep-nav a:hover { color: var(--text); }

/* Compact Season List (5-col desktop for 15 seasons) */
.s-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.s-list--n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.s-list--n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.s-list--n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.s-item { padding: 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border); display: grid; gap: 6px; }
.s-item:hover { border-color: var(--accent); }
.s-item .t { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.s-item b { font-size: 16px; color: var(--text); }
.s-item small { font: 500 12px var(--font-mono); color: var(--muted); }
.s-item .dots { display: flex; gap: 4px; flex-wrap: wrap; }
.s-item .dots i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }

@media (max-width: 1180px) {
  .stage { grid-template-columns: 1fr; }
  .ep { position: static; display: grid; grid-template-columns: 1fr 1fr; }
  .ep-still { aspect-ratio: auto; min-height: 100%; }
  .s-list, .s-list--n4, .s-list--n5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .brand small { display: none; }
  .head { padding-top: 16px; }
  .resume { width: 100%; justify-content: space-between; }
  .resume .bar { display: none; }
  .stage { display: flex; flex-direction: column-reverse; }
  .ep { grid-template-columns: 1fr; width: 100%; }
  .ep-still { aspect-ratio: 16 / 9; }
  .map { padding: 14px 12px; width: 100%; }
  .grid {
    --cell: 32px;
    --gap: 3px;
    grid-template-columns: 44px repeat(var(--ep-cols, 23), 32px);
    width: max-content;
  }
  .cell { width: 32px; height: 32px; font-size: 11px; }
  .row-lbl small { display: none; }
  .voices { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .vbtn { flex: none; }
  .s-list, .s-list--n3, .s-list--n4, .s-list--n5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-list > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
