:root {
  --bg: #0f0e0c;
  --panel: #181613;
  --panel-2: #201d19;
  --line: #2f2b25;
  --ink: #ece6da;
  --muted: #9a9284;
  --accent: #e8b64c;
  --accent-ink: #1a1408;
  --good: #7fc28a;
  --warn: #e0a15a;
  --bad: #e07a6a;
  --paper: #efe4c8;
  --paper-ink: #2b2418;
  --display: "EB Garamond", Garamond, "Times New Roman", serif;
  --sans: "EB Garamond", Garamond, "Times New Roman", serif;
  --mono: "Courier Prime", "Courier New", Courier, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f1e8;
    --panel: #fffdf8;
    --panel-2: #f1ebdf;
    --line: #ddd4c3;
    --ink: #1f1b15;
    --muted: #6d6556;
    --accent: #a8741a;
    --accent-ink: #fffdf8;
    --good: #2f7a3e;
    --warn: #a0620f;
    --bad: #b2402e;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 18px/1.55 var(--sans);
  font-variant-numeric: lining-nums;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); }
button, select, input { font: inherit; color: inherit; }

.masthead { border-bottom: 1px solid var(--line); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); z-index: 5; }
.masthead .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: .01em; }
.mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.nav { display: flex; gap: 6px; align-items: center; }
.nav select { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 52vw; }
.ghost { background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.ghost:hover:not(:disabled) { border-color: var(--accent); }
.ghost:disabled { opacity: .35; cursor: default; }

.hero { padding: 48px 0 24px; }
.eyebrow { margin: 0; font: 600 12px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 7vw, 60px); line-height: 1.05; margin: 12px 0 16px; letter-spacing: -.01em; }
.intro { font-family: var(--display); font-size: 19px; color: var(--muted); max-width: 60ch; margin: 0; }
.status { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 20px; font: 13px var(--mono); color: var(--muted); }

.puzzles { display: grid; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 22px; position: relative; }
.card.solved { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.num { font: 600 12px var(--mono); color: var(--muted); letter-spacing: .1em; }
.card h2 { font-family: var(--display); font-weight: 600; font-size: 24px; margin: 4px 0 8px; line-height: 1.2; }
.flavor { font-family: var(--display); font-style: italic; color: var(--muted); margin: 0 0 18px; max-width: 64ch; }
.badge { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--good); white-space: nowrap; }

.body { margin: 0 0 18px; overflow-x: auto; }
.mono { font-family: var(--mono); font-size: 15px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; word-break: break-all; white-space: pre-wrap; margin: 0; }
.mono.big { font-size: 26px; letter-spacing: .18em; text-align: center; }
.prose { font-family: var(--display); font-size: 21px; line-height: 1.7; background: var(--paper); color: var(--paper-ink); border-radius: 6px; padding: 18px 22px; margin: 0; box-shadow: inset 0 0 40px rgba(120, 90, 30, .18); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-family: var(--mono); font-size: 15px; }
.chip.glyph { font-size: 22px; letter-spacing: .12em; font-family: var(--sans); }
.plain-list { margin: 0; padding-left: 1.4em; font-size: 17px; }
.plain-list li { padding: 2px 0; }
.plain-list.mono-list { font-family: var(--mono); font-size: 15px; }
.gallery { display: flex; flex-wrap: wrap; gap: 14px; }
.gallery svg { display: block; }
.swatch { width: 96px; }
.swatch .chip-color { height: 72px; border-radius: 8px 8px 0 0; border: 1px solid var(--line); }
.swatch .code { font: 12px var(--mono); text-align: center; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 8px 8px; color: var(--muted); }
.tape { display: inline-block; background: var(--paper); padding: 10px 14px; border-radius: 3px; }
.tape-row { display: flex; gap: 6px; height: 16px; align-items: center; }
.tape-row + .tape-row { margin-top: 4px; }
.hole { width: 12px; height: 12px; border-radius: 50%; }
.hole.on { background: #1b160d; }
.hole.off { background: transparent; }
.sprocket { width: 6px; height: 6px; border-radius: 50%; background: #1b160d; margin: 0 2px; }
.taps .chip { font-size: 18px; letter-spacing: .08em; }
.taps .gap { display: inline-block; width: 14px; }

.answer { display: flex; gap: 8px; flex-wrap: wrap; }
.answer input { flex: 1 1 220px; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; font-family: var(--mono); font-size: 16px; text-transform: uppercase; letter-spacing: .08em; }
.answer input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 10px; padding: 10px 18px; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.feedback { font-size: 14px; margin-top: 10px; min-height: 1.4em; }
.feedback.good { color: var(--good); }
.feedback.warn { color: var(--warn); }
.feedback.bad { color: var(--bad); }
.hint { margin-top: 12px; font-size: 14px; color: var(--muted); border-left: 3px solid var(--warn); padding: 4px 12px; }
.solved-word { font: 600 18px var(--mono); letter-spacing: .14em; color: var(--good); }

#meta .card { margin-top: 28px; border-width: 2px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--panel)), var(--panel)); }
#meta h2 { font-size: 30px; }
.blanks { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.blank { width: 40px; height: 48px; border-bottom: 3px solid var(--accent); display: grid; place-items: center; font: 600 24px var(--mono); }
.win { text-align: center; padding: 10px 0 4px; }
.win .big { font-family: var(--display); font-size: clamp(36px, 8vw, 64px); font-weight: 800; letter-spacing: .08em; color: var(--accent); }

#solution .card { margin-top: 28px; }
.sol-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sol-table td, .sol-table th { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sol-table th { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

.rules { margin: 40px 0 0; color: var(--muted); border-top: 1px solid var(--line); padding-top: 18px; }
.rules summary { cursor: pointer; color: var(--ink); font-weight: 600; }
.footer { color: var(--muted); font-size: 13px; padding: 32px 16px 48px; }

@media (max-width: 560px) {
  .card { padding: 16px; }
  .mono.big { font-size: 20px; }
  .prose { font-size: 18px; padding: 14px 16px; }
  .brand span:last-child { display: none; }
}

.mono.wide { word-break: normal; letter-spacing: .14em; line-height: 2; font-size: 16px; }
.board { border-collapse: collapse; font: 600 17px var(--mono); }
.board td { width: 34px; height: 34px; text-align: center; border: 1px solid var(--line); background: var(--panel-2); }
.board td.dark { background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); }
.board th { font: 12px var(--mono); color: var(--muted); padding: 0 6px; }
.board.plain td { width: 30px; height: 30px; border-color: transparent; background: transparent; }
.board.plain { background: var(--paper); color: var(--paper-ink); border-radius: 6px; }
.gallery svg[aria-label="flag"] { box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.nono-wrap { overflow-x: auto; padding-bottom: 4px; }
.nono { --cell: 20px; border-collapse: collapse; font: 700 calc(var(--cell) * .58)/1.2 var(--mono); color: var(--muted); user-select: none; }
.nono .colclue { vertical-align: bottom; padding: 0 0 4px; min-width: var(--cell); max-width: var(--cell); line-height: 1.2; }
.nono .rowclue { text-align: right; padding-right: 8px; white-space: nowrap; }
.nono .cell { width: var(--cell); height: var(--cell); min-width: var(--cell); padding: 0; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; }
.nono .cell.filled { background: var(--ink); }
.nono .cell.crossed { background: var(--panel-2) linear-gradient(45deg, transparent 45%, var(--muted) 45% 55%, transparent 55%); }
.nono .cell.given { cursor: default; outline: 2px solid var(--accent); outline-offset: -3px; }
.fitgrid { display: grid; gap: 6px; margin-bottom: 18px; }
.fitrow { display: flex; gap: 4px; }
.fitcell { width: 30px; height: 30px; border: 1.5px solid var(--muted); border-radius: 3px; }
.fitcell.shade { background: color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); }
@media (max-width: 560px) { .board td { width: 30px; height: 30px; } .fitcell { width: 24px; height: 24px; } }

.diff { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.diff button { background: transparent; border: 0; padding: 6px 12px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px; }
.diff button.on { background: var(--accent); color: var(--accent-ink); }
.diff button:disabled { opacity: .35; cursor: default; }
.enum { font-family: var(--mono); font-size: 16px; color: var(--muted); font-weight: 400; }
.technique { display: inline-block; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 999px; padding: 2px 10px; margin: 0 0 10px; }
.explain { margin: -8px 0 16px; font-size: 14px; color: var(--ink); border-left: 3px solid var(--accent); padding: 2px 12px; }
.note { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.scroll-x { overflow-x: auto; }
.sudoku { border-collapse: collapse; border: 2px solid var(--ink); font: 600 18px var(--mono); }
.sudoku td { width: 36px; height: 36px; border: 1px solid var(--line); text-align: center; position: relative; padding: 0; }
.sudoku td.box-r { border-right: 2px solid var(--ink); }
.sudoku td.box-b { border-bottom: 2px solid var(--ink); }
.sudoku td.given { background: var(--panel-2); }
.sudoku td.marked { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.sudoku input, .dropquote input { width: 100%; height: 100%; border: 0; background: transparent; text-align: center; font: inherit; color: var(--accent); text-transform: uppercase; padding: 0; }
.sudoku input:focus, .dropquote input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.sudoku .cellnum { position: absolute; top: 1px; left: 3px; font: 600 9px var(--mono); color: var(--accent); pointer-events: none; }
.dropquote { border-collapse: collapse; font: 600 14px var(--mono); }
.dropquote .pool td { width: 24px; height: 18px; text-align: center; color: var(--muted); }
.dropquote .slots td { width: 24px; height: 28px; border: 1px solid var(--line); }
.dropquote .slots td.black { background: var(--ink); }
.dropquote .slots tr:first-child td { border-top-width: 2px; }
.lamp { display: grid; gap: 8px; background: #0b0d12; padding: 14px 16px; border-radius: 8px; }
.lamp-row { display: flex; gap: 8px; align-items: center; min-height: 12px; }
.flash { height: 10px; border-radius: 5px; background: #ffd66b; box-shadow: 0 0 10px #ffc83a; }
.flash.short { width: 12px; }
.flash.long { width: 40px; }
.braille-cell { display: grid; grid-template-columns: repeat(2, 14px); gap: 6px; padding: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
.braille-cell .dot { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); }
.braille-cell .dot.on { background: var(--ink); border-color: var(--ink); }
.audio-btn { font-size: 16px; }
.tabs { display: flex; gap: 4px; }
.tab { background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; cursor: pointer; font-size: 13px; color: var(--muted); }
.tab.on { border-color: var(--accent); color: var(--accent); }
.board-card { margin-top: 28px; }
.board-table tr.me td { color: var(--accent); font-weight: 600; }
.join { margin-bottom: 4px; }
@media (max-width: 560px) {
  .masthead .wrap { gap: 8px; }
  .diff button { padding: 6px 8px; font-size: 13px; }
  .nav select { max-width: 34vw; }
  .sudoku td { width: 30px; height: 30px; }
}
/* Grid items default to min-width:auto and would stretch to fit a wide nonogram. */
.puzzles > .card, .body { min-width: 0; }
.dropquote .slots td.black { background: repeating-linear-gradient(45deg, var(--muted) 0 2px, transparent 2px 6px); }
.dropquote .slots td.open { background: var(--panel-2); }
.plain-list { list-style-position: inside; padding-left: 0; }

.timer { color: var(--accent); font-weight: 600; }
.splits { margin: 14px auto 0; max-width: 520px; text-align: left; }
.splits td:nth-child(3), .splits td:nth-child(4) { font-family: var(--mono); white-space: nowrap; }
.splits tr.meta-row td { color: var(--accent); font-weight: 600; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
a.btn { text-decoration: none; display: inline-block; }
.timeline { width: 100%; height: auto; margin: 8px 0 4px; display: block; }
.squares { font-size: 22px; letter-spacing: .1em; margin: 6px 0; }
.verify { text-align: center; margin-top: 14px; }
.verify.ok { color: var(--good); }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stat-v { font: 600 22px var(--mono); color: var(--accent); }
.stat-k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.masthead a.btn { padding: 7px 14px; font-size: 14px; }

.gate { text-align: center; padding: 44px 22px 40px; border-width: 2px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.card .gate-title { font-family: var(--display); font-weight: 800; font-size: clamp(44px, 9vw, 72px); margin: 8px 0 10px; }
.gate-copy { max-width: 52ch; margin: 0 auto 18px; color: var(--muted); font-family: var(--display); font-size: 18px; }
.gate-btn { font-size: 20px; padding: 14px 44px; border-radius: 12px; margin-top: 6px; }
.countdown { font-family: var(--display); font-weight: 800; font-size: 88px; line-height: 1; color: var(--accent); min-height: 0; }
.countdown.pop { animation: pop .7s ease-out; }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .countdown.pop { animation: none; } }
.livesplits { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.split-chip { display: grid; grid-template-columns: auto auto; column-gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; font-size: 13px; }
.split-chip .split-name { grid-column: 1 / -1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.split-chip .split-time { font: 600 14px var(--mono); color: var(--good); }
.split-chip .split-at { font: 12px var(--mono); color: var(--muted); align-self: end; }
.split-chip.hinted .split-time { color: var(--warn); }
.split-chip.meta { border-color: var(--accent); }
.split-chip.meta .split-time { color: var(--accent); }
.split-chip.current { border-style: dashed; }
.split-chip.current .split-time { color: var(--ink); }
@media (min-width: 760px) {
  #livesplits { position: sticky; top: 56px; z-index: 4; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); padding-top: 8px; }
}

a.ghost { text-decoration: none; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.stat-tiles { margin-bottom: 16px; }
.cal-card { margin-bottom: 16px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 10px; }
.cal-head { font: 600 11px var(--mono); color: var(--muted); text-align: center; letter-spacing: .06em; }
.cal-cell { min-height: 58px; border: 1px solid var(--line); border-radius: 8px; padding: 5px 6px; display: flex; flex-direction: column; justify-content: space-between; color: inherit; text-decoration: none; background: var(--panel-2); }
.cal-cell.empty { background: transparent; border-style: dashed; opacity: .35; }
a.cal-cell:hover { border-color: var(--accent); }
.cal-day { font: 600 12px var(--mono); color: var(--muted); }
.cal-dots { display: flex; gap: 4px; }
.cal-dot { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 10px var(--mono); border: 1.5px solid var(--line); color: var(--muted); }
.cal-dot.done { background: var(--good); border-color: var(--good); color: var(--bg); }
.cal-dot.progress { background: linear-gradient(90deg, var(--warn) 50%, transparent 50%); border-color: var(--warn); color: var(--ink); }
.cal-dot.opened { border-color: var(--muted); }
.cal-legend { margin: -4px 0 16px; }
.progress-table tr.st-none td { color: var(--muted); }
.progress-table tr.st-done td:nth-child(5) { color: var(--good); }
.progress-table tr.st-progress td:nth-child(5) { color: var(--warn); }
.backup { margin-top: 16px; }
label.btn { cursor: pointer; }
@media (max-width: 560px) { .cal-cell { min-height: 46px; padding: 3px; } .cal-dot { width: 16px; height: 16px; font-size: 9px; } }

/* ---------- typography: book serif + typewriter, small caps instead of tracked capitals ---------- */
.eyebrow, .num, .badge, .technique, .sol-table th, .stat-k, .cal-head, .diff button, .tab {
  font-family: var(--display); font-variant-caps: all-small-caps; text-transform: none;
  letter-spacing: .05em; font-weight: 600;
}
.eyebrow { font-size: 18px; line-height: 1.2; }
.num { font-size: 16px; }
.badge { font-size: 16px; }
.technique { font-size: 15px; padding: 0 10px 2px; }
.sol-table th { font-size: 15px; }
.stat-k { font-size: 15px; }
.cal-head { font-size: 15px; }
.diff button { font-size: 17px; }
.hero h1, .card .gate-title { font-weight: 600; letter-spacing: -.005em; }
.card h2 { font-weight: 600; font-size: 26px; }
#meta h2 { font-size: 32px; }
.intro { font-size: 21px; }
.flavor { font-size: 19px; }
.status { font-family: var(--display); font-size: 16px; font-variant-numeric: lining-nums tabular-nums; }
.timer { font-family: var(--mono); font-weight: 700; }
.btn { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: .01em; }
.note, .feedback, .hint, .explain { font-size: 16px; }
.stat-v, .split-chip .split-time, .countdown, .win .big { font-family: var(--mono); font-weight: 700; }
.win .big { letter-spacing: .06em; }
.countdown { font-size: 80px; }
.mono.big { font-weight: 700; }
.epigraph { font-family: var(--display); font-style: italic; font-size: 18px; color: var(--muted); max-width: 56ch; margin: 14px 0 0; padding-left: 16px; border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); }
.masthead a.ghost.mine { font-family: var(--display); font-size: 17px; padding: 5px 12px; }

/* ---------- fit-in grid ---------- */
.fitgrid { display: grid; gap: 8px; margin-bottom: 18px; }
.fitrow { display: flex; align-items: center; gap: 10px; }
.fitlen { width: 26px; text-align: right; font-family: var(--mono); font-size: 14px; color: var(--muted); }
.fitcells { display: flex; gap: 4px; }
input.fitcell { width: 34px; height: 38px; border: 1.5px solid var(--muted); border-radius: 4px; background: var(--panel-2); color: var(--ink); text-align: center; font: 700 20px var(--mono); padding: 0; text-transform: uppercase; }
input.fitcell:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input.fitcell.shade { background: color-mix(in srgb, var(--accent) 30%, var(--panel-2)); border-color: var(--accent); }
.fitrow.filled input.fitcell { color: var(--good); }
.fitrow.filled input.fitcell.shade { color: var(--ink); }
.fitsrc { font-size: 15px; color: var(--muted); font-style: italic; white-space: nowrap; }
.fitread { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.fitread-label { color: var(--muted); font-size: 16px; margin-right: 4px; }
.fitread-letter { font: 700 22px var(--mono); color: var(--accent); min-width: 18px; text-align: center; }
.fitread-letter.empty { color: var(--line); }
@media (max-width: 560px) { input.fitcell { width: 26px; height: 32px; font-size: 16px; } .fitcells { gap: 3px; } .fitsrc { display: none; } }
/* ---------- drop quote ---------- */
.dropquote .pool td { font-family: var(--mono); font-weight: 700; color: var(--ink); height: 20px; }
.dropquote .pool td.used { color: var(--line); text-decoration: line-through; }
.dropquote td.col-focus { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.dropquote .slots td.open.col-focus { background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); }
.dropquote .slots td { width: 26px; height: 30px; }
.dropquote input { font: 700 16px var(--mono); }
.dropquote input.bad { color: var(--bad); }

/* nonogram: × marks instead of hatching, so "given empty" is unmistakable */
.nono .cell.crossed { background: var(--panel-2); position: relative; }
.nono .cell.crossed::after { content: "×"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 calc(var(--cell) * .7)/1 var(--mono); color: var(--muted); }
.nono .cell.crossed.given::after { color: var(--accent); }
.nono .cell.given { outline: 2px solid var(--accent); outline-offset: -2px; }
.nono-legend { margin-top: 10px; line-height: 1.9; }
.nono-key { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; border: 1px solid var(--line); background: var(--panel-2); text-align: center; font: 700 13px/14px var(--mono); color: var(--muted); }
.nono-key.filled { background: var(--ink); }
.nono-key.given { outline: 2px solid var(--accent); outline-offset: -2px; }

.flavor, .intro, .epigraph, .gate-copy, .note { max-width: 72ch; }
.nono-wrap { width: 100%; }

/* ---------- tiered hints, notes and in-page solving ---------- */
.hints { margin-top: 12px; display: grid; gap: 8px; justify-items: start; }
.hints .hint { margin-top: 0; }
.btn.small { padding: 5px 12px; font-size: 14px; }
.caption { font-style: italic; margin: 0; color: var(--ink); }
.scratch { margin: 0 0 14px; }
.scratch summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.scratch textarea { display: block; width: 100%; margin-top: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 15px/1.5 var(--mono); color: var(--ink); resize: vertical; }

.slot { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.slot-in { width: 30px; height: 30px; text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; font: 600 16px var(--mono); color: var(--accent); text-transform: uppercase; padding: 0; }
.slot-in.wide { padding: 0 6px; letter-spacing: .08em; }
.slot-in:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tray-gallery { display: flex; flex-wrap: wrap; gap: 12px; }
.tray-gallery.bigchars { gap: 6px; }
.bigchar { font: 600 26px var(--mono); }
.tray-rows .slot { flex-direction: row; justify-content: space-between; gap: 14px; }
.lamp.tray-rows, .tape.tray-rows { display: inline-grid; }
.tape.tray-rows .slot + .slot { margin-top: 4px; }
.tape.tray-rows .slot-in { width: 24px; height: 20px; font-size: 13px; }
.tray-list li { display: flex; align-items: center; gap: 12px; }
.tray-list .tray-text { min-width: 0; }
.tray-list .slot-in { flex: none; }

.ws { touch-action: none; user-select: none; outline: none; }
.ws td { cursor: pointer; border-radius: 50%; }
.ws td.hit { background: color-mix(in srgb, var(--accent) 38%, transparent); }
.ws td.preview { background: color-mix(in srgb, var(--good) 45%, transparent); }
.ws td.anchor { outline: 2px solid var(--good); outline-offset: -2px; }
.ws td.focus { box-shadow: inset 0 0 0 2px var(--paper-ink); }
.ws-status { min-height: 1.4em; margin: 8px 0 0; }
.ws-read { font-size: 14px; margin: 6px 0 10px; }
.ws-left { font: 600 16px var(--mono); letter-spacing: .12em; margin-left: 8px; word-break: break-all; }
button.chip { cursor: pointer; color: var(--ink); }
.chip.strike.struck { text-decoration: line-through; opacity: .45; }
.board.chess td { cursor: pointer; position: relative; }
.board.chess td.visited { background: color-mix(in srgb, var(--good) 45%, var(--panel-2)); }
.board.chess td .cellnum { position: absolute; top: 1px; left: 3px; font: 600 9px var(--mono); color: var(--ink); }
.tiles .tile:disabled { opacity: .25; cursor: default; }
.tiles-laid { min-height: 38px; margin: 10px 0 0; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; }
.tile.laid { border-color: var(--accent); }

.subst-text { display: flex; flex-wrap: wrap; gap: 6px 18px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.subst-word { display: inline-flex; gap: 2px; }
.subst-cell { display: flex; flex-direction: column; align-items: center; width: 24px; border-radius: 4px; }
.subst-cell.same { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.subst-sym { font: 16px var(--mono); color: var(--muted); line-height: 1.5; }
.subst-in { width: 22px; height: 26px; text-align: center; border: 0; border-bottom: 2px solid var(--line); background: transparent; font: 600 16px var(--mono); color: var(--accent); text-transform: uppercase; padding: 0; }
.subst-in:focus { outline: none; border-bottom-color: var(--accent); }
.subst-in.dup { color: var(--bad); }
.subst .btn.small { margin-top: 10px; }
.wheel { margin-bottom: 12px; }
.wheel-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.wheel-k { font: 600 14px var(--mono); min-width: 13ch; text-align: center; }

/* ---------- phone masthead: difficulty gets its own full-width row of big tap targets ---------- */
@media (max-width: 560px) {
  .masthead .wrap { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; row-gap: 8px; }
  .masthead .nav { flex: 1 1 0; min-width: 0; justify-content: flex-end; }
  .masthead .nav select { flex: 1 1 auto; min-width: 0; max-width: none; }
  .masthead a.ghost.mine { white-space: nowrap; font-size: 15px; padding: 5px 8px; }
  .masthead .diff { order: 3; flex: 1 0 100%; display: flex; }
  .masthead .diff button { flex: 1; min-height: 42px; padding: 6px 4px; font-size: 17px; touch-action: manipulation; }
}

/* ---------- seating plans, gapless Morse, letter grids ---------- */
.seating .plain-list { margin-bottom: 12px; }
.seat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.seat { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.seat select { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--ink); font: 15px var(--sans); }
.seat select.dup { border-color: var(--bad); color: var(--bad); }
.morse-lines li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 4px 0; }
.morse-code { font: 600 17px var(--mono); letter-spacing: .12em; word-break: break-all; }
.morse-meta { font-size: 14px; color: var(--muted); }
.lettergrid td { cursor: pointer; }
.lettergrid td.pad { color: var(--muted); }
.lettergrid td.visited { background: color-mix(in srgb, var(--good) 45%, var(--panel-2)); }
