/* Approved R5 HUD. Presentation only: movement, access and economy remain authoritative. */
:root{--hud-edge:#a6b29050;--hud-paper:#dfdcc1;--hud-mono:ui-monospace,SFMono-Regular,Consolas,monospace}
.game-shell.interior-mode{height:100dvh;max-width:none;margin:0}
.game-shell.interior-mode .screens{height:100%;min-height:0}
.game-shell.interior-mode .interior-screen.hud-active{display:block;position:relative;height:100%;overflow:hidden;background:radial-gradient(ellipse,#34452f,#102017 80%)}
.hud-active .map-first-stage.scene-stage{position:absolute;inset:0;height:100%;min-height:0;display:block;background:radial-gradient(ellipse,#34452f,#102017 80%)}
.hud-active .map-first-stage .scene-map{position:absolute;inset:62px 0 115px;min-height:0;margin:0;overflow:hidden}
.hud-active .scene-map>.scene-plan{width:100%;height:100%;filter:drop-shadow(0 8px 16px #0006)}
.hud-active .map-first-top.scene-top{height:56px;z-index:10;gap:8px;align-items:start;padding:12px 16px;background:linear-gradient(#08170ed9,#08170e00);pointer-events:none}
.hud-active .scene-top>*{pointer-events:auto}.hud-active .scene-wordmark{font:8px var(--hud-mono);letter-spacing:1.5px;margin-top:5px;flex:1;color:#b7c091}.hud-active .scene-top [data-exit]{font:9px var(--hud-mono);min-height:44px;padding:5px 8px;border:0;background:none;box-shadow:none}
.hud-active .scene-options{margin-left:auto}
.hud-active .scene-options summary{width:44px;min-height:44px;border-radius:3px;background:#203027c9;border:1px solid var(--hud-edge);font-size:17px}
.hud-active .scene-options-panel{z-index:25;top:48px;right:0;width:min(280px,calc(100vw - 32px));max-height:calc(100dvh - 145px);border:1px solid var(--hud-edge);border-radius:3px;background:#203024f5}
.hud-active .scene-options-panel button{font:11px/1.6 var(--hud-mono);min-height:44px}
.hud-active .scene-location{top:42px;left:16px;right:65px;z-index:3;pointer-events:none}.hud-active .scene-location h1{font:20px/1.2 Georgia,serif;letter-spacing:0;margin:2px 0;color:var(--hud-paper);text-shadow:0 2px 5px #000}.hud-active .scene-location .scene-eyebrow{font:7px/1.5 var(--hud-mono);color:#a6b990}.hud-active .scene-location>p:last-child{display:none}
.hud-objective{position:absolute;top:85px;left:16px;z-index:3;border-left:2px solid #c5b37b77;padding:0 0 0 8px;font:9px var(--hud-mono);color:#bdc7a7;pointer-events:none;text-shadow:0 1px 3px #000}
.hud-active .home-actions,.hud-active .field-belt{display:none!important}
.hud-belt{position:absolute;z-index:9;left:16px;right:16px;bottom:max(18px,env(safe-area-inset-bottom));height:62px;display:flex;align-items:stretch;gap:12px;pointer-events:none}.hud-belt button{pointer-events:auto;cursor:pointer;touch-action:manipulation;clip-path:none;min-height:44px;border-radius:3px}
.hud-belt .hud-tool-slot,.hud-belt .hud-bag-slot{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;width:57px;height:62px;flex:none;padding:5px;border:1px solid #9fac7c99;background:linear-gradient(135deg,#43503a,#263728);box-shadow:inset 0 1px #e1dab02e,0 6px 20px #0005;font:10px var(--hud-mono);color:#d9d9b7;overflow:visible}
.hud-tool-slot>svg,.hud-bag-slot>svg{width:24px;height:24px}.hud-tool-slot>b{position:absolute;right:5px;bottom:4px;font:9px var(--hud-mono);color:#cbd4ae}.hud-tool-slot:not(.is-equipped){border-style:dashed;background:linear-gradient(135deg,#283b2abf,#15271bcf);color:#8fa17e}.hud-tool-slot small,.hud-bag-slot small{position:absolute;top:-13px;left:0;right:0;text-align:center;font:7px var(--hud-mono);letter-spacing:1.5px;color:#aeb997}.hud-bag-slot>b{font:10px var(--hud-mono)}.hud-bag-slot b span{font-size:8px;color:#a3b48e}.hud-bag-slot::after{content:'';position:absolute;bottom:0;left:0;height:2px;width:var(--capacity);background:#d6be84}
.hud-belt .hud-main-action{display:flex;align-items:center;justify-content:center;gap:7px;flex:1;min-width:0;margin:0;padding:8px 10px;font:10px var(--hud-mono);letter-spacing:.5px;border:1px solid #e6d5a29c;background:linear-gradient(135deg,#c8b277,#968149);color:#1b2a1c;box-shadow:inset 0 1px #f4e1a77d,0 5px 20px #0005;text-align:center;clip-path:none}.hud-main-action svg{width:18px;height:18px;flex:none}.hud-main-action:disabled{opacity:.55;cursor:default}
.hud-active:not(:has(.home-stage)) .hud-main-action{border-color:#a3b18b60;background:#253c2bbf;color:#c3cdb0;box-shadow:inset 0 1px #c7d5a51a}
.hud-active .map-first-stage .scene-camera{right:16px;bottom:165px;top:auto;z-index:5;gap:0;border:1px solid #93a57540;border-radius:3px;overflow:hidden;background:#203528b8}.hud-active .scene-camera button,.hud-active .scene-camera button:first-child{width:44px;height:44px;min-height:44px;border:0;border-radius:0;background:none}.hud-active .scene-camera button+button{border-top:1px solid #b7bd8a20}
.hud-active .map-first-stage .scene-floors,.hud-active:has(.field-belt) .scene-floors{bottom:105px;left:16px;right:115px;max-width:calc(100% - 135px);width:max-content;z-index:4;transform:none;border-radius:2px;background:#183020db}.hud-active .scene-floors button{font:9px var(--hud-mono);min-width:44px;min-height:44px;padding:7px 10px}.hud-active .scene-controls-plan{left:auto;right:16px;bottom:105px;z-index:5;min-width:88px;min-height:44px;font:9px var(--hud-mono);border:1px solid #93a57540;border-radius:2px;background:#203528cf}
.hud-active .walk-instruction{left:16px;right:16px;bottom:84px;top:auto;z-index:3;font:8px/1.4 var(--hud-mono);pointer-events:none}.hud-active .scene-credit{left:auto;right:5px;bottom:2px;font-size:6px}
.hud-world-label{position:absolute;z-index:6;transform:translate(-50%,-50%);min-height:44px;padding:6px 10px;border:1px solid #c6bd8270;border-radius:2px;background:#1f3528dc;box-shadow:0 3px 10px #0004;color:#d4d7b5;font:8px var(--hud-mono);text-transform:uppercase;letter-spacing:.9px;white-space:nowrap}
.hud-world-label:hover{background:#485738}.hud-world-label:active{transform:translate(-50%,-50%)}
.hud-active .field-context.map-first-tray{border:1px solid #c2bc8266;border-left:2px solid #d0bd7c;border-radius:3px;background:linear-gradient(130deg,#34462bf5,#1d3527ee);box-shadow:0 8px 25px #0004}.hud-active .field-context h2{font:19px Georgia}.hud-active .field-context .selected-state{font:9px/1.6 var(--hud-mono)!important}.hud-active .field-context .action.primary{font:10px var(--hud-mono);clip-path:none;border-radius:2px;background:#c5ae70;color:#162719}
/* Same real inventory, rendered as occupied capacity cells. No hard-coded 12-slot limit. */
#backpack{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}.world-panel #backpack .hud-inventory-slot{position:relative;aspect-ratio:1;min-height:0;min-width:0;padding:5px;border:1px solid #b7ba7b77;border-radius:2px;background:radial-gradient(#5a66383b,#183021);box-shadow:inset 0 1px #c6cc9926}.world-panel #backpack .hud-inventory-slot .game-art{width:100%;height:65%;max-width:82px;max-height:82px;margin:0 auto;object-fit:contain}.hud-inventory-slot .item-name{font:8px/1.25 var(--hud-mono);color:#c6cfb2}.hud-inventory-slot>small{position:absolute;top:3px;left:4px;font:6px var(--hud-mono);color:#a8bb8a}.world-panel #backpack .hud-inventory-slot.is-empty{border-color:#8fa66c45;background:#0b251966;box-shadow:inset 0 3px 9px #071d1599}.hud-inventory-slot.is-empty>small{color:#687f5d}
.world-panel,.detail-dialog{border:1px solid #b4c08b66;border-top:2px solid #b9b88299;border-radius:3px;background:linear-gradient(135deg,#35432ff5,#192e23fa 70%);box-shadow:0 15px 80px #0009}.world-panel::backdrop,.detail-dialog::backdrop{background:#06120cb8;backdrop-filter:blur(2px)}.world-panel .screen-heading h1,.world-panel .workshop-banner h1,.detail-dialog h2{font:16px/1.3 var(--hud-mono);text-transform:uppercase;letter-spacing:1.5px}.world-panel .screen-heading p,.world-panel .workshop-banner p{font:10px/1.8 var(--hud-mono)}.world-panel .segmented button{font:9px var(--hud-mono)}.hud-equipment-list article{display:flex;gap:14px;align-items:center;padding:15px 0;border-bottom:1px solid #a5b27e33}.hud-equipment-list h3{font:20px Georgia;margin:0 0 7px}.hud-equipment-list p{font:10px var(--hud-mono);color:#b8c7a2;margin:0}.hud-tool-art{display:grid;place-items:center;width:60px;height:60px;flex:none;border:1px solid #a5b57c30;background:#21382370;color:#c6c58d}.hud-tool-art svg{width:28px;height:28px}
/* Keep a single accessible bag control on the geographical map, too. */
#screen-explore .explore-hud [data-bag-target]{display:none}
.game-shell:has(#screen-explore:not([hidden])){height:100dvh;margin:0;max-width:none}.game-shell:has(#screen-explore:not([hidden])) .game-header{position:absolute;inset:0 0 auto;z-index:10;background:linear-gradient(#0a160fdb,#0a160f00)}
.game-shell:has(#screen-explore:not([hidden])) #world-bag{position:fixed;right:17px;bottom:max(18px,env(safe-area-inset-bottom));width:58px;height:62px;border-radius:3px;background:linear-gradient(135deg,#43503a,#263728);border:1px solid #9fac7c99;display:flex;flex-direction:column;justify-content:center;gap:5px}.game-shell:has(#screen-explore:not([hidden])) #world-bag b{font:9px var(--hud-mono)}
@media(min-width:800px){.hud-active .scene-location{left:28px}.hud-active .scene-top{padding-inline:28px}.hud-objective{left:28px}.hud-active .scene-map{inset:60px 30px 105px}.hud-belt{left:28px;right:28px}.hud-main-action{max-width:350px;margin-inline:auto!important}.hud-bag-slot{margin-left:auto}.hud-active .field-context{max-width:360px}}
@media(max-width:359px){.hud-belt{left:12px;right:12px;gap:10px}.hud-belt .hud-tool-slot,.hud-belt .hud-bag-slot{width:48px;height:56px}.hud-belt .hud-main-action{font-size:9px;padding-inline:6px}.hud-active .scene-location h1{font-size:18px}.hud-active .scene-location .scene-eyebrow{font-size:6px}.hud-objective{font-size:8px}.hud-inventory-slot .item-name{font-size:7px}}
@media(max-height:500px) and (min-width:600px){.hud-active .map-first-stage{width:100%!important}.hud-active .scene-location{top:40px;left:16px;right:60px;width:auto}.hud-active .scene-map{inset:55px 100px 85px}.hud-active .field-context.map-first-tray{position:absolute;top:var(--context-y,80px);left:var(--context-x,12px);right:auto;max-height:calc(100% - 170px)}.hud-active .scene-floors{bottom:90px}.hud-active .walk-instruction{display:none}.hud-active .hud-objective{display:none}.hud-active .scene-camera{bottom:100px}}
@media(prefers-reduced-motion:no-preference){.hud-bag-slot.bag-pulse{animation:hud-bag-pulse .6s ease-out}@keyframes hud-bag-pulse{50%{box-shadow:0 0 22px #d2c07b66,inset 0 0 12px #c5c37533}}}
/* A single workbench surface for the existing catalogues and preparation. */
.workshop-tool-art{display:grid;place-items:center;width:72px;height:72px;margin:4px auto 10px;color:#c6c58d;background:radial-gradient(#64704333,#193024);border:1px solid #a9b77633;border-radius:2px}.workshop-tool-art svg{width:34px;height:34px}.workshop-screen:has(#workshop-inspector:not([hidden])) #workshop-list,.workshop-screen:has(#workshop-inspector:not([hidden])) #workshop-intro{display:none}.workshop-screen .field-inspector{border:0;padding:15px 0 0;margin:0}.workshop-screen .field-inspector .detail-art{float:none;width:80px;height:80px;margin:0 auto 16px;display:grid;place-items:center}.workshop-screen .field-inspector .detail-description{font:11px/1.8 var(--hud-mono);color:#b5c5a2;clear:both}.workshop-screen .field-inspector h2{font:23px/1.3 Georgia;text-align:center}.workshop-screen .field-inspector .overline{text-align:center;font-size:8px}.workshop-screen .field-inspector .ingredient-list{margin-top:20px}.workshop-screen .field-inspector .detail-note{font:10px/1.8 var(--hud-mono);color:#a5b88f}.workshop-screen .recipe-card{border-radius:2px;border-color:#93a66d33;background:linear-gradient(135deg,#34452b99,#183023);box-shadow:inset 0 1px #c6cc9920}.workshop-screen .recipe-card.is-locked{opacity:.8}.workshop-screen .recipe-card h3{font:17px/1.3 Georgia}.workshop-screen .recipe-card .card-state{font:8px/1.6 var(--hud-mono)}.workshop-screen .section-intro{font:10px/1.7 var(--hud-mono);color:#a9bd95;margin:12px 0 20px}.workshop-screen .segmented{gap:3px}.workshop-screen .segmented button{font:8px var(--hud-mono);padding:10px 5px;min-height:44px}.workshop-screen .text-button{min-height:44px;font:10px var(--hud-mono)}.bag-screen .field-inspector .detail-description{font:11px/1.8 var(--hud-mono);color:#becba8;clear:both}.bag-screen #open-discard{display:block;width:100%;min-height:44px;margin-top:8px;font:10px var(--hud-mono);color:#c8af89;background:none;border:0}.bag-screen #confirm-discard{border:1px solid #ad866044;background:#392e1b;color:#dec59c;clip-path:none}.bag-screen #cancel-discard{color:#d1dcb9}.world-panel[data-surface=workshop]{max-height:min(88dvh,calc(100dvh - 50px))}
@media(max-width:359px){.workshop-screen .recipe-card h3{font-size:15px}.workshop-tool-art{width:58px;height:58px}.workshop-screen .recipe-card .card-state{font-size:7px}.workshop-screen .field-inspector .detail-art{width:64px;height:64px;margin-bottom:12px}}
.workshop-screen .ingredient-list strong{display:flex;flex-direction:column;align-items:flex-end;font:16px var(--hud-mono);color:#d2d9ac}.workshop-screen .ingredient-list strong.missing{color:#d5ad85}.workshop-screen .ingredient-list strong small{font:8px var(--hud-mono);letter-spacing:0;color:#99b188;margin-top:4px}.workshop-screen .ingredient-list li{padding-block:10px}#game-panel{--hud-panel-height:min(88dvh,calc(100dvh - 50px));max-height:var(--hud-panel-height);overflow:hidden}#game-panel[data-surface=bag]{--hud-panel-height:min(62dvh,calc(100dvh - 150px))}#panel-content{max-height:calc(var(--hud-panel-height) - 50px);overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;scrollbar-color:#637d4f #142d20;padding-right:4px}.world-panel .panel-close{z-index:20;background:#1b3125eb}.world-panel .screen-heading,.world-panel .workshop-banner{padding-right:48px}
@media(max-width:600px){#screen-workshop .recipe-grid{grid-template-columns:repeat(2,minmax(0,1fr))}#screen-workshop .recipe-card .card-state{font-size:9px;line-height:1.6}#screen-workshop .recipe-card h3{font-size:18px}}@media(max-width:359px){#screen-workshop .recipe-card h3{font-size:16px}#screen-workshop .recipe-card .card-state{font-size:8px}}
.hud-active[aria-busy=true] .hud-belt button,.hud-active[aria-busy=true] .scene-top [data-exit]{cursor:wait;opacity:.65}.hud-active[aria-busy=true] .hud-main-action{opacity:.9}.world-panel[aria-busy=true] button{cursor:wait}.survivor-objectives .is-done{color:#a8bd8b}.detail-dialog h3{font:19px Georgia,serif;margin:22px 0 12px}
/* Landscape: keep the selected action beside the plan rather than over the rooms. */
@media(max-height:500px) and (min-width:600px){
 .hud-active .scene-top{justify-content:flex-end}
 .hud-active .scene-location{top:12px;left:16px;right:75px}
 .hud-active:has(.field-context:not([hidden])) .map-first-stage .scene-map{inset:55px 330px 110px 16px}
 .hud-active .field-context.map-first-tray{left:auto!important;right:75px;top:68px!important;width:240px;max-height:calc(100dvh - 160px);margin:0}
 .hud-active .scene-floors{max-width:170px;bottom:105px}
 .hud-active .scene-controls-plan{left:200px;right:auto;bottom:105px;min-width:80px}
 .hud-active .scene-camera{right:16px}
 .hud-active .scene-options[inert]{opacity:.5}
}

/* Keep location separate from the fixed bag and attribution controls. */
#screen-explore #locate{right:22px;bottom:calc(max(18px,env(safe-area-inset-bottom)) + 74px)}
#screen-explore .maplibregl-ctrl-bottom-right{bottom:150px}

/* Map commands share one right-hand column; the legend keeps its own space. */
#screen-explore .map-footer{left:16px;right:87px;bottom:max(24px,env(safe-area-inset-bottom));width:auto;max-width:none;transform:none}
#screen-explore .explore-hint{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 9px;white-space:normal;margin:0!important;padding:8px 10px;font-size:10px}
#screen-explore .explore-hint span{white-space:nowrap}
#screen-explore #locate{right:17px;width:58px;height:48px;border-radius:3px;border:1px solid #9fac7c99;background:linear-gradient(135deg,#43503a,#263728);bottom:calc(max(18px,env(safe-area-inset-bottom)) + 72px)}
#screen-explore .maplibregl-ctrl-bottom-right{right:24px;bottom:150px}
#screen-explore #guild-map-clear{position:fixed;right:17px;bottom:calc(max(18px,env(safe-area-inset-bottom)) + 130px);width:58px;height:44px;border-radius:3px}
#screen-explore:has(#guild-map-clear:not([hidden])) .maplibregl-ctrl-bottom-right{bottom:208px}
.hud-active .walk-instruction{bottom:160px;right:80px;text-align:center}
