@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&display=swap');

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #ffffffcc;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  position: relative;
  overflow: auto;
  background: #0a0a0f;
}

/* Subtle mesh glow in background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 20%, rgba(142, 45, 226, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(74, 0, 224, 0.12) 0%, transparent 70%);
  z-index: 0;
  pointer-events: none;
}

/* Faint grid overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(142, 45, 226, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(142, 45, 226, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  pointer-events: none;
}

/* ── Page root ── */
#pageRoot {
  position: relative;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#pageRoot.visible { opacity: 1; }

/* ── Splash screen container ── */
#screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s ease;
}

/* Slide-up exit animation */
#screen.splash-exit {
  transform: translateY(-60px);
  opacity: 0;
  pointer-events: none;
}

/* ── Logo ── */
#splashLogo {
  font-size: clamp(3rem, 12vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -1px;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: linear-gradient(135deg, #ffffff 0%, #c084fc 50%, #8e2de2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  user-select: none;
}

#splashLogo.logo-visible {
  opacity: 1;
  transform: scale(1);
}

/* Glow pulse after appearing */
#splashLogo.logo-glow {
  animation: logoPulse 1.2s ease-in-out 2;
}

@keyframes logoPulse {
  0%   { filter: drop-shadow(0 0 0px rgba(142,45,226,0)); }
  50%  { filter: drop-shadow(0 0 28px rgba(142,45,226,0.75)); }
  100% { filter: drop-shadow(0 0 0px rgba(142,45,226,0)); }
}

/* ── Tagline ── */
#splashTag {
  font-size: 0.95rem;
  font-weight: 300;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  margin-top: 0.75rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

#splashTag.tag-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Construction popup ── */
#constructionPopup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

/* ═══════════════════════════════════════════════
   GENESIS INTRO OVERLAY — Same as Dashboard
═══════════════════════════════════════════════ */

#genesisOverlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.4s ease;
}

#genesisCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#genesisFlashCanvasWrap {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#genesisFlashCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

#genesisStage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#genesisLumoraText {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 800;
  letter-spacing: 0.15em;
  background: linear-gradient(135deg, #ffffff 0%, #c084fc 40%, #8e2de2 70%, #ffffff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
  text-shadow: none;
  filter: drop-shadow(0 0 40px rgba(142, 45, 226, 0.3));
  white-space: nowrap;
}

#genesisGenesisWrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 2;
}

#genesisGenesisText {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(4rem, 12vw, 10rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #ffffff 0%, #c084fc 50%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  filter: drop-shadow(0 0 60px rgba(142, 45, 226, 0.5));
  white-space: nowrap;
}

#genesisTagline {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(0.8rem, 2.5vw, 1.4rem);
  font-weight: 300;
  letter-spacing: 0.3em;
  color: rgba(192, 132, 252, 0.7);
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
  text-transform: uppercase;
  white-space: nowrap;
}

#genesisSkipBtn {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999999;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.5);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  letter-spacing: 0.05em;
}

#genesisSkipBtn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(192, 132, 252, 0.4);
}

#genesisSkipBtn:active {
  transform: scale(0.96);
}

/* ─── Season Badge ─── */
#genesisSeasonBadge {
  position: absolute;
  top: clamp(1.5rem, 5vh, 3rem);
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(0.6rem, 1.5vw, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(192, 132, 252, 0.8);
  padding: 0.4rem 1.2rem;
  border: 1px solid rgba(192, 132, 252, 0.2);
  border-radius: 100px;
  background: rgba(142, 45, 226, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  z-index: 5;
  opacity: 0;
}

/* ─── Shockwave Burst ─── */
#genesisShockwave {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(192, 132, 252, 0.5);
  box-shadow:
    0 0 60px rgba(192, 132, 252, 0.3),
    inset 0 0 40px rgba(192, 132, 252, 0.1);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
}

.genesis-hidden {
  opacity: 0 !important;
  pointer-events: none;
}

/* ─── Narrative text cards ─── */
#genesisNarration {
  position: absolute;
  bottom: clamp(4rem, 12vh, 8rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 90%;
  max-width: 48rem;
  text-align: center;
  pointer-events: none;
  z-index: 3;
}

.genesis-narr-line {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: clamp(0.95rem, 3vw, 1.6rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  text-shadow: 0 0 30px rgba(142, 45, 226, 0.3);
  line-height: 1.5;
}

.genesis-narr-line--small {
  font-size: clamp(0.85rem, 2.5vw, 1.3rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 0 20px rgba(142, 45, 226, 0.2);
}

.genesis-narr-closer {
  font-size: clamp(1.2rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  margin-top: 1rem;
  background: linear-gradient(135deg, #ffffff, #c084fc, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 30px rgba(142, 45, 226, 0.4));
}

@media (max-width: 480px) {
  #genesisNarration {
    bottom: clamp(2.5rem, 8vh, 5rem);
  }
  .genesis-narr-line {
    font-size: clamp(0.8rem, 4vw, 1rem);
  }
  .genesis-narr-line--small {
    font-size: clamp(0.75rem, 3.5vw, 0.9rem);
  }
  .genesis-narr-closer {
    font-size: clamp(1rem, 6vw, 1.4rem);
  }
  #genesisSkipBtn {
    bottom: 1.25rem;
    right: 1.25rem;
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
  }
}