:root {
  color-scheme: dark;
  --ink: #fff7df;
  --muted: #cfb77e;
  --panel-strong: rgba(72, 36, 61, 0.72);
  --line: rgba(255, 229, 153, 0.2);
  --accent: #ffd76a;
  --accent-hot: #ff6d8f;
  --blue: #72d8ff;
  --shadow: rgba(0, 0, 0, 0.34);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  height: 100svh;
  color: var(--ink);
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 109, 143, 0.24), transparent 26rem),
    radial-gradient(circle at 82% 10%, rgba(114, 216, 255, 0.2), transparent 24rem),
    linear-gradient(145deg, #17081f 0%, #30113a 46%, #0f182f 100%);
}

button,
input,
textarea {
  font: inherit;
}

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

.page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 32px));
  height: 100vh;
  height: 100svh;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 54px) 0;
}

.hero {
  position: relative;
  min-height: 100%;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: clamp(14px, 2.2vh, 22px);
  overflow: hidden;
  isolation: isolate;
}

.eyebrow,
h1,
.lead,
.wish-counter,
.thought-button,
.danmaku-form,
.birthday-note {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 0;
  font-size: clamp(3.1rem, 10vw, 8.2rem);
  line-height: 0.94;
  font-weight: 900;
  text-wrap: balance;
  text-shadow: 0 18px 44px var(--shadow);
}

.lead {
  max-width: 660px;
  margin-bottom: 0;
  color: #f6e5bd;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.8;
  font-weight: 700;
}

.wish-counter {
  display: grid;
  gap: 4px;
  margin-top: 6px;
}

.wish-counter span {
  color: var(--accent);
  font-size: clamp(3rem, 8vw, 6rem);
  line-height: 0.92;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  transition: transform 260ms var(--ease-out);
}

.wish-counter small {
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 700;
}

.thought-button,
.danmaku-form button {
  border: 0;
  cursor: pointer;
  color: #2a1028;
  background: linear-gradient(135deg, var(--accent) 0%, #ffb86c 45%, var(--accent-hot) 100%);
  box-shadow: 0 18px 40px rgba(255, 109, 143, 0.27);
  transition: transform 180ms ease, filter 180ms ease;
}

.thought-button {
  position: relative;
  z-index: 1;
  overflow: hidden;
  min-height: 64px;
  border-radius: 999px;
  padding: 0 30px;
  font-size: 1.1rem;
  font-weight: 900;
}

.thought-button:hover,
.danmaku-form button:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.thought-button.celebrating,
body.is-celebrating .wish-counter span {
  transform: scale(1.035);
}

.thought-button:disabled,
.danmaku-form button:disabled {
  cursor: wait;
  filter: saturate(0.7);
}

.danmaku-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  width: min(560px, 100%);
  margin-top: 4px;
}

.danmaku-form input {
  min-width: 0;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--ink);
  background: rgba(15, 11, 27, 0.68);
  outline: none;
}

.danmaku-form input::placeholder {
  color: rgba(255, 247, 223, 0.42);
}

.danmaku-form input:focus {
  border-color: rgba(255, 215, 106, 0.72);
  box-shadow: 0 0 0 4px rgba(255, 215, 106, 0.12);
}

.danmaku-form button {
  min-width: 88px;
  height: 52px;
  border-radius: 999px;
  font-weight: 900;
}

.form-status {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: -4px 0 0 18px;
  color: rgba(255, 215, 106, 0.82);
  font-size: 0.78rem;
}

.wish-stream {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%);
  opacity: 0.7;
}

.wish-bullet {
  position: absolute;
  left: 100%;
  top: var(--lane);
  max-width: min(72vw, 680px);
  white-space: nowrap;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #f9e8c3;
  background: var(--panel-strong);
  font-size: clamp(0.98rem, var(--size), 1.3rem);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
  animation: drift-wish var(--duration) linear infinite;
  animation-delay: var(--delay);
  opacity: var(--alpha, 0.72);
  will-change: transform;
}

.wish-bullet.ghost {
  opacity: 0.36;
}

.birthday-note {
  position: absolute;
  left: 0;
  bottom: clamp(16px, 3vh, 30px);
  margin: 0;
  color: rgba(255, 247, 223, 0.52);
  font-size: clamp(0.72rem, 1.4vw, 0.9rem);
  letter-spacing: 0.08em;
}

@keyframes drift-wish {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(calc(-100vw - 100% - 160px)) translateY(var(--float, -10px));
  }
}

@media (max-width: 760px) {
  .page {
    width: min(100% - 24px, 640px);
  }

  .hero {
    align-content: center;
    gap: 12px;
  }

  h1 {
    font-size: clamp(2.75rem, 15vw, 4.7rem);
  }

  .lead {
    max-width: 100%;
    font-size: 0.98rem;
    line-height: 1.65;
  }

  .thought-button {
    min-height: 56px;
    padding: 0 22px;
    font-size: 1rem;
  }

  .wish-stream {
    opacity: 0.42;
  }

  .wish-bullet {
    max-width: 78vw;
    padding: 9px 14px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .danmaku-form {
    grid-template-columns: 1fr;
    max-width: 360px;
  }

  .danmaku-form input,
  .danmaku-form button {
    height: 46px;
  }
}

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

  .wish-stream {
    display: block;
    mask-image: none;
  }

  .wish-bullet {
    opacity: 0.28;
    animation: none;
  }
}
