* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; width: 100vw; height: 100vh; overflow: hidden;
  background: #000; color: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  user-select: none;
}
body.hide-cursor { cursor: none; }

#viewport {
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: #000;
}

#stage {
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 20%, #0f294d, #040914 75%);
  transform-origin: center center;
  flex-shrink: 0;
}

.scene {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity 0.55s ease;
}
.scene.active {
  opacity: 1; pointer-events: auto;
}

/* Unlock overlay (hidden permanently once clicked) */
#unlock-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(3, 8, 20, 0.72);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; transition: opacity 0.35s;
}
#unlock-overlay.hidden { opacity: 0; pointer-events: none; }
.unlock-pill {
  padding: 20px 42px; border-radius: 999px;
  background: linear-gradient(135deg, #0284c7, #2563eb);
  border: 2px solid rgba(125, 211, 252, 0.7);
  font-size: 24px; font-weight: 700; letter-spacing: 1px;
  box-shadow: 0 0 40px rgba(0, 210, 255, 0.45);
}

/* === SCENE 1: MEDIA === */
#media-container {
  position: absolute; inset: 0; background: #000;
  display: flex; align-items: center; justify-content: center;
}
#media-container img, #media-container video {
  width: 100%; height: 100%;
  object-fit: contain;
  animation: mediaFadeIn 0.6s ease;
}
@keyframes mediaFadeIn {
  from { opacity: 0; transform: scale(1.015); }
  to { opacity: 1; transform: scale(1); }
}

/* === SCENE 2: LOTTERY === */
#scene-lottery {
  background: radial-gradient(circle at 50% 25%, #1e1b4b 0%, #090d24 55%, #030510 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 72px;
}
#lottery-fx-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1;
}
.lottery-inner {
  position: relative; z-index: 2; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.lottery-tag {
  display: inline-block; padding: 10px 28px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(245,158,11,0.22), rgba(234,179,8,0.35));
  border: 1px solid rgba(251,191,36,0.6);
  color: #fde047; font-size: 24px; font-weight: 700; letter-spacing: 3px;
  margin-bottom: 18px;
}
.lottery-title {
  font-size: 62px; font-weight: 900; margin: 0 0 18px;
  background: linear-gradient(180deg, #fff7cc 0%, #fbbf24 55%, #d97706 100%);
  -webkit-background-clip: text; color: transparent;
  text-shadow: 0 8px 40px rgba(251, 191, 36, 0.25);
}
.lottery-sub {
  font-size: 30px; color: #cbd5e1; margin-bottom: 34px;
}

.pool-counter {
  display: inline-flex; align-items: baseline; gap: 16px;
  padding: 20px 44px; border-radius: 20px;
  background: rgba(15, 23, 42, 0.72);
  border: 2px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 40px rgba(56, 189, 248, 0.2);
}
.pool-counter .num {
  font-size: 76px; font-weight: 900; color: #38bdf8;
  font-variant-numeric: tabular-nums;
}

/* Rolling slot stage */
.rolling-stage {
  width: 100%; max-width: 1380px;
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.rolling-prize-banner {
  font-size: 44px; font-weight: 800; color: #fef08a;
  text-shadow: 0 0 28px rgba(250, 204, 21, 0.55);
}
.rolling-grid {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; width: 100%;
}
.code-slot {
  min-width: 310px; padding: 28px 36px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(30,41,59,0.92), rgba(15,23,42,0.96));
  border: 3px solid #38bdf8;
  box-shadow: 0 0 36px rgba(56, 189, 248, 0.45), inset 0 0 24px rgba(56, 189, 248, 0.2);
  font-size: 56px; font-weight: 900; letter-spacing: 5px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color: #fff;
}
.code-slot.winner {
  border-color: #fbbf24;
  background: linear-gradient(135deg, rgba(180,83,9,0.55), rgba(30,27,75,0.95));
  box-shadow: 0 0 55px rgba(251, 191, 36, 0.7), inset 0 0 28px rgba(253, 224, 71, 0.3);
  color: #fef08a;
  animation: winnerPop 0.65s cubic-bezier(0.22, 1.3, 0.36, 1);
}
.code-slot .phone-mask {
  display: block; margin-top: 8px; font-size: 22px; letter-spacing: 2px; color: #e2e8f0; font-family: inherit; font-weight: 500;
}
@keyframes winnerPop {
  0% { transform: scale(0.7); opacity: 0; }
  65% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.countdown-badge {
  font-size: 32px; font-weight: 700; color: #38bdf8;
  padding: 10px 30px; border-radius: 999px;
  background: rgba(2, 132, 199, 0.2); border: 1px solid rgba(56, 189, 248, 0.5);
}

/* Corner QR badge */
.corner-qr {
  position: absolute; right: 44px; bottom: 40px; z-index: 20;
  background: rgba(15, 23, 42, 0.85);
  border: 2px solid rgba(56, 189, 248, 0.5);
  border-radius: 20px; padding: 14px; text-align: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}
.corner-qr img { width: 156px; height: 156px; border-radius: 12px; display: block; background: #fff; padding: 6px; }
.corner-qr .qr-label { margin-top: 8px; font-size: 16px; font-weight: 600; color: #e0f2fe; }

/* === SCENE 3: WISH WALL === */
#scene-wish {
  background: radial-gradient(circle at 30% 20%, #164e63 0%, #0c1938 55%, #050a18 100%);
  background-size: cover;
  background-position: center;
}
.wish-bg-overlay {
  position: absolute; inset: 0;
  background: radial-gradient(circle at center, rgba(4, 10, 24, 0.15), rgba(4, 10, 24, 0.48));
  pointer-events: none;
}
#wish-ambient-layer {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2;
}
.wish-float-mini {
  position: absolute;
  width: 180px; border-radius: 14px; overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  opacity: 0.42;
  animation: floatDrift 18s ease-in-out infinite alternate;
}
.wish-float-mini img { width: 100%; height: 130px; object-fit: cover; display: block; }
@keyframes floatDrift {
  0% { transform: translate(0, 0) rotate(-3deg); }
  100% { transform: translate(45px, -35px) rotate(3deg); }
}

#wish-hero-stage {
  position: absolute; inset: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
}
.wish-hero-card {
  width: 680px; max-width: 72%;
  border-radius: 28px; overflow: hidden;
  background: rgba(15, 23, 42, 0.86);
  border: 3px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 60px rgba(56, 189, 248, 0.35);
  backdrop-filter: blur(14px);
  will-change: transform, opacity;
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.75s ease;
}
.wish-hero-card .wish-photo {
  width: 100%; height: 480px; object-fit: cover; display: block; background: #000;
}
.wish-hero-card .wish-meta {
  padding: 24px 32px; text-align: left;
}
.wish-hero-card .wish-msg {
  font-size: 30px; font-weight: 700; color: #fff; line-height: 1.45; margin-bottom: 10px;
}
.wish-hero-card .wish-author {
  font-size: 20px; color: #7dd3fc; font-weight: 600;
}

/* Choreography states: 移入 -> 放大 -> 保持(3-5s) -> 缩小 -> 移走 */
.wish-hero-card.phase-enter-start { opacity: 0; transform: translateX(65vw) scale(0.55) rotate(6deg); }
.wish-hero-card.phase-slide-in    { opacity: 0.92; transform: translateX(0) scale(0.72) rotate(0deg); }
.wish-hero-card.phase-zoom-hold   { opacity: 1; transform: translateX(0) scale(1.06) rotate(0deg); }
.wish-hero-card.phase-shrink      { opacity: 0.92; transform: translateX(0) scale(0.72) rotate(0deg); }
.wish-hero-card.phase-exit        { opacity: 0; transform: translateX(-65vw) scale(0.55) rotate(-6deg); }

.wish-header-badge {
  position: absolute; top: 38px; left: 48px; z-index: 15;
  padding: 12px 26px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.65); border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(10px); font-size: 24px; font-weight: 700; letter-spacing: 2px;
}

/* === SCENE 4: STANDBY === */
#scene-standby {
  background: radial-gradient(circle at 20% 20%, #0e7490, #0f172a 55%, #020617 100%);
  background-size: cover; background-position: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 60px;
}
.standby-scrim {
  position: absolute; inset: 0; background: rgba(2, 6, 23, 0.42);
}
.standby-content { position: relative; z-index: 2; }
.standby-title {
  font-size: 86px; font-weight: 900; letter-spacing: 6px; margin: 0 0 18px;
  background: linear-gradient(90deg, #e0f2fe, #38bdf8, #818cf8);
  -webkit-background-clip: text; color: transparent;
}
.standby-sub { font-size: 32px; color: #e2e8f0; letter-spacing: 3px; margin: 0 0 36px; }
.standby-clock { font-size: 40px; font-weight: 600; color: #7dd3fc; font-variant-numeric: tabular-nums; }
