:root {
  color-scheme: dark;
  --bg: #050713;
  --ink: #f9fbff;
  --soft: rgba(249, 251, 255, 0.76);
  --muted: rgba(249, 251, 255, 0.58);
  --cyan: #58e6ff;
  --pink: #ff6bd6;
  --gold: #ffd36a;
  --violet: #8f7cff;
  --green: #73ffc1;
  --panel: rgba(9, 16, 38, 0.72);
  --line: rgba(255, 255, 255, 0.16);
  --glow: 0 0 40px rgba(88, 230, 255, 0.28), 0 0 90px rgba(255, 107, 214, 0.18);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(88, 230, 255, 0.22), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(255, 107, 214, 0.2), transparent 30%),
    radial-gradient(circle at 50% 86%, rgba(115, 255, 193, 0.12), transparent 36%),
    linear-gradient(145deg, #050713, #101532 46%, #070816);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

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

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 56px);
  background: linear-gradient(180deg, rgba(5, 7, 19, 0.86), rgba(5, 7, 19, 0));
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 0 26px rgba(88, 230, 255, 0.42);
}

.small-link {
  min-height: 38px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

main {
  position: relative;
  z-index: 1;
}

.countdown-view,
.birthday-view {
  min-height: 100vh;
}

.countdown-view {
  display: grid;
  place-items: center;
  padding: 104px 18px 48px;
}

.countdown-shell {
  width: min(980px, 100%);
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    var(--panel);
  box-shadow: var(--glow);
  backdrop-filter: blur(24px);
  text-align: center;
}

.avatar-orbit {
  position: relative;
  width: 156px;
  height: 156px;
  margin: 0 auto 26px;
}

.avatar-orbit span {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--cyan), var(--pink), var(--gold), var(--green), var(--cyan));
  filter: blur(0.5px);
  animation: spin 7s linear infinite;
}

.avatar-orbit img {
  position: absolute;
  inset: 8px;
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid #090f24;
}

.kicker {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(42px, 8vw, 88px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 28px;
  font-size: clamp(30px, 5vw, 56px);
  line-height: 1.12;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 22px;
  letter-spacing: 0;
}

p {
  color: var(--soft);
  line-height: 1.86;
}

.lead {
  max-width: 720px;
  margin: 0 auto 34px;
  font-size: clamp(17px, 2vw, 21px);
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.time-grid div {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(88, 230, 255, 0.12), rgba(255, 107, 214, 0.08)),
    rgba(255, 255, 255, 0.06);
}

.time-grid strong {
  font-family: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-size: clamp(42px, 7vw, 74px);
  line-height: 1;
  text-shadow: 0 0 22px rgba(88, 230, 255, 0.55);
}

.time-grid span,
.countdown-note span {
  color: var(--muted);
}

.countdown-note {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}

.countdown-note span {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.birthday-view {
  width: 100%;
  padding: 112px clamp(18px, 4vw, 56px) 70px;
  overflow: hidden;
}

.is-hidden {
  display: none;
}

.birthday-hero {
  width: min(1240px, 100%);
  max-width: calc(100vw - 48px);
  min-height: calc(100vh - 160px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.88fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
}

.card-stage,
.cake-stage {
  position: relative;
  min-width: 0;
}

.holo-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: clamp(26px, 5vw, 54px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(88, 230, 255, 0.16), rgba(255, 107, 214, 0.1)),
    rgba(7, 12, 30, 0.76);
  box-shadow: var(--glow);
  backdrop-filter: blur(26px);
}

.holo-card::before {
  position: absolute;
  inset: -45%;
  content: "";
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, 0.24), transparent 58%);
  transform: rotate(8deg);
  animation: scan 5.4s ease-in-out infinite;
}

.card-chip {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 70px;
  height: 52px;
  border: 1px solid rgba(255, 211, 106, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(90deg, transparent 30%, rgba(255, 211, 106, 0.32) 31% 34%, transparent 35%),
    linear-gradient(0deg, rgba(255, 211, 106, 0.14), rgba(255, 255, 255, 0.08));
}

.holo-card img {
  width: 118px;
  height: 118px;
  margin-bottom: 24px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.74);
  object-fit: cover;
  box-shadow: 0 0 34px rgba(255, 107, 214, 0.38);
}

.holo-card h1 span {
  display: block;
}

.holo-card p {
  overflow-wrap: anywhere;
}

.blessing-title {
  max-width: 8.8em;
  margin-bottom: 14px;
  font-size: clamp(34px, 4.8vw, 60px);
  line-height: 1.08;
}

.blessing-lead {
  margin-bottom: 18px;
  color: #fff6c9;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 800;
  line-height: 1.45;
}

.journey-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
  font-weight: 800;
}

.journey-strip span {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.journey-strip i {
  width: 34px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), var(--pink));
  box-shadow: 0 0 12px rgba(88, 230, 255, 0.36);
}

.blessing-poem {
  display: grid;
  gap: 18px;
  margin-top: 4px;
}

.blessing-poem p {
  margin: 0;
  color: rgba(249, 251, 255, 0.88);
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.92;
}

.blessing-signoff {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff7d5 !important;
  font-size: clamp(18px, 1.7vw, 22px) !important;
  font-weight: 900;
}

.ai-note {
  margin: 24px 0 0;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(88, 230, 255, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  color: rgba(115, 255, 193, 0.92);
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.holo-card > * {
  position: relative;
  z-index: 1;
}

.card-code {
  display: grid;
  min-width: 0;
  gap: 8px;
  margin-top: 28px;
  padding: 16px;
  border: 1px solid rgba(88, 230, 255, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--green);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  overflow-wrap: anywhere;
}

.card-code span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cake-stage {
  width: min(650px, 100%);
  display: grid;
  justify-items: center;
  gap: 18px;
}

.cake-showcase {
  position: relative;
  width: min(640px, 94vw);
  max-width: 100%;
  isolation: isolate;
  transform-style: preserve-3d;
  animation: floatCake 5.4s ease-in-out infinite;
}

.cake-showcase::before {
  position: absolute;
  inset: 16% 12% 8%;
  z-index: -1;
  content: "";
  border-radius: 50%;
  background:
    radial-gradient(circle at 44% 42%, rgba(255, 211, 106, 0.26), transparent 28%),
    radial-gradient(circle at 54% 46%, rgba(88, 230, 255, 0.24), transparent 38%),
    radial-gradient(circle at 58% 64%, rgba(255, 107, 214, 0.2), transparent 48%);
  filter: blur(28px);
  opacity: 0.84;
}

.cake-stage.is-lit .cake-showcase::before {
  animation: cakeGlow 2.8s ease-in-out infinite alternate;
}

.cake-image {
  position: relative;
  z-index: 1;
  width: 100%;
  border-radius: 14px;
  filter: saturate(1.18) contrast(1.06) drop-shadow(0 30px 70px rgba(88, 230, 255, 0.24));
}

.real-candles {
  position: absolute;
  top: 7.6%;
  left: 50%;
  z-index: 3;
  width: 50%;
  height: 31%;
  transform: translateX(-50%);
  pointer-events: none;
}

.real-candle {
  --x: 50%;
  --y: 60%;
  --scale: 1;
  --z: 3;
  --tilt: 0deg;
  --icing-a: rgba(201, 242, 255, 0.94);
  --icing-b: rgba(255, 204, 238, 0.9);
  position: absolute;
  top: var(--y);
  left: var(--x);
  z-index: var(--z);
  width: clamp(10px, 1.5vw, 16px);
  height: clamp(82px, 9.8vw, 128px);
  border-radius: 999px 999px 8px 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(255, 252, 232, 0.52) 26%, rgba(191, 154, 82, 0.12) 54%, rgba(42, 32, 42, 0.22) 100%),
    linear-gradient(180deg, #fffdf0, #f7edd4 58%, #d7b56e);
  box-shadow:
    inset -3px 0 6px rgba(60, 43, 31, 0.22),
    inset 2px 0 7px rgba(255, 255, 255, 0.74),
    0 8px 18px rgba(0, 0, 0, 0.26);
  transform: translate(-50%, calc(-100% + 25px)) rotate(var(--tilt)) scale(var(--scale));
  transform-origin: 50% 100%;
}

.real-candle::before {
  position: absolute;
  z-index: -1;
  left: 50%;
  bottom: -14px;
  width: 230%;
  height: 20px;
  content: "";
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 52%, rgba(31, 17, 10, 0.44) 0 38%, rgba(31, 17, 10, 0.16) 39% 58%, transparent 59%);
  filter: blur(1px);
  transform: translateX(-50%) rotate(-2deg);
}

.real-candle b {
  position: absolute;
  z-index: 5;
  top: -6px;
  left: 50%;
  width: 2px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, #2a1f20, #0e0b0f);
  transform: translateX(-50%);
}

.real-candle::after {
  position: absolute;
  display: block;
  z-index: 6;
  left: 50%;
  top: -39px;
  width: clamp(18px, 2.9vw, 30px);
  height: clamp(34px, 4.6vw, 48px);
  content: "";
  border-radius: 58% 42% 54% 46% / 68% 62% 38% 32%;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 66%, #fff 0 12%, #fff1a8 13% 28%, transparent 29%),
    radial-gradient(ellipse at 50% 72%, #ffd36a 0 38%, #ff922e 39% 64%, rgba(255, 64, 24, 0.48) 65% 76%, transparent 77%);
  filter:
    drop-shadow(0 0 10px #fff2aa)
    drop-shadow(0 0 22px #ff9b39)
    drop-shadow(0 0 42px rgba(255, 107, 214, 0.58));
  transform: translateX(-50%) translateY(16px) scale(0.2);
}

.real-candle.is-lit::after {
  opacity: 1;
  animation:
    igniteFlame 0.56s cubic-bezier(0.16, 1, 0.3, 1) both,
    flame 1.05s ease-in-out 0.56s infinite alternate;
}

.real-candle i {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: -2px;
  width: 158%;
  height: 27px;
  border-radius: 50% 50% 46% 46%;
  opacity: 1;
  background:
    radial-gradient(ellipse at 50% 24%, rgba(255, 255, 255, 0.78) 0 18%, transparent 19%),
    linear-gradient(90deg, var(--icing-a), var(--icing-b));
  box-shadow:
    inset 0 -3px 5px rgba(55, 40, 64, 0.16),
    0 3px 5px rgba(24, 14, 20, 0.28),
    0 -2px 5px rgba(255, 255, 255, 0.36);
  transform: translateX(-50%) rotate(-2deg);
}

.real-candle i::after {
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 66%;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(76, 40, 22, 0.26) 0 46%, transparent 48%);
  transform: translateX(-50%);
}

.real-candle.is-lit i {
  opacity: 1;
}

.candle-one {
  --x: 22%;
  --y: 43%;
  --scale: 0.78;
  --z: 5;
  --tilt: -3deg;
  --icing-a: rgba(93, 226, 255, 0.92);
  --icing-b: rgba(196, 240, 255, 0.9);
}

.candle-two {
  --x: 37%;
  --y: 28%;
  --scale: 0.68;
  --z: 2;
  --tilt: 2deg;
  --icing-a: rgba(121, 231, 255, 0.9);
  --icing-b: rgba(220, 203, 255, 0.9);
}

.candle-three {
  --x: 50%;
  --y: 36%;
  --scale: 0.78;
  --z: 4;
  --tilt: -1deg;
  --icing-a: rgba(191, 209, 255, 0.9);
  --icing-b: rgba(247, 190, 240, 0.9);
  height: clamp(78px, 9.7vw, 124px);
}

.candle-four {
  --x: 63%;
  --y: 28%;
  --scale: 0.68;
  --z: 2;
  --tilt: 2deg;
  --icing-a: rgba(211, 199, 255, 0.9);
  --icing-b: rgba(255, 184, 226, 0.9);
}

.candle-five {
  --x: 78%;
  --y: 42%;
  --scale: 0.76;
  --z: 5;
  --tilt: 4deg;
  --icing-a: rgba(255, 193, 234, 0.9);
  --icing-b: rgba(255, 152, 207, 0.9);
}

.cake-showcase .real-candles {
  top: 0;
  left: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  transform: none;
}

.cake-showcase .real-candle {
  top: var(--flame-y);
  left: var(--flame-x);
  width: 0;
  height: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
}

.cake-showcase .real-candle::before,
.cake-showcase .real-candle b,
.cake-showcase .real-candle i {
  display: none;
}

.cake-showcase .real-candle::after {
  top: -42px;
  left: 0;
  width: clamp(18px, 2.7vw, 29px);
  height: clamp(32px, 4.4vw, 46px);
}

.cake-showcase .candle-one {
  --flame-x: 33.4%;
  --flame-y: 10.7%;
}

.cake-showcase .candle-two {
  --flame-x: 42.7%;
  --flame-y: 7.2%;
}

.cake-showcase .candle-three {
  --flame-x: 51.2%;
  --flame-y: 9.2%;
}

.cake-showcase .candle-four {
  --flame-x: 60.0%;
  --flame-y: 7.1%;
}

.cake-showcase .candle-five {
  --flame-x: 68.0%;
  --flame-y: 10.5%;
}

.spark-burst {
  position: absolute;
  top: 10%;
  left: 50%;
  z-index: 4;
  width: 48%;
  height: 22%;
  transform: translateX(-50%);
  pointer-events: none;
}

.spark-burst span {
  position: absolute;
  top: 45%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0;
  box-shadow: 0 0 18px var(--gold), 0 0 34px var(--pink);
}

.cake-stage.is-lit .spark-burst span {
  animation: spark 1.25s ease-out both;
}

.cake-stage.is-lit .spark-burst span:nth-child(1) {
  --x: -126px;
  --y: -38px;
  animation-delay: 0.25s;
}

.cake-stage.is-lit .spark-burst span:nth-child(2) {
  --x: -76px;
  --y: 26px;
  animation-delay: 0.58s;
}

.cake-stage.is-lit .spark-burst span:nth-child(3) {
  --x: -18px;
  --y: -52px;
  animation-delay: 0.95s;
}

.cake-stage.is-lit .spark-burst span:nth-child(4) {
  --x: 46px;
  --y: 34px;
  animation-delay: 1.28s;
}

.cake-stage.is-lit .spark-burst span:nth-child(5) {
  --x: 100px;
  --y: -28px;
  animation-delay: 1.62s;
}

.cake-stage.is-lit .spark-burst span:nth-child(6) {
  --x: 134px;
  --y: 18px;
  animation-delay: 1.95s;
}

.cake-caption {
  max-width: 500px;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
}

.cake-caption strong {
  font-size: 22px;
}

.cake-caption span {
  color: var(--soft);
  line-height: 1.7;
}

.ignite-button {
  min-height: 44px;
  margin-top: 6px;
  padding: 0 22px;
  border: 1px solid rgba(255, 211, 106, 0.5);
  border-radius: 999px;
  color: #161321;
  background: linear-gradient(135deg, #fff2b3, #ffd36a 45%, #ff91d7);
  box-shadow: 0 0 26px rgba(255, 211, 106, 0.28);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

.ignite-button:focus-visible {
  outline: 3px solid rgba(88, 230, 255, 0.58);
  outline-offset: 4px;
}

.future-lab {
  width: min(1180px, 100%);
  margin: 70px auto 0;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.mission-grid article {
  min-height: 220px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.mission-grid span {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 50%;
  color: #071024;
  background: var(--gold);
  font-weight: 900;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes scan {
  0%,
  36% {
    transform: translateX(-28%) rotate(8deg);
  }
  72%,
  100% {
    transform: translateX(28%) rotate(8deg);
  }
}

@keyframes floatCake {
  0%,
  100% {
    transform: translateY(0) rotateX(0deg) rotateZ(-0.4deg);
  }
  50% {
    transform: translateY(-16px) rotateX(2deg) rotateZ(0.4deg);
  }
}

@keyframes igniteFlame {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(16px) scale(0.15);
  }
  64% {
    opacity: 1;
    transform: translateX(-50%) translateY(-5px) scale(1.18);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes flame {
  from {
    border-radius: 48% 52% 48% 52%;
    transform: translateX(-50%) translateY(0) scale(0.92) rotate(-4deg);
  }
  to {
    border-radius: 55% 45% 52% 48%;
    transform: translateX(-50%) translateY(-3px) scale(1.08) rotate(5deg);
  }
}

@keyframes cakeGlow {
  from {
    filter: blur(28px);
    opacity: 0.78;
  }
  to {
    filter: blur(36px);
    opacity: 1;
  }
}

@keyframes spark {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
  22% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.15);
  }
}

@media (max-width: 900px) {
  .birthday-hero,
  .mission-grid {
    grid-template-columns: 1fr;
  }

  .birthday-hero {
    min-height: auto;
  }

  .cake-showcase {
    margin-top: 24px;
  }
}

@media (max-width: 620px) {
  .topbar {
    position: absolute;
  }

  .small-link {
    display: none;
  }

  .brand span {
    overflow-wrap: anywhere;
  }

  .countdown-view {
    padding-top: 126px;
  }

  .time-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .time-grid div {
    min-height: 118px;
  }

  h1 {
    font-size: clamp(38px, 13vw, 58px);
  }

  .birthday-view {
    padding-top: 116px;
  }

  .holo-card {
    padding-top: 86px;
  }

  .card-chip {
    top: 22px;
    left: 24px;
    right: auto;
  }

  .cake-showcase {
    width: min(560px, 100%);
    margin-left: 0;
  }

  .real-candles {
    top: 7.4%;
    width: 52%;
    height: 32%;
  }
}
