:root {
  --bg: #f4f1ea;        /* paper */
  --paper: #fbfaf6;     /* raised surfaces */
  --ink: #14110b;       /* near-black */
  --muted: #8a8275;
  --accent: #1f2ae0;    /* bold editorial cobalt — brand chrome, distinct from the pastel strata */
  --accent-ink: #ffffff;
  --tile: #ece7dc;
  --tile-ink: #2a261d;
  --tile-selected: #14110b;
  --tile-selected-ink: #fbfaf6;
  --line: #d8d0c0;
  --hair: #14110b;      /* hairline rules */
  --c0: #f3d96b; /* easy */
  --c1: #a8c66c; /* medium */
  --c2: #99b9e3; /* hard */
  --c3: #bb8fce; /* devious */
  --radius: 0;          /* no rounded edges anywhere — hard architectural corners */
  --shadow: none;
  --serif: "Hoefler Text", Garamond, Georgia, "Times New Roman", serif;
  --sans: "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "American Typewriter", "Courier New", Courier, monospace;  /* in-game words */
  /* bold accents (OMA-ish): one per game, used as full color blocks */
  --c-trail: #1f2ae0;   /* cobalt */
  --c-dig:   #d8462b;   /* vermilion */
  --c-grow:  #128a4c;   /* green */
  --c-herb:  #e8a300;   /* ochre */
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 1.2rem 1rem 2rem;
}

header { text-align: center; margin-bottom: 1.4rem; width: 100%; max-width: 560px; }

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3rem, 12vw, 4.4rem);
  line-height: 0.92;
  letter-spacing: -0.025em;
  margin: 0;
  display: inline-flex;
  align-items: flex-start;
  gap: 0.12em;
}

h1 .seed { width: 0.46em; height: 0.46em; margin-top: 0.06em; flex: none; }
h1 .seed path { stroke: var(--c-grow); }

.tagline {
  margin: 0.7rem 0 0;
  color: var(--ink);
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32em;
}

.puzzle-meta { margin: 0.3rem 0 0; color: var(--muted); font-size: 0.85rem; }

main { width: 100%; max-width: 520px; }

.instructions {
  text-align: center;
  font-size: 0.95rem;
  color: var(--tile-ink);
  margin: 0 0 0.9rem;
}

#hint-area:not(:empty) { margin-bottom: 0.7rem; }

.hint-chip {
  background: #fff8e1;
  border: 1px solid #ecd9a0;
  border-radius: 0;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  animation: pop 0.25s ease;
}

/* ---- solved groups ---- */
#solved-groups:not(:empty) { margin-bottom: 0.6rem; }

.solved-group {
  border-radius: 0;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.55rem;
  color: #2c2417;
  box-shadow: var(--shadow);
  cursor: pointer;
  animation: pop 0.35s ease;
}

.solved-group .sg-root { font-weight: 700; font-size: 0.95rem; }
.solved-group .sg-root em { font-family: Georgia, serif; }
.solved-group .sg-words {
  font-size: 0.88rem;
  margin-top: 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.solved-group .sg-more { display: none; }
.solved-group.open .sg-more { display: block; }
.solved-group .sg-notes {
  margin: 0.5rem 0 0.1rem;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  line-height: 1.45;
}

/* ---- fingerprint game ---- */
.fp-progress {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
}

.fp-step {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 0;
  border: 1.5px solid var(--line);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--tile);
}

.fp-step.step-current { border-color: var(--ink); color: var(--ink); }
.fp-step.step-done { background: #eaf3de; border-color: #639922; color: #27500a; }
.fp-step.step-failed { background: #fcebeb; border-color: #e24b4a; color: #791f1f; }

.fp-card {
  background: var(--paper);
  border: 1.5px solid var(--hair);
  border-radius: 0;
  padding: 1.5rem 1.2rem 1.2rem;
  box-shadow: var(--shadow);
}

.fp-word {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.seg {
  appearance: none;
  font-family: var(--mono);
  font-size: 1.7rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.55rem;
  border-radius: 0;
  border: 2px dashed var(--line);
  background: var(--tile);
  color: var(--tile-ink);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.12s ease;
  position: relative;
}

.seg:not(.locked):active { transform: scale(0.95); }
.seg.locked { border-style: solid; cursor: default; }
.seg.shake { animation: shake 0.35s ease; }

.seg.picked, .slot.picked {
  outline: 2.5px dashed var(--ink);
  outline-offset: 2px;
}

.seg-lock {
  position: absolute;
  top: -0.5rem;
  right: -0.4rem;
  background: #639922;
  color: #fff;
  font-size: 0.65rem;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, sans-serif;
}

.fp-tries {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.7rem 0 0.9rem;
  min-height: 1.1rem;
}

.fp-palette {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
}

.swatch {
  appearance: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.42rem 0.75rem;
  border-radius: 0;
  border: 2px solid;
  cursor: pointer;
  transition: transform 0.08s ease;
}

.swatch.active { transform: scale(1.07); box-shadow: 0 1px 6px rgba(60, 50, 30, 0.25); }
.swatch:disabled { opacity: 0.45; cursor: default; }

.fp-actions {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.fp-telltale {
  margin-top: 0.9rem;
  background: #fff8e1;
  border: 1px solid #ecd9a0;
  border-radius: 0;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
}

.fp-reveal { margin-top: 0.9rem; }

.reveal-verdict {
  font-family: Georgia, serif;
  font-style: italic;
  margin: 0 0 0.6rem;
  text-align: center;
}

.reveal-parts {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.reveal-parts li { margin-bottom: 0.45rem; }

.seg-chip {
  display: inline-block;
  font-family: Georgia, serif;
  padding: 0.05rem 0.45rem;
  border-radius: 0;
  border: 1.5px solid;
  margin-right: 0.15rem;
}

.part-origin {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-right: 0.2rem;
}

.reveal-story {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  margin: 0.7rem 0 0.3rem;
}

.reveal-telltale { font-size: 0.85rem; color: var(--tile-ink); margin: 0.3rem 0 0; }

.reveal-next { text-align: center; margin-top: 1rem; }

.recap-row {
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.recap-story {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.2rem;
}

/* ---- daily dig ---- */
.phase-step {
  padding: 0.3rem 0.8rem;
  border-radius: 0;
  border: 1.5px solid var(--line);
  color: var(--muted);
  background: var(--tile);
  font-size: 0.82rem;
  font-weight: 600;
}

.phase-step.step-current { border-color: var(--ink); color: var(--ink); background: #fffdf8; }
.phase-step.step-done { background: #eaf3de; border-color: #639922; color: #27500a; }
.phase-step.step-failed { background: #fcebeb; border-color: #e24b4a; color: #791f1f; }

.cut-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  padding: 0.4rem 0;
}

.cut-letter {
  font-family: var(--mono);
  font-size: 1.8rem;
  padding: 0.1rem 0.05rem;
}

.cut-gap {
  appearance: none;
  width: 9px;
  height: 2.4rem;
  margin: 0 1px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
}

.cut-gap::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 15%;
  bottom: 15%;
  width: 3px;
  border-radius: 0;
  background: var(--line);
}

.cut-gap:hover::after { background: var(--muted); }
.cut-gap.placed::after { background: var(--ink); top: 0; bottom: 0; }
.cut-gap.locked { cursor: default; }
.cut-gap.locked::after { background: #639922; top: 0; bottom: 0; }

.cut-feedback {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.cut-chip {
  background: #faece7;
  color: #712b13;
  border: 1px solid #d85a30;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 0;
  animation: pop 0.25s ease;
}

.gloss-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.gloss-piece {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.gloss-piece .seg-chip { font-size: 1.3rem; }

.seg-chip.undug { background: var(--tile); color: var(--tile-ink); border-color: var(--line); }

.piece-origin {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  animation: pop 0.3s ease;
}

.slot {
  appearance: none;
  font-family: inherit;
  font-size: 0.85rem;
  min-width: 5.2rem;
  padding: 0.35rem 0.6rem;
  border-radius: 0;
  border: 1.5px dashed var(--line);
  background: var(--tile);
  color: var(--muted);
  cursor: pointer;
}

.slot.filled { border-style: solid; border-color: var(--ink); color: var(--ink); background: #fffdf8; }
.slot.locked { border-style: solid; border-color: #639922; color: #27500a; background: #eaf3de; cursor: default; }

.mcard {
  appearance: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.8rem;
  border-radius: 0;
  border: 1.5px solid var(--ink);
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.mcard.active { transform: scale(1.07); box-shadow: 0 1px 6px rgba(60, 50, 30, 0.25); }
.mcard.used { opacity: 0.4; }
.mcard:disabled { opacity: 0.4; cursor: default; }

.literal {
  font-family: Georgia, serif;
  font-size: 1.25rem;
  text-align: center;
  margin: 0.2rem 0 0.8rem;
}

@media (max-width: 420px) {
  .cut-letter { font-size: 1.3rem; }
  .cut-gap { width: 7px; height: 1.9rem; }
}

/* ---- grow mode ---- */
/* nav = four themed image tiles, each with a white label box (set in chrome.js) */
.modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 1.1rem;
}

.mode {
  position: relative;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background-size: cover;
  background-position: center;
  border: 1.5px solid var(--hair);
}
.mode-label {
  background: #fff;
  color: #000;
  padding: 0.26rem 0.5rem;
  font-family: var(--sans);
  font-size: clamp(0.5rem, 2.2vw, 0.62rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1.5px solid var(--hair);
  white-space: nowrap;
}

/* active tile = a bold colored frame per game (no grey-on-black) */
.mode.active { border-width: 3px; }
.mode.active.m-graft { border-color: var(--c-trail); }
.mode.active.m-dig   { border-color: var(--c-dig); }
.mode.active.m-grow  { border-color: var(--c-grow); }
.mode.active.m-herb  { border-color: var(--c-herb); }
.mode.active .mode-label { border-color: currentColor; }
.mode.active.m-graft .mode-label { box-shadow: inset 0 -3px 0 var(--c-trail); }
.mode.active.m-dig   .mode-label { box-shadow: inset 0 -3px 0 var(--c-dig); }
.mode.active.m-grow  .mode-label { box-shadow: inset 0 -3px 0 var(--c-grow); }
.mode.active.m-herb  .mode-label { box-shadow: inset 0 -3px 0 var(--c-herb); }

.root-card { text-align: center; margin-bottom: 0.35rem; }

.root-pill {
  display: inline-block;
  font-family: Georgia, serif;
  font-size: 1.15rem;
  padding: 0.4rem 1rem;
  border-radius: 0;
  border: 1.5px solid;
}

.grow-count {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.9rem;
}

.grow-bar {
  position: relative;
  height: 7px;
  background: var(--tile);
  border: 1px solid var(--line);
  border-radius: 0;
  margin: 0 0.2rem 1rem;
}

.grow-bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: #a8c66c;
  border-radius: 0;
  transition: width 0.3s ease;
}

.grow-bar-tick {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--ink);
  opacity: 0.55;
}

.grow-tools { text-align: center; margin-bottom: 0.7rem; }

.grow-tools .btn { font-size: 0.8rem; padding: 0.4rem 0.9rem; }

#branch-map {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.bm-chip {
  background: #fff8e1;
  border: 1px solid #ecd9a0;
  border-radius: 0;
  font-size: 0.85rem;
  padding: 0.25rem 0.65rem;
}

.bm-chip strong { font-family: Georgia, serif; }

.grow-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

#grow-input {
  flex: 1;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0;
  border: 1.5px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  min-width: 0;
}

#grow-input:focus { outline: none; border-color: var(--ink); }
#grow-input.shake { animation: shake 0.35s ease; }

#leaves { display: flex; flex-direction: column; gap: 0.4rem; }

.leaf {
  border-radius: 0;
  padding: 0.5rem 0.8rem;
  font-size: 0.92rem;
  text-align: left;
}

.leaf.found {
  background: #eaf3de;
  color: #27500a;
  border: 1px solid #a8c66c;
  animation: pop 0.3s ease;
}

.leaf.found.missed { background: #fcebeb; color: #791f1f; border-color: #f09595; }
.leaf-missed { float: right; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.7; }

.leaf.bonus { background: #e1f5ee; color: #085041; border: 1px solid #5dcaa5; animation: pop 0.3s ease; }

.leaf-word { font-weight: 700; }
.leaf-note { font-style: italic; opacity: 0.9; }

.wikt {
  color: inherit;
  opacity: 0.55;
  text-decoration: none;
  font-size: 0.85em;
}

.wikt:hover { opacity: 1; }

.source-line { text-align: center; font-size: 0.78rem; margin: 0.5rem 0 0; }
.source-line .wikt { text-decoration: underline; }

.hidden-leaf {
  appearance: none;
  font-family: inherit;
  width: 100%;
  border: 1.5px dashed var(--line);
  background: var(--tile);
  color: var(--muted);
  cursor: pointer;
}

.hidden-leaf.mono { font-family: ui-monospace, Menlo, monospace; letter-spacing: 0.06em; }
.hidden-leaf .leaf-clue { font-family: -apple-system, sans-serif; letter-spacing: 0; font-style: italic; }
.hidden-leaf .leaf-hint-cta { float: right; font-size: 0.72rem; opacity: 0.6; font-family: -apple-system, sans-serif; letter-spacing: 0; }

.bonus-title {
  margin-top: 0.9rem;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

#bonus-area .leaf { margin-bottom: 0.4rem; }

.trap-chip {
  margin-top: 0.6rem;
  background: #faeeda;
  color: #633806;
  border: 1px solid #ef9f27;
  border-radius: 0;
  padding: 0.5rem 0.8rem;
  font-size: 0.88rem;
  animation: pop 0.3s ease;
}

.grow-footer { text-align: center; margin-top: 1rem; }

/* ---- trail mode ---- */
.trail-goal {
  text-align: center;
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
}
.goal-label, .goal-arrow { color: var(--muted); }
.goal-par, .goal-ways {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.1rem 0.55rem;
}

/* hint button level pips: ●●● used / ○○○ remaining */
.hint-pips {
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  vertical-align: 0.04em;
}

.trail-word {
  font-family: var(--mono);
  font-size: 1.05rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0;
  background: var(--tile);
  color: var(--tile-ink);
  white-space: nowrap;
}
.trail-word.is-target { box-shadow: inset 0 0 0 2px var(--ink); }
.trail-word.is-current { background: var(--ink); color: var(--bg); }

#chain {
  margin: 0 auto 0.9rem;
  min-height: 2rem;
  width: fit-content;
  font-family: var(--mono);
  font-size: 1.15rem;
  line-height: 1.5;
}
.chain-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--tile-ink);
  border-radius: 0;
  padding: 0.05rem 0.3rem;
}
.chain-line .cw { white-space: pre; }
.chain-line.is-current { font-weight: 700; }
.chain-line.is-seed,
.chain-line.is-target { font-weight: 700; color: var(--ink); }
.chain-line.is-frontier { outline: 1.5px dashed var(--line); }
.chain-line.is-frontier.active { outline: 2px solid var(--ink); background: var(--tile); }
.chain-x {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  border-radius: 0;
  opacity: 0.55;
}
.chain-x:hover { opacity: 1; color: #c0392b; background: #f6e3df; }
.chain-slot {
  white-space: pre;
  text-align: center;
  color: var(--muted);
  opacity: 0.45;
  letter-spacing: 0.5em;
}
.chain-slot::before { content: "· · ·"; }
/* tier-3 hint shown inline in the slot the next word lands in */
.chain-slot.is-hint {
  opacity: 1;
  color: var(--ink);
  letter-spacing: normal;
  font-weight: 700;
  outline: 2px solid var(--ink);
  background: var(--tile);
  border-radius: 0;
  padding: 0.05rem 0.45rem;
}
.chain-slot.is-hint::before { content: none; }
.chain-slot.is-hint .blanks { white-space: pre; }
.chain-slot.is-hint .blank-len {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 0.55rem;
}
.chain-slot.is-hint .blank-len::before { content: "("; }
.chain-slot.is-hint .blank-len::after { content: " letters)"; }
.via-hi {
  border-radius: 0;
  padding: 0.05rem 0;
}

/* bidirectional frontier toggle */
.trail-dir {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.6rem;
}
.dir-btn {
  flex: 1 1 0;
  min-width: 0;
  font-family: Georgia, serif;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  border-radius: 0;
  border: 1.5px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dir-btn.active { border-color: var(--ink); background: var(--ink); color: var(--bg); }

#trail-input {
  flex: 1;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0;
  border: 1.5px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  min-width: 0;
}
#trail-input:focus { outline: none; border-color: var(--ink); }
#trail-input.shake { animation: shake 0.35s ease; }

.hint-scaffold {
  text-align: center;
  background: #fff8e1;
  border: 1px solid #ecd9a0;
  border-radius: 0;
  padding: 0.5rem 0.8rem;
  font-size: 0.95rem;
  margin-bottom: 0.9rem;
}
.hint-scaffold .blanks {
  font-family: ui-monospace, Menlo, monospace;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.hint-scaffold .blank-len { color: var(--muted); font-size: 0.82rem; }

/* morpheme breakdown note (why two look-alike words don't connect) */
.morph-note {
  border: 1.5px solid var(--hair);
  background: var(--paper);
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.9rem;
  font-size: 0.95rem;
}
.morph-note .mn-row { margin: 0.15rem 0; font-family: var(--mono); }
.morph-note .mn-row b { font-weight: 700; }
.morph-note .mc {
  display: inline-block;
  padding: 0.02rem 0.4rem;
  margin: 0 0.1rem;
  text-decoration: none;
  border: 1px solid rgba(0,0,0,0.18);
  font-family: var(--mono);
}
.morph-note .mc:hover { outline: 1.5px solid var(--ink); }
.morph-note .mc-plus { color: var(--muted); margin: 0 0.1rem; }
.morph-note .mc-none { color: var(--muted); font-style: italic; }
.morph-note .mn-tip { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--muted); font-family: var(--sans); }

.tok {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 0.72rem;
  padding: 0.12rem 0.4rem;
  border-radius: 0;
  border: 1.5px solid;
}
.tok-prefix { background: var(--tile); color: var(--muted); border-color: var(--line); }

.trail-prompt {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

.ngroup {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--line);
}
.ngroup:first-child { border-top: none; }
.ngroup .tok { margin-top: 0.25rem; flex: 0 0 auto; }
.nwords { display: flex; flex-wrap: wrap; gap: 0.3rem; }

.nword {
  appearance: none;
  font-family: Georgia, serif;
  font-size: 0.92rem;
  padding: 0.28rem 0.6rem;
  border-radius: 0;
  border: 1.5px solid var(--line);
  background: #fffdf8;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.08s ease, background 0.12s ease;
}
.nword:active { transform: scale(0.96); }
.nword.is-target { border-color: var(--ink); border-width: 2px; font-weight: 700; }
.nword.hinted { background: #fff8e1; border-color: #ecd9a0; animation: pop 0.3s ease; }

.trail-deadend { text-align: center; color: var(--muted); font-size: 0.9rem; font-style: italic; }

#trail-actions { margin-top: 1rem; }

/* ---- field guide ---- */
.modal-wide { max-width: 480px; }

.guide-intro { color: var(--muted); margin-top: -0.3rem; }

#guide-map svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  margin-bottom: 0.9rem;
}

.guide-label {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 700;
  paint-order: stroke;
  stroke: rgba(250, 247, 240, 0.9);
  stroke-width: 3px;
}

#guide-strata {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.guide-card {
  border: 1.5px solid;
  border-radius: 0;
  padding: 0.6rem 0.7rem;
}

.guide-name { font-weight: 700; font-size: 0.9rem; }
.guide-blurb { font-size: 0.78rem; margin-top: 0.15rem; line-height: 1.4; }
.guide-cues { font-size: 0.72rem; margin-top: 0.3rem; opacity: 0.85; font-family: ui-monospace, Menlo, monospace; }

@media (max-width: 420px) {
  #guide-strata { grid-template-columns: 1fr; }
  .seg { font-size: 1.35rem; }
}
.solved-group .sg-notes strong { text-transform: capitalize; }
.solved-group .sg-expand {
  font-size: 0.75rem;
  opacity: 0.65;
  margin-top: 0.2rem;
}

.g0 { background: var(--c0); }
.g1 { background: var(--c1); }
.g2 { background: var(--c2); }
.g3 { background: var(--c3); }

/* ---- grid ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.tile {
  appearance: none;
  border: none;
  background: var(--tile);
  color: var(--tile-ink);
  border-radius: 0;
  min-height: 4.6rem;
  padding: 0.3rem 0.25rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, background 0.12s ease, color 0.12s ease;
  word-break: break-word;
  line-height: 1.15;
}

.tile.long { font-size: 0.74rem; }
.tile.verylong { font-size: 0.62rem; }

.tile:active { transform: scale(0.96); }

.tile.selected {
  background: var(--tile-selected);
  color: var(--tile-selected-ink);
}

.tile.shake { animation: shake 0.35s ease; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes pop {
  0% { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.btn {
  appearance: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: 0;
  border: 1.5px solid var(--ink);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.btn:disabled { opacity: 0.35; cursor: default; }

.btn-primary { background: var(--ink); color: var(--bg); }

.link-btn {
  appearance: none;
  border: none;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}

footer {
  margin-top: 1.4rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  color: var(--line);
}

/* ---- cookie-consent banner (consent.js) ---- */
.consent-banner {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  width: min(640px, calc(100% - 1.6rem));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.85rem 1.1rem;
  background: #fffdf8;
  border: 1.5px solid var(--line);
  border-radius: 0;
  box-shadow: 0 6px 24px rgba(60, 50, 30, 0.18);
  z-index: 40;
  animation: pop 0.2s ease;
}
.consent-text {
  margin: 0;
  flex: 1 1 16rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--tile-ink);
}
.consent-text a { color: var(--ink); }
.consent-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.consent-actions .btn { font-size: 0.82rem; padding: 0.45rem 1rem; }

/* ---- prose pages (privacy policy) ---- */
.prose { max-width: 42rem; line-height: 1.6; }
.prose-meta { color: var(--muted); font-size: 0.85rem; margin-top: 0; }
.prose h2 { font-size: 1.05rem; margin: 1.6rem 0 0.4rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: 0.3rem 0; }
.prose a { color: var(--ink); }

/* ---- toast ---- */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 0.55rem 1.1rem;
  border-radius: 0;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  animation: pop 0.2s ease;
  z-index: 30;
}

/* ---- modals ---- */
.modal-backdrop[hidden] { display: none; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(40, 34, 24, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 20;
}

.modal {
  position: relative;
  background: var(--bg);
  border-radius: 0;
  max-width: 420px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem 1.4rem 1.3rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  animation: pop 0.25s ease;
}

.modal h2 { font-family: Georgia, serif; margin: 0 0 0.5rem; }
.modal p, .modal li { font-size: 0.93rem; line-height: 1.5; }
.modal ul { padding-left: 1.2rem; }

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  border: none;
  background: none;
  font-size: 1.5rem;
  color: var(--muted);
  cursor: pointer;
}

.modal-actions { text-align: center; margin-top: 1rem; }

.share-grid { font-size: 1.25rem; line-height: 1.35; text-align: center; letter-spacing: 0.1em; }

.stats {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
  text-align: center;
}

.stat .num { font-size: 1.6rem; font-weight: 700; display: block; font-family: Georgia, serif; }
.stat .label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.next-puzzle { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }

.dot { display: inline-block; width: 0.75em; height: 0.75em; border-radius: 0; vertical-align: baseline; }
.dot.d0 { background: var(--c0); }
.dot.d3 { background: var(--c3); }

@media (max-width: 420px) {
  h1 { font-size: 2.1rem; }
  .tile { min-height: 4.2rem; font-size: 0.8rem; }
  .tile.long { font-size: 0.66rem; }
  .tile.verylong { font-size: 0.56rem; }
  .btn { padding: 0.55rem 0.9rem; font-size: 0.85rem; }
}
