:root {
  color-scheme: dark;
  --ink: #f9f4ed;
  --muted: rgba(249, 244, 237, 0.62);
  --gold: #ffd98a;
  --rose: #ff759c;
  --cyan: #79e8ef;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05050d;
}

body {
  position: relative;
  min-height: 100svh;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, #02030a 0%, #070713 45%, #150814 78%, #20090e 100%);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 50% 42%, transparent 0 34%, rgba(0, 0, 0, 0.18) 72%, rgba(0, 0, 0, 0.58) 100%),
    linear-gradient(90deg, rgba(255, 83, 121, 0.05), transparent 22% 78%, rgba(67, 222, 231, 0.05));
}

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

.moon {
  position: fixed;
  top: clamp(5.5rem, 10vh, 8rem);
  left: clamp(1.75rem, 8vw, 9rem);
  z-index: 0;
  width: clamp(2.5rem, 4.5vw, 4.3rem);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow:
    -0.8rem 0.7rem 0 0 #fff0c6,
    -1rem 0.9rem 1.8rem rgba(255, 223, 151, 0.28);
  opacity: 0.85;
  transform: rotate(-14deg);
}

.horizon {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  height: 22vh;
  min-height: 8rem;
  background:
    linear-gradient(168deg, transparent 0 58%, rgba(24, 4, 12, 0.44) 59% 61%, transparent 62%) 0 0 / 34% 100%,
    linear-gradient(192deg, transparent 0 66%, rgba(5, 2, 8, 0.68) 67%) 100% 0 / 74% 100%,
    linear-gradient(180deg, transparent, rgba(3, 1, 6, 0.88));
  opacity: 0.72;
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 4.75rem;
  padding: max(1.1rem, env(safe-area-inset-top)) clamp(1.25rem, 4vw, 4rem) 0.65rem;
  color: rgba(255, 247, 237, 0.68);
  font-family: Georgia, "STKaiti", "KaiTi", serif;
}

.seal {
  justify-self: start;
  display: grid;
  width: 2.15rem;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(255, 217, 138, 0.66);
  color: var(--gold);
  font-size: 0.72rem;
  line-height: 1;
}

.topbar-title {
  font-size: 0.82rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.date {
  justify-self: end;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
}

.stage {
  position: relative;
  z-index: 4;
  display: grid;
  width: 100%;
  min-height: 100svh;
  place-items: center;
  pointer-events: none;
}

.intro {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 1rem;
  width: min(92vw, 56rem);
  margin-top: -2vh;
  text-align: center;
  transition:
    opacity 900ms ease,
    transform 900ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 900ms ease;
}

.eyebrow {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(0.62rem, 1.2vw, 0.74rem);
  letter-spacing: 0.28em;
  opacity: 0.82;
}

h1 {
  margin: 0;
  color: #fff9ef;
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei", serif;
  font-size: clamp(2.45rem, 7vw, 5.6rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0;
  text-shadow:
    0 0 1.2rem rgba(255, 215, 145, 0.16),
    0 0 3.6rem rgba(255, 102, 137, 0.11);
}

.ignite-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.5rem;
  min-height: 3rem;
  margin-top: 0.7rem;
  padding: 0.65rem 1.5rem;
  overflow: hidden;
  border: 1px solid rgba(255, 226, 174, 0.52);
  border-radius: 0.25rem;
  outline: 0;
  color: #fff7e8;
  background: rgba(16, 7, 17, 0.48);
  box-shadow:
    inset 0 0 1.5rem rgba(255, 191, 119, 0.05),
    0 0.6rem 2rem rgba(0, 0, 0, 0.22);
  font: inherit;
  font-size: 0.9rem;
  letter-spacing: 0;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  transition:
    border-color 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.ignite-button::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(110deg, transparent 16%, rgba(255, 255, 255, 0.2) 46%, transparent 72%);
  transform: translateX(-130%);
  animation: sheen 3.8s ease-in-out infinite 1.2s;
}

.ignite-button:hover {
  border-color: rgba(255, 222, 158, 0.9);
  background: rgba(53, 17, 34, 0.6);
  box-shadow:
    0 0 1.8rem rgba(255, 100, 143, 0.16),
    inset 0 0 1.4rem rgba(255, 218, 148, 0.08);
  transform: translateY(-2px);
}

.ignite-button:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 4px;
}

.spark-icon {
  margin-right: 0.55rem;
  color: var(--gold);
  font-size: 0.92rem;
  animation: sparkle 1.8s ease-in-out infinite;
}

.started .intro {
  opacity: 0;
  filter: blur(0.4rem);
  transform: translateY(-1.25rem) scale(0.97);
  pointer-events: none;
}

.wish {
  position: fixed;
  right: 1rem;
  bottom: max(2rem, env(safe-area-inset-bottom));
  left: 1rem;
  margin: 0;
  color: rgba(255, 244, 225, 0.7);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  line-height: 1.8;
  text-align: center;
  text-shadow: 0 0 1rem rgba(255, 199, 126, 0.16);
  opacity: 0;
  transform: translateY(0.8rem);
  transition: opacity 1.8s ease, transform 1.8s ease;
}

.wish.visible {
  opacity: 1;
  transform: translateY(0);
}

.corner-mark {
  position: fixed;
  right: clamp(1.2rem, 3vw, 3rem);
  bottom: max(1.35rem, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  gap: 0.28rem;
  align-items: flex-end;
  height: 1.2rem;
  opacity: 0.46;
  pointer-events: none;
}

.corner-mark span {
  display: block;
  width: 1px;
  background: var(--gold);
}

.corner-mark span:nth-child(1) { height: 0.35rem; }
.corner-mark span:nth-child(2) { height: 0.75rem; }
.corner-mark span:nth-child(3) { height: 1.15rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes sheen {
  0%, 62% { transform: translateX(-130%); }
  82%, 100% { transform: translateX(130%); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.52; transform: scale(0.82) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.18) rotate(45deg); }
}

@media (max-width: 600px) {
  .topbar {
    min-height: 4.2rem;
    padding-right: 1.15rem;
    padding-left: 1.15rem;
  }

  .topbar-title {
    font-size: 0.72rem;
  }

  .date {
    font-size: 0.6rem;
  }

  .moon {
    top: 6.5rem;
    left: 1.4rem;
  }

  .intro {
    gap: 0.85rem;
    padding: 0 1.2rem;
  }

  h1 {
    max-width: 8em;
    font-size: clamp(2.5rem, 13vw, 4.2rem);
  }

  .wish {
    bottom: max(1.4rem, env(safe-area-inset-bottom));
    padding: 0 2.5rem;
    font-size: 0.78rem;
  }

  .corner-mark {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
