:root {
  --ink: #f8f8ff;
  --muted: rgba(229, 232, 255, .56);
  --line: rgba(207, 216, 255, .18);
  --stage-w: 540px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #02030a; }
body {
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  overscroll-behavior: none;
}
button { font: inherit; }
.stage {
  position: relative;
  width: min(100vw, var(--stage-w));
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(59, 62, 151, .22), transparent 38%),
    radial-gradient(ellipse at 50% 90%, rgba(74, 42, 116, .16), transparent 45%),
    linear-gradient(180deg, #02030b 0%, #050718 50%, #02030b 100%);
}
.nebula {
  position: absolute; inset: -25%; z-index: 0; pointer-events: none;
  filter: blur(60px); opacity: .42; mix-blend-mode: screen;
  animation: nebulaDrift 18s ease-in-out infinite alternate;
}
.nebula-a { background: radial-gradient(circle at 40% 45%, rgba(80, 98, 255, .16), transparent 38%); }
.nebula-b { background: radial-gradient(circle at 65% 60%, rgba(185, 126, 255, .10), transparent 34%); animation-delay: -7s; }
@keyframes nebulaDrift { to { transform: translate3d(4%, -3%, 0) scale(1.06); } }
.subject-canvas, .particle-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.subject-canvas { z-index: 2; }
.particle-canvas { z-index: 3; }
.cards-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.care-card {
  position: absolute;
  min-width: 132px; max-width: min(76vw, 340px);
  padding: 13px 18px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 14px;
  color: #3d3d52;
  font-size: clamp(15px, 4vw, 19px);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: .02em;
  text-align: center;
  opacity: 0;
  transform: translate3d(var(--from-x, 0), var(--from-y, 30px), 0) rotate(var(--rot, 0deg)) scale(.88);
  filter: blur(5px);
  box-shadow: 0 16px 45px rgba(3, 5, 18, .24), inset 0 1px rgba(255,255,255,.5);
  backdrop-filter: blur(10px);
  transition: opacity 1.15s ease, transform 1.4s cubic-bezier(.2,.8,.15,1), filter 1.1s ease;
}
.care-card.show { opacity: .97; transform: translate3d(0,0,0) rotate(var(--rot, 0deg)) scale(1); filter: blur(0); }
.care-card.leave { opacity: 0; transform: translate3d(0,-35px,0) rotate(calc(var(--rot,0deg) * .4)) scale(.96); filter: blur(4px); transition-duration: 1.1s; }
.care-card.dissolve { opacity: 0; transform: translate3d(0,-60px,0) rotate(0) scale(1.06); filter: blur(9px) brightness(1.5); transition-duration: 1.8s; }
.card-cream { background: linear-gradient(140deg, rgba(255,250,236,.96), rgba(242,238,255,.91)); }
.card-pink { background: linear-gradient(140deg, rgba(255,226,239,.95), rgba(247,221,255,.90)); }
.card-blue { background: linear-gradient(140deg, rgba(221,242,255,.95), rgba(226,226,255,.90)); }
.card-lilac { background: linear-gradient(140deg, rgba(239,226,255,.95), rgba(255,235,247,.90)); }
.birthday-layer {
  position: absolute; z-index: 6; left: 8%; right: 8%; top: 50%;
  transform: translateY(-50%) scale(.92); text-align: center;
  opacity: 0; filter: blur(10px); pointer-events: none;
  transition: opacity 1.35s ease, transform 1.55s cubic-bezier(.18,.82,.22,1), filter 1.35s ease;
}
.birthday-layer.show { opacity: 1; transform: translateY(-50%) scale(1); filter: blur(0); }
.birthday-layer.hide { opacity: 0; transform: translateY(-55%) scale(1.04); filter: blur(8px); }
.birthday-kicker { font-size: clamp(11px, 3vw, 15px); letter-spacing: .24em; color: rgba(227,232,255,.62); margin-bottom: 13px; }
.birthday-title {
  font-size: clamp(45px, 13vw, 72px); font-weight: 700; letter-spacing: .10em;
  color: #fbfbff;
  text-shadow: 0 0 10px rgba(255,255,255,.72), 0 0 32px rgba(128,150,255,.68), 0 0 70px rgba(143,102,255,.28);
  white-space: nowrap;
}
.final-copy {
  position: absolute; z-index: 7; left: 7%; right: 7%; bottom: max(7.5%, calc(env(safe-area-inset-bottom) + 26px));
  text-align: center; opacity: 0; transform: translateY(16px); filter: blur(8px);
  transition: opacity 1.8s ease, transform 1.8s ease, filter 1.8s ease;
  pointer-events: none;
}
.final-copy.show { opacity: 1; transform: translateY(0); filter: blur(0); }
.final-main {
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: clamp(22px, 6.2vw, 34px); letter-spacing: .08em; line-height: 1.45;
  text-shadow: 0 0 16px rgba(200,210,255,.65), 0 0 35px rgba(147,105,255,.32);
}
.final-sub { margin-top: 9px; font-size: clamp(11px,3.2vw,15px); letter-spacing: .22em; color: rgba(235,236,255,.72); }
.landing {
  position: absolute; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center;
  padding: 0 24px; background: radial-gradient(circle at 50% 45%, rgba(61,65,158,.24), rgba(2,3,11,.65) 42%, rgba(2,3,11,.92) 80%);
  transition: opacity 1.2s ease, visibility 1.2s ease;
}
.landing.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.landing h1 { margin: 20px 0 28px; font-size: clamp(32px,8vw,44px); letter-spacing: .18em; text-indent: .18em; font-weight: 650; text-shadow: 0 0 24px rgba(139,154,255,.45); }
.landing-orbit { position: relative; width: 118px; height: 118px; border: 1px solid rgba(213,220,255,.18); border-radius: 50%; }
.landing-orbit::before { content:""; position:absolute; inset:19px; border:1px dashed rgba(216,222,255,.22); border-radius:50%; animation: orbitSpin 12s linear infinite reverse; }
.landing-orbit i { position:absolute; left:50%; top:50%; width:6px; height:6px; border-radius:50%; background:#fff; box-shadow:0 0 12px 4px rgba(176,190,255,.65); transform-origin:0 0; }
.landing-orbit i:nth-child(1){ animation:orbit1 6s linear infinite; }
.landing-orbit i:nth-child(2){ width:3px;height:3px;animation:orbit2 9s linear infinite reverse;opacity:.7; }
.landing-orbit i:nth-child(3){ width:4px;height:4px;animation:orbit3 13s linear infinite;opacity:.55; }
@keyframes orbit1 { to { transform: rotate(360deg) translateX(56px); } }
@keyframes orbit2 { to { transform: rotate(360deg) translateX(39px); } }
@keyframes orbit3 { to { transform: rotate(360deg) translateX(71px); } }
@keyframes orbitSpin { to { transform: rotate(360deg); } }
.start-button, .replay-large {
  border: 0; border-radius: 999px; padding: 16px 52px; color: #171729; background: linear-gradient(135deg,#fff,#eceeff);
  font-size: clamp(17px,4.5vw,20px); font-weight: 700; letter-spacing: .12em;
  box-shadow: 0 13px 35px rgba(0,0,0,.26), 0 0 30px rgba(164,174,255,.13);
  cursor: pointer;
}
.start-button:active, .replay-large:active { transform: scale(.97); }
.portrait-tip { margin: 24px 0 0; font-size: 12px; letter-spacing: .12em; color: rgba(226,229,255,.35); }
.controls {
  position: absolute; z-index: 30; top: max(12px, calc(env(safe-area-inset-top) + 8px)); right: 12px;
  display: flex; gap: 8px; opacity: 0; transform: translateY(-8px); pointer-events:none; transition:.8s ease;
}
.controls.show { opacity: 1; transform: translateY(0); pointer-events:auto; }
.controls button {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(225,229,255,.18);
  color: rgba(250,250,255,.9); background: rgba(4,6,20,.36); backdrop-filter: blur(12px); font-size: 20px; cursor:pointer;
}
.controls button:active { background: rgba(76,83,156,.35); }
.ending { position:absolute; inset:0; z-index:25; display:grid; place-content:center; opacity:0; visibility:hidden; background:rgba(1,2,8,.28); transition:opacity 1.5s ease,visibility 1.5s ease; }
.ending.show { opacity:1; visibility:visible; }
.replay-large { font-size:16px; padding:14px 42px; }
.loading-hint { position:absolute; z-index:40; left:50%; bottom:max(20px,calc(env(safe-area-inset-bottom) + 12px)); transform:translateX(-50%); font-size:12px; color:rgba(235,238,255,.5); opacity:0; transition:.3s; pointer-events:none; }
.loading-hint.show { opacity:1; }
@media (max-height: 650px) {
  .landing-orbit { width:90px;height:90px; }
  .landing h1 { margin:14px 0 20px; }
  .start-button { padding:13px 43px; }
  .portrait-tip { margin-top:16px; }
}
@media (min-width: 541px) {
  body { background: radial-gradient(circle at 50% 45%,#11152a,#02030a 65%); }
  .stage { box-shadow: 0 0 90px rgba(77,89,180,.18); }
}
@media (prefers-reduced-motion: reduce) {
  .nebula, .landing-orbit i, .landing-orbit::before { animation-duration: 24s !important; }
}

/* v8 · 路线1：高级梦幻剪影 */
.stage {
  background:
    radial-gradient(ellipse at 50% 42%, rgba(58, 72, 164, .23), transparent 35%),
    radial-gradient(ellipse at 50% 72%, rgba(91, 56, 142, .13), transparent 42%),
    radial-gradient(ellipse at 25% 88%, rgba(41, 102, 156, .08), transparent 32%),
    linear-gradient(180deg, #01020a 0%, #040616 46%, #02030c 100%);
}
.subject-canvas { opacity: .97; }
.particle-canvas { filter: saturate(1.04); }
.birthday-layer { left: 13%; right: 13%; }
.birthday-kicker { font-size: clamp(10px,2.8vw,14px); letter-spacing: .26em; color: rgba(228,232,255,.54); }
.birthday-title {
  font-size: clamp(40px, 10.8vw, 61px);
  letter-spacing: .12em;
  text-shadow: 0 0 8px rgba(255,255,255,.68), 0 0 28px rgba(125,148,255,.58), 0 0 62px rgba(132,99,237,.23);
}
.final-copy {
  left: 8%; right: 8%;
  bottom: max(10%, calc(env(safe-area-inset-bottom) + 34px));
}
.final-main {
  font-size: clamp(19px, 5.15vw, 29px);
  font-weight: 400;
  letter-spacing: .10em;
  color: rgba(247,247,255,.92);
  text-shadow: 0 0 13px rgba(202,214,255,.55), 0 0 31px rgba(143,115,238,.25);
}
.care-card {
  box-shadow: 0 13px 38px rgba(2, 4, 18, .20), inset 0 1px rgba(255,255,255,.47), 0 0 24px rgba(160,174,255,.05);
}
.landing { background: radial-gradient(circle at 50% 44%, rgba(58,66,151,.23), rgba(2,3,11,.68) 43%, rgba(2,3,11,.94) 82%); }
.landing h1 { font-weight: 560; letter-spacing: .22em; text-shadow: 0 0 24px rgba(132,151,255,.38); }
.landing-orbit { border-color: rgba(220,225,255,.15); }
.controls button { width: 40px; height: 40px; font-size: 19px; }
