@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&display=swap');
:root{--bg:#101217;--text:#eeeae4;--muted:#8d919b;--line:#ffffff14;--amber:#ffb17e;--blue:#81d8eb;--accent:var(--amber);font-family:'DM Sans',sans-serif;color:var(--text);background:var(--bg);font-synthesis:none}*{box-sizing:border-box}body{margin:0}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit}button{border:0}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:2px solid var(--accent);outline-offset:6px}button:disabled{cursor:default;opacity:.4}button:focus:not(:focus-visible){outline:none}button:hover{filter:brightness(1.15)}.app{max-width:2000px;margin:auto;padding:0 3.4vw}header{height:100px;display:flex;align-items:center;border-bottom:1px solid var(--line);gap:40px}.brand{display:flex;align-items:center;gap:14px;color:var(--text);text-decoration:none;font-size:19px;letter-spacing:.24em;font-weight:700}.brand svg{width:34px;fill:none;stroke:var(--amber);stroke-width:1.25}.header-note{color:var(--muted);font-size:12px;letter-spacing:.18em}.header-actions{margin-left:auto;display:flex;align-items:center;gap:24px}.icon-button{background:none;display:flex;align-items:center;gap:9px;font-size:13px;color:#a4a6ae;padding:8px}.icon-button svg{width:18px;fill:none;stroke:currentColor;stroke-width:1.3}.question{border:1px solid #686b74;border-radius:50%;height:23px;width:23px;text-align:center;line-height:21px}main{height:calc(100svh - 184px);min-height:620px;max-height:1000px;position:relative;isolation:isolate}.chapter-panel{position:absolute;top:55px;left:0;width:240px;z-index:2;pointer-events:none}.chapter-panel button{pointer-events:auto}.eyebrow{font-size:11px;font-weight:600;letter-spacing:.15em;color:var(--muted);display:flex;align-items:center;gap:10px}.little-line{width:20px;height:1px;background:var(--accent)}h1{font-family:'Manrope',sans-serif;font-size:clamp(34px,3.2vw,49px);font-weight:500;letter-spacing:-.055em;line-height:1.13;margin:23px 0 20px}p{font-size:15px;color:#999ba5;line-height:1.75}.chapter-panel>p{margin:0}.objective{margin-top:34px;display:flex;align-items:flex-start;gap:11px}.diamond{font-size:29px;line-height:1;color:var(--accent)}.objective strong{display:block;font-size:14px;font-weight:500}.objective span:not(.diamond){font-size:12px;color:var(--muted);display:block;margin-top:7px}.text-button{background:none;padding:0;font-size:13px;color:var(--muted);display:flex;align-items:center;gap:12px}.text-button:hover{color:var(--text)}#hint-button{margin-top:31px;border-bottom:1px solid #ffffff22;padding-bottom:7px}#hint-text{margin-top:15px;font-size:13px;line-height:1.65;color:var(--accent);width:225px}#stage{position:absolute;inset:0;z-index:0}canvas{display:block;width:100%;height:100%;touch-action:none;outline:none}.stage-label{position:absolute;bottom:103px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:9px;pointer-events:none;white-space:nowrap}.stage-label span:first-child{font-size:11px;letter-spacing:.22em;color:var(--accent)}.stage-label span:last-child{font-size:12px;color:#757985}.perspective-panel{position:absolute;top:60px;right:0;width:226px;z-index:2}.perspective-panel>.eyebrow{margin-bottom:21px}.reality-button{display:flex;align-items:center;width:100%;padding:18px 12px;margin-bottom:8px;text-align:left;background:transparent;border:1px solid transparent;border-radius:10px;gap:12px;transition:background .4s,border .4s}.reality-button.active{background:#ffffff04;border-color:#ffffff20}.reality-icon{font-size:29px;color:#6b6e79;width:29px;text-align:center}.active .sun-icon{color:var(--amber)}.active .moon-icon{color:var(--blue)}.reality-button strong{font-size:15px;font-weight:500;display:block}.reality-button small{display:block;font-size:11px;color:#818692;margin-top:6px}.reality-button>kbd{margin-left:auto}.shift-button{display:flex;align-items:center;justify-content:center;gap:9px;background:#eee8df;color:#212229;border-radius:6px;height:46px;width:100%;font-size:13px;font-weight:500;margin-top:19px}.shift-button>span{font-size:23px}.shift-button kbd{border-color:#1112;color:#64646b;font-size:9px}.legend{margin-top:23px;font-size:11px;display:flex;flex-direction:column;gap:13px;color:#838793;padding-left:12px}.legend span{display:flex;align-items:center;gap:10px}.legend i{width:8px;height:8px;transform:rotate(45deg)}.anchor-key{background:#d4c9b4}.ghost-key{border:1px solid #7a7b86}.scene-bottom{position:absolute;bottom:26px;left:0;right:0;display:flex;align-items:center;justify-content:space-between;gap:16px;pointer-events:none}.scene-bottom button{pointer-events:auto}#fragment-count{font-size:11px;letter-spacing:.12em;color:#bbbec6;display:flex;align-items:center;gap:10px}.scene-word{font-size:10px;letter-spacing:.19em;color:#505662}kbd{font:10px 'DM Sans',sans-serif;display:inline-flex;min-width:19px;height:21px;padding:0 5px;align-items:center;justify-content:center;border:1px solid #ffffff20;border-radius:3px;color:#9398a3}footer{height:84px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:20px}.journey-button{display:flex;align-items:center;gap:20px;background:none;padding:10px 0}.journey-button .eyebrow{font-size:10px}.progress-dots{display:flex;gap:10px}.progress-dots i{width:6px;height:6px;border-radius:50%;background:#3c4049}.progress-dots i.done{background:#d3bca5}.progress-dots i.current{background:var(--accent);box-shadow:0 0 0 4px #ffb17e15}.keyboard-guide{display:flex;align-items:center;gap:20px;font-size:11px;color:#838894}.keyboard-guide span{display:flex;align-items:center;gap:5px}.keyboard-guide i{width:1px;height:15px;background:var(--line)}.footer-end{font-size:9px;letter-spacing:.13em;color:#5e6471}.mobile-controls{display:none}.loading{position:absolute;inset:0;background:var(--bg);display:flex;align-items:center;justify-content:center;font-size:14px;letter-spacing:.08em;color:var(--amber);z-index:4}dialog{color:var(--text);background:#1b1e26;border:1px solid #ffffff18;border-radius:16px;width:510px;max-width:calc(100% - 32px);padding:43px;box-shadow:0 20px 100px #0007}dialog::backdrop{background:#090c12b0;backdrop-filter:blur(9px)}.close-dialog{position:absolute;top:16px;right:19px;background:none;color:#999;font-size:28px;padding:5px}h2{font-family:'Manrope',sans-serif;font-weight:500;font-size:36px;letter-spacing:-.045em;line-height:1.2;margin:20px 0}dialog p{font-size:14px;line-height:1.7}dialog .eyebrow{color:var(--accent);font-size:10px}.help-steps{margin:26px 0}.help-steps>div{display:flex;gap:20px}.help-steps>div>span{font-size:12px;color:var(--accent);padding-top:15px}.help-steps strong{color:#ddd9d3;font-weight:500}.primary{width:100%;padding:17px 20px;background:#f1e9dd;color:#24262b;display:flex;justify-content:space-between;border-radius:6px;font-size:14px}.completion-symbol{font-size:76px;color:var(--accent);margin:16px 0 -10px;text-align:center}#complete-dialog{text-align:center}#complete-dialog .eyebrow{justify-content:center}#complete-dialog h2{font-size:40px}.stats{display:flex;margin:28px 0 34px;justify-content:center;gap:52px}.stats strong{font-size:26px;font-weight:500;display:block}.stats span{font-size:11px;color:var(--muted);display:block;margin-top:5px}#replay{margin:18px auto 0}#chamber-list{display:flex;flex-direction:column;gap:6px}#chamber-list button{background:#ffffff04;border:1px solid #ffffff09;border-radius:6px;display:flex;align-items:center;text-align:left;gap:16px;padding:16px}#chamber-list span:first-child{color:var(--accent);font-size:12px}#chamber-list span:last-child{margin-left:auto;color:var(--muted)}
@media(min-width:1700px){.chapter-panel{width:280px}.perspective-panel{width:255px}}
@media(max-width:1100px){.app{padding:0 25px}.header-note{display:none}.chapter-panel{width:185px;top:36px}.perspective-panel{width:190px;top:40px}h1{font-size:36px}.chapter-panel>p{font-size:13px}.objective strong{font-size:12px}.objective{margin-top:24px}.reality-button{padding:12px 6px;gap:8px}.reality-button small{font-size:10px}.reality-button>kbd{display:none}.shift-button{font-size:12px}.shift-button kbd{display:none}.legend{padding-left:5px;font-size:10px}.footer-end{display:none}.scene-word{font-size:8px}.header-actions{gap:15px}#hint-text{width:185px;font-size:12px}}
@media(max-width:740px){.app{padding:0 18px}header{height:74px}.brand{font-size:16px;gap:10px;letter-spacing:.2em}.brand svg{width:28px}.icon-button{padding:5px}.icon-button span:not(.question){display:none}main{height:calc(100svh - 139px);min-height:665px;max-height:none}.chapter-panel{top:27px;width:65%;pointer-events:none}.eyebrow{font-size:9px}h1{font-size:31px;margin:12px 0 10px}h1 br{display:none}.chapter-panel>p{font-size:12px;max-width:220px;line-height:1.6}.chapter-panel>p br{display:none}.objective{margin-top:14px;gap:7px}.objective strong{font-size:11px}.objective span:not(.diamond){font-size:10px;margin-top:4px}.diamond{font-size:23px}#hint-button{margin-top:15px;font-size:11px}#hint-text{background:#1b202af5;padding:10px;border-radius:6px;width:245px;font-size:12px}.perspective-panel{top:30px;width:91px}.perspective-panel>.eyebrow{display:none}.reality-button{padding:9px 2px;justify-content:center;flex-direction:column;gap:5px;margin-bottom:7px;border-radius:8px}.reality-icon{font-size:25px;line-height:1.1}.reality-button strong{font-size:11px}.reality-button small{display:none}.shift-button{margin-top:8px;height:38px;font-size:0;gap:0}.shift-button>span{font-size:24px}.legend{display:none}.scene-bottom{bottom:14px}.scene-word{display:none}.scene-bottom #reset{font-size:11px}.scene-bottom kbd{display:none}#fragment-count{font-size:9px;gap:7px}.stage-label{bottom:150px}.stage-label span:first-child{font-size:9px}.stage-label span:last-child{font-size:10px}.mobile-controls{display:flex;position:absolute;bottom:48px;left:50%;transform:translateX(-50%);flex-direction:column;align-items:center;gap:5px}.mobile-controls div{display:flex;gap:5px}.mobile-controls button{height:35px;width:44px;border:1px solid #ffffff1a;border-radius:6px;background:#ffffff05;color:#b6b9c3;font-size:19px}.mobile-controls button:active{background:#ffffff20}.keyboard-guide{display:none}footer{height:65px;justify-content:center}.journey-button{gap:23px}.journey-button .eyebrow{font-size:9px}dialog{padding:35px 27px}dialog h2{font-size:32px}.help-steps{margin:18px 0}.help-steps>div{gap:12px}.help-steps p{font-size:13px}.stats{gap:35px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
/* Readable type and a quiet halo around the playable world. */
#stage{background:radial-gradient(ellipse at 50% 52%,#25344922 0%,#10121700 58%)}
.chapter-panel>p{font-size:16px}.objective strong{font-size:14px}.objective span:not(.diamond){font-size:13px}.text-button{font-size:14px}.eyebrow{font-size:12px}.reality-button small{font-size:12px}.legend{font-size:12px}.stage-label span:first-child{font-size:12px}.stage-label span:last-child{font-size:12px}.scene-word{font-size:12px;letter-spacing:.13em}.footer-end{font-size:10px}.keyboard-guide{font-size:12px}.journey-button .eyebrow{font-size:12px}#fragment-count{font-size:12px}#hint-text{font-size:14px}.shift-button{font-size:14px}.reality-button{padding-left:8px;padding-right:8px}.reality-button>kbd{display:none}
@media(max-width:1100px){.scene-word{display:none}.chapter-panel>p{font-size:14px}.reality-button small{font-size:11px}.objective strong{font-size:13px}.objective span:not(.diamond){font-size:12px}.legend{font-size:11px}.shift-button{font-size:13px}.keyboard-guide{font-size:11px}}
@media(max-width:740px){.chapter-panel{width:calc(100% - 110px)}.chapter-panel>p{font-size:13px}.chapter-panel h1{letter-spacing:-.04em}.eyebrow{font-size:10px}.objective strong{font-size:12px}.objective span:not(.diamond){font-size:11px}#hint-button{font-size:12px}.reality-button strong{font-size:12px}.shift-button{font-size:0}.stage-label{bottom:141px}.stage-label span:first-child{font-size:10px}.stage-label span:last-child{font-size:11px}#fragment-count{font-size:10px}.journey-button .eyebrow{font-size:10px}#hint-text{font-size:13px}.mobile-controls{bottom:48px}}
#crosshair{display:none;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:22px;line-height:1;color:#fff8;pointer-events:none;font-weight:400;text-shadow:0 0 6px #000}
#view-compass{display:none;position:absolute;left:50%;top:34px;transform:translateX(-50%);font-size:11px;letter-spacing:.28em;color:#cbd8e0b0;pointer-events:none}
.first-person #crosshair,.first-person #view-compass{display:block}.first-person #stage:after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#101217de 0%,#10121766 24%,transparent 38%,transparent 66%,#101217bb 100%)}
.first-person .chapter-panel h1{font-size:35px}.first-person .chapter-panel>p{display:none}.first-person .stage-label{z-index:2}.first-person .stage-label{padding:10px 17px;border-radius:8px;background:#101217c9;backdrop-filter:blur(8px)}.first-person .objective{margin-top:23px}.first-person canvas{cursor:grab}
@media(max-width:740px){.first-person #stage:after{background:linear-gradient(180deg,#101217cc 0%,#10121788 24%,transparent 47%,#10121744 70%,#101217ee 100%)}.first-person .chapter-panel h1{font-size:26px}.first-person .objective{margin-top:12px}.first-person #view-compass{top:255px;font-size:10px}.first-person #crosshair{top:53%}.first-person .stage-label{width:max-content;max-width:95%;padding:8px 12px}.first-person .stage-label span:last-child{font-size:10px}}
@media(min-width:741px){main{min-height:520px}.first-person .perspective-panel{background:linear-gradient(90deg,transparent,#10121799);border-radius:12px;padding:12px 0 18px 8px}.first-person .legend{color:#b9c5d1}.first-person .scene-word{display:none}}
#rotation-controls{display:flex;align-items:center;justify-content:space-between;margin-top:17px;color:#969da9;font-size:10px;letter-spacing:.1em}#rotation-controls button{background:#ffffff05;border:1px solid #ffffff15;border-radius:5px;width:34px;height:30px;font-size:21px;color:#bfc5cc}#rotation-controls button:hover{background:#ffffff12}.first-person #rotation-controls{color:#c3cbd8}
@media(max-width:740px){#rotation-controls{display:none}.stage-label span:first-child{font-size:9px;letter-spacing:.14em}}
@media(max-width:740px){#fragment-count{font-size:12px;letter-spacing:.07em}.mobile-controls button{height:40px}.stage-label span:first-child{font-size:10px}.first-person .stage-label span:last-child{font-size:11px}}

/* A compact mixer; the soundtrack starts on the first gameplay gesture. */
.header-actions{position:relative}#audio-panel{position:absolute;right:0;top:calc(100% + 16px);z-index:100;width:280px;padding:21px;background:#17212cf5;border:1px solid #758b9d66;border-radius:14px;box-shadow:0 18px 55px #0007;backdrop-filter:blur(20px);color:#e8eef4}#audio-panel[hidden]{display:none}.audio-title{display:flex;align-items:center;justify-content:space-between}.audio-title strong{font-size:17px;font-weight:500}.audio-title button{font-size:25px;background:none;border:0;color:#c6d4e0;cursor:pointer}#audio-panel p{font-size:13px;color:#a4b5c4;margin:9px 0 20px;line-height:1.5}#audio-panel label{display:flex;justify-content:space-between;font-size:14px;margin-top:17px}#audio-panel output{font-size:13px;color:#afc4d1}#audio-panel input{display:block;width:100%;margin:12px 0 0;accent-color:#9bcdd8;cursor:pointer}#audio-panel .audio-mute{width:100%;padding:11px;margin-top:22px;border:1px solid #72889a80;border-radius:7px;background:#253746;color:#e5f0f7;font-size:14px;cursor:pointer}#audio-message{display:block;margin-top:13px;color:#9eafbd;font-size:12px;line-height:1.5}.audio-muted{opacity:.65}#audio-panel :focus-visible{outline:2px solid #b4e7f1;outline-offset:4px}@media(max-width:740px){#audio-panel{right:-3px;width:min(280px,calc(100vw - 40px));top:calc(100% + 11px)}}

/* The next chapter shares the same quiet stone, with clear hands-on controls. */
.mechanic-panel{margin-top:22px;border-top:1px solid #92daca40;padding-top:18px;pointer-events:auto;width:240px;max-width:100%}.mechanic-panel[hidden],#look-controls[hidden],#seal-reticle[hidden]{display:none}.mechanic-heading{display:flex;gap:9px;align-items:center;color:#b3eee0}.mechanic-heading strong{font-size:14px;font-weight:500}.mechanic-emblem{font-size:24px;line-height:1}.mechanic-panel p{font-size:14px;line-height:1.55;color:#b0bac2;margin:10px 0 14px}.mechanic-action-row{display:flex;align-items:center;gap:9px}.mechanic-action-row button{font-size:14px;background:#bcdfd4;color:#13231f;padding:11px 15px;border-radius:6px;min-height:42px}.mechanic-action-row button:disabled{background:#25313a;color:#a1afb8;opacity:.75}.mechanic-action-row kbd{color:#b3eee0}#look-controls{display:flex;align-items:center;gap:5px;margin-top:11px}#look-controls span{font-size:12px;color:#a2b1ba;margin-right:5px}#look-controls button{width:33px;height:33px;background:#25313a;border:1px solid #ffffff14;border-radius:5px;font-size:19px}#seal-reticle{position:absolute;left:50%;top:50%;width:72px;height:72px;transform:translate(-50%,-50%);border:1px solid #b9e8de55;border-radius:50%;pointer-events:none;z-index:1;transition:border-color .15s,box-shadow .15s}#seal-reticle.aligned{border-color:#d7fff1;box-shadow:0 0 24px #9deed744,inset 0 0 18px #9deed722}.has-seal.first-person #crosshair{top:50%}.prototype-nav{display:flex;align-items:center;gap:7px}.prototype-nav>span{font-size:11px;letter-spacing:.12em;color:#8796a4;margin-right:3px}.prototype-nav button{display:flex;gap:6px;align-items:center;background:#ffffff05;border:1px solid #ffffff14;padding:9px 11px;border-radius:6px;font-size:13px;color:#d5dedf;white-space:nowrap}.prototype-nav button span{color:#8faaa7;font-size:12px}.prototype-nav button[aria-pressed=true]{border-color:#a5dfce88;background:#94cfba12;color:#d8f6ec}.chamber-group{margin:16px 0 7px;color:#9dd8c5;font-size:11px;letter-spacing:.08em}#chambers-dialog{max-height:85svh;overflow:auto}#chamber-list .chamber-name{font-size:14px;color:#e4e4df}#chamber-list small{display:block;margin-top:5px;color:#91b8ad;font-size:12px}#chamber-list button[aria-current=true]{border-color:#a6d8c766}.mechanism-chamber main{min-height:680px}.mechanism-chamber .chapter-panel{top:32px}.mechanism-chamber .chapter-panel h1{font-size:39px;margin:16px 0}.mechanism-chamber .objective{margin-top:22px}.mechanism-chamber #hint-button{margin-top:18px}
@media(max-width:1100px){.mechanic-panel p{font-size:13px}.prototype-nav button{padding:9px}.prototype-nav button span{display:none}.mechanism-chamber .chapter-panel h1{font-size:32px}.keyboard-guide{gap:10px}.keyboard-guide span:last-child{display:none}}
@media(max-width:740px){footer{height:auto;min-height:100px;flex-wrap:wrap;justify-content:center;gap:0;padding:12px 0}.journey-button{padding:7px 0}.prototype-nav{justify-content:center;width:100%;margin-top:7px}.prototype-nav button span{display:inline}.mechanism-chamber main{min-height:820px}.mechanism-chamber .chapter-panel{top:21px}.mechanism-chamber .chapter-panel h1{font-size:28px;margin:10px 0}.mechanism-chamber .chapter-panel>p{font-size:12px}.mechanism-chamber .objective{margin-top:12px}.mechanism-chamber #hint-button{margin-top:10px}.mechanic-panel{margin-top:13px;padding-top:11px;width:255px}.mechanic-panel p{font-size:13px;line-height:1.4;margin:7px 0 10px}.mechanic-heading strong{font-size:13px}.mechanic-action-row button{padding:9px 12px;font-size:13px;min-height:38px}.mechanic-action-row kbd{display:none}#look-controls{margin-top:8px}#look-controls button{width:34px;height:34px}.mechanism-chamber.first-person .chapter-panel h1{font-size:26px}.mechanism-chamber.first-person #view-compass{top:380px}.mechanism-chamber #hint-text{position:absolute;left:0;top:100%;z-index:6;width:min(290px,calc(100vw - 40px));border:1px solid #ffffff20;box-shadow:0 15px 35px #0008}.mechanism-chamber .stage-label span:last-child{white-space:normal;text-align:center}}

.race-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;border-top:1px solid #ffffff10}.race-bar span{font-size:12px;color:#c1bacf;font-variant-numeric:tabular-nums;letter-spacing:.03em}.race-bar button{font-size:13px}.race-dialog{width:min(540px,calc(100vw - 28px));max-height:calc(100svh - 32px);overflow:auto;padding:32px;box-sizing:border-box}.race-dialog h2{font-size:34px;margin:15px 0}.race-dialog p{font-size:15px}.race-dialog label{display:block;font-size:14px;color:#e7e2db;margin:18px 0 8px}.race-dialog input,.race-dialog select{box-sizing:border-box;width:100%;border:1px solid #ffffff30;background:#10151e;color:#f2ede5;font:inherit;font-size:16px;padding:12px;border-radius:7px}.race-dialog input:focus,.race-dialog select:focus{outline:2px solid #ffab76;outline-offset:3px}.welcome-controls{border-top:1px solid #ffffff14;border-bottom:1px solid #ffffff14;margin:18px 0;padding:3px 0}.welcome-controls p{display:grid;grid-template-columns:52px 1fr;gap:14px;margin:12px 0;line-height:1.5}.welcome-controls strong{color:#ffc49e}.race-dialog .race-note{font-size:13px;line-height:1.5;color:#aba9b5}.race-dialog .form-error{color:#ffc49e;font-size:14px;min-height:0}.race-dialog .form-error:empty{display:none}#practice-run{display:block;margin:16px auto 0;font-size:14px}.race-result{font-variant-numeric:tabular-nums;color:#ffc49e}#view-score{margin:0 auto 16px;font-size:14px}.board-scroll{overflow-x:auto}.race-dialog table{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums}.race-dialog th,.race-dialog td{text-align:left;padding:12px 7px;border-bottom:1px solid #ffffff12}.race-dialog th{color:#aaa5b4;font-weight:400}.race-dialog td:nth-child(2){overflow-wrap:anywhere;max-width:200px}.race-dialog td:nth-child(3){white-space:nowrap;color:#ffd1af}.board-actions{display:flex;justify-content:space-between;margin-top:12px}button:disabled{opacity:.5;cursor:wait}#leaderboard-button{font-size:14px;padding:8px}[hidden]{display:none!important}@media(max-width:740px){.race-dialog{padding:24px}.race-dialog h2{font-size:30px}.race-dialog p{font-size:14px}.welcome-controls p{grid-template-columns:42px 1fr;gap:9px}.race-bar span{font-size:11px;max-width:65%}.header-actions{gap:4px}#leaderboard-button{font-size:12px;padding:5px}.race-dialog table{font-size:13px}.race-dialog th,.race-dialog td{padding:10px 4px}}

.timed-replay{display:block;margin:0 auto 18px;font-size:14px;color:#ffc49e}

@media(max-width:740px){.journey-button{gap:14px}.progress-dots{gap:6px}}

/* Give phones a dedicated play surface, with the HUD outside the canvas. */
@media(max-width:740px){
 .app{height:100svh;height:100dvh;min-height:620px;display:flex;flex-direction:column;padding:0 max(12px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px,env(safe-area-inset-left))}
 header{height:48px;min-height:48px;gap:8px}
 .brand{font-size:14px;gap:6px;letter-spacing:.16em}.brand svg{width:23px}
 .header-actions{gap:0}.header-actions .icon-button{min-height:44px;min-width:44px;justify-content:center}
 #leaderboard-button{font-size:12px;padding:4px}
 main,.mechanism-chamber main{flex:1;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(180px,1fr) auto auto;gap:6px;height:auto;min-height:min-content;max-height:none;padding-top:6px}
 .chapter-panel,.mechanism-chamber .chapter-panel{position:relative;top:auto;left:auto;width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:0 8px;pointer-events:auto}
 .chapter-panel>.eyebrow{font-size:10px;letter-spacing:.08em;white-space:nowrap}.chapter-panel .little-line{display:none}
 .chapter-panel h1,.first-person .chapter-panel h1,.mechanism-chamber .chapter-panel h1,.mechanism-chamber.first-person .chapter-panel h1{grid-column:2 / -1;font-size:18px;line-height:1.3;letter-spacing:-.04em;margin:0}
 .chapter-panel>p:not(#hint-text){display:none}
 .chapter-panel .objective,.first-person .chapter-panel .objective,.mechanism-chamber .chapter-panel .objective{grid-column:1 / 3;align-items:center;margin:0;gap:6px}
 .objective strong{font-size:12px}.objective span:not(.diamond){display:none}.objective .diamond{font-size:20px}
 #hint-button,.mechanism-chamber #hint-button{grid-column:3;font-size:12px;min-height:36px;margin:0;padding:0;border:0;white-space:nowrap}
 #hint-text,.mechanism-chamber #hint-text{position:absolute;top:100%;left:0;margin:4px 0 0;width:min(320px,100%);z-index:6;padding:14px;font-size:14px;border:1px solid #ffffff20;box-shadow:0 15px 35px #0008}
 .perspective-panel{grid-row:2;position:static;display:flex;gap:6px;width:100%;min-width:0}
 .reality-button{flex:1;flex-direction:row;gap:7px;width:auto;min-width:0;min-height:44px;margin:0;padding:6px;border-radius:7px}
 .reality-icon{font-size:22px;width:24px}.reality-button strong{font-size:14px}
 .shift-button{flex:0 0 44px;width:44px;height:44px;margin:0}
 #stage{grid-row:3;position:relative;inset:auto;min-height:0;margin:0 -8px;overflow:hidden}
 #world{position:absolute;inset:0}
 .stage-label,.first-person .stage-label{bottom:8px;gap:4px;max-width:calc(100% - 16px);width:max-content;padding:0;background:none;backdrop-filter:none}
 .stage-label span:first-child{font-size:10px;letter-spacing:.1em}.stage-label span:last-child,.first-person .stage-label span:last-child{font-size:12px;white-space:normal;text-align:center}
 .first-person #stage:after{background:linear-gradient(180deg,#10121744,transparent 20%,transparent 75%,#101217cc)}
 .first-person #view-compass,.mechanism-chamber.first-person #view-compass{top:12px;font-size:10px}
 .first-person #crosshair{top:50%}
 .mobile-controls{grid-row:4;position:static;transform:none;gap:4px;padding:0}
 .mobile-controls div{gap:4px}.mobile-controls button{width:48px;height:44px;font-size:22px}
 .scene-bottom{grid-row:5;position:static;min-height:32px;gap:8px}
 .scene-bottom #reset{font-size:12px;min-height:32px}#fragment-count{font-size:12px}
 .race-bar{padding:3px 0;min-height:22px;flex-shrink:0}.race-bar span{font-size:11px;max-width:100%}
 footer{height:36px;min-height:36px;flex-shrink:0;padding:0}
 .journey-button{min-height:36px;padding:0;gap:14px}
 .mechanic-panel{grid-column:1 / -1;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;align-items:center;width:100%;margin:0;padding:6px 0;border-top:1px solid #92daca30}
 .mechanic-heading{gap:6px}.mechanic-heading strong{font-size:12px}.mechanic-emblem{font-size:18px}
 .mechanic-panel p{grid-column:1;grid-row:2;font-size:12px;line-height:1.35;margin:0}
 .mechanic-action-row{grid-column:2;grid-row:1 / 3}.mechanic-action-row button{min-height:44px;padding:8px 10px;font-size:13px}
 #look-controls{grid-column:1 / -1;justify-content:center;margin:0}#look-controls button{width:44px;height:44px}
}
