/* Undercover Nerd Project: design system v2 ("terminal"). Single source: design/ui.css.
   Copied into every deployable by tools/make-pages.py. Guide: design/README.md.

   Look: calm, soft-edged, dev-terminal accents (monospace labels, prompts, a blinking cursor).
   Colour: mid-tone blue (action), teal (success / terminal), soft violet (highlight).
   No pure black or white; no neons or pastels; text >= 4.5:1, UI borders >= 3:1 in BOTH themes. */

/* ---------- tokens ---------- */
:root {
  --bg: #f9f9f9;
  --surface: #fcfcfd;
  --surface-2: #eff1f5;
  --text: #15171c;
  --muted: #4a5160;
  --border: #d6dae2;           /* decorative hairlines */
  --border-strong: #7a8294;    /* control edges (>= 3:1) */

  --blue: #2456c9;             /* primary action, links */
  --on-blue: #f9f9f9;
  --teal: #0b766a;             /* terminal accents, success */
  --violet: #6841cf;           /* highlight, gradient end */
  --danger: #b42318;

  --link: var(--blue);
  --focus: var(--blue);
  --grad: linear-gradient(90deg, var(--blue), var(--violet));
  --glow-blue: rgb(36 86 201 / 0.10);
  --glow-violet: rgb(104 65 207 / 0.09);
  --glow-teal: rgb(11 118 106 / 0.08);
  --grid-dot: rgb(21 23 28 / 0.11);

  --tile: #f3d9a4;             /* Scrabble tile */
  --tile-edge: #d2aa5e;
  --tile-text: #3b2a0a;

  --shadow: 0 1px 2px rgb(20 24 40 / 0.05), 0 10px 28px rgb(20 24 40 / 0.07);
  --radius: 16px;
  --radius-sm: 11px;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px; --space-7: 48px;
  --container: 760px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-brand: "JetBrains Mono", "Fira Code", "Courier New", monospace;   /* toolbar brand + every page title (h1) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --surface: #1b1c1f; --surface-2: #25272b; --text: #e8eaee; --muted: #a7adb8;
    --border: #33363d; --border-strong: #79808e;
    --blue: #6f95ff; --on-blue: #121212; --teal: #3db9a5; --violet: #a488f6; --danger: #f0857d;
    --glow-blue: rgb(111 149 255 / 0.20); --glow-violet: rgb(164 136 246 / 0.16); --glow-teal: rgb(61 185 165 / 0.12);
    --grid-dot: rgb(232 234 238 / 0.08);
    --tile: #c99f55; --tile-edge: #8f6d30; --tile-text: #1f1604;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 10px 28px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --surface: #1b1c1f; --surface-2: #25272b; --text: #e8eaee; --muted: #a7adb8;
  --border: #33363d; --border-strong: #79808e;
  --blue: #6f95ff; --on-blue: #121212; --teal: #3db9a5; --violet: #a488f6; --danger: #f0857d;
  --glow-blue: rgb(111 149 255 / 0.20); --glow-violet: rgb(164 136 246 / 0.16); --glow-teal: rgb(61 185 165 / 0.12);
  --grid-dot: rgb(232 234 238 / 0.08);
  --tile: #c99f55; --tile-edge: #8f6d30; --tile-text: #1f1604;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.5), 0 10px 28px rgb(0 0 0 / 0.4);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.6 var(--font-sans);
  padding-bottom: env(safe-area-inset-bottom);
}
body.wide { --container: 1040px; }
body { overflow-x: clip; }
a { color: var(--link); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; }
h1 { font: 700 clamp(1.5rem, 5vw, 2.4rem)/1.2 var(--font-brand); letter-spacing: 0.02em; margin: 0; }   /* every page title: same font as the toolbar */
h2 { font-size: 1.25rem; margin: var(--space-6) 0 var(--space-2); }
h3 { font-size: 1.05rem; margin: var(--space-5) 0 var(--space-1); }
p, li { max-width: 68ch; }
::selection { background: color-mix(in srgb, var(--blue) 30%, transparent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
kbd, code {
  font: 600 0.85em var(--font-mono); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 0 0.4em;
}

/* ---------- layout ---------- */
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--blue); color: var(--on-blue); padding: var(--space-2) var(--space-4); z-index: 100; border-radius: 0 0 var(--radius-sm) 0; }
.skip:focus { left: 0; }
.page-head { padding: var(--space-6) 0 var(--space-4); }
.page-head .sub { margin: var(--space-2) 0 0; color: var(--muted); }
.title-row { display: flex; align-items: center; gap: var(--space-2); }
.stack > * + * { margin-top: var(--space-4); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: var(--space-4); }

/* mono "prompt" label used above titles, e.g. "$ ./anagram --solve" */
.eyebrow { margin: 0 0 var(--space-3); font: 600 0.82rem/1.4 var(--font-mono); color: var(--teal); letter-spacing: 0.02em; }
.eyebrow::before { content: "$ "; content: "$ " / ""; opacity: 0.7; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- command bar (the toolbar) ---------- */
.cmdbar-wrap { position: sticky; top: 0; z-index: 40; padding: var(--space-3) 0; }
.cmdbar {
  position: relative; display: flex; align-items: center; gap: var(--space-3);
  padding: 6px 8px 6px 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: var(--shadow);
}
.cmdbar::after {                                   /* thin accent line along the top edge */
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--blue), var(--violet), transparent); opacity: 0.8;
}
/* the brand: a terminal path that types itself (JetBrains Mono Bold, SIL OFL 1.1, self-hosted; see design/README.md).
   The real name stays in the link as visually hidden text for search engines and screen readers (.tb-sr). */
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("fonts/jetbrains-mono-700.woff2") format("woff2");
}
.brand { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; color: var(--text); text-decoration: none; }
.brand img { height: 30px; width: auto; flex: none; }
.tb-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tb-line {
  display: block; position: relative; padding-right: 0.8em; white-space: nowrap;   /* the padding reserves room for the cursor */
  font: 700 1rem/1.2 var(--font-brand); letter-spacing: 0.02em;
}
.tb-line .syntax { color: var(--muted); }
.tb-line .text { color: var(--text); }
.tb-line .cursor {
  display: inline-block; width: 0.6em; height: 1.1em; margin-left: 6px; vertical-align: bottom; background: var(--blue);   /* = the "p" of pr0j3ct, where the gradient starts */
  animation: tb-blink 1.2s step-end infinite;
}
@keyframes tb-blink { 50% { opacity: 0; } }
/* with JavaScript the full text only sizes the box, and the typed copy is drawn on top of it */
.js .tw-src { visibility: hidden; }
.js .tw-out { position: absolute; left: 0; top: 0; }
.js .tw-out .cursor { margin-left: 0.12em; }
.js [data-typewriter]:not(.tw-ready) .tw-out { visibility: hidden; }
.cmdbar-spacer { flex: 1; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 0; max-width: none; }
.nav-list a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-sm);
  font: 600 0.88rem var(--font-mono); color: var(--muted); text-decoration: none;
}
.nav-list a::before { content: "/"; content: "/" / ""; color: var(--teal); margin-right: 1px; }
.nav-list a:hover { color: var(--text); background: var(--surface-2); }
.nav-list a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 -2px 0 var(--teal); }
/* "/projects" menu: lists every project (hover or keyboard focus on desktop, tap on phones) */
.has-sub { position: relative; }
.has-sub > a::after {
  content: ""; width: 5px; height: 5px; margin: -3px 0 0 8px; border: solid var(--teal); border-width: 0 2px 2px 0;
  transform: rotate(45deg); transition: transform 0.15s ease;
}
.nav-list .sub { display: none; list-style: none; margin: 0; padding: 0; }
.nav-list .sub a { display: flex; white-space: nowrap; }
.nav-list .sub a::before { content: "./"; content: "./" / ""; color: var(--teal); margin-right: 1px; }
.nav-list .sub a[aria-current="page"] { box-shadow: inset 2px 0 0 var(--teal); }
@media (min-width: 720px) {
  .nav-list .sub {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; min-width: 240px; flex-direction: column; gap: 2px; padding: var(--space-2);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .nav-list .sub::before { content: ""; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }   /* keeps hover alive across the gap */
  .has-sub:hover > .sub, .has-sub:focus-within > .sub { display: flex; }
  .has-sub:hover > a::after, .has-sub:focus-within > a::after { transform: rotate(-135deg); margin-top: 3px; }
  .has-sub:hover > a, .has-sub:focus-within > a { color: var(--text); background: var(--surface-2); }
}
.icon-btn, .theme-toggle, .nav-toggle {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; color: var(--text);
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer;
}
.icon-btn:hover, .theme-toggle:hover, .nav-toggle:hover { background: var(--surface-2); border-color: var(--border); }
.i-sun { display: none; }
.theme-toggle[aria-pressed="true"] .i-sun { display: block; }
.theme-toggle[aria-pressed="true"] .i-moon { display: none; }
.nav-toggle { display: none; }

@media (max-width: 719px) {
  /* the brand stays on one line: its size scales with the room left beside the buttons */
  .brand { flex: 1 1 0; }
  .brand .tb-line { font-size: min(1rem, calc((100vw - 190px) / 17.4)); }
  @supports (container-type: inline-size) {
    .brand { container-type: inline-size; --mascot: 42px; }   /* mascot + gap */
    .brand .tb-line { font-size: min(1rem, calc((100cqw - var(--mascot)) / 17.4)); }
  }
  .cmdbar { padding-left: 10px; padding-right: 6px; }
  .icon-btn, .theme-toggle, .nav-toggle { width: 38px; }
  .cmdbar-spacer { display: none; }
  .js .nav-toggle { display: inline-grid; }
  .js .nav-list {
    display: none; position: absolute; left: 0; right: 0; top: calc(100% + 8px); flex-direction: column; align-items: stretch;
    padding: var(--space-2); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .js .cmdbar.open .nav-list { display: flex; }
  .js .nav-list a { min-height: 48px; font-size: 0.95rem; }
  .js .nav-list a::before { content: "$ cd /"; content: "$ cd /" / ""; color: var(--teal); opacity: 0.85; margin-right: 4px; }
  .cmdbar { gap: var(--space-2); }
  .js .has-sub > a::after { margin-left: 12px; }
  .js .has-sub.sub-open > .sub { display: flex; flex-direction: column; margin: 0 0 var(--space-2) var(--space-4); border-left: 2px solid var(--border); }
  .js .has-sub.sub-open > a::after { transform: rotate(-135deg); margin-top: 3px; }
  .js .nav-list .sub a { padding-left: var(--space-4); }
  .js .nav-list .sub a::before { content: "./"; content: "./" / ""; opacity: 0.85; margin-right: 1px; }
}
@media (max-width: 379px) {            /* small phones: the text gets the mascot's room */
  .brand img { display: none; }
  .brand { --mascot: 0px; }
  .icon-btn, .theme-toggle, .nav-toggle { width: 34px; }
}

.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-2); list-style: none; margin: var(--space-2) 0 0; padding: 0; font: 0.82rem var(--font-mono); color: var(--muted); }
.crumbs li + li::before { content: "/"; content: "/" / ""; margin-right: var(--space-2); color: var(--teal); }
.crumbs a { color: var(--muted); }

.app-footer { margin-top: var(--space-7); padding: var(--space-5) 0 var(--space-6); border-top: 1px solid var(--border); color: var(--muted); font-size: 0.88rem; }
.app-footer nav { display: flex; flex-wrap: wrap; gap: 0 var(--space-5); margin-bottom: var(--space-2); font-family: var(--font-mono); font-size: 0.82rem; }
.app-footer a { color: var(--muted); display: inline-block; padding: var(--space-1) 0; }
.app-footer a:hover { color: var(--text); }
.app-footer .install-app { padding: var(--space-1) 0; border: 0; background: none; color: var(--teal); font: inherit; cursor: pointer; }
.app-footer .install-app:hover { color: var(--text); text-decoration: underline; }
.app-footer .install-app[hidden] { display: none; }
.app-footer p { margin: var(--space-1) 0; }
.app-footer .sig { font-family: var(--font-mono); font-size: 0.8rem; }
.app-footer .sig::before { content: "$ "; content: "$ " / ""; color: var(--teal); }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow); }
@media (max-width: 480px) { .card { padding: var(--space-4); } }

/* terminal-window card: title bar with three dots and a mono title */
.window { padding: 0; overflow: hidden; }
.window-bar { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-4); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.window-bar .dots { display: inline-flex; gap: 6px; }
.window-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); opacity: 0.55; }
.window-bar .dots i:nth-child(1) { background: var(--danger); opacity: 0.8; }
.window-bar .dots i:nth-child(2) { background: var(--violet); opacity: 0.8; }
.window-bar .dots i:nth-child(3) { background: var(--teal); opacity: 0.9; }
.window-title { font: 600 0.8rem var(--font-mono); color: var(--muted); }
.window-body { padding: var(--space-5); }
@media (max-width: 480px) { .window-body { padding: var(--space-4); } }

/* ---------- form controls ---------- */
.label-row { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.label, .label-row label, .label-row legend { font: 700 0.78rem var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 0; margin: 0; }
.control { border: 0; padding: 0; margin: 0; min-width: 0; }
input[type="text"], select {
  width: 100%; min-height: 48px; padding: 0 var(--space-3); background: var(--bg); color: var(--text);
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); font: inherit;
}
input[type="text"]::placeholder { color: var(--muted); opacity: 1; }
input[type="text"]:focus-visible, select:focus-visible { border-color: var(--focus); outline-offset: 0; box-shadow: 0 0 0 4px var(--glow-blue); }
.input-lg { font: 600 1.25rem var(--font-mono); letter-spacing: 0.05em; min-height: 56px; }
.field { position: relative; }
.field-prompt::before { content: ">"; content: ">" / ""; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font: 700 1.2rem var(--font-mono); color: var(--teal); pointer-events: none; }
.field-prompt input { padding-left: 38px; }
.field .icon-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.field input { padding-right: 52px; }

.seg { display: flex; gap: 3px; padding: 3px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--bg); }
.seg label { flex: 1; margin: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: grid; place-items: center; min-height: 42px; padding: 0 var(--space-2); text-align: center; font-weight: 600; font-size: 0.93rem; cursor: pointer; color: var(--text); border-radius: 8px; }
.seg label:hover span { background: var(--surface-2); }
.seg input:checked + span { background: var(--blue); color: var(--on-blue); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 50px; padding: 0 var(--space-5);
  border: 1.5px solid transparent; border-radius: var(--radius-sm); font: 700 1rem var(--font-sans); text-decoration: none; cursor: pointer;
  background: var(--blue); color: var(--on-blue); transition: box-shadow 0.2s, transform 0.1s, filter 0.2s;
}
.btn:hover { box-shadow: 0 0 0 4px var(--glow-blue); filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--text); box-shadow: none; filter: none; }
.btn-quiet { background: var(--surface-2); color: var(--text); }

.chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.chip {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--space-3); background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 999px; font: 600 0.88rem var(--font-mono); cursor: pointer; text-decoration: none;
}
.chip:hover { border-color: var(--blue); color: var(--blue); }
.badge { display: inline-flex; align-items: center; padding: 0 var(--space-2); border: 1px solid var(--teal); border-radius: 999px; font: 700 0.7rem var(--font-mono); color: var(--teal); letter-spacing: 0.03em; }

details.more > summary, details.fold > summary { cursor: pointer; list-style: none; }
details.more > summary::-webkit-details-marker, details.fold > summary::-webkit-details-marker { display: none; }
details.more > summary { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 40px; font: 700 0.85rem var(--font-mono); color: var(--muted); }
details.more > summary::before { content: "+"; content: "+" / ""; display: inline-grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 6px; font-size: 0.85rem; line-height: 1; }
details.more[open] > summary::before { content: "–"; content: "–" / ""; }
details.more > summary:hover { color: var(--text); }
details.more > .row { margin-top: var(--space-3); }

/* ---------- accordion (long-form content kept out of the way) ---------- */
.fold { border-bottom: 1px solid var(--border); }
.fold:first-of-type { border-top: 1px solid var(--border); }
.fold > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 52px; padding: var(--space-2) 2px; }
.fold > summary h2, .fold > summary h3 { margin: 0; font-size: 1.02rem; font-weight: 700; }
.fold > summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform 0.2s; }
.fold[open] > summary::after { transform: rotate(-135deg); }
.fold > summary:hover h2, .fold > summary:hover h3 { color: var(--blue); }
.fold-body { padding: 0 2px var(--space-5); }
.fold-body > :first-child { margin-top: var(--space-1); }

/* ---------- help anchor: tiny "?" that reveals a short tip on hover, focus or tap ---------- */
.help-wrap { position: relative; display: inline-flex; vertical-align: middle; }
.help {
  display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; background: transparent; color: var(--muted);
  border: 1.5px solid var(--border-strong); border-radius: 7px; font: 700 0.75rem/1 var(--font-mono); cursor: help;
}
.help::before { content: ""; position: absolute; inset: -11px; }
.help:hover, .help[aria-expanded="true"] { color: var(--text); border-color: var(--text); background: var(--surface-2); }
.help-pop {
  position: absolute; z-index: 50; top: calc(100% + 10px); left: 50%; width: max-content; max-width: min(18rem, calc(100vw - 2rem));
  transform: translateX(calc(-50% + var(--shift, 0px)));
  padding: var(--space-3) var(--space-4); background: var(--text); color: var(--bg); border-radius: var(--radius-sm);
  font: 500 0.88rem/1.5 var(--font-sans); text-align: left; text-transform: none; letter-spacing: 0; box-shadow: var(--shadow);
}
.help-pop::before { content: ""; position: absolute; top: -5px; left: calc(50% - var(--shift, 0px)); width: 10px; height: 10px; background: inherit; transform: translateX(-50%) rotate(45deg); }
.help-pop b { font-weight: 800; }
.help-pop ol, .help-pop ul { margin: var(--space-1) 0 0; padding-left: 1.1rem; }
.help-pop li { margin: 2px 0; max-width: none; }
.help-pop a { color: inherit; text-decoration: underline; }
.help-pop kbd { background: color-mix(in srgb, var(--bg) 18%, transparent); border-color: color-mix(in srgb, var(--bg) 35%, transparent); color: inherit; }
@media (max-width: 600px) {
  .help-pop { position: fixed; left: var(--space-4); right: var(--space-4); bottom: calc(var(--space-4) + env(safe-area-inset-bottom)); top: auto; width: auto; max-width: none; transform: none; padding: var(--space-4) var(--space-5); font-size: 0.95rem; }
  .help-pop::before { display: none; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 60;
  background: var(--text); color: var(--bg); padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm); font: 600 0.9rem var(--font-mono);
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scrabble letter tiles (kept) ---------- */
.tile {
  display: inline-grid; place-items: center; width: 34px; height: 38px; text-transform: uppercase;
  background: var(--tile); color: var(--tile-text); border-radius: 6px; box-shadow: 0 2px 0 var(--tile-edge);
  font: 800 1.1rem/1 system-ui, sans-serif;
}
.tile-blank { background: var(--surface-2); box-shadow: 0 2px 0 var(--border); border: 1.5px dashed var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .tb-line .cursor { opacity: 1; }
}
