/* RE:BOING — page shell. The demo itself is drawn into an 8-bit indexed framebuffer by js/core.js. */
:root {
  color-scheme: dark;
  --surround: #000000;
  --ink: #e9e1d2;
  --dim: #8f8899;
  --faint: #4a4352;
  --red: #d6202b;
  --veil: rgba(7, 5, 12, 0.62);
  --panel: #0d0a12;
  --mono: ui-monospace, 'Cascadia Mono', 'Consolas', 'Courier New', monospace;   /* no external fonts: the release is fully self-contained */
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --surround: #17141c; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; --surround: #000000; } }
:root[data-theme="dark"] { --surround: #000000; }
*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }
/* bitmap text: real 5×7 glyphs from the demo's own font, drawn 1:1 and scaled by whole numbers only */
canvas.bm { display: block; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; }
button canvas.bm, label canvas.bm, span canvas.bm { display: inline-block; vertical-align: middle; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button:hover canvas.bm, button:focus-visible canvas.bm { filter: brightness(1.45); }
#controls .sep canvas.bm { opacity: 0.5; }
.title, .sub, .spec { line-height: 0; }
#ov-about p, #ov-about h2 { line-height: 0; }
html, body { height: 100%; margin: 0; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { background: var(--surround); color: var(--ink); font: 17px/1.2 var(--mono); display: flex; overflow: hidden; }
#stage { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--surround); position: relative; }
#screen { position: relative; background: #07050c; flex: none; container-type: size; }
#scene { display: block; width: 100%; height: 100%; image-rendering: pixelated; image-rendering: crisp-edges; }
.ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; background: var(--veil); padding: 4%; }
.ov[hidden] { display: none; }
.title { font-size: 13vmin; font-size: 19cqh; line-height: 0.9; letter-spacing: 0.04em; margin: 0; font-weight: 400; }
.checker { width: min(70%, 420px); height: max(6px, 2cqh); margin: 0.35em 0 0.5em; background: repeating-linear-gradient(90deg, var(--red) 0 6.25%, var(--ink) 6.25% 12.5%); }
.sub { font-size: 3.4vmin; font-size: max(13px, 5cqh); letter-spacing: 0.12em; margin: 0 0 1.4em; }
.spec { color: var(--dim); font-size: 2.6vmin; font-size: max(12px, 4cqh); letter-spacing: 0.08em; margin: 1.2em 0 0; }
button { font: inherit; color: var(--ink); background: none; border: 0; padding: 0.15em 0.4em; cursor: pointer; letter-spacing: 0.06em; border-radius: 0; }
button:hover { color: #fff; background: rgba(214, 32, 43, 0.28); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.go { font-size: 4.6vmin; font-size: max(17px, 7cqh); color: #fff; background: var(--red); padding: 0.1em 0.7em; }
.go:hover { background: #ec3a44; }
.link { color: var(--dim); font-size: max(14px, 4cqh); margin-top: 0.6em; text-decoration: underline; text-underline-offset: 3px; }
label.opt { color: var(--dim); font-size: max(14px, 4cqh); margin-top: 0.4em; display: inline-flex; gap: 0.4em; align-items: center; cursor: pointer; }
input[type=checkbox] { accent-color: var(--red); width: 16px; height: 16px; }
#ov-about { position: fixed; inset: 0; z-index: 20; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: rgba(7, 5, 12, 0.97);
  padding: calc(env(safe-area-inset-top, 0px) + 24px) calc(env(safe-area-inset-right, 0px) + 20px) calc(env(safe-area-inset-bottom, 0px) + 24px) calc(env(safe-area-inset-left, 0px) + 20px); display: flex; }
#ov-about .txt { width: 100%; max-width: 720px; margin: auto; text-align: left; font-size: 16px; }
#ov-about p { margin: 0 0 0.8em; }
#ov-about h2 { font-weight: 400; font-size: 1.5em; margin: 0 0 0.4em; letter-spacing: 0.06em; }
#ov-end { position: absolute; left: 0; right: 0; top: 2%; display: flex; justify-content: center; }
#ov-end .go { font-size: max(15px, 4.5cqh); opacity: 0.92; }
#ov-end[hidden] { display: none; }
#ov-end .msg { font-size: max(14px, 5cqh); color: var(--dim); max-width: 26em; margin: 0 0 1.2em; }
#controls { display: flex; flex-wrap: wrap; gap: 0.1em 0.5em; align-items: center; justify-content: center; padding: 6px 8px; min-height: 44px; font-size: 21px; color: var(--dim); transition: opacity 0.6s; }
#controls button { color: var(--dim); min-height: 36px; }
#controls button:hover, #controls button:focus-visible { color: var(--ink); }
#controls .sep { color: var(--faint); }
#controls label { display: inline-flex; align-items: center; gap: 0.4em; }
#vol { width: 96px; accent-color: var(--red); }
#note { color: var(--dim); font-size: 18px; text-align: center; padding: 0 1em 4px; }
body.quiet #controls { opacity: 0; }
body.quiet { cursor: none; }
#err { position: fixed; inset: 0; display: grid; place-items: center; padding: 2em; text-align: center; }
#debug { width: 300px; flex: none; background: var(--panel); border-left: 1px solid var(--faint); padding: 12px 14px; font-size: 18px; overflow: auto; color: var(--dim); }
#debug dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0 0 10px; }
#debug dt { color: var(--faint); }
#debug dd { margin: 0; color: var(--ink); }
#debug .row { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
#debug .row button { border: 1px solid var(--faint); font-size: 17px; }
#debug canvas { width: 192px; height: 192px; image-rendering: pixelated; display: block; border: 1px solid var(--faint); }
#d-seek { width: 100%; accent-color: var(--red); }
@media (max-width: 760px) { body.debugging { flex-direction: column; } #debug { width: auto; max-height: 42vh; border-left: 0; border-top: 1px solid var(--faint); } #vol { width: 72px; } }
@media (prefers-reduced-motion: reduce) { #controls { transition: none; } }

.resolution { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; }
#resolution { max-width: 100%; background: #17131d; color: #f0e8d8; border: 1px solid #8f8899; padding: 4px; font: 14px monospace; }
#resolution:focus-visible { outline: 2px solid #f0e8d8; outline-offset: 2px; }
