/* Initial download screen owns its flow independently of lift/travel styles.
   Load after scene-loading.css: those legacy absolute rules also target #loading. */
html body #loading {
  position: fixed;
  inset: 0;
  z-index: 10001;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: 12px;
  padding: max(24px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  overflow: auto;
  text-align: center;
  font-family: system-ui, sans-serif;
}
html body #loading > * {
  position: static;
  inset: auto;
  transform: none;
  flex: none;
  box-sizing: border-box;
  margin: 0;
  max-width: min(420px, 100%);
}
html body #loading .loading-logo {
  position: static;
  inset: auto;
  transform: none;
  width: min(156px, 22dvh, 40vw);
  height: auto;
  object-fit: contain;
  margin: 0 0 6px;
}
html body #loading .brand {
  position: static;
  inset: auto;
  transform: none;
  height: auto;
  min-height: 0;
  font-size: clamp(22px, 5vw, 34px) !important;
  line-height: 1.3;
  letter-spacing: .12em;
  overflow-wrap: anywhere;
}
html body #loading #loading-percent {
  font: 500 30px/1.25 system-ui;
  font-variant-numeric: tabular-nums;
}
html body #loading progress {
  display: block;
  width: min(320px, 100%);
  height: 6px;
}
html body #loading :is(p, small, #loading-retry, #quick-visit, #shop-escape) {
  position: static;
  inset: auto;
  transform: none;
  margin: 0;
  padding: 0;
  width: auto;
  max-width: min(420px, 100%);
  line-height: 1.6;
  white-space: normal;
}
html body #loading #loading-status { font-size: 15px; }
html body #loading #loading-detail { font-size: 12px; letter-spacing: 0; }
html body #loading #loading-patience { font-size: 13px; color: #bbcedf; }
html body #loading .loading-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  width: min(420px, 100%);
}
html body #loading .loading-links a {
  position: static;
  inset: auto;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: #bde8ed;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
  white-space: normal;
}
html body #loading .loading-links .loading-about { color: #aebfce; font-size: 12px; }
html body #loading #loading-retry { min-height: 44px; padding: 10px 22px; }
html body #loading #quick-visit { min-height: 44px; padding: 10px 18px; }
html body #loading [hidden] { display: none !important; }
html body #loading :is(a, button):focus-visible { outline: 2px solid #8ee8d5; outline-offset: 3px; }
@media (max-height: 540px) {
  html body #loading { gap: 7px; padding-block: 14px; }
  html body #loading .loading-logo { width: 60px; margin-bottom: 0; }
  html body #loading .brand { font-size: 21px !important; }
  html body #loading #loading-percent { font-size: 24px; }
}
