/* ---------- Tokens ---------- */
:root {
  --bg: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --fg: #1b1b23;
  --muted: #5e5e6c;
  --line: #e4e1da;
  --line-cell: rgba(27, 27, 35, 0.14);
  --ink: #1b1b23;
  --accent: #4b45d1;
  --accent-hover: #3e38b8;
  --accent-soft: #ecebfb;
  --accent-fg: #ffffff;
  --gold: #f2b705;
  --cta: #f2b705;
  --cta-hover: #dba400;
  --cta-edge: #a87e00;
  --cta-fg: #1b1b23;
  --focus: #2f6fed;
  --star: #1b1b23;
  --mark: #6a6a78;
  --bad: #b3261e;
  --bad-soft: #fdecea;
  --good: #1d7a3e;
  --good-soft: #e5f4ea;
  --warn-soft: #fff4d6;
  --hint: #f2b705;
  --r0: #f7c5bd; --r1: #fbd9a6; --r2: #f8ec9c; --r3: #c9e7ae; --r4: #addfd3;
  --r5: #b7d3f6; --r6: #d0c4f3; --r7: #f3c0de; --r8: #e4d0b8; --r9: #d2d8de;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111116;
    --surface: #1b1b22;
    --surface-2: #22222b;
    --fg: #ececf2;
    --muted: #a6a6b4;
    --line: #2e2e38;
    --line-cell: rgba(255, 255, 255, 0.13);
    --ink: #ececf2;
    --accent: #8f8bff;
    --accent-hover: #a5a2ff;
    --accent-soft: #2a2950;
    --accent-fg: #121230;
    --cta: #ffc83d;
    --cta-hover: #ffd76a;
    --cta-edge: #ffc83d;
    --focus: #8ab4f8;
    --star: #fff3c8;
    --mark: #b9b9c6;
    --bad: #ff8a80;
    --bad-soft: #3a1f1d;
    --good: #7fd69b;
    --good-soft: #17301f;
    --warn-soft: #3a3115;
    --hint: #ffd54f;
    --r0: #5b302c; --r1: #5c4424; --r2: #524d27; --r3: #33502e; --r4: #224e48;
    --r5: #284163; --r6: #3e3664; --r7: #5a2e4e; --r8: #4a3f33; --r9: #3c434a;
  }
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 20px 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.skip {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-fg);
  padding: 8px 16px;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 16px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  font-size: 1.1rem;
  color: var(--fg);
  text-decoration: none;
}
.brand svg { width: 28px; height: 28px; fill: var(--gold); }
.topbar nav { flex: 1; }
.topbar nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.topbar nav a {
  display: block;
  padding: 8px 12px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 550;
}
.topbar nav a:hover { background: var(--surface-2); color: var(--fg); }
.topbar nav a[aria-current="page"] { color: var(--fg); }
.account-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--line);
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  min-height: 40px;
  white-space: nowrap;
}
.account-chip:not(:has(.avatar)) { padding-left: 14px; }
.account-chip:hover { background: var(--surface-2); color: var(--fg); }

@media (max-width: 560px) {
  .topbar nav li:first-child { display: none; }
  .topbar nav a { padding: 8px; }
  .brand span { display: none; }
}

/* ---------- Layout ---------- */
.layout {
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "play" "side" "howto";
}
.play { grid-area: play; min-width: 0; }
.side { grid-area: side; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.howto { grid-area: howto; }

@media (min-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-areas: "play side" "howto side";
    align-items: start;
  }
}
@media (min-width: 1200px) {
  .layout {
    grid-template-columns: 290px minmax(0, 1fr) 340px;
    grid-template-areas: "howto play side";
    gap: 24px;
  }
  .howto {
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 20px;
}

/* ---------- Buttons and form controls ---------- */
.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--fg);
  cursor: pointer;
  text-decoration: none;
}
.button:hover:not(:disabled) { background: var(--line); color: var(--fg); }
.button:disabled { opacity: 0.45; cursor: not-allowed; }
.button.primary { background: var(--cta); border-color: var(--cta-edge); color: var(--cta-fg); }
.button.primary:hover:not(:disabled) { background: var(--cta-hover); color: var(--cta-fg); }
.button.danger { color: var(--bad); }
.button.danger-fill { background: var(--bad); border-color: var(--bad); color: #fff; }
.button.danger-fill:hover:not(:disabled) { background: var(--bad); color: #fff; filter: brightness(0.92); }
.button.small { min-height: 36px; padding: 0 12px; font-size: 0.9rem; }
.button.link { background: none; border: none; color: var(--accent); padding: 0 4px; min-height: 36px; }

input[type="text"], select {
  font: inherit;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  width: 100%;
}
input[type="text"]:focus-visible, select:focus-visible { outline-offset: 0; }
.field { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 550; }
.field small { font-weight: 400; color: var(--muted); }
.inline { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 550; }
.inline select { width: auto; min-height: 36px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
.at-input { position: relative; }
.at-input::before {
  content: "@";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}
.at-input input { padding-left: 30px; }
.honey { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Game card ---------- */
.game { padding: 20px 20px 16px; }
.game-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.game-head h1 { margin: 0; font-size: 1.6rem; letter-spacing: -0.01em; }
.sub { margin: 0; color: var(--muted); font-size: 0.9rem; }

.controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0 12px;
}
.segmented {
  display: flex;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 3px;
  margin: 0;
  gap: 2px;
  flex-wrap: wrap;
}
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented span {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.segmented small { font-weight: 500; font-size: 0.75rem; }
.segmented input:checked + span { background: var(--fg); color: var(--surface); }
.segmented input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.segmented input:disabled + span { opacity: 0.5; cursor: not-allowed; }

.statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.statusbar .stat { font-weight: 650; }
.statusbar .stat:last-child { margin-left: auto; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 650;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.badge.ranked { background: var(--good-soft); color: var(--good); border-color: transparent; }
.badge.unranked { background: var(--warn-soft); color: var(--fg); border-color: transparent; }
.badge.duel { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- Duel bar ---------- */
.duelbar {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--accent-soft);
}
.duelbar[hidden] { display: none; }
.duel-vs { display: flex; align-items: center; gap: 8px; }
.progress-pair { display: grid; gap: 6px; }
.prog { display: grid; grid-template-columns: 64px 1fr 28px; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 600; }
.prog > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: var(--surface); overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); }
.bar.them > div { background: var(--gold); }
.duel-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Board ---------- */
.board-wrap { position: relative; width: min(100%, 640px); margin: 0 auto; }
.board {
  --n: 8;
  display: grid;
  grid-template-columns: repeat(var(--n), 1fr);
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: var(--surface);
}
.board[aria-busy="true"] { opacity: 0.5; }
.board > [role="row"] { display: contents; }
.board.locked .cell { cursor: default; }

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--surface);
  font-size: clamp(1.5rem, 6vw, 3rem);
  font-weight: 800;
  text-align: center;
  padding: 16px;
}
.overlay[hidden] { display: none; }

.cell {
  position: relative;
  display: grid;
  place-items: center;
  background: var(--rc, var(--r9));
  border-top: 1px solid var(--line-cell);
  border-left: 1px solid var(--line-cell);
  cursor: pointer;
  min-width: 0;
}
.cell.nt { border-top: none; }
.cell.nl { border-left: none; }
.cell.tt { border-top: 3px solid var(--ink); }
.cell.tl { border-left: 3px solid var(--ink); }
.cell:focus { outline: none; }
.cell:focus-visible { outline: 3px solid var(--focus); outline-offset: -5px; z-index: 1; }
.board.pointer .cell:focus-visible { outline: none; }
@media (hover: hover) {
  .board:not(.locked) .cell:hover { filter: brightness(0.96); }
}

.cell svg { width: 64%; height: 64%; pointer-events: none; }
.cell .glyph-star { fill: var(--star); }
.cell .glyph-mark { stroke: var(--mark); stroke-width: 2.4; stroke-linecap: round; fill: none; width: 32%; height: 32%; }
.cell .glyph-mark.auto { opacity: 0.35; width: 26%; height: 26%; }
.cell.conflict .glyph-star { fill: var(--bad); }
.cell.conflict::after {
  content: "!";
  position: absolute;
  top: 1px;
  right: 4px;
  font-weight: 800;
  font-size: clamp(10px, 2.4vw, 14px);
  color: var(--bad);
}

.letter {
  position: absolute;
  top: 1px;
  left: 4px;
  font-size: clamp(9px, 2.2vw, 12px);
  font-weight: 650;
  color: var(--muted);
  display: none;
  pointer-events: none;
}
.board.show-letters .letter { display: block; }

.cell.flash { animation: flash 0.6s ease-in-out 3; }
@keyframes flash { 50% { box-shadow: inset 0 0 0 4px var(--hint); } }

.message { min-height: 1.5em; margin: 14px 0 4px; font-weight: 550; text-align: center; }
.issues { margin: 0 auto 8px; padding: 8px 12px 8px 30px; color: var(--bad); background: var(--bad-soft); max-width: 640px; }
.issues:empty { display: none; }

.tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 12px 0 4px; }
.tools .button { min-width: 88px; }

.options { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 4px; }
.options summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--muted);
}

/* ---------- How to play ---------- */
.howto { font-size: 0.95rem; padding: 0; }
.howto h2 { font-size: 1.1rem; margin: 0; padding: 18px 20px 6px; }
.howto-body { padding: 0 20px 20px; }
.howto h3 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-top: 22px; }
.rules { padding-left: 1.2em; margin: 0 0 12px; }
.rules li { margin-bottom: 4px; }
.demo { margin: 12px 0 16px; }
.demo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 150px;
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  overflow: hidden;
  margin: 0 auto 8px;
  background: var(--r5);
}
.demo-grid span { border-top: 1px solid var(--line-cell); border-left: 1px solid var(--line-cell); display: grid; place-items: center; font-size: 14px; line-height: 1; }
.demo-grid span:nth-child(-n+5) { border-top: none; }
.demo-grid span:nth-child(5n+1) { border-left: none; }
.demo-grid .s::before { content: "★"; color: var(--star); font-size: 20px; }
.demo-grid .x::before { content: "×"; color: var(--mark); }
.demo-grid .far::before { opacity: 0.45; }
.demo figcaption { font-size: 0.85rem; color: var(--muted); text-align: center; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; align-items: center; }
.keys dd { margin: 0; color: var(--muted); }
kbd {
  display: inline-block;
  font: 600 0.8em ui-monospace, SFMono-Regular, Menlo, monospace;
  min-width: 1.6em;
  text-align: center;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  padding: 1px 5px;
  margin-right: 2px;
  background: var(--surface-2);
}
.links { padding-left: 1.1em; margin: 0; }
.links li { margin-bottom: 4px; }

/* ---------- Side cards ---------- */
.profile { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.profile strong { font-size: 1.15rem; }
.avatar {
  --h: 240;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-weight: 750;
  font-size: 1.1rem;
  color: #fff;
  background: hsl(var(--h) 45% 42%);
  flex: none;
  text-transform: uppercase;
}
.account-chip .avatar { width: 28px; height: 28px; font-size: 0.8rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.stats div { background: var(--surface-2); padding: 8px; text-align: center; }
.stats dt { font-size: 0.75rem; color: var(--muted); }
.stats dd { margin: 0; font-weight: 750; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.bests { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 0.92rem; }
.bests th, .bests td { text-align: left; padding: 4px 0; border-bottom: 1px solid var(--line); }
.bests td { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.code {
  font: 700 1.15rem ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  padding: 12px;
  text-align: center;
  word-break: break-all;
  user-select: all;
}
.note { font-size: 0.9rem; color: var(--muted); }
.error { color: var(--bad); font-weight: 550; }
.ok { color: var(--good); font-weight: 550; }

.invites { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.invite { border: 1px solid var(--line); padding: 10px 12px; background: var(--surface-2); }
.invite p { margin: 0 0 8px; }
.invite.incoming { border-color: var(--accent); background: var(--accent-soft); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs [role="tab"] {
  font: inherit;
  font-weight: 600;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 8px 12px;
  min-height: 44px;
  color: var(--muted);
  cursor: pointer;
}
.tabs [aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.board-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.board-table th { text-align: left; font-size: 0.75rem; color: var(--muted); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.board-table td { padding: 6px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.board-table td.num, .board-table th.num { text-align: right; }
.board-table tr.me td { background: var(--accent-soft); font-weight: 650; }
.board-table .button { min-height: 32px; padding: 0 8px; font-size: 0.8rem; }
.empty { color: var(--muted); font-size: 0.92rem; }

/* ---------- Online now ---------- */
.count { color: var(--muted); font-weight: 500; }
.players { list-style: none; padding: 0; margin: 0 0 12px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.players .avatar { width: 32px; height: 32px; font-size: 0.85rem; }
.players .who { flex: 1; min-width: 0; }
.players .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .who span { font-size: 0.8rem; color: var(--muted); }

/* ---------- Notifications ---------- */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}
.toast {
  background: var(--surface);
  border: 2px solid var(--cta-edge);
  padding: 12px 14px;
}
.toast p { margin: 0 0 8px; }
.toast .row-actions { align-items: center; }
.toast .dismiss { margin-left: auto; }

/* ---------- Dialogs ---------- */
dialog {
  border: 1px solid var(--line);
  padding: 24px;
  background: var(--surface);
  color: var(--fg);
  width: min(92vw, 420px);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
dialog h2 { margin-top: 0; font-size: 1.4rem; }
#win { text-align: center; }
.dialog-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Article pages ---------- */
.reading { max-width: 780px; margin: 0 auto; padding: 24px 16px 48px; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 16px; font-size: 0.9rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
.crumbs a { color: var(--muted); }
.prose { font-size: 1.06rem; line-height: 1.7; }
.prose h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin: 0 0 6px; letter-spacing: -0.015em; }
.prose h2 { font-size: 1.4rem; margin: 36px 0 10px; }
.prose h3 { font-size: 1.12rem; margin: 24px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose .lead { font-size: 1.18rem; color: var(--fg); }
.prose .meta { color: var(--muted); font-size: 0.9rem; margin-bottom: 24px; }
.prose table { border-collapse: collapse; width: 100%; margin: 0 0 20px; font-size: 0.95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose caption { caption-side: bottom; color: var(--muted); font-size: 0.85rem; padding-top: 6px; text-align: left; }
.prose table.mini-grid { width: auto; display: table; }
.prose .mini-grid td { width: 36px; height: 36px; padding: 0; text-align: center; font-size: 1.2rem; background: var(--surface); }
.prose blockquote { margin: 0 0 16px; padding: 8px 16px; border-left: 4px solid var(--accent); background: var(--surface-2); }
.prose code { font-family: ui-monospace, monospace; background: var(--surface-2); padding: 1px 4px; }
.faq { margin-top: 32px; padding: 20px; background: var(--surface); border: 1px solid var(--line); }
.faq h2 { margin-top: 0; }
.cta { margin: 32px 0; text-align: center; }
.cta p { color: var(--muted); }
.related { margin-top: 24px; }
.cards { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.cards .card { padding: 0; }
.cards a { display: grid; gap: 6px; padding: 16px; color: var(--fg); text-decoration: none; height: 100%; }
.cards a:hover { background: var(--surface-2); }
.cards span { color: var(--muted); font-size: 0.9rem; }
.reading > .lead { font-size: 1.1rem; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 32px 16px 24px; }
.footer-inner { max-width: 1440px; margin: 0 auto; display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.site-footer h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--fg); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.fine { max-width: 1440px; margin: 24px auto 0; color: var(--muted); font-size: 0.85rem; }

/* ---------- Motion and contrast preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .cell.flash { box-shadow: inset 0 0 0 4px var(--hint); }
}
@media (forced-colors: active) {
  .cell .glyph-star { fill: CanvasText; }
  .cell.conflict .glyph-star { fill: Mark; }
  .cell.tt { border-top-color: CanvasText; }
  .cell.tl { border-left-color: CanvasText; }
  .cell.flash { outline: 4px dashed Highlight; outline-offset: -6px; }
  .segmented input:checked + span { outline: 2px solid Highlight; }
  .bar > div { background: Highlight; }
}
