/* 璀璨星河 3D（festival/galaxy-brilliant-3d）—— 移动端竖屏优先（375px）
 * 遵守 L4 性能红线：无 filter: blur；box-shadow 半径 ≤8px；
 * 大光晕一律用径向渐变背景代替；降级模式（.reduced）关闭非必要动画 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #050721; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #fff; }

#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }

/* ---------- 3D 场景 ---------- */
.scene {
  position: fixed; inset: 0; z-index: 2;
  perspective: 800px;
  perspective-origin: 50% 40%;
  transform-style: preserve-3d;
  pointer-events: none;
}

/* ---------- 星河粒子群 ---------- */
.galaxy-group {
  position: absolute; left: 50%; top: 44%;
  width: 0; height: 0;
  transform-style: preserve-3d;
  transition: opacity 1.2s ease;
}
.galaxy {
  position: absolute; width: 0; height: 0;
  transform-style: preserve-3d;
  transform: rotateX(70deg);
  will-change: transform;
}
.galaxy.tilt {
  /* 演出稳态小幅摆动（只动容器，降级关闭） */
  animation: tiltSwing 9s ease-in-out infinite;
}
@keyframes tiltSwing {
  0%, 100% { transform: rotateX(70deg) rotateZ(0deg) scale(1); }
  50%      { transform: rotateX(70deg) rotateZ(6deg) scale(1.03); }
}
.gp {
  position: absolute; left: 0; top: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.gp .dot {
  position: absolute;
  left: -3px; top: -3px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--c, #cfe8ff) 0%, var(--c, #cfe8ff) 55%, transparent 72%);
}
.gp .dot.bright {
  left: -5px; top: -5px;
  width: 10px; height: 10px;
  background: radial-gradient(circle, #ffffff 0%, var(--c, #cfe8ff) 45%, transparent 70%);
}
.gp .core {
  position: absolute; left: -4px; top: -4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, var(--c, #ffe9a8) 60%, transparent 80%);
}
/* 微弱闪烁（只动 opacity，聚合完成后稳定态） */
.gp { animation: twinkle 3.4s ease-in-out infinite; }
.gp:nth-child(3n) { animation-duration: 2.6s; }
.gp:nth-child(4n) { animation-delay: -1.2s; }
@keyframes twinkle {
  0%, 100% { opacity: 0.75; }
  50%      { opacity: 1; }
}
.reduced .gp { animation: none; }

/* 星云光带（径向渐变预烘焙，不用 blur） */
.galaxy-glow {
  position: absolute;
  left: -160px; top: -160px;
  width: 320px; height: 320px;
  transform: rotateX(70deg);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(120, 140, 255, 0.28) 0%, rgba(200, 160, 255, 0.12) 40%, transparent 70%);
  pointer-events: none;
}

/* ---------- 祝福语 ---------- */
.blessing {
  position: fixed; left: 0; right: 0; top: 16%; z-index: 3;
  text-align: center; opacity: 0; transform: translateY(18px);
  transition: opacity 1.6s ease, transform 1.6s ease, top 1.2s ease;
  pointer-events: none; padding: 0 28px;
}
.blessing.show { opacity: 1; transform: translateY(0); }
.blessing.up { top: 8%; }
.bless-sub  { font-size: 14px; letter-spacing: 8px; color: #b9c8ff; margin-bottom: 12px; }
.bless-main {
  font-size: 34px; letter-spacing: 4px; font-weight: bold;
  background: linear-gradient(90deg, #cfe8ff, #ffe9a8, #ffd0e8, #cfe8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 12px;
}
.bless-msg {
  font-size: 15px; line-height: 1.9; letter-spacing: 2px; color: #d8dcf5;
  max-width: 320px; margin: 0 auto; white-space: pre-wrap;
}
.bless-sender { font-size: 13px; letter-spacing: 3px; color: #9fa8e8; margin-top: 14px; }

/* ---------- 3D 照片环 ---------- */
.ring-wrap {
  position: absolute; left: 50%; top: 52%;
  width: 0; height: 0;
  transform-style: preserve-3d;
  opacity: 0;
  transform: translate3d(0, 320px, 0) scale(.6);
  transition: opacity 1.4s ease, transform 1.6s cubic-bezier(.22,.9,.3,1);
}
.ring-wrap.show { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
.ring { position: absolute; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.ring-item {
  position: absolute; left: -45px; top: -60px;
  width: 90px; height: 120px;
  border-radius: 8px; overflow: hidden;
  border: 2px solid rgba(180, 200, 255, .85);
  box-shadow: 0 0 8px rgba(140, 160, 255, .7);
  background: #111;
  backface-visibility: hidden;
}
.ring-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- 入场引导 ---------- */
.intro {
  position: fixed; inset: 0; z-index: 10;
  background: radial-gradient(ellipse at 50% 35%, #151a3d 0%, #050721 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 1s ease;
  pointer-events: auto;
}
.intro.hide { opacity: 0; pointer-events: none; }
.intro-moon {
  width: 90px; height: 90px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8e0, #e6d0ff 60%, #a8a0e0);
  box-shadow: 0 0 8px rgba(220, 200, 255, .8);
  margin-bottom: 36px;
  position: relative;
}
.intro-moon::after {
  content: ""; position: absolute; inset: -70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(210, 200, 255,.4) 0%, rgba(210,200,255,.1) 45%, transparent 70%);
  animation: moonPulse 3s ease-in-out infinite;
}
@keyframes moonPulse {
  0%, 100% { opacity: .7; }
  50%      { opacity: 1; }
}
.reduced .intro-moon::after { animation: none; opacity: .85; }
.intro-title { font-size: 42px; letter-spacing: 14px; text-indent: 14px; color: #e8dcff; margin-bottom: 20px; }
.intro-tip { font-size: 14px; letter-spacing: 4px; color: #9fa8e8; animation: blink 1.8s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.reduced .intro-tip { animation: none; opacity: .8; }
