/* =========================================================
   spinner.css — 5-type page load spinner overlay
   ========================================================= */

.pg-spinner {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 55%, #24243e 100%);
  transition: opacity 0.55s ease;
}

.pg-spinner.sp-done {
  opacity: 0;
  pointer-events: none;
}

/* ── Inner box ─────────────────────────────────── */
.sp-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

.sp-name {
  color: #fff;
  font-size: clamp(18px, 3.5vw, 30px);
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  opacity: 0.92;
  text-align: center;
}

/* ── All spans hidden by default ──────────────── */
.sp-anim span { display: block; }

/* ==========================================================
   TYPE 1 — RING  (classic double-ring)
   ========================================================== */
.sp-type-ring .sp-anim {
  width: 64px; height: 64px;
  position: relative;
}
.sp-type-ring .sp-anim span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
}
.sp-type-ring .sp-anim span:nth-child(1) {
  border-top-color: var(--accent, #f39c12);
  animation: sp-spin 0.9s linear infinite;
}
.sp-type-ring .sp-anim span:nth-child(2) {
  inset: 10px;
  border-top-color: rgba(255,255,255,0.5);
  animation: sp-spin 1.4s linear infinite reverse;
}
.sp-type-ring .sp-anim span:nth-child(n+3) { display: none; }

@keyframes sp-spin { to { transform: rotate(360deg); } }

/* ==========================================================
   TYPE 2 — DOTS  (5 bouncing colour dots)
   ========================================================== */
.sp-type-dots .sp-anim {
  display: flex; align-items: center; gap: 12px;
}
.sp-type-dots .sp-anim span {
  width: 14px; height: 14px;
  border-radius: 50%;
  animation: sp-bounce 1.4s ease-in-out infinite;
}
.sp-type-dots .sp-anim span:nth-child(1) { background: var(--accent, #f39c12); animation-delay: 0s; }
.sp-type-dots .sp-anim span:nth-child(2) { background: #fff; animation-delay: 0.15s; }
.sp-type-dots .sp-anim span:nth-child(3) { background: var(--accent, #f39c12); animation-delay: 0.3s; }
.sp-type-dots .sp-anim span:nth-child(4) { background: #fff; animation-delay: 0.45s; }
.sp-type-dots .sp-anim span:nth-child(5) { background: var(--accent, #f39c12); animation-delay: 0.6s; }

@keyframes sp-bounce {
  0%, 80%, 100% { transform: translateY(0) scale(0.5); opacity: 0.4; }
  40%            { transform: translateY(-18px) scale(1); opacity: 1; }
}

/* ==========================================================
   TYPE 3 — BARS  (5-bar equaliser wave)
   ========================================================== */
.sp-type-bars .sp-anim {
  display: flex; align-items: flex-end; gap: 6px; height: 52px;
}
.sp-type-bars .sp-anim span {
  width: 10px; border-radius: 3px 3px 0 0;
  animation: sp-bar 1.1s ease-in-out infinite;
}
.sp-type-bars .sp-anim span:nth-child(1) { background: var(--accent, #f39c12); animation-delay: 0s; }
.sp-type-bars .sp-anim span:nth-child(2) { background: #fff;                   animation-delay: 0.1s; }
.sp-type-bars .sp-anim span:nth-child(3) { background: var(--accent, #f39c12); animation-delay: 0.2s; }
.sp-type-bars .sp-anim span:nth-child(4) { background: #fff;                   animation-delay: 0.3s; }
.sp-type-bars .sp-anim span:nth-child(5) { background: var(--accent, #f39c12); animation-delay: 0.4s; }

@keyframes sp-bar {
  0%, 100% { height: 12px; opacity: 0.4; }
  50%       { height: 48px; opacity: 1;   }
}

/* ==========================================================
   TYPE 4 — ORBIT  (planet orbiting a central dot)
   ========================================================== */
.sp-type-orbit .sp-anim {
  width: 66px; height: 66px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.sp-type-orbit .sp-anim span:nth-child(1) {
  /* orbit track */
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
}
.sp-type-orbit .sp-anim span:nth-child(2) {
  /* center core */
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent, #f39c12);
  box-shadow: 0 0 20px var(--accent, #f39c12);
}
.sp-type-orbit .sp-anim span:nth-child(3) {
  /* orbiting planet */
  position: absolute;
  width: 12px; height: 12px;
  top: 3px; left: 50%; margin-left: -6px;
  background: #fff;
  border-radius: 50%;
  animation: sp-orbit 1.1s linear infinite;
  transform-origin: 6px calc(33px - 3px);
}
.sp-type-orbit .sp-anim span:nth-child(4) {
  /* second smaller planet */
  position: absolute;
  width: 8px; height: 8px;
  bottom: 3px; left: 50%; margin-left: -4px;
  background: var(--accent, #f39c12);
  border-radius: 50%;
  animation: sp-orbit 1.1s linear infinite reverse;
  transform-origin: 4px calc(-33px + 3px + 4px);
}
.sp-type-orbit .sp-anim span:nth-child(5) { display: none; }

@keyframes sp-orbit { to { transform: rotate(360deg); } }

/* ==========================================================
   TYPE 5 — RIPPLE  (expanding rings)
   ========================================================== */
.sp-type-ripple .sp-anim {
  width: 72px; height: 72px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.sp-type-ripple .sp-anim span {
  position: absolute;
  border-radius: 50%;
  border: 3px solid var(--accent, #f39c12);
  opacity: 0;
  animation: sp-ripple 2.4s ease-out infinite;
}
.sp-type-ripple .sp-anim span:nth-child(1) { animation-delay: 0s; }
.sp-type-ripple .sp-anim span:nth-child(2) { animation-delay: 0.6s; }
.sp-type-ripple .sp-anim span:nth-child(3) { animation-delay: 1.2s; }
.sp-type-ripple .sp-anim span:nth-child(4) { animation-delay: 1.8s; border-color: rgba(255,255,255,0.5); }
.sp-type-ripple .sp-anim span:nth-child(5) { display: none; }

/* Center dot */
.sp-type-ripple .sp-anim::after {
  content: '';
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent, #f39c12);
  box-shadow: 0 0 20px var(--accent, #f39c12);
}

@keyframes sp-ripple {
  0%   { width: 0;    height: 0;    opacity: 0.9; transform: translate(-50%, -50%); left: 50%; top: 50%; }
  100% { width: 72px; height: 72px; opacity: 0;   transform: translate(-50%, -50%); left: 50%; top: 50%; }
}
