/* Sandbox controls are scoped to the new mode; legacy rooms keep their HUD. */
#mobile-sound[data-ready=false]{border-color:#e8ba6b;color:#ffe3a8}
#mobile-sound{min-width:52px;font-size:11px}
#shift-lock-reticle,#shift-lock-status{display:none;pointer-events:none}
body.shift-locked #shift-lock-reticle{display:block;position:fixed;left:50%;top:50%;width:8px;height:8px;transform:translate(-50%,-50%);border:2px solid #fff;border-radius:50%;background:#26394a;box-shadow:0 0 0 2px #26394a66;z-index:10}
body.shift-locked #shift-lock-status{display:block;position:fixed;left:50%;top:18px;transform:translateX(-50%);margin:0;padding:8px 12px;border-radius:9px;background:#182a43e8;color:#fff;font-size:11px;z-index:10}
body.shift-locked #sandbox-crosshair{display:none!important}
#shift-lock-toggle[aria-pressed=true]{background:#e2f0dc;color:#294c30}
.mobile-layout #shift-lock-toggle{display:none!important}
@media (pointer:coarse){#shift-lock-toggle{display:none!important}}
.sandbox-mode-note{display:grid;gap:4px;margin:0;padding:10px 12px;border:1px solid #e5d2a6;border-radius:10px;background:#fff6df;color:#6e5220;font-size:11px;line-height:1.45}
.sandbox-mode-note strong{font-size:11px;font-weight:800}.sandbox-mode-note span{color:#786545}.sandbox-mode-note[data-pvp=false]{background:#eaf4ef;border-color:#c9dfd4;color:#315f4d}.sandbox-mode-note[data-pvp=false] span{color:#557166}
.sandbox-pvp-option{padding:4px 0}.sandbox-pvp-option small{white-space:normal}
.sandbox-hud{position:absolute;inset:0;pointer-events:none;color:#1d2d46}
.sandbox-hud[hidden],.sandbox-hud [hidden],#sandbox-craft-dialog [hidden]{display:none!important}
.hud.sandbox-active .mission-hud,.hud.sandbox-active #wallet,.hud.sandbox-active #map-name,.hud.sandbox-active #hotbar,.hud.sandbox-active .controls-hint,.hud.sandbox-active #interact,.hud.sandbox-active #open-inventory,.hud.sandbox-active #emote,.hud.sandbox-active .portrait-tip{display:none!important}
.hud.sandbox-active .hud-top{justify-content:flex-end}
.hud.sandbox-active .adventure-bar{top:159px;grid-template-columns:repeat(3,auto);gap:6px}
.hud.sandbox-active .adventure-bar button{min-height:44px;padding:9px 12px;font-size:11px;text-align:center}
.hud.sandbox-defeated>*{visibility:hidden!important;pointer-events:none!important}
.sandbox-survival{position:absolute;top:160px;left:16px;width:220px;padding:10px 12px;border:1px solid #b9eff1;border-radius:12px;background:#133746ed;color:#fff;font-size:12px;pointer-events:none}
.sandbox-survival>div{display:flex;align-items:center;gap:7px;margin:3px 0}.sandbox-survival label{min-width:48px}.sandbox-survival strong{min-width:34px;font-variant-numeric:tabular-nums}.sandbox-survival meter{width:80px;flex:1}.sandbox-survival p{margin:6px 0 0;line-height:1.35;font-size:11px}.sandbox-survival[data-danger=true]{border-color:#ffc482;color:#ffe0b8}
.hud[data-underwater=true]{box-shadow:inset 0 0 70px 18px #125f7977}
.mobile-layout .sandbox-survival{left:calc(var(--safe-left) + 12px);top:120px;width:174px;padding:6px 8px;font-size:10px}.mobile-layout .sandbox-survival label{min-width:37px}.mobile-layout .sandbox-survival strong{min-width:27px}.mobile-layout .sandbox-survival p{font-size:9px;margin-top:3px}.mobile-layout .sandbox-survival meter{width:45px}
@media(orientation:landscape) and (max-height:400px){.mobile-layout .sandbox-survival{left:50%;transform:translateX(-50%);top:105px;width:220px}.mobile-layout .sandbox-survival>div{display:inline-flex;width:48%}.mobile-layout .sandbox-survival meter{display:none}.mobile-layout .sandbox-survival p{text-align:center}}
.sandbox-vitals{position:absolute;top:16px;left:16px;width:246px;padding:13px 15px;border:1px solid #ffffffb3;border-radius:14px;background:#f8fbfff5;box-shadow:0 8px 25px #14263e17}
.sandbox-health-heading{display:flex;align-items:center;gap:9px;font-size:11px;font-weight:750;color:#536783}
#sandbox-health-value{margin-left:auto;font-size:18px;font-weight:900;color:#1c493a;font-variant-numeric:tabular-nums}
.sandbox-pvp-badge{padding:3px 5px;border-radius:5px;background:#fff0d1;color:#87631f;font-size:9px;font-weight:900}
.sandbox-health{height:8px;margin-top:9px;border-radius:20px;background:#d9e5df;overflow:hidden}
.sandbox-health>span{display:block;height:100%;width:100%;background:#319676;border-radius:inherit}
.sandbox-vitals[data-low-health=true] #sandbox-health-value{color:#a1463d}.sandbox-vitals[data-low-health=true] .sandbox-health>span{background:#c96757}
.sandbox-shield{margin:8px 0 0;color:#3c659b;font-size:10px;font-weight:750;line-height:1.4}
.sandbox-materials{position:absolute;left:16px;top:111px;display:flex;gap:6px;pointer-events:none}
.sandbox-materials>span{display:flex;align-items:center;gap:5px;min-width:77px;min-height:33px;padding:6px 8px;border:1px solid #ffffff9c;border-radius:8px;background:#f8fbfff0;font-size:9px;font-weight:750;color:#51647f}
.sandbox-materials strong{margin-left:2px;color:#243a59;font-size:13px;font-variant-numeric:tabular-nums}.sandbox-material-dot{display:inline-block;width:8px;height:8px;flex-shrink:0;border-radius:2px;background:#b88750}.sandbox-material-dot.stone{background:#8091aa}.sandbox-material-dot.ore{background:#7092bd}
.sandbox-crosshair{position:absolute;left:50%;top:50%;width:20px;height:20px;transform:translate(-50%,-50%);filter:drop-shadow(0 1px 2px #0a183db3)}
.sandbox-crosshair::before,.sandbox-crosshair::after{content:'';position:absolute;background:#fff;border-radius:2px}.sandbox-crosshair::before{left:9px;top:0;width:2px;height:20px}.sandbox-crosshair::after{left:0;top:9px;width:20px;height:2px}.sandbox-crosshair span{position:absolute;inset:5px;border-radius:50%;border:1px solid #fff;background:#3d63e540}
.sandbox-toolbelt{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);display:flex;gap:7px;padding:6px;border:1px solid #ffffff5c;border-radius:15px;background:#182a43eb;box-shadow:0 8px 24px #14243e26;pointer-events:auto}
.sandbox-toolbelt button{display:grid;justify-items:center;align-content:center;gap:3px;min-width:64px;min-height:56px;padding:7px 9px;border:1px solid transparent;border-radius:10px;background:transparent;color:#dfe8f8;cursor:pointer;touch-action:manipulation}
.sandbox-toolbelt button>span{font-size:21px;line-height:1.1}.sandbox-toolbelt button strong{font-size:10px;font-weight:800;white-space:nowrap}.sandbox-toolbelt button[aria-pressed=true]{background:#f7faff;color:#254375;border-color:#fff}.sandbox-toolbelt .sandbox-craft-shortcut{border-color:#7a95bf75;background:#344e72}
.sandbox-context{position:absolute;left:50%;bottom:101px;transform:translateX(-50%);max-width:min(440px,calc(100vw - 32px));padding:10px;border:1px solid #ffffff86;border-radius:13px;background:#1c2e48ed;box-shadow:0 7px 24px #14243e2b;pointer-events:auto;text-align:center}
#sandbox-context-label{margin:0 4px 7px;color:#dce7f8;font-size:11px;font-weight:750;line-height:1.4}.sandbox-context-actions{display:flex;justify-content:center;gap:7px}
.sandbox-action{min-height:44px;min-width:100px;padding:9px 15px;border:1px solid #d8e4f9;border-radius:9px;background:#e5edfa;color:#223f68;font-size:12px;font-weight:800;cursor:pointer;touch-action:manipulation}.sandbox-action-primary{background:#f6ca6e;border-color:#ffe1a2;color:#49391b}
.sandbox-fire{position:absolute;right:20px;bottom:102px;display:grid;place-items:center;align-content:center;gap:2px;width:76px;min-height:70px;padding:8px;border:2px solid #ffffffae;border-radius:17px;background:#4c66d1;color:#fff;box-shadow:0 5px 16px #162d4726;pointer-events:auto;cursor:pointer;touch-action:manipulation}
.sandbox-fire>span{font-size:27px;line-height:1}.sandbox-fire>strong{font-size:11px;line-height:1.4}
.sandbox-flight{position:absolute;right:18px;bottom:18px;display:grid;gap:8px;pointer-events:auto}
.sandbox-flight button{display:flex;align-items:center;justify-content:center;gap:7px;width:88px;min-height:50px;padding:8px;border:1px solid #ffffffa6;border-radius:12px;background:#294b7aec;color:#fff;font-size:12px;font-weight:800;cursor:pointer;touch-action:none;user-select:none;-webkit-user-select:none}
.sandbox-flight button>span{font-size:22px;line-height:1}.sandbox-flight button[data-held=true]{background:#4d76b3;border-color:#fff}
.sandbox-vehicle-status{position:absolute;bottom:20px;left:50%;transform:translateX(-50%);margin:0;max-width:calc(100vw - 280px);padding:10px 14px;border:1px solid #ffffff57;border-radius:10px;background:#1c2e48e8;color:#e7effe;font-size:12px;font-weight:750;text-align:center;line-height:1.5}
.sandbox-keyboard-hint{position:absolute;left:16px;bottom:18px;display:grid;gap:6px;padding:11px 13px;border:1px solid #ffffff47;border-radius:12px;background:#182a43de;color:#e4edfa;font-size:10px;line-height:1.4}.sandbox-keyboard-hint kbd{min-width:30px;height:20px;margin-right:6px;font-size:9px}
.hud.sandbox-active[data-sandbox-vehicle=buggy] .mobile-actions,.hud.sandbox-active[data-sandbox-vehicle=boat] .mobile-actions,.hud.sandbox-active[data-sandbox-vehicle=helicopter] .mobile-actions{visibility:hidden;pointer-events:none}
.sandbox-feedback{position:absolute;left:50%;top:20px;transform:translateX(-50%);max-width:min(420px,calc(100vw - 550px));padding:10px 14px;margin:0;border-radius:10px;background:#183452ed;color:#fff;font-size:12px;line-height:1.5;text-align:center}
.sandbox-hud button:disabled{opacity:.55;cursor:default}.sandbox-hud button:active{transform:scale(.97)}.sandbox-toolbelt button:focus-visible,.sandbox-action:focus-visible,.sandbox-flight button:focus-visible,.sandbox-fire:focus-visible{outline:3px solid #ffe49a;outline-offset:3px}
#sandbox-craft-dialog{width:min(720px,calc(100% - 24px));max-height:calc(100dvh - 28px);padding:0;overflow:hidden}
#sandbox-craft-dialog[open]{display:flex;flex-direction:column}
#sandbox-craft-dialog .dialog-heading{padding:23px 24px 18px;margin:0;flex-shrink:0}
.sandbox-craft-tabs{display:flex;gap:8px;padding:0 24px 16px;flex-shrink:0;border-bottom:1px solid #dbe4f0}
.sandbox-craft-tabs button{min-height:44px;padding:9px 14px;border:1px solid #cfdaec;border-radius:10px;background:#ecf2fa;color:#52698b;font-size:12px;font-weight:800;cursor:pointer}
.sandbox-craft-tabs button[aria-selected=true]{background:#294972;color:#fff;border-color:#294972}
.sandbox-craft-scroll{overflow:auto;min-height:0;padding:21px 24px 24px;overscroll-behavior:contain;scroll-padding:16px}
.sandbox-craft-intro{font-size:13px;line-height:1.6;color:#5b6f8d;margin:0 0 18px}
.sandbox-build-options{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.sandbox-build-options button{display:grid;justify-items:start;gap:8px;min-height:166px;padding:20px;border:1px solid #c6d4e7;border-radius:13px;background:#fff;color:#29466d;text-align:left;cursor:pointer}
.sandbox-build-options strong{font-size:15px;line-height:1.4}.sandbox-build-options small{font-size:12px;color:#71829b}
.sandbox-block-icon{display:grid;place-items:center;width:49px;height:49px;border-radius:10px;background:#f1e4d4;color:#88643d;font-size:34px;line-height:1}.sandbox-block-icon.stone{background:#e3eaf3;color:#677d9b}
.sandbox-build-options button:disabled{cursor:default;opacity:.65}.sandbox-craft-tip{padding:12px 14px;border-radius:9px;background:#eaf0f8;color:#657894;font-size:12px;line-height:1.6;margin:18px 0 0}
.sandbox-recipes{display:grid;gap:11px}.sandbox-recipe{display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:14px;padding:15px;border:1px solid #d4deec;border-radius:12px;background:#fff}
.sandbox-recipe-icon{display:grid;place-items:center;width:46px;height:46px;border-radius:10px;background:#eaf0fa;color:#4a6791;font-size:24px;line-height:1}
.sandbox-recipe h3{margin:0 0 4px;color:#29425f;font-size:14px;line-height:1.35}.sandbox-recipe-description{margin:0 0 8px;color:#6c7e96;font-size:11px;line-height:1.45}.sandbox-recipe-cost{display:flex;flex-wrap:wrap;gap:5px;margin:0;color:#4f688d;font-size:11px;font-weight:750;line-height:1.5}.sandbox-recipe-cost span{padding:2px 6px;border-radius:5px;background:#edf2f9}.sandbox-recipe-cost span[data-missing=true]{color:#94602b;background:#fff1db}
.sandbox-recipe button{min-width:87px;min-height:44px;padding:9px 12px;border:1px solid #bfcde2;border-radius:9px;background:#365fba;color:#fff;font-size:12px;font-weight:800;cursor:pointer}.sandbox-recipe button:disabled{background:#edf1f7;color:#7a8a9f;border-color:#d9e0eb;cursor:default}
.sandbox-craft-footer{flex-shrink:0;padding:15px 24px;border-top:1px solid #d4deec;background:#f1f5fb}.sandbox-craft-balance{display:flex;gap:20px;flex-wrap:wrap;color:#657994;font-size:11px}.sandbox-craft-balance strong{margin-left:4px;color:#29456c;font-size:13px;font-variant-numeric:tabular-nums}
#sandbox-craft-feedback{margin:10px 0 0;color:#8b5730;font-size:12px;line-height:1.5}#sandbox-craft-feedback:empty{display:none}
#sandbox-defeat-dialog{width:min(440px,calc(100% - 32px));padding:34px 30px;text-align:center}
#sandbox-defeat-dialog::backdrop{background:#101d33c9;backdrop-filter:blur(8px)}
.sandbox-defeat-mark{display:grid;place-items:center;width:70px;height:70px;margin:0 auto 22px;border:1px solid #cdd8e8;border-radius:20px;background:#e7eef7;color:#6c819e;font-size:23px;font-weight:850}
#sandbox-defeat-dialog .eyebrow{font-size:9px;line-height:1.5;margin-bottom:12px;color:#7a8da7}
#sandbox-defeat-dialog h2{margin:0 0 14px;font-size:28px;line-height:1.15;letter-spacing:-.035em;color:#273c5d}
#sandbox-defeat-message{margin:0 0 24px;color:#627795;font-size:14px;line-height:1.65}
#sandbox-exit-defeat{width:100%;padding:0 14px;min-height:50px;font-size:13px}
.sandbox-defeat-note{margin:15px 0 0;font-size:11px;line-height:1.5;color:#8493a9}
@media(hover:hover) and (pointer:fine){.sandbox-toolbelt button:hover{background:#466083}.sandbox-toolbelt button[aria-pressed=true]:hover{background:#fff}.sandbox-action:hover{filter:brightness(1.06)}.sandbox-build-options button:not(:disabled):hover{border-color:#718fbb;background:#f8faff}.sandbox-recipe button:not(:disabled):hover{background:#284d9c}}
@media(max-width:800px), (any-pointer:coarse){
 .sandbox-keyboard-hint{display:none}
 .sandbox-vitals{left:12px;top:12px;width:204px;padding:10px 12px}.sandbox-health-heading{font-size:10px}#sandbox-health-value{font-size:16px}.sandbox-health{height:7px;margin-top:7px}.sandbox-shield{font-size:9px;margin-top:6px}
 .sandbox-materials{left:12px;top:98px;gap:4px}.sandbox-materials>span{min-width:73px;min-height:29px;padding:5px 6px;font-size:9px;gap:4px}.sandbox-materials strong{font-size:12px}.sandbox-material-dot{width:6px;height:6px}
 .hud.sandbox-active .adventure-bar{left:12px;top:139px;max-width:calc(100vw - 110px);gap:5px}.hud.sandbox-active .adventure-bar button{min-height:44px;padding:8px 9px;font-size:10px}
 .sandbox-toolbelt{bottom:16px;gap:5px;padding:5px;border-radius:13px}.sandbox-toolbelt button{min-width:58px;min-height:52px;padding:6px 7px}.sandbox-toolbelt button>span{font-size:20px}.sandbox-toolbelt button strong{font-size:9px}
 .sandbox-fire{right:18px;bottom:194px;width:72px;min-height:64px}.sandbox-context{bottom:249px;max-width:calc(100vw - 28px);padding:9px}.sandbox-action{min-width:92px;font-size:11px;padding:8px 13px}
 .sandbox-flight{bottom:112px;right:18px}.sandbox-flight button{width:72px;min-height:48px;font-size:11px}
 .sandbox-vehicle-status{bottom:23px;max-width:calc(100vw - 40px);font-size:11px}
 .sandbox-feedback{top:204px;max-width:calc(100vw - 30px);font-size:11px;padding:9px 12px}
 .hud.sandbox-active #minimap{top:100px}.hud.sandbox-active #open-chat{top:190px}.hud.sandbox-active .performance-status{bottom:89px;right:14px}
}
@media(max-width:560px){
 #sandbox-craft-dialog .dialog-heading{padding:18px 18px 14px}#sandbox-craft-dialog .dialog-heading h2{font-size:24px}.sandbox-craft-tabs{padding:0 18px 13px;gap:7px}.sandbox-craft-tabs button{padding:8px 10px;font-size:10px;flex:1}
 .sandbox-craft-scroll{padding:17px 18px 20px}.sandbox-build-options{gap:10px}.sandbox-build-options button{padding:14px;min-height:156px}.sandbox-build-options strong{font-size:13px}.sandbox-build-options small{font-size:11px}.sandbox-craft-intro{font-size:12px}.sandbox-craft-tip{font-size:11px}
 .sandbox-recipe{grid-template-columns:40px minmax(0,1fr);padding:12px;gap:10px}.sandbox-recipe-icon{width:39px;height:39px;font-size:21px}.sandbox-recipe h3{font-size:13px}.sandbox-recipe button{grid-column:2;justify-self:start;min-width:115px}.sandbox-recipe-description{font-size:11px}.sandbox-recipe-cost{font-size:10px}
 .sandbox-craft-footer{padding:13px 18px}.sandbox-craft-balance{gap:13px;font-size:10px}.sandbox-craft-balance strong{font-size:12px}
 .sandbox-mode-note{padding:8px 10px;font-size:10px;gap:3px}.sandbox-mode-note strong{font-size:10px}
}
@media(orientation:landscape) and (max-height:520px){
 .lobby .lobby-copy{max-width:none}
 .sandbox-keyboard-hint{display:none}
 .sandbox-vitals{left:12px;top:10px;width:210px;padding:9px 11px}.sandbox-health-heading{font-size:10px}#sandbox-health-value{font-size:16px}.sandbox-health{height:6px;margin-top:6px}.sandbox-shield{font-size:9px;margin-top:5px}
 .sandbox-materials{left:12px;top:91px;gap:4px}.sandbox-materials>span{min-width:73px;min-height:26px;font-size:9px;padding:4px 6px}.sandbox-materials strong{font-size:12px}
 .hud.sandbox-active .adventure-bar{left:12px;top:124px;grid-template-columns:repeat(3,auto);gap:5px}.hud.sandbox-active .adventure-bar button{min-height:44px;padding:8px 9px;font-size:10px}
 .sandbox-toolbelt{bottom:12px;gap:5px;padding:5px}.sandbox-toolbelt button{min-width:55px;min-height:50px;padding:5px 7px}.sandbox-toolbelt button>span{font-size:19px}.sandbox-toolbelt button strong{font-size:9px}
 .sandbox-context{bottom:81px;max-width:calc(100vw - 292px);padding:8px}#sandbox-context-label{font-size:10px;margin-bottom:5px}.sandbox-action{min-height:44px;min-width:86px;padding:8px 12px;font-size:11px}
 .sandbox-fire{right:18px;bottom:100px;width:72px;min-height:62px}.sandbox-flight{right:18px;bottom:18px;gap:8px}.sandbox-flight button{width:72px;min-height:48px}
 .sandbox-vehicle-status{bottom:20px;max-width:calc(100vw - 285px);font-size:11px;padding:8px 12px}
 .sandbox-feedback{top:16px;max-width:calc(100vw - 500px);font-size:10px;padding:8px 10px}
 .hud.sandbox-active #minimap{top:90px}.hud.sandbox-active #open-chat{top:170px}.hud.sandbox-active .performance-status{bottom:9px;right:103px}
 #sandbox-craft-dialog{max-height:calc(100dvh - 20px)}#sandbox-craft-dialog .dialog-heading{padding:12px 18px 10px}#sandbox-craft-dialog .dialog-heading .eyebrow{display:none}#sandbox-craft-dialog .dialog-heading h2{font-size:22px}.sandbox-craft-tabs{padding:0 18px 10px}.sandbox-craft-tabs button{min-height:44px;font-size:11px}.sandbox-craft-scroll{padding:15px 18px}.sandbox-craft-footer{padding:10px 18px}
 #sandbox-defeat-dialog{padding:20px 28px;max-width:510px}.sandbox-defeat-mark{width:47px;height:47px;margin-bottom:12px;border-radius:13px;font-size:18px}#sandbox-defeat-dialog .eyebrow{display:none}#sandbox-defeat-dialog h2{font-size:25px;margin-bottom:10px}#sandbox-defeat-message{font-size:12px;margin-bottom:16px;line-height:1.5}.sandbox-defeat-note{margin-top:10px;font-size:10px}
 .sandbox-mode-note{padding:6px 9px;font-size:9px;line-height:1.35;gap:2px}.sandbox-mode-note strong{font-size:9px}
}
@media(orientation:landscape) and (max-height:360px){.sandbox-vitals{width:185px}.sandbox-materials{top:85px}.hud.sandbox-active .adventure-bar{top:116px}.sandbox-toolbelt button{min-width:49px;min-height:44px}.sandbox-toolbelt{gap:3px}.sandbox-context{bottom:70px}.sandbox-feedback{top:10px}.sandbox-flight button{min-height:44px}}
@media(prefers-reduced-motion:reduce){.sandbox-hud button:active{transform:none}}
/* Audio controls remain usable in the scrollable landscape settings dialog. */
.audio-settings{display:grid;gap:12px;min-width:0;margin:0;padding:16px;border:1px solid #d5dfed;border-radius:14px;background:#f3f7fc}
.audio-settings legend{padding:0 6px;font-size:16px;font-weight:800;color:#293b58}
.audio-settings .settings-field input[type=range]{min-height:44px;touch-action:pan-y}
.audio-settings .settings-check{margin:0;min-height:44px}
.audio-settings button{min-height:44px}
.audio-status{margin:0;font-size:12px;line-height:1.5;color:#52647d}
