:root {
  --paper: #f8f5ee;
  --card: #fffdf7;
  --ink: #242c4f;
  --muted: #555a70;
  --line: #dcd8cd;
  --accent: #ac492f;
  --gold: #f1b854;
  --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: 'DM Sans', system-ui, sans-serif; font-size: 16px; line-height: 1.6; }
a { color: var(--accent); text-underline-offset: 3px; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
h1, h2 { font-family: Fraunces, Georgia, serif; line-height: 1.2; }
h1 { margin: 0 0 12px; font-size: 48px; }
h2 { margin: 32px 0 12px; font-size: 28px; }
p { margin: 0 0 16px; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.skip { position: fixed; left: 16px; z-index: 2; transform: translateY(-110%); background: var(--card); padding: 8px; }
.skip:focus { transform: translateY(0); }
.masthead { border-bottom: 1px solid var(--line); }
.topbar, .foot-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar nav, .foot-inner nav { display: flex; flex-wrap: wrap; gap: 16px; }
.topbar nav a, .foot-inner a { color: var(--ink); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font: 700 22px/1 Fraunces, Georgia, serif; }
.mark { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3px; width: 24px; height: 24px; padding: 4px; border-radius: 5px; background: var(--ink); }
.mark i { background: var(--card); }
.mark i:last-child { background: var(--gold); }
.intro { padding: 48px 0 16px; }
.intro > p, .play-intro > p { max-width: 65ch; color: var(--muted); }
.shelf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.word-shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.word-shelf .puzzle-tile { grid-template-columns: 128px minmax(0, 1fr) auto; }
.word-shelf .tile-art { grid-column: auto; }
.ladder { background-color: #d7dfc5; color: var(--ink); }
.crossword { background-color: #ead8ac; color: var(--ink); }
.cipher { background-color: #dcd2e7; color: var(--ink); }
.puzzle-tile { display: grid; grid-template-columns: minmax(0, 1fr) auto; position: relative; overflow: hidden; color: var(--ink); text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.puzzle-tile:hover { border-color: var(--accent); }
.tile-art { grid-column: 1 / -1; min-height: 112px; display: grid; place-items: center; }
.sudoku { background-color: #e9c786; color: var(--ink); }
.words { background-color: #c8d8e9; color: var(--ink); }
.pixels { background-color: #e3cbbb; color: var(--ink); }
.tile-art span, .cover-symbol { display: block; padding: 8px 16px; border: 1px solid currentColor; border-radius: 4px; font-weight: 700; font-size: 22px; letter-spacing: .12em; }
.tile-copy { display: grid; gap: 4px; padding: 16px 0 16px 16px; }
.tile-copy strong { font-family: Fraunces, Georgia, serif; font-size: 22px; }
.tile-copy span { color: var(--muted); font-size: 14px; }
.tile-copy .category { font-weight: 700; }
.tile-arrow { padding: 16px; color: var(--accent); }
.reading { max-width: 70ch; padding-bottom: 32px; }
.document { padding-top: 48px; min-height: 45vh; }
.faq { margin-top: 24px; }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { margin: 8px 0 0; }
.play-intro { max-width: 800px; padding-top: 24px; }
.crumb { margin-bottom: 16px; font-size: 14px; color: var(--muted); }
.game-stage { position: relative; width: 100%; min-height: 760px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.game-stage iframe, .game-cover, .game-load { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.game-cover { align-content: start; justify-items: center; gap: 24px; display: grid; padding: 48px 16px; }
.game-load { display: none; align-content: start; justify-items: center; gap: 12px; padding-top: 48px; }
.game-stage[data-gf-state="loading"] .game-load { display: grid; }
.game-stage[data-gf-state] .game-cover { display: none; }
.loading-dots { color: var(--accent); letter-spacing: .35em; }
.button { min-height: 48px; padding: 8px 24px; border: 0; border-radius: var(--radius); background: var(--ink); color: white; font-weight: 700; }
.button:hover { background: #141a36; }
.play-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.play-controls a { margin-right: auto; }
.play-controls button { min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--card); padding: 4px 12px; }
.play-controls button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.fallback { font-size: 14px; }
.more { padding-bottom: 48px; }
.more ul { padding-left: 24px; }
.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .topbar nav { gap: 12px; font-size: 14px; }
  .intro, .document { padding-top: 32px; }
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }
  .shelf, .word-shelf { grid-template-columns: 1fr; gap: 8px; }
  .puzzle-tile, .word-shelf .puzzle-tile { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .tile-art { grid-column: auto; min-height: 96px; }
  .tile-art span { font-size: 14px; padding: 4px; letter-spacing: 0; }
  .tile-copy { padding: 8px 0 8px 12px; gap: 0; }
  .tile-copy strong { font-size: 18px; }
  .tile-arrow { padding: 12px; }
  .game-stage { min-height: 820px; }
  .button { width: 100%; }
  .foot-inner { align-items: flex-start; flex-direction: column; padding-block: 16px; }
}
