/* Shared phone/tablet layout; desktop geometry stays in the existing styles. */
.mobile-game-menu,.mobile-game-backdrop{display:none}
@media(max-width:900px){
 html body{min-width:0}
 body .game-ui{height:100dvh!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important}
 body .game-ui #sharedHeader.top-hud{height:112px!important;min-height:112px!important;max-height:112px!important;flex:0 0 112px!important}
 body #sharedHeader>.hl2-header{display:flex!important;justify-content:flex-start!important;overflow-x:auto!important;overflow-y:hidden!important;height:56px!important;max-width:100%;scrollbar-width:thin}
 body #sharedHeader .hl2-header>*{flex-shrink:0!important}
 body #sharedHeader .hl2-header .hl2-link,body #sharedHeader .hl2-header .hl2-icon-link{min-width:44px;min-height:44px}
 body #sharedHeader .hl2-link-label{display:inline!important;font-size:11px}
 body #sharedHeader .hl2-link{width:auto!important;gap:6px;padding:0 10px!important}
 body #sharedHeader .hl2-icon-link--players{display:flex!important}
 body .mobile-game-menu{display:block;flex:0 0 48px;width:100%;min-height:48px;text-align:left;padding:0 16px;border:0;border-bottom:1px solid #b18c4f80;background:linear-gradient(#253027,#101a14);color:#f1ce8e;font:600 15px/1.3 'Segoe UI',sans-serif;z-index:4500;cursor:pointer}
 body .mail-menu-toggle{display:none!important}
 body .game-ui>.game-body,body[data-page] .game-body{display:block!important;flex:1 1 auto!important;grid-template-columns:minmax(0,1fr)!important;min-height:0!important;height:auto!important;overflow:hidden!important}
 body .game-ui .game-body>main{grid-column:1!important;width:100%!important;max-width:100%!important;min-width:0!important;height:100%!important;min-height:0!important;max-height:none!important;overflow:auto!important;overscroll-behavior:contain;padding-bottom:max(20px,env(safe-area-inset-bottom))!important}
 body #sharedSidebar.sidebar{display:none!important}
 body.mobile-game-menu-open #sharedSidebar.sidebar{display:flex!important;position:fixed!important;top:160px!important;left:0!important;width:min(300px,calc(100vw - 40px))!important;min-width:0!important;max-width:300px!important;height:calc(100dvh - 160px)!important;min-height:0!important;max-height:none!important;overflow-y:auto!important;z-index:4400!important;transform:none!important;padding-bottom:env(safe-area-inset-bottom)}
 body #sharedSidebar .sidebar-profile,body #sharedSidebar nav{flex-shrink:0!important}
 body #sharedSidebar nav{overflow:visible!important;flex:none!important;min-height:0!important}
 body #sharedSidebar .nav-link{min-height:44px!important;font-size:14px!important}
 body #sharedSidebar #menuButton{display:none!important}
 body #sharedSidebar .sidebar-admin-refill,body #sharedSidebar [data-wallet]{min-height:44px}
 body #sharedSidebar .sidebar-level-badge{min-height:44px}
 body.mobile-game-menu-open .mobile-game-backdrop{display:block;position:fixed;inset:160px 0 0;background:#0009;border:0;z-index:4300}
 body .game-body>main button,body .game-body>main select{min-height:44px}
 body input:not([type=checkbox]):not([type=radio]),body textarea,body select{font-size:16px!important;max-width:100%}
 body dialog{max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;overflow:auto!important;box-sizing:border-box}
 body dialog input,body dialog button{min-height:44px}
 .travel-modal{z-index:6500;padding:12px}
 .travel-modal-card{max-height:calc(100dvh - 24px);overflow:auto}
 .travel-modal-close{min-width:44px;min-height:44px}
 body .wallet-dialog .wallet-close{min-width:44px;min-height:44px}
 body .dashboard-compact-info{display:block!important;padding:12px!important}
 .dashboard-compact-info .db-top-row,.dashboard-compact-info .db-middle-row,.dashboard-compact-info .db-bottom-row{grid-template-columns:minmax(0,1fr);margin-bottom:12px}
 .dashboard-compact-info .db-panel{min-width:0;overflow:visible}
 .dashboard-compact-info .db-panel__title{font-size:21px;line-height:1.2}
 .dashboard-compact-info .db-row{grid-template-columns:minmax(0,1fr) auto;gap:8px}
 .dashboard-compact-info .db-row span{overflow-wrap:anywhere}
 .scavenge-main .zone-description{font-size:14px;line-height:1.5}
 .scavenge-main .scavenge-drops>span{min-width:0;overflow-wrap:anywhere}
 .travel-page .travel-name{font-size:15px}
 .travel-page .travel-description{font-size:13px;line-height:1.5}
 .travel-page .travel-level{font-size:12px}
 .travel-page .travel-button{font-size:12px;min-height:44px}
 .outpost-page nav a,.outpost-page nav button{min-height:44px}
 body .simple-inventory-page{display:block!important}
 .simple-inventory-page .si-loadout-section{height:auto;min-height:0;overflow:visible}
 .simple-inventory-page .si-items-section{margin-top:12px;height:auto;min-height:320px}
 .simple-inventory-page .si-tabs{display:flex;overflow-x:auto;min-height:48px}
 .simple-inventory-page .si-tab{flex:0 0 108px;min-height:48px}
 .login-form .input-row,.login-form .action-button{min-height:44px}
 .login-form .password-toggle{min-width:44px;min-height:44px}
}
@media(max-width:480px){
 .gym-main .gym-stat-card{min-width:0}
 .gym-main .next-rank{white-space:normal}
 .boss-page .boss-entry{grid-template-columns:minmax(0,1fr)}
 .boss-page .boss-entry .boss-portrait{width:100%;height:220px;object-fit:cover}
 .boss-page .boss-public-row{grid-template-columns:minmax(0,1fr)}
 .dashboard-compact-info .db-stat-chip,.dashboard-compact-info .db-record-box{min-width:0;padding:10px 8px}
}

/* Keep the document fixed; page scrolling begins below the shared header. */
html:has(body > .game-ui), body:has(> .game-ui) {
 height:100%; overflow:hidden!important;
}
body > .game-ui {
 height:100dvh!important; min-height:0!important; max-height:100dvh!important;
 display:flex!important; flex-direction:column!important; overflow:hidden!important;
}
body > .game-ui > .game-body {
 flex:1 1 0!important; height:auto!important; min-height:0!important; overflow:hidden!important;
}
@media(min-width:901px) {
 body > .game-ui > .game-body > main,
 body > .game-ui > .game-body > .admin-ajax-host {
  height:100%!important; min-height:0!important; max-height:100%!important;
  overflow:auto!important; overscroll-behavior-y:contain;
 }
}
