/* The loading cover (index.html #boot-loader): a night city drawn by public/boot/scene.js, shown until main.js
   has built the game and drawn its first frame. Render-blocking in <head>, so the first paint never shows
   unstyled HUD icons. */
html[data-boot] { background: #05061a; }
html[data-boot] body { margin: 0; overflow: hidden; }
html[data-boot] body > :not(#boot-loader),
html[data-boot] body > :not(#boot-loader) * { visibility: hidden !important; }
html[data-boot] dialog::backdrop { visibility: hidden !important; }
#boot-loader {
  position: fixed; inset: 0; z-index: 2147483647; overflow: hidden;
  background: #05061a; color: #eef2fa; font-family: 'Onest', system-ui, sans-serif;
  transition: opacity 0.45s ease-out;
}
#boot-loader[hidden] { display: none; }
#boot-loader.boot-leaving { opacity: 0; pointer-events: none; }
#boot-city { position: absolute; inset: 0; width: 100%; height: 100%; }
#boot-city text { font-family: 'Onest', system-ui, sans-serif; fill: #2a3258; transition: fill 0.2s; }
.boot-head {
  position: absolute; top: max(24px, 8vh); left: 16px; right: 16px;
  display: grid; justify-items: center; gap: 14px; text-align: center;
}
.boot-logo { font-size: clamp(40px, 9vw, 84px); font-weight: 900; font-style: italic; letter-spacing: -2px; line-height: 1; }
.boot-logo span { color: #ff3987; }
#boot-status { margin: 0; font-size: 15px; color: #bdc9da; }
#boot-error { margin: 0; max-width: min(640px, 85vw); white-space: pre-wrap; overflow-wrap: anywhere; color: #ffb6ce; font: 12px/1.5 monospace; }
#boot-retry { padding: 12px 24px; border: 1px solid #58dbec; background: #121a29; color: #eef2fa; font: inherit; cursor: pointer; }

/* The street: the car's light trail is the progress bar (--p from 0 to 1) */
.boot-street { --p: 0; position: absolute; left: 0; right: 0; bottom: 42px; height: 28px; }
.boot-trail {
  position: absolute; left: 0; bottom: 6px; height: 3px;
  width: calc(var(--p) * (100% - 64px) + 8px);
  background: #58dbec; box-shadow: 0 0 10px #58dbec;
}
.boot-car { position: absolute; bottom: 0; left: calc(var(--p) * (100% - 64px)); width: 120px; height: 28px; }
.boot-foot {
  position: absolute; left: 16px; right: 16px; bottom: 12px; margin: 0;
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  font-size: 13px; color: #7f8aa8;
}
#boot-percent { color: #58dbec; font-weight: 700; font-variant-numeric: tabular-nums; }

/* The rooftop sign: dark while loading, flickers on when the game is ready */
#boot-city .boot-sign.on text { fill: #eef2fa; animation: boot-flicker 0.45s steps(1); }
#boot-city .boot-sign.on .boot-sign-pink { fill: #ff3987; }
.boot-far { animation: boot-far 90s linear infinite; }
.boot-blink { animation: boot-blink 1.6s steps(1) infinite; }
@keyframes boot-far { to { transform: translateX(-640px); } }
@keyframes boot-blink { 60% { opacity: 0.15; } }
@keyframes boot-flicker { 20% { opacity: 0.2; } 40% { opacity: 1; } 60% { opacity: 0.3; } 80% { opacity: 1; } }

/* A start-up error: the city stays, the message sits on a panel and the street empties */
html[data-boot="error"] .boot-head {
  top: 50%; left: 50%; right: auto; transform: translate(-50%, -50%);
  width: min(640px, calc(100vw - 32px)); box-sizing: border-box; padding: 24px;
  background: rgba(10, 13, 42, 0.92); border: 1px solid #ff3987;
}
html[data-boot="error"] #boot-status { color: #ffb6ce; }
html[data-boot="error"] .boot-street,
html[data-boot="error"] .boot-foot { display: none; }

/* No keyboard on touch screens: the key hints would only confuse */
@media (pointer: coarse) { #boot-tip { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .boot-far, .boot-blink, #boot-city .boot-sign.on text { animation: none; }
  #boot-loader { transition: none; }
}
