/* ===================================================================
   pepe.fail — entry loader

   Shown when arriving at the casino from the landing. Hidden by
   default: a tiny inline script decides to reveal it before first
   paint, so a repeat visit never flashes a loading screen.
   =================================================================== */

.loader {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  background: var(--bg-900, #080b12);
}
.loader.is-on { display: flex; }

.loader.is-done {
  opacity: 0;
  visibility: hidden;
  transition: opacity 380ms ease, visibility 0s linear 380ms;
}

.loader__logo {
  width: 108px; height: 108px;
  object-fit: contain;
}

.loader__word {
  font-family: var(--font-display, sans-serif);
  font-weight: 800;
  font-size: 30px;
  letter-spacing: -0.04em;
  color: var(--text, #eaeeff);
}
.loader__word b {
  background: var(--grad-gold, linear-gradient(180deg, #ffe86b, #f5a623));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Progress bar --------------------------------------------------
   The fill carries its own heat: a warm bloom on the bar plus a
   brighter head at the leading edge, so the glow travels with it. */
.loader__track {
  position: relative;
  width: min(300px, 62vw);
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: visible;
}

.loader__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5c00, #ff7a00 45%, #ffb020);
  box-shadow:
    0 0 10px rgba(255, 122, 0, 0.75),
    0 0 24px rgba(255, 92, 0, 0.45);
  transition: width 240ms cubic-bezier(0.25, 0.6, 0.2, 1);
}

/* the ember at the leading edge */
.loader__fill::after {
  content: "";
  position: absolute;
  right: -5px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 200, 40, 0.95), rgba(255, 92, 0, 0.35) 55%, transparent 72%);
  animation: loader-ember 1.6s ease-in-out infinite;
}

/* a slow, shallow flicker — heat, not a strobe */
@keyframes loader-ember {
  0%, 100% { opacity: 0.75; transform: translateY(-50%) scale(1); }
  50%      { opacity: 1;    transform: translateY(-50%) scale(1.14); }
}

.loader__pct {
  font-family: var(--font, sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mute, #6b74a6);
}

@media (prefers-reduced-motion: reduce) {
  .loader__fill { transition: none; }
  .loader__fill::after { animation: none; }
  .loader.is-done { transition: none; }
}
