/* ---------- Sun's life-cycle flipbook ---------- */
.lifecycle-launch {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 35;
  background: rgba(20, 14, 6, 0.62);
  border: 1px solid rgba(255, 214, 107, 0.35);
  color: #ffe9a8;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
}
.lifecycle-launch:hover {
  background: rgba(50, 30, 8, 0.78);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 180, 60, 0.25);
}

.lifecycle-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background-color: #02010a;
  background-image: radial-gradient(
    ellipse at 50% 50%,
    rgba(20, 6, 2, 0.85) 0%,
    rgba(2, 1, 8, 0.97) 70%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: fade-in 0.4s ease;
  overflow: hidden;
}

.lifecycle-stage {
  position: relative;
  width: min(82vw, 560px);
  height: min(82vw, 560px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lifecycle-sun {
  position: absolute;
  border-radius: 50%;
  transition:
    width 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    height 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.7s ease,
    box-shadow 0.7s ease,
    opacity 0.5s ease;
}

.lifecycle-orbit-dot {
  position: absolute;
  border-radius: 50%;
  transition:
    opacity 0.6s ease,
    transform 0.7s ease;
  pointer-events: none;
}
.lifecycle-orbit-dot.mercury {
  width: 6px;
  height: 6px;
  background: #a89078;
  box-shadow: 0 0 6px rgba(168, 144, 120, 0.6);
}
.lifecycle-orbit-dot.venus {
  width: 9px;
  height: 9px;
  background: #d8a45a;
  box-shadow: 0 0 8px rgba(216, 164, 90, 0.6);
}
.lifecycle-orbit-dot.earth {
  width: 9px;
  height: 9px;
  background: #5b8fd3;
  box-shadow: 0 0 8px rgba(91, 143, 211, 0.6);
}

.lifecycle-nebula {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
}

/* --- Frame 1: baby star inside dust cloud --- */
.lifecycle-frame-1 .lifecycle-sun {
  width: 70px;
  height: 70px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffb16a 0%,
    #c44a1f 60%,
    #4a1208 100%
  );
  box-shadow:
    0 0 36px 6px rgba(255, 120, 60, 0.6),
    0 0 100px 30px rgba(220, 80, 40, 0.25);
  opacity: 0.92;
}
.lifecycle-frame-1 .lifecycle-nebula {
  opacity: 1;
  background:
    radial-gradient(
      circle at 30% 40%,
      rgba(255, 140, 200, 0.35) 0%,
      transparent 35%
    ),
    radial-gradient(
      circle at 70% 60%,
      rgba(180, 120, 220, 0.32) 0%,
      transparent 38%
    ),
    radial-gradient(
      circle at 50% 50%,
      rgba(80, 30, 60, 0.4) 0%,
      transparent 70%
    );
  filter: blur(6px);
}

/* --- Frame 2: young main sequence --- */
.lifecycle-frame-2 .lifecycle-sun {
  width: 130px;
  height: 130px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffffff 0%,
    #fff4c2 50%,
    #ffae3a 100%
  );
  box-shadow:
    0 0 60px 10px rgba(255, 240, 180, 0.7),
    0 0 160px 40px rgba(255, 200, 100, 0.35);
}

/* --- Frame 3: today's Sun --- */
.lifecycle-frame-3 .lifecycle-sun {
  width: 180px;
  height: 180px;
  background: radial-gradient(
    circle at 50% 50%,
    #fff7d0 0%,
    #ffd66b 55%,
    #ff7b2a 100%
  );
  box-shadow:
    0 0 80px 14px rgba(255, 200, 100, 0.7),
    0 0 200px 60px rgba(255, 120, 50, 0.35);
}

/* --- Frame 4: getting bigger (subgiant) --- */
.lifecycle-frame-4 .lifecycle-sun {
  width: 320px;
  height: 320px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffe2a0 0%,
    #ff9a3a 55%,
    #c64414 100%
  );
  box-shadow:
    0 0 100px 24px rgba(255, 150, 60, 0.7),
    0 0 240px 80px rgba(220, 80, 30, 0.4);
}

/* --- Frame 5: red giant --- */
.lifecycle-frame-5 .lifecycle-sun {
  width: 520px;
  height: 520px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffb874 0%,
    #d8421a 50%,
    #6a1408 100%
  );
  box-shadow:
    0 0 120px 32px rgba(255, 110, 50, 0.6),
    0 0 320px 120px rgba(180, 40, 20, 0.4);
}

/* --- Frame 6: white dwarf in planetary nebula --- */
.lifecycle-frame-6 .lifecycle-sun {
  width: 26px;
  height: 26px;
  background: radial-gradient(
    circle at 50% 50%,
    #ffffff 0%,
    #c8e0ff 60%,
    #6a8ad8 100%
  );
  box-shadow:
    0 0 30px 6px rgba(200, 224, 255, 0.95),
    0 0 90px 18px rgba(140, 180, 255, 0.5);
}
.lifecycle-frame-6 .lifecycle-nebula {
  opacity: 1;
  background:
    radial-gradient(
      circle at 50% 50%,
      transparent 18%,
      rgba(120, 220, 200, 0.18) 30%,
      rgba(180, 120, 220, 0.15) 45%,
      transparent 70%
    ),
    radial-gradient(
      circle at 50% 50%,
      transparent 25%,
      rgba(255, 160, 100, 0.12) 38%,
      transparent 60%
    );
  filter: blur(2px);
}

.lifecycle-caption {
  position: absolute;
  left: 50%;
  bottom: 11vh;
  transform: translateX(-50%);
  width: min(86vw, 620px);
  text-align: center;
  font-size: 19px;
  line-height: 1.5;
  color: #fff7e0;
  letter-spacing: 0.01em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.85);
  pointer-events: none;
}
.lifecycle-caption .when {
  display: block;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 214, 107, 0.78);
  margin-bottom: 10px;
}

.lifecycle-counter {
  position: fixed;
  top: 18px;
  right: 22px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(255, 214, 107, 0.68);
  pointer-events: none;
}

.lifecycle-iframe-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #03050a;
  animation: fade-in 0.4s ease;
}
.lifecycle-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.lifecycle-iframe-overlay .lifecycle-back {
  z-index: 84;
  bottom: auto;
  top: 18px;
  right: 18px;
  left: auto;
}

.lifecycle-back {
  position: fixed;
  bottom: 22px;
  left: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 12, 32, 0.78);
  border: 1px solid var(--panel-border);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.lifecycle-back:hover {
  background: rgba(30, 24, 60, 0.86);
}

.lifecycle-tap-hint {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(244, 241, 232, 0.32);
  pointer-events: none;
}

@media (max-width: 720px) {
  .lifecycle-launch {
    font-size: 10px;
    padding: 6px 10px;
    top: 10px;
    right: 10px;
  }
  .lifecycle-caption {
    font-size: 16px;
    bottom: 14vh;
  }
  .lifecycle-frame-5 .lifecycle-sun {
    width: 86vw;
    height: 86vw;
  }
  .lifecycle-frame-4 .lifecycle-sun {
    width: 70vw;
    height: 70vw;
  }
}

