/* Hustle Heroes' loading screen: Huss in the middle, the squad orbiting him. Pure CSS, so it shows from the
   first paint, before the app's scripts load. */
.hh-loading {
  --load-bg: #fbf7f2; --load-glow: #ffe2cc; --load-ink: #1d1a16; --load-muted: #6b6359; --load-accent: #ff6a13; --load-accent-ink: #c04b05; --load-track: #efe6da;
  position: fixed; inset: 0; z-index: 10; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px;
  background: radial-gradient(120% 60% at 50% -10%, var(--load-glow), transparent 60%), var(--load-bg);
  color: var(--load-ink); font: 15px/1.5 "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-align: center;
}
@media (prefers-color-scheme: dark) {
  .hh-loading { --load-bg: #151311; --load-glow: #3a2213; --load-ink: #f3eee7; --load-muted: #b4aca2; --load-accent-ink: #ff9a5c; --load-track: #2e2a25; }
}

.hh-load-stage { position: relative; width: 196px; height: 196px; }
.hh-load-orbit { position: absolute; inset: 0; animation: hh-load-spin 9s linear infinite; }
.hh-load-orbit > span {
  --n: 7; --r: 84px; --size: 44px;
  position: absolute; left: 50%; top: 50%; width: var(--size); height: var(--size); margin: calc(var(--size) / -2);
  transform: rotate(calc(var(--i) * 360deg / var(--n))) translateY(calc(var(--r) * -1)) rotate(calc(var(--i) * -360deg / var(--n)));
}
.hh-load-orbit > span > i {
  display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: color-mix(in srgb, var(--c) 16%, #fff); box-shadow: 0 0 0 2px var(--load-bg), 0 6px 14px -8px var(--c);
  animation: hh-load-pop .5s cubic-bezier(.34, 1.56, .64, 1) both, hh-load-spin 9s linear infinite reverse;
  animation-delay: calc(var(--i) * 110ms), 0s;
}
.hh-load-orbit img, .hh-load-huss img { display: block; width: 100%; height: 100%; object-fit: cover; }

.hh-load-huss {
  position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px; border-radius: 50%;
  background: color-mix(in srgb, var(--load-accent) 18%, #fff); box-shadow: 0 0 0 3px var(--load-bg), 0 14px 30px -14px var(--load-accent);
  animation: hh-load-bob 1.8s ease-in-out infinite;
}
.hh-load-huss > div { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; }
/* The hero signal: a ring that pulses out from Huss. */
.hh-load-huss::before, .hh-load-huss::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--load-accent); opacity: 0;
  animation: hh-load-signal 2.4s ease-out infinite;
}
.hh-load-huss::after { animation-delay: 1.2s; }

.hh-load-brand { display: flex; align-items: center; gap: 10px; }
.hh-load-brand svg, .hh-load-brand img { width: 30px; height: 30px; display: block; border-radius: 24%; }
.hh-load-brand b { font: 400 26px/1 "Instrument Serif", Georgia, serif; letter-spacing: -.01em; }
.hh-load-brand b i { color: var(--load-accent-ink); }

/* Three lines take turns, without any script. */
.hh-load-lines { position: relative; height: 22px; width: 260px; color: var(--load-muted); font-weight: 600; font-size: 14px; }
.hh-load-lines > span { position: absolute; inset: 0; opacity: 0; animation: hh-load-line 6.6s ease-in-out infinite; }
.hh-load-lines > span:nth-child(2) { animation-delay: 2.2s; }
.hh-load-lines > span:nth-child(3) { animation-delay: 4.4s; }

.hh-load-bar { width: 180px; height: 4px; border-radius: 4px; background: var(--load-track); overflow: hidden; }
.hh-load-bar > span { display: block; width: 40%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff9a3c, var(--load-accent)); animation: hh-load-run 1.3s ease-in-out infinite; }

@keyframes hh-load-spin { to { transform: rotate(360deg); } }
/* The pop-in uses `scale`, which adds to the counter-spin's `transform` instead of replacing it. */
@keyframes hh-load-pop { from { scale: 0; opacity: 0; } }
@keyframes hh-load-bob { 50% { transform: translateY(-6px); } }
@keyframes hh-load-signal { from { transform: scale(.9); opacity: .55; } to { transform: scale(1.7); opacity: 0; } }
@keyframes hh-load-line { 0%, 4% { opacity: 0; transform: translateY(6px); } 8%, 30% { opacity: 1; transform: none; } 34%, 100% { opacity: 0; transform: translateY(-6px); } }
@keyframes hh-load-run { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

@media (prefers-reduced-motion: reduce) {
  .hh-load-orbit, .hh-load-orbit > span > i, .hh-load-huss, .hh-load-huss::before, .hh-load-huss::after, .hh-load-bar > span { animation: none; }
  .hh-load-lines > span { animation: none; }
  .hh-load-lines > span:first-child { opacity: 1; }
  .hh-load-bar > span { width: 100%; opacity: .5; }
}
