/* GOBAN — the Go-specific layer on top of the Industry design system.
 *
 * Design law (from the brief): the goban is the ONLY wooden object on screen;
 * everything else stays Industry paper + hairlines. Steel (--color-accent) is
 * the machine's voice ONLY — engine, eval, heatmap, live state — never
 * decoration. Barlow Condensed is used for anything numeric (clocks, move
 * numbers, ranks); Barlow for words. Registration "+" marks belong to the
 * chrome (.blueprint); the board keeps its nine real hoshi.
 */

:root {
  /* Industry's paper, warmed two degrees so it sits under wood without going grey. */
  --color-bg: #f1efeb;
  --paper: #f1efeb;
  --paper-2: #e7e4dd;
  /* Warm paper tint for inner framed cards (design's #f7f6f3) — a value step
     above the page so cards separate without a heavy fill. */
  --paper-card: color-mix(in srgb, var(--paper) 55%, white);

  /* Honey-kaya board wood (CSS fallbacks; the canvas renderer holds the
     authoritative grain values in render/board.js). */
  --wood-hi: #f0c982;
  --wood-1: #e3b169;
  --wood-2: #d59c4c;
  --wood-3: #c2863a;
  --wood-line: #6b4a24;
  --board-shadow: 0 18px 48px -20px rgba(40, 26, 8, 0.55);

  /* Dark table (archive / lit-board mode). */
  --table-dark: #1a1c1f;

  --num: "Barlow Condensed", system-ui, sans-serif;

  /* Board metrics (design specimen: 30px pitch, 28px stones). */
  --board-pitch: 30px;
  --stone: 28px;

  --shell-max: 1200px;
}

/* ── App shell ─────────────────────────────────────────────────────────── */
html, body { height: 100%; }
body { background: var(--paper); }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.goban-nav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--color-divider);
  gap: var(--space-6);
  max-width: none;
}
.goban-nav .nav-brand { letter-spacing: 0.14em; }
.goban-nav a { font-family: var(--font-heading); letter-spacing: 0.02em; }
.nav-rank {
  display: inline-flex; align-items: baseline; gap: 7px;
  font-family: var(--num); margin-left: var(--space-2);
  padding: 3px 9px; border: 1px solid var(--color-divider);
}
.nav-rank-tier { font-weight: 600; letter-spacing: 0.04em; }
.nav-rank-rating { color: var(--color-accent); font-weight: 600; }
button.nav-rank { cursor: pointer; background: none; color: inherit; }

/* Account popover (design tokens only — no inline hex fallbacks). */
.nav-rank-wrap { position: relative; }
.nav-menu {
  position: absolute; right: 0; top: 100%; margin-top: var(--space-2);
  min-width: 210px; z-index: 50; display: none;
  background: var(--color-surface); color: var(--color-text);
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); padding: var(--space-3);
}
.nav-menu.is-open { display: block; }
.nav-menu-handle { font-weight: 600; margin-bottom: 2px; }
.nav-menu-sub { font-size: 12px; margin-bottom: var(--space-3); }

.app-outlet { flex: 1; }
.screen { max-width: var(--shell-max); margin: 0 auto; width: 100%; }
.screen-pad { padding: var(--space-8) var(--space-6) 64px; }
.screen-host { display: block; }

.empty-state { padding: 80px var(--space-6); text-align: center; }
.empty-state h2 { font-size: 28px; }

/* ── Layout utilities ──────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: var(--space-3); }
.row-top { display: flex; align-items: flex-start; gap: var(--space-3); }
.col { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--space-3); }
.stack-2 > * + * { margin-top: var(--space-2); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { display: grid; place-items: center; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.machine { color: var(--color-accent); }           /* the steel "machine voice" */
.kicker { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-accent); }
.eyebrow { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.section-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-3); margin: 0 0 var(--space-4); }
.section-head h2, .section-head h3, .section-head h4, .section-head h6 { margin: 0; }
/* Section titles are letter-spaced UPPERCASE steel eyebrows, not big headings
   (design 1c/3a/…). The h-level stays for semantics; only the look changes, and
   only for the leading title of a section-head. */
.section-head > h2:first-child, .section-head > h3:first-child {
  font-size: 11px; font-weight: 600; line-height: 1;
  letter-spacing: 0.11em; text-transform: uppercase;
  color: var(--color-accent-700);
}

/* Blueprint section panels carry no padding by default (border only), so a
   flush heading collides with the `+` corner marks at -6px. Give the panels
   that wrap stacked content real padding so headings/content clear the marks
   (design cells are padded ~15px 16px). Spec cells and the board frame set their
   own padding, so scope this to the stack layouts the panels use. */
.blueprint.stack, .blueprint.stack-2 { padding: var(--space-4) var(--space-4) calc(var(--space-4) + 2px); }
/* Inner framed cards (a blueprint nested in a section blueprint — resume, live)
   take the warm paper-card fill for a two-level hierarchy; outer section panels
   stay transparent on the page paper. */
.blueprint .blueprint { background: var(--paper-card); }
/* Registration "+" marks belong ONLY to top-level section panels and to the
   spec-cell grid (its cells are blueprints on purpose — the crosshair grid).
   Suppress the marks on every OTHER nested blueprint (resume/live/inner cards)
   so they don't scatter "all over the place" (design 2.png). Spec cells keep
   theirs via the more specific selector below. */
.blueprint .blueprint:not(.spec-cell) > .corner { display: none; }
.divider { height: 1px; background: var(--color-divider); margin: var(--space-6) 0; }
.icon { display: inline-block; vertical-align: middle; }

/* Modal dialogs sit OVER page content, so they need an opaque fill (Industry's
   base .dialog is transparent — the wireframe treatment — which lets the page
   bleed through a modal). Give it the paper surface + elevation. */
.dialog { background: var(--paper); box-shadow: var(--shadow-lg); }

/* Board-based lesson view (7.62): a wider dialog holding a real goban that steps
   through the concept positions, with a caption and prev/next controls. */
.lesson-dialog { width: min(420px, 100%); }
.lesson-intro { font-size: 13px; }
.lesson-board { width: 100%; max-width: 340px; margin: var(--space-2) auto 0; aspect-ratio: 1; }
.lesson-board canvas { display: block; width: 100%; height: 100%; }
.lesson-caption { font-size: 13.5px; line-height: 1.45; min-height: 40px;
  padding: var(--space-2) 0; color: var(--color-text); }
.lesson-step { font-size: 12px; }

/* Section grid used across screens (Industry's visible modular grid). */
.grid { display: grid; gap: var(--space-4); }
/* Grid columns default to min-width:auto and refuse to shrink below their
   content — which let the Tsumego board overflow narrow screens (bug lwy).
   Let the flex columns inside a grid shrink to their track. */
.tsumego-layout > .col { min-width: 0; }
.tsumego-board { width: 100%; max-width: 400px; }
.tsumego-board .board-wrap, .tsumego-board canvas { max-width: 100%; height: auto; }
/* Analyse/Review: two columns on desktop, stacked on phones. The first (board)
   track uses minmax(0,1fr) so it can shrink; the board canvas caps at 100% so it
   never overflows a narrow viewport. Collapse handled in the ≤900px block. */
.review-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: var(--space-6); align-items: start; }
.review-board { width: 100%; }
.review-board .board-wrap, .review-board canvas { max-width: 100%; height: auto; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── The board stage ───────────────────────────────────────────────────── */
.board-stage { position: relative; display: inline-block; }
.board-wrap {
  position: relative; display: inline-block; line-height: 0;
  filter: drop-shadow(var(--board-shadow));
}
.board-wrap canvas { display: block; touch-action: none; }
.board-caption { line-height: 1.4; margin-top: var(--space-2); }

/* ── Player strip (name, rank, clock, captures, bowl) ──────────────────── */
.player-strip {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-divider);
}
.player-strip.is-turn { border-color: var(--color-accent);
  box-shadow: inset 3px 0 0 var(--color-accent); }
.player-portrait {
  width: 40px; height: 40px; flex: none;
  background: var(--color-accent-800);
  display: grid; place-items: center; color: var(--paper);
  font-family: var(--num); font-weight: 600; font-size: 16px;
}
.player-stone { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.player-stone.black { background: radial-gradient(circle at 35% 30%, #6a7284, #0a1020 78%); }
.player-stone.white { background: radial-gradient(circle at 35% 30%, #ffffff, #c3cede 82%); border: 1px solid var(--color-divider); }
.player-name { font-weight: 500; }
.player-rank { font-size: 12px; }
.player-meta { display: flex; align-items: baseline; gap: var(--space-2); }
.clock {
  font-family: var(--num); font-variant-numeric: tabular-nums;
  font-size: 26px; font-weight: 600; letter-spacing: 0.01em; line-height: 1;
}
.clock.low { color: var(--color-accent-700); }
.clock.expired { color: var(--color-neutral-500); text-decoration: line-through; }
.clock-byoyomi { font-size: 11px; letter-spacing: 0.06em; }
.capture { font-family: var(--num); font-size: 13px; }
.capture .n { font-weight: 600; }

/* ── Move list ─────────────────────────────────────────────────────────── */
.move-list { border: 1px solid var(--color-divider); max-height: 340px; overflow: auto; }
.move-row {
  display: grid; grid-template-columns: 34px 1fr 1fr; align-items: baseline;
  font-family: var(--num); font-size: 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 7%, transparent);
}
.move-row > * { padding: 5px 8px; }
.move-num { color: color-mix(in srgb, var(--color-text) 45%, transparent); text-align: right; }
.move-cell { cursor: pointer; }
.move-cell.is-current { background: var(--color-accent); color: var(--paper); }
.move-cell:hover:not(.is-current) { background: color-mix(in srgb, var(--color-text) 6%, transparent); }
.move-comment { font-family: var(--font-body); font-size: 12px; padding: 6px 10px;
  border-bottom: 1px solid var(--color-divider); background: color-mix(in srgb, var(--color-accent) 5%, transparent); }
.move-comment .who { color: var(--color-accent); }

/* ── Chat ──────────────────────────────────────────────────────────────── */
.chat { display: flex; flex-direction: column; border: 1px solid var(--color-divider); }
.chat-log { flex: 1; overflow: auto; padding: var(--space-3); display: flex; flex-direction: column; gap: 6px; max-height: 220px; }
.chat-msg { font-size: 13px; }
.chat-msg .who { font-weight: 600; margin-right: 6px; }
.chat-msg.mine .who { color: var(--color-accent); }
.chat-input-row { display: flex; border-top: 1px solid var(--color-divider); }
.chat-input-row .input { border: 0; }

/* ── Spec sheet (time controls, curriculum, review data) ───────────────── */
/* The design's crosshair lattice (design 1c): the cells form ONE continuous
   single-hairline grid — NOT gapped tiles — with a `+` registration mark sitting
   exactly on every intersection. We build the lattice from shared borders: the
   container draws the top+left outer hairline, each cell draws its right+bottom
   hairline, so interior lines are single (never doubled). Because cells are
   gapless, each cell's corner marks land on the SAME point as its neighbours' —
   they coincide into one clean `+` per intersection instead of floating pairs in
   a gap. */
.spec-sheet { display: grid; gap: 0;
  border-top: 1px solid var(--color-divider);
  border-left: 1px solid var(--color-divider); }
.spec-sheet.cols-3 { grid-template-columns: repeat(3, 1fr); }
.spec-sheet.cols-2 { grid-template-columns: repeat(2, 1fr); }
.spec-cell {
  padding: var(--space-4); cursor: pointer; position: relative;
  border-right: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  background: var(--paper-card);
  display: flex; flex-direction: column; gap: 6px;
  text-align: left;
}
.spec-cell:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
/* The selected cell keeps its full accent frame (all four edges) over the shared
   lattice, and its steel corner marks paint above the neighbours' grey ones. */
.spec-cell.is-selected { background: var(--color-accent-100);
  border-color: var(--color-accent-400); box-shadow: inset 0 0 0 1px var(--color-accent-400); }
.spec-cell.is-selected > .corner { color: var(--color-accent); z-index: 2; }
/* All pace kickers steel; only a `.muted` one (CUSTOM) stays grey. */
.spec-cell .spec-kicker { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--color-accent); }
.spec-cell .spec-kicker.muted { color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.spec-value { font-family: var(--num); font-size: 28px; font-weight: 600; line-height: 1; }
/* Muted arithmetic operators (+ × /) and trailing units inside a spec value. */
.spec-value .op { color: color-mix(in srgb, var(--color-text) 38%, transparent); font-weight: 400; }
.spec-cell.is-selected .spec-value { color: var(--color-accent-800); }
.spec-cell.is-selected .spec-value .op { color: color-mix(in srgb, var(--color-accent-800) 45%, transparent); }
.spec-blurb { font-size: 12px; color: color-mix(in srgb, var(--color-text) 60%, transparent); }

/* Small labelled choice rows (board size, rank, strength). */
.choice-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: color-mix(in srgb, var(--color-text) 55%, transparent); margin-bottom: 6px; }
/* Inline variant: eyebrow label beside the seg (New-game footer). */
.choice-inline { display: inline-flex; align-items: center; gap: var(--space-2); }
.choice-inline .choice-label { margin-bottom: 0; }

/* New-game footer: BOARD/RANK inline, action buttons pushed right, top hairline. */
.newgame-foot { display: flex; align-items: center; flex-wrap: wrap;
  gap: var(--space-4); margin-top: var(--space-2); padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider); }
.newgame-foot > .newgame-actions { margin-left: auto; }

/* ── Rating sparkline ──────────────────────────────────────────────────── */
.rating-spark { display: block; width: 100%; height: 56px; color: var(--color-accent); }
.rating-value { font-family: var(--num); font-size: 30px; font-weight: 600; }
.rating-delta { font-family: var(--num); color: var(--color-accent); font-size: 14px; }
/* Dated sparkline: small date ticks under the line (7.61). */
.rating-figure { display: flex; flex-direction: column; gap: 4px; }
.rating-axis { display: flex; justify-content: space-between;
  font-family: var(--num); font-size: 10px; letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--color-text) 45%, transparent); }

/* ── Glossary (Learn) ──────────────────────────────────────────────────── */
.glossary { display: grid; gap: 0; border-top: 1px solid var(--color-divider); }
.term { padding: var(--space-3) 0; border-bottom: 1px solid var(--color-divider);
  display: grid; grid-template-columns: 160px 1fr; gap: var(--space-4); align-items: baseline; }
.term-name { font-family: var(--font-heading); font-weight: 600; font-size: 16px; }
.term-def { font-size: 13px; color: color-mix(in srgb, var(--color-text) 75%, transparent); }

/* ── Learn: two-column layout + curriculum module card grid (design 3a) ─── */
.learn-grid { display: grid; grid-template-columns: minmax(0, 1fr) 372px;
  gap: 26px; align-items: start; }
.learn-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* The path: nine modules as a 3-column grid of blueprint cards. */
.module-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.module-card {
  padding: 14px 16px; background: var(--paper-card); cursor: pointer;
  display: flex; flex-direction: column; position: relative;
}
.module-card:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.module-card.is-here { background: var(--color-accent-100); border-color: var(--color-accent-400); }
.module-card.is-here > .corner { color: var(--color-accent); }
.module-card-top { display: flex; align-items: baseline; gap: 9px; margin-bottom: 8px; }
.module-index { font-family: var(--num); font-size: 24px; font-weight: 600; line-height: 1;
  color: color-mix(in srgb, var(--color-text) 30%, transparent); }
.module-card.is-here .module-index { color: var(--color-accent); }
.module-badge { margin-left: auto; display: inline-flex; align-items: center;
  color: var(--color-accent); }
.module-badge.here { font: 600 10px/1 var(--num); letter-spacing: 0.11em;
  text-transform: uppercase; color: var(--color-accent-800); }
.module-title { font: 600 19px/1.1 var(--num); margin-bottom: 5px; }
.module-card.is-here .module-title { color: var(--color-accent-800); }
.module-meta { font-size: 11.5px; color: color-mix(in srgb, var(--color-text) 50%, transparent); }
.module-card.is-here .module-meta { color: var(--color-accent-800); }

/* Expanded lessons drawer under a module card (spans the full grid row). */
.module-lessons { grid-column: 1 / -1; }

/* ── Review: candidates, turning points, accuracy, ownership legend ─────── */
.candidate { display: grid; grid-template-columns: 22px 1fr auto; gap: var(--space-3);
  align-items: center; padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); }
/* The engine's pick (A) row gets an accent-100 tint (design 2b). */
.candidate.is-best { background: var(--color-accent-100); }
/* Candidate discs are ROUND (design 2b): A = filled steel with paper letter;
   B/C = paper with a steel ring. */
.candidate-tag { font-family: var(--num); font-weight: 600; width: 22px; height: 22px;
  border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--color-accent); color: var(--color-accent);
  background: var(--paper-card); }
.candidate-tag.is-best { background: var(--color-accent); color: var(--paper);
  border-color: var(--color-accent); }
.candidate-move { font-family: var(--num); font-weight: 600; }
.candidate-win { font-family: var(--num); color: var(--color-accent); font-weight: 600; }
.candidate-note { grid-column: 2 / -1; font-size: 12px; }

/* Review game picker (9.72): a list of selectable played games. */
.picker-list { display: flex; flex-direction: column; }
.picker-row { display: flex; align-items: center; gap: var(--space-3); width: 100%;
  text-align: left; cursor: pointer; background: transparent; border: 0;
  padding: var(--space-3) var(--space-2); font: inherit; color: inherit;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); }
.picker-row:last-child { border-bottom: 0; }
.picker-row:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.picker-name { font-weight: 500; }
.picker-meta { margin-left: auto; font-size: 12px; }
.picker-row .machine { display: inline-flex; }

.turning-point { display: grid; grid-template-columns: 26px 34px 44px 1fr auto; gap: var(--space-2);
  align-items: baseline; padding: 6px 8px; font-size: 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); cursor: pointer; }
.turning-point:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.tp-glyph { font-family: var(--num); font-weight: 700; text-align: center; }
.tp-move, .tp-coord { font-family: var(--num); }
.tp-delta { font-family: var(--num); text-align: right; }
.tp-delta.pos { color: var(--color-accent); }
.tp-delta.neg { color: var(--color-accent-800); }

.winrate-bar { position: relative; height: 26px; border: 1px solid var(--color-divider);
  background: repeating-linear-gradient(45deg, transparent, transparent 5px, color-mix(in srgb, var(--color-text) 5%, transparent) 5px, color-mix(in srgb, var(--color-text) 5%, transparent) 10px); }
.winrate-fill { position: absolute; inset: 0 auto 0 0; background: var(--color-accent); }
.winrate-label { font-family: var(--num); font-weight: 600; }

.accuracy-figure { font-family: var(--num); font-size: 34px; font-weight: 600; }

/* Ownership heatmap legend + mode badge. */
.heatmap-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; }
.heatmap-swatch { width: 14px; height: 14px; }
.heatmap-swatch.black { background: color-mix(in srgb, var(--color-text) 82%, transparent); }
.heatmap-swatch.white { background: var(--paper-2); border: 1px solid var(--color-divider); }

/* ── Tsumego ───────────────────────────────────────────────────────────── */
.streak-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--num);
  font-weight: 600; color: var(--color-accent); }
.tsumego-stat { text-align: center; }
.tsumego-stat .v { font-family: var(--num); font-size: 26px; font-weight: 600; display: block; }
.tsumego-stat .l { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.problem-row { display: grid; grid-template-columns: 22px 1fr auto; gap: var(--space-2);
  align-items: center; padding: 6px 8px; font-size: 13px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); }
/* Current problem row: accent-100 fill + inset steel marker + steel text, and a
   right-aligned NOW eyebrow (design 3b). */
.problem-row.is-now { background: var(--color-accent-100);
  box-shadow: inset 3px 0 0 var(--color-accent); color: var(--color-accent-800); }
.problem-row.is-now .problem-glyph { color: var(--color-accent-800); }
.problem-now { font: 600 11px/1 var(--num); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--color-accent-800); }
.problem-glyph { font-family: var(--num); font-weight: 700; text-align: center; }

/* Other-sets progress bar (steel — mastery-at-a-glance, design 3b). */
.setbar { width: 88px; height: 3px; flex: none;
  background: color-mix(in srgb, var(--color-text) 12%, transparent); }
.setbar-fill { height: 3px; background: var(--color-accent); }

/* ── Game controls toolbar ─────────────────────────────────────────────── */
.controls { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.controls .btn { flex: 1; min-width: 92px; }

/* ── Game board layout: bowls flank the board (design 2a) ──────────────── */
/* [white bowl][ center: strip + board + strip ][black bowl] — structural flex
   is inlined in game.js; only the identity bar + clock skins live here. */

/* Thin horizontal identity bar above/below the board (identity only). */
.board-player-bar {
  width: 100%; display: flex; align-items: center; gap: var(--space-3);
  padding: 8px 14px; border: 1px solid var(--color-divider);
  background: var(--paper-card);
}
.board-player-bar.is-turn { box-shadow: inset 3px 0 0 var(--color-accent); }
.board-player-name { font-size: 13.5px; font-weight: 500; line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-player-rank { font-size: 11px;
  color: color-mix(in srgb, var(--color-text) 50%, transparent); }
.board-player-pill { margin-left: auto; display: inline-flex; align-items: center;
  gap: 7px; padding: 4px 9px; background: var(--paper-card);
  border: 1px solid color-mix(in srgb, var(--color-text) 20%, transparent);
  font: 600 11px/1 var(--num); letter-spacing: 0.08em; }
.board-player-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.board-player-dot.black { background:
  radial-gradient(circle at 34% 26%, #63656a 0%, #2a2c30 44%, #101113 100%);
  box-shadow: 0 1px 2px rgba(30,14,4,.4); }
.board-player-dot.white { background:
  radial-gradient(circle at 34% 26%, #fffefb 0%, #f4f0e8 42%, #d7d1c3 100%);
  box-shadow: 0 1px 2px rgba(30,14,4,.35), 0 0 0 .5px rgba(80,62,36,.35); }

/* ── Right-rail clock panel (machine voice; design 2a) ─────────────────── */
.clock-panel { padding: 0; background: var(--paper-card); }
.clock-row { position: relative; display: flex; align-items: center;
  gap: var(--space-3); padding: 11px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent); }
.clock-row:last-child { border-bottom: none; }
.clock-row.is-active { background: var(--color-accent-100);
  box-shadow: inset 3px 0 0 var(--color-accent); }
.clock-dot { width: 13px; height: 13px; border-radius: 50%; flex: none; }
.clock-dot.black { background:
  radial-gradient(circle at 34% 26%, #63656a 0%, #2a2c30 44%, #101113 100%);
  box-shadow: 0 1px 2px rgba(30,14,4,.4); }
.clock-dot.white { background:
  radial-gradient(circle at 34% 26%, #fffefb 0%, #f4f0e8 42%, #d7d1c3 100%);
  box-shadow: 0 1px 2px rgba(30,14,4,.35), 0 0 0 .5px rgba(80,62,36,.35); }
.clock-eyebrow { font: 600 11px/1 var(--num); letter-spacing: 0.1em;
  text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.clock-row.is-active .clock-eyebrow { color: var(--color-accent-800); }
.clock-time { margin-left: auto; font: 600 32px/1 var(--num); letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--color-text) 55%, transparent); }
.clock-row.is-active .clock-time { color: var(--color-accent-800); }
.clock-progress { position: absolute; left: 0; bottom: 0; height: 2px;
  background: var(--color-accent); }

/* ── Duotone portrait plate (no avatars/photos in the design) ──────────── */
.portrait-plate { aspect-ratio: 1; background:
  repeating-linear-gradient(135deg, var(--color-accent-200), var(--color-accent-200) 6px, var(--color-accent-300) 6px, var(--color-accent-300) 12px);
  display: grid; place-items: center; }

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .learn-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .spec-sheet.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  /* Analyse/Review stacks board over sidebar instead of a cramped 2-col grid. */
  .review-layout { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .goban-nav { gap: var(--space-3); overflow-x: auto; }
  .grid-2, .grid-3, .grid-4, .spec-sheet.cols-2, .spec-sheet.cols-3 { grid-template-columns: 1fr; }
  .module-grid { grid-template-columns: 1fr; }
  .screen-pad { padding: var(--space-6) var(--space-4) 48px; }
  .term { grid-template-columns: 1fr; gap: 2px; }
  /* Let section headers wrap instead of clipping their trailing tag/badge on a
     phone (e.g. Tsumego's "Black to play" tag and the STREAK badge — bug lwy). */
  .section-head { flex-wrap: wrap; }
}
