:root {
  --bg-top: #ffdce8;
  --bg-bottom: #fff4f7;
  --gold: #f0cf9a;
  --rose: #b96d84;
  --paper: #fff7ef;
  --ink: #5f3b39;
  --envelope: #f4d3c6;
  --envelope-dark: #e8b8b5;
  --shadow: rgba(157, 94, 124, 0.24);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  font-family: "Noto Serif SC", serif;
  color: #8d5368;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.9), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(255, 210, 231, 0.85), transparent 20%),
    radial-gradient(circle at 50% 10%, rgba(255, 243, 176, 0.48), transparent 16%),
    radial-gradient(circle at 20% 78%, rgba(255, 205, 221, 0.55), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.75;
  background:
    radial-gradient(circle at 12% 28%, rgba(255, 255, 255, 0.95) 0 14px, transparent 15px),
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.85) 0 10px, transparent 11px),
    radial-gradient(circle at 24% 75%, rgba(255, 255, 255, 0.7) 0 12px, transparent 13px),
    radial-gradient(circle at 82% 78%, rgba(255, 231, 239, 0.9) 0 18px, transparent 19px);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 8% 14%, rgba(255, 170, 198, 0.45) 0 6px, transparent 7px),
    radial-gradient(circle at 18% 84%, rgba(255, 170, 198, 0.38) 0 8px, transparent 9px),
    radial-gradient(circle at 88% 18%, rgba(255, 192, 203, 0.35) 0 7px, transparent 8px),
    radial-gradient(circle at 70% 72%, rgba(255, 214, 107, 0.28) 0 6px, transparent 7px);
  filter: blur(1px);
}

.romance-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
}

.music-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #9b6276;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(208, 133, 156, 0.14);
  backdrop-filter: blur(14px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.music-toggle:hover {
  transform: translateY(-1px);
}

.music-toggle.is-playing {
  background: rgba(255, 233, 241, 0.92);
  box-shadow: 0 14px 34px rgba(208, 133, 156, 0.22);
}

.music-icon {
  font-size: 1rem;
}

.music-label {
  font-size: 0.92rem;
}

.float-heart,
.glow-dot,
.burst-heart {
  position: absolute;
  opacity: 0;
}

.float-heart {
  color: rgba(222, 117, 150, 0.46);
  text-shadow: 0 8px 20px rgba(219, 136, 162, 0.18);
  animation: driftHeart 11s linear infinite;
}

.heart-1 {
  left: 8%;
  bottom: -8%;
  font-size: 1.3rem;
  animation-delay: 0s;
}

.heart-2 {
  left: 24%;
  bottom: -10%;
  font-size: 1.7rem;
  animation-delay: 3.6s;
}

.heart-3 {
  right: 18%;
  bottom: -12%;
  font-size: 1.15rem;
  animation-delay: 7.2s;
}

.heart-4 {
  right: 6%;
  bottom: -9%;
  font-size: 1.5rem;
  animation-delay: 5.4s;
}

.glow-dot {
  border-radius: 999px;
  filter: blur(0.5px);
  animation: twinkle 5s ease-in-out infinite;
}

.burst-heart {
  left: 0;
  top: 0;
  z-index: 20;
  color: rgba(220, 101, 140, 0.92);
  font-size: 1.15rem;
  text-shadow: 0 10px 24px rgba(220, 101, 140, 0.22);
  animation: burstUp 820ms ease-out forwards;
}

.celebration-heart {
  left: 0;
  top: 0;
  z-index: 22;
  color: rgba(217, 88, 136, 0.96);
  font-size: 1.25rem;
  text-shadow: 0 12px 30px rgba(220, 101, 140, 0.24);
  animation: celebrateBurst 1250ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.heart-transition {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  background: rgba(233, 128, 160, 0);
  pointer-events: none;
  overflow: hidden;
}

.heart-transition::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f19ab8, #ea7fa6);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.heart-transition-core {
  position: relative;
  z-index: 1;
  font-size: 4rem;
  line-height: 1;
  color: #fff4f7;
  text-shadow: 0 18px 40px rgba(190, 73, 120, 0.25);
  transform: scale(0.4);
  opacity: 0;
}

.heart-transition.is-active::before {
  opacity: 1;
}

.heart-transition.is-active .heart-transition-core {
  animation: heartExpand 0.92s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.heart-transition.is-dropping {
  animation: heartCurtainDrop 0.82s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.letter-reveal {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: transparent;
}

.letter-reveal-envelope {
  position: relative;
  width: min(76vw, 340px);
  aspect-ratio: 1.28 / 0.88;
  border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, #f8e4dc, var(--envelope));
  box-shadow: 0 24px 50px rgba(157, 94, 124, 0.22), 0 0 0 10px rgba(255, 255, 255, 0.26);
  overflow: hidden;
  opacity: 0;
  transform: scale(0.92);
}

.letter-reveal-envelope::before,
.letter-reveal-envelope::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 50.5%;
  height: 100%;
  background: linear-gradient(180deg, var(--envelope-dark), #dca8a7);
}

.letter-reveal-envelope::before {
  left: 0;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.letter-reveal-envelope::after {
  right: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.letter-reveal-paper {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 72%;
  height: 88%;
  border-radius: 16px 16px 8px 8px;
  background:
    linear-gradient(180deg, rgba(138, 88, 85, 0.1), rgba(138, 88, 85, 0)),
    var(--paper);
  transform: translateX(-50%) translateY(52%);
}

.letter-reveal-paper::before {
  content: "";
  position: absolute;
  inset: 18px 18px auto;
  height: 2px;
  background: rgba(95, 59, 57, 0.16);
  box-shadow: 0 18px 0 rgba(95, 59, 57, 0.14), 0 36px 0 rgba(95, 59, 57, 0.12);
}

.letter-reveal-flap {
  position: absolute;
  inset: 0;
  transform-origin: top center;
  background: linear-gradient(180deg, #ffdcd4, #e8b8b5);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  z-index: 3;
}

.letter-reveal-heart {
  position: absolute;
  left: 50%;
  top: 57%;
  z-index: 4;
  transform: translate(-50%, -50%);
  color: #c86479;
  font-size: clamp(1.5rem, 5vw, 2rem);
}

.letter-reveal-to {
  position: absolute;
  left: 50%;
  bottom: 36px;
  z-index: 4;
  transform: translateX(-50%);
  color: #a86273;
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  white-space: nowrap;
}

.letter-reveal.is-active .letter-reveal-envelope {
  animation: revealEnvelopeShow 0.42s ease forwards;
}

.letter-reveal.is-active .letter-reveal-flap {
  animation: revealFlapOpen 0.72s cubic-bezier(0.2, 0.8, 0.2, 1) 0.22s forwards;
}

.letter-reveal.is-active .letter-reveal-paper {
  animation: revealPaperRise 0.82s cubic-bezier(0.2, 0.8, 0.2, 1) 0.26s forwards;
}

.letter-reveal.is-active .letter-reveal-envelope {
  animation: revealEnvelopeShow 0.42s ease forwards, revealEnvelopeZoom 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) 0.92s forwards;
}

.dot-1 {
  top: 22%;
  left: 10%;
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.85);
}

.dot-2 {
  top: 68%;
  right: 14%;
  width: 14px;
  height: 14px;
  background: rgba(255, 236, 196, 0.8);
  animation-delay: 1.8s;
}

.dot-3 {
  top: 54%;
  left: 78%;
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.78);
  animation-delay: 3.1s;
}

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

.cover-screen,
.hero {
  width: 100%;
  text-align: center;
}

.cover-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.9), transparent 18%),
    radial-gradient(circle at 80% 18%, rgba(255, 210, 231, 0.85), transparent 20%),
    radial-gradient(circle at 50% 10%, rgba(255, 243, 176, 0.48), transparent 16%),
    radial-gradient(circle at 20% 78%, rgba(255, 205, 221, 0.55), transparent 24%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  opacity: 1;
  transition: opacity 0.35s ease;
}

.hero {
  min-height: 100vh;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 24px;
  opacity: 1;
  animation: reveal 0.5s ease;
}

.hero > * {
  width: min(100%, 760px);
}

.eyebrow {
  margin: 0 0 8px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: #ca8fa2;
}

h1 {
  margin: 0;
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 400;
  line-height: 1.05;
}

.intro {
  width: min(100%, 520px);
  margin: 10px auto 0;
  font-size: 1rem;
  line-height: 1.9;
  color: rgba(141, 83, 104, 0.82);
}

.envelope-scene {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  margin: 0 auto;
  padding: 28px 20px 10px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.pointer-hand {
  position: absolute;
  left: -34px;
  top: 46%;
  z-index: 5;
  font-size: 3.2rem;
  line-height: 1;
  opacity: 0.72;
  filter: saturate(0.92);
  text-shadow: 0 10px 24px rgba(196, 111, 139, 0.16);
  transform: translateY(-50%);
  animation: pointPulse 1.8s ease-in-out infinite;
}

.envelope-scene:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 8px;
}

.envelope {
  position: relative;
  width: min(72vw, 320px);
  aspect-ratio: 1.28 / 0.88;
  display: block;
  border-radius: 0 0 22px 22px;
  background: linear-gradient(180deg, #f8e4dc, var(--envelope));
  box-shadow: 0 24px 50px var(--shadow), 0 0 0 10px rgba(255, 255, 255, 0.28);
  overflow: hidden;
  transform: translateY(0) scale(1);
  transition: transform 0.7s ease;
}

.envelope::before,
.envelope::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 50.5%;
  height: 100%;
  background: linear-gradient(180deg, var(--envelope-dark), #dca8a7);
}

.envelope::before {
  left: 0;
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}

.envelope::after {
  right: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.envelope-flap {
  position: absolute;
  inset: 0;
  transform-origin: top center;
  background: linear-gradient(180deg, #ffdcd4, #e8b8b5);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  z-index: 3;
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.letter-peek {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: 72%;
  height: 88%;
  border-radius: 16px 16px 8px 8px;
  background:
    linear-gradient(180deg, rgba(138, 88, 85, 0.1), rgba(138, 88, 85, 0)),
    var(--paper);
  transform: translateX(-50%) translateY(52%);
  transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.letter-peek::before {
  content: "";
  position: absolute;
  inset: 18px 18px auto;
  height: 2px;
  background: rgba(95, 59, 57, 0.16);
  box-shadow: 0 18px 0 rgba(95, 59, 57, 0.14), 0 36px 0 rgba(95, 59, 57, 0.12);
}

.envelope-to {
  position: absolute;
  left: 50%;
  bottom: 36px;
  z-index: 4;
  transform: translateX(-50%);
  color: #a86273;
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  white-space: nowrap;
}

.envelope-heart {
  position: absolute;
  left: 50%;
  top: 57%;
  z-index: 4;
  transform: translate(-50%, -50%);
  color: #c86479;
  font-size: clamp(1.5rem, 5vw, 2rem);
  text-shadow: 0 8px 18px rgba(180, 85, 99, 0.25);
}

.cta {
  color: var(--rose);
  font-size: 0.98rem;
  letter-spacing: 0.08em;
}

.tap-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 14px 40px rgba(204, 124, 155, 0.16);
}

.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle, #fff7d8, rgba(255, 247, 216, 0));
  filter: blur(0.4px);
  animation: float 4s ease-in-out infinite;
}

.spark-1 {
  top: 10%;
  left: 16%;
}

.spark-2 {
  top: 18%;
  right: 18%;
  animation-delay: 1.1s;
}

.spark-3 {
  bottom: 24%;
  right: 10%;
  animation-delay: 2.1s;
}

.letter-panel {
  margin-top: 34px;
  animation: reveal 0.9s ease;
}

.letter-panel.is-revealing {
  animation: letterFadeIn 0.7s ease forwards;
}

.quiz-panel {
  margin-top: 34px;
  animation: reveal 0.9s ease;
}

.quiz-card {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 38px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 24px 60px rgba(189, 126, 149, 0.18);
  backdrop-filter: blur(14px);
  color: var(--ink);
}

.quiz-card.is-switching {
  animation: quizCardSwap 0.38s ease;
}

.quiz-step {
  margin: 0;
  color: #ca8fa2;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
}

.quiz-question {
  margin: 12px 0 0;
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  color: #8d5368;
}

.quiz-tip {
  margin: 12px 0 0;
  line-height: 1.9;
  color: rgba(95, 59, 57, 0.72);
}

.quiz-options {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.quiz-input-wrap {
  display: grid;
  gap: 14px;
  margin-top: 26px;
}

.quiz-option,
.quiz-next,
.quiz-submit,
.quiz-input {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.quiz-option,
.quiz-next,
.quiz-submit {
  cursor: pointer;
}

.quiz-option {
  background: rgba(255, 247, 250, 0.92);
  color: #8d5368;
  box-shadow: 0 10px 24px rgba(208, 133, 156, 0.14);
}

.quiz-input {
  background: rgba(255, 251, 252, 0.96);
  color: #8d5368;
  box-shadow: inset 0 0 0 1px rgba(208, 133, 156, 0.18);
  outline: none;
}

.quiz-input::placeholder {
  color: rgba(141, 83, 104, 0.5);
}

.quiz-submit {
  background: rgba(255, 219, 230, 0.95);
  color: #8d5368;
  box-shadow: 0 10px 24px rgba(208, 133, 156, 0.14);
}

.quiz-option:hover,
.quiz-next:hover,
.quiz-submit:hover {
  transform: translateY(-1px);
}

.quiz-option.is-correct {
  background: #ffdbe6;
  box-shadow: 0 12px 28px rgba(208, 133, 156, 0.22);
}

.quiz-option.is-wrong {
  background: #fff1f4;
}

.quiz-option:disabled {
  cursor: default;
  opacity: 0.9;
}

.quiz-submit:disabled {
  cursor: default;
  opacity: 0.85;
}

.quiz-input.is-correct {
  box-shadow: inset 0 0 0 2px rgba(201, 109, 144, 0.45);
}

.quiz-input.is-wrong {
  box-shadow: inset 0 0 0 2px rgba(222, 122, 148, 0.35);
}

.quiz-feedback {
  min-height: 28px;
  margin: 18px 0 0;
  color: #a34f5c;
}

.quiz-next {
  margin-top: 8px;
  background: linear-gradient(180deg, #f7bfd0, #ee9db6);
  color: #fffafc;
  box-shadow: 0 12px 28px rgba(208, 133, 156, 0.26);
}

.letter-paper {
  position: relative;
  width: min(100%, 680px);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 52px);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 247, 239, 0.95)),
    var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(189, 126, 149, 0.22);
  text-align: left;
}

.letter-paper::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(168, 115, 121, 0.18);
  border-radius: 18px;
  pointer-events: none;
}

.letter-paper::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 24px;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(164, 120, 126, 0.08) 1px, transparent 1px),
    radial-gradient(circle at 20% 16%, rgba(255, 255, 255, 0.28), transparent 20%);
  background-size: 100% 34px, 100% 100%;
}

.letter-date,
.signature {
  font-family: "Ma Shan Zheng", cursive;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin: 0;
}

.letter-body {
  margin-top: 22px;
}

.letter-body p {
  margin: 0 0 18px;
  font-size: 1.04rem;
  line-height: 2.08;
  text-wrap: pretty;
}

.highlight-line {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 224, 233, 0.82), rgba(255, 240, 244, 0.92));
  box-shadow: 0 14px 30px rgba(208, 133, 156, 0.12);
  font-weight: 700;
  font-size: 1.08rem;
  color: #a13f58;
}

.signature {
  margin-top: 34px;
  text-align: right;
  color: #9a5565;
  transform: rotate(-2deg);
}

.letter-paper.is-settled {
  animation: paperSettle 0.7s ease;
}

body.is-open .envelope {
  transform: translateY(-6px) scale(1.03);
}

body.is-open .envelope-flap {
  transform: rotateX(180deg);
}

body.is-open .letter-peek {
  transform: translateX(-50%) translateY(-12%);
}

.cover-screen.is-fading {
  opacity: 0;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.4;
  }

  50% {
    transform: translateY(-18px) scale(1.25);
    opacity: 1;
  }
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes nudge {
  0%,
  100% {
    transform: translateX(0);
  }

  50% {
    transform: translateX(6px);
  }
}

@keyframes pointPulse {
  0%,
  100% {
    transform: translateY(-50%) translateX(0);
  }

  50% {
    transform: translateY(-50%) translateX(4px);
  }
}

@keyframes driftHeart {
  0% {
    transform: translate3d(0, 0, 0) scale(0.9) rotate(0deg);
    opacity: 0;
  }

  12% {
    opacity: 0.5;
  }

  55% {
    opacity: 0.32;
  }

  100% {
    transform: translate3d(24px, -110vh, 0) scale(1.18) rotate(12deg);
    opacity: 0;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.8);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.25);
  }
}

@keyframes burstUp {
  0% {
    opacity: 0;
    transform: translate3d(var(--burst-x, 0), var(--burst-y, 0), 0) scale(0.6);
  }

  15% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(var(--burst-x, 0) + var(--drift-x, 0px)), calc(var(--burst-y, 0) - 68px), 0) scale(1.3);
  }
}

@keyframes celebrateBurst {
  0% {
    opacity: 0;
    transform: translate3d(var(--burst-x, 0), var(--burst-y, 0), 0) scale(0.5);
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(calc(var(--burst-x, 0) + var(--drift-x, 0px)), calc(var(--burst-y, 0) + var(--drift-y, 0px)), 0) scale(1.55) rotate(14deg);
  }
}

@keyframes heartExpand {
  0% {
    transform: scale(0.35);
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  55% {
    transform: scale(3.8);
    opacity: 1;
  }

  100% {
    transform: scale(14);
    opacity: 1;
  }
}

@keyframes heartCurtainDrop {
  from {
    transform: translateY(0);
  }

  to {
    transform: translateY(115vh);
  }
}

@keyframes revealEnvelopeShow {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes revealFlapOpen {
  from {
    transform: rotateX(0deg);
  }

  to {
    transform: rotateX(180deg);
  }
}

@keyframes revealPaperRise {
  from {
    transform: translateX(-50%) translateY(52%);
  }

  to {
    transform: translateX(-50%) translateY(-12%) scale(1.09);
  }
}

@keyframes revealEnvelopeZoom {
  from {
    opacity: 1;
    transform: scale(1);
  }

  to {
    opacity: 0;
    transform: scale(1.68);
  }
}

@keyframes letterFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes quizCardSwap {
  0% {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes paperSettle {
  0% {
    transform: translateY(12px) scale(0.992);
  }

  55% {
    transform: translateY(-3px) scale(1.002);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 18px;
  }

  .music-toggle {
    top: 14px;
    right: 14px;
    padding: 9px 12px;
  }

  .heart-transition-core {
    font-size: 3.2rem;
  }

  .letter-reveal-envelope {
    width: min(82vw, 320px);
  }

  .cover-screen,
  .hero {
    padding: 18px;
  }

  .intro {
    font-size: 0.95rem;
  }

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

  .quiz-card {
    padding: 22px 18px 24px;
  }

  .quiz-options,
  .quiz-input-wrap {
    gap: 16px;
  }

  .quiz-option,
  .quiz-next,
  .quiz-submit,
  .quiz-input {
    min-height: 54px;
    padding: 15px 18px;
  }

  .cta {
    font-size: 0.9rem;
  }

  .pointer-hand {
    left: -20px;
    top: 46%;
    font-size: 2.5rem;
  }
}
