/* ============================================================
   Page one (index.html): the one-off activities (scorecard,
   rain, wall, timeline, next word, re-dated post, map, recap)
   ------------------------------------------------------------
   The global skin (screens, hues, the page tint, stripes, the
   rail, the .placeholder and .band, the .screen-n labels) is
   site-wide and lives in css/site.css, together with
   js/stripes.js, js/rail.js and js/progress.js.
   ============================================================ */

/* ---------- scorecard ---------- */
.scorecard {
  position: sticky;
  top: 68px;
  z-index: 5;
  margin-top: var(--sp-6);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 900px) { .scorecard { top: 92px; } }
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.sc-col { position: relative; min-width: 0; }
.sc-title { font-family: var(--font-mono); font-size: var(--fs-2); color: var(--ink); margin-bottom: var(--sp-2); }
.sc-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
.sc-row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sc-n { font-family: var(--font-mono); font-weight: 500; font-size: var(--fs-5); line-height: 1; display: inline-block; min-width: 1.2em; }
.sc-label { font-size: var(--fs-1); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-row--fabricated .sc-n { color: var(--fab); }
.sc-row--check .sc-n { color: var(--check); }
.sc-row--good .sc-n { color: var(--good); }
.sc-row--links .sc-n { color: var(--note); }
.sc-stamps {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 26px;
  margin-top: var(--sp-3);
}
.sc-stamp {
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border: 2px solid currentColor;
  border-radius: 4px;
  transform: rotate(-6deg);
  transform-origin: center;
  mix-blend-mode: multiply;
}
:root[data-theme="dark"] .sc-stamp { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sc-stamp { mix-blend-mode: screen; } }
.sc-stamp--fabricated { color: var(--fab); }
.sc-stamp--check { color: var(--check); }
.sc-stamp--good { color: var(--good); }
.sc-question { margin-top: var(--sp-4); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.sc-q { font-weight: 600; max-width: none; }
.sc-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-3); }
.sc-done { margin-top: var(--sp-3); color: var(--text-2); max-width: none; }
@media (max-width: 600px) {
  .sc-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
  .sc-rows { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 8px; }
  .sc-row { flex-direction: column; gap: 2px; }
  .sc-label { white-space: normal; overflow: visible; font-size: 0.7rem; line-height: 1.2; }
  .sc-n { font-size: var(--fs-4); }
  .sc-stamps { min-height: 0; }
  .scorecard { padding: var(--sp-3) var(--sp-4); }
}

/* the compare below a sticky scorecard */
.screen .compare { margin-top: var(--sp-5); }

/* ---------- screen 1: rain and typed title ---------- */
.hero--rain { overflow: hidden; min-height: clamp(520px, 82vh, 780px); display: flex; align-items: center; }
.hero--rain .rain {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  /* thinner where the text sits (the centred column), so the words stay readable */
  mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.4) 20%, rgba(0, 0, 0, 0.4) 80%, rgba(0, 0, 0, 1) 100%);
  -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.4) 20%, rgba(0, 0, 0, 0.4) 80%, rgba(0, 0, 0, 1) 100%);
}
.hero--rain .lede, .hero--rain h1, .hero--rain .rain-note { text-shadow: 0 0 18px var(--bg), 0 0 6px var(--bg); }
.hero--rain .wrap { width: 100%; }
.hero--rain h1 { min-height: 1.15em; }
.typed-cursor {
  display: inline-block;
  width: 0.08em; height: 0.9em;
  margin-left: 0.06em;
  vertical-align: -0.08em;
  background: currentColor;
  animation: tp-blink 900ms steps(2, start) infinite;
}
.after-typed { opacity: 0; transform: translateY(10px); transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out); }
.after-typed.is-shown { opacity: 1; transform: none; }
.rain-note {
  margin-top: var(--sp-5);
  font-family: var(--font-mono);
  font-size: var(--fs-1);
  color: var(--muted);
  max-width: none;
}
@media (prefers-reduced-motion: reduce) {
  .typed-cursor { animation: none; }
  .after-typed { transition: none; }
}

/* ---------- screen 4: the wall and the window ---------- */
.wall-stage { margin-top: var(--sp-5); }
.wall-stage.is-pinned { height: calc(100vh + 90vh); }
.wall-stage.is-pinned .wall-scene { position: sticky; top: 72px; }
.wall-scene {
  --brick: oklch(var(--ink-l) calc(var(--ink-c) * 0.9) var(--hue));
  --brick-edge: oklch(calc(var(--ink-l) - 12%) var(--ink-c) var(--hue));
  --beam: oklch(85% 0.14 95);
  position: relative;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  overflow: hidden;
  min-height: 420px;
}
.wall-svg { display: block; width: 100%; height: auto; max-height: min(52vh, 460px); }
.wall-axis { stroke: var(--border-strong); stroke-width: 2; }
.wall-tick { stroke: var(--border-strong); stroke-width: 2; }
.wall-year { font-family: var(--font-mono); font-size: 14px; fill: var(--muted); }
.wall-year--edge { font-size: 12px; }
.wall-label { font-family: var(--font-mono); font-size: 13px; fill: var(--ink); letter-spacing: 0.04em; text-transform: uppercase; }
.brick {
  fill: var(--brick);
  stroke: var(--brick-edge);
  stroke-width: 1;
  opacity: 0;
  transform: translateY(-70px) rotate(-6deg);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 420ms var(--ease-out), opacity 300ms ease;
}
.brick.is-set { opacity: 1; transform: none; }
/* the window: those bricks slide aside when search is on */
.wall-scene.is-open .brick--window.is-set { transform: translateX(var(--dx)) scale(0.6); opacity: 0.18; }
.wall-beam { opacity: 0; transition: opacity 500ms ease; }
.wall-scene.is-open .wall-beam { opacity: 1; }
:root[data-theme="dark"] .wall-scene { --beam: oklch(80% 0.16 95); }

.wall-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); }
.wall-switch {
  font: inherit; font-weight: 600; font-size: var(--fs-2);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  min-height: 40px;
}
.wall-knob {
  width: 44px; height: 26px; border-radius: 13px;
  background: var(--border-strong);
  position: relative;
  transition: background var(--dur) ease;
}
.wall-knob::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform var(--dur) var(--ease-out);
}
.wall-switch[aria-checked="true"] .wall-knob { background: var(--good); }
.wall-switch[aria-checked="true"] .wall-knob::after { transform: translateX(18px); }
.wall-status { margin-top: var(--sp-3); min-height: 2.6em; color: var(--text-2); max-width: none; font-size: var(--fs-2); }
.wall-scene.is-done .wall-status { color: var(--ink); font-weight: 500; }

.wall-tray { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--sp-3); min-height: 44px; }
.wcard {
  font: inherit; font-size: var(--fs-2); font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  text-align: left;
  transition: box-shadow var(--dur-fast) ease;
}
.wcard:hover { box-shadow: var(--shadow-md); }
.wcard.is-dragging { cursor: grabbing; box-shadow: var(--shadow-md); z-index: 4; position: relative; }
.wcard.is-flying { position: absolute; z-index: 3; cursor: pointer; }
.wcard.is-placed { border-color: var(--ink); }
.wcard.is-blocked { border-color: var(--fab); }
.wcard.is-through, .wcard.is-before, .wcard.is-timeless { border-color: var(--good); }
.wcard-ghost { display: inline-block; border: 1px dashed var(--border); border-radius: var(--radius); }
.wcard-tag {
  position: absolute; left: 10px; bottom: -11px;
  font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.04em;
  padding: 1px 8px; border-radius: var(--radius-pill);
  background: var(--good-bg); color: var(--good);
  border: 1px solid currentColor;
  white-space: nowrap;
}
.wcard.is-blocked .wcard-tag { background: var(--fab-bg); color: var(--fab); }
.wcard.is-through .wcard-tag { background: var(--note-bg); color: var(--note); }

@media (max-width: 600px) {
  .wall-svg { max-height: none; }
  .wall-year { font-size: 18px; }
  .wcard { font-size: var(--fs-1); padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .brick, .wall-beam, .wall-knob, .wall-knob::after { transition: none; }
}

/* ---------- screen 2: the scrubbed timeline ---------- */
.tl-stage { margin-top: var(--sp-5); }
.tl-stage.is-pinned { height: calc(100vh + 160vh); }
.tl-stage.is-pinned .tl-scene { position: sticky; top: 72px; }
.tl-scene {
  position: relative;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-4) var(--sp-4);
  overflow: hidden;
}
.tl-year {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 6vw, 4.5rem);
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}
.tl-track-wrap {
  position: relative;
  height: 164px;
  margin: var(--sp-3) calc(-1 * var(--sp-4)) 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.tl-pointer {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; background: var(--ink);
  z-index: 2;
}
.tl-track {
  position: absolute; left: 0; top: 0; height: 100%;
  will-change: transform;
}
.tl-track::before {
  content: ''; position: absolute; left: 0; right: 0; top: 22px; height: 2px;
  background: var(--border-strong);
}
.tl-event {
  position: absolute; top: 14px;
  width: 168px;
  transform: translateX(-9px);
  opacity: 0.45;
  transition: opacity var(--dur) ease;
}
.tl-event.is-passed { opacity: 1; }
.tl-event-dot {
  display: block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--border-strong);
  transition: background var(--dur) ease, border-color var(--dur) ease, transform var(--dur) var(--ease-out);
}
.tl-event.is-passed .tl-event-dot { background: var(--ink); border-color: var(--ink); transform: scale(1.15); }
.tl-event-year { display: block; font-family: var(--font-mono); font-size: var(--fs-1); color: var(--muted); margin-top: 6px; }
.tl-event--alt .tl-event-year { margin-top: 52px; }
.tl-event--alt .tl-event-dot { position: relative; }
.tl-event--alt .tl-event-dot::after {
  content: ''; position: absolute; left: 50%; top: 100%; width: 1px; height: 46px;
  background: var(--border-strong);
}
.tl-event-text { display: block; font-size: var(--fs-1); line-height: 1.3; color: var(--text-2); margin-top: 2px; }

.tl-card {
  margin: var(--sp-5) auto 0;
  max-width: 34ch;
  padding: var(--sp-5) var(--sp-6);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transition: border-color var(--dur) ease;
}
.tl-quote { font-size: var(--fs-5); line-height: 1.35; font-weight: 500; max-width: none; }
.tl-swap { color: var(--ink); font-weight: 700; }
.tl-swap.is-marked { background: color-mix(in oklab, var(--ink) 18%, transparent); border-radius: 4px; padding: 0 3px; }
.tl-by { margin-top: var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-1); color: var(--muted); }
.tl-card.is-b { border-color: var(--accent-2); }
.tl-card.is-b .tl-swap { color: var(--accent-2); }

.tl-end {
  margin: var(--sp-4) auto 0;
  text-align: center;
  color: var(--ink);
  font-weight: 600;
  max-width: none;
  opacity: 0; transform: translateY(6px);
  transition: opacity 500ms var(--ease-out), transform 500ms var(--ease-out);
}
.tl-end.is-shown { opacity: 1; transform: none; }

.tl-bar { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }
.tl-slider { flex: 1; accent-color: var(--ink); min-width: 0; height: 36px; }

.tl-still { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--sp-5); margin-top: var(--sp-5); }
.tl-still .tl-card { margin: 0; max-width: none; }
.tl-still .tl-end { grid-column: 1 / -1; }
.tl-still-label { font-family: var(--font-mono); font-size: var(--fs-1); color: var(--muted); margin-bottom: var(--sp-2); }

@media (max-width: 600px) {
  .tl-event { width: 150px; }
  .tl-track-wrap { height: 176px; }
  .tl-card { padding: var(--sp-4) var(--sp-5); }
  .tl-quote { font-size: var(--fs-4); }
}
@media (prefers-reduced-motion: reduce) {
  .tl-event, .tl-event-dot, .tl-card, .tl-end { transition: none; }
}

/* ---------- screen 6: the re-dated post ---------- */
.rp { margin-top: var(--sp-5); }
.rp-window {
  position: relative;
  background: #fff;
  color: #222;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  font-family: Georgia, 'Times New Roman', serif;   /* deliberately not the site's face: this is someone else's page */
}
.rp-chrome {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  background: #e9e9ea;
  border-bottom: 1px solid #d3d3d5;
  font-family: var(--font-sans);
}
.rp-dot { width: 11px; height: 11px; border-radius: 50%; background: #c9c9cc; }
.rp-dot:nth-child(1) { background: #ff5f57; } .rp-dot:nth-child(2) { background: #febc2e; } .rp-dot:nth-child(3) { background: #28c840; }
.rp-url {
  flex: 1; margin-left: 10px;
  background: #fff; border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px; color: #555;
  font-family: var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rp-body {
  --wipe: 0%;
  position: relative;
  max-height: min(62vh, 640px);
  overflow-y: auto;
  background: #fff;
}
.rp-article { padding: 28px 32px 36px; max-width: 640px; margin: 0 auto; }
.rp-window .rp-title { font-size: 1.9rem; line-height: 1.15; margin: 0 0 10px; color: #1a1a1a; font-weight: 700; }
.rp-meta { font-family: var(--font-sans); font-size: 0.82rem; color: #666; margin: 0 0 18px; max-width: none; }
.rp-date--muted { color: #999; }
.rp-figure { height: 180px; border-radius: 8px; background: linear-gradient(135deg, #f3e2c7, #d9b58a); display: grid; place-items: center; margin-bottom: 18px; }
.rp-loaf { width: 150px; height: 84px; border-radius: 60px 60px 40px 40px / 50px 50px 30px 30px; background: radial-gradient(ellipse at 40% 30%, #e9c48f, #a9682f 80%); box-shadow: inset -8px -10px 18px rgba(0, 0, 0, 0.18), 0 8px 14px rgba(0, 0, 0, 0.12); }
.rp-p { font-size: 1rem; line-height: 1.6; margin: 0 0 14px; max-width: none; }
.rp-window .rp-h2 { font-size: 1.2rem; margin: 22px 0 8px; font-weight: 700; color: #1a1a1a; }
.rp-list { margin: 0 0 8px; padding-left: 1.3em; line-height: 1.55; }
.rp-window .rp-link { color: #1a5cb8; }
.rp-comments { border-top: 1px solid #e5e5e5; padding-top: 8px; }
.rp-comment { padding: 10px 0; border-bottom: 1px solid #efefef; font-family: var(--font-sans); }
.rp-comment-who { font-weight: 600; font-size: 0.9rem; margin-right: 8px; }
.rp-comment-when { font-size: 0.78rem; color: #888; }
.rp-comment-text { margin: 4px 0 0; font-size: 0.92rem; max-width: none; }
.rp-statusbar {
  font-family: var(--font-mono); font-size: 11px; color: #555;
  padding: 4px 12px; background: #f2f2f3; border-top: 1px solid #ddd;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* clues: nothing shows until found (or hinted) */
[data-clue] { cursor: pointer; border-radius: 4px; transition: background 220ms ease, box-shadow 220ms ease; }
[data-clue].is-found { background: color-mix(in srgb, #ffd166 45%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, #ffd166 45%, transparent); }
[data-clue].is-hinted { animation: rp-pulse 1.2s ease-in-out 2; }
@keyframes rp-pulse { 50% { box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.9); } }

.rp-stickers {
  position: absolute; right: -6px; top: 46px;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.rp-sticker {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: #7a1b0f; background: #ffe0a3;
  border: 2px solid #7a1b0f; border-radius: 4px;
  padding: 3px 9px;
  transform: rotate(-4deg);
  box-shadow: var(--shadow-sm);
}

.rp-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); }
.rp-status { flex: 1 1 26ch; min-height: 2.6em; color: var(--text-2); max-width: none; font-size: var(--fs-2); }
.rp-status.is-miss { color: var(--muted); font-style: italic; }
.rp-status.is-all { color: var(--ink); font-weight: 500; }

/* the wipe: the 2019 version sits under the current one, clipped from the left */
.rp-layer--orig {
  position: absolute; inset: 0 0 auto 0;   /* as tall as its own content, so the wipe covers the whole article */
  background: #fff;
  clip-path: inset(0 calc(100% - var(--wipe)) 0 0);
  border-right: 3px solid var(--ink);
  pointer-events: none;
}
.rp-article--orig .rp-date--orig { background: #dff5e3; box-shadow: 0 0 0 3px #dff5e3; border-radius: 3px; }
.rp-wipe { display: none; margin-top: var(--sp-3); }
.rp-wipe.is-shown { display: block; }
.rp-wipe-range { width: 100%; accent-color: var(--ink); height: 36px; }
.rp-wipe-caption { opacity: 0; transition: opacity var(--dur) ease; color: var(--ink); font-weight: 600; max-width: none; margin-top: 4px; }
.rp-wipe-caption.is-shown { opacity: 1; }

@media (max-width: 600px) {
  .rp-article { padding: 18px 16px 24px; }
  .rp-window .rp-title { font-size: 1.4rem; }
  .rp-body { max-height: min(70vh, 640px); }
  .rp-stickers { right: 2px; top: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-clue] { transition: none; }
  [data-clue].is-hinted { animation: none; box-shadow: 0 0 0 4px rgba(255, 209, 102, 0.9); }
}

/* ---------- screen 7: the model map ---------- */
.mm { margin-top: var(--sp-5); }
.mm-svg {
  display: block; width: 100%; height: auto;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.mm-land path {
  fill: color-mix(in oklab, var(--ink) 16%, var(--surface));
  stroke: color-mix(in oklab, var(--ink) 40%, transparent);
  stroke-width: 1.2;
  stroke-linejoin: round;
}
.mm-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2.5; }
.mm-laptop rect { fill: var(--ink); }
.mm-leader { stroke: color-mix(in oklab, var(--ink) 55%, transparent); stroke-width: 1.2; }
.mm-label { cursor: pointer; }
.mm-label rect { fill: var(--surface); stroke: var(--ink); stroke-width: 1.2; transition: fill var(--dur-fast) ease; }
.mm-label text { font-family: var(--font-sans); font-size: 14px; font-weight: 600; fill: var(--text); }
.mm-label:hover rect, .mm-label:focus-visible rect { fill: color-mix(in oklab, var(--ink) 14%, var(--surface)); }
.mm-label.is-active rect { fill: var(--ink); }
.mm-label.is-active text { fill: var(--surface); }
.mm-label:focus-visible { outline: none; }
.mm-label:focus-visible rect { stroke-width: 3; }

.mm-panel { margin-top: var(--sp-4); min-height: 120px; }
.mm-hint { color: var(--muted); font-family: var(--font-mono); font-size: var(--fs-1); }
.mm-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--ink);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  box-shadow: var(--shadow-sm);
}
.mm-card-title { margin-bottom: var(--sp-3); color: var(--ink); }
.mm-rows { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; }
.mm-rows dt { font-size: var(--fs-1); color: var(--muted); padding-top: 3px; }
.mm-rows dd { margin: 0; }
.mm-v { font-weight: 600; }
.mm-note { display: block; font-size: var(--fs-2); color: var(--text-2); margin-top: 2px; }
.mm-yes .mm-v, .mm-runs-them .mm-v { color: var(--good); }
.mm-no .mm-v { color: var(--fab); }
.mm-some .mm-v, .mm-most .mm-v { color: var(--check); }
.mm-pending .mm-v { color: var(--muted); font-weight: 400; font-style: italic; }
.mm-checked { margin-top: var(--sp-3); font-family: var(--font-mono); font-size: var(--fs-1); color: var(--muted); }
.mm-done { margin-top: var(--sp-3); color: var(--ink); font-weight: 600; max-width: none; }
.mm-more { margin-top: var(--sp-3); font-size: var(--fs-1); color: var(--muted); font-family: var(--font-mono); }
@media (max-width: 600px) {
  .mm-label text { font-size: 20px; }
  .mm-rows { grid-template-columns: 1fr; gap: 4px; }
  .mm-rows dt { padding-top: 8px; }
}

/* ---------- screen 5: the next word ---------- */
.nw-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
}
.nw-sentence { margin: 0 0 var(--sp-5); font-size: var(--fs-5); line-height: 1.4; min-height: 2.8em; max-width: none; }
.nw-slot {
  display: inline-block;
  min-width: 3.2em;
  margin-left: 2px;
  padding: 0 4px;
  border-bottom: 3px solid var(--border-strong);
  color: var(--muted);
  font-family: var(--font-mono);
}
.nw-slot.is-filled { border-bottom-color: var(--ink); color: var(--ink); font-weight: 600; }
.nw-slot.is-rolled { border-bottom-color: var(--accent-2); color: var(--accent-2); }
.nw-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.nw-chip {
  font: inherit;
  font-size: var(--fs-2);
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  min-height: 38px;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.nw-chip:hover:not(:disabled) { border-color: var(--ink); }
.nw-chip:disabled { cursor: default; }
.nw-chip.is-picked { border-color: var(--accent); background: var(--accent-bg); box-shadow: 0 0 0 3px var(--accent-bg); }
.nw-status { margin: var(--sp-4) 0 0; min-height: 1.6em; font-size: var(--fs-3); color: var(--text); max-width: none; }

/* after the pick: the odds beside the lesson and the draw */
.nw-result {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: var(--sp-6);
  margin-top: var(--sp-5);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}
.nw-result[hidden] { display: none; }
.nw-odds-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-weight: 600; font-size: var(--fs-2); margin-bottom: var(--sp-3); max-width: none; }
.nw-key { font-family: var(--font-mono); font-weight: 400; font-size: var(--fs-1); color: var(--muted); }
.nw-bars { display: grid; gap: 6px; }
.nw-bar { display: grid; grid-template-columns: minmax(84px, 7.5em) 1fr 4.6em 2.6em; align-items: center; gap: 10px; border-radius: 6px; }
.nw-bar-word { font-family: var(--font-mono); font-size: var(--fs-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw-bar-track { height: 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.nw-bar-fill { height: 100%; width: 0; min-width: 2px; background: var(--band); border-radius: 3px 0 0 3px; }
.nw-bar-num { font-family: var(--font-mono); font-size: var(--fs-1); text-align: right; }
.nw-bar-count { font-family: var(--font-mono); font-size: var(--fs-1); color: var(--accent-2); font-weight: 500; }
.nw-bar.is-picked .nw-bar-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.nw-bar.is-top .nw-bar-fill { background: var(--ink); animation: nw-pulse 1.4s ease-in-out infinite; }
.nw-bar.is-top .nw-bar-num { color: var(--ink); font-weight: 600; }
.nw-bar.is-rest { margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--border-strong); border-radius: 0; }
.nw-bar.is-rest .nw-bar-word { font-family: var(--font-sans); font-style: italic; color: var(--muted); white-space: normal; line-height: 1.2; }
.nw-bar.is-rest .nw-bar-fill { background: repeating-linear-gradient(135deg, var(--border-strong) 0 4px, transparent 4px 8px); }
/* the draw: a flicker down the bars, then the landing */
.nw-bar.is-rolling { background: color-mix(in oklab, var(--accent-2) 14%, transparent); }
.nw-bar.is-landed { background: color-mix(in oklab, var(--accent-2) 20%, transparent); }
.nw-bar.is-landed .nw-bar-word { color: var(--accent-2); font-weight: 600; }
@keyframes nw-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.nw-side { display: flex; flex-direction: column; gap: var(--sp-4); }
.nw-lesson { max-width: none; color: var(--text-2); }
.nw-roll { padding: var(--sp-4); border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }
.nw-roll-intro { max-width: none; font-size: var(--fs-2); color: var(--text-2); }
.nw-roll-bar { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.nw-roll-status { max-width: none; margin-top: var(--sp-3); min-height: 1.5em; font-size: var(--fs-2); color: var(--accent-2); }

.nw-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.nw-src { flex: 1 1 20ch; margin: 0; font-family: var(--font-mono); font-size: var(--fs-1); color: var(--muted); max-width: none; }
.nw-burst-chip {
  position: absolute;
  width: 14px;
  height: 8px;
  border-radius: 3px;
  background: var(--band);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { .nw-bar.is-top .nw-bar-fill { animation: none; } }
@media (max-width: 860px) {
  .nw-result { grid-template-columns: 1fr; gap: var(--sp-5); }
}
@media (max-width: 600px) {
  .nw-card { padding: var(--sp-4); }
  .nw-sentence { font-size: var(--fs-4); }
  .nw-bar { grid-template-columns: 5.2em 1fr 4.2em 2.2em; gap: 6px; }
  .nw-bar-word { font-size: var(--fs-1); }
}

/* ---------- screen 8: the recap ---------- */
.recap { margin-top: var(--sp-5); }
.recap-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-sm);
}
.recap-empty { color: var(--muted); max-width: none; }
.recap-list { margin: 0; padding-left: 1.4em; display: grid; gap: var(--sp-3); }
.recap-line { line-height: 1.5; }
.recap-line::marker { color: var(--ink); font-family: var(--font-mono); font-weight: 500; }
.recap-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border); }
.recap-count { flex: 1 1 16ch; font-family: var(--font-mono); font-size: var(--fs-1); color: var(--muted); max-width: none; }
.recap.is-complete .recap-count { color: var(--ink); }
.recap-clear { font-weight: 400; opacity: 0.7; }
.recap-burst { position: absolute; inset: 0; pointer-events: none; }


