:root {
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
  font-synthesis: none;
  --ink: #25394b;
  --paper: #faf7ef;
  --muted: #757d80;
  --line: #e4e1d7;
  --accent: #ac573d;
  --peach: #f5e6dc;
  --surface: #fffefa;
  --soft: #eeece4;
  --tile-border: #dcded7;
  --tile-hover: #9aabaf;
  --column: #f7eee6;
  --column-border: #d9b6a2;
  --filled: #25394b;
  --on-filled: #ffffff;
  --filled-hover: #395268;
  --faint: #a9aea9;
  --body-copy: #61717b;
  --backdrop: #25394b55;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e2eaf0;
  --paper: #17212b;
  --muted: #aab5bf;
  --line: #35414d;
  --accent: #edab8e;
  --peach: #49372f;
  --surface: #222e3a;
  --soft: #2c3946;
  --tile-border: #4d5d6b;
  --tile-hover: #91a5b4;
  --column: #3a302e;
  --column-border: #aa806b;
  --filled: #b9cfdd;
  --on-filled: #17212b;
  --filled-hover: #d8e5ed;
  --faint: #82919c;
  --body-copy: #b2c0cc;
  --backdrop: #070d16b3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100svh; display: flex; flex-direction: column; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
button { border: 0; }
a { color: inherit; }
.masthead { width: min(100% - 64px, 920px); margin: auto; padding: 22px 0 19px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; font: bold 29px/1 Georgia, serif; letter-spacing: -1.3px; }
.wordmark-dot { color: var(--accent); margin-left: -10px; }
nav { display: flex; gap: 8px; align-items: center; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: transparent; }
.icon-button:hover { background: var(--soft); }
.icon-button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.game { width: min(100% - 40px, 450px); margin: 0 auto; flex: 1; }
.intro { text-align: center; padding: 35px 0 27px; }
.eyebrow { font-size: 9px; letter-spacing: 2px; font-weight: 700; color: var(--muted); margin: 0 0 15px; }
h1 { font: 49px/1.07 Georgia, "Times New Roman", serif; letter-spacing: -1.9px; margin: 0 0 16px; }
h1 em { font-weight: normal; color: var(--accent); }
.subtitle { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.6; }
.play-area { width: 100%; }
.puzzle-toolbar { display: flex; align-items: center; gap: 10px; padding: 0 0 15px; }
.puzzle-label { display: flex; gap: 7px; align-items: center; background: transparent; padding: 8px 0; font-size: 12px; font-weight: 750; }
.puzzle-name { font-size: 11px; color: var(--muted); flex: 1; }
.move-count { display: flex; align-items: baseline; gap: 5px; border: 1px solid var(--line); border-radius: 20px; padding: 7px 12px; font-size: 10px; background: var(--surface); }
.move-count strong { font-size: 17px; font-variant-numeric: tabular-nums; font-weight: 650; }
.board { display: grid; gap: 9px; }
.letter-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) 22px; gap: 9px; align-items: center; }
.letter { display: grid; place-items: center; aspect-ratio: 1; width: 100%; min-width: 0; padding: 0; border: 1.5px solid var(--tile-border); border-bottom-width: 3px; border-radius: 10px; background: var(--surface); font-size: clamp(21px, 5vw, 30px); font-weight: 650; box-shadow: 0 2px 3px #25394b04; transition: background .16s, border-color .16s, color .16s; }
.letter:not(:disabled):hover { border-color: var(--tile-hover); }
.letter.in-column { background: var(--column); border-color: var(--column-border); }
.letter.valid { background: var(--filled); color: var(--on-filled); border-color: var(--filled); }
.letter[aria-pressed="true"] { border-color: var(--accent); background: var(--peach); color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.row-status { font-size: 14px; color: var(--faint); text-align: center; }
.row-status.valid { color: var(--ink); font-weight: bold; }
.status { font-size: 12px; min-height: 36px; margin: 16px 0 8px; line-height: 1.6; text-align: center; color: var(--body-copy); }
.daily-note { text-align: center; font-size: 11px; line-height: 1.6; color: var(--muted); margin: 12px 0 20px; }
.playing-note { border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 13px; padding: 17px 0 9px; }
.playing-note p { margin: 0; line-height: 1.7; font-size: 11px; color: var(--muted); }
.playing-note strong { font-weight: 500; color: var(--ink); }
.small-star { color: var(--accent); font-size: 23px; }
.game-actions { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 12px 0 18px; font-size: 12px; }
.text-button { background: transparent; font-size: 11px; padding: 10px 0; color: var(--muted); text-underline-offset: 4px; }
.text-button:hover { color: var(--ink); text-decoration: underline; }
.primary { background: var(--filled); border-radius: 8px; padding: 13px 20px; font-size: 12px; color: var(--on-filled); font-weight: 600; }
.primary:hover { background: var(--filled-hover); }
.primary span { margin-left: 15px; }
.secondary { background: var(--soft); border-radius: 8px; padding: 13px 20px; font-size: 12px; }
.result { border-top: 1px solid var(--line); text-align: center; margin-top: 20px; padding: 21px 0 0; }
.result .eyebrow { margin-bottom: 6px; }
.result h2 { font: 39px Georgia, serif; letter-spacing: -1px; color: var(--accent); margin: 0 0 8px; }
.result-copy { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.6; }
.score-stats { display: flex; justify-content: center; gap: 0; margin: 17px 0 0; }
.score-stat { display: flex; flex-direction: column; gap: 5px; width: 125px; }
.score-stat + .score-stat { border-left: 1px solid var(--line); }
.score-stat strong { font: 26px Georgia, serif; }
.score-stat span { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.footer { width: min(100% - 40px, 450px); text-align: center; margin: 20px auto 0; padding: 18px 0 20px; border-top: 1px solid var(--line); color: var(--muted); }
.footer p { margin: 0; font: italic 13px Georgia, serif; }
.footer button { font-size: 9px; letter-spacing: .4px; }
.notice { padding: 12px; font-size: 12px; background: var(--peach); border-radius: 8px; line-height: 1.5; }
.dev-controls { border: 1px dashed var(--column-border); border-radius: 10px; padding: 14px; margin: 20px 0; }
.dev-controls .eyebrow { margin-bottom: 8px; color: var(--accent); }
.dev-controls > div { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
dialog { width: min(100% - 32px, 460px); max-height: calc(100svh - 48px); padding: 24px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: 0 25px 90px #16233329; overflow-y: auto; }
dialog::backdrop { background: var(--backdrop); backdrop-filter: blur(3px); }
.modal-top { display: flex; align-items: center; justify-content: space-between; }
.modal-top .eyebrow { margin: 0; }
.modal-top .icon-button { font-size: 26px; margin-right: -8px; }
dialog h2 { font: 32px Georgia, serif; letter-spacing: -.8px; margin: 6px 0 20px; }
dialog p, dialog li { font-size: 13px; line-height: 1.75; color: var(--body-copy); }
dialog strong { color: var(--ink); }
dialog ol { padding-left: 21px; }
dialog li { padding: 3px 0 8px 4px; }
.example { display: flex; gap: 7px; margin: 18px 0; }
.example span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; background: var(--filled); color: var(--on-filled); font-weight: 700; }
.dialog-actions { display: flex; justify-content: end; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.route-words { font-weight: 650; letter-spacing: 1px; color: var(--ink) !important; }
.route-start { display: grid; gap: 4px; padding: 12px; border-radius: 8px; background: var(--soft); width: max-content; font: 15px monospace; letter-spacing: 7px; }
@media (min-height: 900px) and (min-width: 600px) { .intro { padding-top: 48px; padding-bottom: 35px; } .game { max-width: 460px; } }
@media (max-width: 540px) {
  .masthead { width: calc(100% - 36px); padding: 16px 0; }
  .wordmark { font-size: 26px; }
  .game { width: calc(100% - 36px); max-width: 390px; }
  .intro { padding: 29px 0 24px; }
  h1 { font-size: 43px; }
  .eyebrow { font-size: 8px; letter-spacing: 1.5px; }
  .letter-row { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  /* Keep row status accessible without reserving a visible column. */
  .row-status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .board { gap: 8px; }
  .letter { border-radius: 7px; }
  .footer { margin-top: 6px; }
}
@media (max-width: 350px) {
  h1 { font-size: 38px; }
  .letter-row { gap: 5px; }
  .puzzle-name { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
