/* ═══════════════════════════════════════════════════════════════════════════
   FANTASY REALM ENTRANCE - CINEMATIC SUN GOD AWAKENING
   A breath-taking journey through divine realms
   ═══════════════════════════════════════════════════════════════════════════ */

.fantasy-entrance {
  position: fixed;
  inset: 0;
  z-index: 99999;
  overflow: hidden;
  background: #000;
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE FANTASY BACKGROUND - Full cinematic image
   ═══════════════════════════════════════════════════════════════════════════ */

.fantasy-realm {
  position: absolute;
  inset: 0;
  background-image: url('../img/fantasy-scene-depicting-sun-god-s_23-2151339253.jpg');
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.3);
  filter: brightness(0) saturate(1.2);
  animation: realmAwaken 6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes realmAwaken {
  0% {
    opacity: 0;
    transform: scale(1.5);
    filter: brightness(0) saturate(0.5);
  }
  30% {
    opacity: 0.6;
    filter: brightness(0.4) saturate(1);
  }
  60% {
    opacity: 0.9;
    transform: scale(1.15);
    filter: brightness(0.7) saturate(1.1);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(0.85) saturate(1.2);
  }
}

/* Cinematic slow zoom effect after initial reveal */
.fantasy-realm.revealed {
  animation: cinematicZoom 30s ease-out forwards;
}

@keyframes cinematicZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.15); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   GOLDEN LIGHT OVERLAY - Divine energy wash
   ═══════════════════════════════════════════════════════════════════════════ */

.divine-light {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 30%,
    rgba(255, 200, 100, 0.25) 0%,
    rgba(255, 150, 50, 0.1) 40%,
    transparent 70%
  );
  opacity: 0;
  animation: lightPulse 4s ease-out 2s forwards;
  mix-blend-mode: overlay;
}

@keyframes lightPulse {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0.7; }
}

/* God rays streaming from top */
.god-rays {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200%;
  height: 100%;
  background: 
    linear-gradient(180deg, rgba(255, 215, 140, 0.15) 0%, transparent 60%),
    repeating-conic-gradient(
      from 90deg at 50% 0%,
      transparent 0deg,
      rgba(255, 200, 100, 0.03) 2deg,
      transparent 4deg
    );
  opacity: 0;
  animation: raysDescend 5s ease-out 1.5s forwards;
  pointer-events: none;
}

@keyframes raysDescend {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-20%) scaleY(0.5);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scaleY(1);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ENERGY PARTICLES - Divine sparks ascending
   ═══════════════════════════════════════════════════════════════════════════ */

.energy-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.spark {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffd700 50%, transparent 70%);
  opacity: 0;
  animation: sparkRise var(--duration, 8s) ease-out infinite;
  animation-delay: var(--delay, 0s);
}

.spark.golden {
  background: radial-gradient(circle, #fff 0%, #ffb347 30%, #ff8c00 60%, transparent 80%);
  box-shadow: 0 0 10px 3px rgba(255, 180, 70, 0.6);
}

.spark.white {
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.8) 40%, transparent 70%);
  box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.5);
}

@keyframes sparkRise {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0);
  }
  10% {
    opacity: 1;
    transform: translateY(-5vh) scale(1);
  }
  90% {
    opacity: 0.8;
    transform: translateY(-85vh) scale(0.6);
  }
  100% {
    opacity: 0;
    transform: translateY(-100vh) scale(0);
  }
}

/* Floating ember particles */
.ember {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #ffa500;
  border-radius: 50%;
  opacity: 0;
  animation: emberFloat var(--float-duration, 12s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
  box-shadow: 0 0 6px 2px rgba(255, 165, 0, 0.5);
}

@keyframes emberFloat {
  0%, 100% {
    opacity: 0;
    transform: translate(0, 0) scale(0);
  }
  10% {
    opacity: 0.8;
    transform: translate(calc(var(--drift-x, 20px)), -10vh) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(calc(var(--drift-x, 20px) * -1), -50vh) scale(0.8);
  }
  90% {
    opacity: 0.5;
    transform: translate(calc(var(--drift-x, 20px) * 0.5), -90vh) scale(0.4);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANCIENT RUNES - Floating mystical symbols
   ═══════════════════════════════════════════════════════════════════════════ */

.rune-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  opacity: 0;
  animation: runeReveal 3s ease-out 3s forwards;
}

@keyframes runeReveal {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5) rotate(-180deg);
  }
  60% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.1) rotate(10deg);
  }
  100% {
    opacity: 0.4;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
  }
}

.rune-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(255, 215, 140, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.rune-ring-1 {
  width: 300px;
  height: 300px;
  animation: ringRotate 20s linear infinite;
}

.rune-ring-2 {
  width: 400px;
  height: 400px;
  border-style: dashed;
  border-color: rgba(255, 215, 140, 0.2);
  animation: ringRotate 30s linear infinite reverse;
}

.rune-ring-3 {
  width: 500px;
  height: 500px;
  border-color: rgba(255, 215, 140, 0.15);
  animation: ringRotate 40s linear infinite;
}

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

/* Floating rune symbols */
.rune-symbol {
  position: absolute;
  font-size: 1.5rem;
  color: rgba(255, 215, 140, 0.6);
  text-shadow: 0 0 10px rgba(255, 200, 100, 0.8);
  animation: runeFloat 8s ease-in-out infinite;
  animation-delay: var(--rune-delay, 0s);
}

@keyframes runeFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.4; }
  50% { transform: translateY(-15px) scale(1.1); opacity: 0.8; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE TITLE REVEAL - Epic cinematic text
   ═══════════════════════════════════════════════════════════════════════════ */

.title-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 100;
  pointer-events: none;
}

.title-whisper {
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 12px;
  text-transform: uppercase;
  color: rgba(255, 215, 140, 0.8);
  margin-bottom: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: whisperReveal 2s ease-out 3.5s forwards;
}

@keyframes whisperReveal {
  0% {
    opacity: 0;
    transform: translateY(20px);
    letter-spacing: 20px;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    letter-spacing: 12px;
  }
}

.title-name {
  font-family: var(--serif, 'Playfair Display', serif);
  font-size: clamp(4rem, 15vw, 10rem);
  font-weight: 700;
  letter-spacing: 8px;
  color: transparent;
  background: linear-gradient(
    180deg,
    #fff 0%,
    #ffecd2 30%,
    #fcb69f 60%,
    #ff9a56 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  text-shadow: 
    0 0 40px rgba(255, 200, 100, 0.5),
    0 0 80px rgba(255, 150, 50, 0.3);
  opacity: 0;
  transform: scale(0.8);
  animation: nameEpicReveal 3s cubic-bezier(0.16, 1, 0.3, 1) 4s forwards;
}

@keyframes nameEpicReveal {
  0% {
    opacity: 0;
    transform: scale(0.6);
    letter-spacing: 50px;
    filter: blur(10px);
  }
  40% {
    opacity: 1;
    transform: scale(1.15);
    letter-spacing: 15px;
    filter: blur(0);
  }
  70% {
    transform: scale(0.95);
    letter-spacing: 6px;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    letter-spacing: 8px;
    filter: blur(0);
  }
}

.title-subtitle {
  font-family: var(--serif, 'Playfair Display', serif);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: rgba(255, 215, 140, 0.9);
  margin-top: 25px;
  opacity: 0;
  transform: translateY(-10px);
  animation: subtitleReveal 2s ease-out 5.5s forwards;
}

@keyframes subtitleReveal {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ENERGY BURST - Power explosion effect
   ═══════════════════════════════════════════════════════════════════════════ */

.energy-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.energy-burst.active {
  animation: burstExpand 1.5s ease-out forwards;
}

@keyframes burstExpand {
  0% {
    opacity: 1;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 200, 100, 0.8) 30%, transparent 70%);
    box-shadow: 0 0 100px 50px rgba(255, 200, 100, 0.8);
  }
  50% {
    opacity: 0.8;
    width: 300vw;
    height: 300vw;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 200, 100, 0.2) 30%, transparent 60%);
    box-shadow: 0 0 200px 100px rgba(255, 200, 100, 0.3);
  }
  100% {
    opacity: 0;
    width: 500vw;
    height: 500vw;
    background: transparent;
    box-shadow: none;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   VIGNETTE & CINEMATIC BARS
   ═══════════════════════════════════════════════════════════════════════════ */

.cinematic-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    transparent 0%,
    rgba(0, 0, 0, 0.3) 70%,
    rgba(0, 0, 0, 0.7) 100%
  );
  pointer-events: none;
}

.cinematic-bars {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

.cinematic-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 8%;
  background: #000;
  animation: barsOpen 2s ease-out 7s forwards;
}

.cinematic-bar.top { top: 0; transform-origin: top; }
.cinematic-bar.bottom { bottom: 0; transform-origin: bottom; }

@keyframes barsOpen {
  0% { transform: scaleY(1); }
  100% { transform: scaleY(0); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PORTAL TRANSITION - Exit to main site
   ═══════════════════════════════════════════════════════════════════════════ */

.portal-vortex {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(
    circle at 50% 50%,
    transparent 0%,
    rgba(0, 0, 0, 0.5) 40%,
    rgba(0, 0, 0, 1) 70%
  );
}

.portal-vortex.active {
  animation: vortexClose 2.5s ease-in forwards;
}

@keyframes vortexClose {
  0% {
    opacity: 0;
    background: radial-gradient(
      circle at 50% 50%,
      transparent 0%,
      rgba(0, 0, 0, 0) 40%,
      rgba(0, 0, 0, 0) 70%
    );
  }
  30% {
    opacity: 1;
    background: radial-gradient(
      circle at 50% 50%,
      rgba(255, 200, 100, 0.3) 0%,
      transparent 20%,
      rgba(0, 0, 0, 0.8) 60%,
      rgba(0, 0, 0, 1) 80%
    );
  }
  100% {
    opacity: 1;
    background: radial-gradient(
      circle at 50% 50%,
      #000 0%,
      #000 100%
    );
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CONTROLS
   ═══════════════════════════════════════════════════════════════════════════ */

.entrance-controls {
  position: absolute;
  bottom: 40px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 300;
  opacity: 0;
  animation: controlsReveal 1s ease-out 2s forwards;
}

@keyframes controlsReveal {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.entrance-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 215, 140, 0.4);
  color: rgba(255, 215, 140, 0.9);
  padding: 12px 24px;
  font-family: var(--sans, 'Inter', sans-serif);
  font-size: 0.85rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.entrance-btn:hover {
  background: rgba(255, 200, 100, 0.15);
  border-color: rgba(255, 215, 140, 0.8);
  color: #ffd700;
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(255, 200, 100, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .title-name {
    letter-spacing: 4px;
  }
  
  .title-whisper,
  .title-subtitle {
    letter-spacing: 4px;
    font-size: 0.75rem;
  }
  
  .rune-circle {
    width: 300px;
    height: 300px;
  }
  
  .rune-ring-1 { width: 180px; height: 180px; }
  .rune-ring-2 { width: 240px; height: 240px; }
  .rune-ring-3 { width: 300px; height: 300px; }
  
  .entrance-controls {
    bottom: 20px;
    padding: 0 20px;
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  .entrance-btn {
    padding: 10px 20px;
    font-size: 0.75rem;
  }
  
  .cinematic-bar {
    height: 5%;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRELOADER
   ═══════════════════════════════════════════════════════════════════════════ */

.fantasy-preloader {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 1s ease-out;
}

.fantasy-preloader.hidden {
  opacity: 0;
  pointer-events: none;
}

.preloader-symbol {
  width: 60px;
  height: 60px;
  border: 2px solid rgba(255, 215, 140, 0.3);
  border-top-color: #ffd700;
  border-radius: 50%;
  animation: preloaderSpin 1s linear infinite;
}

@keyframes preloaderSpin {
  to { transform: rotate(360deg); }
}
