/* Shared start/loading screen. The supplied art keeps its original proportions. */
/* Stay hidden through the loader's fade, until it is actually removed from view.
   Chapter 1 also tracks its drone intro explicitly. */
body:has(#loader:not([style*="display: none"])) :is(#cute-btn-settings, #cute-btn-fullscreen),
body.cute-intro :is(#cute-btn-settings, #cute-btn-fullscreen),
body[data-chapter]:not([data-chapter="ship"]):not(.playing) :is(#cute-btn-settings, #cute-btn-fullscreen) {
  display: none !important;
}
.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .8); /* Full-screen black foil, 20% transparent. */
  transition: opacity .65s ease;
}
.loader-overlay.hidden { opacity: 0; pointer-events: none; }
.loader-card {
  position: relative;
  width: min(88vw, 800px);
  padding: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.loader-art-panel {
  width: 100%;
  max-width: calc((100dvh - 208px) * 16 / 9);
  aspect-ratio: 16 / 9;
}
.loader-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.loader-bar-outer {
  position: absolute;
  top: calc(100% + 12px);
  box-sizing: border-box;
  width: min(76%, 480px);
  height: 20px;
  padding: 3px;
  background: #241b13;
  border: 2px solid #b88a3c;
  border-radius: 999px;
  overflow: hidden;
}
.loader-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #d89228, #ffda69);
  border-radius: inherit;
  transition: width .12s ease-out;
}
.loader-percent { position: absolute; top: calc(100% + 44px); color: #ffda69; font-size: 16px; font-weight: 800; line-height: 1; }
.loader-status { position: absolute; top: calc(100% + 72px); width: 100%; color: #e4d2b5; font-size: 15px; font-weight: 600; min-height: 24px; }
@media (max-height: 450px) {
  .loader-card { gap: 7px; }
  .loader-art-panel { max-width: calc((100dvh - 176px) * 16 / 9); }
  .loader-bar-outer { top: calc(100% + 7px); }
  .loader-percent { top: calc(100% + 34px); }
  .loader-status { top: calc(100% + 57px); }
}
@media (prefers-reduced-motion: reduce) {
  .loader-overlay, .loader-bar-inner { transition: none; }
}

