:root {
  color-scheme: light;
  --paper: #f8efe7;
  --ink: #271a1c;
  --panel: #341f23;
  --board: #26171b;
  --cream: #fff3e8;
  --soft: #d3b8b2;
  --edge: #65464b;
  --coral: #ff917a;
  --gold: #f7cc71;
  --focus: #8de3e1;
  --serif: Georgia, 'Times New Roman', serif;
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
a { color: inherit; text-underline-offset: .22em; }
button { min-width: 44px; min-height: 44px; font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #795034; outline-offset: 3px; }
#game :focus-visible { outline-color: var(--focus); }
.wrap { width: min(94%, 1260px); margin-inline: auto; }
.top { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wordmark { display: flex; align-items: center; gap: 13px; }
.wordmark img { flex: 0 0 auto; display: block; }
.top h1, .top .brand { margin: 0; font: 700 clamp(1.7rem, 3.8vw, 3.5rem)/1 var(--serif); letter-spacing: -.055em; text-decoration: none; }
.top nav a, .footer a { display: inline-flex; min-height: 44px; align-items: center; font-weight: 650; }

/* The playing surface shares its frame with a narrow score and clue rail. */
.home-page {
  padding-block-start: max(8px, env(safe-area-inset-top));
  background:
    radial-gradient(ellipse at 82% 15%, #88405a 0, transparent 53rem),
    radial-gradient(ellipse at 0 42%, #642943 0, transparent 54rem),
    linear-gradient(150deg, #401f32, #53253b 64%, #341b2b);
  color: var(--cream);
}
.home-page .wrap { width: min(calc(100% - 24px), 1360px); }
.home-page main { container-type: inline-size; }
.home-page a:focus-visible { outline-color: var(--focus); }
#game {
  --rail: clamp(226px, 24cqw, 385px);
  --column-gap: clamp(9px, 1.55cqw, 23px);
  --frame-x: clamp(8px, 1.5cqw, 20px);
  --frame-y: clamp(9px, 1.15cqw, 18px);
  --grid-x: 3px;
  --grid-y: 3px;
  --board-ratio: .75;
  --available-width: 100cqw;
  --screen-reserve: 34px;
  --side-space: calc(var(--rail) + 44px + 2 * (var(--column-gap) + var(--frame-x)) + 2px);
  --board-edges: calc(2px + 2 * var(--grid-x));
  --play-height: min(
    max(360px, calc(100dvh - var(--screen-reserve) - 2 * var(--frame-y))),
    calc((var(--available-width) - var(--side-space) - var(--board-edges)) / var(--board-ratio) + var(--board-edges))
  );
  --play-width: calc((var(--play-height) - var(--board-edges)) * var(--board-ratio) + var(--board-edges));
  --frame-width: calc(var(--side-space) + var(--play-width));
  position: relative; isolation: isolate; display: grid;
  grid-template:
    'name board tools' auto
    'clue board tools' minmax(min-content, 1fr)
    'action board tools' auto
    'goal board tools' 104px
    'readout board tools' 78px
    'console board tools' auto
    'finds board tools' minmax(58px, 1fr)
    / minmax(var(--rail), 1fr) var(--play-width) 44px;
  gap: 8px var(--column-gap);
  width: min(100%, max(60vw, var(--frame-width)));
  height: calc(var(--play-height) + 2 * var(--frame-y) + 2px);
  margin-inline: auto;
  padding: var(--frame-y) var(--frame-x); border: 1px solid #ba7d8b; border-radius: 22px;
  color: var(--cream);
  background:
    radial-gradient(ellipse at 8% 5%, #814452 0%, transparent 62%),
    radial-gradient(ellipse at 90% 96%, #563143 0%, transparent 53%),
    repeating-linear-gradient(123deg, #ffe1d405 0 1px, transparent 1px 5px),
    #3b2330;
  box-shadow: inset 0 1px #ffcfbf43, 0 8px 0 #2b1721, 0 20px 34px #2b172150;
}
#game[data-kind=training] { --board-ratio: 1; }
.scene-title {
  grid-area: name; align-self: start; min-width: 0; margin: 0;
  padding: 3px 0 10px; border-bottom: 1px solid #d59c986b;
  color: #ffe3c3; text-shadow: 0 2px #4e2532;
  font: italic 700 clamp(1.34rem, 3cqw, 2.85rem)/1.07 'Segoe Script', 'Snell Roundhand', Georgia, cursive;
  letter-spacing: -.042em; text-wrap: balance;
}
.scene-tools { grid-area: tools; z-index: 4; display: flex; flex-direction: column-reverse; gap: 6px; justify-content: flex-end; align-items: center; }
.icon-button {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0;
  border: 1px solid #c38689; border-radius: 50%; color: var(--cream); background: #422631;
  box-shadow: inset 0 1px #d9928d38;
}
.icon-button:hover, .icon-button[aria-expanded=true] { background: #68404b; border-color: #efb397; }
.icon-button .shrink, #game[data-fullscreen] .icon-button .expand { display: none; }
#game[data-fullscreen] .icon-button .shrink { display: block; }
.site-menu {
  z-index: 5; position: absolute; top: calc(var(--frame-y) + 49px); right: var(--frame-x);
  width: min(236px, calc(100% - 2 * var(--frame-x)));
  max-height: calc(100% - var(--frame-y) - 53px); overflow: auto; overscroll-behavior: contain;
  padding: 9px 13px; border: 1px solid #d08b91; border-radius: 13px;
  background: #492832; color: var(--cream); box-shadow: 0 9px 25px #21121bd9;
}
.site-menu a { display: flex; min-height: 44px; align-items: center; padding-inline: 8px; border-radius: 6px; }
.site-menu a:hover { background: #633d47; }
.site-menu [aria-current=page] { color: var(--gold); font-weight: 720; text-decoration: none; }
.language-nav ul { list-style: none; padding: 0; margin: 0; }
.language-nav p { color: var(--soft); margin: 7px 8px 0; padding-top: 6px; border-top: 1px solid #a87b80; font-size: .875rem; }
.clue-panel { grid-area: clue; align-self: end; min-width: 0; }
.edition { margin: 0 0 .35rem; color: var(--gold); font-size: .9rem; font-weight: 680; }
#clue { margin: 0; font: 400 clamp(1.8rem, 3.2cqw, 3.3rem)/.99 var(--serif); letter-spacing: -.045em; overflow-wrap: anywhere; }
.progress-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; margin-top: 9px; font-size: .93rem; color: var(--soft); }
#pips { display: flex; gap: 4px; align-self: center; }
#pips i { display: block; width: clamp(8px, .7vw, 14px); height: 4px; border-radius: 3px; background: #a07379; }
#pips .filled { background: var(--coral); }
#pips .total { background: var(--gold); }
.front-action { grid-area: action; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.front-action .primary { min-width: 80px; }
.mission { grid-area: goal; min-width: 0; align-self: start; font-size: .9rem; line-height: 1.28; color: var(--soft); }
.mission p { margin: 0; }
#record { font-weight: 680; color: #ffd9a8; font-variant-numeric: tabular-nums; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border: 1px solid transparent; border-radius: 8px; font-size: .94rem; font-weight: 690; white-space: nowrap; transition: background .15s, color .15s, transform .15s; }
.button:active { transform: translateY(2px); }
.primary { background: var(--coral); color: #281518; border-color: #ff9f8c; box-shadow: inset 0 1px #ffc0ae; }
.primary:hover { background: #ffa58f; }
.quiet { background: #2f1e22; color: var(--cream); border-color: #8b6268; }
.quiet:hover { background: #4a2d32; }
.button:disabled { background: #483034; border-color: #78565c; color: #dbbcb6; box-shadow: none; }
.controls [data-act=hint] { gap: 7px; }
.hint-meter { display: inline-flex; gap: 3px; }
.hint-meter i { width: 5px; height: 11px; border: 1px solid #dfb4a9; border-radius: 2px; }
.hint-meter i.on { background: var(--gold); border-color: var(--gold); }

.board {
  grid-area: board; min-height: 0; position: relative; overflow: hidden; border-radius: 13px; isolation: isolate;
  container-type: size; border: 1px solid #a17277;
  background: radial-gradient(ellipse at 67% 12%, #603c44 0%, #38232a 53%, #23171d 100%);
  box-shadow: inset 0 0 34px #180b126b, 0 5px 14px #1a0c1480;
}
.board::before {
  content: ''; z-index: -1; position: absolute; inset: 5px;
  border: 1px solid #b784822f; border-radius: 8px; pointer-events: none;
  background: repeating-linear-gradient(128deg, #f8c7a204 0 1px, transparent 1px 5px);
}
/* Fit equal row and column steps into the board while leaving room for its frame. */
.letter-bed {
  --cell-size: min(calc((100cqw - 2 * var(--grid-x)) / var(--cols, 6)),
                   calc((100cqh - 2 * var(--grid-y)) / var(--rows, 8)));
  position: absolute; top: 50%; left: 50%;
  width: calc(var(--cols, 6) * var(--cell-size)); height: calc(var(--rows, 8) * var(--cell-size));
  transform: translate(-50%, -50%);
  border-radius: 8px; background: #25171b88;
  box-shadow: 0 0 0 1px #e1a09a36, inset 0 0 24px #170e1366;
}
#grid { position: absolute; inset: 0; display: grid;
  grid-template: repeat(var(--rows, 8), minmax(0, 1fr)) / repeat(var(--cols, 6), minmax(0, 1fr));
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#threads { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.cell { position: relative; display: grid; place-items: center; background: transparent; padding: 0; border: 0; min-height: 0; min-width: 0; -webkit-tap-highlight-color: transparent; }
.cell b {
  z-index: 1; position: absolute; inset: 0; margin: auto; display: grid; place-items: center;
  width: 84%; height: 84%; border-radius: calc(var(--cell-size) * .19); color: var(--cream);
  border: 1px solid #a5757c; border-bottom-color: #58363e;
  background: linear-gradient(160deg, #65424a, #3e2831 67%);
  box-shadow: inset 0 1px #e0a7a137, 0 3px 4px #1b1015b0;
  font: 680 calc(var(--cell-size) * .50)/1 var(--serif);
  transition: transform .13s, border-color .15s;
  pointer-events: none;
}
.cell:hover b { border-color: #f0aaa0; }
.cell:focus-visible { outline: none; }
.cell:focus-visible b { outline: 2px solid var(--focus); outline-offset: 3px; }
.cell[data-state=active] b { background: #f7e2d4; color: #291819; border-color: #fff8f1; transform: scale(1.045); }
.cell[data-state=found] b, .cell[data-state=span] b { color: #281518; box-shadow: inset 0 0 0 1px #44202128, 0 2px 6px #16081090; }
.cell[data-state=found] b { background: linear-gradient(145deg, #ffae97, var(--coral)); border-color: #ffbfaf; }
.cell[data-state=span] b {
  background: repeating-linear-gradient(135deg, #ffffff27 0 1px, transparent 1px 6px), linear-gradient(145deg, #ffe09a, var(--gold));
  border-color: #593923; outline: 2px solid var(--gold); outline-offset: 1px; border-radius: calc(var(--cell-size) * .12);
}
.cell[data-hint] b { border: 2px dashed var(--gold); }
.cell[data-hint=start] b { outline: 2px solid var(--gold); outline-offset: 2px; }
.cell[data-inspect] b { outline: 2px solid var(--cream); outline-offset: 3px; transform: scale(1.035); }
.cell.flash b { animation: settle .17s both; }
@keyframes settle { 45% { transform: scale(1.10); } }
.thread { fill: none; stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
.thread.found { stroke: var(--coral); }
.thread.span { stroke: var(--gold); stroke-width: 12; }
.thread.stitch { stroke: #653d2f; stroke-width: 1.5; stroke-dasharray: 4 5; }
.thread.active { stroke: #f7e2d4; stroke-width: 7; }
.thread.tether { stroke: #f7e2d4a0; stroke-width: 3; }
.edge-trace { stroke: var(--gold); stroke-width: 2; stroke-dasharray: 3 3; }
.grid-tick { stroke: #b3878c85; stroke-width: 1; }


.console { display: contents; }
.readout {
  grid-area: readout; min-width: 0; height: 100%; padding: 5px 8px; overflow: auto;
  border-inline-start: 2px solid #b58088; border-radius: 5px; background: #311d28;
  scrollbar-color: #bf9095 #311d28; scrollbar-width: thin;
}
#draft { margin: 0; overflow-wrap: anywhere; font-weight: 720; font-size: 1.07rem; letter-spacing: .06em; }
#draft:empty, #status:empty { display: none; }
#status, #tutorial-tip { margin: 0; color: var(--soft); font-size: .875rem; line-height: 1.25; }
#draft:not(:empty) + #status:not(:empty) { margin-top: 2px; }
#status[data-kind=bad] { color: #ffd1c4; }
#status:is([data-kind=good], [data-kind=hint]) { color: var(--gold); }
#game[data-readout] #tutorial-tip { display: none; }
#game:not([data-readout]):not([data-mode=tutorial]) .readout { border-color: transparent; background: transparent; }
#game[data-readout=bad] .readout { border-color: var(--coral); }
#game:is([data-readout=hint], [data-readout=good]) .readout { border-color: var(--gold); }
.controls { grid-area: console; display: grid; gap: 6px; grid-template-columns: auto 1fr 1fr; min-width: 0; align-self: start; }
.controls .button { padding-inline: 8px; }
.finds { grid-area: finds; min-height: 0; min-width: 0; align-self: stretch; display: flex; flex-direction: column; }
.finds-title { display: none; }
.legend { display: flex; gap: 3px 12px; flex-wrap: wrap; align-items: center; color: var(--soft); font-size: .875rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 11px; height: 11px; background: var(--coral); border-radius: 50%; }
.legend i.span-key { background: var(--gold); border: 2px double #372324; border-radius: 3px; outline: 1px solid var(--gold); }
.word-list { display: flex; flex-wrap: wrap; gap: 4px; overflow: auto; padding: 4px 3px; scrollbar-color: #b9858c #322126; scrollbar-width: thin; }
.word-list:empty { display: none; }
.word-list button { flex: 0 0 auto; max-width: 100%; overflow-wrap: anywhere; background: #2f1e22; color: var(--coral); border: 1px solid #99686d; border-radius: 6px; padding: 0 8px; font-size: .875rem; font-weight: 700; }
.word-list button.span { color: var(--gold); }
.word-list button[aria-pressed=true] { border-color: currentColor; }
.board-sheet { grid-area: board; min-height: 0; display: grid; align-items: center; justify-items: center; padding: 10px; background: #211519b8; border-radius: 13px; z-index: 2; }
.sheet-card { width: min(100%, 412px); max-height: 100%; overflow: auto; padding: clamp(13px, 3.2vmin, 28px); border-radius: 14px; border: 1px solid #ac7980; background: #382227; color: var(--cream); box-shadow: 0 16px 42px #11070bb0; }
.sheet-card h2, .result-copy h2 { margin: 0; font: 400 clamp(1.7rem, 4.8vmin, 3.4rem)/1 var(--serif); letter-spacing: -.045em; }
.sheet-card p { margin: 8px 0 13px; color: var(--soft); font-size: .94rem; }
.settings { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.settings button { justify-content: space-between; padding-inline: 8px; }
.settings button::after { content: attr(data-value); flex: 0 0 auto; white-space: nowrap; font-weight: 550; color: var(--soft); }
.settings button[aria-pressed=true]::after { color: var(--gold); }
.sheet-actions, .result-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sheet-actions button, .result-actions button { flex: 1; }
.picker-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid-choices { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 5px; margin: 14px 0 18px; }
.grid-choices button { padding-inline: 5px; }
.archive-label { display: block; color: var(--cream); font-weight: 650; margin-bottom: 4px; }
.archive { display: flex; align-items: center; gap: 6px; }
.archive select { width: 100%; min-width: 0; min-height: 44px; padding: 2px 28px 2px 8px; border-radius: 8px; border: 1px solid #b78389; background: #27191d; color: var(--cream); font: inherit; }

.board-sheet { background: #211519bf; backdrop-filter: brightness(.8); }
.sheet-card {
  border-radius: 24px 24px 12px 12px;
  border-top: 3px solid #edb192;
  background: linear-gradient(155deg, #563340, #34202b 80%);
}
.results { grid-area: console; min-width: 0; align-self: start; }
.result-actions .button { min-width: 0; white-space: normal; line-height: 1.15; padding: 0 8px; }
.result-copy {
  grid-area: goal; align-self: start; min-width: 0; padding: 8px 9px;
  border-left: 3px double #7e4c44; border-radius: 6px;
  color: #432232; background: #f5bc9e;
}
#game:is([data-mode=won], [data-mode=over]) .mission { visibility: hidden; }
.result-copy h2 { font-size: clamp(1.4rem, 3.3vmin, 2.45rem); }
.result-copy p { margin: 4px 0 0; font-size: .875rem; line-height: 1.22; }
.result-copy p:empty { display: none; }
#game[data-mode=won] .result-copy { background: #f7cc71; }
#game[data-mode=won] .board { border-color: #edbe69; }
#game[data-celebrate] .cell b { animation: victory .46s calc(var(--cell) * 10ms) both; }
#game[data-celebrate] .board { animation: board-win .75s ease-out; }
@keyframes victory { 40% { transform: scale(1.12); filter: brightness(1.26); } }
@keyframes board-win { 40% { box-shadow: 0 0 34px #ffcd7390, inset 0 0 38px #ffbb7d70; } }
.spark { fill: var(--gold); animation: spark .64s ease-out both; transform-box: fill-box; transform-origin: center; }
@keyframes spark { 0% { opacity: 0; transform: translateY(7px) scale(.5); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-20px) scale(.35); } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.footer { display: flex; gap: 13px; justify-content: space-between; align-items: center; margin-top: 35px; border-top: 1px solid #d5beb1; padding-block: 12px max(16px, env(safe-area-inset-bottom)); font-weight: 650; }
.footer nav { display: flex; gap: 15px; }
.prose { width: min(100%, 750px); margin: 65px auto 0; font-size: 1.05rem; line-height: 1.64; }
.prose h1, .prose h2 { font-family: var(--serif); line-height: 1.07; letter-spacing: -.035em; }
.prose h1 { font-size: clamp(2.35rem, 5vw, 4rem); margin: 0 0 20px; }
.prose h2 { font-size: clamp(1.65rem, 3.5vw, 2.2rem); margin: 1.55em 0 .45em; }
.prose h3 { margin: 1.1em 0 .15em; font-size: 1.05rem; }
.prose p { margin: 0 0 .9em; }
.prose ul, .prose ol { padding-left: 1.35em; }
.prose li { margin-bottom: .48em; }
.prose kbd { padding: .08em .3em; border: 1px solid #d5beb1; border-radius: 3px; background: #fff8f1; font-size: .91em; }
.read-page { margin-top: 32px; }

.home-page .prose { width: min(100%, 900px); margin-block-start: 44px; }
.home-page .prose details { border-top: 1px solid #bd8b95; }
.home-page .prose details:last-child { border-bottom: 1px solid #bd8b95; }
.home-page .prose summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 52px; padding: 8px 5px; cursor: pointer; list-style: none;
}
.home-page .prose summary::-webkit-details-marker { display: none; }
.home-page .prose summary::after { content: '+'; color: var(--gold); font-size: 1.4rem; }
.home-page .prose details[open] summary::after { content: '−'; }
.home-page .prose summary h2 { margin: 0; color: #ffe2cc; font-size: clamp(1.35rem, 3vw, 1.9rem); }
.home-page .prose details p { padding-inline: 5px; }
.home-page .footer { justify-content: center; border-color: #bd8b95; text-align: center; }
.home-page .footer nav { justify-content: center; gap: clamp(9px, 3vw, 30px); }
.home-page .footer a { line-height: 1.2; }

.settings, .grid-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-choices { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.settings .button, .grid-choices .button, .controls .button {
  min-width: 0; white-space: normal; overflow-wrap: anywhere; line-height: 1.15;
}

/* Overlay the existing game in browsers which cannot enter native fullscreen. */
html:has(#game[data-fullscreen=fallback]), body:has(#game[data-fullscreen=fallback]) { overflow: hidden; overscroll-behavior: none; }
.home-page:has(#game[data-fullscreen=fallback]) main { container-type: normal; }
#game:fullscreen { max-width: none; }
#game::backdrop { background: #341b2b; }
#game[data-fullscreen] {
  --available-width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right));
  --screen-reserve: calc(2px + env(safe-area-inset-top) + env(safe-area-inset-bottom));
  width: 100%; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none;
  padding-block: max(var(--frame-y), env(safe-area-inset-top)) max(var(--frame-y), env(safe-area-inset-bottom));
  padding-inline: max(var(--frame-x), env(safe-area-inset-left)) max(var(--frame-x), env(safe-area-inset-right));
  overflow: auto; overscroll-behavior: contain;
}
#game[data-fullscreen=fallback] { position: fixed; inset: 0; z-index: 20; }
#game[data-fullscreen] .site-menu {
  top: calc(max(var(--frame-y), env(safe-area-inset-top)) + 49px);
  right: max(var(--frame-x), env(safe-area-inset-right));
}
@media (min-width: 901px), (min-width: 701px) and (orientation: landscape) {
  #game[data-fullscreen] {
    grid-template-columns: var(--rail) var(--play-width) 44px;
    justify-content: center;
  }
  .site-menu { top: calc(var(--frame-y) + 99px); max-height: calc(100% - var(--frame-y) - 103px); }
  #game[data-fullscreen] .site-menu {
    top: auto; right: auto; grid-area: tools; align-self: start; justify-self: end; width: 236px; margin-top: 99px;
  }
}
@media (min-width: 901px) and (min-height: 681px) {
  :where(html:lang(es), html:lang(fr), html:lang(it), html:lang(pt)) .scene-title {
    font-size: clamp(1.35rem, 1.9cqw, 1.9rem);
  }
}
@media (min-width: 701px) and (max-height: 680px) {
  #game {
    --rail: clamp(238px, 27cqw, 335px);
    --frame-y: 6px;
    --screen-reserve: 12px;
    grid-template-rows: auto minmax(min-content, 1fr) auto 73px 58px auto minmax(49px, 1fr);
    row-gap: 4px;
  }
  .scene-title { font-size: clamp(1.22rem, 3.4vmin, 1.85rem); padding-block: 0 5px; }
  #clue { font-size: clamp(1.45rem, 5vmin, 2.25rem); }
  .edition { margin-bottom: 1px; }
  .progress-line { margin-top: 2px; }
  .readout { padding-block: 3px; }
}
@media (min-width: 701px) and (max-height: 465px) {
  #game {
    --rail: clamp(270px, 38cqw, 340px);
    --frame-y: 5px; --grid-x: 0px; --grid-y: 0px; --screen-reserve: 22px;
    grid-template-rows: auto auto auto 63px 41px auto minmax(44px, 1fr); row-gap: 3px;
  }
  .controls { grid-template-columns: repeat(3, minmax(max-content, 1fr)); }
  .controls .button { white-space: nowrap; padding-inline: 5px; }
  #clue { font-size: clamp(1.35rem, 5.3vmin, 1.75rem); }
  .clue-panel { align-self: start; }
  .board { align-self: start; height: var(--play-height); }
  #pips { display: none; }
  .board-sheet { grid-column: 1 / 3; }
  .finds .legend { display: none; }
  .finds .word-list { flex-wrap: nowrap; padding-block: 0; }
  .mission { line-height: 1.2; }
  .scene-title { font-size: 1.075rem; line-height: 1; text-wrap: initial; }
  .result-copy { padding: 4px 6px; }
  .result-copy h2 { font-size: 1.4rem; }
}
@media (max-width: 700px), (max-width: 900px) and (orientation: portrait) {
  .wrap { width: calc(100% - 20px); }
  .home-page .wrap { width: calc(100% - 12px); }
  .top { min-height: 54px; }
  .wordmark { gap: 7px; }
  .wordmark img { width: 32px; height: 32px; }
  .top nav a { font-size: .86rem; }
  #game {
    --frame-x: 5px; --frame-y: 5px; --grid-x: 3px; --grid-y: 3px;
    --play-height: clamp(362px, 60dvh, 590px);
    width: auto; height: auto; padding: var(--frame-y) var(--frame-x) 8px; border-radius: 15px;
    grid-template:
      'name tools' auto
      'board board' auto
      'readout readout' 50px
      'clue action' minmax(53px, auto)
      'console console' auto
      'goal goal' auto
      'finds finds' minmax(22px, auto) / minmax(0, 1fr) auto;
    gap: 4px 6px;
  }
  .scene-title { align-self: center; padding: 0 2px; border: 0; text-align: start; font-size: clamp(1.13rem, 5.5cqw, 2.15rem); }
  .scene-tools { flex-direction: row; justify-content: flex-end; }
  .clue-panel, .mission { padding-inline: 3px; }
  .clue-panel { align-self: center; }
  .edition { margin-bottom: 1px; font-size: .875rem; }
  #clue { font-size: clamp(1.27rem, 5.8cqw, 2.3rem); }
  .progress-line { gap: 2px 6px; margin-top: 3px; font-size: .875rem; }
  #pips { display: none; }
  .front-action { align-self: center; flex-wrap: nowrap; gap: 4px; }
  .front-action .primary { min-width: 56px; padding-inline: 7px; }
  .front-action .quiet { padding-inline: 7px; }
  .front-action svg + span { display: none; }
  .mission { font-size: .875rem; line-height: 1.27; }
  #game[data-kind=training] { --play-height: clamp(251px, 50dvh, 500px); }
  .board { height: var(--play-height); }
  .board::before { inset: 2px; }
  .board-sheet { grid-area: board; }
  .results, .controls { margin-inline: 3px; }
  .result-copy { grid-area: readout; align-self: stretch; min-height: 45px; margin-inline: 3px; padding: 4px 7px; }
  .result-copy h2 { font-size: 1.1rem; }
  .result-copy p { font-size: .875rem; }
  #game:is([data-mode=won],[data-mode=over]) .mission { visibility: visible; }
  .readout { margin-inline: 3px; padding: 2px 6px; align-content: center; }
  #draft, #status { display: inline; }
  #draft { font-size: .98rem; }
  #draft:not(:empty) + #status:not(:empty) { margin-inline-start: .4em; }
  .finds { padding-inline: 3px; }
  .word-list { flex-wrap: nowrap; overflow-x: auto; }
  .footer { font-size: .9rem; }
  .footer nav { gap: 11px; }
  .prose { margin-top: 48px; padding-inline: 5px; }
  .read-page { margin-top: 24px; }
  #game[data-fullscreen] {
    --play-height: clamp(360px, calc(100dvh - 315px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 720px);
    align-content: start; row-gap: 3px;
    grid-template:
      'name tools' auto
      'board board' auto
      'readout readout' max-content
      'clue action' max-content
      'console console' max-content
      'finds finds' max-content
      'goal goal' max-content / minmax(0, 1fr) auto;
  }
  #game[data-fullscreen] .readout { height: auto; min-height: 36px; max-height: 60px; }
  #game[data-fullscreen] .finds .legend { display: none; }
  #game[data-fullscreen] .word-list:not(:empty) { min-height: 48px; padding-block: 2px; }
  #game[data-fullscreen][data-kind=training] { --play-height: clamp(235px, 48dvh, 550px); }
  #game:is([data-mode=won], [data-mode=over]) {
    grid-template-rows: auto auto max-content max-content max-content max-content max-content;
  }
}
@media (min-width: 601px) and (max-width: 900px) and (orientation: portrait) {
  #game { --play-height: clamp(500px, 65dvh, 760px); }
  #game[data-kind=training] { --play-height: clamp(370px, 61dvh, 620px); }
}
@media (max-width: 350px) {
  .grid-choices { grid-template-columns: 1fr; }
  .front-action .button { padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
#game[data-reduced=true] *, #game[data-reduced=true] *::before, #game[data-reduced=true] *::after { animation: none !important; transition: none !important; }
.route-example { position: relative; display: inline-flex; gap: clamp(9px, 3vw, 22px); margin: 0 0 1rem; padding: 14px; border-radius: 12px; background: var(--board); color: var(--ink); }
.route-example::before { content: ''; position: absolute; inset: calc(50% - 3px) 25px auto; height: 6px; background: var(--coral); }
.route-example span { position: relative; display: grid; place-items: center; width: clamp(38px, 10vw, 46px); aspect-ratio: 1; border-radius: 50%; background: var(--coral); font-weight: 750; }
