/* 🌙 Dark loading screen to prevent white flashbang during WASM initialisation */
body {
  background-color: #1a1a2e !important;
}

/* Uno Platform WASM loading indicator container */
.uno-loading {
  background-color: #1a1a2e !important;
}

#uno-loading {
  background-color: #1a1a2e !important;
}

/* Progress bar container. 📖 It now also holds the readable intro (below), which is taller than a phone
   screen: let it scroll, and keep the top reachable when it overflows ("safe" centring). */
.uno-loader {
  background-color: #1a1a2e !important;
  overflow-y: auto;
  justify-content: safe center;
}

#uno-loader {
  background-color: #1a1a2e !important;
}

/* 📖 The readable intro inside the loader (index.html, 2026-10-10): visible while the app loads, then removed
      with the loader. Narrow and centred so it reads well on a phone. */
.coo-intro {
  max-width: 640px;
  margin: 24px auto 0;
  padding: 0 16px 32px;
  color: #c8c8dc;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  text-align: left;
}
.coo-intro h1 { font-size: 28px; color: #ffffff; margin: 0 0 4px; text-align: center; }
.coo-intro h2 { font-size: 17px; color: #b8b8d8; margin: 20px 0 4px; }
.coo-intro p { margin: 0 0 8px; font-size: 15px; }
.coo-intro nav { margin-top: 20px; font-size: 14px; text-align: center; }
.coo-intro a { color: #8fa4ff; }

/* 🖼️ Splash logo in normal flow (2026-10-13, "the logo on the loading screen overlaps with the text"). Uno's
      bootstrap CSS pins `.uno-loader .logo` with position: fixed at 50%/50%, which was fine while the loader
      held only the logo and a progress bar. Since the readable intro joined it, that fixed logo was drawn over
      the middle of the text. Put it back in the flow, centred above the heading, so the two can never cover
      each other at any width. `img.logo` outranks Uno's selector regardless of stylesheet order. */
.uno-loader img.logo {
  position: static;
  transform: none;
  display: block;
  margin: 24px auto 0;
  width: auto;
  height: auto;
  max-width: min(90%, 620px);
  max-height: min(40vh, 300px);
}
/* Before Uno fills in the src the empty image must take no space (Uno only hides it with visibility). */
.uno-loader img.logo[src=''] { display: none; }
/* The progress bar is absolute at the loader's bottom edge, so once the intro is taller than the screen it
   scrolled with the text and always sat across the same line (the footer links on a laptop). Pin it to the
   window instead: scrolling moves the text out from under it, and the intro's bottom padding leaves the last
   line clear at the end of the scroll. */
.uno-loader progress { position: fixed; }

/* 📶 2026-10-26: the progress block under the title (index.html #coo-boot, filled by boot-progress.js). Lewis: "doesn't
      inform the user of progress (except the loading bar at the bottom, which is good, maybe could be a bit more
      obvious". Fixed line heights, so changing words never move the text below. The loader is always dark (the
      splash colour), so these colours hold in light and dark mode alike; each pair passes WCAG AA. */
.coo-boot { margin: 16px 0 8px; padding: 14px 16px; border-radius: 10px; background: #24243e; color-scheme: dark; }
.coo-boot-head { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 8px; min-height: 1.5em;
  font-size: 18px; font-weight: 600; color: #ffffff; }
#coo-boot-pct { font-variant-numeric: tabular-nums; color: #b9c6ff; }
.coo-boot-bar { height: 12px; border-radius: 6px; background: #3a3a5c; overflow: hidden; }
.coo-boot-bar > div, .coo-boot-edge > div { height: 100%; width: 0; background: #8fa4ff; transition: width 0.3s ease-out; }
.coo-boot .coo-boot-detail { margin: 8px 0 0; min-height: 3em; font-size: 14px; line-height: 1.5;
  color: #d4d4e6; font-variant-numeric: tabular-nums; }
.coo-boot .coo-boot-hurry { margin: 10px 0 0; font-size: 14px; color: #d4d4e6; }
.coo-boot-error { margin-top: 10px; padding: 10px 12px; border-left: 4px solid #ff9e94; background: #3a2430; }
.coo-boot-error p { margin: 0 0 8px; color: #ffe1dd; font-size: 15px; }
.coo-boot-error button { min-height: 44px; padding: 8px 20px; border: 0; border-radius: 6px; font: inherit;
  font-weight: 600; background: #8fa4ff; color: #11112a; cursor: pointer; }
.coo-boot-error button:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }
.coo-boot-failed .coo-boot-bar > div { background: #ff9e94; }
/* After the download there is no number to show: the full bar pulses (and keeps still under reduced motion). */
.coo-boot-busy .coo-boot-bar > div { width: 100% !important; animation: coo-boot-pulse 1.6s ease-in-out infinite; }
.coo-boot-busy.coo-boot-failed .coo-boot-bar > div { animation: none; }
@keyframes coo-boot-pulse { 50% { opacity: 0.45; } }
/* The thin bar at the window's foot stays (Lewis liked it), now showing the same real number as the block. */
.coo-boot-edge { display: none; }
.uno-loader.coo-boot-live .coo-boot-edge { display: block; position: fixed; left: 0; right: 0; bottom: 0; height: 5px;
  background: #3a3a5c; }
.uno-loader.coo-boot-live progress { display: none; }
@media (prefers-reduced-motion: reduce) {
  .coo-boot-bar > div, .coo-boot-edge > div { transition: none; }
  .coo-boot-busy .coo-boot-bar > div { animation: none; }
}
