/* ---------- Loading screen ---------- */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, #ffe6f2 0%, #f78fc4 100%);
  font-family: "Georgia", serif;
  transition: opacity 0.6s ease;
}
#loading-screen.gone {
  opacity: 0;
  pointer-events: none;
}
.loading-card {
  box-sizing: border-box;
  width: min(100%, 420px);
  text-align: center;
  color: #6b2247;
  padding: 32px clamp(20px, 8vw, 48px);
}
.loading-crown {
  font-size: 64px;
  color: #ffd86b;
  text-shadow: 0 4px 12px rgba(176, 53, 121, 0.45);
  animation: crown-spin 3s ease-in-out infinite;
}
@keyframes crown-spin {
  0%,
  100% {
    transform: rotate(-8deg) scale(1);
  }
  50% {
    transform: rotate(8deg) scale(1.1);
  }
}
.loading-card h1 {
  margin: 8px 0 24px;
  font-size: 36px;
  color: #b03579;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.6);
}
.loading-bar-track {
  width: min(300px, 100%);
  height: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 2px solid #b03579;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto;
}
.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd86b 0%, #ff8ac0 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.loading-pct {
  margin-top: 14px;
  font-size: 14px;
  color: #6b2247;
  letter-spacing: 0.05em;
}
.loading-retry {
  margin-top: 16px;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid #b03579;
  border-radius: 8px;
  background: #fff8eb;
  color: #6b2247;
  font:
    800 15px/1 "Arial Rounded MT Bold",
    "Trebuchet MS",
    Arial,
    sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(176, 53, 121, 0.18);
}
.loading-retry:focus-visible {
  outline: 4px solid rgba(255, 216, 107, 0.95);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .loading-crown {
    animation: none;
  }
  .loading-bar-fill,
  #loading-screen {
    transition: none;
  }
}
