/* Device presentation only: shared game, menus and saved career. */
#movementJoystick,#rotateDevice{display:none}.pcMode .touch,.pcMode .lookControls{display:none!important}.pcMode #prompt{max-width:65vw}.pcMode .bottom span:last-child{display:block}.modalOpen #movementJoystick,.modalOpen .lookControls,.modalOpen #stockAction,.modalOpen #prompt,.modalOpen #rotateDevice{display:none!important}
.touchMode .touch,.touchMode .lookControls>.controlLabel,.touchMode .lookControls>div:first-of-type,.touchMode #runToggle{display:none!important}
.touchMode #movementJoystick{display:block;position:fixed;left:max(20px,env(safe-area-inset-left));bottom:max(35px,env(safe-area-inset-bottom));width:120px;height:120px;border-radius:50%;background:#35253766;border:2px solid #fff7;touch-action:none;user-select:none;z-index:4}
#joystickThumb{position:absolute;top:50%;left:50%;width:52px;height:52px;border-radius:50%;background:#ef80adee;border:2px solid #fff9;transform:translate(-50%,-50%);pointer-events:none}
.touchMode .lookControls{right:max(20px,env(safe-area-inset-right));bottom:max(48px,env(safe-area-inset-bottom));z-index:4}.touchMode #actionTouch{width:132px;min-height:64px;height:auto;font-size:15px;padding:12px;border-radius:18px;line-height:1.25;touch-action:manipulation}.touchMode #actionTouch[hidden]{display:none!important}
.touchMode #stockAction{right:max(22px,env(safe-area-inset-right));bottom:132px;left:auto;top:auto;min-height:48px;max-width:132px;font-size:13px;z-index:4}
.touchMode #prompt{bottom:max(55px,env(safe-area-inset-bottom));max-width:calc(100vw - 330px);width:max-content;pointer-events:none}.touchMode #interact{font-size:12px;padding:9px 12px;border-radius:12px}.touchMode .bottom{left:155px;right:155px;bottom:max(28px,env(safe-area-inset-bottom));justify-content:center}.touchMode .bottom #inventory{font-size:12px;text-align:center}.touchMode .bottom span:last-child,.touchMode .location{display:none}
.touchMode header{top:max(8px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right))}.touchMode .brand{display:none}.touchMode .topright{margin-left:auto}.touchMode #day{max-width:240px;font-size:12px}.touchMode #pause{min-width:44px;min-height:44px}
.touchMode .metrics{top:calc(56px + env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));width:auto;transform:none;padding:8px 4px;justify-content:space-around}.touchMode .metrics strong{font-size:16px}.touchMode .metrics small{font-size:10px;letter-spacing:0}.touchMode .metrics div{padding:0 8px}
.touchMode #gameWallet{top:calc(110px + env(safe-area-inset-top));font-size:12px;padding:3px 10px}.touchMode .mission{left:max(12px,env(safe-area-inset-left));top:calc(140px + env(safe-area-inset-top));width:28%;max-height:75px;padding:8px 12px;transform:none}.touchMode #eventPanel{right:max(12px,env(safe-area-inset-right));left:auto;top:calc(140px + env(safe-area-inset-top));bottom:auto;width:28%;max-height:75px;padding:8px 12px}.touchMode .mission h2,.touchMode #eventPanel h2{font-size:13px;margin:2px 0}.touchMode .mission .eyebrow,.touchMode #eventPanel .eyebrow{display:none}.touchMode #finish{right:max(16px,env(safe-area-inset-right));bottom:max(5px,env(safe-area-inset-bottom));min-height:40px;font-size:12px}.touchMode #saveStatus{bottom:max(4px,env(safe-area-inset-bottom));max-width:40vw;font-size:11px}.touchMode #toast{top:auto;bottom:180px;font-size:13px}
.touchMode .dialog{width:min(720px,100%);max-height:calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 12px);padding:20px;overscroll-behavior:contain}.touchMode .dialog button{min-height:48px;font-size:16px;touch-action:manipulation}.touchMode .dialog input,.touchMode .dialog select{font-size:16px;min-height:48px}.controlSetting{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:18px}.controlSetting select{padding:10px;border-radius:8px;max-width:65%}
.touchMode .scanLane .scanItem{min-width:140px;min-height:110px;font-size:15px}.touchMode #modal{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.touchMode #modal.connectMode .dialog{padding:14px;max-height:100%;height:100%}.touchMode .connectShell{grid-template-columns:1fr;gap:14px}.touchMode .connectNav{flex-direction:row;overflow:auto;border-right:0;padding:0 0 10px}.touchMode .connectNav button{flex:0 0 auto;white-space:nowrap;font-size:15px!important}.touchMode .connectNav button:last-child{margin-top:0}.touchMode .supplierGrid{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}.touchMode .supplierQuantity button{min-width:48px}.touchMode .supplierProduct button{width:100%}.touchMode .supplierQuantity button{width:48px}.touchMode .connectMode .dialog p{font-size:15px}.touchMode .connectTable{font-size:14px}
@media(orientation:portrait){.touchMode.playing:not(.modalOpen) #rotateDevice{display:block;position:fixed;top:42%;left:10%;width:80%;padding:18px;background:#292133ed;border:1px solid #ed9ebf;border-radius:16px;text-align:center;font-weight:700;pointer-events:none;z-index:3}.touchMode #rotateDevice small{display:block;font-size:13px;font-weight:400;margin-top:8px}.touchMode #prompt{bottom:180px;max-width:90vw}.touchMode .mission,.touchMode #eventPanel{width:44%;max-height:110px}.touchMode .metrics strong{font-size:13px}.touchMode .metrics div{padding:0 3px}.touchMode .metrics small{font-size:9px}.touchMode .bottom{left:20px;right:20px;bottom:175px}.touchMode .supplierGrid{grid-template-columns:1fr}}
@media(max-height:450px) and (orientation:landscape){.touchMode .mission,.touchMode #eventPanel{max-height:48px}.touchMode .mission .objectives,.touchMode #eventPanel p,.touchMode #helperProgress{display:none}.touchMode #movementJoystick{width:104px;height:104px}.touchMode #stockAction{bottom:118px}.touchMode #toast{bottom:150px}}

.touchMode .metrics{grid-template-columns:repeat(6,minmax(0,1fr))}.touchMode .metrics small{white-space:nowrap}@media(orientation:portrait){.touchMode .metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 0}.touchMode #gameWallet{top:calc(172px + env(safe-area-inset-top))}.touchMode .mission,.touchMode #eventPanel{top:calc(204px + env(safe-area-inset-top))}}

/* Full menu panels own the interaction layer until Back/Close. */
body.modalOpen #welcome{visibility:hidden;pointer-events:none}body.modalOpen header{visibility:hidden;pointer-events:none}#modal{z-index:1000;background:#19131de8;isolation:isolate;overflow:auto}#modal[hidden]{display:none!important}#modal .dialog{box-sizing:border-box;margin:auto;overflow:auto;max-width:calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px);overflow-wrap:anywhere}#modal .dialog h2{overflow-wrap:anywhere}.leaderboardTable{table-layout:fixed}.leaderboardTable td,.leaderboardTable th{overflow-wrap:anywhere}.nicknameInput{box-sizing:border-box;max-width:100%}body.modalOpen #saveStatus{pointer-events:none}
.controllerMode .padFocus{outline:3px solid #ed4c99!important;outline-offset:3px;box-shadow:0 0 0 5px #fff9!important}
.padKeyboard{position:sticky;bottom:0;z-index:20;background:#fff4fa;color:#29232b;border:2px solid #e84692;border-radius:12px;padding:12px;max-height:65dvh;overflow:auto}
.padKeyboard>strong{display:block;overflow-wrap:anywhere;margin-bottom:8px}.padKeys{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:6px}.padKeys button{min-width:0;min-height:44px;padding:8px 3px;font-size:14px}.padKeys button:nth-last-child(-n+2){grid-column:span 2}

/* Optional co-op uses the existing dialog and touch navigation. */
.coopField{display:flex;flex-direction:column;gap:.45rem;text-align:left;font-size:1rem;min-width:0}.coopField input{box-sizing:border-box;width:100%;min-height:46px;padding:.7rem;font:inherit;color:#282330;background:#fff;border:1px solid #ddbbcb;border-radius:10px}
/* Contextual touch actions stay separate from look/joystick gestures. */
.touchMode #stockAction{pointer-events:auto;touch-action:none;z-index:8;min-height:56px;max-width:180px;bottom:calc(128px + env(safe-area-inset-bottom));-webkit-user-select:none;user-select:none}.touchMode #actionTouch{pointer-events:auto;touch-action:none}.blindOpening .blindStage{pointer-events:none}.blindOpening #choices>button{position:relative;z-index:2;touch-action:manipulation;min-height:48px}
.staffPreview{display:block;width:220px;max-width:100%;height:200px;margin:0 auto 12px;border-radius:14px}.staffChoices{display:flex;flex-wrap:wrap;gap:7px;margin:12px 0}.staffChoices strong{width:100%;font-size:13px}.staffChoices button{min-height:44px!important;padding:9px 13px!important;flex:0 1 auto}.staffChoices button[aria-pressed=true]{outline:2px solid #ff87bb;background:#854263!important}
