:root {
  color-scheme: light;
  --paper: #e8e9e2;
  --ink: #243d32;
  --muted: #53675b;
  --red: #a53246;
  --line: #b9c6b7;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 5px; padding: .7rem 1rem; }
button:hover:not(:disabled) { background: #d5ddcd; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, canvas:focus-visible, summary:focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
.arcade { max-width: 1100px; margin: auto; padding: 36px 42px 24px; }
.intro { margin-bottom: 30px; }
.japanese { margin: 0 0 4px; font-size: 1.3rem; font-family: "Hiragino Mincho ProN", "Yu Mincho", serif; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.1rem, 5vw, 3.5rem); font-weight: 400; line-height: 1.1; margin: 0 0 13px; }
.edition { margin: 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: .92rem; color: var(--muted); }
.badge { color: var(--red); border: 1px solid #bc8d94; border-radius: 4px; padding: 4px 8px; font-size: .8rem; }
.play-area { display: grid; grid-template-columns: minmax(320px, 640px) minmax(220px, 1fr); align-items: start; gap: 50px; }
.player { --touch-space: 0px; }
.exit-fullscreen { display: none; }
.screen { position: relative; width: 100%; margin: 0; background: #000; border: 10px solid #243d32; border-radius: 8px; overflow: hidden; }
#game { display: block; width: 100%; height: auto; aspect-ratio: 640 / 480; image-rendering: pixelated; background: black; touch-action: none; }
.screen-message { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; color: #fff; text-align: center; background: #001306a8; padding: 16px; }
.screen-message[hidden] { display: none; }
.screen-message p { font-family: Georgia, serif; font-size: 1.6rem; margin: 0 0 20px; }
.screen-message button { color: #fff; background: #a53246; border-color: #a53246; }
.screen-message button:hover:not(:disabled) { background: #8d2537; }
.companion { padding-top: 10px; }
.stage-label { margin: 0 0 10px; color: var(--red); }
h2 { font-family: Georgia, serif; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 400; line-height: 1.2; margin: 0 0 18px; }
.scope { max-width: 36ch; font-size: .95rem; line-height: 1.65; margin: 0 0 25px; color: var(--muted); }
.stage-progress { color: var(--ink); font-size: .85rem; margin: -12px 0 22px; }
.controls { display: grid; gap: 9px; margin: 0 0 25px; }
.controls div { display: flex; align-items: center; gap: 16px; }
.controls dt { min-width: 102px; display: flex; gap: 3px; }
.controls dd { margin: 0; font-size: .9rem; }
kbd { display: inline-block; background: #fafbf5; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; min-width: 22px; text-align: center; padding: 3px 6px; font: .8rem "Trebuchet MS", Verdana, sans-serif; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; max-width: 380px; }
.actions button { font-size: .85rem; }
.status { min-height: 2.5rem; color: var(--red); font-size: .87rem; line-height: 1.4; margin: 15px 0 0; max-width: 40ch; }
.notes { margin-top: 15px; font-size: .8rem; line-height: 1.6; color: var(--muted); max-width: 43ch; }
.notes summary { cursor: pointer; }
.notes output { display: block; font-family: monospace; }
.touch-controls { display: none; align-items: center; gap: 30px; margin: 25px 0 0; touch-action: none; }
.dpad { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 44px); gap: 4px; }
.dpad button { padding: 0; font-size: 1.25rem; user-select: none; }
.up { grid-column: 2; }.left { grid-column: 1; grid-row: 2; }.down { grid-column: 2; grid-row: 2; }.right { grid-column: 3; grid-row: 2; }
.touch-actions { display: grid; gap: 6px; max-width: 150px; }
.touch-actions button { min-height: 44px; user-select: none; font-size: .8rem; padding: .45rem .65rem; }
footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 35px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.player:fullscreen { display: flex; flex-direction: column; align-items: center; justify-content: center; background: #000; }
.player:fullscreen .screen { border: 0; border-radius: 0; width: auto; }
.player:fullscreen #game { width: auto; height: min(calc(100dvh - var(--touch-space)), 115vw); max-width: 100vw; }
.player:fullscreen .touch-controls { margin: 16px 0; }
.player:fullscreen .touch-controls button { color: #fff; border-color: #9caca2; }
.player:fullscreen .exit-fullscreen { display: block; position: absolute; top: 12px; right: 12px; z-index: 2; color: #fff; border-color: #9caca2; background: #000; }
@media (pointer: coarse) { .touch-controls { display: flex; } .player { --touch-space: 132px; } }
@media (max-width: 720px) {
  .arcade { padding: 24px 20px; }
  .play-area { grid-template-columns: 1fr; gap: 24px; }
  .screen { max-width: 640px; margin: auto; }
  .companion { max-width: 440px; margin: auto; }
  .scope { max-width: 48ch; }
  .touch-controls { display: flex; justify-content: center; }
  .player { --touch-space: 132px; }
  footer { font-size: .7rem; }
}

.stage-choice { display: grid; gap: 7px; margin: 0 0 16px; font-size: .85rem; max-width: 380px; }
.stage-choice select { font: inherit; padding: .65rem; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fafbf5; width: 100%; }
.stage-choice select:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
.audio-controls { display:flex; align-items:center; gap:12px; margin:16px 0 8px; }
.audio-controls label { display:flex; align-items:center; gap:8px; font-size:.85rem; }
.audio-controls input { width:120px; accent-color:var(--red); }
