:root {
  color-scheme: dark;
  --ink: #101529;
  --paper: #dde0bd;
  --muted: #85929d;
  --cyan: #7fbe9e;
  --coral: #ee8c70;
  --line: #34404b;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", "PingFang SC", monospace;
  color: var(--paper);
  background: var(--ink);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--ink); }
button, a, canvas { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { font: inherit; }
.stage { min-height: 100svh; max-width: 1480px; margin: 0 auto; padding: 24px 40px; display: grid; grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr); gap: clamp(32px, 5vw, 80px); align-items: center; }
.identity { justify-self: start; width: 100%; max-width: 250px; }
.wordmark { display: flex; gap: 12px; align-items: center; }
.brand-mask { width: 32px; height: 32px; fill: var(--cyan); flex: none; }
.mask-eyes { fill: var(--ink); }
h1 { margin: 0; font-size: clamp(17px, 1.6vw, 23px); font-weight: 700; letter-spacing: .03em; line-height: .95; }
h1 span { display: block; color: var(--coral); font-size: 10px; letter-spacing: .36em; margin-top: 9px; }
.edition { color: var(--cyan); font-size: 8px; letter-spacing: .1em; margin: 25px 0 0; }
.premise { font-size: 11px; color: var(--muted); line-height: 1.9; margin: 14px 0 0; }
.edition-number { display: inline-block; color: #56646e; font-size: 8px; letter-spacing: .04em; margin-top: 50px; padding-top: 12px; border-top: 1px solid var(--line); }
.game-region { position: relative; grid-column: 2; }
.game-frame { position: relative; isolation: isolate; height: min(960px, calc(100svh - 48px)); aspect-ratio: 480 / 800; overflow: hidden; background: var(--ink); outline: 1px solid var(--line); outline-offset: 7px; }
canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; outline: none; touch-action: none; user-select: none; -webkit-user-select: none; overscroll-behavior: contain; }
.field-guide { max-width: 220px; justify-self: end; width: 100%; }
h2 { margin: 0 0 26px; color: var(--paper); font-size: 9px; font-weight: 600; letter-spacing: .13em; }
.touch-controls { margin: 0; padding: 0; list-style: none; display: grid; gap: 21px; }
.touch-controls li { display: flex; align-items: start; gap: 13px; }
.step { font-size: 8px; line-height: 13px; color: var(--coral); }
.touch-controls p { margin: 0; }
.touch-controls strong { display: block; color: var(--cyan); font-size: 9px; line-height: 13px; letter-spacing: .035em; font-weight: 500; }
.touch-controls p > span { display: block; color: var(--muted); font-size: 9px; line-height: 1.7; margin-top: 5px; }
.language { display: flex; align-items: center; gap: 17px; margin-top: 40px; font-size: 9px; }
.language a { color: var(--muted); text-decoration: none; padding: 7px 0; border-bottom: 1px solid transparent; }
.language a[aria-current="page"] { color: var(--paper); border-bottom-color: var(--coral); }
.language a:hover { color: var(--cyan); }
.language a:focus-visible, .reload-button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 5px; }
.boot-screen { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; flex-direction: column; gap: 18px; background: var(--ink); z-index: 3; }
.boot-screen.is-ready, .boot-screen[hidden] { display: none; }
.loading-mark { display: flex; gap: 5px; }
.loading-mark i { width: 6px; height: 6px; background: var(--cyan); animation: load .9s steps(1) infinite; }
.loading-mark i:nth-child(2) { animation-delay: .15s; }
.loading-mark i:nth-child(3) { animation-delay: .3s; }
.boot-screen p { font-size: 9px; color: var(--muted); letter-spacing: .1em; margin: 0; padding: 0 28px; text-align: center; line-height: 1.7; }
.reload-button { margin-top: 12px; border: 1px solid var(--cyan); background: transparent; color: var(--paper); padding: 10px 22px; cursor: pointer; }
.toast { position: absolute; z-index: 5; left: 18px; right: 18px; bottom: max(22px, env(safe-area-inset-bottom)); padding: 12px 16px; font-size: 11px; line-height: 1.6; text-align: center; color: var(--paper); background: var(--ink); border: 1px solid var(--cyan); opacity: 0; pointer-events: none; }
.toast.is-visible { opacity: 1; }
.noscript { position: fixed; inset: 0; display: grid; place-content: center; margin: 0; background: var(--ink); padding: 30px; text-align: center; z-index: 10; }
@keyframes load { 50% { opacity: .25; } }
@media (max-width: 1100px) {
  .stage { padding-inline: 24px; gap: 27px; grid-template-columns: minmax(150px, 1fr) auto minmax(150px, 1fr); }
  .wordmark { gap: 8px; }
  .brand-mask { width: 26px; height: 26px; }
  h1 { font-size: 16px; }
  h1 span { font-size: 8px; }
  .edition { font-size: 7px; }
  .premise { font-size: 9px; }
}
@media (max-width: 900px) {
  .stage { display: flex; justify-content: center; padding: 0; min-height: 100svh; }
  .identity, .field-guide { display: none; }
  .game-region { width: 100%; height: 100svh; display: flex; justify-content: center; align-items: center; }
  .game-frame { height: 100%; width: 100%; aspect-ratio: auto; outline: 0; }
}
@media (max-height: 550px) and (min-width: 901px) {
  .touch-controls { gap: 10px; }
  .language { margin-top: 17px; }
  .edition-number { margin-top: 25px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Developer rail stays outside the canvas, including narrow desktop panels. */
.developer-tools[hidden] { display: none; }
.developer-tools { width: 140px; grid-column: 2; align-self: start; padding-top: 20px; max-height: calc(100vh - 48px); overflow-y: auto; scrollbar-width: thin; }
.developer-tools h2 { color: var(--muted); font-size: 9px; margin-bottom: 14px; }
.developer-tools button { width: 100%; border: 1px solid var(--coral); padding: 12px 9px; color: var(--paper); background: #2b2330; font-size: 10px; font-weight: 600; line-height: 1.7; cursor: pointer; }
.developer-tools button + button { margin-top: 8px; }
.developer-tools button:hover { background: #4a3039; border-color: #ffd1a9; }
.developer-tools button:disabled { opacity: .45; cursor: wait; }
.developer-tools button:focus-visible, .developer-tools a:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }
.developer-tools p, .developer-tools a { color: var(--muted); font-size: 9px; line-height: 1.7; }
.developer-tools a { color: var(--cyan); }
.dev-tools-enabled .stage { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 24px; max-width: 1000px; padding: 16px; min-height: 100svh; align-items: start; }
.dev-tools-enabled .game-region { grid-column: 1; width: 100%; height: calc(100svh - 32px); display: flex; justify-content: center; align-items: center; }
.dev-tools-enabled .game-frame { width: min(100%, calc((100svh - 32px) * .6)); height: auto; aspect-ratio: 480 / 800; outline: 0; }
.dev-tools-enabled .field-guide { display: none; }
@media (max-width: 600px) {
 .dev-tools-enabled .stage { grid-template-columns: minmax(0, 1fr) 92px; gap: 10px; padding: 8px; }
 .dev-tools-enabled .game-region { height: calc(100svh - 16px); }
 .developer-tools { width: 92px; padding-top: 8px; }
 .developer-tools button { padding: 10px 6px; font-size: 9px; }
}
