/* Keep raw canvases/forms from widening the mobile viewport before game CSS arrives. */
html.game-boot-pending, html.game-boot-pending body { margin:0; width:100%; height:100%; min-width:0; overflow:hidden; }
html.game-boot-pending body > :not(#game-loading):not(script):not(link) {
  visibility:hidden!important; position:fixed!important; inset:0!important;
  width:100%!important; max-width:100%!important; overflow:hidden!important;
}
/* Critical startup cover is independent from the rest of the game styles. */
#game-loading {
  position: fixed; inset: 0; z-index: 2147483000; box-sizing: border-box;
  display: grid; place-items: center; overflow: auto;
  padding: max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
  background: linear-gradient(#12383c40,#102e3280), #173e46 url('login-coast.png') center/cover no-repeat;
  color: #fff; font-family: system-ui,sans-serif; text-align: center;
}
#game-loading[hidden] { display: none!important; }
#game-loading .game-loading-card {
  box-sizing: border-box; width: min(360px,100%); min-width: 0; padding: 22px 24px;
  background: #123c3cee; border: 1px solid #ffffff80; border-radius: 22px;
}
#game-loading h1 { font: 700 clamp(22px,4vw,28px)/1.3 system-ui,sans-serif; color: #ffe19c; margin: 0 0 10px; overflow-wrap: break-word; letter-spacing: normal; }
#game-loading p { font: 14px/1.5 system-ui,sans-serif; margin: 0 0 16px; color: #f0f9f4; overflow-wrap: break-word; }
#game-loading .game-loading-spinner { display: block; width: 30px; height: 30px; border: 3px solid #ffffff30; border-top-color: #ffe19c; border-radius: 50%; margin: 0 auto; animation: game-loading-spin .9s linear infinite; }
#game-loading button { display: block; margin: 14px auto 0; min-height: 44px; padding: 8px 22px; border: 1px solid #eee; border-radius: 6px; color: #fff; background: #202020; font: 600 14px system-ui,sans-serif; cursor: pointer; }
#game-loading [hidden] { display: none!important; }
@keyframes game-loading-spin { to { transform: rotate(360deg); } }
@media(prefers-reduced-motion:reduce) { #game-loading .game-loading-spinner { animation: none; } }
