@font-face {
  font-family: 'VT323';
  src: url('/fonts/VT323-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f4e9cd;
  --paper-light: #fff4d8;
  --ink: #2b2118;
  --muted: #6c5944;
  --line: #2b2118;
  --accent: #b8322b;
  --green: #397d5c;
  --ocean: #a9c4c7;
  --pixel: 'VT323', 'Courier New', monospace;
  font-family: var(--pixel);
  font-size: 24px;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(#947b4e24 .8px, transparent .9px), radial-gradient(#947b4e18 .7px, transparent .8px);
  background-size: 13px 17px, 23px 29px;
  background-position: 0 0, 7px 8px;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { margin: 12px; }
button, select, input, textarea { font: inherit; color: inherit; }
button, a, select, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, summary { cursor: pointer; }
a { color: inherit; text-underline-offset: 4px; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, select:focus-visible, canvas:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3, strong, b { font-weight: 400; }
h1:focus { outline: none; }
button { border-radius: 0; }
.header { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border: 1px solid var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; fill: none; stroke: var(--ink); stroke-width: 1.6; }
.brand-mark path { fill: var(--accent); stroke: var(--accent); }
.brand-mark circle:last-child { fill: var(--paper); stroke: none; }
.brand strong { font-size: 28px; }
.brand small { display: none; }
.brand-period { color: var(--accent); }
nav { display: flex; align-items: center; gap: 28px; }
nav button, footer button, .text-button, #reset-map { border: 0; background: none; padding: 5px 0; font-size: 22px; line-height: 1.15; }
nav button:hover, footer button:hover, .text-button:hover, #reset-map:hover { color: var(--accent); }
main { width: 100%; }
.edition { display: flex; justify-content: center; align-items: center; gap: 20px; font-size: 20px; line-height: 1; }
.edition > span:last-child { display: none; }
.header .edition { flex: 1; }
.game-page .header .edition { display: none; }
main > .edition { min-height: 35px; border-left: 1px solid var(--ink); border-right: 1px solid var(--ink); }
footer { display: flex; align-items: center; justify-content: space-between; min-height: 42px; gap: 20px; padding: 8px 6px 0; font-size: 18px; color: var(--muted); }
footer > div { display: flex; gap: 26px; }
footer button { font-size: 18px; }
.footer-links { flex: 1; flex-wrap: wrap; gap: 8px 24px; }
.footer-links a { font-size: 20px; line-height: 1.2; }
.footer-links a:hover { color: var(--accent); }
#language-select { width: 112px; min-height: 30px; padding: 2px 5px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper-light); font-size: 20px; line-height: 1; flex: 0 0 auto; }
.footer-dot { color: var(--accent); }
.skip-link { position: fixed; top: -100px; left: 20px; z-index: 100; background: var(--paper); padding: 12px 18px; border: 2px solid var(--ink); }
.skip-link:focus { top: 12px; }
.eyebrow { font-size: 22px; line-height: 1; }
.accent { color: var(--accent); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 18px; min-height: 56px; padding: 12px 24px; border: 2px solid var(--ink); font-size: 30px; line-height: 1; font-weight: 400; text-decoration: none; box-shadow: inset 2px 2px 0 #fff4d899, inset -2px -2px 0 #0002; }
.button.primary { color: var(--paper); background: var(--ink); outline: 1px solid var(--ink); outline-offset: 3px; }
.button.primary:hover:not(:disabled) { background: #453023; }
.button.secondary { color: var(--ink); background: var(--paper); }
.button.secondary:hover:not(:disabled) { background: var(--paper-light); }
.button:active:not(:disabled) { transform: translate(1px, 1px); box-shadow: inset 2px 2px 0 #0003; }
.button:disabled { color: #786a52; background: #e0d3b4; border-color: #8e7a5d; outline-color: #8e7a5d; box-shadow: none; }
.button span { font-size: inherit; }

/* A paper title, slowly turning pixel globe and one clear play dock. */
.home-page .header .brand { visibility: hidden; pointer-events: none; font-size: 24px; width: 152px; }
.home-page .workspace { position: relative; height: calc(100svh - 118px); min-height: 600px; border: 1px solid var(--ink); overflow: hidden; }
.home-page .story, .home-story { display: contents; }
.home-page .map-preview { position: absolute; inset: 0 0 112px; border: none; background: transparent; }
.home-globe-wrap { position: absolute; inset: 222px 24px 20px; display: grid; place-items: center; }
#home-globe { display: block; image-rendering: pixelated; pointer-events: none; filter: drop-shadow(6px 6px 0 #2b21182b); }
.map-preview.globe-ready #home-map-preview { display: none; }
.home-map-preview, #home-map-preview { display: block; width: 100%; height: 100%; max-width: 620px; max-height: 620px; object-fit: contain; object-position: center; image-rendering: pixelated; user-select: none; pointer-events: none; }
.home-page .home-title { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 2; width: min(620px, calc(100% - 44px)); padding: 22px 24px 20px; border: 2px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); background: var(--paper); text-align: center; }
.home-page h1 { margin: 0; font-size: clamp(62px, 7vw, 100px); line-height: .83; text-transform: uppercase; text-shadow: 3px 3px 0 var(--accent); white-space: nowrap; }
.home-page h1 br { display: none; }
.hero-description { font-size: 28px; margin-top: 20px; line-height: 1.05; }
.home-actions { position: absolute; inset: auto 0 0; z-index: 2; min-height: 112px; border-top: 1px solid var(--ink); padding: 20px; display: grid; grid-template-columns: 2fr 1fr; gap: 18px; align-items: center; background: var(--paper); }
.home-actions .button { width: 100%; min-height: 66px; font-size: 34px; text-transform: uppercase; letter-spacing: 1px; }
.home-page .map-heading, .home-page .map-caption, .home-page .map-compass, .home-facts, .home-streak, .practice-hint, .prototype-note { display: none; }
.home-info { max-width: 1100px; margin: 50px auto 0; padding: 0 24px 28px; }
.home-info-content { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 48px; }
.home-info-section { border-top: 1px solid var(--ink); padding-top: 22px; }
.home-info-section:first-child { grid-column: 1 / -1; }
.home-info h2 { font-size: 36px; line-height: 1.1; margin-bottom: 14px; }
.home-info p { font-size: 24px; line-height: 1.35; }
.home-info p + p { margin-top: 12px; }
.home-info-links { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-top: 16px; font-size: 24px; }
.home-info-links a:hover { color: var(--accent); }
.edition-notice { font-size: 24px; line-height: 1.2; }
.edition-notice p { font-size: 22px; margin-top: 4px; }

/* Full-width question, atlas and controls follow the reference game's three strips. */
.game-page .header { padding-left: 18px; }
.game-page .header .brand { visibility: hidden; pointer-events: none; }
.game-page main > .edition { display: none; }
.game-page .workspace { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(330px, 1fr) auto; height: auto; min-height: max(650px, calc(100svh - 118px)); border: 1px solid var(--ink); border-top: 0; }
.game-page .story, .game-page .round-story { display: contents; }
.game-top { position: absolute; top: -50px; left: 18px; height: 47px; display: flex; align-items: center; gap: 24px; z-index: 3; }
.game-top .text-button { font-size: 24px; }
.score-mini { font-size: 34px; white-space: nowrap; }
.score-mini small { font-size: 22px; }
.question-banner { grid-row: 1; position: relative; padding: 14px 22px 16px; border-bottom: 1px solid var(--ink); background: var(--paper); z-index: 5; }
.round-heading { display: flex; align-items: center; gap: 24px; min-height: 28px; color: var(--accent); }
.round-track { display: flex; align-items: center; gap: 7px; color: var(--ink); }
.round-track span { display: inline-grid; place-items: center; width: 25px; height: 25px; font-size: 20px; border: 1px solid var(--ink); background: transparent; }
.round-track i { display: none; }
.round-track .active { color: var(--paper); background: var(--accent); border-color: var(--accent); }
.round-track .done { background: var(--green); border-color: var(--green); color: var(--paper); }
.round-track .missed { background: var(--ink); color: var(--paper); }
.question-title { margin: 8px 0 0; padding-right: 5px; font-size: 40px; line-height: 1; }
.clue-details { position: absolute; top: 14px; right: 22px; font-size: 22px; }
.clue-details summary { color: var(--muted); text-underline-offset: 3px; }
.clue-details[open] { z-index: 8; }
.clue-details .question-note { position: absolute; top: 32px; right: 0; padding: 18px; width: min(540px, calc(100vw - 65px)); border: 1px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-size: 24px; line-height: 1.25; background: var(--paper); }
.clue-details .question-note { max-height: min(460px, 55svh); overflow-y: auto; overscroll-behavior: contain; }
.map-panel { position: relative; min-width: 0; min-height: 0; background: var(--ocean); overflow: hidden; isolation: isolate; }
.game-page .map-panel { grid-column: 1; grid-row: 2; width: 100%; height: 100%; }
#world-map { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.map-crosshair { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 25px; height: 25px; pointer-events: none; z-index: 2; color: var(--accent); }
.map-crosshair::before, .map-crosshair::after { content: ""; position: absolute; background: currentColor; box-shadow: 0 0 0 1px var(--paper); }
.map-crosshair::before { left: 12px; top: 0; width: 2px; height: 25px; }
.map-crosshair::after { left: 0; top: 12px; width: 25px; height: 2px; }
#world-map:focus-visible ~ .map-crosshair { display: block; }
.map-heading { position: absolute; top: 12px; left: 14px; z-index: 2; }
.map-heading > span { display: none; }
#reset-map { padding: 6px 11px; border: 1px solid var(--ink); background: var(--paper); font-size: 22px; box-shadow: 2px 2px 0 #2b211866; }
.map-zoom { position: absolute; left: 12px; bottom: 40px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.map-zoom button { width: 43px; height: 43px; border: 1px solid var(--ink); background: var(--paper); box-shadow: 2px 2px 0 #2b211866; padding: 0; font-size: 31px; line-height: 1; }
.map-zoom button:hover { background: var(--paper-light); }
.map-zoom button:last-child { font-size: 28px; }
.map-compass { position: absolute; bottom: 38px; right: 14px; display: grid; place-items: center; width: 50px; height: 62px; pointer-events: none; color: var(--ink); }
.map-compass span { font-size: 20px; line-height: 1; }
.map-compass svg { width: 20px; height: 37px; fill: var(--paper); stroke: var(--ink); stroke-width: 1; }
.map-compass svg path:first-child { fill: var(--accent); }
.map-caption { position: absolute; bottom: 4px; left: 10px; right: 10px; display: flex; justify-content: space-between; gap: 16px; align-items: end; pointer-events: none; font-size: 18px; line-height: 1; }
.map-caption > span { background: var(--paper); padding: 2px 4px; }
.map-caption > span:empty { display: none; }
.map-caption > span:last-child { margin-left: auto; }
.map-loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--ocean); font-size: 32px; }
.play-dock { grid-column: 1; grid-row: 3; border-top: 1px solid var(--ink); min-height: 110px; padding: 15px 20px; display: grid; grid-template-columns: minmax(150px, .9fr) minmax(180px, 1fr) minmax(240px, 1.5fr); align-items: center; gap: 22px; background: var(--paper); z-index: 4; }
.selection-card { grid-column: 1 / 3; display: flex; align-items: center; gap: 10px; min-width: 0; }
.selection-icon { color: var(--accent); font-size: 38px; line-height: 1; }
#selection-name { font-size: 29px; line-height: 1; overflow-wrap: anywhere; }
.play-dock .round-actions { grid-column: 3; }
.round-actions .button { width: 100%; min-height: 60px; font-size: 30px; text-transform: uppercase; letter-spacing: 1px; }
.timer-row:empty { display: none; }
#map-clock { position: absolute; right: 24px; top: 24px; z-index: 3; pointer-events: none; }
#map-clock:empty { display: none; }
.clock { display: inline-flex; align-items: center; justify-content: center; width: 90px; height: 90px; border: 2px solid var(--ink); outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 50%; color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 9px var(--green), inset 0 0 0 11px var(--ink); }
.clock b { font-size: 42px; }
.clock > span { font-size: 24px; margin-top: 8px; }
.clock.urgent { color: var(--accent); box-shadow: inset 0 0 0 9px var(--accent), inset 0 0 0 11px var(--ink); }
.timer-row > span:not(.clock) { padding: 6px 10px; font-size: 22px; border: 1px solid var(--ink); background: var(--paper); }
.feedback { min-width: 0; }
.feedback-kicker { font-size: 20px; color: var(--green); }
.feedback.incorrect .feedback-kicker { color: var(--accent); }
.feedback > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 16px; }
.feedback h2 { font-size: 29px; line-height: 1; }
.feedback b { font-size: 31px; white-space: nowrap; }
.feedback small { font-size: 22px; }
.answer-details { font-size: 24px; }
.answer-details[open] { position: relative; }
.answer-details[open] > :not(summary) { position: relative; }
.play-dock:has(.answer-details[open]) { z-index: 7; }
.play-dock .answer-details[open] { position: absolute; left: 20px; bottom: 92px; width: min(640px, calc(100% - 40px)); padding: 18px; border: 1px solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); max-height: min(500px, 55svh); overflow-y: auto; }
.feedback-explanation { margin-top: 12px; font-size: 24px; line-height: 1.25; }
.source-links { margin-top: 14px; font-size: 20px; line-height: 1.3; }
.source-links a { display: inline-block; }
.answer-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.answer-chip { display: inline-flex; align-items: baseline; gap: 9px; padding: 5px 9px; border: 1px solid #8f7a59; background: var(--paper-light); line-height: 1; }
.answer-chip b { font-size: 22px; }
.answer-chip small { color: var(--muted); font-size: 20px; white-space: nowrap; }

/* Results and supporting notes retain the same large, spare type. */
.game-page:has(.is-complete) .header .brand { visibility: visible; pointer-events: auto; }
.game-page .workspace.is-complete, .game-page .workspace.is-unavailable { grid-template-columns: minmax(300px, .8fr) minmax(0, 1.7fr); grid-template-rows: minmax(550px, 1fr); height: calc(100svh - 118px); }
.is-complete .story, .is-unavailable .story { display: block; grid-column: 1; grid-row: 1; padding: 40px 30px; border-right: 1px solid var(--ink); }
.is-complete .map-panel, .is-unavailable .map-panel { grid-column: 2; grid-row: 1; }
.complete-story { display: flex; flex-direction: column; align-items: stretch; gap: 25px; }
.complete-story h1, .unavailable-story h1 { font-size: 58px; line-height: .95; }
.complete-story p, .unavailable-story p { font-size: 26px; line-height: 1.2; }
.score-stamp { display: flex; align-items: baseline; justify-content: center; gap: 10px; padding: 20px 10px; border-top: 3px double var(--ink); border-bottom: 3px double var(--ink); }
.score-stamp b { font-size: 88px; line-height: 1; }
.score-stamp span { font-size: 26px; }
.mini-note { font-size: 22px !important; color: var(--muted); line-height: 1.25; }
.is-unavailable .round-story { display: flex; flex-direction: column; gap: 24px; }
.is-unavailable .question-title { margin-top: 0; }
.review { padding: 30px 0; max-width: 1100px; margin: auto; }
.review-heading h2 { font-size: 48px; margin-bottom: 20px; }
.review-item { border-top: 1px solid var(--ink); }
.review-item:last-child { border-bottom: 1px solid var(--ink); }
.review-item summary { display: flex; gap: 18px; padding: 19px 0; align-items: baseline; }
.review-index { font-size: 30px; color: var(--accent); }
.review-item summary > span:nth-child(2) { flex: 1; }
.review-item summary b { display: block; font-size: 28px; line-height: 1.1; }
.review-item summary small { display: block; font-size: 22px; margin-top: 7px; color: var(--muted); }
.review-item summary > strong { font-size: 28px; white-space: nowrap; }
.review-body { padding: 0 0 22px 31px; line-height: 1.3; }
.review-body > p { font-size: 24px; }
.review-body .source-links { font-size: 20px; }
.loading { padding: 30px; }
.loading h1 { font-size: 48px; margin: 20px 0; }
.loading p { font-size: 26px; }
.noscript { padding: 25px; font-size: 26px; }

/* Dialogs are paper sheets rather than miniature interface copy. */
dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100svh - 40px); padding: 22px 28px 30px; border: 2px solid var(--ink); border-radius: 0; background: var(--paper); color: var(--ink); box-shadow: 7px 7px 0 var(--ink); overflow-y: auto; }
dialog::backdrop { background: #2b21187a; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.modal-head .eyebrow { color: var(--muted); font-size: 20px; }
.icon-button { display: grid; place-items: center; min-width: 40px; height: 40px; padding: 0; border: 1px solid var(--ink); background: none; font-size: 34px; }
#modal-body h2 { font-size: 46px; line-height: 1; margin-bottom: 22px; }
#modal-body p { font-size: 24px; line-height: 1.3; margin: 16px 0; }
#modal-body details { font-size: 24px; margin: 18px 0; }
#modal-body .button { width: 100%; margin-top: 12px; }
#modal-body label { display: block; font-size: 24px; margin-bottom: 8px; }
#modal-body textarea { width: 100%; padding: 12px; border: 1px solid var(--ink); border-radius: 0; background: var(--paper-light); font-size: 24px; line-height: 1.25; }
.help-steps { padding-left: 30px; font-size: 30px; line-height: 1.6; margin: 12px 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 16px 0; gap: 15px; margin: 20px 0; }
.stats-grid b { display: block; font-size: 48px; }
.stats-grid span { font-size: 20px; color: var(--muted); }
.history-list { list-style: none; margin: 20px 0; padding: 0; }
.history-list li { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #a99777; font-size: 24px; }
#toast { position: fixed; z-index: 60; bottom: 30px; left: 50%; transform: translate(-50%, 20px); max-width: calc(100vw - 36px); padding: 12px 20px; background: var(--ink); color: var(--paper); border: 1px solid var(--paper); box-shadow: 3px 3px 0 var(--ink); opacity: 0; visibility: hidden; pointer-events: none; font-size: 24px; line-height: 1.2; }
#toast.visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.map-panel:fullscreen { width: 100vw; height: 100svh; background: var(--ocean); }

@media (max-width: 900px) {
  nav { gap: 20px; }
  .play-dock { grid-template-columns: minmax(130px, 1fr) minmax(160px, 1fr) minmax(180px, 1.1fr); gap: 16px; padding: 14px 16px; }
  #selection-name { font-size: 27px; }
  .game-page .workspace.is-complete, .game-page .workspace.is-unavailable { grid-template-columns: minmax(280px, 1fr) minmax(0, 1.2fr); }
  .is-complete .story, .is-unavailable .story { padding: 30px 24px; }
  .complete-story h1 { font-size: 48px; }
}

@media (max-width: 640px) {
  body { margin: 7px; }
  .header { min-height: 49px; padding: 0 12px; gap: 12px; }
  .brand strong { font-size: 24px; }
  .brand-mark { display: none; }
  .home-page .header .brand { display: none; }
  .home-page .header .edition { justify-content: flex-start; font-size: 20px; }
  nav { gap: 18px; }
  nav button { font-size: 21px; padding: 8px 0; }
  .edition, main > .edition { font-size: 20px; min-height: 32px; }
  footer { min-height: 38px; padding: 8px 4px 0; gap: 12px; font-size: 18px; }
  footer > div { gap: 16px; }
  #language-select { width: 101px; }
  footer button { font-size: 18px; }
  .home-page .workspace { height: calc(100svh - 101px); min-height: 580px; }
  .home-page .home-title { top: 20px; width: calc(100% - 36px); padding: 22px 10px 20px; box-shadow: 4px 4px 0 var(--ink); }
  .home-page h1 { font-size: clamp(43px, 10.3vw, 66px); line-height: 1; text-shadow: 2px 2px 0 var(--accent); }
  .hero-description { font-size: 24px; margin-top: 10px; }
  .home-info { padding: 0 16px 24px; }
  .home-info-content { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .home-info h2 { font-size: 32px; }
  .home-actions { min-height: 154px; padding: 15px; grid-template-columns: 1fr; gap: 12px; }
  .home-actions .button { min-height: 54px; font-size: 30px; }
  .home-page .map-preview { bottom: 154px; }
  .home-globe-wrap { inset: 202px 18px 24px; }
  .home-map-preview, #home-map-preview { object-fit: contain; object-position: center; }
  .game-page .header .brand { width: 80px; }
  .game-top { top: -47px; left: 12px; gap: 16px; height: 45px; }
  .game-top .text-button { font-size: 22px; }
  .score-mini { font-size: 30px; }
  .score-mini small { font-size: 20px; }
  .game-page .workspace { height: auto; min-height: max(650px, calc(100svh - 101px)); grid-template-rows: auto minmax(320px, 1fr) auto; }
  .question-banner { padding: 12px 14px 15px; }
  .round-heading { gap: 13px; min-height: 25px; }
  .eyebrow { font-size: 20px; }
  .round-track { gap: 5px; }
  .round-track span { width: 21px; height: 21px; font-size: 18px; }
  .question-title { font-size: 32px; line-height: 1; margin-top: 10px; }
  .clue-details { position: relative; top: auto; right: auto; font-size: 20px; margin-top: 9px; }
  .clue-details .question-note { left: 0; }
  .clue-details .question-note { width: calc(100vw - 54px); font-size: 22px; top: 26px; right: -1px; }
  .play-dock { min-height: 144px; padding: 12px 13px 14px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 14px; }
  .selection-card { grid-column: 1 / -1; gap: 6px; align-self: center; }
  #selection-name { font-size: 25px; line-height: .95; }
  .selection-icon { font-size: 31px; }
  .play-dock .round-actions { grid-column: 1 / -1; }
  .round-actions .button { min-height: 52px; font-size: 28px; }
  #map-clock { top: 17px; right: 17px; }
  .clock { width: 66px; height: 66px; outline-offset: 3px; box-shadow: inset 0 0 0 6px var(--green), inset 0 0 0 8px var(--ink); }
  .clock b { font-size: 34px; }
  .clock > span { font-size: 20px; margin-top: 6px; }
  .clock.urgent { box-shadow: inset 0 0 0 6px var(--accent), inset 0 0 0 8px var(--ink); }
  .timer-row > span:not(.clock) { padding: 5px 8px; font-size: 20px; }
  .map-heading { top: 9px; left: 10px; }
  #reset-map { font-size: 20px; padding: 5px 8px; }
  .map-zoom { left: 10px; bottom: 34px; gap: 5px; }
  .map-zoom button { width: 37px; height: 37px; font-size: 29px; }
  .map-compass { bottom: 31px; right: 10px; }
  .map-caption { font-size: 18px; left: 8px; right: 8px; bottom: 5px; }
  .map-caption > span:last-child { font-size: 18px; }
  .feedback { grid-column: 1 / -1; }
  .play-dock:has(.feedback) .answer-details { grid-column: 1 / -1; text-align: left; }
  .feedback h2 { font-size: 26px; overflow-wrap: anywhere; }
  .feedback b { font-size: 28px; }
  .feedback-kicker { font-size: 20px; }
  .play-dock .answer-details { text-align: right; font-size: 22px; }
  .play-dock .answer-details[open] { text-align: left; left: 12px; bottom: 78px; width: calc(100% - 24px); padding: 15px; }
  .feedback-explanation { font-size: 23px; }
  .game-page .workspace.is-complete, .game-page .workspace.is-unavailable { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .is-complete .story, .is-unavailable .story { padding: 27px 23px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .is-complete .map-panel, .is-unavailable .map-panel { height: 330px; min-height: 330px; }
  .complete-story { gap: 20px; }
  .complete-story h1, .unavailable-story h1 { font-size: 48px; }
  .score-stamp { padding: 12px 6px; }
  .score-stamp b { font-size: 72px; }
  .review { padding: 25px 5px; }
  .review-heading h2 { font-size: 40px; }
  .review-item summary { gap: 10px; padding: 17px 0; align-items: start; }
  .review-item summary b { font-size: 25px; }
  .review-item summary small { font-size: 22px; }
  .review-item summary > strong { font-size: 25px; }
  .review-index { font-size: 26px; }
  .review-body { padding: 0 0 20px 22px; }
  .review-body > p { font-size: 23px; }
  dialog { width: calc(100% - 24px); padding: 17px 20px 24px; max-height: calc(100svh - 32px); }
  .modal-head .eyebrow { font-size: 20px; }
  #modal-body h2 { font-size: 40px; }
  #modal-body p { font-size: 24px; }
  .stats-grid { gap: 10px; }
  .stats-grid b { font-size: 42px; }
  .stats-grid span { font-size: 20px; }
  #toast { bottom: 165px; font-size: 23px; }
}

@media (max-width: 370px) {
  nav { gap: 13px; }
  nav button { font-size: 20px; }
  .game-top { gap: 11px; }
  .brand strong { font-size: 22px; }
  .home-page h1 { font-size: 42px; }
  .game-page .header { padding-left: 10px; padding-right: 10px; }
  .question-title { font-size: 30px; }
  .round-track span { width: 19px; height: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}


/* Local preview controls are kept outside the actual game layout. */
.test-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px 20px; padding: 9px 14px; border: 1px solid var(--accent); border-top: 0; }
.test-mode-badge { font-size: 21px; color: var(--accent); }
.test-controls > div { display: flex; flex-wrap: wrap; gap: 9px; }
.test-controls .button { min-height: 36px; padding: 6px 12px; font-size: 22px; }
.is-test-mode .game-top { top: calc(-50px - var(--test-controls-height, 0px)); }
.game-page.is-test-mode .workspace { min-height: max(650px, calc(100svh - 118px - var(--test-controls-height, 0px))); }
.game-page.is-test-mode .workspace.is-complete { height: calc(100svh - 118px - var(--test-controls-height, 0px)); }
@media (max-width: 640px) {
  .is-test-mode .game-top { top: calc(-47px - var(--test-controls-height, 0px)); }
  .test-controls { padding: 10px; gap: 8px; }
  .test-controls > div { width: 100%; }
  .test-controls .button { font-size: 20px; padding: 7px 9px; flex: 1 1 auto; }
  .game-page.is-test-mode .workspace { min-height: max(650px, calc(100svh - 101px - var(--test-controls-height, 0px))); }
  .game-page.is-test-mode .workspace.is-complete { min-height: 0; height: auto; }
}
