/* playpen.site — one stylesheet, no framework, no CDN.
   Palette = the app's own dark tokens (src/renderer/style.css): #0d0e12 base, #f2f2f5 text, #a3a6b0 muted, #3a3c46 hairline,
   accents only where the app uses them: green #4ecb7d, amber #e0a852, coral #d97757, blue #4ea1ff. */
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica"); size-adjust: 107%; ascent-override: 90%; descent-override: 22.4%; line-gap-override: 0%; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --bg: #08090c;
  --bg-2: #0d0e12;
  --panel: #15171e;
  --panel-2: #1a1c24;
  --line: #2a2c35;
  --line-2: #3a3c46;
  --text: #f2f2f5;
  --muted: #a3a6b0;
  --faint: #7b7e89;
  --green: #4ecb7d;
  --amber: #e0a852;
  --coral: #d97757;
  --blue: #4ea1ff;
  --danger: #ff6b6b;
  --pill: 999px;
  --wrap: 1180px;
  --gutter: clamp(18px, 4vw, 40px);
  --sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 4px; }
::selection { background: #f2f2f5; color: #08090c; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--pill); z-index: 100; font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------------------------------------------------------------- header */
.site-head { position: sticky; top: 0; z-index: 40; background: rgba(8, 9, 12, 0.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.site-head .wrap { display: flex; align-items: center; gap: 18px; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a { padding: 8px 14px; border-radius: var(--pill); text-decoration: none; color: var(--muted); font-size: 15px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--panel); }
.nav .btn { margin-left: 8px; padding: 11px 18px; font-size: 15px; }
@media (max-width: 680px) {
  .nav a:not(.btn) { display: none; }
  .nav .btn { margin-left: 0; }
}

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: var(--pill); border: 1px solid var(--line-2); background: transparent; color: var(--text); font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer; transition: transform .12s ease, background .15s ease, border-color .15s ease; }
.btn:hover { background: var(--panel); border-color: #55586a; }
.btn:active { transform: scale(0.97); }
.btn.primary { background: #f0f0f2; color: #101114; border-color: #f0f0f2; }
.btn.primary:hover { background: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------------------------------------------------------------- type */
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.08; font-weight: 600; }
h1 { font-size: clamp(38px, 6.2vw, 68px); }
h2 { font-size: clamp(28px, 4vw, 42px); }
h3 { font-size: 20px; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(18px, 2.1vw, 21px); color: var(--muted); max-width: 34em; }
.muted { color: var(--muted); }
.eyebrow { font: 500 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 0 14px; }
section { padding: clamp(56px, 9vw, 112px) 0; }
.rule { border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- hero */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(32px, 5vw, 56px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.hero-copy h1 { margin-bottom: 20px; }
.hero-copy .lede { margin-bottom: 28px; }
.hero-note { margin-top: 18px; font-size: 14px; color: var(--faint); }
.galaxy { position: relative; }
.galaxy-stage { position: relative; aspect-ratio: 8 / 7; width: 100%; touch-action: pan-y; cursor: grab; outline-offset: 6px; border-radius: 12px; }
.galaxy-stage:active { cursor: grabbing; }
.galaxy-stage canvas { width: 100%; height: 100%; }
.galaxy-caption { min-height: 132px; padding-top: 6px; text-align: center; }
.galaxy-caption .cap-no { font: 500 12px/1 var(--mono); letter-spacing: .1em; color: var(--muted); margin-bottom: 8px; }
.galaxy-caption h2 { font-size: clamp(20px, 2.6vw, 26px); letter-spacing: -0.015em; margin-bottom: 6px; }
.galaxy-caption p { margin: 0 auto; max-width: 30em; color: var(--muted); font-size: 16px; }
.galaxy-caption h2, .galaxy-caption p { transition: opacity .35s ease, transform .35s ease; }
.galaxy-caption.swap h2, .galaxy-caption.swap p { opacity: 0; transform: translateY(6px); }
.stations { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; list-style: none; margin: 14px 0 0; padding: 0; }
.stations button { width: 30px; height: 30px; border-radius: var(--pill); border: 1px solid var(--line-2); background: transparent; color: var(--faint); font: 500 12px/1 var(--mono); cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.stations button:hover { color: var(--text); border-color: #55586a; }
.stations button[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.galaxy-hint { text-align: center; font-size: 13px; color: var(--faint); margin-top: 10px; }
.nojs-stations { display: none; }
.no-js .nojs-stations { display: block; }
.no-js .galaxy-stage, .no-js .stations, .no-js .galaxy-hint { display: none; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .galaxy-stage { aspect-ratio: 1 / 0.92; }
}

/* ---------------------------------------------------------------- demo */
.demo-head { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: end; justify-content: space-between; margin-bottom: 28px; }
.demo-head p { margin: 0; color: var(--muted); max-width: 32em; }
.demo-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 32px; align-items: start; }
.demo-layout > * { min-width: 0; }
.pane.chat { position: relative; }
@media (max-width: 980px) { .demo-layout { grid-template-columns: 1fr; } }
.app { background: #0a0b0f; border: 1px solid var(--line-2); border-radius: 14px; overflow: hidden; font-size: 13px; line-height: 1.45; }
.app-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #0d0e12; min-height: 46px; position: relative; }
.app-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.app-title img { width: 18px; height: 18px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--pill); padding: 2px; background: #101218; position: relative; }
.seg span { position: relative; z-index: 1; padding: 4px 11px; border-radius: var(--pill); color: var(--faint); font-weight: 500; font-size: 12px; transition: color .25s, background .25s; }
.seg span.on { background: #f0f0f2; color: #101114; }
.app-tabs { display: flex; gap: 2px; }
.app-tabs .tab { padding: 4px 11px; border-radius: var(--pill); color: var(--faint); font-weight: 500; font-size: 12px; transition: background .2s, color .2s; }
.app-tabs .tab.on { background: var(--panel-2); color: var(--text); }
.app-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.app-chip { border: 1px solid var(--line-2); border-radius: var(--pill); padding: 4px 11px; font-size: 12px; color: var(--muted); font-weight: 500; transition: border-color .2s, color .2s, box-shadow .3s; }
.app-chip.hot { border-color: var(--green); color: var(--text); box-shadow: 0 0 0 3px rgba(78, 203, 125, 0.22); }
.toast { position: absolute; right: 12px; top: 52px; z-index: 5; max-width: 240px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: #14161c; color: var(--text); font-size: 12px; font-weight: 500; opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; pointer-events: none; }
.toast.on { opacity: 1; transform: none; }
.toast.warn { border-color: var(--amber); }
.toast.ok { border-color: var(--green); }
.app-body { display: flex; height: clamp(380px, 46vw, 470px); background: #08090c; position: relative; }
.pane { min-width: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column; transition: flex-basis .6s cubic-bezier(.2,.7,.2,1), opacity .4s; overflow: hidden; }
.pane:last-child { border-right: 0; }
.pane-head { padding: 7px 12px; border-bottom: 1px solid var(--line); color: var(--faint); font: 500 11px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex: 0 0 auto; }
.pane.terminal { flex: 0 0 0%; opacity: 0; }
.pane.chat { flex: 1 1 0; }
.pane.test { flex: 0 0 0%; opacity: 0; }
.app.t-open .pane.terminal { flex-basis: 34%; opacity: 1; }
.app.g-open .pane.test { flex-basis: 34%; opacity: 1; }
.term-lines { padding: 10px 12px; font: 400 12px/1.5 var(--mono); overflow: hidden; display: flex; flex-direction: column; gap: 7px; flex: 1; justify-content: flex-end; }
.tl { display: block; opacity: 0; transform: translateY(5px); transition: opacity .3s, transform .3s; color: #cfd1d8; }
.tl.on { opacity: 1; transform: none; }
.tag { display: inline-block; padding: 1px 8px; margin-right: 7px; border-radius: var(--pill); font: 600 10.5px/1.5 var(--sans); letter-spacing: .02em; vertical-align: 1px; }
.tag.pp { background: #f0f0f2; color: #101114; }
.tag.cc { background: var(--coral); color: #17110d; }
.tag.sys { background: transparent; border: 1px solid var(--line-2); color: var(--muted); }
.handshake { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.handshake .node { padding: 4px 9px; border-radius: var(--pill); font: 600 11px/1.4 var(--sans); }
.handshake .node.a { background: #f0f0f2; color: #101114; }
.handshake .node.b { background: var(--coral); color: #17110d; }
.handshake .wire { flex: 1; height: 2px; background: linear-gradient(90deg, #f0f0f2, var(--coral)); transform-origin: left; transform: scaleX(0); transition: transform .8s ease; border-radius: 2px; }
.tl.on .wire { transform: scaleX(1); }
.chat-scroll { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 9px; overflow: hidden; justify-content: flex-end; }
.msg { max-width: 88%; padding: 8px 13px; border-radius: 18px; font-size: 13px; opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s; }
.msg.on { opacity: 1; transform: none; }
.msg.me { align-self: flex-end; background: #f0f0f2; color: #101114; border-bottom-right-radius: 6px; }
.msg.pp { align-self: flex-start; background: var(--panel-2); color: var(--text); border-bottom-left-radius: 6px; }
.msg .ico { display: inline-flex; vertical-align: -3px; margin-right: 6px; }
.msg.voice .bars { display: inline-flex; gap: 2px; align-items: center; height: 14px; margin-right: 8px; vertical-align: middle; }
.msg.voice .bars i { width: 2px; background: currentColor; border-radius: 2px; height: 5px; animation: bars 0.9s ease-in-out infinite; }
.msg.voice .bars i:nth-child(2) { animation-delay: .12s; } .msg.voice .bars i:nth-child(3) { animation-delay: .24s; } .msg.voice .bars i:nth-child(4) { animation-delay: .36s; }
@keyframes bars { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.progress { align-self: stretch; height: 6px; border-radius: var(--pill); background: var(--panel-2); overflow: hidden; opacity: 0; transition: opacity .3s; margin: 2px 0; }
.progress.on { opacity: 1; }
.progress i { display: block; height: 100%; width: 0; background: var(--green); border-radius: var(--pill); transition: width 1s linear; }
.plan-view { position: absolute; inset: 0; background: #08090c; padding: 14px; display: flex; flex-direction: column; gap: 10px; opacity: 0; pointer-events: none; transition: opacity .35s; z-index: 2; }
.plan-view.on { opacity: 1; }
.plan-view .mod { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; background: var(--panel); opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .35s; }
.plan-view .mod.on { opacity: 1; transform: none; }
.mod h4 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.mod ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.mod li { color: #cfd1d8; padding-left: 16px; position: relative; opacity: 0; transition: opacity .3s; }
.mod li.on { opacity: 1; }
.mod li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid var(--faint); }
.mod .go { display: inline-block; margin-top: 10px; padding: 5px 14px; border-radius: var(--pill); background: #f0f0f2; color: #101114; font-weight: 600; font-size: 12px; transition: transform .2s, background .2s; }
.mod .go.press { transform: scale(.94); background: var(--green); }
.plan-view .planhead { color: var(--faint); font: 500 11px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.test-canvas { flex: 1; min-height: 0; position: relative; background: #0a0b0f; }
.test-canvas canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.test-tag { position: absolute; left: 10px; bottom: 8px; font: 500 11px/1 var(--mono); color: var(--faint); }
.demo-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.demo-controls .btn { padding: 12px 18px; font-size: 14px; }
.demo-controls .sped { margin-left: auto; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); border: 1px solid var(--line-2); border-radius: var(--pill); padding: 6px 10px; }
.demo-caption { margin-top: 12px; color: var(--muted); font-size: 15px; min-height: 3em; }
.demo-caption b { color: var(--text); font-weight: 600; }
.demo-steps { display: none; gap: 8px; margin-top: 10px; }
.reduced .demo-steps { display: flex; }
.qr-card { text-align: left; }
.qr-card .qr { width: 188px; background: #fff; padding: 8px; border-radius: 12px; }
.qr-card .qr img { width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; }
.qr-card h3 { margin: 16px 0 6px; font-size: 18px; }
.qr-card p { font-size: 15px; color: var(--muted); margin: 0 0 8px; }
.transcript { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 12px; }
.transcript summary { cursor: pointer; color: var(--muted); font-weight: 500; }
.transcript ol { color: var(--muted); padding-left: 1.2em; }

/* ---------------------------------------------------------------- toggle section */
.how-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
@media (max-width: 900px) { .how-grid { grid-template-columns: 1fr; } }
.mode-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--pill); padding: 4px; background: #0d0e12; margin: 6px 0 22px; position: relative; }
.mode-toggle button { position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted); font: 600 15px/1 var(--sans); padding: 11px 22px; border-radius: var(--pill); cursor: pointer; transition: color .2s; }
.mode-toggle button[aria-checked="true"] { color: #101114; }
.mode-toggle .thumb { position: absolute; z-index: 0; top: 4px; bottom: 4px; left: 4px; border-radius: var(--pill); background: #f0f0f2; transition: transform .35s cubic-bezier(.3,.8,.3,1), width .35s cubic-bezier(.3,.8,.3,1); }
.mode-panel { transition: opacity .25s ease, transform .25s ease; }
.mode-panel.swap { opacity: 0; transform: translateY(8px); }
.mode-panel h3 { font-size: clamp(22px, 2.8vw, 30px); letter-spacing: -0.02em; margin-bottom: 10px; }
.mode-panel ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.mode-panel li { padding-left: 22px; position: relative; color: var(--muted); }
.mode-panel li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 2px; background: var(--text); }
.under { margin-top: 0; }
.under h3 { margin-bottom: 14px; }
.under dl { margin: 0; }
.under .row { display: grid; grid-template-columns: 11em 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.under .row:last-child { border-bottom: 1px solid var(--line); }
.under dt { font-weight: 600; }
.under dd { margin: 0; color: var(--muted); }
@media (max-width: 560px) { .under .row { grid-template-columns: 1fr; gap: 4px; } }

/* ---------------------------------------------------------------- signup */
.signup { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--bg-2); }
.signup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); align-items: center; }
@media (max-width: 860px) { .signup-grid { grid-template-columns: 1fr; } }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row input[type="email"] { flex: 1 1 240px; min-width: 0; padding: 14px 20px; border-radius: var(--pill); border: 1px solid var(--line-2); background: #0a0b0f; color: var(--text); font: 400 16px/1 var(--sans); }
.form-row input[type="email"]::placeholder { color: var(--faint); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; color: var(--muted); font-size: 15px; }
.check input { margin-top: 5px; width: 17px; height: 17px; accent-color: #f0f0f2; }
.form-note { font-size: 14px; color: var(--faint); margin: 14px 0 0; }
.form-status { margin-top: 14px; min-height: 1.5em; font-weight: 500; }
.form-status.ok { color: var(--green); }
.form-status.err { color: var(--danger); }
.form-status.info { color: var(--amber); }

/* ---------------------------------------------------------------- long-form pages */
.page-head { padding: clamp(40px, 7vw, 88px) 0 28px; }
.page-head h1 { font-size: clamp(34px, 5vw, 56px); margin-bottom: 14px; }
.prose { max-width: 42em; }
.prose h2 { font-size: clamp(22px, 2.6vw, 28px); margin: 2.2em 0 .5em; letter-spacing: -0.02em; }
.prose h3 { margin: 1.6em 0 .4em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--panel); padding: 1px 6px; border-radius: 6px; }
.prose .callout { border-left: 2px solid var(--amber); padding: 2px 0 2px 18px; margin: 1.6em 0; color: var(--muted); }
.draft-banner { background: #1d1708; border: 1px solid var(--amber); border-radius: 12px; padding: 12px 16px; margin-bottom: 28px; color: #f2dfb8; font-size: 15px; }
.dl-card { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 8px 0 8px; }
@media (max-width: 640px) { .dl-card { grid-template-columns: 1fr; } }
.dl-meta { display: grid; grid-template-columns: 7em 1fr; gap: 6px 16px; margin: 12px 0 0; font-size: 15px; }
.dl-meta dt { color: var(--faint); }
.dl-meta dd { margin: 0; word-break: break-all; font-family: var(--mono); font-size: 13px; }
.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 600; font-size: 18px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--faint); font-weight: 400; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 12px 0 0; color: var(--muted); max-width: 40em; }

/* ---------------------------------------------------------------- why + footer */
.why p { font-size: clamp(20px, 2.6vw, 28px); line-height: 1.45; letter-spacing: -0.01em; max-width: 30em; color: #dcdde3; margin: 0 0 .7em; }
.site-foot { border-top: 1px solid var(--line); padding: 36px 0 56px; color: var(--muted); font-size: 15px; }
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.site-foot a { color: var(--muted); }
.site-foot a:hover { color: var(--text); }
.foot-small { width: 100%; font-size: 13px; color: var(--faint); }

/* ---------------------------------------------------------------- placeholder game page */
.game-page { min-height: 100svh; display: flex; flex-direction: column; background: #08090c; }
.game-page header { padding: 12px var(--gutter); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.game-banner { background: #1d1708; border-bottom: 1px solid var(--amber); color: #f2dfb8; padding: 10px var(--gutter); font-size: 14px; }
.game-stage { flex: 1; display: grid; place-items: center; padding: 16px; }
.game-stage canvas { width: min(100%, 520px); aspect-ratio: 1; background: #0a0b0f; border: 1px solid var(--line-2); border-radius: 14px; touch-action: none; }
.dpad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 64px); gap: 8px; justify-content: center; padding: 12px 0 28px; }
.dpad button { border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: 600 22px/1 var(--sans); touch-action: manipulation; }
.dpad button:active { background: #2a2d38; }
.dpad .up { grid-column: 2; } .dpad .left { grid-column: 1; grid-row: 2; } .dpad .down { grid-column: 2; grid-row: 2; } .dpad .right { grid-column: 3; grid-row: 2; }

/* ---------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- phone: the demo's three zones stack (terminal, chat, test) */
@media (max-width: 640px) {
  .app-body { flex-direction: column; height: 600px; }
  .pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .pane:last-child { border-bottom: 0; }
  .app.t-open .pane.terminal { flex-basis: 32%; }
  .app.g-open .pane.test { flex-basis: 34%; }
  .term-lines { padding: 8px 10px; }
}

@media (max-width: 600px) { .galaxy-caption { min-height: 196px; } }
