/* Hallmark · shape: app screen · genre: playful · theme: Arcade (deal 1/3, seed platform-minigame-ringan-untuk-1051·1f524fbf·2026-11-21·r0)
 * nav: top bar with wordmark and the language switch · signature: the pixel mascot beside the headline, the logo tile come alive · states: loading (no-script notice), empty (filter with no games), error (unknown game route), full · arcade: ember/grille
 * axes: dark/pixel/chromatic-ember · posture: full-palette · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V4 · weakest: S, a game grid could be any portal; each card shows its own board mid-round, and the mascot holds the hero */
@import url("./tokens.css");
@import url("./base.css");

:root {
  --text-figure: 2.5rem;
  
  --stage-max: 560px;
  --bar-h: 64px;
  --game-1: var(--color-crt-r);
  --game-2: var(--color-crt-b);
  --game-3: var(--color-crt-g);
  --game-4: oklch(87% 0.17 92);
  --scrim: color-mix(in oklab, var(--color-paper) 90%, transparent);
}

/* ---------- type ---------- */
.display {
  font-family: var(--font-display); font-weight: 400; line-height: 1.02; text-transform: uppercase;
  text-shadow: -1.5px 0 0 var(--color-crt-r), 1.5px 0 0 var(--color-crt-c);
}
h2, h3 { font-family: var(--font-body); font-weight: 900; letter-spacing: -0.02em; line-height: 1.05; }
.figure { font-family: var(--font-outlier); font-weight: 700; font-size: var(--text-figure); line-height: 1; color: var(--color-accent-2); font-variant-numeric: tabular-nums; }
.figure--lead { color: var(--color-accent); }
.unit { font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm); color: var(--color-ink-2); }
.label { font-weight: 700; font-size: var(--text-sm); color: var(--color-muted); }
.muted { color: var(--color-muted); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  min-height: 44px; padding: var(--space-xs) var(--space-md);
  background: var(--color-accent); color: var(--color-accent-ink);
  border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-card);
  font-family: var(--font-body); font-weight: 700; font-size: var(--text-md); text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--color-accent-2);
  transition: translate var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out), background-color var(--dur-micro) steps(1);
  user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:hover { translate: -1px -1px; box-shadow: 5px 5px 0 var(--color-accent-2); }
.btn:active { translate: 3px 3px; box-shadow: 1px 1px 0 var(--color-accent-2); }
.btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; transition: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; translate: none; box-shadow: none; }
.btn[aria-busy="true"] { cursor: progress; }
.btn--ghost { background: transparent; color: var(--color-ink); }
.btn--small { min-height: 36px; padding: var(--space-2xs) var(--space-sm); font-size: var(--text-sm); box-shadow: 3px 3px 0 var(--color-accent-2); }
.btn--small:hover { box-shadow: 4px 4px 0 var(--color-accent-2); }
.btn--small:active { box-shadow: 0 0 0 var(--color-accent-2); }

.link { color: var(--color-ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--color-accent-2); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
.link:hover { color: var(--color-accent-2); }
.link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.input {
  width: 100%; min-height: 52px; padding: 0 var(--space-md); background: var(--color-paper); color: var(--color-ink);
  border: var(--rule-bar) solid var(--color-muted); border-radius: 0; font-size: var(--text-lg);
}
.input:hover { border-color: var(--color-ink-2); }
.input:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; border-color: var(--color-ink); }
.input:disabled { background: var(--color-paper-3); color: var(--color-muted); border-color: var(--color-rule); cursor: not-allowed; }
.input[aria-invalid="true"] { border-color: var(--color-error); }

/* ---------- shell ---------- */
.bar { position: sticky; top: 0; z-index: var(--z-sticky-nav); background: var(--color-paper); border-bottom: var(--rule-bar) solid var(--color-rule); }
.bar__in { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); min-height: var(--bar-h); }
.wordmark { display: inline-flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.wordmark:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 4px; }

/* logo: pixel B tile with the acid hard shadow, pixel wordmark split in RGB (built by the logo script, see img/) */
.logo { display: block; height: 40px; width: auto; }
.logo--full { aspect-ratio: 176 / 32; }
.logo--mark { aspect-ratio: 1; display: none; }
.lg-acid { fill: var(--color-accent-2); }
.lg-ember { fill: var(--color-accent); }
.lg-dark { fill: var(--color-accent-ink); }
.lg-ink { fill: var(--color-ink); }
.lg-red { fill: var(--color-crt-r); }
.lg-cyan { fill: var(--color-crt-c); }
.lg-split-r, .lg-split-c { transition: transform var(--dur-micro) var(--ease-out); }
.wordmark:hover .lg-split-r { transform: translateX(-0.75px); }
.wordmark:hover .lg-split-c { transform: translateX(0.75px); }
.wordmark:active .logo { translate: 1px 1px; }

main { padding-block: var(--space-xl) var(--space-3xl); }

/* ---------- library ---------- */
.lib-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xl); align-items: end; padding-bottom: var(--space-xl); }
.lib-head h1 { font-size: clamp(2rem, 5vw, 3.5rem); max-width: 14ch; }
.lib-head p { margin-top: var(--space-md); color: var(--color-ink-2); max-width: 46ch; }

/* mascot: the logo tile as a character holding a handheld (pixels from tools/make_mascot.py) */
.mascot { position: relative; margin: 0; padding-top: var(--space-xl); justify-self: end; }
.mascot__art { display: block; width: clamp(150px, 17vw, 220px); height: auto; overflow: visible; }
.mascot__body { animation: mascot-bob 1.6s steps(1) infinite; }
.mascot__eyes { transform-box: fill-box; transform-origin: center; animation: mascot-blink 4.2s steps(1) infinite; }
.m-a { fill: var(--color-accent-2); } .m-e { fill: var(--color-accent); } .m-d { fill: var(--color-accent-ink); }
.m-w { fill: var(--color-ink); } .m-c { fill: var(--color-crt-c); }
.mascot__bubble {
  position: absolute; top: 0; right: 62%; z-index: 1; max-width: none; white-space: nowrap;
  padding: var(--space-xs) var(--space-sm); background: var(--color-paper-2); color: var(--color-ink);
  border: var(--rule-bar) solid var(--color-ink); box-shadow: 4px 4px 0 var(--color-accent);
  font-weight: 700; font-size: var(--text-sm);
}
@keyframes mascot-bob { 0% { transform: translateY(0); } 50% { transform: translateY(-0.5px); } }
@keyframes mascot-blink { 0% { transform: scaleY(1); } 94% { transform: scaleY(0.15); } 97% { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) { .mascot__body, .mascot__eyes { animation: none; } }

.crt { isolation: isolate; }
.crt::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background-image:
    repeating-linear-gradient(to right, color-mix(in oklab, var(--color-crt-r) 5%, transparent) 0 1px, color-mix(in oklab, var(--color-crt-g) 5%, transparent) 1px 2px, color-mix(in oklab, var(--color-crt-b) 5%, transparent) 2px 3px),
    repeating-linear-gradient(to bottom, transparent 0 2px, color-mix(in oklab, var(--color-shade) 16%, transparent) 2px 3px);
}

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); padding-block: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 40px; padding: 0 var(--space-md);
  border: var(--rule-bar) solid var(--color-rule); border-radius: 0; color: var(--color-ink-2); text-decoration: none; font-weight: 700; font-size: var(--text-sm);
  transition: background-color var(--dur-micro) steps(1), color var(--dur-micro) steps(1);
}
.chip:hover { border-color: var(--color-ink-2); color: var(--color-ink); }
.chip:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.chip[aria-current="true"] { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.chip .count { font-weight: 400; }
.filters__spacer { flex: 1; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: var(--space-md); padding: 0; margin: var(--space-md) 0 0; list-style: none; }
.grid > li { min-width: 0; }
.tile {
  display: grid; grid-template-rows: auto 1fr; height: 100%; overflow: hidden;
  background: var(--color-paper-2); border: var(--rule-bar) solid var(--color-rule); border-radius: var(--radius-card);
  color: var(--color-ink); text-decoration: none;
  transition: background-color var(--dur-micro) steps(1), color var(--dur-micro) steps(1), border-color var(--dur-micro) steps(1);
}
.tile__body { display: grid; grid-template-rows: auto 1fr auto; gap: var(--space-xs); padding: var(--space-md); min-width: 0; }
.tile__pic { position: relative; aspect-ratio: 16 / 10; background: var(--color-paper); border-bottom: var(--rule-bar) solid var(--color-rule); }
.tile__pic > svg, .tile__pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile:hover .tile__pic, .tile:focus-visible .tile__pic { border-bottom-color: var(--color-accent-ink); }

/* game thumbnails: inline SVG drawn from the game's own pieces */
.th text { font-family: var(--font-body); font-weight: 900; }
.th .px { font-family: var(--font-outlier); font-weight: 700; }
.th .bg { fill: var(--color-paper); } .th .p2 { fill: var(--color-paper-2); } .th .p3 { fill: var(--color-paper-3); } .th .ru { fill: var(--color-rule); }
.th .a { fill: var(--color-accent); } .th .b { fill: var(--color-accent-2); } .th .c { fill: var(--color-crt-c); }
.th .r { fill: var(--game-1); } .th .bl { fill: var(--game-2); } .th .gn { fill: var(--game-3); } .th .y { fill: var(--game-4); }
.th .ink { fill: var(--color-ink); } .th .mu { fill: var(--color-muted); } .th .dk { fill: var(--color-accent-ink); }
.th .ln { fill: none; stroke: var(--color-ink); } .th .lr { fill: none; stroke: var(--color-rule); }
.th .lm { fill: none; stroke: var(--color-muted); } .th .lb { fill: none; stroke: var(--color-accent-2); } .th .ld { fill: none; stroke: var(--color-accent-ink); }
.th .dim { opacity: 0.35; }
.th .now { text-decoration: underline; } .th .strike { text-decoration: line-through; }
.tile h2 { font-size: var(--text-xl); }
.tile p { color: var(--color-ink-2); }
.tile__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-sm); font-size: var(--text-sm); font-weight: 700; color: var(--color-muted); }
.tile__meta span { white-space: nowrap; }
.tile:hover, .tile:focus-visible { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.tile:hover p, .tile:hover .tile__meta, .tile:focus-visible p, .tile:focus-visible .tile__meta { color: var(--color-accent-ink); }
.tile:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.tile:active { background: var(--color-accent-2); border-color: var(--color-accent-2); }

.empty { padding: var(--space-xl); border: var(--rule-bar) dashed var(--color-rule); color: var(--color-ink-2); }

/* ---------- game view ---------- */
.game-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-md) var(--space-xl); align-items: end; padding-bottom: var(--space-lg); }
.game-head h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); margin-top: var(--space-sm); }
.game-head p { color: var(--color-ink-2); margin-top: var(--space-xs); }
.scores { display: flex; gap: var(--space-lg); align-items: start; }
.score { display: grid; gap: var(--space-2xs); }
.score .figure { white-space: nowrap; }

.game-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 280px); gap: var(--space-xl); align-items: start; }
.stage {
  position: relative; display: grid; place-items: center; min-height: 380px; padding: var(--space-lg);
  background: var(--color-paper-2); border: var(--rule-bar) solid var(--color-rule); border-radius: var(--radius-card);
  touch-action: manipulation;
}
.stage:focus { outline: none; }
.g { position: relative; z-index: 2; width: 100%; display: grid; justify-items: center; gap: var(--space-md); }
.g-canvas { display: block; height: auto; background: var(--color-paper); border: var(--rule-bar) solid var(--color-rule); touch-action: none; }
.status { min-height: 1.6em; font-weight: 700; color: var(--color-ink-2); text-align: center; }

.side { display: grid; gap: var(--space-lg); }
.side h2 { font-size: var(--text-lg); }
.side p { margin-top: var(--space-xs); color: var(--color-ink-2); }
.side__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }

.overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: var(--space-lg); background: var(--scrim); }
.overlay__panel { display: grid; color: var(--color-ink); justify-items: center; gap: var(--space-md); text-align: center; padding: var(--space-lg); background: var(--color-paper); border: var(--rule-bar) solid var(--color-ink); box-shadow: var(--shadow-card); max-width: 360px; }
.overlay__panel h2 { font-size: var(--text-2xl); }
.overlay__new { font-weight: 700; color: var(--color-accent); }
.overlay__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm); }

.dpad { display: none; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 56px); gap: var(--space-2xs); }
.dpad button { font-size: var(--text-lg); padding: 0; min-height: 56px; }
.dpad [data-d="up"] { grid-column: 2; grid-row: 1; }
.dpad [data-d="left"] { grid-column: 1; grid-row: 2; }
.dpad [data-d="down"] { grid-column: 2; grid-row: 2; }
.dpad [data-d="right"] { grid-column: 3; grid-row: 2; }
@media (pointer: coarse) { .dpad { display: grid; } }


/* ---------- shared game pieces ---------- */
.board { display: grid; gap: var(--space-2xs); width: min(100%, var(--board, 400px)); }
.cell {
  aspect-ratio: 1; display: grid; place-items: center; padding: 0; min-width: 0;
  background: var(--color-paper-3); color: var(--color-ink); border: var(--rule-bar) solid var(--color-rule); border-radius: var(--radius-card);
  font-family: var(--font-body); font-weight: 900; font-size: clamp(1rem, 4vw, 1.6rem); cursor: pointer;
  transition: background-color var(--dur-micro) steps(1), color var(--dur-micro) steps(1), translate var(--dur-micro) var(--ease-out);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.cell:hover { border-color: var(--color-ink-2); }
.cell:active { translate: 1px 1px; }
.cell:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; transition: none; }
.cell:disabled { cursor: default; }
.cell:disabled:hover { border-color: var(--color-rule); }
.cell[data-on="true"] { background: var(--color-accent); color: var(--color-accent-ink); border-color: var(--color-accent); }
.cell[data-hit="true"] { background: var(--color-accent-2); color: var(--color-accent-ink); border-color: var(--color-accent-2); }
.cell[data-open="true"] { background: var(--color-paper); }
.cell[data-bad="true"] { background: var(--color-crt-r); color: var(--color-accent-ink); }

.row-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm); }
.big-word { font-family: var(--font-body); font-weight: 900; font-size: clamp(2rem, 7vw, 3.25rem); line-height: 1.05; text-align: center; overflow-wrap: anywhere; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); width: min(100%, 420px); }
.choices .btn { min-height: 56px; font-size: var(--text-lg); }
.meter { width: min(100%, 420px); height: 8px; background: var(--color-paper-3); }
.meter > i { display: block; height: 100%; background: var(--color-accent-2); transform-origin: left; }

/* 2048 */
.t2048 { --board: 380px; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: var(--space-2xs); background: var(--color-rule); }
.t2048 .cell { cursor: default; border: 0; font-size: clamp(1rem, 5vw, 1.75rem); }
.t2048 .cell:hover { border: 0; }
.t2048 .cell[data-v="0"] { background: var(--color-paper-2); }
.t2048 .cell[data-v="2"], .t2048 .cell[data-v="4"] { background: var(--color-paper-3); color: var(--color-ink); }
.t2048 .cell[data-v="8"], .t2048 .cell[data-v="16"] { background: var(--color-crt-b); color: var(--color-accent-ink); }
.t2048 .cell[data-v="32"], .t2048 .cell[data-v="64"] { background: var(--color-crt-c); color: var(--color-accent-ink); }
.t2048 .cell[data-v="128"], .t2048 .cell[data-v="256"] { background: var(--color-accent-2); color: var(--color-accent-ink); }
.t2048 .cell[data-v="512"], .t2048 .cell[data-v="1024"] { background: var(--color-accent); color: var(--color-accent-ink); }
.t2048 .cell[data-v="big"] { background: var(--color-ink); color: var(--color-paper); }

/* minesweeper */
.mines { --board: 420px; gap: var(--space-3xs); }
.mines .cell { font-size: clamp(0.85rem, 3.4vw, 1.2rem); border-width: 1px; border-radius: 2px; }
.mines .cell[data-n="1"] { color: var(--color-crt-c); }
.mines .cell[data-n="2"] { color: var(--color-accent-2); }
.mines .cell[data-n="3"] { color: var(--color-accent); }
.mines .cell[data-n="4"], .mines .cell[data-n="5"], .mines .cell[data-n="6"], .mines .cell[data-n="7"], .mines .cell[data-n="8"] { color: var(--color-crt-r); }
.mines .cell[data-flag="true"] { background: var(--color-accent-2); color: var(--color-accent-ink); }

/* tic tac toe, connect four */
.ttt { --board: 330px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.ttt .cell { font-size: clamp(2rem, 9vw, 3.25rem); }
.ttt .cell[data-p="X"] { color: var(--color-accent); }
.ttt .cell[data-p="O"] { color: var(--color-accent-2); }
.c4 { --board: 448px; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: var(--space-xs); background: var(--color-crt-b); gap: var(--space-2xs); border-radius: var(--radius-card); }
.c4 .cell { border-radius: 50%; background: var(--color-paper); border: 0; }
.c4 .cell:hover { border: 0; }
.c4 .cell[data-p="1"] { background: var(--color-accent); }
.c4 .cell[data-p="2"] { background: var(--color-accent-2); }
.c4 .cell[data-win="true"] { outline: 3px solid var(--color-ink); outline-offset: -3px; }

/* memory */
.memory { --board: 400px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-xs); }
.memory .cell { font-size: clamp(1.6rem, 8vw, 2.4rem); }
.memory .cell[data-face="down"] { color: transparent; }
.memory .cell[data-face="down"]::after { content: "?"; color: var(--color-muted); font-size: var(--text-lg); }
.memory .cell[data-face="up"] { background: var(--color-paper); }
.memory .cell[data-done="true"] { background: var(--color-paper); border-color: var(--color-accent-2); opacity: 0.6; }
.memory .k1 { color: var(--color-accent); } .memory .k2 { color: var(--color-accent-2); } .memory .k3 { color: var(--color-crt-c); } .memory .k4 { color: var(--color-crt-r); }

/* simon */
.simon { --board: 320px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.simon .cell { opacity: 0.35; border: 0; transition: opacity var(--dur-micro) steps(1); }
.simon .cell[data-lit="true"] { opacity: 1; }
.simon .cell:nth-child(1) { background: var(--game-1); } .simon .cell:nth-child(2) { background: var(--game-2); }
.simon .cell:nth-child(3) { background: var(--game-3); } .simon .cell:nth-child(4) { background: var(--game-4); }

/* whack, lights, slide */
.whack { --board: 360px; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); }
.lights { --board: 360px; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--space-2xs); }
.lights .cell[data-on="true"] { background: var(--color-accent-2); border-color: var(--color-accent-2); }
.slide { --board: 360px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2xs); }
.slide .cell[data-empty="true"] { background: transparent; border-color: transparent; cursor: default; }
.slide .cell[data-ok="true"] { color: var(--color-accent-2); }

/* reaction, aim */
.pad {
  width: 100%; min-height: 300px; display: grid; place-items: center; padding: var(--space-lg); text-align: center;
  background: var(--color-crt-r); color: var(--color-ink); border: var(--rule-bar) solid var(--color-ink); border-radius: var(--radius-card);
  font-family: var(--font-body); font-weight: 900; font-size: var(--text-2xl); cursor: pointer; user-select: none; touch-action: manipulation;
}
.pad[data-s="go"] { background: var(--color-accent-2); color: var(--color-accent-ink); }
.pad[data-s="idle"], .pad[data-s="result"] { background: var(--color-paper-3); }
.pad:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.field { position: relative; width: 100%; height: 340px; background: var(--color-paper); border: var(--rule-bar) solid var(--color-rule); overflow: hidden; cursor: crosshair; touch-action: none; }
.target { position: absolute; border-radius: 50%; padding: 0; border: 4px solid var(--color-accent-ink); background: var(--color-accent); box-shadow: inset 0 0 0 6px var(--color-accent-2); cursor: pointer; }
.target:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* stroop */
.ink-1 { color: var(--game-1); } .ink-2 { color: var(--game-2); } .ink-3 { color: var(--game-3); } .ink-4 { color: var(--game-4); }
.sw { border-color: var(--color-ink); }
.sw-1 { background: var(--game-1); color: var(--color-accent-ink); } .sw-2 { background: var(--game-2); color: var(--color-accent-ink); }
.sw-3 { background: var(--game-3); color: var(--color-accent-ink); } .sw-4 { background: var(--game-4); color: var(--color-accent-ink); }

/* typing */
.words { width: min(100%, 520px); display: flex; flex-wrap: wrap; gap: var(--space-2xs) var(--space-sm); font-size: var(--text-xl); line-height: 1.5; min-height: 6em; align-content: flex-start; }
.words span[data-s="now"] { color: var(--color-ink); text-decoration: underline; text-decoration-color: var(--color-accent-2); text-decoration-thickness: 3px; text-underline-offset: 0.25em; }
.words span[data-s="ok"] { color: var(--color-accent-2); }
.words span[data-s="bad"] { color: var(--color-crt-r); text-decoration: line-through; }
.words span { color: var(--color-muted); }
.form-row { display: flex; gap: var(--space-sm); width: min(100%, 520px); }
.form-row .input { flex: 1; }

/* ---------- responsive ---------- */
@media (max-width: 60rem) {
  .game-body { grid-template-columns: minmax(0, 1fr); }
  .game-head { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  main { padding-top: var(--space-lg); }
  .stage { padding: var(--space-sm); min-height: 320px; }
  .lib-head { grid-template-columns: minmax(0, 1fr); }
  .mascot { display: none; }
  .logo { height: 26px; }
}
@media (max-width: 22rem) {
  .logo--full { display: none; }
  .logo--mark { display: block; height: 32px; }
  .scores { gap: var(--space-md); }
  .figure { font-size: 2.5rem; }
}

/* ---------- site nav ---------- */
.bar__nav { display: flex; align-items: center; gap: var(--space-md); min-width: 0; }
.bar__link {
  font-weight: 700; font-size: var(--text-sm); color: var(--color-ink-2); text-decoration: none; white-space: nowrap;
  padding-block: var(--space-xs); border-bottom: var(--rule-bar) solid transparent;
}
.bar__link:hover { color: var(--color-ink); border-bottom-color: var(--color-accent-2); }
.bar__link[aria-current="page"] { color: var(--color-ink); border-bottom-color: var(--color-accent); }
.bar__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---------- about page ---------- */
.about-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-xl); align-items: end; padding-bottom: var(--space-xl); }
.about-hero h1 { font-size: clamp(2rem, 5vw, 3.5rem); max-width: 13ch; }
.about-hero p { margin-top: var(--space-md); color: var(--color-ink-2); max-width: 52ch; font-size: var(--text-lg); line-height: 1.5; }

/* facts: four numbers in a strip, like a scoreboard */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: var(--rule-bar) solid var(--color-rule); background: var(--color-paper-2); }
.facts > div { display: grid; gap: var(--space-xs); align-content: start; padding: var(--space-lg); min-width: 0; }
.facts > div + div { border-left: var(--rule-bar) solid var(--color-rule); }
.facts dt { order: 2; font-weight: 700; font-size: var(--text-sm); color: var(--color-ink-2); }
.facts dd { order: 1; margin: 0; }
.facts > div:nth-child(odd) .figure { color: var(--color-accent); }

/* sections: heading in the left column, body on the right */
.about-sec { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--space-md) var(--gap-columns); padding-block: var(--space-2xl); border-bottom: var(--rule-hair) solid var(--color-rule); }
.about-sec > h2 { font-size: var(--text-2xl); }
.about-sec__body { display: grid; gap: var(--space-md); min-width: 0; }
.about-sec__body > p { color: var(--color-ink-2); font-size: var(--text-lg); line-height: 1.55; }

.rules { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.rules li { display: grid; grid-template-columns: 4rem minmax(0, 1fr); gap: var(--space-2xs) var(--space-md); padding-block: var(--space-lg); counter-increment: rule; }
.rules li + li { border-top: var(--rule-hair) dashed var(--color-rule); }
.rules li:first-child { padding-top: 0; }
.rules li::before { content: counter(rule, decimal-leading-zero); grid-row: span 2; font-family: var(--font-outlier); font-weight: 700; font-size: var(--text-2xl); line-height: 1; color: var(--color-accent-2); }
.rules h3 { font-size: var(--text-xl); }
.rules p { color: var(--color-ink-2); }

.shelves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); margin: 0; padding: 0; list-style: none; }
.shelf {
  display: grid; gap: var(--space-xs); height: 100%; padding: var(--space-lg);
  background: var(--color-paper-2); border: var(--rule-bar) solid var(--color-rule); border-radius: var(--radius-card);
  color: var(--color-ink); text-decoration: none;
  transition: background-color var(--dur-micro) steps(1), color var(--dur-micro) steps(1), border-color var(--dur-micro) steps(1);
}
.shelf__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-sm); }
.shelf h3 { font-size: var(--text-xl); }
.shelf .figure { font-size: var(--text-2xl); }
.shelf p { color: var(--color-ink-2); }
.shelf:hover, .shelf:focus-visible { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.shelf:hover p, .shelf:focus-visible p, .shelf:hover .figure, .shelf:focus-visible .figure { color: var(--color-accent-ink); }
.shelf:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.shelf:active { background: var(--color-accent-2); border-color: var(--color-accent-2); }

.about-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-lg);
  margin-top: var(--space-2xl); padding: var(--space-xl); background: var(--color-paper-2);
  border: var(--rule-bar) solid var(--color-ink); box-shadow: var(--shadow-card);
}
.about-cta h2 { font-size: var(--text-2xl); }
.about-cta p { margin-top: var(--space-xs); color: var(--color-ink-2); }

@media (max-width: 60rem) {
  .about-sec { grid-template-columns: minmax(0, 1fr); padding-block: var(--space-xl); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts > div:nth-child(3) { border-left: 0; }
  .facts > div:nth-child(n+3) { border-top: var(--rule-bar) solid var(--color-rule); }
}
@media (max-width: 40rem) {
  .about-hero { grid-template-columns: minmax(0, 1fr); }
  .about-hero p { font-size: var(--text-md); }
  .facts > div { padding: var(--space-md); }
  .shelves { grid-template-columns: minmax(0, 1fr); }
  .rules li { grid-template-columns: 3rem minmax(0, 1fr); }
  .about-cta { padding: var(--space-lg); }
  .bar__nav { gap: var(--space-sm); }
}
/* header holds logo + about link + language switch: drop to the logo tile before they collide */
@media (max-width: 30rem) {
  .logo--full { display: none; }
  .logo--mark { display: block; height: 32px; }
}
