/* Atlantis UI parity · mobile-first shared shell, 2026-11-17. */
:root { --atl-top: env(safe-area-inset-top, 0px); --atl-bottom: env(safe-area-inset-bottom, 0px); }
html { width:100%; overflow-x:clip; }
body { width:100%; min-width:0; max-width:100%; overflow-x:clip; }
#shell { box-sizing:border-box; width:100%; max-width:100%; }
@media (max-width:710px), (pointer:coarse) and (max-width:1100px) {
  #shell { height:100dvh; max-height:100dvh; min-height:100dvh; padding-top:var(--atl-top); overflow:hidden; }
  #shell .shell-header { box-sizing:border-box; height:clamp(58px,8dvh,68px); flex-basis:clamp(58px,8dvh,68px); min-height:58px; padding-inline:max(12px,env(safe-area-inset-left,0px)) max(12px,env(safe-area-inset-right,0px)); gap:8px; }
  #shell .logo-lockup { min-width:0; max-width:40%; overflow:hidden; }
  #shell .logo-lockup b, #shell .logo-lockup small { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  #shell .header-right { flex:1 1 0; min-width:0; display:flex; justify-content:flex-end; gap:5px; }
  #shell .account-button { min-width:0; max-width:min(45vw,190px); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  #shell .shell-layout { min-height:0; }
  #shell .workspace { padding:8px max(8px,env(safe-area-inset-right,0px)) 8px max(8px,env(safe-area-inset-left,0px)); }
  #shell.world-mode .workspace { overflow:hidden; }
  #shell.world-mode #worldView { min-height:0; flex:1 1 0; }
  #shell #worldView .world-heading { margin-bottom:5px; }
  #shell .playground-world-nav { box-sizing:border-box; flex:0 0 auto; width:100%; max-width:100%; display:flex; flex-wrap:nowrap; overflow-x:auto; overflow-y:hidden; -webkit-overflow-scrolling:touch; gap:6px; padding:6px; margin:3px 0 6px; min-height:0; }
  #shell .playground-world-nav>span { display:none; }
  #shell .playground-world-nav button { flex:0 0 auto; min-width:max-content; min-height:35px; font-size:11px; padding:7px 10px; white-space:nowrap; }
  #shell .game-viewport { min-height:0; max-height:none; flex:1 1 auto; overflow:hidden; }
  #shell .shell-legal { display:none; }
  #shell .bottom-dock { flex-shrink:0; padding-bottom:max(8px,var(--atl-bottom)); }
  #shell .u01-survival-panel { box-sizing:border-box; top:68px; left:7px; max-width:calc(100% - 14px); width:min(330px,calc(100% - 14px)); max-height:min(32dvh,205px); overflow-y:auto; padding:6px; }
  #shell .u01-survival-panel #survivalActions { max-width:100%; }
  #shell .u01-view-toggle { top:35px; right:7px; z-index:16; }
  #shell .u02-perf-choice { max-width:min(45vw,190px); right:7px; }
  #shell .world-hud-bottom { top:auto; bottom:clamp(112px,20dvh,178px); right:auto; left:7px; max-width:min(65%,265px); pointer-events:none; }
  #shell .world-hud-bottom > div { width:auto; max-width:100%; }
  #shell .world-hud-top { top:5px; right:7px; left:7px; }
  #shell .touch-pad { left:max(12px,env(safe-area-inset-left,0px)); bottom:15px; }
  #shell .touch-action { right:max(12px,env(safe-area-inset-right,0px)); bottom:22px; }
}
@media (max-width:390px) { #shell .logo-lockup small { display:none; } #shell .header-icon { width:32px; min-width:32px; } #shell .world-hud-bottom { max-width:57%; } }
@media (max-height:520px) and (orientation:landscape) and (pointer:coarse) { #shell .u01-survival-panel { top:35px; max-height:40dvh; width:min(44%,300px); } #shell .world-hud-bottom { bottom:65px; } #shell .shell-header { height:42px; min-height:42px; flex-basis:42px; } }

/* U11: iPhone landing screen safe area, normal browser + installed PWA.
   Unlike gameplay fullscreen, the gateway must NEVER draw text under the
   system clock, Dynamic Island/notch, or home indicator.  We use the OS
   inset when available and add a standalone fallback for older iOS shells. */
:root { --atl-gateway-top: env(safe-area-inset-top, 0px); }
#boot.boot-screen {
  padding-top: calc(34px + var(--atl-gateway-top));
  padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px));
  padding-left: max(5.6%, calc(12px + env(safe-area-inset-left, 0px)));
  padding-right: max(5.6%, calc(12px + env(safe-area-inset-right, 0px)));
}
@media (max-width: 710px), (pointer: coarse) and (max-width: 1100px) {
  #boot.boot-screen {
    padding-top: calc(20px + var(--atl-gateway-top));
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    padding-left: max(19px, calc(12px + env(safe-area-inset-left, 0px)));
    padding-right: max(19px, calc(12px + env(safe-area-inset-right, 0px)));
  }
}
/* Some older iOS standalone shells report a zero safe-area inset despite
   placing the clock over the page. Minimum clearance is standalone-only;
   Safari in a normal browser tab retains its original compact spacing. */
@media (display-mode: standalone) and (max-width: 710px) {
  #boot.boot-screen { padding-top: max(calc(20px + var(--atl-gateway-top)), 78px); }
}
@media (display-mode: standalone) and (orientation: landscape) and (pointer: coarse) {
  #boot.boot-screen {
    padding-left: max(19px, calc(12px + env(safe-area-inset-left, 0px)));
    padding-right: max(19px, calc(12px + env(safe-area-inset-right, 0px)));
  }
}
