:root{color-scheme:dark;--blue:#336699;--ink:#0b192b;--text:#e1edfa;--muted:#91a8bc;--gold:#e9d49b}*{box-sizing:border-box}body{margin:0;background:radial-gradient(ellipse at 50% 0,#203a52,#091626 60%,#050d19);color:var(--text);font:14px Arial,Helvetica,sans-serif;padding:14px 22px}.shell{max-width:1600px;margin:auto;position:relative}button,input,select{font:inherit}button,a{touch-action:manipulation}button{padding:9px 12px;border:1px solid #415d77;border-radius:7px;color:#dfeefa;background:#152d43;cursor:pointer;font-size:11px;font-weight:bold;white-space:nowrap}button:hover{background:#28465f}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #89add6;outline-offset:3px}button:disabled{cursor:default}a{color:#aac9e7;text-decoration:none}a:hover{text-decoration:underline}header{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:0 0 13px}.brand{display:flex;align-items:center;gap:12px;color:#ecf4ff;text-decoration:none}.brand-mark{display:grid;place-items:center;width:35px;height:39px;font-size:23px;background:#336699;clip-path:polygon(0 20%,50% 0,100% 20%,100% 80%,50% 100%,0 80%)}.brand b{letter-spacing:3px;font-size:16px}.brand small{display:block;font-size:9px;letter-spacing:2px;color:var(--muted);padding-top:5px}nav{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.workspace{display:grid;grid-template-columns:minmax(0,1fr);gap:17px;align-items:start}.workspace.editor-open{grid-template-columns:minmax(0,1fr)minmax(400px,460px)}.game-column{min-width:0}.hud-top,.hud-bottom{position:relative;background-repeat:no-repeat;background-position:50% 50%;background-size:100% 315%;width:100%;height:95px;text-shadow:0 2px 3px #000}.hud-top{background-image:url('../editor/hud-top-v1.png')}.hud-bottom{background-image:url('../editor/hud-bottom-v2.png');height:113px}.hud-top small{display:block;color:#d1c5a7;font-size:8px;letter-spacing:1px;margin-bottom:4px}.hud-top strong{display:block;color:#fff1cc;font-size:17px;letter-spacing:.5px}.hud-avatar-label{position:absolute;left:16%;top:40%;width:9%;text-align:center;font-weight:900;color:#c3d8e9;letter-spacing:3px;font-size:18px}.hud-level{position:absolute;left:31%;top:31%;width:23%;text-align:center}.hud-score{position:absolute;left:65%;top:28%;width:9%;text-align:center}.hud-time{position:absolute;left:83%;top:28%;width:13%;text-align:center}.hud-score strong{color:#d4d2c7}.play-toolbar{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 2px 10px;font-size:10px;color:var(--muted)}.play-toolbar>div{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.play-toolbar button{padding:6px 9px;font-size:9px}.viewport{position:relative;isolation:isolate;aspect-ratio:12/7;border:1px solid #466179;border-radius:13px;overflow:hidden;background:#0b1c2c;box-shadow:0 20px 70px #0008,0 0 0 4px #09121f,0 0 0 5px #2a4055}.background{position:absolute;inset:0;background:radial-gradient(ellipse at 72% 22%,#416e76 0,#18364c 35%,#091a2d 82%);filter:brightness(var(--bg-brightness,.85)) saturate(var(--bg-saturation,.75))}.background[data-theme="rome"]{background-color:#261b18}.background[data-theme="castle"]{background-color:#152536}.background[data-theme="egypt"]{background-color:#2c1d11}.background[data-theme="iceland"]{background-color:#102938}canvas{position:relative;z-index:1;width:100%;height:100%;display:block;touch-action:none;outline:none}.scan{position:absolute;inset:0;pointer-events:none;z-index:3;opacity:var(--crt-opacity,.1);background:repeating-linear-gradient(0deg,transparent,transparent 2px,#050b154a 3px,#050b154a 4px);box-shadow:inset 0 0 70px #0004}.viewport:not(.crt) .scan{display:none}.world-badge,.viewport-note{position:absolute;z-index:2;pointer-events:none;color:#9eb9cd;font-size:9px;letter-spacing:1px;text-shadow:0 2px 3px #07111b}.world-badge{top:12px;left:15px}.viewport-note{bottom:10px;right:15px}.menu-overlay{position:absolute;inset:0;z-index:4;background:linear-gradient(90deg,#071528ed,#071528ba 35%,#07152800 80%);display:flex;align-items:center;padding:5.5%}.menu-copy{max-width:49%}.eyebrow{font-size:9px;font-weight:bold;letter-spacing:3px;color:#9fc0dc;margin-bottom:18px}h1{font-size:clamp(36px,5.8vw,87px);line-height:.92;letter-spacing:-3px;margin:0;color:#eaf2fb;text-shadow:0 4px 0 #244463}h1 span{display:block;font-size:clamp(10px,1vw,15px);line-height:1.5;letter-spacing:5px;margin-top:15px;color:#b4cad9}.menu-copy>p:not(.eyebrow){font-size:12px;line-height:1.7;color:#aabfd1;margin:22px 0}.row{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin:8px 0}.primary{background:#336699;border-color:#719ac0;color:#f1f7ff;padding:12px 16px}.primary:hover{background:#477caa}.menu-copy>a{display:block;font-size:10px;margin-top:20px;color:#8da8c1}.pause-overlay{position:absolute;inset:0;z-index:5;background:#05101cc9;display:grid;place-items:center;text-align:center;backdrop-filter:blur(4px)}.pause-overlay>div{padding:30px;border:1px solid #4c6881;border-radius:14px;background:#122b42e8}.pause-overlay p{font-size:12px;color:#adc1d1}.inventory{position:absolute;left:3.5%;width:32.2%;top:22%;height:58%;display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.inventory button{position:relative;border:0;background:none;color:#c1b498;font:9px Arial;padding:0;opacity:.7;text-align:right;padding-right:8px}.inventory span{display:block;text-align:center;font-size:20px;color:#716957}.meters{position:absolute;left:39%;top:13%;width:22.6%;height:76%;display:grid;grid-template-rows:repeat(3,1fr);gap:6px}.meters>div{display:grid;grid-template-columns:11% 1fr 11%;gap:8px;align-items:center;text-align:center;font:11px monospace;color:#ddd5b8}.meter{height:57%;display:flex;align-items:flex-end;gap:2px;padding:0 2px}.meter i{flex:1;height:75%;background:#080b10;box-shadow:inset 0 1px 0 #ffffff05}.meter i:nth-child(3n){height:95%}.meter i:nth-child(2n){height:86%}.energy i.lit{background:#c76d62;box-shadow:0 0 4px #ae49384d}.power i.lit{background:#336699}.battery i.lit{background:#eeeede;box-shadow:0 0 3px #e1e1b838}.meters output{font-size:9px}.hud-message{position:absolute;left:65%;width:30%;top:26%;height:54%;display:flex;flex-direction:column;justify-content:center;gap:6px}.hud-message b{font-size:11px;letter-spacing:1px;color:#e9d49b}.hud-message span{font-size:10px;line-height:1.45;color:#d0c1a4}.hud-message progress{width:100%;height:3px;accent-color:#336699}.footer-hint{font-size:11px;color:#8fa9bd;text-align:center;margin:2px 0 10px}.touch-controls{display:none;justify-content:space-between;gap:10px;margin:8px 0}.touch-controls>div{display:flex;gap:7px}.touch-controls button{min-width:45px;min-height:43px;touch-action:none;user-select:none}.touch-controls .fire{min-width:80px;background:#254d72}.editor-panel{padding:17px;border:1px solid #36536d;border-radius:12px;background:linear-gradient(130deg,#163049,#0b1c2e);max-height:calc(100dvh - 80px);overflow:auto;position:sticky;top:12px}.editor-panel h2{font-size:13px;letter-spacing:1.5px;margin-top:0}.editor-panel h3{font-size:10px;letter-spacing:2px;color:#9fb7cb;margin:23px 0 10px}.muted{font-size:11px;line-height:1.55;color:#8fa8be}.editor-panel label,.floating-panel label{display:block;font-size:11px;line-height:1.6;color:#b9ccdc;margin:12px 0}.editor-panel input:not([type=range]),.editor-panel select{width:100%;margin-top:5px;background:#0d2136;color:#e0ecf8;border:1px solid #3b5d7a;border-radius:6px;padding:7px 8px}.editor-panel input[type=range],.floating-panel input{display:block;width:100%;min-height:26px;accent-color:#648db4}.editor-panel output,.floating-panel output{float:right;color:#e0d4ae;font-size:10px}.tools{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:17px 0}.tools [aria-pressed=true]{background:#336699;border-color:#a1bdd4;color:#fff}.tools button{white-space:normal;min-height:39px}.tools button:last-child{grid-column:1/-1}.editor-panel .row button{flex:1;white-space:normal;min-height:35px;font-size:10px}.pan-buttons{display:flex;gap:4px;flex-wrap:wrap}.pan-buttons button{padding:7px 10px}.editor-status{font-size:11px;line-height:1.6;color:#c5d9e7;background:#081a2ba3;padding:10px;border-radius:6px;white-space:pre-wrap;overflow-wrap:anywhere}.editor-panel>a{font-size:10px}.floating-panel{position:absolute;right:0;top:50px;z-index:20;width:min(310px,100%);padding:17px;border:1px solid #4d6c85;border-radius:12px;background:#0e2439f7;box-shadow:0 20px 70px #0008}.panel-title{display:flex;justify-content:space-between;align-items:center}.panel-title b{font-size:12px;letter-spacing:2px}.floating-panel .row button{padding:7px;font-size:9px}.help-panel{position:absolute;right:0;top:50px;z-index:21;width:min(480px,100%);max-height:calc(100dvh - 70px);overflow:auto;padding:25px;border:1px solid #4b6b85;border-radius:12px;background:#0c2236f7;box-shadow:0 20px 70px #000a}.help-panel h2{font-size:22px}.help-panel p{font-size:12px;line-height:1.75;color:#b7cbdc}.help-panel a{font-size:11px}.close{position:absolute;right:12px;top:12px}.boot-error{position:absolute;inset:0;z-index:40;display:grid;place-items:center;padding:30px;background:#0b1828eb;color:#f2ceac;text-align:center}footer{display:flex;justify-content:space-between;color:#516d86;font-size:9px;letter-spacing:1px;padding:9px 1px}footer a{color:#7595af}[hidden]{display:none!important}@media(max-width:1000px){.workspace.editor-open{grid-template-columns:minmax(0,1fr)240px}.editor-panel{padding:12px}.hud-top{height:76px}.hud-bottom{height:96px}.hud-top strong{font-size:13px}.hud-top small{font-size:6px}.hud-avatar-label{font-size:13px}.hud-message b{font-size:9px}.hud-message span{font-size:9px}.meters>div{gap:3px;font-size:9px}.meter{gap:1px}.meters output{font-size:7px}.menu-copy{max-width:55%}.menu-copy>p:not(.eyebrow){font-size:10px;margin:15px 0}.menu-copy .row button{font-size:10px;padding:10px}.eyebrow{font-size:7px;margin-bottom:12px}.world-badge,.viewport-note{font-size:7px}}@media(pointer:coarse),(max-width:800px){.touch-controls{display:flex}}@media(max-width:700px){body{padding:12px 9px}.brand b{font-size:12px;letter-spacing:1.5px}.brand small{font-size:7px;letter-spacing:.5px}header{align-items:flex-start;gap:8px}.brand-mark{display:none}nav{max-width:58%;gap:4px}nav button{padding:7px;font-size:8px}.workspace.editor-open{grid-template-columns:1fr}.editor-panel{position:relative;top:0;max-height:none}.hud-top{height:63px}.hud-bottom{height:75px}.hud-top strong{font-size:10px}.hud-top small{font-size:5px}.hud-avatar-label{font-size:10px}.hud-message{top:22%;height:58%;gap:3px}.hud-message b{font-size:7px;letter-spacing:0}.hud-message span{font-size:7px}.meters{gap:3px}.meters>div{font-size:7px;gap:2px}.meters output{font-size:6px}.inventory{gap:2px}.inventory button{font-size:6px;padding-right:2px}.inventory span{font-size:12px}.play-toolbar{font-size:8px;align-items:flex-start}.play-toolbar button{font-size:7px;padding:5px}.viewport{border-radius:9px}.menu-copy{max-width:62%}h1{font-size:clamp(29px,9vw,52px);letter-spacing:-2px}h1 span{font-size:7px;letter-spacing:2px;margin-top:9px}.menu-copy>p:not(.eyebrow){font-size:8px;line-height:1.5;margin:10px 0}.menu-copy .row{gap:4px}.menu-copy .row button{padding:7px;font-size:8px}.menu-copy>a{font-size:7px;margin-top:9px}.eyebrow{font-size:6px;letter-spacing:1.5px;margin-bottom:10px}.world-badge{top:7px;left:9px;font-size:6px}.viewport-note{bottom:6px;right:8px;font-size:6px}.footer-hint{font-size:9px}.floating-panel,.help-panel{position:fixed;top:12px;right:12px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto}footer{font-size:7px}}

.hud-level strong{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Desktop fit: keep both native HUD strips visible. Small/touch screens scroll normally. */
@media (min-width:901px) and (min-height:600px) and (pointer:fine){
 .viewport{height:auto;max-height:calc(100dvh - 330px);min-height:180px;aspect-ratio:12/7}
 .editor-panel{max-height:calc(100dvh - 110px)}
}
@media (min-width:901px) and (min-height:600px) and (max-height:800px) and (pointer:fine){
 .menu-overlay{padding:3.5% 5%}.menu-copy .eyebrow{margin:0 0 10px}h1{font-size:clamp(38px,4.4vw,64px)}h1 span{margin-top:9px;font-size:10px}.menu-copy>p:not(.eyebrow){margin:12px 0;font-size:10px}.menu-copy .row button{padding:10px 13px}.menu-copy>a{margin-top:12px}
}

@media(min-width:901px) and (min-height:600px) and (pointer:fine){.viewport{width:100%;aspect-ratio:auto}}

/* One consistent RAI-blue instrument housing, shared by both HUD bars. */
.hud-top,.hud-bottom{background-image:none;background:linear-gradient(125deg,#274b6c 0%,#173651 45%,#122b43 100%);border:1px solid #557a9e;border-radius:12px;box-shadow:inset 0 1px 0 #94b5d244,inset 0 -3px 0 #081b2d88,0 4px 14px #0003;text-shadow:none;color:#e4eef8}
.hud-top{height:88px;display:grid;grid-template-columns:150px minmax(0,1fr)100px 140px;align-items:stretch;overflow:hidden}.hud-avatar-label,.hud-level,.hud-score,.hud-time{position:static;left:auto;top:auto;width:auto;height:auto;padding:15px 20px;text-align:left;min-width:0}.hud-avatar-label{display:flex;align-items:center;gap:12px;padding:9px 14px;font:800 17px/1.25 system-ui;letter-spacing:2px}.hud-avatar-label img{width:47px;height:58px;object-fit:contain;flex:none}.hud-avatar-label span{display:block}.hud-avatar-label small{font:9px/1.3 system-ui;letter-spacing:1px;white-space:nowrap;margin-top:4px}.hud-level,.hud-score,.hud-time{border-left:1px solid #5a80a14d;display:flex;justify-content:center;flex-direction:column}.hud-top small{color:#a4bed7;font:600 9px/1.4 system-ui;letter-spacing:1px;margin-bottom:5px}.hud-top strong{font:700 16px/1.3 system-ui;color:#edf4fb;letter-spacing:.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hud-score strong,.hud-time strong{font-variant-numeric:tabular-nums}.hud-bottom{height:112px;padding:14px 18px;display:grid;grid-template-columns:minmax(230px,1fr) minmax(210px,.85fr) minmax(240px,1.3fr);gap:20px;align-items:stretch;overflow:hidden}.inventory{position:static;left:auto;top:auto;width:auto;height:auto;gap:7px}.inventory button{position:relative;opacity:1;text-align:left;padding:5px 8px;border:1px solid #456b8d;background:linear-gradient(#0e2942,#0a2035);border-radius:6px;color:#8da9c4;font:600 11px/1.4 system-ui;box-shadow:inset 0 1px 3px #02091299}.inventory span{font:16px/1.6 system-ui;color:#456583}.meters{position:static;width:auto;height:auto;grid-template-rows:repeat(3,minmax(0,1fr));gap:5px}.meters>div{font:700 12px/1.2 system-ui;gap:7px;grid-template-columns:13px 1fr 28px;color:#c7d9e9}.meters output{font:700 10px/1.2 system-ui;color:#afc7dd;font-variant-numeric:tabular-nums}.meter{height:17px;padding:2px 3px;background:#071a2d;border:1px solid #385b79;border-radius:3px;gap:3px}.meter i{background:#142d44;box-shadow:none}.energy i.lit{background:#cb716b;box-shadow:none}.power i.lit{background:#5a85b1}.battery i.lit{background:#e5edf5;box-shadow:none}.hud-message{position:static;width:auto;height:auto;padding-left:19px;border-left:1px solid #52799b66;gap:6px;min-width:0}.hud-message b{color:#deebf6;font:700 11px/1.35 system-ui;letter-spacing:1px}.hud-message span{font:12px/1.45 system-ui;color:#b0c8dd}.hud-message progress{height:4px;accent-color:#6a96c1}.play-toolbar button[aria-pressed=true]{background:#336699;border-color:#86afd2;color:#fff}
@media(max-width:1100px){.hud-top{grid-template-columns:125px minmax(0,1fr)80px 120px}.hud-avatar-label,.hud-level,.hud-score,.hud-time{padding-left:12px;padding-right:12px}.hud-bottom{grid-template-columns:minmax(190px,1fr) minmax(190px,1fr) minmax(205px,1.1fr);gap:14px;padding:13px}.hud-message{padding-left:13px}.hud-message span{font-size:11px}.hud-avatar-label{gap:7px}.hud-avatar-label img{width:40px}}
@media(max-width:700px){.hud-top{height:82px;grid-template-columns:80px minmax(0,1fr)55px 80px}.hud-avatar-label{gap:4px;padding:8px;font-size:10px;letter-spacing:.5px}.hud-avatar-label img{width:30px;height:43px}.hud-avatar-label small{display:none}.hud-level,.hud-score,.hud-time{padding:10px 8px}.hud-top strong{font-size:12px}.hud-top small{font-size:8px;letter-spacing:.25px}.hud-bottom{height:auto;min-height:150px;grid-template-columns:1fr 1fr;gap:12px;padding:12px}.inventory{min-height:64px}.hud-message{grid-column:1/-1;padding:8px 0 0;border-left:0;border-top:1px solid #52799b66;gap:3px}.hud-message span{font-size:11px}.meter{gap:2px}.hud-message progress{height:3px}}

#focus-pause-status{color:#bdd4e8;font-size:10px;line-height:1.4}.play-toolbar>span{min-width:0;flex:1}

/* Classic five-slot order, in the retained RAI-blue housing. */
.hud-bottom{grid-template-columns:minmax(270px,1.15fr) minmax(200px,.8fr) minmax(230px,1.05fr);gap:16px}
.inventory{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.inventory button{display:flex;flex-direction:column;justify-content:space-between;align-items:center;min-width:0;padding:7px 3px;background:linear-gradient(150deg,#102d49,#081c30);border:2px solid #355c7f;box-shadow:inset 2px 2px 5px #020b16aa,inset -1px -1px 0 #6789a344;color:#8caaca}
.inventory .slot-number{align-self:flex-start;font-size:9px;color:#7796b5;line-height:1}
.inventory .slot-name{font:700 9px/1.25 system-ui;letter-spacing:.2px;color:#c3daf0;text-shadow:0 0 7px #75a5d36b;text-align:center;white-space:normal;overflow-wrap:normal}
.inventory .slot-count{font:10px/1.2 system-ui;color:#7694b0}
@media(max-width:700px){.hud-bottom{grid-template-columns:minmax(170px,1.2fr) minmax(110px,.8fr);height:auto;min-height:100px;gap:9px;padding:9px}.hud-message{grid-column:1/-1;border:0;padding:0;display:flex;flex-direction:row;flex-wrap:wrap}.inventory .slot-name{font-size:7px}.inventory button{min-height:58px}.inventory .slot-count{font-size:8px}}

/* Camera-projected object names; no pointer overlay over the canvas/editor. */
#hammer-object-layer{position:absolute;inset:0;z-index:4;overflow:hidden;pointer-events:none}
.hammer-world-object{position:absolute;left:0;top:0;color:var(--item-color,#fff);border:1px solid currentColor;border-radius:5px;background:rgba(5,13,22,.88);padding:4px 7px;font:800 10px/1.2 ui-monospace,monospace;letter-spacing:.04em;white-space:nowrap;box-shadow:0 0 9px color-mix(in srgb,var(--item-color,#fff) 45%,transparent);text-shadow:0 1px 1px #000;will-change:transform}
.hammer-world-object[data-type="in"],.hammer-world-object[data-type="out"]{min-width:32px;min-height:44px;border-width:2px;border-radius:14px 14px 3px 3px;display:grid;place-items:center;font-size:12px;background:linear-gradient(90deg,rgba(2,7,12,.94),rgba(16,33,47,.94));box-shadow:inset 0 0 10px #000,0 0 10px var(--item-color)}
#tools [data-tool="in"],#tools [data-tool="out"],#tools [data-tool="potion"],#tools [data-tool="key"],#tools [data-tool="time-capsule"],#tools [data-tool="hint-book"],#tools [data-tool="battery"]{color:var(--item-color);border-color:var(--item-color);font-size:10px;line-height:1.35;min-height:38px}
.inventory [data-inventory]:not(:disabled){color:var(--item-color);border-color:var(--item-color)}
.play-toolbar>div{flex-wrap:wrap;justify-content:flex-end}

/* One left-aligned game workspace and a readable compact tool workbench. */
body{padding:10px 12px;background:radial-gradient(ellipse at 20% 0,#24415d,#0b1b2c 58%,#07121f)}
.shell{max-width:none;margin:0;width:100%}header{padding:2px 0 10px;gap:14px;border-bottom:1px solid #3c5c7655;margin-bottom:10px}.brand b{letter-spacing:2px;font-size:15px}nav{gap:7px}nav button{font-size:11px;padding:9px 11px}nav button[aria-pressed=true]{background:#336699;border-color:#86afd2}
.workspace{gap:14px}.workspace.editor-open{grid-template-columns:minmax(0,1fr)420px;align-items:start}.game-column{min-width:0}.hud-top{height:76px}.hud-bottom{height:104px}.hud-avatar-label img{height:51px}.hud-avatar-label,.hud-level,.hud-score,.hud-time{padding-top:11px;padding-bottom:11px}.play-toolbar{gap:8px;align-items:flex-start;padding:8px 1px}.play-toolbar>span{font-size:10px;line-height:1.7}.play-toolbar button{padding:7px 8px;font-size:10px}.footer-hint{margin:7px 0;font-size:11px}
.editor-workbench{width:100%;padding:14px;border:1px solid #527799;border-radius:12px;background:linear-gradient(150deg,#1b3650ee,#0b2034f5);box-shadow:0 8px 30px #0004,inset 0 1px 0 #c4e5ff1a;scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#426486 #10273d}
#editor-workbench-heading{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding-bottom:10px;border-bottom:1px solid #6182a144;margin-bottom:12px}#editor-workbench-heading h2{margin:0;font:750 13px/1.4 system-ui;letter-spacing:1px;flex:1}#editor-mode-badge{font:700 9px/1.3 system-ui;letter-spacing:.7px;padding:5px 7px;border:1px solid #5b7d9b;border-radius:5px;color:#bbd5e9;background:#15304a}#editor-mode-badge.testing{color:#f1d997;border-color:#a68d54;background:#493b24}
#test-editor-return{width:100%;background:#336699;border-color:#8caecb}.editor-workbench label{margin:10px 0;font-size:11px}.editor-workbench h3{font:700 10px/1.4 system-ui;margin:17px 0 9px;letter-spacing:1px}.editor-workbench .muted{font-size:11px;line-height:1.5}.editor-workbench>p.muted{margin:6px 0 12px}.editor-workbench .row{gap:6px}.editor-workbench .row button{min-height:34px;font-size:10px}.editor-test-action{position:sticky;bottom:-14px;z-index:6;padding:10px 0;background:linear-gradient(transparent,#0d2237 28%);margin:4px 0 8px}.editor-test-action button{font-size:11px!important;letter-spacing:.5px}
#selected-tool-inspector{display:grid;grid-template-columns:72px minmax(0,1fr);gap:11px;align-items:center;background:#081b2e88;border:1px solid #426180;border-radius:9px;padding:10px;margin-bottom:13px}#selected-tool-inspector small{font:600 8px/1.4 system-ui;letter-spacing:1.3px;color:#8caecb}#selected-tool-name{display:block;font:750 12px/1.5 system-ui;color:#e2effb}#selected-tool-description{font:11px/1.45 system-ui;color:#a7c2d8;margin:3px 0 6px}#selected-tool-cell{display:block;float:none;font:10px/1.4 ui-monospace,monospace;color:#8faec7}

/* Theme & Stone Texture selector block in active editor */
.theme-material-section{background:#091e32b8;border:1px solid #436482;border-radius:9px;padding:9px 10px;margin:0 0 10px}
.theme-material-header{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:6px}
.theme-material-header b{font:750 10px/1.3 system-ui;letter-spacing:1px;color:#c8dff2}
#active-theme-pill{font:700 9px/1.2 ui-monospace,monospace;padding:3px 6px;border-radius:4px;background:#153450;border:1px solid #5980a3;color:#e3f0fc}
.theme-material-section label{margin:6px 0;font-size:10px;color:#b8cfe2}
.theme-material-section select{margin-top:3px;padding:6px 7px;font-size:11px}
.theme-chip-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;margin:6px 0}
.theme-chip-row button{padding:5px 4px;font-size:10px;min-height:28px;border-radius:6px;background:#112940;border:1px solid #3f617f}
.theme-chip-row button[aria-pressed="true"]{background:#336699;border-color:#b6d2ea;color:#fff;box-shadow:0 0 8px #33669966}
.variant-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.swatch-group{margin-top:6px}
.swatch-group small{display:block;font:700 8px/1.3 system-ui;letter-spacing:1px;color:#8fb0cc;margin-bottom:4px}
.swatch-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
.variant-swatch{display:flex;flex-direction:column;align-items:center;gap:3px;padding:4px 2px;min-height:38px;font:650 8.5px/1.1 system-ui;border-radius:5px;background:#0e2438;border:1px solid #3b5c78;color:#cbe0f2}
.variant-swatch span{display:block;width:20px;height:14px;border-radius:3px;background:var(--swatch-color,#8ea2b2);border:1px solid var(--swatch-gleam,#d9e6f2);box-shadow:inset 0 2px 0 rgba(255,255,255,.28)}
.variant-swatch.breakable-swatch span{background:linear-gradient(90deg,transparent 44%,#171d24 45% 55%,transparent 56%),linear-gradient(0deg,transparent 44%,#171d24 45% 55%,transparent 56%),var(--swatch-color,#9c8a6c);border-color:var(--swatch-mortar,#251d16);box-shadow:none}
.variant-swatch[aria-pressed="true"]{background:#295680;border-color:#c6dff5;color:#fff}

#tools{display:block;margin:0}.tool-category{border-top:1px solid #5c7a9544;padding:9px 0 5px}.tool-category>summary{font:750 11px/1.5 system-ui;color:#c9dfef;cursor:pointer;margin-bottom:8px;list-style-position:inside}.tool-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.tool-grid .tool-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:69px;padding:7px 4px;line-height:1.3;font:650 10px/1.3 system-ui!important;letter-spacing:0;text-align:center;white-space:normal;grid-column:auto!important;background:linear-gradient(150deg,#173b59,#102941);border:1px solid #456b8c;border-radius:7px;box-shadow:inset 0 1px 0 #cce5ff12}.tool-grid .tool-card:hover{background:#244d70;border-color:#8cabca}.tool-grid .tool-card[aria-pressed=true]{background:linear-gradient(150deg,#3c6d99,#214d77);border-color:#bdd3e6;box-shadow:inset 0 0 0 1px #a5cae977,0 0 8px #33669950}.tool-grid .tool-card:disabled{opacity:.55}
.tool-card-visual,#selected-tool-preview{display:block;position:relative;flex:none;width:28px;height:27px;pointer-events:none;border-radius:4px;background:#223d53;border:1px solid #7b9aaf;box-shadow:0 2px 4px #0006}.tool-card-visual[data-kind=stone],#selected-tool-preview[data-kind=stone]{background:linear-gradient(135deg,#c4d2d1,#78999f);border-color:#dae5df;box-shadow:inset 0 0 0 2px #78989d,inset 3px 3px 0 #d5e0da,0 3px 5px #0007}.tool-card-visual[data-kind=breakable],#selected-tool-preview[data-kind=breakable]{background:linear-gradient(90deg,transparent 45%,#233b47 46% 53%,transparent 54%),linear-gradient(0deg,transparent 45%,#233b47 46% 53%,transparent 54%),linear-gradient(135deg,#9eb1ae,#6c858b);border-color:#adbfbc}.tool-card-visual[data-kind=steel],#selected-tool-preview[data-kind=steel]{background:repeating-linear-gradient(135deg,#607f92 0 5px,#496879 5px 10px);border:3px ridge #a6bac8}.tool-card-visual[data-kind=ladder],#selected-tool-preview[data-kind=ladder]{background:repeating-linear-gradient(0deg,transparent 0 5px,#b38559 5px 8px,transparent 8px 12px);border:0;border-left:4px solid #9b6b43;border-right:4px solid #9b6b43;border-radius:0;width:21px;box-shadow:0 2px 4px #0006}.tool-card-visual[data-kind=erase],#selected-tool-preview[data-kind=erase]{background:linear-gradient(140deg,#bad0dc 0 48%,#ab5864 49%);transform:rotate(-15deg);border-color:#d6e0e7;width:26px;height:17px}
.tool-card-visual[data-kind=in],.tool-card-visual[data-kind=out],#selected-tool-preview[data-kind=in],#selected-tool-preview[data-kind=out]{background:linear-gradient(90deg,#0b2237,#284d65,#0b2237);border:2px solid var(--item-color,#7caed6);border-radius:9px 9px 2px 2px;width:23px;height:31px}.tool-card-visual[data-kind=potion],.tool-card-visual[data-kind=key],.tool-card-visual[data-kind=time-capsule],.tool-card-visual[data-kind=hint-book],.tool-card-visual[data-kind=battery]{border-color:var(--item-color,#c9dbeb);color:var(--item-color,#c9dbeb);background:#0a1c2d}.tool-card-visual[data-kind=potion]:after{content:'P';}.tool-card-visual[data-kind=key]:after{content:'K';}.tool-card-visual[data-kind=time-capsule]:after{content:'T';}.tool-card-visual[data-kind=hint-book]:after{content:'?';}.tool-card-visual[data-kind=battery]:after{content:'B';}.tool-card-visual:after{position:absolute;inset:0;display:grid;place-items:center;font:800 15px/1 ui-monospace,monospace}
#selected-tool-preview{width:62px;height:58px;display:grid;place-items:center;background:#0a1b2b;border-color:var(--item-color);color:var(--item-color)}#selected-tool-preview[data-kind=ladder]{width:43px;height:60px}#selected-tool-preview[data-kind=erase]{width:53px;height:35px}#selected-tool-preview[data-kind=in],#selected-tool-preview[data-kind=out]{width:48px;height:62px}#selected-tool-preview span{font:800 8px/1.3 ui-monospace,monospace;text-align:center;padding:3px;white-space:normal}.editor-workbench #hammer-media-controls .rai-media{padding:9px}.editor-workbench #hammer-media-controls .rai-media label{font-size:11px;margin:6px 0}.editor-workbench #hammer-media-controls .rai-media select{font-size:11px;padding:7px}.editor-workbench #world-size-controls .row{display:grid;grid-template-columns:1fr 1fr}.editor-workbench #world-size-controls label{margin:4px 0}.editor-workbench #world-resize{width:100%}
#hammer-media-controls,#world-size-controls{border:1px solid #4c6a854d;border-radius:6px;padding:8px 9px;margin:8px 0;background:#0d243877}#hammer-media-controls>summary,#world-size-controls>summary{font:700 10px/1.5 system-ui;letter-spacing:.5px;color:#a9c7df;cursor:pointer}#hammer-media-controls[open]>summary,#world-size-controls[open]>summary{margin-bottom:9px}summary:focus-visible{outline:2px solid #89add6;outline-offset:3px}
@media(min-width:901px) and (min-height:600px) and (pointer:fine){.viewport{max-height:none;min-height:180px}.editor-panel{top:10px;max-height:calc(100dvh - 90px)}}
@media(min-width:1900px){.workspace.editor-open{grid-template-columns:minmax(0,1440px)460px;max-width:1914px}.workspace:not(.editor-open){max-width:1814px}}
@media(max-width:1100px) and (min-width:761px){.workspace.editor-open{grid-template-columns:minmax(0,1fr)340px}.hud-top{grid-template-columns:95px minmax(0,1fr)70px 92px}.hud-avatar-label img{width:30px}.hud-avatar-label{font-size:11px;padding:8px;gap:5px}.hud-avatar-label small{display:none}.hud-bottom{grid-template-columns:minmax(170px,1.1fr)minmax(145px,.9fr);height:121px;padding:10px;gap:8px}.hud-message{grid-column:1/-1;border:0;padding:0;display:flex;flex-direction:row;flex-wrap:wrap;font-size:10px}.hud-message progress{display:none}.inventory .slot-name{font-size:8px}.meter{gap:2px}.hud-top strong{font-size:12px}.play-toolbar{flex-wrap:wrap}.play-toolbar>span{flex-basis:100%}.play-toolbar>div{justify-content:flex-start}}
@media(max-width:760px){body{padding:8px}.workspace.editor-open{grid-template-columns:minmax(0,1fr)}header{align-items:flex-start;gap:8px;flex-wrap:wrap}.brand{flex:1}.brand b{font-size:12px}nav{max-width:none;gap:5px}nav button{font-size:9px;padding:7px}.editor-panel{position:relative;top:0;max-height:none}.editor-workbench{padding:12px}.tool-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.hud-top{height:70px}.hud-bottom{height:auto;min-height:110px}.play-toolbar{flex-wrap:wrap}.play-toolbar>div{justify-content:flex-start}.play-toolbar button{font-size:9px}.editor-test-action{bottom:0}.editor-workbench .muted{font-size:11px}}

/* Keep the robot visible when standing in the entry portal. */
.hammer-world-object[data-type="in"]{background:transparent;box-shadow:0 0 10px var(--item-color);font-size:0}
.hammer-world-object[data-type="in"]::before{content:"IN";position:absolute;top:-14px;left:50%;transform:translateX(-50%);font:800 10px/1 ui-monospace,monospace;color:var(--item-color);text-shadow:0 0 5px #000}

/* Goal controls, collected-only slots and short editor pages. */
.map-goals{display:grid;grid-template-columns:1fr 1fr;gap:8px}.map-goals label{min-width:0}.map-goals small{font-size:9px;color:#a9c7df}.inventory button[hidden]{display:none!important}.inventory button:not([hidden]){opacity:1;color:#e1edfa}.tool-category:not([open]){padding-bottom:5px}.tool-category:not([open])>summary{margin-bottom:0}.editor-workbench .tool-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.editor-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:0 0 9px}.editor-tabs button{min-width:0;padding:8px 4px}.editor-tabs button[aria-selected=true]{background:#336699;border-color:#a9c9e5}.editor-pane[hidden]{display:none!important}.editor-workbench{padding:10px!important}#selected-tool-inspector{padding:7px;margin-bottom:7px}.editor-workbench .tool-grid .tool-card{min-height:60px}.editor-workbench .tool-category{padding:6px 0 4px}.editor-workbench .editor-test-action{padding:5px 0;margin:2px 0}.editor-workbench .row button{min-height:30px}#editor-save-section{border:1px solid #4c6a854d;border-radius:6px;padding:8px 9px;margin:8px 0;background:#0d243877}#editor-save-section>summary{font:700 10px/1.5 system-ui;color:#a9c7df;cursor:pointer}#editor-save-section[open]>summary{margin-bottom:7px}#editor-pane-level #hammer-media-controls,#editor-pane-level #world-size-controls{margin:8px 0}.editor-pane .rai-point-editor{margin-top:0!important}
@media(max-width:1100px){.editor-workbench .tool-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:760px){.editor-workbench .tool-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}@media(max-width:460px){.map-goals{grid-template-columns:1fr}.variant-grid{grid-template-columns:1fr}}

/* At a normal desktop height, the Level page uses width instead of a second scroll area.
   Short and narrow screens retain the panel's ordinary scrolling behavior. */
@media (min-width:1101px) and (min-height:600px) {
 #editor-pane-level:not([hidden]){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-areas:"intro intro" "media world" "name name" "goals goals" "energy energy" "save color" "note note";column-gap:9px;row-gap:3px;align-items:start}
 #editor-pane-level>p.muted{grid-area:intro;margin:0 0 2px}
 #editor-pane-level #hammer-media-controls{grid-area:media;margin:0}
 #editor-pane-level #world-size-controls{grid-area:world;margin:0}
 #editor-pane-level>label:has(#map-name){grid-area:name;margin:2px 0}
 #editor-pane-level>.map-goals{grid-area:goals;gap:8px}
 #editor-pane-level>.map-goals label{margin:2px 0}
 #editor-pane-level>label:has(#map-energy){grid-area:energy;margin:2px 0}
 #editor-pane-level>#editor-save-section{grid-area:save;margin:1px 0}
 #editor-pane-level>label:has(#rai-color-select){grid-area:color;margin:1px 0}
 #editor-pane-level>#test-editor-note{grid-area:note;margin:2px 0;line-height:1.25}
 #editor-pane-tools #editor-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
}
