.bg { position: fixed; inset: 0; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, #2a2466 0%, #151236 55%, #0b0a1e 100%); }
.glow { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; animation: drift 18s ease-in-out infinite alternate; }
.g1 { width: 60vmax; height: 60vmax; left: -20vmax; top: -10vmax; background: #4b3aa8; }
.g2 { width: 50vmax; height: 50vmax; right: -18vmax; top: 20vh; background: #b0507a; animation-delay: -6s; opacity: 0.35; }
.g3 { width: 55vmax; height: 55vmax; left: 10vw; bottom: -30vmax; background: #2f7fa6; animation-delay: -11s; opacity: 0.35; }
@keyframes drift { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
.stars { position: absolute; inset: 0; background-image:
  radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 72% 12%, #fff 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 42% 32%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 88% 42%, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 22% 62%, #fff 50%, transparent 51%), radial-gradient(1.5px 1.5px at 62% 72%, #fff 50%, transparent 51%),
  radial-gradient(1px 1px at 8% 86%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 92% 84%, #fff 50%, transparent 51%);
  opacity: 0.6; animation: twinkle 5s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: 0.25; } to { opacity: 0.7; } }

.top { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }

.stage { position: relative; z-index: 2; height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: calc(72px + env(safe-area-inset-top)) 16px calc(56px + env(safe-area-inset-bottom)); }
.hero { text-align: center; animation: rise 0.9s var(--ease) both; }
.hero h1 { margin: 0; font-size: clamp(28px, 8vw, 46px); line-height: 1.15; letter-spacing: -0.035em; font-weight: 800; }
.hero p { margin: 12px 0 0; color: var(--ink-soft); font-size: 16px; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); filter: blur(8px); } }

.orbs { flex: 1; width: min(100%, 560px); display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto;
  align-items: center; justify-items: center; row-gap: 8px; padding-top: 18px; }
.orb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; text-decoration: none;
  border: 0; background: none; padding: 0; color: inherit;
  translate: calc(var(--px, 0) * var(--depth, 1) * 1px) calc(var(--py, 0) * var(--depth, 1) * 1px);
  transition: translate 0.8s var(--ease); animation: orbIn 1.1s var(--ease) both; }
@keyframes orbIn { from { opacity: 0; scale: 0.82; filter: blur(10px); } }
.orb .ball { position: relative; display: block; border-radius: 50%; overflow: hidden; animation: float 7s ease-in-out infinite; animation-delay: var(--d);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18), 0 20px 60px rgba(0,0,0,0.35); transition: transform 0.5s var(--ease); }
@keyframes float { 50% { transform: translateY(-12px); } }
.orb:hover .ball { transform: scale(1.04); }
.orb:active .ball { transform: scale(0.97); }
.orb .label { text-align: center; display: grid; gap: 2px; }
.orb .label b { font-size: 17px; letter-spacing: -0.01em; }
.orb .label small { font-size: 13px; color: var(--ink-soft); transition: opacity 0.6s; }

.orb.main { --depth: 0.6; grid-column: 1 / -1; animation-delay: 0.15s; z-index: 2; }
.orb.main .ball { width: min(58vw, 34dvh, 300px); aspect-ratio: 1; box-shadow: 0 0 0 1px rgba(255,255,255,0.25), 0 0 80px rgba(150,140,255,0.35), 0 30px 80px rgba(0,0,0,0.4); }
.orb.main canvas { width: 100%; height: 100%; display: block; }
.orb.soon { --depth: 1.4; opacity: 0.8; animation-delay: 0.3s; }
.orb.soon .ball { width: min(20vw, 11dvh, 104px); aspect-ratio: 1; filter: saturate(0.8); }
.orb.s1 { align-self: start; }
.orb.s2 { align-self: start; margin-top: 18px; }
.orb.soon .label b { font-size: 14px; }
.orb.soon.wiggle .ball { animation: wiggle 0.5s var(--ease); }
@keyframes wiggle { 25% { transform: rotate(-8deg) scale(1.05); } 75% { transform: rotate(8deg) scale(1.05); } }

.blob { background: conic-gradient(from var(--r, 0deg), #ffd1e8, #b9a2ff, #8fe3ff, #ffd1e8); animation: spin 12s linear infinite, float 7s ease-in-out infinite; }
.blob::after { content: ''; position: absolute; inset: 18%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.8), transparent 45%); filter: blur(4px); }
.b2 { background: conic-gradient(from var(--r, 0deg), #ffe3a3, #ff9e7a, #7a5cff, #ffe3a3); }
@property --r { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --r: 360deg; } }

.foot { position: fixed; left: 0; right: 0; bottom: calc(14px + env(safe-area-inset-bottom)); text-align: center; font-size: 12px; color: var(--ink-soft); z-index: 2; }

/* 테스트로 들어갈 때: 작은 하늘이 화면 전체로 커진다 */
.diving .hero, .diving .orb.soon, .diving .foot, .diving .top, .diving .orb.main .label { opacity: 0; transition: opacity 0.35s; }
.orb.main.dive .ball { animation: none; transition: transform 0.85s cubic-bezier(0.65, 0, 0.35, 1), border-radius 0.85s; transform: var(--dive); }

@media (min-width: 720px) {
  .orbs { grid-template-columns: 1fr auto 1fr; grid-template-rows: 1fr; }
  .orb.main { grid-column: 2; grid-row: 1; }
  .orb.s1 { grid-column: 1; grid-row: 1; align-self: start; margin-top: 10%; }
  .orb.s2 { grid-column: 3; grid-row: 1; align-self: end; margin-bottom: 12%; }
}
@media (max-height: 700px) { .foot { display: none; } .hero p { font-size: 14px; } }
