:root{color-scheme:dark;font-family:Consolas,"Segoe UI",sans-serif;background:#101419;color:#e9e5d8}*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 20% 0,#263035,#101419 50%);min-height:100vh}.masthead{padding:28px max(26px,calc((100vw - 1420px)/2));display:flex;align-items:end;justify-content:space-between;gap:32px;border-bottom:1px solid #5a675c}.eyebrow,.panel-heading,.source-tag{font-size:11px;letter-spacing:.17em;text-transform:uppercase;color:#b0bd9c}.eyebrow{margin:0 0 8px}h1{font-size:clamp(28px,4vw,54px);line-height:1;margin:0;font-weight:900;letter-spacing:-.05em;text-transform:uppercase}h1 span{font-weight:400;color:#f0b749}.subtitle{max-width:690px;color:#b8c2b8;line-height:1.5;margin:12px 0 0}.source-tag{min-width:180px;text-align:right;line-height:1.7}.source-tag span{color:#f0b749;letter-spacing:.03em}main{max-width:1420px;margin:auto;display:grid;grid-template-columns:minmax(280px,370px) minmax(400px,1fr);gap:18px;padding:22px}.panel{background:#1b2226;border:1px solid #43524d;box-shadow:0 8px 30px #0004;padding:18px;min-width:0}.panel-heading{display:flex;justify-content:space-between;border-bottom:1px solid #46524b;padding-bottom:13px;margin-bottom:18px}.panel-heading strong{color:#f0b749;letter-spacing:.02em}.screen-frame{display:grid;place-items:center;background:#090c0e;min-height:0;border:10px solid #323d3b;box-shadow:inset 0 0 0 2px #798477}#screen{width:448px;max-width:100%;height:auto;aspect-ratio:224/256;image-rendering:pixelated;background:#171b1d}.stage-note,.notice,.evidence p{font-size:13px;line-height:1.5;color:#b6c0b7}.control-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px}.control-grid label,.map-controls label{display:flex;flex-direction:column;gap:8px;color:#b7c6bd;font-size:12px;text-transform:uppercase;letter-spacing:.1em}select,input[type=range],button{accent-color:#f0b749}select,button{font:inherit;background:#252f32;color:#f6ecd6;border:1px solid #647267;padding:10px}button{cursor:pointer}button:hover{background:#3b4946}.transport{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:24px 0}.transport span{margin-left:auto;color:#e8b955}.map-controls{display:flex;gap:18px;align-items:center;flex-wrap:wrap;border-top:1px solid #46524b;border-bottom:1px solid #46524b;padding:15px 0}.map-controls label:first-child{flex-direction:row;align-items:center}.notice{background:#273031;border-left:3px solid #e8b955;padding:10px 12px}h2{font-size:12px;text-transform:uppercase;letter-spacing:.12em;color:#e8b955;margin-top:22px}pre{background:#111719;border:1px solid #364844;max-height:350px;overflow:auto;padding:14px;color:#b9d3c4;font-size:12px;line-height:1.5}.evidence{grid-column:1/-1}.sheet-viewport{overflow:auto;background:#0b0d10;max-height:330px;display:grid;place-items:start}.sheet-viewport img{image-rendering:pixelated;max-width:none}.evidence a{color:#f0b749}#loading{position:fixed;bottom:15px;right:15px;padding:10px 14px;background:#f0b749;color:#111;font-weight:700}#loading[hidden]{display:none}@media(max-width:850px){.masthead{padding:22px;display:block}.source-tag{text-align:left;margin-top:18px}main{grid-template-columns:1fr;padding:12px}.screen-frame{min-height:0}.control-grid{grid-template-columns:1fr 1fr}}@media(max-width:500px){.control-grid{grid-template-columns:1fr}}
:root .control-hint{font-size:13px;color:#e8b955;line-height:1.4;margin:-10px 0 18px}
.recording-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:12px 0;font-size:12px}.recording-controls a{color:#f0b749}.recording-controls span{color:#b6c0b7}.recording-controls .recording-error{color:#ff8798}
.stage-actions{display:grid;gap:10px}.stage-actions label{display:flex;flex-direction:column;gap:7px;font-size:12px;color:#b7c6bd;text-transform:uppercase;letter-spacing:.1em}.stage-actions select{width:100%;min-width:0}.stage-action-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.stage-action-row button{white-space:nowrap}.stage-score{display:flex;flex-direction:column;gap:3px;min-width:76px;color:#b7c6bd;font-size:11px;text-transform:uppercase;letter-spacing:.1em}.stage-score b{color:#e8b955;font-size:16px;letter-spacing:.04em}
#reference-panel{margin-top:16px;text-align:center;border-top:1px solid #46524b;padding-top:10px}#reference-panel[hidden]{display:none}#reference-image{max-width:100%;height:auto;image-rendering:pixelated;border:1px solid #647267}#pixel-diff{color:#f0b749}
[hidden]{display:none!important}.mode-controls{margin-top:20px}.mode-controls h2{margin:0 0 14px}.mode-controls .notice{margin:18px 0 0}.mode-controls .map-controls{margin-top:22px}.transport{margin-top:18px}
.catalog{grid-column:1/-1}.catalog-controls{display:flex;gap:16px;flex-wrap:wrap;margin:18px 0}.catalog-controls label{display:flex;flex-direction:column;gap:6px;color:#b7c6bd;font-size:12px;text-transform:uppercase;letter-spacing:.1em}.catalog-controls input{min-width:260px;font:inherit;background:#252f32;color:#f6ecd6;border:1px solid #647267;padding:10px}.catalog-layout{display:grid;grid-template-columns:minmax(350px,2fr) minmax(280px,1fr);gap:18px}.catalog-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(128px,1fr));gap:8px;max-height:570px;overflow:auto;align-content:start}.catalog-card{display:flex;flex-direction:column;align-items:center;gap:5px;min-height:126px;text-align:center;padding:8px}.catalog-card[aria-pressed=true],.catalog-sample[aria-pressed=true]{border-color:#f0b749;background:#384442}.catalog-card strong{font-size:13px}.catalog-card small{font-size:10px;color:#b6c0b7;line-height:1.2}.catalog-thumbnail,.catalog-large-sprite{image-rendering:pixelated;border:1px solid #647267}.catalog-detail{background:#12191b;border:1px solid #364844;padding:16px;min-width:0}.catalog-detail h3{margin:0 0 7px;color:#f0b749}.catalog-facts{font-size:12px;line-height:1.5;color:#b6c0b7}.catalog-large-sprite{display:block;margin:16px auto;max-width:100%;height:auto}.catalog-samples{display:flex;flex-wrap:wrap;gap:6px}.catalog-sample{font-size:11px;padding:6px}.catalog-source{font-size:11px;max-height:220px}.catalog-detail .notice{font-size:12px}@media(max-width:850px){.catalog-layout{grid-template-columns:1fr}.catalog-list{max-height:380px}}
.diagnostic-toggle{display:flex;align-items:center;gap:8px;margin-top:16px;font-size:12px;line-height:1.4;color:#b7c6bd}
.catalog-visual-description{font-size:12px;line-height:1.45;color:#d8cda9;border-left:2px solid #f0b749;padding-left:9px}
.compound-toggles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:7px;margin:12px 0}.compound-toggle{display:flex;align-items:center;gap:7px;padding:8px;background:#1d2a2a;border:1px solid #485a54;color:#e9e5d8;font-size:11px;line-height:1.3}.compound-toggle input{accent-color:#f0b749}
.subtitle a{color:#f0b749}.behavior-lab{grid-column:1/-1;scroll-margin-top:18px}.behavior-lab .notice{margin-top:0}.behavior-controls{display:flex;gap:14px;flex-wrap:wrap;margin:14px 0}.behavior-controls label{display:flex;flex-direction:column;gap:6px;min-width:150px;flex:1;color:#b7c6bd;font-size:12px;text-transform:uppercase;letter-spacing:.08em}.behavior-controls input[type=number]{width:100%;font:inherit;background:#252f32;color:#f6ecd6;border:1px solid #647267;padding:9px}.behavior-controls .behavior-check{flex-direction:row;align-items:center;align-self:end;padding:10px 0;min-width:180px}.behavior-layout{display:grid;grid-template-columns:minmax(190px,240px) 1fr;gap:20px}.behavior-preview{display:flex;flex-direction:column;align-items:center;gap:8px;align-self:start;background:#111719;border:1px solid #364844;padding:16px;text-align:center}.behavior-preview canvas{max-width:100%;height:auto;image-rendering:pixelated;border:1px solid #647267}.behavior-preview strong{color:#f0b749}.behavior-preview span{font-size:12px;color:#b7c6bd;line-height:1.4}.behavior-transport{display:flex;gap:8px;flex-wrap:wrap;margin:16px 0}.behavior-result{min-height:2.5em;color:#f0b749;font-size:14px;line-height:1.5}.behavior-readout{display:grid;grid-template-columns:minmax(230px,1fr) minmax(230px,1fr);gap:12px}.behavior-readout h3{font-size:12px;color:#b7c6bd;text-transform:uppercase;letter-spacing:.08em}.behavior-readout pre{margin:0;max-height:220px}.behavior-readout ol{margin:0;padding:10px 10px 10px 30px;background:#111719;border:1px solid #364844;max-height:220px;min-height:120px;overflow:auto;font-size:12px;line-height:1.5;color:#b9d3c4}.behavior-readout li+li{margin-top:6px}@media(max-width:850px){.behavior-layout,.behavior-readout{grid-template-columns:1fr}}
.behavior-preview #behavior-scene{width:224px;aspect-ratio:224/256}.behavior-preview #behavior-shot-detail{display:flex;flex-direction:column;align-items:center;gap:6px;border-top:1px solid #364844;padding-top:10px}.behavior-preview #behavior-shot-sprite{width:96px}
.actor-focus{display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:14px;padding:12px;background:#111719;border:1px solid #364844}.actor-focus[hidden]{display:none}.actor-focus h2{margin:0}.actor-focus canvas{width:144px;height:144px;image-rendering:pixelated;border:1px solid #647267}.actor-focus p{margin:0;text-align:center}
.stage-pool-readout{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin:-8px 0 18px}.stage-pool-readout .pool-slot{min-width:0;padding:7px;background:#182123;border:1px solid #485a54;color:#b7c6bd;font-size:11px}.stage-pool-readout .pool-slot b{display:block;color:#e8b955;font-size:12px}.stage-pool-readout .pool-slot span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stage-pool-readout .pool-slot.occupied{background:#2c3935;border-color:#7f9b72}@media(max-width:500px){.stage-pool-readout{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* The dedicated play page reuses the stage engine but puts experiments elsewhere. */
.gameplay-layout{max-width:1830px;grid-template-columns:minmax(680px,1080px) minmax(340px,1fr);align-items:start}
.gameplay-layout .stage{grid-row:span 1}
.gameplay-stage-stack{display:grid;gap:18px;min-width:0}
.sound-map summary{display:flex;justify-content:space-between;gap:12px;cursor:pointer;color:#f0b749;font-weight:bold;font-size:14px}
.sound-map summary span{font-size:11px;font-weight:normal;color:#b6c0b7;text-align:right}
.sound-map canvas{display:block;width:100%;height:auto;border:1px solid #314248;cursor:crosshair}
.sound-map-legend{font-size:11px;line-height:1.7;color:#a8b9b4}.listener-key{color:#7cddd7}.point-key{color:#f0b749}.loop-key{color:#d396ff}
.sound-map label{display:grid;gap:7px;font-size:12px;color:#b7c6bd}.sound-map select{width:100%;min-width:0;padding:8px;font-size:12px}
.sound-map-info{white-space:pre-line;overflow-wrap:anywhere;font-size:12px;line-height:1.6;color:#d8e3db;background:#101a20;padding:10px;border-left:2px solid #f0b749;min-height:60px}
#audio-lab .sound-map{max-width:520px}
.gameplay-layout .screen-frame{padding:12px}
.gameplay-layout .screen-frame{position:relative}
.gameplay-layout .start-game-prompt{position:absolute;inset:0;z-index:6;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:20px;text-align:center;background:#090c0e9e;color:#f6ecd6}
.gameplay-layout .start-game-prompt[hidden]{display:none!important}
.gameplay-layout .start-game-prompt button{font-size:22px;font-weight:700;background:#e8b955;color:#111;border-color:#f6d889}
.gameplay-layout .start-game-prompt p{max-width:260px;margin:0;font-size:13px;line-height:1.45}
.screen-frame.compare{grid-template-columns:1fr 1fr;gap:8px}.screen-frame.compare>#screen,.screen-frame.compare>.screen-3d{width:100%!important}.compare-2d{display:flex;gap:8px;align-items:center;margin-top:8px;font-size:13px;color:#b6c0b7}.screen-3d{position:relative;width:448px;max-width:100%;aspect-ratio:224/256;background:#171b1d}.screen-3d[hidden]{display:none}.screen-3d canvas{position:absolute;inset:0;width:100%;height:100%;display:block}.screen-3d-overlay{image-rendering:pixelated;pointer-events:none}.view-3d-hint{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:6px;font-size:12px;color:#8f9a91}.view-3d-hint[hidden]{display:none}.screen-3d-world{touch-action:none}
.gameplay-layout .controls{align-self:stretch}
.gameplay-layout .gameplay-debug{grid-column:1/-1}
.gameplay-layout a{color:#f0b749}
.gameplay-presentation label{display:flex;flex-direction:column;gap:8px;color:#b7c6bd;font-size:12px;text-transform:uppercase;letter-spacing:.1em}
.gameplay-presentation select{width:100%}
.gameplay-debug summary{cursor:pointer;color:#f0b749;font-weight:700;letter-spacing:.06em}
.gameplay-debug .stage-pool-readout{margin:15px 0}
.gameplay-debug pre{max-height:480px}
@media(max-width:1100px){.gameplay-layout{grid-template-columns:1fr}}
@media(max-width:850px){.gameplay-layout{grid-template-columns:1fr}.gameplay-layout .gameplay-debug{grid-column:1}}

.semantic-inspector { margin: 1rem 0; max-width: 100%; overflow: auto; }
.semantic-inspector summary { cursor: pointer; color: var(--accent, #f4d35e); }
.semantic-inspector table { border-collapse: collapse; font-size: .75rem; width: 100%; table-layout: fixed; }
.semantic-inspector #semantic-objects { max-height: 28rem; overflow: auto; }
.semantic-inspector th, .semantic-inspector td { text-align: left; vertical-align: top; padding: .5rem; border: 1px solid #456; white-space: pre-line; overflow-wrap: anywhere; }

.audio-controls { display:flex; flex-wrap:wrap; gap:.65rem; align-items:center; padding:1rem 0; }
.audio-controls h2,.audio-controls p { flex-basis:100%; margin:.25rem 0; }
.audio-controls label { display:inline-flex; align-items:center; gap:.4rem; flex-wrap:wrap; }
.audio-controls input[type="range"] { max-width:8rem; }
.audio-controls input[type="file"] { max-width:16rem; }

.audio-song-controls { display:flex; flex-wrap:wrap; gap:.75rem; }
.audio-song-controls[hidden] { display:none; }

/* Standalone sound library. */
.sound-nav { display:flex; gap:1.4rem; margin-top:1rem; }
.sound-nav a,.sound-page a { color:#f0b749; }
.sound-layout { max-width:1290px; grid-template-columns:minmax(0,1.35fr) minmax(340px,1fr); align-items:start; }
.sound-platforms { display:grid; grid-template-columns:1fr 1fr; gap:.7rem; }
.sound-platforms button { display:flex; flex-direction:column; gap:.4rem; text-align:left; font-size:1rem; }
.sound-platforms small { color:#b7c6bd; font-size:.7rem; font-weight:normal; }
.sound-platforms [aria-pressed=true] { border-color:#f0b749; background:#35443e; }
.sound-filters { display:flex; gap:1rem; margin:1.4rem 0 .8rem; }
.sound-filters label { display:flex; flex-direction:column; gap:.5rem; color:#b7c6bd; font-size:.75rem; }
.sound-filters label:first-child { flex:1; min-width:0; }
.sound-filters input { width:100%; min-width:0; font:inherit; padding:.8rem; border:1px solid #647267; background:#252f32; color:#f6ecd6; }
.sound-count { font-size:.75rem; color:#b7c6bd; }
.sound-list { display:grid; gap:.5rem; max-height:66vh; overflow:auto; padding-right:.3rem; }
.sound-row { display:grid; grid-template-columns:3.7rem minmax(0,1fr) 3.5rem 3.4rem; gap:.7rem; align-items:center; text-align:left; width:100%; padding:1rem .85rem; }
.sound-row strong { font-size:.85rem; line-height:1.4; }
.sound-row small { color:#b7c6bd; font-size:.65rem; }
.sound-code { color:#b7c6bd; font-size:.75rem; }
.sound-play-symbol { color:#f0b749; font-size:.7rem; text-align:right; }
.sound-row[aria-pressed=true] { border-color:#f0b749; background:#35443e; }
.sound-player { position:sticky; top:1rem; }
.sound-player h2 { font-size:1.5rem; line-height:1.4; text-transform:none; letter-spacing:normal; color:#f6ecd6; }
#current-details { color:#f0b749; font-size:.75rem; line-height:1.6; }
.sound-time { display:flex; justify-content:space-between; align-items:center; border-top:1px solid #46524b; border-bottom:1px solid #46524b; padding:1rem 0; margin:1.5rem 0; color:#b7c6bd; }
#sound-clock { font-size:1.6rem; color:#f6ecd6; font-variant-numeric:tabular-nums; }
.sound-transport { display:flex; flex-wrap:wrap; gap:.6rem; }
.sound-transport button:disabled,.sound-row:disabled { opacity:.5; cursor:default; }
#sound-status { min-height:3em; color:#b7c6bd; font-size:.8rem; line-height:1.5; }
.sound-notes { border-top:1px solid #46524b; padding-top:1rem; font-size:.75rem; line-height:1.6; color:#b7c6bd; }
.sound-notes summary { color:#f0b749; cursor:pointer; }
@media(max-width:850px) { .sound-layout { grid-template-columns:1fr; } .sound-player { position:static; } .sound-list { max-height:52vh; } }
@media(max-width:500px) { .sound-row { grid-template-columns:3rem minmax(0,1fr) 3rem; gap:.4rem; } .sound-row small { display:none; } }

.sound-player .audio-controls > h2 { font-size:.85rem; text-transform:uppercase; letter-spacing:.1em; }
.sound-schedule { display:flex; gap:1rem; flex-wrap:wrap; }
.sound-schedule label { display:grid; gap:.4rem; font-size:.8rem; color:#b7c6bd; }
.sound-schedule input { width:7rem; padding:.5rem; background:#252f32; color:#f6ecd6; border:1px solid #647267; }
.sound-active { margin:1rem 0; border-top:1px solid #46524b; padding-top:1rem; }
.sound-active h3 { font-size:1rem; }
#sound-active-count { display:inline-block; margin-left:.4rem; color:#f0b749; }
#sound-active-empty { font-size:.8rem; color:#b7c6bd; }
.sound-instance { display:grid; grid-template-columns:1fr auto; gap:.35rem .6rem; padding:.7rem 0; border-bottom:1px solid #46524b; }
.sound-instance strong { font-size:.8rem; }
.sound-instance span { font-size:.75rem; color:#b7c6bd; grid-column:1; }
.sound-instance button { grid-column:2; grid-row:1 / 3; padding:.5rem; }
