:root {
  color-scheme: dark;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #fdf8ea;
  background: #192239;
  --muted: #c1cbe1;
  --ink: #192239;
  --accent: #ffca73;
  --panel: #222e49;
  --line: #455574;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.mast { border-bottom: 1px solid #394765; }
.mast-inner { max-width: 1056px; padding: 13px 18px; margin: auto; display: flex; align-items: center; gap: 11px; }
.brand-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--ink); background: var(--accent); font-size: 26px; flex: none; }
h1, h2, p, figure { margin: 0; }
h1 { font-size: clamp(19px, 4.6vw, 26px); line-height: 1.08; letter-spacing: -.035em; }
.mast p, .eyebrow, figcaption { font-size: 11px; font-weight: 800; letter-spacing: .11em; }
.mast p { color: var(--muted); margin-top: 5px; }
main { width: min(100%, 1056px); margin: auto; padding: 17px 18px 0; }
.round-bar { display: flex; justify-content: space-between; align-items: end; gap: 8px; margin-bottom: 13px; }
.round-bar .eyebrow { color: var(--accent); }
h2 { font-size: clamp(23px, 5.4vw, 37px); letter-spacing: -.045em; line-height: 1.05; margin-top: 3px; }
.round-dots { display: flex; gap: 4px; align-items: center; padding-bottom: 4px; }
.round-dots i { width: 7px; height: 7px; background: #687694; border-radius: 50%; }
.round-dots .current { width: 16px; background: var(--accent); border-radius: 10px; }
.round-dots .done { background: #a7dcca; }
.game { display: grid; grid-template-columns: 1fr; gap: 13px; }
.scene { position: relative; overflow: hidden; border-radius: 20px; background: #fff; min-width: 0; aspect-ratio: 3 / 4; }
.scene picture { position: absolute; inset: 0; display: block; }
.scene img { display: block; width: 100%; height: 100%; object-fit: contain; }
.scene[data-background="true"] img { object-fit: cover; }
.scene img.reveal-art { animation: art-in .24s ease-out; }
@keyframes art-in { from { opacity: .45; } to { opacity: 1; } }
figcaption { position: absolute; bottom: 7px; left: 7px; color: var(--ink); background: #fcf7ec; border: 1px solid #e2dccf; padding: 4px 7px; border-radius: 7px; font-size: 9px; }
.workbench { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.detail-steps { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.detail-steps li { text-align: center; padding: 7px 3px; border-radius: 8px; background: var(--panel); color: var(--muted); font-size: clamp(11px, 3.3vw, 14px); font-weight: 750; border: 1px solid var(--line); white-space: nowrap; }
.detail-steps span { margin-left: 2px; }
[data-kind="when"] { --detail: #875108; --chip: #ffe4ac; }
[data-kind="where"] { --detail: #126149; --chip: #bcebd8; }
[data-kind="how"] { --detail: #623d98; --chip: #e5d4ff; }
.detail-steps .active { color: var(--ink); background: var(--chip); border-color: var(--chip); }
.detail-steps .visited { color: var(--chip); border-color: var(--chip); }
.paper { color: var(--ink); background: #fff7e7; border-radius: 16px; padding: 13px 14px 15px; }
.paper .eyebrow { color: #615544; }
.sentence { margin-top: 7px; font-size: clamp(23px, 6vw, 37px); line-height: 1.27; font-weight: 800; letter-spacing: -.035em; }
.detail { color: var(--detail); }
.detail.new { animation: mark-in .25s ease-out both; border-radius: .12em; }
@keyframes mark-in { from { background: var(--chip); } to { background: transparent; } }
.blank { display: inline-block; vertical-align: -.07em; height: .8em; width: 3.7em; max-width: 80%; border-bottom: 3px solid var(--detail); margin-inline: .12em; }
.hint { color: var(--muted); font-size: 14px; line-height: 1.4; }
.word-bank { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin: 0; padding: 0; }
.word-bank li { color: #f0e5ff; font-size: 13px; background: #352953; border: 1px solid #665789; border-radius: 8px; padding: 3px 7px; }
.sound-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.listen-help { font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.language-buttons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.language-buttons .sound { font-size: 14px; padding: 5px 6px; }
.language-buttons .english { border-color: var(--accent); color: var(--accent); }
.sound[data-playing] { background: #3b4d70; border-color: #fff; }
.sound { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 10px; color: #fff; background: var(--panel); font-weight: 750; }
.sound svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
#sound-status { font-size: 12px; color: var(--muted); }
.actions { position: sticky; bottom: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 9px; background: var(--ink); border-top: 1px solid #394765; padding: 9px 0 max(10px, env(safe-area-inset-bottom)); margin-top: 11px; }
.actions button { border-radius: 11px; min-height: 48px; font-weight: 800; padding: 7px 12px; }
.back { background: transparent; color: #fff; border: 1px solid var(--line); flex: none; }
.back:disabled { opacity: .42; cursor: default; }
.next { display: flex; gap: 8px; align-items: center; justify-content: center; min-width: 155px; flex: 1; background: var(--accent); border: 1px solid transparent; color: var(--ink); }
.next:hover { background: #ffda99; }
.complete { padding: 28px 22px; }
.complete h2 + p { margin-top: 10px; }
.worksheet-link { display: inline-flex; align-items: center; gap: 10px; margin-top: 22px; padding: 13px 18px; border-radius: 10px; background: var(--ink); color: #fff; font-weight: 750; text-decoration: none; line-height: 1.4; }
.worksheet-link:hover { background: #344563; }
.worksheet-link:focus-visible { outline-color: var(--ink); }
@media (max-width: 440px) { .language-buttons { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 600px) {
  .scene { aspect-ratio: 4 / 3; }
}
@media (min-width: 1000px) {
  main { padding-top: 24px; }
  .game { grid-template-columns: minmax(0, 1.08fr) minmax(340px, 1fr); align-items: start; gap: 23px; }
  .workbench { gap: 13px; }
  .paper { padding: 20px; }
  .round-bar { margin-bottom: 17px; }
  .actions { margin-top: 15px; }
  .next { flex: 0 1 245px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
