/* AI Plays Go — public viewer. Colours come from ../tokens.css (shared with the admin
   console); the tokens below are local to the public site. */
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-opsz-italic.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap;
}

:root {
  --display: "Newsreader", Georgia, "Times New Roman", serif;
  --focus: var(--accent);
  --link: #7fb2f0;
  --link-hover: #a9cbf5;
  --surface-sunk: #141413;
  --current: #ef4d4d;
  --muted: #9b988f;
  --btn-bg: #2369c4;
  --btn-bg-hover: #1d5aa8;
  --wood-hi: #e2c086;
  --stone-ring: rgba(0, 0, 0, .55);
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px -12px rgba(0,0,0,.6);
  --gutter: 16px;
  --measure: 68ch;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
:root[data-theme="light"] {
  --link: #1a5fb4;
  --link-hover: #12457f;
  --surface-sunk: #f5f3ee;
  --current: #d12a2a;
  --muted: #5d5a53;
  --btn-bg: #1f63bd;
  --btn-bg-hover: #194f97;
  --stone-ring: rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(40,30,10,.10), 0 8px 24px -14px rgba(40,30,10,.30);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body { font-size: 16px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; outline: none; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
img, svg, video { max-width: 100%; }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
code { background: var(--surface-2); padding: .08em .35em; border-radius: 4px; }
kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 .35em; background: var(--surface-2); font-size: .8em; }
h1, h2, h3 { font-family: var(--display); font-weight: 560; line-height: 1.12; letter-spacing: -0.012em; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 1.5rem + 2.2vw, 3.1rem); font-variation-settings: "opsz" 72; }
h2 { font-size: 1.6rem; margin-top: 2.2em; font-variation-settings: "opsz" 36; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted, .note { color: var(--text-2); }
.note { font-size: .9rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface-2); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
html { scrollbar-color: var(--surface-3) var(--surface); }

/* layout */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); }
.page-head { padding: 40px 0 8px; max-width: 780px; }
.page-head .lede { margin-bottom: 1.2em; }
.lede { font-size: 1.15rem; color: var(--text-2); max-width: var(--measure); }
.crumbs, .ep-meta { color: var(--muted); font-size: .9rem; margin-bottom: .6em; }
.crumbs a, .ep-meta a { color: var(--text-2); }
.section-title { margin-top: 2.5em; }

/* header */
.preview-banner { background: color-mix(in srgb, var(--warning) 22%, var(--surface)); color: var(--text); font-size: .88rem; padding: 6px var(--gutter); text-align: center; border-bottom: 1px solid color-mix(in srgb, var(--warning) 45%, var(--surface)); }
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(1.2) blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 20px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-family: var(--display); font-size: 1.25rem; font-weight: 600; white-space: nowrap; }
.brand:hover { color: var(--text); }
.brand-mark { width: 30px; height: 30px; }
.bm-black { fill: var(--stone-black); stroke: var(--black-player); stroke-width: 1.6; }
.bm-white { fill: var(--stone-white); stroke: var(--white-player); stroke-width: 1.6; }
.site-nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { color: var(--text-2); text-decoration: none; padding: 8px 10px; border-radius: 6px; font-size: .95rem; white-space: nowrap; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current] { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 6px 6px 0 0; }
.theme-toggle { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); cursor: pointer; }
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.theme-toggle .i-moon { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-moon { display: block; }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 6px 12px; padding-top: 8px; }
  .site-nav { order: 3; width: 100%; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px; mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .theme-toggle { margin-left: auto; }
}

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; background: var(--surface-sunk); }
.footer-inner { max-width: 1040px; margin: 0 auto; padding: 28px var(--gutter) 36px; color: var(--text-2); font-size: .92rem; }
.footer-inner p { max-width: 72ch; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 8px; background: var(--btn-bg); color: #fff; text-decoration: none; font-weight: 600; font-size: .95rem; border: 1px solid transparent; transition: background-color .18s var(--ease), transform .18s var(--ease); }
.btn:hover { color: #fff; background: var(--btn-bg-hover); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--border); }
.btn-quiet:hover { background: var(--surface-2); color: var(--text); }
.btn + .btn { margin-left: 8px; }

/* player identity */
.pdot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; flex: none; }
.pdot-black { background: var(--stone-black); box-shadow: 0 0 0 2.5px var(--black-player); }
.pdot-white { background: var(--stone-white); box-shadow: 0 0 0 2.5px var(--white-player); }
.aid { display: inline-flex; align-items: baseline; gap: .35em; font-size: .78rem; font-weight: 600; letter-spacing: .01em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.aid-name { font-weight: 450; }
.aid-l0 { color: var(--muted); }
.aid-bot { border-style: dashed; }
.won { font-size: .75rem; font-weight: 700; color: var(--good); margin-left: 8px; text-transform: uppercase; letter-spacing: .06em; }
.draft { color: var(--warning); font-weight: 600; }
.pline { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.result { font-weight: 600; color: var(--text); }

/* board (shared by thumbnails, hero and reviewer) */
.goban { display: block; width: 100%; height: auto; }
.goban-wood { fill: var(--board); }
.goban-grid { stroke: var(--board-line); stroke-width: .035; fill: none; }
.goban-star { fill: var(--board-line); }
.goban-coord { font: 600 .42px var(--font); fill: var(--board-line); text-anchor: middle; opacity: .8; }
.stone-black { fill: var(--stone-black); }
.stone-white { fill: var(--stone-white); stroke: rgba(0,0,0,.28); stroke-width: .03; }
.last-mark { fill: none; stroke-width: .07; }
.last-on-black { stroke: var(--stone-white); }
.last-on-white { stroke: var(--stone-black); }

/* home */
.home-hero { max-width: 1240px; margin: 0 auto; padding: 56px var(--gutter) 24px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.home-hero h1 { font-size: clamp(2.5rem, 1.6rem + 3.6vw, 4.6rem); letter-spacing: -0.025em; line-height: 1.02; margin-bottom: .45em; font-weight: 520; }
.hh-links { margin: 1.6em 0; }
.prior-art { font-size: .95rem; color: var(--text-2); max-width: 56ch; border-top: 1px solid var(--border); padding-top: 1em; }
.hero-board { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 18px; box-shadow: var(--shadow); }
.hero-board .goban { border-radius: 6px; }
.hero-board figcaption { padding: 16px 4px 2px; }
.hb-move { font-family: var(--mono); font-size: .9rem; color: var(--text-2); margin-bottom: .4em; }
.hero-board blockquote { margin: 0 0 .6em; font-family: var(--display); font-style: italic; font-size: 1.3rem; line-height: 1.3; }
.hb-who { color: var(--text-2); font-size: .95rem; }
.hb-who strong { color: var(--text); }
.numbers { max-width: 1240px; margin: 24px auto 0; padding: 0 var(--gutter); }
.numbers dl { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.numbers dl > div { padding: 22px 24px 22px 0; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; }
.numbers dl > div + div { padding-left: 24px; border-left: 1px solid var(--border); }
.numbers dd { margin: 0; font-family: var(--display); font-size: 3rem; line-height: 1; font-weight: 500; letter-spacing: -0.02em; }
.numbers .of { font-size: 1.2rem; color: var(--text-2); margin-left: .2em; }
.numbers dt { color: var(--text-2); font-size: .95rem; max-width: 30ch; }
.home-cols { max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 48px; }
.home-episode h3 { font-size: 2rem; }
.home-episode h3 a { color: var(--text); text-decoration: none; }
.home-episode h3 a:hover { text-decoration: underline; }
.lede-small { color: var(--text-2); }
@media (max-width: 900px) {
  .home-hero, .home-cols { grid-template-columns: 1fr; gap: 28px; }
  .home-hero { padding-top: 32px; }
  .numbers dl { grid-template-columns: 1fr; }
  .numbers dl > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--border); }
  .numbers dd { font-size: 2.4rem; }
}

/* cards & lists */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin-top: 16px; }
.gcard { display: grid; grid-template-columns: 1fr; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.gcard-link { display: block; background: var(--surface-3); }
.gcard-link .goban { max-width: 260px; margin: 16px auto; }
.card-poster { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gcard-body { padding: 14px 16px 16px; }
.gcard h3 { font-size: 1.15rem; margin-bottom: .5em; }
.gcard h3 a { color: var(--text); text-decoration: none; }
.gcard h3 a:hover { text-decoration: underline; }
.gcard-players { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.gcard-meta { color: var(--text-2); font-size: .88rem; margin: 0; }
.ep-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.ep-item { display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 20px 0; border-top: 1px solid var(--border); align-items: start; }
.ep-item h2 { margin: 0 0 .3em; font-size: 1.8rem; }
.ep-item h2 a { color: var(--text); text-decoration: none; }
.ep-item h2 a:hover { text-decoration: underline; }
.ep-games { color: var(--muted); font-size: .88rem; }
.ep-thumb .goban { border-radius: 6px; }
@media (max-width: 560px) { .ep-item { grid-template-columns: 84px 1fr; gap: 14px; } .ep-item h2 { font-size: 1.4rem; } }
.empty { border: 1px dashed var(--border); border-radius: 12px; padding: 28px; color: var(--text-2); max-width: 680px; }
.empty h2, .empty h3 { margin-top: 0; color: var(--text); font-size: 1.3rem; }
.empty-page { padding-top: 80px; }

/* prose (episodes, method) */
.prose { max-width: var(--measure); font-size: 1.08rem; }
.episode .prose { font-family: var(--display); font-size: 1.24rem; line-height: 1.6; font-variation-settings: "opsz" 16; }
.episode .prose h2 { font-size: 1.55rem; }
.prose h2 { margin-top: 1.8em; }
.prose li { margin-bottom: .4em; }
.prose blockquote { margin: 1em 0; padding-left: 1em; border-left: 1px solid var(--border); color: var(--text-2); }
.method .prose { font-size: 1.02rem; }
.toc ol { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 12px 0; margin: 0 0 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: .92rem; }
.cited { margin-top: 28px; display: grid; gap: 16px; }
.cited .gcard { grid-template-columns: 180px 1fr; }
.cited .gcard-link .goban { margin: 12px; max-width: none; width: calc(100% - 24px); }
@media (max-width: 560px) { .cited .gcard { grid-template-columns: 1fr; } .cited .gcard-link .goban { max-width: 220px; margin: 12px auto; } }
.charts-details summary { cursor: pointer; color: var(--link); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 12px; }
.chart-png { margin: 0; background: var(--surface-2); border-radius: 8px; padding: 8px; }
.chart-png img { display: block; width: 100%; border-radius: 4px; }
.chart-png figcaption { font-size: .85rem; color: var(--text-2); padding: 8px 4px 2px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 12px 0 20px; border: 1px solid var(--border); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { font-weight: 600; color: var(--text-2); background: var(--surface-2); font-size: .85rem; white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tbody th { font-weight: 500; }
td.num, th.num { text-align: right; }
.sub { color: var(--muted); font-size: .82rem; font-weight: 400; }
.unit { font-weight: 400; color: var(--muted); font-size: .78rem; }
.compare th[scope=col] { white-space: normal; }
table.compare td { width: 30%; }
.games-table td:nth-child(2), .games-table td:nth-child(3) { white-space: nowrap; }
.models-table thead th button { all: unset; cursor: pointer; display: inline-block; }
.models-table thead th button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.models-table thead th[aria-sort="ascending"] button::after { content: " ↑"; }
.models-table thead th[aria-sort="descending"] button::after { content: " ↓"; }
.table-sticky { max-height: 76vh; }
.table-sticky thead th { position: sticky; top: 0; z-index: 2; }
.table-sticky tbody th { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 170px; }
.table-sticky thead th:first-child { left: 0; z-index: 3; }
.runs { white-space: nowrap; }
.run { display: inline-block; font-size: .74rem; padding: 0 6px; margin: 1px 3px 1px 0; border-radius: 4px; border: 1px solid var(--border); font-family: var(--mono); }
.run-works { border-color: color-mix(in srgb, var(--good) 60%, var(--border)); color: var(--text); background: color-mix(in srgb, var(--good) 16%, transparent); }
.run-needs-key { color: var(--text-2); border-style: dashed; }
.run-untested { color: var(--muted); }
.run-blocked { color: var(--text-2); text-decoration: line-through; }
.tier { font-size: .85rem; color: var(--text-2); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: end; margin: 8px 0 4px; font-size: .9rem; color: var(--text-2); }
.filters label { display: flex; flex-direction: column; gap: 4px; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; padding-bottom: 8px; }
.filters output { padding-bottom: 8px; color: var(--muted); }
input[type=search], select { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 7px 10px; min-height: 38px; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0; margin: 8px 0 0; border-top: 1px solid var(--border); }
.facts > div { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--border); }
.facts dt { font-size: .82rem; color: var(--muted); }
.facts dd { margin: 2px 0 0; }
.access { padding-left: 1.1em; }
.access li { margin-bottom: 6px; color: var(--text-2); }

/* segmented control */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; padding: 2px; background: var(--surface-2); gap: 2px; }
.seg button { font: inherit; font-size: .88rem; color: var(--text-2); background: none; border: 0; padding: 6px 12px; border-radius: 6px; cursor: pointer; min-height: 34px; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }

/* video */
.video-block { margin: 18px 0 24px; }
.vtabs { display: flex; gap: 4px; margin-bottom: 8px; }
.vtabs button { font: inherit; font-size: .9rem; background: none; border: 1px solid transparent; color: var(--text-2); padding: 6px 12px; border-radius: 7px; cursor: pointer; }
.vtabs button[aria-selected="true"] { border-color: var(--border); background: var(--surface-2); color: var(--text); font-weight: 600; }
.vpane video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 10px; }
.track-switch { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .88rem; color: var(--text-2); flex-wrap: wrap; }
.track-switch button { font: inherit; font-size: .85rem; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.track-switch button[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }
.yt-facade { aspect-ratio: 16 / 9; display: grid; place-content: center; justify-items: center; gap: 10px; background: var(--surface-sunk); border: 1px solid var(--border); border-radius: 10px; text-align: center; padding: 16px; }
.yt-facade p { color: var(--muted); font-size: .85rem; margin: 0; max-width: 40ch; }
.yt-play { display: inline-flex; gap: 10px; align-items: center; font: inherit; font-weight: 600; background: var(--btn-bg); color: #fff; border: 0; border-radius: 999px; padding: 12px 22px; cursor: pointer; }
.yt-play svg { width: 18px; height: 18px; fill: currentColor; }
.yt-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; }

/* ============================================================== reviewer
   Stacked on phones and short windows; an app-like viewport layout (no page scroll)
   from 900px wide and 600px tall: board left, details right, curve strip at the bottom. */
.reviewer { display: grid; gap: 14px; padding: 14px var(--gutter) 0; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "bar" "board" "side" "chart"; max-width: 1320px; margin: 0 auto; }
.rv-bar { grid-area: bar; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; }
.rv-crumb { margin: 0; font-size: .9rem; display: flex; gap: 8px; color: var(--muted); }
.rv-crumb a { color: var(--text-2); }
.rv-bar h1 { font-size: 1.35rem; margin: 0; min-width: 0; flex: 1 1 320px; font-variation-settings: "opsz" 24; }
.rv-vs { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: .9rem; }
.rv-vs-p { display: inline-flex; align-items: center; gap: 6px; }
.rv-vs-sep { color: var(--muted); }
.rv-vs-res { font-family: var(--mono); font-size: .9rem; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }

.rv-board-col { grid-area: board; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.board-host { width: 100%; max-width: 640px; aspect-ratio: 1; }
.board-host .goban { border-radius: 8px; box-shadow: var(--shadow); touch-action: manipulation; }
.rv-controls { width: 100%; max-width: 640px; margin-top: 10px; }
.rv-buttons { display: flex; align-items: center; justify-content: center; gap: 4px; }
.rv-buttons button { width: 44px; height: 38px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: background-color .15s var(--ease); }
.rv-buttons button:hover:not(:disabled) { background: var(--surface-3); }
.rv-buttons button:disabled { opacity: .4; cursor: default; }
.rv-buttons button[data-nav$="key"] { color: var(--warning); }
.rv-buttons svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rv-counter { min-width: 84px; text-align: center; font-family: var(--mono); font-size: .92rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.rv-slider { position: relative; margin: 8px 4px 0; padding-bottom: 12px; }
.rv-slider input[type=range] { width: 100%; accent-color: var(--accent); margin: 0; height: 22px; cursor: pointer; }
.ticks { position: absolute; left: 8px; right: 8px; bottom: 0; height: 9px; }
.ticks span { position: absolute; top: 0; width: 3px; height: 9px; margin-left: -1.5px; border-radius: 2px; }
.ticks .tk-black { background: var(--stone-black); box-shadow: 0 0 0 1px var(--text-2); }
.ticks .tk-white { background: var(--stone-white); box-shadow: 0 0 0 1px var(--text-2); }
.ticks .tk-cur { width: 6px; height: 13px; margin-left: -3px; top: -2px; background: var(--current); border-radius: 3px; z-index: 1; box-shadow: 0 0 0 1.5px var(--surface); }
.ticks .tk-cur[hidden] { display: none; }

.rv-side { grid-area: side; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.rv-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--border); flex: none; }
.rv-tabs button { font: inherit; font-size: .9rem; color: var(--text-2); background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; cursor: pointer; }
.rv-tabs button:hover { color: var(--text); }
.rv-tabs button[aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.rv-tabpanel { padding: 14px 16px 10px; min-height: 0; }
.rv-side { container-type: inline-size; }
@container (min-width: 720px) {
  [data-panel] { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: 28px; grid-auto-flow: row dense; align-items: start; }
  [data-panel] > .pn-head, [data-panel] > .pn-stats, [data-panel] > .pn-intro { grid-column: 1 / -1; }
  [data-panel] > .pn-access-block { grid-column: 2; grid-row: 3 / span 6; }
  [data-panel] > .pn-block:not(.pn-access-block) { grid-column: 1; }
  [data-panel] .pn-stats { max-width: 560px; }
}
.rv-tabpanel[hidden] { display: none; }
.tp-title { font-size: 1.25rem; margin: 0 0 .3em; }
.rv-players { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.rv-player p { margin: 0; }
.rv-pname { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rv-pname > span { color: var(--muted); font-size: .85rem; }
.rv-setup { font-size: .85rem; color: var(--muted); margin-top: 3px !important; }
.rv-actions { margin: 0 0 14px; }
.moves-table { font-size: .84rem; }
.moves-table th, .moves-table td { padding: 5px 6px; }
.moves-table thead th { position: sticky; top: -14px; z-index: 1; }
.moves-table tr.is-current { background: color-mix(in srgb, var(--accent) 16%, transparent); }

.pn-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.pn-move { font-family: var(--display); font-size: 1.6rem; font-weight: 560; line-height: 1.1; margin: 0; display: flex; align-items: center; }
.pn-move .mono { font-size: 1.4rem; font-weight: 600; margin-left: .3em; }
.pn-key { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--warning); border: 1px solid color-mix(in srgb, var(--warning) 55%, transparent); border-radius: 999px; padding: 1px 8px; }
.pn-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 10px 0 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.pn-stats > div { padding: 8px 8px 8px 0; }
.pn-stats > div + div { padding-left: 10px; border-left: 1px solid var(--border); }
.pn-stats dt { font-size: .75rem; color: var(--muted); }
.pn-stats dd { margin: 0; font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.pn-stats .bad { color: var(--critical); }
.pn-block { margin: 0 0 12px; }
.pn-label { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin: 0 0 4px; }
.pn-analysis { font-size: .95rem; line-height: 1.5; margin: 0; }
.pn-say { font-family: var(--display); font-style: italic; font-size: 1.1rem; margin: 0; color: var(--text); }
.pn-refusals { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.pn-refusals li { padding: 6px 10px; border-radius: 6px; background: color-mix(in srgb, var(--critical) 13%, transparent); margin-bottom: 4px; }
.pn-refusals li strong { color: var(--text); }
.pn-access { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.pn-access li { display: grid; grid-template-columns: 104px 1fr; gap: 8px; padding: 5px 0; border-top: 1px solid var(--border); }
.pn-access li:first-child { border-top: 0; }
.pn-access .k { color: var(--muted); font-size: .82rem; }
.pn-access .file { font-family: var(--mono); font-size: .85rem; background: var(--surface-3); padding: 1px 6px; border-radius: 4px; margin: 0 4px 2px 0; display: inline-block; }
.pn-access .opened { color: var(--text); }
.pn-hint { font-family: var(--mono); font-size: .8rem; white-space: pre-wrap; background: var(--surface-sunk); border-radius: 6px; padding: 8px; margin: 4px 0 0; color: var(--text-2); }
.pn-intro p { color: var(--text-2); font-size: .95rem; }
.pn-end { white-space: pre-wrap; font-size: .9rem; color: var(--text-2); }

.rv-chart { grid-area: chart; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rv-chart-head { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 4px; flex: none; }
.rv-chart-head h2 { margin: 0; font-size: 1.05rem; font-variation-settings: "opsz" 18; }
.seg-sm button { padding: 3px 10px; min-height: 28px; font-size: .82rem; }
.kthr { font-size: .82rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kthr select { min-height: 28px; padding: 1px 6px; font-size: .82rem; }
.chart-host { position: relative; width: 100%; height: 190px; cursor: crosshair; touch-action: pan-y; border-radius: 8px; flex: 1 1 auto; min-height: 0; }
.chart-host svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; overflow: visible; }
.chart-host .grid { stroke: var(--border); stroke-width: 1; }
.chart-host .mid { stroke: var(--muted); stroke-width: 1; }
.chart-host .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart-host .line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-host .area-black { fill: var(--text); opacity: .09; }
.chart-host .area-white { fill: var(--text); opacity: .045; }
.chart-host .zone { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }
.key-black { fill: var(--stone-black); stroke: var(--text-2); stroke-width: 1.5; }
.key-white { fill: var(--stone-white); stroke: var(--text-2); stroke-width: 1.5; }
.cursor { stroke: var(--current); stroke-width: 2; }
.cursor-ring { fill: none; stroke: var(--current); stroke-width: 2.5; }
.cursor-dot { fill: var(--current); }
.legend .lg { width: 14px; height: 14px; margin-right: 5px; vertical-align: -3px; overflow: visible; }
.legend .lg-cur { width: 18px; }
.chart-host .hover-line { stroke: var(--muted); stroke-width: 1; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface-3); border: 1px solid var(--border); border-radius: 7px; padding: 5px 9px; font-size: .8rem; box-shadow: var(--shadow); white-space: nowrap; transform: translate(-50%, 0); z-index: 3; }
.chart-tip[hidden] { display: none; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 0; font-size: .8rem; color: var(--text-2); }
.legend .sw { display: inline-block; width: 12px; height: 9px; border-radius: 2px; margin-right: 5px; }
.legend .sw-line { height: 2px; vertical-align: 3px; background: var(--text); }

@media (min-width: 900px) and (min-height: 600px) {
  body.is-app .site-footer { margin-top: 0; }
  .reviewer {
    height: calc(100dvh - var(--hdr, 92px)); max-width: none; padding: 10px 20px 12px; gap: 10px 22px;
    /* board column ≈ the square that fits the height left by the bar, controls and curve strip;
       the board itself is clamped again by a container query, so a rough estimate is safe */
    --bsz: max(300px, calc(0.79 * (100dvh - var(--hdr, 92px)) - 150px));
    grid-template-columns: minmax(0, var(--bsz)) minmax(360px, 1fr);
    grid-template-rows: auto minmax(0, 1fr) minmax(112px, 21%);
    grid-template-areas: "bar bar" "board side" "chart chart";
  }
  .rv-bar { flex-wrap: nowrap; }
  .rv-bar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.2rem; }
  .rv-vs { flex-wrap: nowrap; white-space: nowrap; }
  .rv-board-col { container-type: size; min-height: 0; justify-content: flex-start; }
  .board-host, .rv-controls { width: min(100cqw, 100cqh - 82px); max-width: none; }
  .rv-controls { margin-top: 8px; min-width: 300px; }
  .rv-tabpanel { overflow-y: auto; flex: 1; overscroll-behavior: contain; }
  .chart-host { height: auto; }
}
@media (min-width: 900px) and (min-height: 600px) {
  .rv-chart-head { flex-wrap: nowrap; overflow: hidden; }
  .legend { flex-wrap: nowrap; white-space: nowrap; }
}
@media (min-width: 900px) and (min-height: 600px) and (max-width: 1180px) {
  .rv-vs .aid-name { display: none; }
  .legend li:first-child { display: none; }
}
@media (max-width: 420px) {
  .rv-buttons button { width: 38px; }
  .rv-counter { min-width: 64px; font-size: .85rem; }
  .pn-access li { grid-template-columns: 1fr; gap: 2px; }
}

/* leaderboard */
.lb-row-int { width: 220px; }
.int-svg { display: block; width: 100%; height: 22px; }
.int-svg .whisker { stroke: var(--text-2); stroke-width: 2; stroke-linecap: round; }
.int-svg .pt { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.int-svg .zero { stroke: var(--border); }
.aid-effect, .lb-status { max-width: 780px; }
.anchor-ladder { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 12px 0; }
.anchor-ladder li { border: 1px dashed var(--border); border-radius: 999px; padding: 3px 12px; font-size: .88rem; color: var(--text-2); }

/* model page strip plot */
.strip-fig { margin: 16px 0; }
.strip-fig figcaption { font-size: .9rem; color: var(--text-2); margin-bottom: 8px; }
.strip { width: 100%; max-width: 680px; height: auto; display: block; }
.strip .grid { stroke: var(--border); }
.strip .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.strip .dot-black { fill: var(--black-player); stroke: var(--surface); stroke-width: 1.5; opacity: .85; }
.strip .dot-white { fill: var(--white-player); stroke: var(--surface); stroke-width: 1.5; opacity: .85; }
.strip .median { stroke: var(--text); stroke-width: 2; }
.strip-rows { font-size: .85rem; color: var(--text-2); padding-left: 1.4em; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) { .pdot, .ticks span { forced-color-adjust: none; } }

/* related work & limits */
.rw-list { display: grid; gap: 0; margin-top: 8px; }
.rw-item { padding: 22px 0; border-top: 1px solid var(--border); }
.rw-item h3 { font-size: 1.45rem; margin-bottom: .15em; }
.rw-item h3 a { color: var(--text); }
.rw-by { color: var(--muted); font-size: .92rem; margin-bottom: .8em; }
.rw-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; }
.rw-dl dt { font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.rw-dl dd { margin: 0; font-size: .97rem; color: var(--text); }
.rw-links { margin: 12px 0 0; font-size: .9rem; }
.limits { margin-top: 1em; }
.limits h2 { margin-top: 2em; }
.callout { font-size: 1rem; color: var(--text-2); }
@media (max-width: 820px) { .rw-dl { grid-template-columns: 1fr; gap: 12px; } }

.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

/* prompt-style rows in the reviewer panel (styles work) */
.pn-access .ok { color: var(--good); font-weight: 600; white-space: nowrap; }
.pn-access .warn { color: var(--warning); font-weight: 600; white-space: nowrap; }
.pn-notes { max-height: 12em; overflow: auto; }
