:root {
  --cream: #fff8ee;
  --paper: #f8ead7;
  --paper-deep: #ead2b8;
  --apricot: #e9ac91;
  --rose: #d78d78;
  --ink: #5b3d32;
  --ink-soft: rgba(91, 61, 50, 0.72);
  --line: rgba(126, 84, 61, 0.14);
  --gold: #efc77f;
  --shadow: 0 22px 56px rgba(91, 54, 34, 0.18);
  --soft-shadow: 0 12px 28px rgba(91, 54, 34, 0.12);
  --title-font: 'Kaiti SC', 'STKaiti', 'KaiTi', 'Songti SC', serif;
  --body-font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --audio-energy: 0;
  --audio-treble: 0;
  --audio-pulse: 0;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--body-font);
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 255, 255, 0.78), transparent 34%),
    radial-gradient(circle at 84% 18%, rgba(242, 195, 162, 0.42), transparent 30%),
    linear-gradient(180deg, #fbefe4 0%, #f1d5bf 54%, #d99f82 100%);
  overflow-x: clip;
}

button {
  border: 0;
  font: inherit;
  appearance: none;
}

img {
  max-width: 100%;
}

.letter-app {
  min-height: 100svh;
  padding:
    calc(10px + env(safe-area-inset-top, 0px))
    12px
    calc(16px + env(safe-area-inset-bottom, 0px));
}

.letter-page {
  width: min(100%, 390px);
  min-height: calc(100svh - 46px);
  margin: 0 auto;
  padding: 12px 12px 12px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.62), transparent 26%),
    linear-gradient(180deg, rgba(255, 247, 237, 0.88), rgba(246, 226, 207, 0.86));
  box-shadow: var(--shadow);
}

.letter-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 4px 6px;
  color: rgba(91, 61, 50, 0.72);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.letter-status p {
  margin: 0;
  min-width: 0;
}

.music-button {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 249, 241, 0.62);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(132, 92, 68, 0.12);
  font-size: 11.5px;
  white-space: nowrap;
}

.music-button[aria-pressed='true'] {
  background: rgba(255, 238, 212, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(220, 161, 104, 0.22),
    0 0 calc(8px + var(--audio-treble) * 18px) rgba(255, 214, 153, 0.42);
}

.letter-art-wrap {
  position: relative;
  height: clamp(442px, calc(100svh - 360px), 588px);
  margin: 0;
  overflow: hidden;
  border-radius: 26px;
  background: var(--paper-deep);
  box-shadow: var(--soft-shadow);
  isolation: isolate;
}

.letter-art {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(0.96) contrast(0.99);
}

.scene-glow {
  position: absolute;
  inset: -10%;
  z-index: 1;
  opacity: calc(0.22 + var(--audio-energy) * 0.22);
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 68% 20%, rgba(255, 231, 178, 0.32), transparent 26%),
    radial-gradient(circle at 26% 80%, rgba(255, 210, 182, 0.28), transparent 24%);
  transform: scale(calc(1 + var(--audio-pulse) * 0.035));
  filter: blur(calc(14px + var(--audio-treble) * 14px));
}

.scene-motion {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.scene-motion span {
  position: absolute;
  opacity: 0.72;
}

.scene-motion span:nth-child(1) { left: 16%; top: 18%; animation-delay: 0ms; }
.scene-motion span:nth-child(2) { left: 72%; top: 20%; animation-delay: 220ms; }
.scene-motion span:nth-child(3) { left: 24%; top: 66%; animation-delay: 440ms; }
.scene-motion span:nth-child(4) { left: 82%; top: 70%; animation-delay: 660ms; }
.scene-motion span:nth-child(5) { left: 48%; top: 36%; animation-delay: 880ms; }
.scene-motion span:nth-child(6) { left: 58%; top: 86%; animation-delay: 1100ms; }

.inline-note {
  position: absolute;
  z-index: 4;
  max-width: 45%;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 246, 235, 0.34);
}

.inline-note__label {
  margin: 0 0 6px;
  color: rgba(98, 60, 46, 0.9);
  font-size: 9.7px;
  letter-spacing: 0.16em;
}

.inline-note__copy {
  margin: 0;
  white-space: pre-line;
  font-family: var(--title-font);
  font-size: 15px;
  line-height: 1.65;
  color: rgba(62, 42, 34, 0.98);
}

.inline-note--margin-ink {
  left: auto;
  right: 3.2%;
  top: 6.5%;
  max-width: 28%;
  transform: rotate(2deg);
}

.inline-note--bookmark-note {
  left: auto;
  right: 6%;
  top: 10.2%;
  max-width: 31%;
  transform: rotate(3.2deg);
}

.inline-note--margin-ink,
.inline-note--bookmark-note {
  padding: 8px 10px 6px;
  border-radius: 16px 14px 15px 13px;
  background: linear-gradient(180deg, rgba(255, 249, 241, 0.78), rgba(245, 231, 218, 0.48));
  box-shadow:
    inset 0 0 0 1px rgba(134, 96, 72, 0.08),
    0 8px 16px rgba(111, 61, 38, 0.05);
  backdrop-filter: blur(0.32px);
}

.inline-note--margin-ink .inline-note__copy,
.inline-note--bookmark-note .inline-note__copy {
  font-size: 12.5px;
  line-height: 1.5;
}

.inline-note--flower-margin {
  right: 4.8%;
  top: 13.6%;
  max-width: 25%;
  transform: rotate(2deg);
}

.inline-note--chalk-note {
  left: 5.8%;
  top: 16.4%;
  max-width: 19%;
  padding: 6px 7px 5px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(38, 34, 32, 0.54), rgba(38, 34, 32, 0.3));
  box-shadow: inset 0 0 0 1px rgba(248, 243, 227, 0.1);
  color: rgba(247, 241, 225, 0.94);
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.12);
}

.inline-note--chalk-note .inline-note__label {
  color: rgba(245, 239, 222, 0.82);
}

.inline-note--lamp-note {
  left: 3.2%;
  top: 16%;
  max-width: 15%;
  transform: rotate(-2deg);
  color: rgba(93, 62, 44, 0.92);
}

.inline-note--red-ink-note {
  left: 4.6%;
  top: 13.8%;
  max-width: 18%;
  color: #a84c42;
  transform: rotate(-4deg);
  border-left: 1.5px solid rgba(178, 68, 58, 0.22);
  border-radius: 0 12px 12px 0;
}

.inline-note--red-ink-note::after {
  content: '';
  position: absolute;
  left: -10px;
  right: -8px;
  bottom: -8px;
  height: 38px;
  border: 2px solid rgba(178, 68, 58, 0.42);
  border-top: 0;
  border-radius: 50%;
  transform: rotate(4deg);
}

.inline-note--gift-tag {
  right: 3.9%;
  top: 13.5%;
  max-width: 16.5%;
  padding-left: 9px;
  border-left: 1px solid rgba(126, 84, 61, 0.18);
  transform: rotate(1.8deg);
}

.inline-note--seal-note {
  left: 4.2%;
  top: 13.8%;
  bottom: auto;
  max-width: 18%;
  transform: rotate(-1deg);
}

.inline-note--flower-margin,
.inline-note--lamp-note,
.inline-note--red-ink-note,
.inline-note--gift-tag,
.inline-note--seal-note {
  padding: 8px 10px 7px;
  border-radius: 15px 13px 15px 12px;
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.66), rgba(245, 231, 218, 0.32));
  box-shadow:
    inset 0 0 0 1px rgba(134, 96, 72, 0.08),
    0 8px 16px rgba(111, 61, 38, 0.04);
  backdrop-filter: blur(0.38px);
}

.inline-note--lamp-note,
.inline-note--gift-tag {
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.7), rgba(245, 231, 218, 0.38));
  box-shadow:
    inset 0 0 0 1px rgba(134, 96, 72, 0.08),
    0 10px 18px rgba(111, 61, 38, 0.06);
}

.inline-note--flower-margin .inline-note__copy,
.inline-note--lamp-note .inline-note__copy,
.inline-note--red-ink-note .inline-note__copy,
.inline-note--gift-tag .inline-note__copy,
.inline-note--seal-note .inline-note__copy {
  font-size: 12.8px;
  line-height: 1.5;
}

.inline-note--chalk-note .inline-note__copy,
.inline-note--lamp-note .inline-note__copy,
.inline-note--gift-tag .inline-note__copy {
  font-size: 11.4px;
  line-height: 1.44;
}

.inline-note--chalk-note .inline-note__copy {
  color: rgba(250, 244, 231, 0.98);
  font-size: 12.2px;
}

.inline-note--red-ink-note .inline-note__copy,
.inline-note--seal-note .inline-note__copy {
  font-size: 11.9px;
  line-height: 1.48;
}

.inline-note--red-ink-note {
  background: linear-gradient(90deg, rgba(255, 247, 241, 0.72), rgba(245, 231, 218, 0.22));
  box-shadow: none;
  backdrop-filter: blur(0.22px);
}

.inline-note--seal-note {
  background: linear-gradient(180deg, rgba(255, 248, 239, 0.74), rgba(245, 231, 218, 0.38));
}

.inline-note--gift-tag::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 11px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 249, 241, 0.96);
  box-shadow: inset 0 0 0 1px rgba(139, 96, 72, 0.18);
}

.letter-page[data-stage='gift-ribbon'] .letter-art-wrap::after {
  content: '把没说完的祝福，\A都藏进这一只礼盒里。';
  position: absolute;
  left: 29.5%;
  top: 11.2%;
  z-index: 3;
  width: 33%;
  color: rgba(118, 87, 73, 0.64);
  font-family: var(--title-font);
  font-size: 12.6px;
  line-height: 1.72;
  letter-spacing: 0.04em;
  white-space: pre-line;
  text-shadow: 0 1px 0 rgba(255, 244, 232, 0.68);
  transform: rotate(-7deg);
  pointer-events: none;
}

.interaction-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}

.guide-orb {
  position: absolute;
  left: var(--orb-left, 50%);
  top: var(--orb-top, 50%);
  width: var(--orb-size, 76px);
  height: var(--orb-size, 76px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.guide-orb__ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 246, 223, 0.1), rgba(255, 246, 223, 0) 70%);
  box-shadow:
    0 0 0 1px rgba(255, 250, 239, 0.3),
    0 0 0 6px rgba(255, 218, 176, 0.04),
    0 0 12px rgba(255, 216, 160, 0.18);
  animation: orb-breathe 2.1s ease-in-out infinite;
}

.guide-orb__label {
  position: absolute;
  left: 50%;
  bottom: -12px;
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 1px 6px 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.22), rgba(255, 248, 236, 0.04));
  color: rgba(120, 74, 55, 0.98);
  font-size: 11.2px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translateX(-50%);
  text-shadow: 0 1px 0 rgba(255, 247, 236, 0.72);
  box-shadow: none;
}

.interaction-layer.is-dragging .guide-orb {
  transform: translate(calc(-50% + var(--drag-progress, 0) * 22px), -50%);
}

.letter-page[data-complete='true'] .guide-orb {
  opacity: 0.2;
}

.collect-toast,
.save-toast {
  position: fixed;
  left: 50%;
  z-index: 60;
  max-width: calc(100% - 44px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 247, 236, 0.94);
  color: #9e5b43;
  font-size: 12px;
  box-shadow: 0 14px 30px rgba(91, 54, 34, 0.16);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.collect-toast {
  position: absolute;
  bottom: 22px;
}

.collect-toast.is-visible,
.save-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.save-toast {
  bottom: calc(22px + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
}

.letter-copy {
  padding: 14px 4px 6px;
}

.scene-theme,
.letter-copy h1,
.letter-copy p {
  margin: 0;
}

.scene-theme {
  color: #b96a4d;
  font-size: 12px;
  letter-spacing: 0.18em;
}

.letter-copy h1 {
  margin-top: 6px;
  font-family: var(--title-font);
  font-size: clamp(25px, 7vw, 32px);
  line-height: 1.3;
  letter-spacing: 0.03em;
}

.letter-copy #guideSubtext,
.scene-line {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.85;
}

.scene-line {
  color: #8d5942;
  font-family: var(--title-font);
}

.completion-line {
  min-height: 18px;
  margin-top: 8px !important;
  color: #b26446;
  font-size: 12px;
}

.letter-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 44px;
  border-radius: 18px;
}

.primary-button {
  flex: 1 1 auto;
  padding: 0 18px;
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(180deg, #d98c6b, #bd674c);
  color: #fffaf3;
  box-shadow: 0 14px 30px rgba(177, 87, 59, 0.2);
  font-size: 15px;
}

.primary-button:not(:disabled) {
  animation: button-breathe 2.8s ease-in-out infinite;
}

.primary-button:disabled {
  opacity: 0.46;
  box-shadow: none;
}

.secondary-button {
  width: 100%;
  padding: 0 16px;
  background: rgba(255, 248, 240, 0.66);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(126, 84, 61, 0.14);
}

.text-button {
  flex: 0 0 auto;
  min-width: auto;
  padding: 0 4px;
  background: transparent;
  color: rgba(91, 61, 50, 0.42);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.letter-progress {
  margin: 0 4px 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.letter-progress p {
  margin: 0 0 8px;
  color: rgba(91, 61, 50, 0.64);
  font-size: 12px;
}

.collection-trail {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 9px 8px;
  padding-inline: 2px;
}

.collection-mark {
  --mark-tilt: 0deg;
  position: relative;
  width: 16px;
  height: 13px;
  justify-self: center;
  opacity: 0.4;
  transform: rotate(var(--mark-tilt)) scale(0.88);
  transition: opacity 260ms ease, transform 260ms ease, filter 260ms ease;
}

.collection-mark::before,
.collection-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(179, 116, 88, 0.52);
}

.collection-mark::before {
  border-radius: 70% 30% 70% 30%;
  transform: rotate(45deg);
}

.collection-mark::after {
  inset: 4px;
  border-radius: 999px;
  background: rgba(255, 245, 219, 0.86);
}

.collection-mark.is-collected {
  opacity: 0.98;
  transform: rotate(var(--mark-tilt)) scale(1.04);
  filter: drop-shadow(0 4px 8px rgba(188, 125, 90, 0.26));
}

.collection-mark.is-fresh {
  animation: mark-pop 520ms ease-out both;
}

.collection-mark.is-waiting {
  opacity: 0.64;
  filter: drop-shadow(0 0 8px rgba(255, 206, 134, 0.58));
  animation: wait-glow 1.8s ease-in-out infinite;
}

.letter-page[data-progress-style='garden'] .collection-mark {
  width: 14px;
  height: 14px;
  opacity: 0.42;
}

.letter-page[data-progress-style='garden'] .collection-mark::before {
  border-radius: 64% 36% 66% 34%;
  transform: rotate(24deg);
  background: linear-gradient(180deg, rgba(227, 156, 138, 0.74), rgba(194, 118, 102, 0.42));
}

.letter-page[data-progress-style='garden'] .collection-mark::after {
  inset: 4px;
  border-radius: 999px;
  background: rgba(255, 244, 227, 0.7);
}

.letter-page[data-progress-style='garden'] .collection-mark.is-collected::before {
  background: linear-gradient(180deg, rgba(240, 173, 153, 0.98), rgba(210, 128, 109, 0.96));
}

.letter-page[data-progress-style='chalk'] .collection-mark::before {
  border-radius: 2px;
  background: rgba(241, 236, 219, 0.56);
  transform: rotate(-12deg);
}

.letter-page[data-progress-style='chalk'] .collection-mark {
  width: 19px;
  height: 8px;
  opacity: 0.54;
}

.letter-page[data-progress-style='chalk'] .collection-mark::after {
  inset: auto 1px -2px auto;
  width: 4px;
  height: 4px;
  background: rgba(245, 240, 224, 0.52);
}

.letter-page[data-progress-style='chalk'] .collection-mark.is-collected::before {
  background: rgba(245, 240, 224, 0.98);
  box-shadow: 0 2px 10px rgba(255, 246, 225, 0.24);
}

.letter-page[data-progress-style='chalk'] .collection-mark.is-collected::after {
  background: rgba(255, 248, 236, 0.92);
}

.letter-page[data-progress-style='paper'] .collection-mark {
  width: 17px;
  height: 12px;
}

.letter-page[data-progress-style='paper'] .collection-mark:nth-child(3n + 1) {
  --mark-tilt: -8deg;
}

.letter-page[data-progress-style='paper'] .collection-mark:nth-child(3n + 2) {
  --mark-tilt: -2deg;
}

.letter-page[data-progress-style='paper'] .collection-mark:nth-child(3n) {
  --mark-tilt: 7deg;
}

.letter-page[data-progress-style='paper'] .collection-mark::before {
  border-radius: 3px;
  transform: none;
  background: linear-gradient(180deg, rgba(243, 233, 220, 0.74), rgba(223, 203, 184, 0.5));
  box-shadow: inset 0 0 0 1px rgba(132, 89, 65, 0.05);
}

.letter-page[data-progress-style='paper'] .collection-mark::after {
  inset: auto 1px 1px auto;
  width: 5px;
  height: 5px;
  border-radius: 0;
  background: rgba(255, 251, 244, 0.74);
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.letter-page[data-progress-style='paper'] .collection-mark.is-collected::before {
  background: linear-gradient(180deg, rgba(245, 217, 180, 0.98), rgba(224, 176, 126, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(143, 91, 61, 0.16),
    0 4px 9px rgba(193, 140, 98, 0.18);
}

.letter-page[data-progress-style='paper'] .collection-mark.is-collected::after {
  background: rgba(255, 249, 240, 0.96);
}

.letter-page[data-progress-style='lamp'] .collection-mark::before,
.letter-page[data-progress-style='candle'] .collection-mark::before {
  border-radius: 52% 52% 44% 44%;
  background: rgba(240, 194, 118, 0.28);
}

.letter-page[data-progress-style='lamp'] .collection-mark,
.letter-page[data-progress-style='candle'] .collection-mark {
  width: 12px;
  height: 16px;
  opacity: 0.58;
}

.letter-page[data-progress-style='lamp'] .collection-mark::after,
.letter-page[data-progress-style='candle'] .collection-mark::after {
  inset: 4px 3px 3px;
  border-radius: 999px 999px 70% 70%;
  background: rgba(255, 242, 214, 0.6);
}

.letter-page[data-progress-style='lamp'] .collection-mark.is-collected::before,
.letter-page[data-progress-style='candle'] .collection-mark.is-collected::before {
  background: linear-gradient(180deg, rgba(255, 221, 144, 0.98), rgba(235, 171, 88, 0.94));
  box-shadow: 0 0 12px rgba(255, 207, 120, 0.32);
}

.letter-page[data-progress-style='lamp'] .collection-mark.is-collected::after,
.letter-page[data-progress-style='candle'] .collection-mark.is-collected::after {
  background: rgba(255, 247, 228, 0.94);
}

.letter-page[data-progress-style='gift'] .collection-mark::before {
  border-radius: 4px;
  background: rgba(211, 170, 149, 0.52);
  transform: rotate(0deg);
}

.letter-page[data-progress-style='seal'] .collection-mark::before {
  border-radius: 999px;
  background: rgba(180, 122, 108, 0.38);
  transform: none;
}

.letter-page[data-progress-style='gift'] .collection-mark {
  width: 16px;
  height: 14px;
  opacity: 0.56;
  outline: 1px dashed rgba(197, 142, 120, 0.42);
  outline-offset: 1px;
}

.letter-page[data-progress-style='gift'] .collection-mark::after {
  inset: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 245, 234, 0.58) 44%, rgba(255, 245, 234, 0.58) 56%, transparent 56%),
    linear-gradient(180deg, transparent 44%, rgba(255, 245, 234, 0.58) 44%, rgba(255, 245, 234, 0.58) 56%, transparent 56%);
}

.letter-page[data-progress-style='gift'] .collection-mark.is-collected::before {
  background: linear-gradient(180deg, rgba(236, 198, 176, 0.98), rgba(208, 138, 112, 0.94));
}

.letter-page[data-progress-style='gift'] .collection-mark.is-collected::after {
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 246, 238, 0.84) 44%, rgba(255, 246, 238, 0.84) 56%, transparent 56%),
    linear-gradient(180deg, transparent 44%, rgba(255, 246, 238, 0.84) 44%, rgba(255, 246, 238, 0.84) 56%, transparent 56%);
}

.letter-page[data-progress-style='gift'] .collection-mark.is-collected {
  outline: none;
  filter: drop-shadow(0 4px 10px rgba(193, 140, 98, 0.28));
}

.letter-page[data-progress-style='gift'] .collection-mark.is-waiting::before {
  background: linear-gradient(180deg, rgba(239, 210, 193, 0.84), rgba(210, 159, 134, 0.68));
}

.letter-page[data-progress-style='gift'] .collection-mark.is-waiting::after {
  background:
    linear-gradient(90deg, transparent 44%, rgba(255, 248, 241, 0.82) 44%, rgba(255, 248, 241, 0.82) 56%, transparent 56%),
    linear-gradient(180deg, transparent 44%, rgba(255, 248, 241, 0.82) 44%, rgba(255, 248, 241, 0.82) 56%, transparent 56%);
}

.letter-page[data-progress-style='gift'] .collection-mark.is-waiting {
  opacity: 0.82;
  outline-color: rgba(197, 142, 120, 0.56);
}

.letter-page[data-progress-style='seal'] .collection-mark {
  width: 14px;
  height: 14px;
  opacity: 0.46;
}

.letter-page[data-progress-style='seal'] .collection-mark::after {
  inset: 4px;
  background: rgba(255, 241, 232, 0.2);
}

.letter-page[data-progress-style='seal'] .collection-mark.is-collected::before {
  background: linear-gradient(180deg, rgba(202, 112, 93, 0.96), rgba(157, 71, 58, 0.94));
  box-shadow: 0 4px 8px rgba(157, 71, 58, 0.18);
}

.letter-page[data-progress-style='seal'] .collection-mark.is-collected::after {
  background: rgba(255, 233, 220, 0.42);
}

.letter-page[data-progress-style='seal'] .collection-mark.is-waiting::before {
  background: rgba(199, 145, 130, 0.68);
  box-shadow:
    inset 0 0 0 1px rgba(154, 89, 74, 0.2),
    0 0 10px rgba(219, 163, 144, 0.16);
}

.letter-page[data-progress-style='seal'] .collection-mark.is-waiting::after {
  background: rgba(255, 238, 229, 0.4);
}

.letter-page[data-progress-style='seal'] .collection-mark.is-waiting {
  opacity: 0.76;
  outline: 1px dashed rgba(167, 106, 90, 0.4);
  outline-offset: 1px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 255, 255, 0.72), transparent 32%),
    linear-gradient(180deg, #fbefe3, #efd1bb);
  transition: opacity 320ms ease, visibility 320ms ease;
}

.loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-card {
  width: min(100%, 310px);
  padding: 30px 24px;
  border-radius: 30px;
  background: rgba(255, 247, 237, 0.9);
  text-align: center;
  box-shadow: var(--shadow);
}

.loading-card p,
.loading-card h1 {
  margin: 0;
}

.loading-card p {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.18em;
}

.loading-card h1 {
  margin-top: 12px;
  font-family: var(--title-font);
  font-size: 28px;
  line-height: 1.4;
}

.loading-petals {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.loading-petals span {
  width: 11px;
  height: 17px;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(180deg, #efb09c, #d3846d);
  animation: petal-bob 1.4s ease-in-out infinite;
}

.loading-petals span:nth-child(2) { animation-delay: 140ms; }
.loading-petals span:nth-child(3) { animation-delay: 280ms; }

.finale-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding:
    calc(12px + env(safe-area-inset-top, 0px))
    12px
    calc(18px + env(safe-area-inset-bottom, 0px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.finale-overlay[hidden] {
  display: none;
}

.finale-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.finale-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(63, 38, 28, 0.48);
  backdrop-filter: blur(8px);
}

.finale-card {
  position: relative;
  z-index: 1;
  width: min(100%, 390px);
  max-height: calc(100svh - 28px);
  overflow-y: auto;
  padding: 108px 14px 18px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 14% 10%, rgba(255, 255, 255, 0.54), transparent 26%),
    linear-gradient(180deg, #f8e8d6, #edcfb7);
  box-shadow: var(--shadow);
}

.finale-card::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 56px;
  width: min(82%, 292px);
  height: 92px;
  border-radius: 24px 24px 28px 28px;
  background:
    linear-gradient(180deg, rgba(224, 192, 161, 0.42), rgba(214, 173, 137, 0.24)),
    linear-gradient(135deg, rgba(255, 248, 238, 0.2), transparent 44%);
  clip-path: polygon(0 0, 100% 0, 100% 86%, 50% 100%, 0 86%);
  transform: translateX(-50%);
  box-shadow: 0 10px 18px rgba(91, 54, 34, 0.08);
  pointer-events: none;
}

.finale-envelope {
  position: absolute;
  top: 16px;
  left: 50%;
  width: min(82%, 286px);
  height: 132px;
  transform: translateX(-50%);
  perspective: 800px;
  pointer-events: none;
}

.finale-envelope__back,
.finale-envelope__flap,
.finale-envelope__seal {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.finale-envelope__back {
  bottom: 0;
  width: 100%;
  height: 88px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(233, 200, 166, 0.9), rgba(214, 166, 125, 0.82));
  box-shadow: 0 12px 22px rgba(91, 54, 34, 0.12);
}

.finale-envelope__back::before {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 62%;
  clip-path: polygon(0 100%, 0 12%, 50% 70%, 100% 12%, 100% 100%);
  background: linear-gradient(135deg, #e1b98f, #d09b72);
}

.finale-envelope__back::after {
  content: '';
  position: absolute;
  inset: 10px 16px auto;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 249, 241, 0.16);
  filter: blur(8px);
}

.finale-envelope__flap {
  bottom: 38px;
  width: 100%;
  height: 100px;
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  background: linear-gradient(180deg, #f2d9bb, #ddb187);
  transform-origin: center bottom;
  transition: transform 840ms cubic-bezier(0.24, 0.82, 0, 1);
}

.finale-envelope__seal {
  bottom: 30px;
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd4c1, #b94f43 72%);
  color: #fff7ef;
  font-family: var(--title-font);
  font-size: 20px;
  transition: opacity 500ms ease, transform 500ms ease;
}

.finale-card.is-letter-open .finale-envelope__flap {
  transform: translateX(-50%) rotateX(176deg);
}

.finale-card.is-letter-open .finale-envelope__seal {
  opacity: 0;
  transform: translateX(-50%) translateY(16px) scale(0.82);
}

.finale-letter {
  position: relative;
  padding: 28px 18px 28px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.58), transparent 26%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(247, 232, 215, 0.98)),
    repeating-linear-gradient(180deg, rgba(126, 84, 61, 0.035) 0 1px, transparent 1px 31px);
  border: 1px solid rgba(140, 95, 68, 0.12);
  box-shadow: 0 18px 34px rgba(91, 54, 34, 0.12);
}

.finale-letter__eyebrow,
.finale-letter__title,
.finale-letter__lead,
.finale-letter__paragraph,
.finale-letter__signature {
  margin: 0;
}

.finale-letter__eyebrow {
  color: var(--ink-soft);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.finale-letter__title {
  margin-top: 13px;
  font-family: var(--title-font);
  font-size: clamp(29px, 7.2vw, 34px);
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.finale-letter__title span {
  display: block;
  white-space: nowrap;
}

.finale-letter__lead,
.finale-letter__paragraphs {
  margin-top: 18px;
}

.finale-letter__lead p,
.finale-letter__paragraph {
  font-family: 'Songti SC', 'STSong', serif;
  font-size: 15px;
  line-height: 1.95;
}

.finale-letter__lead span,
.finale-letter__paragraph span {
  display: block;
}

.finale-letter__paragraphs {
  display: grid;
  gap: 13px;
}

.finale-letter__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 11px 10px;
  margin-top: 22px;
}

.finale-flower-letter {
  --flower-tag-tilt: 0deg;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 8px 10px 8px 11px;
  background: linear-gradient(180deg, rgba(244, 226, 204, 0.7), rgba(231, 205, 176, 0.42));
  border: 1px solid rgba(126, 84, 61, 0.08);
  color: rgba(91, 61, 50, 0.74);
  font-size: 11px;
  letter-spacing: 0.02em;
  box-shadow: 0 1px 2px rgba(91, 54, 34, 0.04);
  transform: rotate(var(--flower-tag-tilt));
}

.finale-flower-letter:nth-child(4n + 1) {
  --flower-tag-tilt: -3deg;
}

.finale-flower-letter:nth-child(4n + 2) {
  --flower-tag-tilt: -1deg;
}

.finale-flower-letter:nth-child(4n + 3) {
  --flower-tag-tilt: 2deg;
}

.finale-flower-letter:nth-child(4n) {
  --flower-tag-tilt: 3deg;
}

.finale-note {
  position: relative;
  margin-top: 24px;
  padding: 13px 14px 14px;
  color: #a64e43;
  transform: rotate(-0.8deg);
}

.finale-note::before {
  content: '';
  position: absolute;
  left: 6px;
  right: 10px;
  bottom: 4px;
  height: 42px;
  border: 2px solid rgba(176, 68, 58, 0.34);
  border-top-color: transparent;
  border-right-color: rgba(176, 68, 58, 0.24);
  border-radius: 49% 51% 47% 53% / 46% 44% 56% 54%;
  transform: rotate(-2.8deg);
}

.finale-note::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 6px;
  bottom: 8px;
  height: 34px;
  border: 1.5px solid rgba(176, 68, 58, 0.26);
  border-top-color: transparent;
  border-left-color: rgba(176, 68, 58, 0.18);
  border-radius: 54% 46% 51% 49% / 42% 48% 52% 58%;
  transform: rotate(3.2deg);
}

.finale-note__label,
.finale-note__copy {
  margin: 0;
}

.finale-note__label {
  font-size: 12px;
  letter-spacing: 0.08em;
}

.finale-note__copy {
  margin-top: 6px;
  font-family: var(--title-font);
  font-size: 18px;
}

.finale-letter__signature {
  margin-top: 28px;
  padding-top: 16px;
  font-family: var(--title-font);
  font-size: 14.5px;
  line-height: 1.95;
  color: rgba(108, 72, 55, 0.78);
  text-align: right;
  border-top: 1px solid rgba(144, 102, 79, 0.12);
}

.finale-letter__signature-line {
  display: block;
}

.finale-letter__signature-line + .finale-letter__signature-line {
  margin-top: 2px;
}

.finale-actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.primary-button--wide {
  width: 100%;
}

.finale-overlay.is-save-mode {
  position: absolute;
  min-height: 100svh;
  display: block;
  overflow: visible;
  padding:
    calc(10px + env(safe-area-inset-top, 0px))
    10px
    calc(32px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #fbefe3, #efd1bb);
}

.finale-overlay.is-save-mode .finale-overlay__backdrop,
.finale-overlay.is-save-mode .finale-envelope,
.finale-overlay.is-save-mode .finale-actions,
.finale-overlay.is-save-mode .finale-card::before {
  display: none;
}

.finale-overlay.is-save-mode .finale-card {
  width: min(100%, 390px);
  max-height: none;
  margin: 0 auto;
  overflow: visible;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

body.is-save-mode .save-toast {
  top: calc(10px + env(safe-area-inset-top, 0px));
  bottom: auto;
  padding: 9px 13px;
  background: rgba(255, 248, 239, 0.92);
  color: rgba(141, 87, 62, 0.96);
  box-shadow: 0 8px 18px rgba(91, 54, 34, 0.12);
}

body.is-save-mode .letter-app,
body.is-save-mode .letter-status,
body.is-save-mode .letter-progress,
body.is-save-mode .letter-action-row,
body.is-save-mode .music-button,
body.is-save-mode .guide-orb {
  display: none !important;
}

.letter-page[data-stage='opening-letter'] .guide-orb,
.letter-page[data-stage='unfurling-pages'] .guide-orb {
  width: calc(var(--orb-size, 76px) * 0.64);
  height: calc(var(--orb-size, 76px) * 0.64);
}

.letter-page[data-stage='opening-letter'] .guide-orb__ring,
.letter-page[data-stage='unfurling-pages'] .guide-orb__ring {
  background: radial-gradient(circle, rgba(255, 247, 230, 0.16), rgba(255, 247, 230, 0) 70%);
  box-shadow:
    0 0 0 1px rgba(255, 248, 235, 0.36),
    0 0 0 6px rgba(255, 220, 186, 0.08),
    0 0 14px rgba(255, 216, 168, 0.24);
}

.letter-page[data-stage='opening-letter'] .guide-orb__ring::after,
.letter-page[data-stage='unfurling-pages'] .guide-orb__ring::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 243, 224, 0.94);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 14px rgba(255, 220, 181, 0.52);
  animation: guide-pulse 2.4s ease-in-out infinite;
}

.letter-page[data-stage='opening-letter'] .guide-orb__label,
.letter-page[data-stage='unfurling-pages'] .guide-orb__label {
  bottom: -12px;
  min-height: auto;
  padding: 1px 6px 2px;
  background: linear-gradient(180deg, rgba(255, 248, 236, 0.18), rgba(255, 248, 236, 0.04));
  color: rgba(124, 74, 54, 0.98);
  font-size: 11px;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 0 rgba(255, 247, 236, 0.76);
  box-shadow: none;
  animation: guide-whisper 2.6s ease-in-out infinite;
}

.letter-page[data-stage='opening-letter'] .guide-orb__label::before,
.letter-page[data-stage='unfurling-pages'] .guide-orb__label::before {
  content: '·';
  margin-right: 4px;
  color: rgba(213, 152, 117, 0.94);
}

.letter-page[data-stage='opening-letter'] .letter-copy h1,
.letter-page[data-stage='unfurling-pages'] .letter-copy h1 {
  font-size: clamp(23px, 6.5vw, 29px);
  line-height: 1.26;
}

.letter-page[data-stage='unfurling-pages'] .guide-orb {
  width: calc(var(--orb-size, 76px) * 0.56);
  height: calc(var(--orb-size, 76px) * 0.56);
}

.letter-page[data-stage='unfurling-pages'] .guide-orb__ring {
  background: none;
  box-shadow: none;
}

.letter-page[data-stage='unfurling-pages'] .guide-orb__label {
  background: none;
  padding: 0;
  bottom: -8px;
  color: rgba(126, 78, 57, 0.98);
  text-shadow:
    0 1px 0 rgba(255, 248, 237, 0.82),
    0 0 10px rgba(255, 232, 193, 0.22);
}

.letter-page[data-stage='fragrance-drift'] .guide-orb,
.letter-page[data-stage='at-the-desk'] .guide-orb,
.letter-page[data-stage='bubu-cheer-beat'] .guide-orb,
.letter-page[data-stage='candle-glow'] .guide-orb,
.letter-page[data-stage='gift-ribbon'] .guide-orb,
.letter-page[data-stage='final-wish'] .guide-orb {
  width: calc(var(--orb-size, 76px) * 0.66);
  height: calc(var(--orb-size, 76px) * 0.66);
}

.letter-page[data-stage='fragrance-drift'] .guide-orb__label,
.letter-page[data-stage='gift-ribbon'] .guide-orb__label,
.letter-page[data-stage='final-wish'] .guide-orb__label {
  background: linear-gradient(180deg, rgba(255, 247, 238, 0.24), rgba(255, 247, 238, 0.04));
  color: rgba(126, 79, 61, 0.98);
}

.letter-page[data-stage='at-the-desk'] .guide-orb__ring {
  inset: 12% 8% 8% 12%;
  background: none;
  border-top: 1px solid rgba(245, 240, 224, 0.48);
  border-right: 1px solid rgba(245, 240, 224, 0.34);
  border-radius: 0 18px 0 0;
  box-shadow: 8px -6px 12px rgba(255, 245, 227, 0.08);
}

.letter-page[data-stage='at-the-desk'] .guide-orb__label {
  background: linear-gradient(180deg, rgba(35, 42, 41, 0.14), rgba(35, 42, 41, 0.04));
  color: rgba(247, 240, 221, 0.98);
  text-shadow: none;
}

.letter-page[data-stage='bubu-cheer-beat'] .guide-orb__ring,
.letter-page[data-stage='candle-glow'] .guide-orb__ring {
  background: radial-gradient(circle, rgba(255, 232, 176, 0.16), rgba(255, 232, 176, 0) 70%);
  box-shadow:
    0 0 0 1px rgba(255, 239, 208, 0.34),
    0 0 0 7px rgba(255, 214, 145, 0.06),
    0 0 15px rgba(255, 205, 111, 0.2);
}

.letter-page[data-stage='bubu-cheer-beat'] .guide-orb__label,
.letter-page[data-stage='candle-glow'] .guide-orb__label {
  background: linear-gradient(180deg, rgba(255, 249, 237, 0.38), rgba(255, 249, 237, 0.12));
  color: rgba(132, 81, 53, 0.99);
}

.letter-page[data-stage='gift-ribbon'] .guide-orb {
  width: calc(var(--orb-size, 76px) * 0.78);
  height: calc(var(--orb-size, 76px) * 0.78);
}

.letter-page[data-stage='gift-ribbon'] .guide-orb__ring {
  background: radial-gradient(circle, rgba(255, 233, 187, 0.22), rgba(255, 233, 187, 0) 72%);
  box-shadow:
    0 0 0 1px rgba(255, 244, 221, 0.66),
    0 0 0 10px rgba(247, 194, 165, 0.12),
    0 0 18px rgba(255, 208, 147, 0.34);
}

.letter-page[data-stage='gift-ribbon'] .guide-orb__label {
  top: 50%;
  bottom: auto;
  min-height: 22px;
  padding: 2px 9px;
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.88), rgba(255, 241, 228, 0.54));
  color: rgba(126, 77, 56, 0.99);
  box-shadow:
    0 6px 14px rgba(135, 84, 58, 0.12),
    0 0 14px rgba(255, 230, 187, 0.24);
  transform: translate(-50%, -50%);
}

.letter-page[data-stage='fragrance-drift'] .guide-orb__label {
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.34), rgba(255, 241, 228, 0.08));
}

.letter-page[data-stage='final-wish'] .guide-orb__label {
  background: linear-gradient(180deg, rgba(255, 248, 238, 0.34), rgba(255, 241, 228, 0.1));
}

.letter-page[data-stage='fragrance-drift'] .letter-art-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 8% 18%, rgba(249, 238, 226, 0.32), transparent 22%),
    radial-gradient(circle at 92% 16%, rgba(249, 238, 226, 0.28), transparent 20%),
    linear-gradient(90deg, rgba(249, 238, 226, 0.12), transparent 16%, transparent 84%, rgba(249, 238, 226, 0.12));
}

.letter-page[data-stage='bubu-cheer-beat'] .letter-art-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 74% 74%, rgba(248, 236, 218, 0.56), transparent 25%),
    radial-gradient(circle at 50% 16%, rgba(248, 236, 218, 0.28), transparent 30%),
    linear-gradient(180deg, rgba(246, 231, 213, 0.12), rgba(246, 231, 213, 0.06));
}

.letter-page[data-stage='final-wish'] .letter-art-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 74% 64%, rgba(248, 238, 224, 0.46), transparent 24%),
    radial-gradient(circle at 82% 82%, rgba(248, 238, 224, 0.22), transparent 18%),
    linear-gradient(90deg, rgba(248, 238, 224, 0.1), transparent 22%);
}

.letter-page[data-stage='bubu-cheer-beat'] .letter-art {
  transform: scale(0.89);
  transform-origin: center center;
  filter: saturate(0.68) contrast(0.97) brightness(0.985) sepia(0.05);
}

.letter-page[data-stage='final-wish'] .letter-art {
  transform: scale(0.936);
  transform-origin: center center;
  filter: saturate(0.76) contrast(0.98) brightness(0.992);
}

.letter-page[data-stage='final-wish'] .scene-motion span {
  opacity: 0.38;
}

.letter-page[data-stage='final-wish'] .letter-copy h1 {
  font-size: clamp(21px, 5.9vw, 28px);
  line-height: 1.28;
}

.review-mode {
  min-height: 100svh;
  width: min(100%, 880px);
  margin: 0 auto;
  padding: 24px 14px calc(36px + env(safe-area-inset-bottom, 0px));
}

.review-mode header {
  margin-bottom: 16px;
}

.review-mode p,
.review-mode h1 {
  margin: 0;
}

.review-mode h1 {
  font-family: var(--title-font);
  font-size: 32px;
}

.review-list {
  display: grid;
  gap: 14px;
}

.review-card {
  padding: 18px;
  border-radius: 20px;
  background: rgba(255, 248, 238, 0.82);
  box-shadow: var(--soft-shadow);
}

.review-card__kicker {
  color: #a45d43;
  font-size: 12px;
}

.review-card h2 {
  margin: 6px 0 12px;
  font-family: var(--title-font);
  font-size: 24px;
}

.review-card dl {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 12px;
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
}

.review-card dt {
  color: rgba(91, 61, 50, 0.58);
}

.review-card dd {
  margin: 0;
}

.letter-page[data-stage='opening-letter'] .scene-motion span,
.letter-page[data-stage='unfurling-pages'] .scene-motion span {
  width: 92px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 239, 211, 0.84), transparent);
  animation: paper-sheen 4.8s ease-in-out infinite;
}

.letter-page[data-stage='fragrance-drift'] .scene-motion span {
  width: 16px;
  height: 12px;
  border-radius: 70% 30% 70% 30%;
  background: linear-gradient(180deg, rgba(238, 166, 148, 0.88), rgba(214, 122, 104, 0.74));
  animation: petal-drift 6s linear infinite;
}

.letter-page[data-stage='at-the-desk'] .scene-motion span {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: rgba(248, 242, 225, 0.82);
  animation: chalk-float 5.2s ease-in-out infinite;
}

.letter-page[data-stage='bubu-cheer-beat'] .scene-motion span {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 218, 129, 0.82);
  box-shadow: 0 0 12px rgba(255, 207, 109, 0.72);
  animation: light-twinkle 2.4s ease-in-out infinite;
}

.letter-page[data-stage='candle-glow'] .scene-motion span {
  width: 8px;
  height: 14px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(180deg, rgba(255, 244, 199, 0.98), rgba(238, 161, 84, 0.84));
  animation: ember-rise 3.4s linear infinite;
}

.letter-page[data-stage='gift-ribbon'] .scene-motion span {
  width: 76px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(246, 194, 172, 0.84), transparent);
  animation: ribbon-sheen 4.2s ease-in-out infinite;
}

.letter-page[data-stage='final-wish'] .scene-motion span {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 225, 177, 0.72);
  box-shadow: 0 0 14px rgba(255, 218, 156, 0.76);
  animation: firefly-float 4.2s ease-in-out infinite;
}

@keyframes orb-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes guide-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(0.88); opacity: 0.82; }
  50% { transform: translate(-50%, -50%) scale(1.14); opacity: 1; }
}

@keyframes guide-whisper {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.88; }
  50% { transform: translateX(-50%) translateY(-1px); opacity: 1; }
}

@keyframes button-breathe {
  0%, 100% { transform: translateY(0); box-shadow: 0 14px 30px rgba(177, 87, 59, 0.2); }
  50% { transform: translateY(-1px); box-shadow: 0 17px 34px rgba(177, 87, 59, 0.26); }
}

@keyframes mark-pop {
  0% { transform: scale(0.3); opacity: 0; }
  70% { transform: scale(1.14); opacity: 1; }
  100% { transform: scale(1); opacity: 0.94; }
}

@keyframes wait-glow {
  0%, 100% { transform: scale(0.9); }
  50% { transform: scale(1.08); }
}

@keyframes petal-bob {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-6px) rotate(8deg); }
}

@keyframes paper-sheen {
  0%, 100% { transform: translate3d(-18px, 0, 0) rotate(-10deg); opacity: 0.12; }
  50% { transform: translate3d(18px, -8px, 0) rotate(-10deg); opacity: 0.82; }
}

@keyframes petal-drift {
  0% { transform: translate3d(0, -14px, 0) rotate(0deg); opacity: 0; }
  16% { opacity: 0.78; }
  100% { transform: translate3d(24px, 126px, 0) rotate(220deg); opacity: 0; }
}

@keyframes chalk-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.82); opacity: 0.22; }
  50% { transform: translate3d(10px, -12px, 0) scale(1.12); opacity: 0.78; }
}

@keyframes light-twinkle {
  0%, 100% { transform: scale(0.82); opacity: 0.32; }
  50% { transform: scale(1.22); opacity: 0.95; }
}

@keyframes ember-rise {
  0% { transform: translate3d(0, 0, 0) scale(0.7); opacity: 0; }
  22% { opacity: 0.9; }
  100% { transform: translate3d(8px, -82px, 0) scale(1.1); opacity: 0; }
}

@keyframes ribbon-sheen {
  0%, 100% { transform: translate3d(-14px, 0, 0) rotate(-12deg) scaleX(0.72); opacity: 0.14; }
  50% { transform: translate3d(18px, -6px, 0) rotate(-12deg) scaleX(1.12); opacity: 0.82; }
}

@keyframes firefly-float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(0.8); opacity: 0.28; }
  50% { transform: translate3d(10px, -14px, 0) scale(1.2); opacity: 0.92; }
}

@media (max-width: 420px) {
  .letter-app {
    padding:
      calc(8px + env(safe-area-inset-top, 0px))
      8px
      calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .letter-page {
    padding: 10px 10px 14px;
    border-radius: 28px;
  }

  .letter-status {
    font-size: 11px;
  }

  .music-button {
    padding-inline: 8px;
    font-size: 10px;
  }

  .letter-art-wrap {
    height: clamp(434px, calc(100svh - 364px), 568px);
    border-radius: 24px;
  }

  .inline-note__copy {
    font-size: 14px;
  }

  .letter-copy h1 {
    font-size: clamp(24px, 6.8vw, 30px);
  }

  .finale-card {
    padding: 104px 12px 16px;
  }

  .finale-letter {
    padding: 26px 16px 20px;
  }

  .finale-letter__title {
    font-size: clamp(27px, 7vw, 31px);
  }
}

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