:root {
  --bg-top: #fff5ef;
  --bg-bottom: #f8d9d8;
  --card-bg: rgba(255, 251, 248, 0.56);
  --card-border: rgba(255, 255, 255, 0.42);
  --text-main: #5f3842;
  --text-soft: #89616b;
  --accent: #d67b8f;
  --accent-strong: #c75b74;
  --gold: #e6b680;
  --shadow: rgba(112, 48, 63, 0.18);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow-x: hidden;
  font-family: "Noto Serif SC", serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.95), transparent 30%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
}

.music-player {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: 16px;
  z-index: 30;
  touch-action: none;
  transition: top 160ms ease, left 160ms ease;
}

.music-fab {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: #fff7f7;
  background: linear-gradient(135deg, rgba(214, 123, 143, 0.96), rgba(199, 91, 116, 0.98));
  box-shadow: 0 14px 28px rgba(112, 48, 63, 0.2);
  cursor: grab;
}

.music-fab-icon {
  font-size: 1.05rem;
}

.music-panel {
  position: absolute;
  top: 0;
  right: calc(100% + 12px);
  width: min(220px, calc(100vw - 28px));
  padding: 14px 14px 12px;
  border-radius: 22px;
  background: rgba(255, 251, 249, 0.82);
  border: 1px solid rgba(235, 213, 214, 0.82);
  box-shadow: 0 14px 28px rgba(112, 48, 63, 0.14);
  backdrop-filter: blur(18px);
  transform-origin: top right;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;
}

.music-player.collapsed .music-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateX(10px) scale(0.92);
  pointer-events: none;
}

.music-player.expanded .music-panel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0) scale(1);
}

.music-player.expanded .music-fab {
  box-shadow: 0 14px 28px rgba(112, 48, 63, 0.28);
}

.music-kicker,
.music-title,
.music-hint {
  margin: 0;
}

.music-kicker {
  color: var(--accent-strong);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.music-title {
  margin-top: 6px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.music-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.music-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 8px;
  color: var(--accent-strong);
  background: linear-gradient(180deg, rgba(255, 244, 244, 0.96), rgba(255, 233, 236, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.music-toggle.playing {
  color: #fff7f7;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 10px 18px rgba(199, 91, 116, 0.22);
}

.music-hint {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.76rem;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding: 24px 16px 40px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.aurora {
  position: absolute;
  inset: auto;
  border-radius: 999px;
  filter: blur(10px);
  opacity: 0.72;
  animation: floatGlow 11s ease-in-out infinite;
}

.aurora-a {
  width: 240px;
  height: 240px;
  top: 8%;
  right: -40px;
  background: radial-gradient(circle, rgba(255, 223, 214, 0.95), transparent 70%);
}

.aurora-b {
  width: 280px;
  height: 280px;
  bottom: 8%;
  left: -60px;
  background: radial-gradient(circle, rgba(240, 189, 202, 0.8), transparent 65%);
  animation-delay: -4s;
}

.stars,
.petals,
.spark-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.spark-layer {
  position: fixed;
  z-index: 35;
}

.stars::before,
.stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.85) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 241, 220, 0.72) 0 1.2px, transparent 1.7px);
  background-size: 120px 120px, 180px 180px;
  background-position: 10px 22px, 64px 80px;
  opacity: 0.52;
  animation: twinkle 8s linear infinite;
}

.stars::after {
  opacity: 0.3;
  transform: scale(1.15);
  animation-duration: 12s;
}

.petal {
  position: absolute;
  top: -10%;
  width: 14px;
  height: 20px;
  border-radius: 14px 14px 14px 2px;
  background: linear-gradient(180deg, rgba(255, 232, 235, 0.95), rgba(233, 158, 181, 0.9));
  box-shadow: 0 8px 18px rgba(198, 109, 134, 0.14);
  opacity: 0.85;
  animation-name: drift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.card {
  position: relative;
  width: min(100%, 420px);
  padding: 28px 20px 26px;
  border: 1px solid var(--card-border);
  border-radius: 28px;
  background: var(--card-bg);
  backdrop-filter: blur(22px);
  box-shadow:
    0 16px 40px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.84rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 8vw, 3rem);
  line-height: 1.18;
  font-weight: 700;
}

.lead {
  margin: 18px 0 0;
  color: var(--text-soft);
  line-height: 1.9;
  font-size: 0.98rem;
}

.message-window {
  margin-top: 22px;
  padding: 18px 16px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 246, 244, 0.88), rgba(255, 239, 240, 0.74));
  border: 1px solid rgba(228, 193, 197, 0.55);
  min-height: 126px;
}

.typing-line {
  margin: 0;
  color: var(--text-main);
  line-height: 1.9;
  min-height: 90px;
}

.days-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.days-card {
  padding: 16px 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 252, 248, 0.72), rgba(255, 238, 239, 0.74));
  border: 1px solid rgba(235, 213, 214, 0.82);
  text-align: center;
}

.days-label,
.days-date,
.days-value {
  margin: 0;
}

.days-label {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.days-value {
  margin-top: 8px;
  color: var(--accent-strong);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.days-unit {
  margin-left: 4px;
  font-size: 0.95rem;
  font-weight: 500;
}

.days-date {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.interactive-panel {
  margin-top: 20px;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.fortune-card,
.game-card,
.letter-card {
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 251, 249, 0.5);
  border: 1px solid rgba(235, 213, 214, 0.78);
}

.section-tag {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.fortune-text {
  margin: 10px 0 0;
  min-height: 54px;
  line-height: 1.8;
  color: var(--text-main);
}

.soft-button,
.letter-seal {
  margin-top: 12px;
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  color: var(--accent-strong);
  background: linear-gradient(180deg, rgba(255, 244, 244, 0.96), rgba(255, 233, 236, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.soft-button {
  width: 100%;
}

.letter-seal {
  width: 100%;
  position: relative;
  padding-top: 14px;
  padding-bottom: 14px;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.letter-seal::before {
  content: "❤";
  margin-right: 8px;
}

.letter-seal.locked {
  opacity: 0.78;
}

.letter-seal.unlocked {
  color: #fff7f7;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 14px 24px rgba(199, 91, 116, 0.18);
}

.letter-seal.pulse {
  animation: sealPulse 900ms ease 2;
}

.letter-seal.opening {
  animation: envelopeOpen 760ms ease forwards;
}

.game-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.game-tip {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.game-count {
  margin: 2px 0 0;
  min-width: 52px;
  color: var(--accent-strong);
  font-size: 1.1rem;
  font-weight: 700;
  text-align: right;
}

.progress-track {
  width: 100%;
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(232, 212, 205, 0.72);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff8ea7 0%, #df5f80 100%);
  transition: width 220ms ease;
}

.heart-game {
  position: relative;
  margin-top: 14px;
  min-height: 180px;
  overflow: hidden;
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.72), transparent 45%),
    linear-gradient(180deg, rgba(255, 246, 247, 0.9), rgba(255, 235, 238, 0.82));
  border: 1px solid rgba(235, 213, 214, 0.78);
}

.heart-game::after {
  content: "抓住江江的心";
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  color: rgba(137, 97, 107, 0.72);
  font-size: 0.84rem;
  white-space: nowrap;
  pointer-events: none;
}

.heart-game.unlocked::after {
  content: "江江的心已经被欢宝抓住啦";
  color: rgba(199, 91, 116, 0.78);
}

.game-heart {
  position: absolute;
  bottom: -24px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  font-size: 24px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  animation: floatHeart linear forwards;
  filter: drop-shadow(0 8px 12px rgba(170, 62, 92, 0.14));
}

.game-heart.pop {
  animation: popHeart 320ms ease forwards;
}

.unlock-banner {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 238, 242, 0.96), rgba(255, 248, 248, 0.96));
  border: 1px solid rgba(226, 178, 190, 0.68);
  box-shadow: 0 10px 22px rgba(199, 91, 116, 0.12);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 300ms ease,
    transform 300ms ease;
}

.unlock-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.unlock-title,
.unlock-copy {
  margin: 0;
  text-align: center;
}

.unlock-title {
  color: var(--accent-strong);
  font-size: 1rem;
  font-weight: 700;
}

.unlock-copy {
  margin-top: 6px;
  color: var(--text-soft);
  line-height: 1.7;
  font-size: 0.9rem;
}

.letter-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
}

.letter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(86, 42, 52, 0.36);
  backdrop-filter: blur(8px);
}

.letter-dialog {
  position: relative;
  width: min(100%, 520px);
  z-index: 1;
}

.letter-paper {
  padding: 56px 22px 24px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(255, 244, 243, 0.96));
  border: 1px solid rgba(232, 212, 205, 0.92);
  box-shadow: 0 22px 46px rgba(112, 48, 63, 0.22);
  line-height: 2;
  transform-origin: top center;
  animation: modalPaperIn 420ms ease forwards;
}

.letter-paper p {
  margin: 0 0 14px;
}

.letter-paper-title {
  color: var(--accent-strong);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
}

.letter-paper-sign {
  margin-top: 16px;
  color: var(--accent-strong);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.6rem;
  text-align: right;
}

.letter-close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--accent-strong);
  background: rgba(255, 245, 245, 0.9);
  box-shadow: 0 8px 18px rgba(170, 62, 92, 0.1);
}

.spark {
  position: absolute;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  display: grid;
  place-items: center;
  font-size: 16px;
  text-shadow: 0 6px 12px rgba(170, 62, 92, 0.18);
  animation: burst 900ms ease-out forwards;
}

.promise-grid {
  margin-top: 22px;
  display: grid;
  gap: 12px;
}

.promise-grid article {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(235, 213, 214, 0.72);
}

.promise-grid span {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
}

.promise-grid h2 {
  margin: 0;
  font-size: 1rem;
}

.promise-grid p {
  margin: 8px 0 0;
  color: var(--text-soft);
  line-height: 1.8;
  font-size: 0.92rem;
}

.reveal-button {
  width: 100%;
  margin-top: 20px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  color: #fff7f7;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: 0 14px 24px rgba(199, 91, 116, 0.28);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.reveal-button:active {
  transform: scale(0.98);
}

.final-note {
  margin-top: 18px;
  padding: 18px 16px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 252, 248, 0.95), rgba(255, 244, 243, 0.84));
  border: 1px solid rgba(232, 212, 205, 0.9);
  line-height: 1.9;
  transform: translateY(10px);
  opacity: 0;
  transition:
    transform 480ms ease,
    opacity 480ms ease;
}

.final-note p {
  margin: 0;
}

.final-note p + p {
  margin-top: 10px;
}

.final-note .signature {
  color: var(--accent-strong);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 1.5rem;
}

.final-note.show {
  transform: translateY(0);
  opacity: 1;
}

.hidden {
  display: none;
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, 18px, 0) scale(1.04);
  }
}

@keyframes twinkle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

@keyframes drift {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  100% {
    transform: translate3d(var(--drift-x), 120vh, 0) rotate(360deg);
  }
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

@keyframes burst {
  0% {
    transform: translate3d(0, 0, 0) scale(0.8);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--spark-x), var(--spark-y), 0) scale(1.3);
    opacity: 0;
  }
}

@keyframes floatHeart {
  0% {
    transform: translate3d(0, 0, 0) scale(0.9);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translate3d(var(--float-x), -220px, 0) scale(1.08);
    opacity: 0;
  }
}

@keyframes popHeart {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

@keyframes sealPulse {
  0%,
  100% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.03);
  }
  70% {
    transform: scale(0.99);
  }
}

@keyframes envelopeOpen {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.04) rotate(-1deg);
  }
  60% {
    transform: scale(0.98) rotate(1deg);
  }
  100% {
    transform: translateY(-8px) scale(1.02);
  }
}

@keyframes modalPaperIn {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.92) rotateX(-12deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0deg);
  }
}

@media (min-width: 768px) {
  .page-shell {
    padding: 40px 20px 60px;
  }

  .card {
    width: min(100%, 520px);
    padding: 34px 28px 30px;
  }

  .promise-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .interactive-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .music-player {
    right: 16px;
  }

  .music-panel {
    width: min(220px, calc(100vw - 62px));
  }

  .days-grid {
    grid-template-columns: 1fr;
  }
}
