/* Full-screen "finding your upgrades" animation (loader.js), used by the home page and the upgrade finder. */
.wl { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; overflow: hidden; color: #f3ead0;
  background: radial-gradient(900px 600px at 50% 45%, #1a2347 0%, #0a0d1a 62%, #05060c 100%);
  opacity: 0; transition: opacity .35s ease; }
.wl.on { opacity: 1; }
.wl.leave { opacity: 0; transition: opacity .5s ease .1s; }
.wl.leave .wl-stage { transform: scale(1.18); filter: blur(2px); transition: transform .6s cubic-bezier(.2, .7, .2, 1), filter .6s; }
.wl::before { content: ""; position: absolute; inset: -50%; pointer-events: none; opacity: .55;
  background-image: radial-gradient(1px 1px at 10% 20%, #fff9, transparent), radial-gradient(1px 1px at 30% 70%, #fff7, transparent),
    radial-gradient(1px 1px at 45% 15%, #fff8, transparent), radial-gradient(1.5px 1.5px at 60% 40%, #fffa, transparent),
    radial-gradient(1px 1px at 75% 80%, #fff7, transparent), radial-gradient(1px 1px at 85% 25%, #fff8, transparent),
    radial-gradient(1px 1px at 20% 90%, #fff6, transparent), radial-gradient(1.5px 1.5px at 92% 60%, #fff9, transparent);
  background-size: 420px 420px; animation: wl-drift 60s linear infinite; }
@keyframes wl-drift { to { transform: translate(-420px, -210px); } }

.wl-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 24px; text-align: center;
  width: min(560px, 100%); }
.wl-orb { position: relative; width: 260px; height: 260px; }
.wl-orb svg.rings { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wl-r1 { transform-origin: 130px 130px; animation: wl-spin 18s linear infinite; }
.wl-r2 { transform-origin: 130px 130px; animation: wl-spin 11s linear infinite reverse; }
.wl-r3 { transform-origin: 130px 130px; animation: wl-spin 6s linear infinite; }
.wl-prog { transition: stroke-dashoffset .5s ease; transform-origin: 130px 130px; transform: rotate(-90deg); }
@keyframes wl-spin { to { transform: rotate(360deg); } }
.wl-crest { position: absolute; left: 50%; top: 50%; width: 92px; height: 101px; transform: translate(-50%, -52%);
  filter: drop-shadow(0 0 18px rgba(248, 183, 0, .55)); animation: wl-pulse 2.2s ease-in-out infinite; }
@keyframes wl-pulse { 0%, 100% { transform: translate(-50%, -52%) scale(1); filter: drop-shadow(0 0 14px rgba(248, 183, 0, .45)); }
  50% { transform: translate(-50%, -52%) scale(1.06); filter: drop-shadow(0 0 30px rgba(248, 183, 0, .8)); } }
.wl-crest .chev { animation: wl-rise 1.6s ease-in-out infinite; }
.wl-crest .chev.b { animation-delay: .25s; }
@keyframes wl-rise { 0%, 100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(-5px); opacity: .7; } }

/* the nine class colours orbiting */
.wl-orbit { position: absolute; inset: 0; animation: wl-spin var(--dur, 7s) linear infinite; animation-delay: var(--delay, 0s); }
.wl-orbit i { position: absolute; left: 50%; top: calc(50% - var(--r, 110px)); width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px;
  border-radius: 50%; background: var(--cc); box-shadow: 0 0 10px var(--cc), 0 0 22px var(--cc); }
.wl-orbit.rev { animation-direction: reverse; }

/* burst when the result is ready */
.wl-burst { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; pointer-events: none;
  opacity: 0; box-shadow: 0 0 0 0 rgba(248, 183, 0, .7); }
.wl.done .wl-burst { animation: wl-burst .9s ease-out forwards; }
@keyframes wl-burst { 0% { opacity: 1; box-shadow: 0 0 0 0 rgba(248, 183, 0, .75), 0 0 0 0 rgba(255, 224, 138, .5); }
  100% { opacity: 0; box-shadow: 0 0 0 160px rgba(248, 183, 0, 0), 0 0 0 260px rgba(255, 224, 138, 0); } }
.wl.done .wl-crest { animation: none; transform: translate(-50%, -52%) scale(1.12); filter: drop-shadow(0 0 40px rgba(255, 210, 80, .95)); transition: all .4s; }

.wl-title { margin: 0; font-family: var(--display, Georgia, serif); font-weight: 800; letter-spacing: 1.5px; font-size: clamp(24px, 4vw, 32px); }
.wl-step { min-height: 24px; margin: -6px 0 0; color: #c9cfdf; font-size: 15.5px; transition: opacity .25s; }
.wl-step.swap { opacity: 0; }
.wl-bar { position: relative; width: min(420px, 86vw); height: 8px; border-radius: 99px; overflow: hidden; background: #1a2036;
  box-shadow: 0 0 0 1px #2c3352 inset; }
.wl-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; transition: width .5s ease;
  background: linear-gradient(90deg, #a86f00, #f8b700, #ffe08a); box-shadow: 0 0 14px rgba(248, 183, 0, .6); }
.wl-bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-100%); animation: wl-shine 1.4s ease-in-out infinite; }
@keyframes wl-shine { to { transform: translateX(100%); } }
.wl-meta { display: flex; justify-content: space-between; width: min(420px, 86vw); margin-top: -10px; color: #8f96ab; font-size: 13px;
  font-variant-numeric: tabular-nums; }
.wl-who { color: #e8d9a8; font-weight: 600; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-cancel { font: inherit; font-size: 13.5px; color: #9aa1b5; background: none; border: 1px solid #2c3352; border-radius: 8px; padding: 6px 14px;
  cursor: pointer; }
.wl-cancel:hover { color: #fff; border-color: #4a5276; }

/* error inside the overlay */
.wl.err .wl-orbit, .wl.err .wl-r3 { animation-play-state: paused; opacity: .25; }
.wl.err .wl-crest { animation: none; filter: grayscale(.6) drop-shadow(0 0 10px rgba(255, 80, 60, .4)); }
.wl-errbox { display: none; flex-direction: column; align-items: center; gap: 12px; }
.wl.err .wl-errbox { display: flex; }
.wl.err .wl-bar, .wl.err .wl-meta, .wl.err .wl-cancel, .wl.err .wl-step { display: none; }
.wl-errbox p { margin: 0; color: #ffb4a8; max-width: 460px; }
.wl-errbox .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.wl-errbox button, .wl-errbox a { font: inherit; font-weight: 700; padding: 9px 18px; border-radius: 10px; cursor: pointer; text-decoration: none;
  color: #e9e2c8; background: #1d2338; border: 1px solid #343b57; }
.wl-errbox .primary { color: #1b1300; border: 0; background: linear-gradient(#ffcc33, #e0a000); }

@media (max-width: 480px) { .wl-orb { width: 210px; height: 210px; } .wl-orb svg.rings { transform: scale(.81); transform-origin: 0 0; width: 260px; height: 260px; } }
@media (prefers-reduced-motion: reduce) {
  .wl::before, .wl-r1, .wl-r2, .wl-r3, .wl-orbit, .wl-crest, .wl-crest .chev, .wl-bar i::after { animation: none !important; }
  .wl.leave .wl-stage { transform: none; filter: none; }
}
