/* loader.css */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  color: rgba(220, 230, 255, 0.92);
  overflow: hidden;
}

/* 3D canvas is the “world” layer */
#loader3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* UI / FX layers */
.loader-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(1200px 900px at 50% 45%, rgba(34,45,90,0.18), rgba(0,0,0,0.92));
}

.stars {
  position: absolute;
  inset: -40%;
  z-index: 2;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.45) 0 1px, transparent 2px),
    radial-gradient(circle at 75% 60%, rgba(155,183,255,0.35) 0 1px, transparent 2px),
    radial-gradient(circle at 35% 80%, rgba(255,255,255,0.25) 0 1px, transparent 2px),
    radial-gradient(circle at 55% 40%, rgba(200,210,255,0.22) 0 1px, transparent 2px);
  background-size: 320px 320px;
  filter: blur(0.25px);
  opacity: 0.45;
  animation: driftStars 18s linear infinite;
}

@keyframes driftStars {
  from { transform: translate3d(0,0,0) scale(1.05); }
  to   { transform: translate3d(-140px, 90px,0) scale(1.05); }
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  background: radial-gradient(circle at 50% 52%, rgba(0,0,0,0.0) 40%, rgba(0,0,0,0.82) 78%);
  pointer-events: none;
}

.scanlines {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.08;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.14) 0px,
    rgba(255,255,255,0.14) 1px,
    rgba(0,0,0,0) 3px,
    rgba(0,0,0,0) 5px
  );
  mix-blend-mode: overlay;
  animation: scan 2.2s linear infinite;
}
@keyframes scan {
  from { transform: translateY(-14px); }
  to   { transform: translateY(14px); }
}

/* Center UI */
.loader-center {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 10;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);
  text-align: center;
}

.sigil {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 10px;
}

.sigil-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 1px solid rgba(155,183,255,0.28);
  box-shadow: 0 0 40px rgba(120,150,255,0.10);
  animation: ringPulse 2.4s ease-in-out infinite;
}

@keyframes ringPulse {
  0%, 100% { transform: scale(0.98); opacity: 0.65; }
  50%      { transform: scale(1.02); opacity: 1.0; }
}

.sigil-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: radial-gradient(circle at 40% 40%, rgba(190,210,255,0.95), rgba(40,60,120,0.05));
  box-shadow: 0 0 90px rgba(150,185,255,0.12);
  animation: coreFlicker 1.8s ease-in-out infinite;
}

@keyframes coreFlicker {
  0%, 100% { opacity: 0.72; transform: translate(-50%, -50%) scale(1); }
  45%      { opacity: 1; transform: translate(-50%, -50%) scale(1.10); }
  70%      { opacity: 0.80; transform: translate(-50%, -50%) scale(0.98); }
}

.sigil-glyphs {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(0deg);
  width: 100%;
  text-align: center;
  font-size: 15px;
  letter-spacing: 7px;
  opacity: 0.50;
  animation: glyphSpin 10s linear infinite;
}

@keyframes glyphSpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Backdrop plate behind the title/sub/CTA text so it stays
   legible over the bright glyph swarm in the 3D layer beneath it. */
.loader-textpanel {
  position: relative;
  z-index: 11;
  margin: 8px auto 0;
  padding: 14px 22px 16px;
  border-radius: 14px;
  width: fit-content;
  max-width: 100%;
  background: linear-gradient(180deg, rgba(5, 8, 18, 0.88), rgba(3, 5, 12, 0.94));
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid rgba(140, 165, 255, 0.14);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.45);
}

.loader-title {
  font-weight: 900;
  letter-spacing: 8px;
  font-size: 18px;
  margin-top: 2px;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.loader-sub {
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 2px;
  opacity: 0.72;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.loader-lines {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.6;
  opacity: 0.64;
  min-height: 56px;
}

.progress-wrap {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(140, 165, 255, 0.14);
  background: rgba(7, 10, 20, 0.52);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 1px;
  opacity: 0.72;
  margin-bottom: 8px;
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(140,165,255,0.10);
  overflow: hidden;
}

.bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(120,150,255,0.12), rgba(160,200,255,0.85), rgba(120,150,255,0.18));
  box-shadow: 0 0 28px rgba(140,170,255,0.18);
  transition: width 140ms ease;
}

.loader-cta {
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 1px;
  opacity: 0.88;
  transition: opacity 600ms ease;
  text-shadow: 0 0 14px rgba(0, 0, 0, 0.9), 0 1px 2px rgba(0, 0, 0, 0.9);
}

.loader-cta b {
  color: #dff0ff;
  text-shadow: 0 0 10px rgba(140, 190, 255, 0.9), 0 0 22px rgba(140, 190, 255, 0.5);
}

.loader-foot {
  margin-top: 10px;
  font-size: 11px;
  opacity: 0.48;
  letter-spacing: 0.6px;
}

.loader-corner {
  position: absolute;
  bottom: 14px;
  z-index: 10;
  font-size: 11px;
  opacity: 0.55;
  letter-spacing: 1px;
}

.loader-corner-left { left: 16px; }
.loader-corner-right { right: 16px; }

.loader.fade-out {
  animation: fadeOut 900ms ease forwards;
}
@keyframes fadeOut {
  to { opacity: 0; transform: scale(1.02); }
}