:root {
  color-scheme: dark;
  --ink: #f8fbff;
  --muted: #c6d3dc;
  --soft: rgba(248, 251, 255, 0.74);
  --line: rgba(255, 255, 255, 0.22);
  --card: rgba(14, 27, 40, 0.72);
  --card-strong: rgba(20, 42, 58, 0.86);
  --green: #68d391;
  --gold: #ffd166;
  --blue: #74d7ff;
  --rose: #ff9fbb;
  --earth: #9bd1a7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
  background:
    radial-gradient(circle at 22% 18%, rgba(116, 215, 255, 0.22), transparent 26rem),
    radial-gradient(circle at 78% 12%, rgba(255, 209, 102, 0.16), transparent 22rem),
    linear-gradient(145deg, #071019 0%, #102331 48%, #162d24 100%);
  color: var(--ink);
  overflow-x: hidden;
}

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

.card-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.birthday-card {
  width: min(960px, 100%);
  min-height: min(820px, calc(100vh - 64px));
  display: grid;
  grid-template-rows: auto minmax(210px, 31vh) auto auto auto;
  gap: 18px;
  padding: clamp(20px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 28%),
    var(--card);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.card-topline {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: 0;
}

.card-topline span {
  min-width: 0;
}

.scene {
  position: relative;
  min-height: 220px;
  border-radius: 8px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 36%, rgba(116, 215, 255, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(5, 12, 24, 0.14), rgba(4, 14, 17, 0.26));
}

.planet {
  position: absolute;
  top: 20px;
  left: clamp(28px, 9vw, 110px);
  width: clamp(76px, 12vw, 122px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 26%, #fff7c2 0 8%, transparent 9%),
    radial-gradient(circle at 62% 54%, rgba(104, 211, 145, 0.9) 0 13%, transparent 14%),
    linear-gradient(140deg, #74d7ff, #295a7b 56%, #142635);
  box-shadow: 0 0 42px rgba(116, 215, 255, 0.58);
}

.orbit {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  transform: rotate(-18deg);
}

.orbit-one {
  top: 52px;
  left: clamp(10px, 6vw, 72px);
  width: clamp(142px, 23vw, 232px);
  height: clamp(44px, 8vw, 70px);
}

.orbit-two {
  top: 70px;
  right: clamp(36px, 10vw, 130px);
  width: clamp(180px, 30vw, 310px);
  height: clamp(56px, 9vw, 92px);
  border-color: rgba(255, 209, 102, 0.26);
}

.mountain {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  height: 54%;
  clip-path: polygon(0 100%, 0 58%, 10% 48%, 20% 66%, 34% 27%, 48% 62%, 62% 24%, 75% 57%, 86% 40%, 100% 65%, 100% 100%);
}

.mountain-back {
  background: linear-gradient(180deg, rgba(155, 209, 167, 0.34), rgba(32, 74, 69, 0.78));
  transform: translateY(8px);
}

.mountain-front {
  height: 43%;
  background: linear-gradient(180deg, rgba(104, 211, 145, 0.42), rgba(14, 55, 42, 0.94));
  clip-path: polygon(0 100%, 0 72%, 12% 48%, 28% 64%, 44% 28%, 60% 69%, 72% 42%, 85% 59%, 100% 38%, 100% 100%);
}

.river {
  position: absolute;
  left: 42%;
  bottom: -52px;
  width: 18%;
  height: 170px;
  background: linear-gradient(90deg, transparent, rgba(116, 215, 255, 0.6), rgba(255, 255, 255, 0.58), rgba(116, 215, 255, 0.42), transparent);
  clip-path: polygon(36% 0, 64% 0, 86% 100%, 8% 100%);
  opacity: 0.8;
}

.trail {
  position: absolute;
  right: 8%;
  bottom: 25%;
  width: 28%;
  height: 38%;
  border-top: 2px dashed rgba(255, 209, 102, 0.72);
  border-radius: 50%;
  transform: rotate(-10deg);
}

.content {
  display: grid;
  gap: 12px;
}

.eyebrow,
.subtitle,
.letter p {
  margin: 0;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.92rem;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.8rem);
  line-height: 0.98;
  font-weight: 800;
}

.subtitle {
  max-width: 720px;
  color: var(--soft);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.7;
}

.letter {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
}

.letter p {
  color: var(--muted);
  line-height: 1.88;
  font-size: 1rem;
}

.letter .signature {
  color: var(--ink);
  font-weight: 700;
}

.wish-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.wish-grid div {
  min-height: 104px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: var(--card-strong);
}

.wish-grid strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.wish-grid span {
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.9rem;
}

.card-actions {
  display: flex;
  justify-content: center;
}

button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.22), rgba(116, 215, 255, 0.16));
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:focus-visible {
  outline: 3px solid rgba(255, 209, 102, 0.8);
  outline-offset: 3px;
}

.button-icon {
  width: 18px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, var(--gold) 0 24%, transparent 25%),
    conic-gradient(from 0deg, transparent 0 12%, var(--gold) 12% 17%, transparent 17% 29%, var(--gold) 29% 34%, transparent 34% 46%, var(--gold) 46% 51%, transparent 51% 63%, var(--gold) 63% 68%, transparent 68% 80%, var(--gold) 80% 85%, transparent 85%);
}

.hidden-wish {
  max-height: 0;
  overflow: hidden;
  border-top: 1px solid transparent;
  color: var(--soft);
  transition: max-height 360ms ease, border-color 360ms ease, padding-top 360ms ease;
}

.hidden-wish.is-open {
  max-height: 260px;
  padding-top: 16px;
  border-color: rgba(255, 255, 255, 0.18);
}

.hidden-wish p {
  margin: 0;
  line-height: 1.8;
}

@media (max-width: 760px) {
  .card-shell {
    padding: 14px;
    place-items: start center;
  }

  .birthday-card {
    min-height: auto;
    grid-template-rows: auto 210px auto auto auto;
    padding: 18px;
  }

  .card-topline {
    flex-wrap: wrap;
  }

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

  button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 460px) {
  .wish-grid {
    grid-template-columns: 1fr;
  }

  .letter {
    padding: 14px;
  }

  .letter p {
    font-size: 0.96rem;
  }
}
