/* Touch layout v2. UI lives at the edges; the scene owns the central drag area. */
#quick-belt{display:none}
#quick-belt[hidden],#aim-feedback[hidden]{display:none!important}
body[data-controls=stick].hud-collapsed #game-shell{--edge-l:max(12px,env(safe-area-inset-left));--edge-r:max(12px,env(safe-area-inset-right));--edge-b:max(8px,env(safe-area-inset-bottom))}
body[data-controls=stick].hud-collapsed #game-shell .scene-top{pointer-events:none;padding:8px 12px}
body[data-controls=stick].hud-collapsed #game-shell .location-time{position:fixed;left:var(--edge-l);top:max(8px,env(safe-area-inset-top));width:calc(100vw - 170px);max-width:none}
body[data-controls=stick].hud-collapsed #game-shell #location{font-size:19px;line-height:25px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body[data-controls=stick].hud-collapsed #game-shell #world-weather{font:14px/1.25 system-ui;min-height:44px;padding:3px 0;max-width:100%;text-align:left}
body[data-controls=stick].hud-collapsed #game-shell .heading-strip{position:fixed;top:72px;left:var(--edge-l);right:var(--edge-r);padding:0;pointer-events:none;font:13px/1.25 system-ui}
body[data-controls=stick].hud-collapsed #game-shell #compass{font-size:16px}
body[data-controls=stick].hud-collapsed #game-shell #fps-meter{font-size:10px;opacity:.65;max-width:calc(100vw - 80px)}
body[data-controls=stick].hud-collapsed #game-shell #scene-map-button{left:auto;top:94px;right:var(--edge-r);width:62px;height:62px;opacity:.75}
body[data-controls=stick].hud-collapsed #game-shell #move-stick{position:fixed;left:var(--edge-l);right:auto;bottom:calc(var(--edge-b) + 78px);width:112px;height:112px;background:#11170d20;border-color:#d9c9a35c;box-shadow:none}
body[data-controls=stick].hud-collapsed #game-shell #move-stick .stick-knob{left:32px;top:32px;width:48px;height:48px;background:#c0a46538}
body[data-controls=stick].hud-collapsed #game-shell #move-stick .stick-label{font-size:11px;letter-spacing:.12em;opacity:.7}
body[data-controls=stick].hud-collapsed #game-shell #quick-actions{position:fixed;left:auto;right:var(--edge-r);bottom:calc(var(--edge-b) + 89px);width:154px;grid-template-columns:minmax(0,1fr);gap:6px}
body[data-controls=stick].hud-collapsed #game-shell #quick-actions button{min-height:44px;max-height:58px;padding:7px 10px;font:14px/1.2 system-ui;background:#14180fcc;border-color:#ac986a99;overflow:hidden;text-overflow:ellipsis}
body[data-controls=stick].hud-collapsed #game-shell #quick-kick,body[data-controls=stick].hud-collapsed #game-shell #quick-search{display:none}
body[data-controls=stick].hud-collapsed #game-shell #quick-vitals{position:fixed;left:var(--edge-l);right:auto;bottom:calc(var(--edge-b) + 198px);font:14px/1.2 system-ui;pointer-events:none}
body[data-controls=stick].hud-collapsed #game-shell .hud-tabs{display:none}
body[data-controls=stick].hud-collapsed #game-shell #quick-belt{position:fixed;z-index:40;bottom:var(--edge-b);left:var(--edge-l);right:var(--edge-r);display:grid;grid-template-columns:repeat(5,minmax(0,1fr)) 48px;gap:5px;pointer-events:none}
#quick-belt button{height:64px;min-width:0;min-height:44px;padding:5px 3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;background:#15190ee6;border:1px solid #8c805a99;border-radius:7px;pointer-events:auto;color:#eee2c1;touch-action:manipulation;line-height:1.15;box-shadow:0 2px 8px #0003}
#quick-belt button strong{font:600 12px/1.2 system-ui;max-width:100%;overflow:hidden;text-overflow:ellipsis}
#quick-belt .belt-type{font:10px/1 system-ui;color:#b7aa8a}
#quick-belt button small{font:11px/1 system-ui;color:#d3c39e}
#quick-belt button[aria-pressed=true]{border-color:#ead09b;box-shadow:inset 0 0 0 1px #d2ac64;background:#413322df}
#quick-belt button:disabled{opacity:.48}
#quick-belt button:focus-visible{outline:2px solid #fff2c4;outline-offset:2px}
#quick-belt .belt-pack>span{font-size:23px}
body[data-controls=stick].hud-collapsed #game-shell .story-peek{position:fixed;left:var(--edge-l);right:var(--edge-r);bottom:calc(var(--edge-b) + 224px);min-height:44px;max-height:44px;width:auto;padding:6px 10px;font:14px/1.3 Georgia,serif;background:#11170b6b;overflow:hidden}
body[data-controls=stick].hud-collapsed #game-shell #narration{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
body[data-controls=stick].hud-collapsed #game-shell .world-tools{position:fixed;left:var(--edge-l);right:var(--edge-r);bottom:calc(var(--edge-b) + 274px);width:auto;pointer-events:none}
body[data-controls=stick].hud-collapsed #game-shell .world-tools button{pointer-events:auto;min-height:44px}
body[data-controls=stick].hud-collapsed #game-shell #notice{top:164px;height:auto;max-height:54px;font-size:14px;overflow:hidden}
body[data-controls=stick].hud-collapsed #game-shell #guardian-status{top:97px;left:var(--edge-l);max-width:calc(100vw - 100px);min-height:44px;font:12px/1.3 system-ui;padding:5px 8px;background:#211916bb}
#aim-feedback{position:fixed;top:36%;left:50%;transform:translateX(-50%);z-index:20;max-width:65vw;padding:5px 10px;border-radius:4px;background:#20130da6;color:#ffe2bd;font:600 15px/1.3 system-ui;pointer-events:none;text-shadow:0 1px #000}
body[data-controls=stick].hud-collapsed #game-shell #encounter{top:100px;left:var(--edge-l);width:calc(100vw - 110px);max-width:260px;background:#211916aa}
body[data-controls=stick].fighting.hud-collapsed #encounter .eyebrow,body[data-controls=stick].fighting.hud-collapsed #encounter p:last-child{display:none}
body[data-controls=stick][data-stick-side=right].hud-collapsed #game-shell #move-stick,body[data-controls=stick][data-stick-side=right].hud-collapsed #game-shell #quick-vitals{left:auto;right:var(--edge-r)}
body[data-controls=stick][data-stick-side=right].hud-collapsed #game-shell #quick-actions{left:var(--edge-l);right:auto}
/* The tavern uses the same navigation menu but its own contextual dock. */
body[data-controls=stick].inside-inn.hud-collapsed #game-shell .hud-tabs{display:flex;right:var(--edge-r);left:auto;bottom:var(--edge-b);width:174px}
body[data-controls=stick].inside-inn.hud-collapsed #game-shell .story-peek{bottom:calc(var(--edge-b) + 122px)}
body[data-controls=stick].inside-inn.hud-collapsed #game-shell .world-tools{bottom:calc(var(--edge-b) + 174px)}
.trait-help summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:6px;color:#e5cc94;text-decoration:underline dotted;text-underline-offset:4px}
.trait-help summary::after{content:'?';font:12px system-ui;border:1px solid #9a8861;border-radius:50%;width:18px;height:18px;display:grid;place-items:center;text-decoration:none}
.trait-help p{font:14px/1.5 system-ui;margin:3px 0 12px;color:#d9ceb8}
.trait-field{padding:4px 0;border-bottom:1px solid #a08b552d}
.trait-field .trait-value{display:flex;align-items:center;justify-content:space-between;font-size:13px}
.trait-field input{max-width:88px;min-height:44px}
.word-stats>div,.skill-progress>div{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:baseline}
.word-stats dt,.word-stats dd,.skill-progress dd{margin:0}
.belt-choices button{min-height:44px;margin:4px;padding:8px 12px}
.belt-choices [aria-pressed=true]{border-color:#e5cc94;background:#473b26}
@media(orientation:landscape) and (max-height:600px){
 body[data-controls=stick].hud-collapsed #game-shell .location-time{width:calc(100vw - 210px)}
 body[data-controls=stick].hud-collapsed #game-shell #location{font-size:18px;line-height:22px}
 body[data-controls=stick].hud-collapsed #game-shell .heading-strip{left:auto;right:var(--edge-r);top:58px;width:134px;display:flex;justify-content:space-between}
 body[data-controls=stick].hud-collapsed #game-shell #fps-meter{font-size:9px;max-width:104px}
 body[data-controls=stick].hud-collapsed #game-shell #scene-map-button{top:82px;width:52px;height:52px}
 body[data-controls=stick].hud-collapsed #game-shell #move-stick{bottom:var(--edge-b);width:100px;height:100px}
 body[data-controls=stick].hud-collapsed #game-shell #move-stick .stick-knob{left:26px;top:26px}
 body[data-controls=stick].hud-collapsed #game-shell #quick-vitals{bottom:calc(var(--edge-b) + 108px)}
 body[data-controls=stick].hud-collapsed #game-shell #quick-actions{width:128px;bottom:var(--edge-b)}
 body[data-controls=stick].hud-collapsed #game-shell #quick-actions button{min-height:44px;max-height:50px;font-size:13px}
 body[data-controls=stick].hud-collapsed #game-shell #quick-belt{left:calc(50% - 172px);right:auto;width:344px;gap:4px;grid-template-columns:repeat(5,minmax(0,1fr)) 44px}
 #quick-belt button{height:58px}
 #quick-belt button strong{font-size:11px}
 body[data-controls=stick].hud-collapsed #game-shell .story-peek{top:63px;bottom:auto;left:var(--edge-l);right:180px;min-height:32px;max-height:32px;font-size:13px;padding:4px 7px}
 body[data-controls=stick].hud-collapsed #game-shell .world-tools{bottom:calc(var(--edge-b) + 65px);left:130px;right:156px;width:auto}
 body[data-controls=stick].hud-collapsed #game-shell #notice{top:99px;left:140px;right:160px;max-height:45px;font-size:13px}
 body[data-controls=stick].hud-collapsed #game-shell #guardian-status{top:105px;left:var(--edge-l);max-width:calc(100vw - 190px);min-height:28px;font-size:12px;pointer-events:none}
 body[data-controls=stick].hud-collapsed #game-shell #encounter{top:102px;left:var(--edge-l);max-width:240px}
 body[data-controls=stick].inside-inn.hud-collapsed #game-shell .story-peek{top:auto;bottom:calc(var(--edge-b) + 64px);left:var(--edge-l);right:204px;max-height:44px}
 body[data-controls=stick].inside-inn.hud-collapsed #game-shell .world-tools{bottom:calc(var(--edge-b) + 118px);left:var(--edge-l);right:204px}
 #aim-feedback{top:42%;font-size:14px}
}
@media(max-width:359px){#quick-belt button strong{font-size:11px}body[data-controls=stick].hud-collapsed #game-shell #quick-actions{width:138px}body[data-controls=stick].hud-collapsed #game-shell #location{font-size:17px}}

body[data-controls=stick].hud-collapsed #game-shell .hud-tools{position:fixed;right:var(--edge-r);top:max(8px,env(safe-area-inset-top));display:flex;gap:6px}
body[data-controls=stick].hud-collapsed #game-shell .hud-tools button{width:44px;height:44px;min-width:44px;min-height:44px;pointer-events:auto}
