/* /play: game stage, overlays and immersive mode. The canvas is owned by the
   Godot runtime; the portal only frames it and never intercepts its input. */
.play-intro { padding: clamp(28px, 5vw, 56px) 0 20px; }
.play-stage { position: relative; aspect-ratio: 16 / 9; min-height: 540px; background: #04121c; border: 1px solid var(--line-strong); border-radius: var(--radius-l); overflow: hidden; box-shadow: var(--shadow), var(--glow); }
.play-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #04121c; touch-action: none; }
.play-stage canvas:focus-visible { outline: 3px solid var(--gold); outline-offset: -4px; }
.play-stage:not([data-state="running"]) canvas { opacity: 0; pointer-events: none; }
.play-shell [hidden] { display: none !important; }
.play-overlay { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: clamp(16px, 4vw, 40px); background: radial-gradient(800px 400px at 50% 0%, rgba(24, 215, 255, .12), transparent 70%), rgba(4, 18, 28, .96); overflow: auto; }
.play-stage[data-state="running"] .play-overlay { display: none; }
.play-panel { width: min(100%, 560px); justify-self: center; overflow-wrap: anywhere; background: rgba(7, 30, 43, .9); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow); }
.play-panel h2 { font-size: 1.5rem; }
.play-panel-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.play-panel-head .wordmark-mark { flex: 0 0 40px; }
.play-panel-head > div { min-width: 0; }
.play-panel .btn-row { flex-wrap: wrap; }
.play-panel .btn { max-width: 100%; white-space: normal; text-align: center; }
.play-requirements { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; font-size: .95rem; }
.req { display: inline-flex; align-items: center; gap: .5em; color: var(--muted); }
.req::before { content: ""; width: .6em; height: .6em; border-radius: 50%; background: var(--muted); flex: none; }
.req[data-ok="true"] { color: var(--text); } .req[data-ok="true"]::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.req[data-ok="false"] { color: var(--danger); } .req[data-ok="false"]::before { background: var(--danger); }
.play-fineprint { font-size: .85rem; margin: 14px 0 0; }
.play-mobile-notice { margin-bottom: 14px; font-size: .92rem; }
.play-shell progress { width: 100%; height: 12px; border: 0; border-radius: 999px; overflow: hidden; background: var(--bg-3); appearance: none; -webkit-appearance: none; }
.play-shell progress::-webkit-progress-bar { background: var(--bg-3); }
.play-shell progress::-webkit-progress-value { background: linear-gradient(90deg, var(--cyan-deep), var(--cyan)); transition: width .2s linear; }
.play-shell progress::-moz-progress-bar { background: linear-gradient(90deg, var(--cyan-deep), var(--cyan)); }
.play-shell progress:not([value]) { background: repeating-linear-gradient(90deg, var(--bg-3), var(--bg-3) 12px, var(--line-strong) 12px, var(--line-strong) 24px); }
.play-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; background: linear-gradient(180deg, rgba(4, 18, 28, .85), rgba(4, 18, 28, 0)); pointer-events: none; opacity: 1; transition: opacity .3s; }
.play-bar > * { pointer-events: auto; }
.play-stage[data-state="running"].play-bar-idle .play-bar { opacity: 0; }
.play-stage[data-state="running"].play-bar-idle:hover .play-bar, .play-stage[data-state="running"].play-bar-idle:focus-within .play-bar { opacity: 1; }
.play-status { display: inline-flex; align-items: center; gap: .5em; font-size: .85rem; color: var(--muted); background: rgba(4, 18, 28, .7); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }
.play-status .badge-dot { color: var(--muted); }
.play-status[data-state="online"] .badge-dot { color: var(--ok); }
.play-status[data-state="offline"] .badge-dot { color: var(--danger); }
.play-status[data-state="starting"] .badge-dot { color: var(--gold); }
.play-bar-actions { display: flex; align-items: center; gap: 6px; }
.play-focus-label { font-size: .8rem; color: var(--muted); }
.play-bar-btn { min-height: 44px; min-width: 44px; padding: .4em .8em; background: rgba(4, 18, 28, .7); border-color: var(--line); font-size: .85rem; }
.play-bar-btn svg { width: 18px; height: 18px; }
@media (max-width: 600px) { .play-bar-btn span, .play-focus-label { display: none; } .play-bar-btn { padding: .4em .6em; } .play-bar { padding-inline: max(8px, env(safe-area-inset-left)); } .play-status { min-width: 0; overflow-wrap: anywhere; } }
.play-under { margin: 14px 0 40px; font-size: .9rem; }
.play-under code, .play-panel code, #play-identity { overflow-wrap: anywhere; }
.play-under dl, .play-error-details dl { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 6px 16px; margin-block: 12px 0; }
.play-under dd, .play-error-details dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.play-error-details { margin-top: 18px; font-size: .9rem; }
.play-under summary, .play-error-details summary { cursor: pointer; min-height: 44px; padding-block: 8px; }
.play-shell, .play-stage, .play-panel { min-width: 0; max-width: 100%; }

/* Immersive: while the engine runs, the stage owns the whole viewport so the
   adaptive canvas policy of Godot sees the full window; no page scroll. */
body.play-immersive { overflow: hidden; }
body.play-immersive .site-header, body.play-immersive .site-footer, body.play-immersive .play-intro, body.play-immersive .play-under, body.play-immersive .offline-banner { display: none !important; }
body.play-immersive .play-stage { position: fixed; inset: 0; z-index: 50; border: 0; border-radius: 0; aspect-ratio: auto; min-height: 0; box-shadow: none; }
body.play-immersive .site-main { padding: 0; }
.play-stage:fullscreen { border: 0; border-radius: 0; }

@media (max-width: 640px) { .play-stage { aspect-ratio: auto; min-height: 560px; } .play-overlay { align-items: start; } }
@media (prefers-reduced-motion: reduce) { .play-shell progress::-webkit-progress-value, .play-bar { transition: none; } }
