:root{color-scheme:dark;--bg:#09121c;--panel:#101e2c;--line:#2a3b49;--text:#eff4f6;--muted:#a4b6c5;--mint:#79efc3;--yellow:#f8d77b;--purple:#bdabff;--red:#ff9f9a;font-family:Inter,Segoe UI,Arial,sans-serif;font-size:16px}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 65% 0,#172b38 0,transparent 50%),var(--bg);color:var(--text)}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;color:inherit;cursor:pointer;background:#172736;border:1px solid var(--line);border-radius:7px;padding:9px 13px;transition:background .15s,border-color .15s,transform .15s}button:hover{background:#263b4c;border-color:#7e9aab}button:active{transform:translateY(1px)}button:disabled{opacity:.4;cursor:default}button:focus-visible,a:focus-visible,#board:focus-visible{outline:3px solid var(--yellow);outline-offset:4px}button.primary{background:var(--mint);color:#0b2420;border-color:var(--mint);font-weight:750}.masthead{max-width:1400px;margin:auto;padding:26px 40px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid var(--line);gap:20px}.brand{display:flex;gap:13px;align-items:center;color:var(--text);text-decoration:none;font-size:19px;letter-spacing:1.5px}.brand b{font-weight:800}.brand small{display:block;color:var(--muted);font-size:10px;letter-spacing:2px;margin-top:6px}.brand-icon{font-size:30px;color:var(--mint);border:2px solid var(--mint);width:44px;height:44px;display:grid;place-items:center;border-radius:50%;font-weight:800}.header-actions{display:flex;align-items:center;gap:10px}.header-actions button{font-size:14px}.edition{font-size:11px;letter-spacing:1px;color:var(--muted);margin-right:15px}main{max-width:1320px;margin:auto;padding:26px 30px}#levels{display:flex;gap:10px}#levels button{display:flex;align-items:center;gap:10px;background:transparent;color:var(--muted);font-size:14px;flex:1;text-align:left;padding:11px 14px}#levels button.active{background:#1a3637;border-color:var(--mint);color:var(--mint)}#levels .number{font-family:monospace;opacity:.8}#levels .check{margin-left:auto;color:var(--mint)}.room-head{display:flex;justify-content:space-between;gap:30px;align-items:center;padding:30px 0 25px}.eyebrow,.section-label{font-size:11px;letter-spacing:1.5px;font-weight:650;color:var(--muted)}.eyebrow{color:var(--mint)}h1{font-size:clamp(26px,3vw,40px);letter-spacing:-1.2px;margin:8px 0 10px}p{line-height:1.55;margin:0;color:var(--muted)}.room-head p{max-width:690px}.goal{border-left:2px solid var(--yellow);padding:7px 0 7px 18px;min-width:230px;max-width:310px}.goal .eyebrow{color:var(--yellow)}.goal strong{display:block;margin:8px 0;font-size:19px}.goal>span:last-child{font-size:14px;color:var(--muted)}.workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:20px;align-items:start}.play-panel{background:#0e1b27;border:1px solid var(--line);border-radius:12px;overflow:hidden}.board-top{padding:16px 20px;display:flex;justify-content:space-between;font-size:11px;letter-spacing:1.3px;color:var(--muted);border-bottom:1px solid var(--line)}.live-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--mint);margin-right:8px}#board{position:relative;display:grid;grid-template-columns:repeat(11,minmax(0,1fr));gap:3px;padding:20px;aspect-ratio:11/7;min-height:280px;background-image:radial-gradient(#39526655 1px,transparent 1px);background-size:18px 18px;isolation:isolate}.tile{position:relative;min-width:0;padding:0;border:1px solid #2a4050;border-radius:4px;display:grid;place-items:center;background:#1a2c3b;aspect-ratio:1;box-shadow:inset 0 -3px #101f2c;z-index:1}.tile:hover{background:#294153}.tile.wall{border-color:transparent;background:#0d1923;box-shadow:none;cursor:default;opacity:.55}.tile.wall:after{content:'';width:28%;height:28%;border:1px solid #243747;transform:rotate(45deg)}.tile.start{border-style:dashed;border-color:#648092}.tile.exit{border:2px solid var(--yellow);background:#413921;color:var(--yellow)}.exit-mark{font-size:25px;font-weight:700}.station{border:2px solid var(--purple);background:#312c4e;color:var(--purple)}.station.scanner{border-color:var(--mint);background:#173d38;color:var(--mint)}.station.selected{outline:2px solid var(--yellow);outline-offset:2px;z-index:2}.station-symbol{font-size:clamp(15px,2.2vw,29px);font-weight:750}.station-tag{position:absolute;top:3px;left:4px;font-size:9px;letter-spacing:.8px}.tile.visited:before{content:'';position:absolute;bottom:5px;right:5px;width:5px;height:5px;border-radius:50%;background:var(--mint)}.courier{position:absolute;width:61%;height:61%;background:#f0f8fc;border-radius:38%;border:3px solid #f0f8fc;box-shadow:0 0 0 3px #08161d,0 0 23px #8aedff55;z-index:3;display:grid;place-items:center;animation:arrive .16s ease-out;pointer-events:none}.courier:before{content:'';background:#152c3d;border-radius:2px;width:65%;height:28%;position:absolute;top:25%}.courier:after{content:'◆';color:var(--mint);font-size:15px;position:absolute;bottom:-9px;right:-9px;text-shadow:0 0 8px #0c3128;-webkit-text-stroke:1px #18342d}.tile:has(.courier) .station-symbol,.tile:has(.courier) .exit-mark{opacity:.25}@keyframes arrive{from{transform:scale(.82)}to{transform:scale(1)}}.map-legend{display:flex;flex-wrap:wrap;gap:18px;padding:0 20px 17px;color:var(--muted);font-size:12px}.map-legend span{display:flex;align-items:center;gap:7px}.map-legend i{width:10px;height:10px;border-radius:2px;border:1px solid}.legend-player{background:#eff4f6}.legend-scan{color:var(--mint)}.legend-gate{color:var(--purple)}.legend-exit{color:var(--yellow)}.toolbar{display:flex;align-items:center;justify-content:space-between;border-top:1px solid var(--line);padding:13px 16px;gap:10px}.toolbar>div{display:flex;gap:8px}.toolbar button{font-size:13px;padding:8px 10px}.keyboard-hint{font-size:11px;color:var(--muted)}kbd{font:inherit;border:1px solid #496170;border-radius:3px;padding:1px 4px;color:var(--muted);margin-left:3px}.message{min-height:95px;padding:19px 20px;background:#142932;border-top:1px solid #2b4952;font-size:15px;line-height:1.55;display:flex;align-items:center;gap:18px}.message strong{color:var(--mint)}.message.win{background:#17362f}.message.warn strong{color:var(--yellow)}.message button{flex-shrink:0}.instrument{background:var(--panel);border:1px solid var(--line);border-radius:10px;padding:18px;margin-bottom:14px}.section-label{margin-bottom:15px}.key-heading{display:flex;align-items:center;gap:13px;margin-bottom:17px}.key-heading strong{font-size:18px}.key-heading small{font-size:12px;color:var(--muted);display:block;margin-top:5px}.key-orbit{width:46px;height:46px;flex-shrink:0;border-radius:50%;border:1px solid #5a9f9f;display:grid;place-items:center;background:#203839}.key-orbit span{font-size:25px;color:var(--mint);font-style:italic}.small{font-size:13px}.micro{font-size:11px;margin-top:11px;line-height:1.6}.prob-row{margin-top:12px}.prob-label{display:flex;justify-content:space-between;font-size:12px;margin-bottom:6px}.prob-track{display:flex;border-radius:3px;overflow:hidden;background:#2e253f;height:7px}.prob-track span{background:var(--mint);height:100%;transition:width .2s}.prob-row:nth-child(2) .prob-track span{background:var(--purple)}.prob-values{display:flex;justify-content:space-between;font-size:11px;color:var(--muted);margin-top:5px}.phase{display:flex;justify-content:space-between;font-size:12px;border-top:1px solid var(--line);margin-top:14px;padding-top:12px}.phase strong{color:var(--purple)}#equipment{display:flex;gap:7px;margin:12px 0}#equipment button{padding:7px 10px;font-size:13px}#equipment button.selected{border-color:var(--yellow);color:var(--yellow)}#station-detail{font-size:13px;line-height:1.5;color:var(--muted)}#station-detail strong{color:var(--text)}.mode-buttons{display:flex;gap:7px;margin-top:10px}.mode-buttons button{flex:1;font-size:13px}.mode-buttons .chosen{border-color:var(--mint);color:var(--mint);background:#1a3637}.log-panel ol{margin:0;padding-left:17px;color:var(--muted);font-size:12px;line-height:1.55}.log-panel li{padding-bottom:9px}.log-panel li:first-child{color:var(--text)}footer{display:flex;justify-content:space-between;align-items:center;padding:20px 0;color:var(--muted);font-size:10px;letter-spacing:1.4px}footer button{font-size:12px;background:transparent}.touch-controls{display:none;text-align:center;padding:10px}.touch-controls button{min-width:48px;min-height:42px;margin:3px}dialog{background:#122433;color:var(--text);border:1px solid #557081;border-radius:14px;max-width:570px;width:calc(100% - 32px);padding:30px;box-shadow:0 24px 120px #000}dialog::backdrop{background:#030a12bb;backdrop-filter:blur(5px)}dialog h2{font-size:27px;margin-top:0;letter-spacing:-.5px}dialog p,dialog li{font-size:15px;line-height:1.7;margin-bottom:15px}dialog strong{color:var(--mint)}dialog button{margin-top:10px}dialog code{font-size:13px;color:var(--yellow)}@media(min-width:1500px){#board{max-height:535px}}@media(max-width:1050px){.edition,.keyboard-hint{display:none}.workspace{grid-template-columns:minmax(0,1fr) 280px}.masthead{padding:22px 25px}main{padding:22px}#levels button{font-size:12px;padding:10px}.goal{min-width:200px}.station-tag{font-size:8px}.touch-controls{display:block}}@media(max-width:760px){.masthead{padding:18px;gap:10px}.brand{font-size:14px;letter-spacing:1px}.brand-icon{width:33px;height:33px;font-size:23px}.brand small{font-size:8px}.header-actions button{font-size:12px;padding:7px}.header-actions{gap:5px}main{padding:18px 12px}.workspace{grid-template-columns:1fr}.room-head{align-items:start;gap:14px;padding:22px 4px;flex-direction:column}.goal{border-left:2px solid var(--yellow);max-width:none;padding:4px 0 4px 14px}.goal strong{display:inline;font-size:16px;margin-left:10px}.goal>span:last-child{display:block;margin-top:7px;font-size:13px}.room-head p{font-size:14px}#levels{gap:5px}#levels button{flex-direction:column;gap:5px;text-align:center;padding:8px 4px;font-size:11px}#levels .check{display:none}#board{padding:10px;min-height:0;gap:2px}.station-symbol{font-size:20px}.station-tag{top:1px;left:2px;font-size:7px}.map-legend{gap:11px;padding:8px 12px 12px;font-size:10px}.message{font-size:14px;flex-wrap:wrap}.instrument{margin-bottom:12px}aside{display:grid;grid-template-columns:1fr 1fr;gap:12px}aside .instrument{margin:0;padding:14px}.log-panel{grid-column:1/-1}.section-label{font-size:10px}.key-heading{gap:8px}.key-heading strong{font-size:15px}.key-orbit{width:35px;height:35px}.small{font-size:12px}.micro{font-size:10px}footer{gap:14px;font-size:9px}footer button{font-size:11px}.courier{border-width:2px}.courier:after{font-size:11px;bottom:-6px;right:-6px}}@media(max-width:390px){aside{grid-template-columns:1fr}.log-panel{grid-column:auto}.header-actions{flex-direction:column}.brand small{letter-spacing:1px}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
#visual-replay{padding:20px;border-top:1px solid var(--line);background:#0d202d}.replay-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.replay-heading>strong{font-size:18px}.replay-heading>span{font-size:11px;letter-spacing:1px;color:var(--muted)}.replay-heading button{font-size:13px}.replay-empty{font-size:14px}.replay-flow{display:grid;grid-template-columns:minmax(0,1fr) 76px minmax(0,1fr);align-items:center;gap:10px}.replay-state{background:#142b39;border:1px solid #375466;border-radius:8px;padding:14px}.replay-label{display:block;font-size:11px;color:var(--muted);letter-spacing:1px;margin-bottom:7px}.replay-state>strong{font-size:20px;color:var(--mint)}.amplitudes{margin:15px 0}.amplitude-row{display:grid;grid-template-columns:34px minmax(20px,1fr) 35px;gap:5px;align-items:center;font-size:11px;margin:10px 0}.amplitude-row>b{font-variant-numeric:tabular-nums;font-size:11px;text-align:right}.amplitude-track{height:15px;position:relative;background:#091b27;border-radius:3px}.amplitude-track:after{content:'';position:absolute;height:21px;top:-3px;left:50%;border-left:1px solid #b9cbd5}.amplitude-track i{position:absolute;top:2px;height:11px;background:var(--mint);border-radius:2px}.amplitude-track i.negative{background:var(--purple)}.replay-probs{display:grid;gap:7px;font-size:11px;color:var(--muted)}.replay-probs>span{display:flex;justify-content:space-between;gap:6px}.replay-probs b{color:var(--text);font-weight:500}.replay-operation{display:flex;flex-direction:column;align-items:center;gap:7px;font-size:10px;color:var(--muted)}.replay-operation>strong{display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--purple);color:var(--purple);border-radius:8px;font-size:25px}.replay-arrow{font-size:24px;color:var(--mint)}.outcome-title{font-size:12px;color:var(--muted);margin-top:16px}.replay-outcomes{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:8px}.replay-outcome{border:1px dashed #516170;border-radius:6px;padding:10px;display:grid;grid-template-columns:1fr auto;gap:6px;color:var(--muted);font-size:13px}.replay-outcome small{grid-column:1/-1;font-size:11px}.replay-outcome.observed{border:1px solid var(--mint);background:#193c37;color:var(--mint)}.replay-explanation{font-size:14px;margin-top:16px;color:var(--text)}.replay-footnote{font-size:11px;margin-top:10px}.animate-replay .replay-state:first-child{animation:reveal-step .5s both}.animate-replay .replay-operation{animation:reveal-step .5s .45s both}.animate-replay .replay-state:last-child{animation:reveal-step .6s .95s both}@keyframes reveal-step{from{opacity:.15;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}@media(max-width:760px){#visual-replay{padding:14px}.replay-flow{gap:6px;grid-template-columns:minmax(0,1fr) 44px minmax(0,1fr)}.replay-state{padding:9px}.replay-state>strong{font-size:17px}.replay-operation>strong{width:34px;height:34px;font-size:20px}.amplitude-row{grid-template-columns:28px minmax(12px,1fr) 30px;gap:2px;font-size:10px}.amplitude-row>b{font-size:10px}.replay-probs{font-size:10px}.replay-operation{font-size:8px}}@media(prefers-reduced-motion:reduce){.animate-replay *{animation:none!important}}
.campaign-nav{display:flex;align-items:center;flex-wrap:wrap;gap:14px;margin-bottom:18px}.mode-switch{display:flex;gap:6px}.mode-switch button{font-size:14px}.mode-switch button[aria-pressed=true]{background:#1a3637;border-color:var(--mint);color:var(--mint)}#chapter-control{font-size:12px;color:var(--muted);display:flex;align-items:center;gap:8px}#chapter-control[hidden]{display:none}#chapter{font:inherit;font-size:13px;max-width:100%;background:var(--panel);border:1px solid var(--line);border-radius:6px;color:var(--text);padding:10px}#campaign-progress{font-size:12px;color:var(--mint);margin-left:auto}.tile.station.hazard{border-color:var(--red);background:#49272c;color:var(--red)}#equipment{flex-wrap:wrap}#levels button{min-width:0;line-height:1.4}#levels .number{flex-shrink:0}@media(max-width:760px){.campaign-nav{gap:10px}.mode-switch{width:100%}.mode-switch button{flex:1;font-size:13px}#chapter-control{max-width:100%}#chapter{min-width:0}#campaign-progress{margin-left:0}#levels{overflow-x:auto;padding:3px 2px 7px}#levels button{flex:0 0 115px;font-size:12px}.room-head .eyebrow{font-size:10px;line-height:1.7}}
#tutorial-guide{padding:18px 20px;background:#183634;border-bottom:1px solid #38695c}#tutorial-guide[hidden]{display:none}#tutorial-guide p{color:var(--text);font-size:16px;margin:9px 0;line-height:1.6}#tutorial-guide small{color:var(--muted);font-size:12px}.welcome-grid{display:grid;grid-template-columns:1fr;gap:8px}dialog{max-height:88vh;overflow:auto}dialog h3{font-size:17px;margin:18px 0 10px}dialog li{margin-bottom:9px}dialog ol,dialog ul{padding-left:22px}dialog .welcome-grid p{margin-bottom:10px}dialog:has(.welcome-grid){max-width:720px}dialog:has(.welcome-grid)>button{position:static;display:block;margin:22px 0 0 auto;box-shadow:none}@media(min-width:680px){.welcome-grid{grid-template-columns:1fr 1fr;gap:25px}}
.welcome-key{display:flex;align-items:center;gap:16px;padding:16px;margin:16px 0 20px;background:#193b36;border:1px solid #4b9b84;border-radius:9px}.key-token{display:grid;place-items:center;flex-shrink:0;width:54px;height:54px;border-radius:10px;background:#0c2724;border:1px solid var(--mint);color:var(--mint);font-size:37px;text-shadow:0 0 15px #79efc355}.welcome-key strong{display:block;font-size:17px}.welcome-key div>span{display:block;font-size:13px;line-height:1.5;color:var(--muted);margin-top:5px}.courier:after{font-size:20px;bottom:-10px;right:-11px;line-height:1;background:#0c2724;border:1px solid var(--mint);border-radius:4px;padding:1px;text-shadow:none;-webkit-text-stroke:0}@media(max-width:760px){.courier:after{font-size:13px;bottom:-7px;right:-8px;padding:0}.welcome-key{padding:12px;gap:12px}}
.courier:not(.carrying):after{display:none}.floor-key{font-size:clamp(18px,3vw,32px);color:var(--mint);text-shadow:0 0 15px #79efc388;line-height:1}
/* Quantum lab theme: light surfaces, clear hierarchy and colour-coded operations. */
:root{color-scheme:light;--bg:#fff;--panel:#f5f7fa;--line:#dce2eb;--text:#20242c;--muted:#5b6473;--mint:#137553;--yellow:#916200;--purple:#6941c6;--red:#b63344;font-family:'Segoe UI Variable', 'Segoe UI',Arial,sans-serif}
body{background:#fff;color:var(--text)}button{background:#fff;border-color:#d5dce6;border-radius:24px;color:var(--text);padding:10px 17px;font-weight:550;box-shadow:none}button:hover{background:#edf2fc;border-color:#9eb6e9}button.primary{background:#185bdf;color:#fff;border-color:#185bdf;padding:12px 24px}button.primary:hover{background:#1248b5}button:focus-visible,a:focus-visible,#board:focus-visible{outline:3px solid #2165db;outline-offset:3px}button:disabled{opacity:.45}.masthead{max-width:none;padding:18px max(28px,calc((100vw - 1280px)/2));border-bottom:1px solid #edf0f5;background:#fff;gap:18px}.brand{color:#242a35;font-size:20px;letter-spacing:-.7px;text-transform:none}.brand b{font-weight:650}.brand small{letter-spacing:1.7px;font-size:9px;color:#58657e}.brand-icon{border:0;background:#e8efff;color:#185bdf;font-family:Georgia,serif;font-size:34px;font-weight:500;width:45px;height:45px;box-shadow:inset 0 0 0 1px #d7e3ff}.edition{color:#626d7f;letter-spacing:.8px}.header-actions #help{background:#185bdf;border-color:#185bdf;color:#fff}.header-actions #sound{background:transparent;border-color:transparent}main{max-width:1340px;padding:24px 30px}.campaign-nav{gap:16px;margin-bottom:18px}.mode-switch{background:#f0f3f8;border-radius:30px;padding:4px}.mode-switch button{border-color:transparent;background:transparent;font-size:14px}.mode-switch button[aria-pressed=true]{background:#fff;border-color:#dce5f5;color:#164ab7;box-shadow:0 2px 7px #2439610c}#chapter{border-radius:22px;background:#fff;font-size:13px;padding:10px 14px}#campaign-progress{background:#e9f5ef;color:#166447;border-radius:24px;padding:10px 16px;font-weight:600}#levels{gap:9px}#levels button{background:#f5f7fa;border:1px solid transparent;border-radius:15px;padding:12px 14px;color:#525f73;line-height:1.35}#levels button.active{background:#e9f0ff;border-color:#bbcef7;color:#164db7}#levels .number{font-family:inherit;display:grid;place-items:center;min-width:28px;height:28px;border-radius:50%;background:#fff;font-size:12px;font-weight:700;opacity:1}#levels .check{color:#137553}.room-head{background:#eef3ff;border:1px solid #e2eafb;border-radius:25px;margin:22px 0;padding:25px 28px;gap:32px}.room-head h1{font-size:clamp(28px,3.3vw,43px);font-weight:650;letter-spacing:-1.6px;margin:8px 0 10px;line-height:1.1}.room-head p{color:#536079;font-size:15px;max-width:690px}.eyebrow{color:#2859aa;font-size:11px;letter-spacing:1.25px}.goal{border-left:0;border-radius:18px;background:#fff;padding:17px 20px;min-width:230px;box-shadow:0 3px 15px #1d437008}.goal .eyebrow{color:#6a5a2b}.goal strong{font-size:19px;font-weight:650;margin:9px 0;color:#313945}.goal>span:last-child{color:#697280;font-size:13px;line-height:1.5;display:block}.workspace{gap:22px;grid-template-columns:minmax(0,1fr) 320px}.play-panel{background:#f8fafc;border:1px solid #e0e5ed;border-radius:26px;box-shadow:0 5px 22px #20395c06}#tutorial-guide{background:#eaf5f0;border-color:#d4e7dd;padding:17px 22px}#tutorial-guide .eyebrow{color:#1c6b50}#tutorial-guide p{font-size:15px;color:#204a3c;line-height:1.5;margin:8px 0}#tutorial-guide small{color:#55776a;font-size:12px}.board-top{padding:14px 22px;color:#62728a;border-color:#e2e8f0;font-size:11px;background:#f8fafc}.live-dot{background:#1a9a6c}#board{background-color:#f8fafc;background-image:radial-gradient(#cbd6e4 1px,transparent 1px);background-size:19px 19px;padding:18px;gap:5px}.tile{background:#e5ebf5;border:1px solid #c8d4e5;border-radius:9px;box-shadow:inset 0 -3px #cdd8e8;color:#374861}.tile:hover{background:#d7e3fa;border-color:#8eace1}.tile.wall{background:transparent;border:0;opacity:1;box-shadow:none}.tile.wall:after{display:none}.tile.start{background:#f0f4fa;border:1px dashed #8b9eb9;box-shadow:none}.tile.exit{border:2px solid #bd9023;background:#fff1c5;color:#805b00;box-shadow:inset 0 -4px #f3d97f}.tile.station{border:2px solid #9c7dd8;background:#eee5ff;color:#6433b1;box-shadow:inset 0 -4px #d1bfee}.tile.station.scanner{border-color:#52a684;background:#dcf4e8;color:#12633f;box-shadow:inset 0 -4px #a8dbc1}.tile.station.hazard{border-color:#d66d76;background:#ffe0e4;color:#ad2639;box-shadow:inset 0 -4px #efb3ba}.tile.station.selected{outline:2px solid #2865d9;outline-offset:3px}.station-tag{color:inherit;font-size:10px;font-weight:650;left:5px;top:3px}.station-symbol{font-weight:650}.tile.visited:before{background:#136443}.courier{background:#fff;border:3px solid #fff;box-shadow:0 0 0 2px #607187,0 5px 10px #15305630;border-radius:34%}.courier:before{background:#284c72}.courier.carrying:after{background:#fff;color:#12805b;border-color:#268568;border-radius:5px;box-shadow:0 2px 4px #15305622}.floor-key{color:#13875d;text-shadow:0 0 12px #51c59b66}.map-legend{padding:4px 22px 18px;color:#5d6c80;font-size:12px}.legend-player{background:#fff;color:#607187}.legend-scan{color:#208759;background:#dcf4e8}.legend-gate{color:#8453cb;background:#eee5ff}.legend-exit{color:#b2820a;background:#fff1c5}.toolbar{border-color:#dce4ee;padding:13px 17px;background:#fff}.toolbar button{font-size:13px;padding:8px 15px}kbd{background:#f3f5f9;border-color:#d4dce7;color:#5b6b81;font-size:10px;border-radius:4px}.keyboard-hint{color:#6c7789}.message{background:#edf2fc;border-color:#dae3f5;color:#435575;font-size:14px;padding:19px 22px;min-height:90px}.message strong{color:#2555aa}.message.win{background:#e5f4ea;color:#235e42}.message.win strong{color:#16603d}.message.warn{background:#fff4da;color:#755716}.message.warn strong{color:#805700}.instrument{background:#f4f6fa;border:0;border-radius:23px;padding:21px;margin-bottom:16px}.section-label{color:#68778d;font-size:11px;font-weight:650;letter-spacing:1px}.key-heading{gap:13px;margin-bottom:18px}.key-heading strong{font-size:20px;font-weight:650;color:#25334b}.key-heading small{font-size:12px;color:#5c6b81;line-height:1.5}.key-orbit{width:95px;height:95px;border:0;background:transparent;flex-shrink:0;display:block}.key-orbit svg{width:100%;height:100%;overflow:visible}.small{font-size:14px}.micro{font-size:12px;color:#69778a}.prob-label{font-size:13px}.prob-track{height:8px;background:#dedbea;border-radius:10px}.prob-track span{background:#25875f}.prob-row:nth-child(2) .prob-track span{background:#8254c4}.prob-values{font-size:12px;color:#5d6b80;margin-top:7px}.phase{font-size:13px;border-color:#dbe1ea;padding-top:15px}.phase strong{color:#7043ad}#equipment{gap:7px}#equipment button{font-size:14px;border-radius:12px;padding:9px 13px;background:#fff}#equipment button.selected{background:#e4edff;border-color:#92afe7;color:#2357af}#station-detail{font-size:14px;color:#5b6880}.mode-buttons button{background:#fff;padding:10px 12px}.mode-buttons .chosen{background:#e5efff;border-color:#91afe4;color:#2158b4}#relocate{border-color:#cbd6e7!important;background:#fff;font-size:13px!important}#log{font-size:13px;color:#677389;line-height:1.65}#log li:first-child{color:#354663}.touch-controls{background:#fff}.touch-controls button{background:#eaf0fc;border-color:#c4d3ed;border-radius:14px;color:#2857a4}#visual-replay{background:#fff;border-color:#e0e6ef;padding:23px}.replay-heading>strong{font-size:21px;font-weight:650;letter-spacing:-.5px}.replay-state{background:#f1f5fd;border:1px solid #dce5f5;border-radius:18px;padding:17px}.replay-label{color:#697c98}.replay-state>strong{color:#2553a3}.amplitude-track{background:#e0e6f0}.amplitude-track:after{border-color:#7b8ca5}.amplitude-track i{background:#27956a}.amplitude-track i.negative{background:#8453c3}.replay-operation>strong{background:#eee5ff;border-color:#b89bdf;color:#7144b0;border-radius:13px}.replay-operation{color:#647089}.replay-arrow{color:#6c86ad}.replay-probs{color:#61738b}.replay-probs b{color:#2d466c}.replay-outcome{border-color:#bbc9dc;color:#64718a;background:#f7f9fc;border-radius:12px}.replay-outcome.observed{border-color:#6eaf91;background:#e7f5ed;color:#206443}.replay-explanation{color:#3c4d67}.replay-footnote{color:#68778e;font-size:12px}.replay-empty{color:#617189}.replay-heading>span{color:#63738a}footer{color:#748196;padding:24px 3px;font-size:10px}footer button{border-color:#d6dfeb;color:#4c638a;border-radius:22px}dialog{background:#fff;color:#273348;border:1px solid #dee5ef;border-radius:27px;padding:32px;box-shadow:0 24px 100px #233e5e30}dialog::backdrop{background:#1b304e60;backdrop-filter:blur(8px)}dialog h2{font-size:32px;line-height:1.15;font-weight:650;letter-spacing:-1px;margin:10px 0 20px}dialog h3{color:#2d3d57;font-weight:650}dialog p,dialog li{color:#58667b;font-size:15px}dialog strong{color:#2059ad}dialog code{color:#7045ad}dialog:has(.welcome-grid)>button{position:static;margin:24px 0 0 auto;box-shadow:none}.welcome-key{background:#eef6f2;border:1px solid #d5e8df;border-radius:18px}.welcome-key strong{color:#26674f}.welcome-key div>span{color:#5d7a6c}.key-token{background:#fff;border-color:#a1cdb7;color:#207d55;text-shadow:none;border-radius:15px}.welcome-grid{gap:24px}.welcome-grid section{background:#f3f6fb;border-radius:18px;padding:2px 17px 8px}.welcome-grid section h3{font-size:16px}#modal:focus{outline:none}
@media(max-width:1050px){.masthead{padding:17px 24px}.workspace{grid-template-columns:minmax(0,1fr) 280px}.key-orbit{width:72px;height:72px}.key-heading strong{font-size:18px}.instrument{padding:17px}.room-head{padding:22px}.goal{min-width:190px;padding:15px}.keyboard-hint{display:none}}
@media(max-width:760px){.masthead{padding:14px 16px}.brand{font-size:16px;letter-spacing:-.5px}.brand-icon{width:36px;height:36px;font-size:28px}.brand small{font-size:8px;letter-spacing:1px}.header-actions button{font-size:12px;padding:8px 11px}main{padding:18px 12px}.campaign-nav{gap:10px}.mode-switch{width:100%}.mode-switch button{font-size:13px}.room-head{border-radius:22px;padding:21px;margin:16px 0;gap:17px}.room-head h1{font-size:31px;letter-spacing:-1px}.room-head p{font-size:14px}.goal{width:100%;min-width:0;border-radius:14px;padding:13px 15px}.goal strong{font-size:16px;margin-left:8px}.goal>span:last-child{font-size:12px}.workspace{grid-template-columns:1fr;gap:16px}.play-panel{border-radius:22px}#board{padding:11px;gap:3px}.tile{border-radius:6px}.station-tag{font-size:8px;top:2px;left:3px}.station-symbol{font-size:20px}.map-legend{padding:7px 12px 14px;font-size:10px;gap:12px}.board-top{padding:12px 16px;font-size:10px}#tutorial-guide{padding:15px 17px}#tutorial-guide p{font-size:14px}#tutorial-guide small{font-size:11px}.toolbar{padding:12px}.toolbar button{padding:8px 11px}.message{padding:16px;font-size:14px}.instrument{border-radius:20px;padding:17px!important}.key-orbit{width:62px;height:62px}.key-heading{flex-wrap:wrap;gap:8px}.key-heading strong{font-size:17px}.key-heading small{font-size:12px}.prob-label,.prob-values,.phase{font-size:11px}.small{font-size:13px}.micro{font-size:11px}#visual-replay{padding:17px}.replay-state{padding:10px;border-radius:13px}.replay-heading>strong{font-size:19px}.replay-state>strong{font-size:16px}.replay-probs{font-size:10px}.replay-footnote{font-size:11px}dialog{padding:23px;border-radius:23px}dialog h2{font-size:28px}.welcome-grid{gap:13px}.welcome-grid section{padding:2px 14px 6px}.welcome-key{padding:13px}.courier.carrying:after{font-size:13px;bottom:-7px;right:-8px}footer{font-size:9px}}
/* Keep the playable path visible alongside the current goal. */
.room-head{padding:20px 24px;margin:18px 0}.room-head h1{font-size:clamp(28px,3vw,38px)}.goal{padding:13px 17px}#board{aspect-ratio:11/5;grid-template-rows:repeat(7,minmax(0,1fr));min-height:0}.tile{aspect-ratio:auto}.tile.wall{min-height:0}@media(max-width:760px){#board{aspect-ratio:11/7}.room-head{padding:19px}.room-head h1{font-size:30px}}
[hidden]{display:none!important}#home-screen{max-width:1280px;margin:auto;padding:70px 35px 35px;display:grid;grid-template-columns:1.2fr 1fr;gap:38px;align-items:center}.home-intro h1{font-size:clamp(40px,5vw,67px);letter-spacing:-2.7px;line-height:1.06;font-weight:650;margin:20px 0}.home-intro p{font-size:18px;max-width:560px;line-height:1.7}.home-actions{display:flex;gap:12px;flex-wrap:wrap;margin:30px 0 16px}.home-actions button{padding:14px 25px}.home-note{font-size:13px;color:var(--muted)}.home-state{background:#edf2ff;border-radius:40px;min-height:350px;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:24px;color:#49648e}.home-ket{font-family:Georgia,serif;font-size:42px;color:#245cca}.home-orbits{position:relative;width:240px;height:195px;display:grid;place-items:center}.home-orbits i{position:absolute;width:210px;height:100px;border:1px solid #6f95dc;border-radius:50%;transform:rotate(-30deg)}.home-orbits i:nth-child(2){transform:rotate(30deg)}.home-orbits i:nth-child(3){transform:rotate(90deg)}.home-orbits b{font-size:46px;color:#16855c;z-index:1;background:#edf2ff;border-radius:50%;padding:8px}.home-state>span:last-child{font-size:14px}.home-cards{grid-column:1/-1;display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:20px}.home-cards button{text-align:left;padding:25px;background:#f4f6fa;border:1px solid transparent;border-radius:23px}.home-cards button:hover{border-color:#97b2e3;transform:translateY(-3px)}.home-cards strong{font-size:18px;display:block;margin-bottom:11px}.home-cards span{font-size:14px;line-height:1.6;color:var(--muted);display:block}#home-progress{grid-column:1/-1;font-size:13px;text-align:center}.header-actions{flex-wrap:wrap}#theme-toggle,#home-button{font-size:13px}
html[data-theme=dark]{color-scheme:dark;--bg:#10151e;--panel:#1b2533;--line:#354256;--text:#e9eff8;--muted:#b0bdd0;--mint:#80dbb5;--purple:#c7a7fa;--yellow:#f1d18a;--red:#ffa2ae}html[data-theme=dark] body{background:var(--bg);color:var(--text)}html[data-theme=dark] .masthead{background:#131b26;border-color:#293448}html[data-theme=dark] .brand{color:#eef3ff}html[data-theme=dark] .brand-icon{background:#263d65;color:#a6c3ff;box-shadow:none}html[data-theme=dark] :is(.brand small,.edition,.section-label,.eyebrow){color:#a1b5d3}html[data-theme=dark] button{background:#202d40;color:#e5eeff;border-color:#465873}html[data-theme=dark] button:hover{background:#2e4260;border-color:#7b9ac8}html[data-theme=dark] button.primary,html[data-theme=dark] .header-actions #help{background:#97baff;border-color:#97baff;color:#142c54}html[data-theme=dark] .mode-switch{background:#1a2536}html[data-theme=dark] .mode-switch button[aria-pressed=true]{background:#304a73;border-color:#4d6e9c;color:#dceaff}html[data-theme=dark] #chapter{background:#1b293d;color:#e6efff;border-color:#445c80}html[data-theme=dark] #campaign-progress{background:#203f35;color:#a6e7c9}html[data-theme=dark] #levels button{background:#1b2638;color:#becce0}html[data-theme=dark] #levels button.active{background:#2a416b;border-color:#647ea8;color:#dfebff}html[data-theme=dark] #levels .number{background:#172439}html[data-theme=dark] .room-head{background:#1c2c47;border-color:#314765}html[data-theme=dark] .room-head p{color:#b8c9e1}html[data-theme=dark] .goal{background:#273952}html[data-theme=dark] .goal strong{color:#f0f4fc}html[data-theme=dark] .goal>span:last-child{color:#becce0}html[data-theme=dark] .goal .eyebrow{color:#e6cf92}html[data-theme=dark] .play-panel{background:#172130;border-color:#35455b}html[data-theme=dark] #tutorial-guide{background:#1d3a33;border-color:#3c6355}html[data-theme=dark] #tutorial-guide :is(p,.eyebrow){color:#bcead4}html[data-theme=dark] #tutorial-guide small{color:#a4c9b8}html[data-theme=dark] .board-top{background:#182435;color:#afc1da;border-color:#35465e}html[data-theme=dark] #board{background-color:#172130;background-image:radial-gradient(#3b4c64 1px,transparent 1px)}html[data-theme=dark] .tile{background:#30415a;border-color:#4c6382;box-shadow:inset 0 -3px #24344c}html[data-theme=dark] .tile.wall{background:transparent;border:0;box-shadow:none}html[data-theme=dark] .tile.start{background:#1d2d44}html[data-theme=dark] .tile.station{background:#46345f;border-color:#a383cf;color:#e2caff;box-shadow:inset 0 -3px #36254e}html[data-theme=dark] .tile.station.scanner{background:#214b3c;border-color:#69b392;color:#b8f3d7;box-shadow:inset 0 -3px #193b30}html[data-theme=dark] .tile.station.hazard{background:#61333f;border-color:#e18b9a;color:#ffd0d9}html[data-theme=dark] .tile.exit{background:#57451f;border-color:#d5b454;color:#ffe3a1}html[data-theme=dark] .floor-key{color:#81edbe}html[data-theme=dark] :is(.toolbar,.touch-controls){background:#192537;border-color:#35465e}html[data-theme=dark] :is(.map-legend,.keyboard-hint,footer){color:#aabdd6}html[data-theme=dark] kbd{background:#1c2a3e;border-color:#465d7e;color:#bbcee8}html[data-theme=dark] .message{background:#21344f;color:#c3d7f4;border-color:#3e5779}html[data-theme=dark] .message strong{color:#afd0ff}html[data-theme=dark] .message.win{background:#203f32;color:#b6e4c5}html[data-theme=dark] .message.warn{background:#493c23;color:#f1dba6}html[data-theme=dark] .instrument{background:#1b2738}html[data-theme=dark] :is(.key-heading strong,#station-detail strong,.replay-probs b){color:#e1ecfc}html[data-theme=dark] :is(.key-heading small,.micro,.prob-values,#station-detail,#log,.replay-footnote){color:#aebed6}html[data-theme=dark] .phase{border-color:#3b4b62}html[data-theme=dark] .phase strong{color:#d3b2fa}html[data-theme=dark] #equipment button,html[data-theme=dark] .mode-buttons button,html[data-theme=dark] #relocate{background:#26364e;color:#d5e4fa;border-color:#526886!important}html[data-theme=dark] #equipment button.selected,html[data-theme=dark] .mode-buttons .chosen{background:#354d74;color:#e5efff}html[data-theme=dark] #log li:first-child{color:#e0eaff}html[data-theme=dark] #visual-replay{background:#162132;border-color:#35465e}html[data-theme=dark] .replay-state{background:#21334e;border-color:#435a7d}html[data-theme=dark] .replay-state>strong{color:#aed0ff}html[data-theme=dark] :is(.replay-label,.replay-probs,.replay-empty){color:#b3c4df}html[data-theme=dark] .amplitude-track{background:#132034}html[data-theme=dark] .replay-operation>strong{background:#493664;color:#e3c8ff}html[data-theme=dark] .replay-explanation{color:#d0ddf0}html[data-theme=dark] .replay-outcome{background:#23324a;color:#becce1;border-color:#5c7392}html[data-theme=dark] .replay-outcome.observed{background:#214837;color:#b7ebcf}html[data-theme=dark] dialog{background:#1b2739;color:#edf3ff;border-color:#536682}html[data-theme=dark] dialog :is(p,li){color:#bdcbe0}html[data-theme=dark] dialog h3{color:#edf3ff}html[data-theme=dark] dialog strong{color:#b1cfff}html[data-theme=dark] .welcome-grid section{background:#25354d}html[data-theme=dark] .welcome-key{background:#264237;border-color:#507d65}html[data-theme=dark] .welcome-key strong{color:#bcebd3}html[data-theme=dark] .welcome-key div>span{color:#b2d5c3}html[data-theme=dark] .key-token{background:#19382b;color:#a1ecc7}html[data-theme=dark] :is(.home-state,.home-orbits b){background:#203451}html[data-theme=dark] .home-ket{color:#b6d0ff}html[data-theme=dark] .home-state{color:#bccfeb}html[data-theme=dark] .home-orbits b{color:#90e9c0}html[data-theme=dark] .home-orbits i{border-color:#789dce}html[data-theme=dark] .home-cards button{background:#1d2a3d}html[data-theme=dark] .touch-controls button{background:#304565;color:#d6e7ff;border-color:#5f7da4}
@media(max-width:760px){#home-screen{padding:35px 20px;grid-template-columns:1fr;gap:25px}.home-intro h1{font-size:43px;letter-spacing:-1.7px}.home-intro p{font-size:16px}.home-state{min-height:270px;border-radius:26px}.home-cards{grid-template-columns:1fr;margin-top:0;gap:12px}.home-cards button{padding:22px}.header-actions{gap:4px}.header-actions .edition{display:none}.header-actions button{font-size:11px!important;padding:7px 9px}.masthead{align-items:flex-start}.header-actions{justify-content:flex-end;max-width:190px}.brand small{display:none}}
#home-screen{padding-top:48px;gap:34px;position:relative}.home-intro .eyebrow{display:inline-block;padding:9px 13px;border-radius:20px;background:#edf3ff;color:#3061ab}.home-intro h1{font-size:clamp(42px,5.1vw,68px);max-width:680px}.home-intro p{max-width:500px}.home-state{position:relative;overflow:hidden;min-height:470px;border:1px solid #d3dff6;box-shadow:0 16px 55px #3a65a51a;padding:23px 26px;gap:0;background:radial-gradient(ellipse at 50% 35%,#d7e6ff,transparent 65%),#f0f5ff}.home-lab-top{display:flex;justify-content:space-between;align-items:center;width:100%;font-size:10px;letter-spacing:1.4px;font-weight:650}.lab-badge{padding:5px 8px;background:#d6f3e4;border-radius:12px;color:#287454;font-size:9px}.lab-badge:before{content:'●';margin-right:5px}#home-qubit{width:min(100%,290px);color:#366fcd}#home-qubit svg{display:block;width:100%;height:auto}.lab-state-dot{filter:drop-shadow(0 0 6px #81afff)}.home-lab-status{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:9px 2px 15px}.home-lab-status strong{font-size:20px;color:#254875}.home-lab-status>span{font-size:12px}.home-gates{display:flex;width:100%;gap:7px}.home-gates button{flex:1;border-radius:13px;background:#ffffffaa;padding:9px 5px;font-size:18px;color:#315b98;border-color:#c2d4f0;min-width:0}.home-gates button span{display:block;font-size:10px;font-weight:400;margin-top:4px}.home-gates button[data-lab=measure]{font-size:13px;flex:1.4}.home-gates button[data-lab=reset]{flex:.65}.home-gates button:hover{background:#dbe9ff;transform:translateY(-3px)}#home-lab-message{font-size:13px;line-height:1.6;margin:16px 0 10px;min-height:63px;color:#506884;align-self:stretch}.home-state small{font-size:10px;color:#667c97;text-align:center}.home-cards{margin-top:4px}.home-cards button{position:relative;overflow:hidden;border:1px solid #e4e9f2;min-height:142px;transition:transform .2s,box-shadow .2s,border-color .2s}.home-cards button:nth-child(1){background:#eaf5ef}.home-cards button:nth-child(2){background:#edf0ff}.home-cards button:nth-child(3){background:#f4edfc}.home-cards button:hover{box-shadow:0 12px 28px #284d8020}.home-cards strong{font-size:18px}.home-actions .primary{box-shadow:0 7px 20px #3569ca2b}html[data-theme=dark] .home-intro .eyebrow{background:#203653;color:#b4d0ff}html[data-theme=dark] .home-state{background:radial-gradient(ellipse at 50% 30%,#263e68,transparent 70%),#182a43;border-color:#385377;box-shadow:0 14px 60px #0003}html[data-theme=dark] #home-qubit{color:#9ec5ff}html[data-theme=dark] .home-lab-status strong{color:#e1edff}html[data-theme=dark] .home-gates button{background:#263d5a;color:#d3e5ff;border-color:#4a658b}html[data-theme=dark] .home-gates button:hover{background:#36527b}html[data-theme=dark] #home-lab-message{color:#c2d3ea}html[data-theme=dark] .home-state small{color:#9fb4d1}html[data-theme=dark] .lab-badge{background:#254e41;color:#9ceac6}html[data-theme=dark] .home-cards button:nth-child(1){background:#203b34}html[data-theme=dark] .home-cards button:nth-child(2){background:#273653}html[data-theme=dark] .home-cards button:nth-child(3){background:#352d49}html[data-theme=dark] .home-cards button{border-color:#425069}@media(max-width:760px){#home-screen{padding-top:30px;gap:26px}.home-state{min-height:0;padding:20px;border-radius:27px}.home-intro h1{font-size:43px}.home-lab-status{flex-wrap:wrap}#home-qubit{max-width:255px}.home-cards button{min-height:115px}#home-lab-message{min-height:0}.home-intro .eyebrow{font-size:10px}}
/* Pointer lighting only; touch and reduced-motion users keep a static interface. */
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){#home-screen{isolation:isolate}#home-screen:before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;opacity:var(--pointer-active,0);background:radial-gradient(330px circle at var(--cursor-x,50%) var(--cursor-y,40%),#5c93ff1a,transparent 75%);transition:opacity .3s}.home-state,.home-cards button{--shine-x:50%;--shine-y:50%;isolation:isolate}.home-state:after,.home-cards button:after{content:'';position:absolute;inset:0;pointer-events:none;border-radius:inherit;background:radial-gradient(230px circle at var(--shine-x) var(--shine-y),#76adff30,transparent 72%);opacity:var(--shine-on,0);transition:opacity .25s;z-index:0}.home-state>* ,.home-cards button>*{position:relative;z-index:1}.home-state{transform:perspective(1000px) rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg));transition:transform .18s ease-out,box-shadow .25s;will-change:transform}.home-state:hover{box-shadow:0 18px 60px #3579e62b;border-color:#80a9df}.home-cards button:hover{border-color:#79a7eb;box-shadow:0 12px 30px #548ee62b}.home-actions button:hover{box-shadow:0 0 0 5px #74a6fb18,0 9px 25px #467ddb28}html[data-theme=dark] #home-screen:before{background:radial-gradient(340px circle at var(--cursor-x,50%) var(--cursor-y,40%),#3e8aff23,transparent 75%)}html[data-theme=dark] .home-state:after,html[data-theme=dark] .home-cards button:after{background:radial-gradient(220px circle at var(--shine-x) var(--shine-y),#70acff30,transparent 72%)}}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){#home-screen{transform:perspective(1800px) rotateX(var(--page-rx,0deg)) rotateY(var(--page-ry,0deg));transform-origin:50% 40%;transition:transform .35s ease-out}.home-intro{transform:translate3d(var(--page-x,0px),var(--page-y,0px),0);transition:transform .35s ease-out}.home-state{transform:perspective(1000px) translate3d(calc(var(--page-x,0px) * -0.65),calc(var(--page-y,0px) * -0.65),0) rotateX(var(--tilt-x,0deg)) rotateY(var(--tilt-y,0deg));transition:transform .3s ease-out,box-shadow .25s}.home-cards{transform:translate3d(calc(var(--page-x,0px) * 0.4),calc(var(--page-y,0px) * 0.4),0);transition:transform .4s ease-out}#home-progress{transform:translate3d(calc(var(--page-x,0px) * 0.2),0,0);transition:transform .4s ease-out}}

.sandbox-panel{max-width:1100px;margin:30px auto;padding:32px;border:1px solid #8699bb66;border-radius:28px;background:var(--panel,transparent)}
.sandbox-settings,.sandbox-circuit{display:flex;flex-wrap:wrap;gap:18px;margin:24px 0}.sandbox-panel label{display:flex;flex-direction:column;gap:8px;flex:1;min-width:140px}.sandbox-panel select{font:inherit;padding:12px;border:1px solid #8699bb;border-radius:12px;background:#f3f6fc;color:#172941}.sandbox-panel p{line-height:1.7}#sandbox-result{padding:20px;margin-top:24px;border:1px solid #8699bb66;border-radius:18px}.sandbox-panel[hidden]{display:none}
.workshop-board{display:flex;gap:8px;align-items:center;overflow-x:auto;padding:24px 6px;background:radial-gradient(circle,#86a1c733 1px,transparent 1px);background-size:18px 18px;border-radius:20px;margin:24px 0}.workshop-tile{display:flex;flex:1;min-width:94px;min-height:106px;flex-direction:column;justify-content:center;align-items:center;gap:12px;border:2px solid #91a4c4;border-radius:16px;background:#eef3fb;color:#243858;font-size:25px}.workshop-tile small{font-size:12px}.workshop-gate{background:#eee4ff;border-color:#9867e3;color:#6530ad}.workshop-scan{background:#dcf7e9;border-color:#309871;color:#12634a}.workshop-goal{background:#fff1bd;border-color:#d59b13;color:#805400}.workshop-tile:focus-visible{outline:3px solid #4488ff;outline-offset:3px}

/* Quantum spectrum: violet gates, cyan instruments, gold destinations. */
html[data-theme=light]{--bg:#f3f2fc;--panel:#eeeffb;--text:#24213e;--muted:#585875;--mint:#087f88;--purple:#7942c7;--line:#d8d4ed}
html[data-theme=light] body{background:radial-gradient(ellipse at 12% 5%,#e4d7ff,transparent 45%),radial-gradient(ellipse at 90% 35%,#cff5f4,transparent 48%),#f7f6fd}
html[data-theme=dark]{--bg:#090b1c;--panel:#14152e;--text:#f1efff;--muted:#b4b7d7;--mint:#66e6e8;--purple:#c399ff;--line:#353558}
html[data-theme=dark] body{background:radial-gradient(ellipse at 12% 0%,#38205b88,transparent 48%),radial-gradient(ellipse at 95% 35%,#07516655,transparent 50%),#090b1c;color:var(--text)}
html[data-theme] .brand-icon{background:linear-gradient(145deg,#7d43d7,#197b96);color:#eaffff;border-color:#8f86df;box-shadow:0 0 24px #9972ff35}
html[data-theme] .home-intro h1{background:linear-gradient(110deg,#6943c4,#087e91);background-clip:text;-webkit-background-clip:text;color:transparent}
html[data-theme=dark] .home-intro h1{background-image:linear-gradient(110deg,#e4cdff,#7de9ed)}
html[data-theme] button.primary{background:linear-gradient(115deg,#7543ca,#246eae);border-color:#8b70de;color:#fff;box-shadow:0 6px 24px #8050d52b}
html[data-theme] button.primary:hover{background:linear-gradient(115deg,#8651df,#25839e);box-shadow:0 0 25px #8270df55}
html[data-theme] .home-state{background:radial-gradient(ellipse at 30% 20%,#dcd0fa,transparent 70%),radial-gradient(ellipse at 90% 90%,#c8eff0,transparent 70%),#f1effc;border-color:#bdb8e8}
html[data-theme=dark] .home-state{background:radial-gradient(ellipse at 25% 20%,#43296788,transparent 65%),radial-gradient(ellipse at 85% 90%,#14536688,transparent 70%),#14162f;border-color:#585080;box-shadow:0 15px 60px #6e32a51c}
html[data-theme=dark] .instrument,html[data-theme=dark] .sandbox-panel,html[data-theme=dark] dialog{background:#15162e;border-color:#3e3a64;color:#f1efff}
html[data-theme=dark] .play-panel{background:#101429;border-color:#393957}
html[data-theme=dark] #board{background-color:#101429;background-image:radial-gradient(#738cd344 1px,transparent 1px)}
html[data-theme=dark] .tile:not(.wall):not(.station):not(.exit){background:#242742;border-color:#424968;box-shadow:inset 0 -3px #151a30}
html[data-theme=dark] .station:not(.scanner),html[data-theme=dark] .workshop-gate{background:#35204e;border-color:#b387f5;color:#dfbeff;box-shadow:0 0 15px #b77af51a}
html[data-theme=dark] .station.scanner,html[data-theme=dark] .workshop-scan{background:#103e45;border-color:#51cece;color:#9af3ec;box-shadow:0 0 15px #51cece1a}
html[data-theme=dark] .home-cards button:nth-child(1){background:#15373e;border-color:#315562}
html[data-theme=dark] .home-cards button:nth-child(2){background:#292342;border-color:#51436f}
html[data-theme=dark] .home-cards button:nth-child(3){background:#302340;border-color:#594270}
html[data-theme=dark] .home-intro .eyebrow{background:#29213f;color:#d4b6ff}
html[data-theme=dark] .home-gates button,html[data-theme=dark] .sandbox-panel select{background:#252440;color:#e4ddff;border-color:#565074}
html[data-theme=dark] .home-lab-status strong{color:#a6f3ef}
html[data-theme=dark] .workshop-tile:not(.workshop-gate):not(.workshop-scan):not(.workshop-goal){background:#242742;color:#d2daf4;border-color:#515d80}
html[data-theme=dark] .workshop-goal{background:#47391c;color:#ffe194;border-color:#d9ae50}
html[data-theme=light] .home-cards button:nth-child(1){background:#e0f2f1}html[data-theme=light] .home-cards button:nth-child(2){background:#eae2fa}html[data-theme=light] .home-cards button:nth-child(3){background:#f0e4f5}

.gate-reference{grid-column:1/-1;width:100%;padding:28px;border:1px solid var(--line);border-radius:24px;background:var(--panel);margin-top:12px}.gate-reference h2{margin:10px 0;font-size:28px}.gate-table-scroll{overflow-x:auto;margin:20px 0}.gate-reference table{width:100%;border-collapse:collapse;text-align:left;line-height:1.65;min-width:550px}.gate-reference caption{text-align:left;color:var(--muted);font-size:13px;padding-bottom:12px}.gate-reference th,.gate-reference td{padding:16px;border-bottom:1px solid var(--line);vertical-align:top}.gate-reference thead{background:#8972d51a}.gate-reference tbody th{color:var(--purple);width:21%}.gate-reference td:last-child{width:26%}.gate-reference p{max-width:900px}@media(max-width:600px){.gate-reference{padding:18px}.gate-reference th,.gate-reference td{padding:12px}}

.room-head{flex-direction:column;align-items:stretch;gap:18px}.room-head .goal{order:-1;max-width:none;min-width:0;border:1px solid var(--yellow);border-left:4px solid var(--yellow);border-radius:16px;padding:16px 20px;background:linear-gradient(100deg,#dca93812,transparent)}.room-head .goal .eyebrow{font-size:13px;letter-spacing:.5px}.room-head .goal strong{font-size:24px;margin:7px 0}

.room-head .goal{order:0}
