/* Preserve the Owner's sculpted frame; tint only its image, never live text. */
body{--hammer-hud-filter:grayscale(.95) brightness(1.05);--hammer-hud-text:#f2f0e8;--hammer-hud-muted:#c8c9cb;--hammer-hud-accent:#d2d8e1}
body[data-hammer-hud-theme="iceland"]{--hammer-hud-filter:grayscale(1) sepia(1) saturate(2.3) hue-rotate(163deg) brightness(.93);--hammer-hud-text:#edf8ff;--hammer-hud-muted:#bddbf5;--hammer-hud-accent:#90ccff}
body[data-hammer-hud-theme="castle"]{--hammer-hud-filter:grayscale(1) brightness(.95);--hammer-hud-text:#f2f3f7;--hammer-hud-muted:#c5c8d2;--hammer-hud-accent:#c9d1e3}
body[data-hammer-hud-theme="egypt"]{--hammer-hud-filter:sepia(1) saturate(1.65) brightness(.87);--hammer-hud-text:#fff0c7;--hammer-hud-muted:#e9d399;--hammer-hud-accent:#edc564}
body:not([data-hammer-mode="menu"]) :is(.hud-top.hammer-stone-hud,.hud-bottom){background:#000;isolation:isolate}
body:not([data-hammer-mode="menu"]) :is(.hud-top.hammer-stone-hud,.hud-bottom)::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:-1;filter:var(--hammer-hud-filter);background-repeat:no-repeat}
body:not([data-hammer-mode="menu"]) .hud-top.hammer-stone-hud::before{background-image:url('owner-hud-battery160.png');background-position:center 49.1902834%;background-size:100% 313.8528139%}
body:not([data-hammer-mode="menu"]) .hud-bottom::before{background-image:url('owner-hud-bottom97.png');background-position:center 45.5882353%;background-size:100% 400.5524862%}
body .hud-top.hammer-stone-hud strong,body .hud-bottom .hud-message b,body .hud-bottom .slot-count{color:var(--hammer-hud-text)}
body .hud-top.hammer-stone-hud small,body .hud-bottom .hud-message span,body .hud-bottom .meters{color:var(--hammer-hud-muted)}
body .hud-bottom .battery i.lit{background:var(--hammer-hud-accent)}
body .hud-bottom .inventory button[data-empty="true"]{opacity:1}
body .hud-bottom .inventory button[data-empty="true"] :is(.hammer-inventory-sprite,.slot-name,.slot-count){display:none!important}
body .hud-bottom .inventory .slot-number{color:var(--hammer-hud-muted);opacity:.65}
body .hammer-world-object[data-type="treasure"]{--item-color:var(--hammer-hud-accent)!important}

.hud-top #hud-energy-value{display:flex;gap:2px;align-items:center;justify-content:center;font-size:clamp(12px,1.7vw,25px);white-space:nowrap}
.hud-top .techman-heart.full{color:var(--hammer-hud-accent);text-shadow:0 1px 2px #000,0 0 5px #ffffff30}
.hud-top .techman-heart.empty{color:#111a21;text-shadow:0 1px 0 #ffffff35}
body .hud-top.hammer-stone-hud strong{font-weight:900;font-size:clamp(12px,1.6vw,25px)}
body .hud-top.hammer-stone-hud small{font-weight:800;font-size:clamp(7px,.75vw,12px)}
body .hud-bottom .hud-message b{font-size:clamp(8px,.8vw,13px);font-weight:900}
.hud-top .hud-heart159{display:none}
#techman-drill-seconds{font-size:clamp(12px,1.2vw,19px);transform:translate(-50%,-50%)}
.techman-timing{font:800 10px Orbitron,sans-serif;display:inline-flex;align-items:center;gap:4px}.techman-timing input{padding:4px;color:#e9f2ff;background:#152c43;border:1px solid #6788ab}
body[data-hammer-mode="play"][data-hammer-test="false"] :is(#zoom-in,#zoom-out,#world-fit,#view-reset){display:none}
.techman-size-select{font:800 clamp(7px,.65vw,11px) Orbitron,sans-serif;padding:2px;min-height:18px;max-width:105px;background:#101a26;color:var(--hammer-hud-text);border:1px solid var(--hammer-hud-accent)}
.techman-world-tools{display:flex;gap:6px;flex-wrap:wrap}.techman-world-tools button{min-height:58px;font:800 10px Orbitron,sans-serif}
.techman-score-popup{position:absolute;font:900 clamp(17px,2vw,28px) Orbitron,sans-serif;color:var(--hammer-hud-accent);text-shadow:0 2px 3px #000,0 0 8px #ffffff55;pointer-events:none;z-index:20}

.hud-top.hammer-stone-hud{container-type:inline-size}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(1){left:15.3%;width:9.5%;top:13%;height:62%}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(2){left:32%;width:21.5%;height:45%;top:16%}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(3){left:32%;width:21.5%;top:59%;height:16%;flex-direction:row;gap:5px}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(4){left:65%;width:8.8%;top:13%;height:62%;flex-direction:column;gap:4%}
.hud-top.hammer-stone-hud #hud-energy-value{font-size:clamp(7px,1.7cqw,24px);gap:1px}
.hud-top.hammer-stone-hud #hud-items-value{font-size:clamp(12px,1.6vw,25px)}
.hud-bottom .meter{display:block;position:relative;overflow:hidden;border-radius:4px;box-shadow:inset 0 1px 5px #000;background:#0c111a}
.hud-bottom .meter i{display:none!important}
.hud-bottom .meter::before{content:"";display:block;width:var(--meter-fill,0%);height:100%;border-radius:3px;background:linear-gradient(0deg,#772b31,#ef7982);box-shadow:0 0 8px #f05d68,inset 0 1px 0 #ffffff66;transition:width .08s linear}
.hud-bottom .power::before{background:var(--power-color,#5eabff);box-shadow:0 0 8px var(--power-color,#5eabff),inset 0 1px 0 #ffffff66}
.hud-bottom .battery::before{background:var(--hammer-hud-accent);box-shadow:0 0 8px var(--hammer-hud-accent),inset 0 1px 0 #ffffff88}
.hud-bottom .inventory[data-slot-count="8"]{grid-template-columns:repeat(8,minmax(0,1fr))}
[data-inventory="oil"] .hammer-inventory-sprite{display:inline-block;width:19px;height:24px;margin:5px;border:3px solid #b89566;border-radius:5px;background:linear-gradient(90deg,#513727,#b6814d,#654029);box-shadow:inset 0 1px 2px #f1d4ac,1px 2px 3px #000}
.hud-top .techman-size-select{max-width:70px;font-size:7px}
label:has(#map-battery-goal){display:none!important}

/* Two independent live counters in the original sculpted middle recess. */
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(2),.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(3){top:17%;height:61%;width:10.2%;flex-direction:column;gap:5%;border:1px solid color-mix(in srgb,var(--hammer-hud-accent),transparent 45%);border-radius:7px;background:linear-gradient(180deg,#050a1260,#050a1220);box-shadow:inset 0 2px 4px #0009,0 1px 0 #ffffff20}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(2){left:32%}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(3){left:43.2%}
body .hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(3) strong{font-size:clamp(11px,1.6cqw,25px);white-space:nowrap}
#techman-map-size-control{display:inline-flex;align-items:center;gap:5px;margin:0;font:800 9px Orbitron,sans-serif;color:#d7e8fa}
#techman-size-preset{display:block!important;visibility:visible!important;max-width:108px;width:108px;min-height:29px;font:800 10px Orbitron,sans-serif;background:#11263a;color:#eaf3ff;border:1px solid #6490b9;border-radius:4px}
#techman-map-size-control[hidden]{display:none!important}
body[data-hammer-palette=tilemap] #editor-panel #hammer-structure-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:4px 0 8px}
body[data-hammer-palette=tilemap] #editor-panel #hammer-structure-actions .tool-card{min-height:58px!important;max-width:100%;font:800 9px Orbitron,sans-serif;white-space:normal}
body[data-hammer-palette=tilemap] #editor-panel #tools #hammer-structure-actions{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important}
body[data-hammer-palette=tilemap] #editor-panel #tools #hammer-structure-actions>button.tool-card{grid-column:auto!important;min-height:44px!important;width:100%!important}
body[data-hammer-palette=tilemap] #editor-panel #hammer-editor-controls{position:static!important;padding:0!important;margin:0!important}
body[data-hammer-palette=tilemap] #editor-panel :is(#tilemap-theme-bar,#tilemap-filter-bar) button{min-height:26px!important;padding:3px!important;font-size:9px!important}
body[data-hammer-palette=tilemap] #editor-panel #editor-search{min-height:27px!important;height:27px!important}
body .play-toolbar{flex-wrap:wrap!important;align-items:center;gap:6px}
body .play-toolbar>span{flex:1 0 160px!important;min-width:150px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body .play-toolbar>div{flex:0 1 auto;display:flex;flex-wrap:wrap;gap:4px}
body .play-toolbar>#techman-map-size-control{flex:0 0 auto}
#techman-portal-help{font:11px/1.5 Arial,sans-serif;color:#c9dff1;max-width:100%;margin:4px 0 8px}
.hud-bottom .slot-number,#inventory-empty{display:none!important}
body .hud-top.hammer-stone-hud :is(#hud-score-value,#goal-value,#hud-items-value,#time-value){font-family:'Arial Black',Impact,'Segoe UI',sans-serif;font-weight:900;font-variant-numeric:tabular-nums;font-size:clamp(14px,2.5cqw,48px);line-height:1.05;color:var(--hammer-hud-text,#e8d9b1);letter-spacing:-.025em;text-shadow:0 -1px 0 #ffffffc9,1px 1px 0 #382c21,2px 2px 0 #211b16,3px 3px 2px #000c,0 0 1px #000;-webkit-text-stroke:.35px #241d17}
body .hud-top.hammer-stone-hud #goal-value{font-size:clamp(13px,2.1cqw,40px)}

/* Latest Owner decision: one warm stone palette for every level theme. */
body,body[data-hammer-hud-theme]{--hammer-hud-filter:sepia(.65) saturate(.75) brightness(.92);--hammer-hud-text:#eee0c5;--hammer-hud-muted:#d9c9a9;--hammer-hud-accent:#d7bd87}
body .hud-top.hammer-stone-hud #hud-energy-value{display:block;font:900 clamp(14px,2.5cqw,48px)/1.05 'Arial Black',Impact,'Segoe UI',sans-serif;color:var(--hammer-hud-text);text-shadow:0 -1px 0 #ffffffc9,1px 1px 0 #382c21,2px 2px 0 #211b16,3px 3px 2px #000c;-webkit-text-stroke:.35px #241d17}
#techman-bg-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:4px 0 12px}
#techman-bg-grid .tool-card{min-height:75px!important}
#techman-bg-grid .tool-card-visual{display:block!important;background:url('/site/assets/rai-hammer/menu/brick161-castle.png') center/cover!important;border:1px solid #687480;min-height:38px!important}
#techman-bg-grid [data-tool='brick-bg-black'] .tool-card-visual{filter:brightness(.55)}
body[data-hammer-hud-theme='iceland'] #techman-bg-grid .tool-card-visual{background-image:url('/site/assets/rai-hammer/menu/brick161-iceland.png')!important}
body[data-hammer-hud-theme='egypt'] #techman-bg-grid .tool-card-visual{background-image:url('/site/assets/rai-hammer/menu/brick161-egypt.png')!important}
body[data-hammer-hud-theme='rome'] #techman-bg-grid .tool-card-visual{background-image:url('/site/assets/rai-hammer/menu/brick161-rome.png')!important}

#techman-drill-seconds{font:800 11px/1.2 Orbitron,sans-serif!important;color:#c8e7ff;text-shadow:0 1px 2px #000,0 0 5px #336699;white-space:nowrap}
.hammer-world-object{pointer-events:none;z-index:10}

/* The same four theme textures drive both swatches and the world materials. */
body[data-hammer-palette="tilemap"] #editor-panel #techman-bg-grid{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:4px 0}
body[data-hammer-palette="tilemap"] #editor-panel #techman-bg-grid .tool-card-visual{width:100%!important;max-width:none!important;height:48px!important;background-color:#172633!important}
body[data-hammer-palette="tilemap"] #editor-panel #techman-bg-grid .tool-card{min-height:80px!important;font-size:10px!important}
body[data-hammer-palette="tilemap"] #editor-panel #techman-bg-grid [data-tool="brick-bg-gray"] .tool-card-visual{filter:brightness(.86)}
body[data-hammer-palette="tilemap"] #editor-panel #techman-bg-grid [data-tool="brick-bg-black"] .tool-card-visual{filter:brightness(.33)}
body[data-hammer-palette="tilemap"] #editor-panel #techman-trap-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body[data-hammer-palette="tilemap"] #editor-panel #techman-trap-grid .tool-card{min-height:96px!important}
@media(min-width:1101px){body[data-hammer-palette="tilemap"]:is([data-hammer-mode="editor"],[data-hammer-test="true"]) .workspace.editor-open{grid-template-columns:clamp(400px,32vw,620px) minmax(0,1fr)!important}}
@media(min-width:901px) and (max-width:1100px){body[data-hammer-palette="tilemap"]:is([data-hammer-mode="editor"],[data-hammer-test="true"]) .workspace.editor-open{grid-template-columns:360px minmax(0,1fr)!important}}
body[data-hammer-palette="tilemap"] #tilemap-filter-bar{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
body[data-hammer-palette="tilemap"] #tilemap-filter-bar button{min-width:0;padding:6px 3px!important;font-size:10px!important;white-space:normal}
body[data-hammer-palette="tilemap"] #hammer-structure-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important}
body[data-hammer-palette="tilemap"] #editor-panel #tools{overscroll-behavior:contain;scrollbar-gutter:stable}
body[data-hammer-palette="tilemap"] #editor-panel #hammer-editor-controls{max-height:none!important;flex:none}
body[data-hammer-palette="tilemap"] #editor-panel #tools #hammer-structure-actions{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body[data-hammer-palette="tilemap"] #editor-panel #tools #techman-bg-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-column:1/-1!important;gap:8px}
body[data-hammer-palette="tilemap"] #editor-panel #tools #techman-bg-grid>button.tool-card{grid-column:auto!important;min-height:92px!important;height:auto!important;display:flex!important;flex-direction:column;align-items:center;gap:5px;padding:6px!important}
body[data-hammer-palette="tilemap"] #editor-panel #tools #techman-bg-grid .tool-card-visual{display:block!important;width:100%!important;max-width:100%!important;height:52px!important;min-height:52px!important;flex:0 0 52px!important}
body[data-hammer-palette="tilemap"] #editor-panel #techman-brush-settings{padding:7px;margin:4px 0 8px;border:1px solid #336699;border-radius:5px;background:#0c1c2c}
body[data-hammer-palette="tilemap"] #editor-panel #techman-brush-settings>summary{cursor:pointer;font:700 11px/1.5 Orbitron,'Segoe UI',sans-serif;color:#c5dcf1}
body[data-hammer-palette="tilemap"] #editor-panel #techman-brush-settings #hammer-common-editor{margin-top:8px}
body[data-hammer-palette="tilemap"] #editor-panel #tools{flex:1 1 auto!important;min-height:160px!important}
body[data-hammer-palette="tilemap"] #editor-panel #tools #techman-trap-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;gap:8px}
body[data-hammer-palette="tilemap"] #editor-panel #tools #techman-trap-grid>button{width:100%!important;max-width:none!important;grid-column:auto!important;font:700 11px/1.4 Orbitron,'Segoe UI',sans-serif!important}
body[data-hammer-palette="tilemap"] #techman-trap-grid .tool-card-visual{background-size:contain!important;background-position:center!important;background-repeat:no-repeat!important}
body[data-hammer-palette="tilemap"] #techman-trap-grid [data-tool="trap-floor"] .tool-card-visual{background:linear-gradient(#89b9da,#395b73)!important;clip-path:polygon(0 85%,10% 85%,20% 0,30% 85%,40% 85%,50% 0,60% 85%,70% 85%,80% 0,90% 85%,100% 85%,100% 100%,0 100%)}
@media(max-width:900px){body[data-hammer-palette="tilemap"] #tilemap-filter-bar{grid-template-columns:repeat(5,minmax(0,1fr))}body[data-hammer-palette="tilemap"] #editor-panel{max-width:100%;min-width:0}}

/* Owner Nexus HUD: original painted art, live counters and controls remain DOM. */
body,body[data-hammer-hud-theme]{--hammer-hud-filter:none;--hammer-hud-text:#eef3fa;--hammer-hud-muted:#b4c8dc;--hammer-hud-accent:#8fbae1}
body:not([data-hammer-mode="menu"]) .hud-top.hammer-stone-hud::before{background-image:url('nexus-hud-top178.webp');background-position:center;background-size:100% 100%}
body:not([data-hammer-mode="menu"]) .hud-bottom::before{background-image:url('nexus-hud-bottom178.webp');background-position:center;background-size:100% 100%}
body:not([data-hammer-mode="menu"]) .hud-top.hammer-stone-hud{aspect-ratio:2169/216;background-image:none!important}
body:not([data-hammer-mode="menu"]) .hud-bottom{aspect-ratio:2169/186;background-image:none!important}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(1){left:15.4%;width:10.7%;top:22%;height:56%}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(2){left:32%;width:11.8%;top:22%;height:56%}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(3){left:44.5%;width:10.1%;top:22%;height:56%}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(4){left:65%;width:9%;top:22%;height:56%}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(5){left:84%;width:11.3%;top:22%;height:56%}
body .hud-top.hammer-stone-hud .hammer-hud-cell{border:0;background:none;box-shadow:none;border-radius:0}
.hud-top.hammer-stone-hud .hammer-hud-cell:nth-child(2){border-right:1px solid #567da280}
body .hud-top.hammer-stone-hud strong{color:#eef4fc!important;text-shadow:0 1px 2px #000,0 0 8px #33669980!important;-webkit-text-stroke:0!important}
body .hud-top.hammer-stone-hud small{color:#aec7dd;font-size:clamp(7px,.7vw,13px)}
.hud-bottom .inventory{left:2.9%;top:21%;width:31.9%;height:58%;gap:0}
.hud-bottom .inventory button{padding:8%;border-radius:8px}
.hud-bottom .inventory button:focus-visible{outline:2px solid #b8d8f5;outline-offset:-5px}
.hud-bottom .inventory button:not([data-empty="true"]):hover{background:#33669933}
.hud-bottom .meters{left:38.1%;top:25%;width:34.9%;height:51%}
.hud-bottom .hud-message{left:77.2%;top:29%;width:19.3%;height:40%}
@media(max-width:760px){body:not([data-hammer-mode="menu"]) .hud-top.hammer-stone-hud{min-height:66px!important}body:not([data-hammer-mode="menu"]) .hud-bottom{min-height:64px!important}}

body:not([data-hammer-mode="menu"]) .hud-bottom::before{background-image:url('nexus-hud-bottom-glass179.webp')}
