:root {
  --ink: #59453f;
  --muted: #8a746e;
  --paper: #fff8ea;
  --paper-deep: #f0dfc2;
  --rose: #bd6f77;
  --plum: #6e4d63;
  --teal: #406f69;
  --gold: #c79645;
  --shadow: rgba(62, 35, 28, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #201c24;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Serif SC", serif;
  background:
    radial-gradient(circle at 14% 16%, rgba(240, 202, 135, 0.34), transparent 26rem),
    radial-gradient(circle at 78% 8%, rgba(96, 154, 145, 0.28), transparent 24rem),
    linear-gradient(135deg, #33242e 0%, #5e3f4a 36%, #2f4d4a 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 246, 218, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 246, 218, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 72%, rgba(255, 212, 143, 0.18) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 28%, rgba(177, 235, 222, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 54% 84%, rgba(235, 156, 176, 0.18) 0 1px, transparent 2px);
  background-size: 92px 92px, 118px 118px, 76px 76px;
  opacity: 0.72;
}

.scene {
  position: relative;
  display: grid;
  min-height: 100vh;
  padding: 56px 18px;
  place-items: center;
  isolation: isolate;
}

.ambient {
  position: fixed;
  width: 22rem;
  height: 22rem;
  border-radius: 999px;
  filter: blur(16px);
  opacity: 0.42;
  pointer-events: none;
}

.ambient-one {
  top: 8%;
  left: -8rem;
  background: radial-gradient(circle, rgba(255, 207, 132, 0.55), transparent 66%);
}

.ambient-two {
  right: -7rem;
  bottom: 10%;
  background: radial-gradient(circle, rgba(104, 181, 167, 0.48), transparent 67%);
}

.ambient-three {
  left: 35%;
  bottom: -12rem;
  background: radial-gradient(circle, rgba(194, 106, 126, 0.38), transparent 70%);
}

.aurora {
  position: fixed;
  z-index: -1;
  width: 74vw;
  height: 32vh;
  min-height: 230px;
  border-radius: 50%;
  filter: blur(24px);
  opacity: 0.44;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: auroraMove 12s ease-in-out infinite alternate;
}

.aurora-one {
  top: 8%;
  left: -18vw;
  background:
    radial-gradient(ellipse at 18% 50%, rgba(253, 202, 126, 0.45), transparent 34%),
    radial-gradient(ellipse at 58% 44%, rgba(105, 191, 174, 0.35), transparent 38%),
    radial-gradient(ellipse at 88% 58%, rgba(205, 116, 147, 0.32), transparent 34%);
  transform: rotate(-12deg);
}

.aurora-two {
  right: -24vw;
  bottom: 4%;
  background:
    radial-gradient(ellipse at 22% 54%, rgba(184, 116, 167, 0.34), transparent 36%),
    radial-gradient(ellipse at 62% 46%, rgba(246, 207, 134, 0.28), transparent 42%),
    radial-gradient(ellipse at 84% 58%, rgba(101, 177, 176, 0.4), transparent 32%);
  animation-delay: -5s;
  transform: rotate(16deg);
}

.constellation {
  position: fixed;
  z-index: 0;
  width: 220px;
  height: 260px;
  pointer-events: none;
  opacity: 0.45;
}

.constellation::before,
.constellation::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, #fff0b7 0 2px, transparent 3px),
    radial-gradient(circle at 62% 30%, #cdeee6 0 2px, transparent 3px),
    radial-gradient(circle at 44% 66%, #ffe7a0 0 2px, transparent 3px),
    radial-gradient(circle at 82% 78%, #f0c2ce 0 2px, transparent 3px);
}

.constellation::after {
  inset: 38px 18px;
  border-top: 1px solid rgba(255, 232, 169, 0.24);
  border-right: 1px solid rgba(205, 238, 230, 0.2);
  border-bottom: 1px solid rgba(255, 232, 169, 0.18);
  transform: skew(-18deg) rotate(18deg);
}

.constellation-left {
  top: 18%;
  left: 5%;
}

.constellation-right {
  right: 6%;
  bottom: 13%;
  transform: scale(0.85) rotate(18deg);
}

.zodiac {
  position: fixed;
  z-index: 0;
  width: 180px;
  height: 180px;
  pointer-events: none;
  opacity: 0.62;
}

.zodiac-title {
  position: absolute;
  color: rgba(255, 234, 184, 0.72);
  font-size: 0.86rem;
  text-shadow: 0 0 14px rgba(255, 218, 142, 0.5);
}

.zodiac i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff2bd;
  box-shadow: 0 0 14px rgba(255, 238, 181, 0.86), 0 0 28px rgba(132, 221, 205, 0.28);
}

.zodiac::before,
.zodiac::after {
  content: "";
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 238, 181, 0.68), rgba(255, 238, 181, 0.04));
  transform-origin: left center;
}

.zodiac-sagittarius {
  top: 13%;
  right: 14%;
}

.zodiac-sagittarius .zodiac-title {
  right: 4px;
  top: 0;
}

.zodiac-sagittarius i:nth-of-type(1) { left: 20px; top: 122px; }
.zodiac-sagittarius i:nth-of-type(2) { left: 56px; top: 94px; }
.zodiac-sagittarius i:nth-of-type(3) { left: 94px; top: 58px; }
.zodiac-sagittarius i:nth-of-type(4) { left: 128px; top: 34px; }
.zodiac-sagittarius i:nth-of-type(5) { left: 126px; top: 84px; }

.zodiac-sagittarius::before {
  left: 22px;
  top: 124px;
  width: 142px;
  transform: rotate(-38deg);
}

.zodiac-sagittarius::after {
  left: 94px;
  top: 60px;
  width: 62px;
  transform: rotate(56deg);
}

.zodiac-leo {
  left: 10%;
  bottom: 19%;
  transform: rotate(-10deg);
}

.zodiac-leo .zodiac-title {
  left: 8px;
  bottom: 0;
}

.zodiac-leo i:nth-of-type(1) { left: 34px; top: 78px; }
.zodiac-leo i:nth-of-type(2) { left: 70px; top: 48px; }
.zodiac-leo i:nth-of-type(3) { left: 116px; top: 58px; }
.zodiac-leo i:nth-of-type(4) { left: 132px; top: 104px; }
.zodiac-leo i:nth-of-type(5) { left: 82px; top: 126px; }

.zodiac-leo::before {
  left: 36px;
  top: 80px;
  width: 100px;
  transform: rotate(-16deg);
}

.zodiac-leo::after {
  left: 80px;
  top: 126px;
  width: 78px;
  transform: rotate(-56deg);
}

.letter-wrap {
  position: relative;
  width: min(760px, 100%);
  padding: 58px 18px 26px;
}

.top-string {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 4;
  display: flex;
  width: min(520px, 78vw);
  height: 92px;
  justify-content: space-between;
  transform: translateX(-50%);
  pointer-events: none;
}

.top-string::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 3%;
  width: 94%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(246, 217, 160, 0.76), transparent);
}

.top-string > span {
  position: relative;
  display: block;
  width: 34px;
  height: 66px;
}

.top-string > span::before {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  width: 1px;
  height: 28px;
  background: rgba(250, 222, 173, 0.8);
}

.star-charm::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 0;
  width: 22px;
  height: 22px;
  background: var(--gold);
  clip-path: polygon(50% 0%, 62% 35%, 100% 38%, 69% 59%, 79% 96%, 50% 74%, 21% 96%, 31% 59%, 0 38%, 38% 35%);
  box-shadow: 0 4px 18px rgba(255, 218, 126, 0.58);
}

.moon-charm::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 0;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  box-shadow: -8px 0 0 0 #f5d591;
}

.pearl-charm::after {
  content: "";
  position: absolute;
  left: 10px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #eed39a 72%);
  box-shadow: 0 0 0 4px rgba(245, 218, 168, 0.16);
}

.leaf-charm::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: 0;
  width: 18px;
  height: 30px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, #8fbf9f, #3f756d);
  box-shadow: 0 0 16px rgba(142, 194, 165, 0.36);
  transform: rotate(-28deg);
}

.leaf-charm::before {
  height: 34px;
}

.crystal-charm::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: 0;
  width: 22px;
  height: 30px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(163, 216, 213, 0.64), rgba(202, 151, 185, 0.5));
  clip-path: polygon(50% 0, 100% 28%, 76% 100%, 24% 100%, 0 28%);
  box-shadow: 0 0 18px rgba(221, 244, 239, 0.45);
}

.gourd-charm::after {
  content: "";
  position: absolute;
  left: 8px;
  bottom: -2px;
  width: 22px;
  height: 34px;
  border-radius: 48% 48% 58% 58%;
  background:
    radial-gradient(circle at 50% 31%, #e6b958 0 9px, transparent 10px),
    radial-gradient(circle at 50% 68%, #c98c3d 0 15px, transparent 16px);
  box-shadow: 0 0 15px rgba(238, 184, 81, 0.36);
}

.gourd-charm::before {
  height: 38px;
}

.letter {
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding: clamp(34px, 6vw, 66px);
  border: 1px solid rgba(122, 77, 52, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(174, 110, 79, 0.08) 1px, transparent 1px) 22px 0 / 32px 100%,
    linear-gradient(var(--paper), #fff6e5 58%, var(--paper-deep));
  box-shadow:
    0 34px 80px rgba(17, 13, 16, 0.34),
    inset 0 0 70px rgba(147, 93, 55, 0.18);
}

.paper-grain {
  position: absolute;
  inset: 0;
  opacity: 0.52;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(116, 75, 46, 0.12) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 60%, rgba(116, 75, 46, 0.09) 0 1px, transparent 1.7px);
  background-size: 26px 24px, 34px 30px;
}

.letter-head {
  position: relative;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #4d3338;
  font-family: "KaiTi", "STKaiti", "Noto Serif SC", serif;
  font-size: clamp(2.25rem, 8vw, 4.9rem);
  font-weight: 500;
  letter-spacing: 0;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.editable-title,
.editable-subtitle,
.editable-signature {
  border-radius: 6px;
  outline: none;
}

.editable-title:focus,
.editable-subtitle:focus,
.editable-signature:focus {
  background: rgba(255, 242, 207, 0.58);
  box-shadow: 0 0 0 6px rgba(255, 242, 207, 0.32);
}

.date {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 14px 0 34px;
  color: var(--muted);
  font-size: 0.92rem;
}

.date::before,
.date::after {
  content: "";
  width: 54px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(136, 89, 63, 0.52));
}

.date::after {
  background: linear-gradient(90deg, rgba(136, 89, 63, 0.52), transparent);
}

.letter-page {
  position: relative;
  z-index: 2;
  min-height: 330px;
  padding: 8px 4px 56px;
  border: 0;
  outline: none;
  font-size: clamp(1rem, 2.8vw, 1.16rem);
  line-height: 2.12;
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.letter-page.turn-next {
  animation: pageInNext 320ms ease;
}

.letter-page.turn-prev {
  animation: pageInPrev 320ms ease;
}

.letter-page p {
  margin: 0 0 1.15em;
  text-indent: 2em;
}

.letter-page p:first-child {
  text-indent: 0;
}

.letter-page:focus {
  background:
    linear-gradient(rgba(161, 98, 72, 0.08) 1px, transparent 1px) 0 1.9em / 100% 2.12em;
}

.letter-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 34px;
  color: #76574f;
  font-family: "KaiTi", "STKaiti", serif;
  font-size: 1.18rem;
}

.letter-foot i {
  width: 72px;
  height: 2px;
  background: linear-gradient(90deg, rgba(117, 77, 64, 0.18), rgba(117, 77, 64, 0.72));
}

.page-controls {
  position: absolute;
  right: clamp(22px, 5vw, 58px);
  bottom: 22px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 7px;
  border: 1px solid rgba(133, 84, 64, 0.22);
  border-radius: 999px;
  background: rgba(255, 248, 234, 0.78);
  box-shadow: 0 12px 24px rgba(88, 51, 39, 0.12);
  backdrop-filter: blur(10px);
}

.page-btn {
  min-width: 64px;
  height: 34px;
  border: 1px solid rgba(139, 83, 67, 0.28);
  border-radius: 999px;
  color: #65453f;
  background: linear-gradient(#fff8eb, #eed8b7);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.page-btn:hover:not(:disabled) {
  color: #4d3338;
  border-color: rgba(151, 74, 82, 0.38);
  background: linear-gradient(#fffdf7, #f0cfbd);
}

.page-btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.page-count {
  min-width: 44px;
  color: rgba(96, 69, 61, 0.72);
  font-size: 0.83rem;
  text-align: center;
}

.corner-ribbon {
  position: absolute;
  top: -1px;
  right: 38px;
  width: 42px;
  height: 138px;
  background: linear-gradient(#9f4c5b, #d0898a);
  box-shadow: 0 8px 18px rgba(85, 32, 42, 0.2);
}

.corner-ribbon::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  border-right: 21px solid transparent;
  border-bottom: 22px solid var(--paper);
  border-left: 21px solid transparent;
}

.stamp {
  position: absolute;
  right: 68px;
  bottom: 52px;
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 2px solid rgba(149, 62, 69, 0.45);
  border-radius: 50%;
  color: rgba(149, 62, 69, 0.55);
  font-size: 1rem;
  transform: rotate(-12deg);
}

.stamp::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(149, 62, 69, 0.42);
  border-radius: 50%;
}

.pressed-flower {
  position: absolute;
  z-index: 1;
  opacity: 0.65;
  pointer-events: none;
}

.pressed-flower::before,
.pressed-flower::after {
  content: "";
  position: absolute;
  border-radius: 50% 50% 48% 8%;
  background: rgba(189, 111, 119, 0.38);
  transform-origin: bottom right;
}

.flower-a {
  top: 86px;
  left: 42px;
  width: 82px;
  height: 130px;
  border-left: 2px solid rgba(76, 111, 96, 0.4);
  transform: rotate(-12deg);
}

.flower-a::before {
  top: -8px;
  left: -18px;
  width: 34px;
  height: 52px;
  transform: rotate(-36deg);
}

.flower-a::after {
  top: 18px;
  left: 4px;
  width: 30px;
  height: 46px;
  background: rgba(233, 178, 126, 0.35);
  transform: rotate(34deg);
}

.flower-b {
  right: 30px;
  bottom: 146px;
  width: 70px;
  height: 96px;
  border-left: 2px solid rgba(76, 111, 96, 0.36);
  transform: rotate(20deg);
}

.flower-b::before {
  top: -6px;
  left: -16px;
  width: 28px;
  height: 42px;
  background: rgba(96, 154, 145, 0.34);
  transform: rotate(-30deg);
}

.flower-b::after {
  top: 14px;
  left: 4px;
  width: 25px;
  height: 38px;
  transform: rotate(36deg);
}

.keepsakes {
  position: absolute;
  top: 28%;
  right: -84px;
  z-index: 3;
  display: grid;
  gap: 18px;
  pointer-events: none;
}

.keepsake {
  position: relative;
  box-shadow: 0 16px 28px rgba(24, 14, 16, 0.24);
}

.tag {
  width: 86px;
  height: 120px;
  padding-top: 46px;
  border-radius: 5px;
  background: linear-gradient(145deg, #e7c88e, #c58d5b);
  color: rgba(83, 48, 35, 0.72);
  font-size: 0.92rem;
  text-align: center;
  transform: rotate(10deg);
}

.postcard {
  width: 104px;
  height: 70px;
  padding: 13px 12px;
  border: 1px solid rgba(111, 77, 58, 0.18);
  border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 64%, rgba(126, 85, 64, 0.16) 64% 66%, transparent 66%),
    repeating-linear-gradient(0deg, transparent 0 12px, rgba(126, 85, 64, 0.12) 13px),
    linear-gradient(145deg, #fff2d8, #d6b77d);
  color: rgba(83, 48, 35, 0.66);
  font-size: 0.88rem;
  transform: rotate(-11deg);
}

.postcard::before {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(151, 74, 82, 0.36);
  border-radius: 3px;
}

.tag::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(100, 58, 42, 0.42);
  border-radius: 50%;
  transform: translateX(-50%);
}

.locket {
  width: 62px;
  height: 72px;
  margin-left: 24px;
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(145deg, #dcb86b, #8d6931);
  transform: rotate(-8deg);
}

.locket span {
  position: absolute;
  inset: 13px 12px;
  border: 1px solid rgba(255, 247, 220, 0.44);
  border-radius: inherit;
}

.wax-drop {
  width: 56px;
  height: 56px;
  margin-left: 34px;
  border-radius: 50% 44% 54% 46%;
  background:
    radial-gradient(circle at 36% 30%, rgba(255, 182, 174, 0.75), transparent 18px),
    linear-gradient(145deg, #9f4c5b, #642d3b);
  transform: rotate(14deg);
}

.wax-drop::before {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -9px;
  width: 20px;
  height: 24px;
  border-radius: 48% 52% 58% 42%;
  background: #713241;
}

.wax-drop span {
  position: absolute;
  inset: 16px;
  border: 1px solid rgba(255, 221, 190, 0.42);
  border-radius: 50%;
}

.gourd-keepsake {
  width: 66px;
  height: 92px;
  margin-left: 8px;
  filter: drop-shadow(0 14px 20px rgba(24, 14, 16, 0.18));
}

.gourd-keepsake::before,
.gourd-keepsake::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(145deg, #f0c15c, #9a632a);
  box-shadow: inset -8px -8px 16px rgba(90, 49, 28, 0.16);
}

.gourd-keepsake::before {
  top: 7px;
  width: 36px;
  height: 34px;
  border-radius: 50%;
}

.gourd-keepsake::after {
  top: 34px;
  width: 52px;
  height: 52px;
  border-radius: 50% 50% 58% 58%;
}

.gourd-keepsake span {
  position: absolute;
  top: -3px;
  left: 30px;
  z-index: 2;
  width: 7px;
  height: 14px;
  border-radius: 999px;
  background: #6e4424;
}

.story-elements {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: block;
  pointer-events: none;
}

.timeline-card,
.person-card {
  border: 1px solid rgba(255, 232, 181, 0.2);
  border-radius: 8px;
  background: rgba(45, 34, 42, 0.48);
  box-shadow: 0 18px 42px rgba(18, 10, 14, 0.22);
  backdrop-filter: blur(12px);
}

.timeline-card {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 230px;
  padding: 12px 16px;
  color: rgba(255, 238, 203, 0.88);
  font-size: 0.92rem;
  transform: translateX(-50%);
}

.timeline-card i {
  flex: 1;
  min-width: 52px;
  height: 1px;
  background: linear-gradient(90deg, #f2d392, #84d2c4, #d58aa0);
  box-shadow: 0 0 12px rgba(255, 232, 167, 0.42);
}

.person-card {
  position: absolute;
  display: grid;
  justify-items: center;
  width: 92px;
  padding: 12px 10px 10px;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
}

.person-card.is-dragging {
  cursor: grabbing;
  z-index: 12;
  box-shadow: 0 24px 52px rgba(18, 10, 14, 0.34);
}

.girl-card {
  left: clamp(18px, 8vw, 128px);
  bottom: 132px;
  transform: rotate(-5deg);
}

.boy-card {
  right: clamp(18px, 8vw, 128px);
  bottom: 48px;
  transform: rotate(4deg);
}

.person {
  position: relative;
  display: grid;
  justify-items: center;
  width: 58px;
}

.person .head {
  position: relative;
  z-index: 2;
  width: 38px;
  height: 40px;
  border-radius: 46% 46% 48% 48%;
  background: #f4c7a7;
  box-shadow: inset -5px -4px 0 rgba(161, 91, 65, 0.12);
}

.person .hair {
  position: absolute;
  top: -4px;
  z-index: 3;
  background: #3d2c2c;
}

.girl .hair {
  width: 46px;
  height: 50px;
  border-radius: 48% 48% 32% 32%;
  box-shadow:
    -10px 18px 0 -8px #3d2c2c,
    10px 18px 0 -8px #3d2c2c;
}

.boy .hair {
  width: 44px;
  height: 28px;
  border-radius: 55% 55% 28% 28%;
  box-shadow:
    -8px 6px 0 -3px #2f2424,
    8px 4px 0 -2px #2f2424,
    0 -5px 0 -1px #2f2424;
}

.glasses {
  position: absolute;
  top: 18px;
  left: 8px;
  width: 23px;
  height: 8px;
  border-top: 2px solid #49373a;
}

.glasses::before,
.glasses::after {
  content: "";
  position: absolute;
  top: -5px;
  width: 10px;
  height: 8px;
  border: 2px solid #49373a;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
}

.glasses::before { left: -5px; }
.glasses::after { right: -5px; }

.smile {
  position: absolute;
  left: 15px;
  bottom: 8px;
  width: 10px;
  height: 5px;
  border-bottom: 2px solid rgba(110, 68, 60, 0.62);
  border-radius: 0 0 999px 999px;
}

.person .body {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 42px;
  margin-top: -5px;
  border-radius: 16px 16px 8px 8px;
  display: grid;
  place-items: center;
  color: rgba(255, 248, 234, 0.95);
  font-size: 0.72rem;
  font-weight: 700;
}

.girl .body {
  background:
    linear-gradient(115deg, transparent 0 35%, rgba(255, 235, 241, 0.24) 36% 48%, transparent 49%),
    linear-gradient(#d58aa0, #8f4a63);
}

.boy .body {
  background: linear-gradient(#4d8a86, #2e555d);
}

.girl .body span {
  position: relative;
  width: 24px;
  height: 18px;
  border-radius: 2px 8px 8px 2px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0 45%, rgba(255, 235, 244, 0.9) 45% 55%, rgba(255, 255, 255, 0.72) 55%),
    linear-gradient(#fff, #f8dbe4);
  box-shadow: 0 0 0 1px rgba(102, 55, 72, 0.16), 8px -6px 0 -5px rgba(255, 238, 214, 0.88);
  transform: rotate(-7deg);
}

.sakura-pin {
  position: absolute;
  top: 0;
  right: 11px;
  z-index: 5;
  width: 14px;
  height: 14px;
  transform: rotate(18deg);
}

.sakura-pin::before,
.sakura-pin::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 15%, #ffd5de 0 4px, transparent 5px),
    radial-gradient(circle at 85% 50%, #ffc3d2 0 4px, transparent 5px),
    radial-gradient(circle at 50% 85%, #ffd5de 0 4px, transparent 5px),
    radial-gradient(circle at 15% 50%, #ffc3d2 0 4px, transparent 5px);
}

.sakura-pin::after {
  inset: 5px;
  border-radius: 50%;
  background: #f2d392;
}

.kana-card {
  position: absolute;
  right: -9px;
  bottom: 22px;
  z-index: 4;
  display: grid;
  width: 20px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(143, 74, 99, 0.28);
  border-radius: 4px;
  color: #8f4a63;
  background: linear-gradient(#fff8eb, #f7dfe7);
  font-family: "Yu Mincho", "MS Mincho", serif;
  font-size: 0.95rem;
  box-shadow: 0 8px 14px rgba(58, 31, 42, 0.16);
  transform: rotate(9deg);
}

.girl .body span::before,
.girl .body span::after {
  content: "";
  position: absolute;
  left: 5px;
  width: 14px;
  height: 1px;
  background: rgba(143, 74, 99, 0.42);
}

.girl .body span::before {
  top: 6px;
}

.girl .body span::after {
  top: 11px;
}

.boy .body span {
  position: relative;
  width: 27px;
  height: 19px;
  border: 2px solid rgba(229, 255, 248, 0.86);
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 4px, rgba(229, 255, 248, 0.58) 4px 6px, transparent 6px),
    linear-gradient(rgba(229, 255, 248, 0.16), rgba(229, 255, 248, 0.04));
}

.boy .body span::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: -6px;
  height: 2px;
  border-radius: 999px;
  background: rgba(229, 255, 248, 0.86);
}

.boy .body span::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 1px;
  background: rgba(229, 255, 248, 0.78);
  box-shadow: 0 4px 0 rgba(229, 255, 248, 0.5);
}


.tassel {
  width: 58px;
  height: 94px;
  margin-left: 10px;
  transform: rotate(5deg);
}

.tassel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  width: 20px;
  height: 18px;
  border-radius: 50%;
  background: #c79645;
}

.tassel i {
  position: absolute;
  top: 17px;
  width: 4px;
  height: 72px;
  border-radius: 99px;
  background: linear-gradient(#c75b66, #7f394b);
}

.tassel i:nth-child(1) { left: 14px; }
.tassel i:nth-child(2) { left: 24px; height: 82px; }
.tassel i:nth-child(3) { left: 34px; height: 78px; }
.tassel i:nth-child(4) { left: 44px; }

.hanging-chain {
  position: fixed;
  top: 0;
  z-index: 1;
  display: grid;
  gap: 16px;
  pointer-events: none;
}

.chain-left {
  left: clamp(18px, 5vw, 86px);
}

.chain-right {
  right: clamp(18px, 5vw, 86px);
}

.hanging-chain span {
  display: block;
  width: 16px;
  height: 28px;
  border: 1px solid rgba(246, 215, 160, 0.42);
  border-radius: 50%;
  transform: rotate(18deg);
}

.music-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 8;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid rgba(255, 232, 181, 0.55);
  border-radius: 50%;
  background: rgba(46, 34, 41, 0.64);
  box-shadow: 0 10px 26px rgba(20, 10, 15, 0.24);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.music-bars {
  display: flex;
  align-items: flex-end;
  height: 20px;
  gap: 4px;
}

.music-bars i {
  display: block;
  width: 4px;
  height: 10px;
  border-radius: 99px;
  background: #f2d392;
  animation: pulse 0.8s ease-in-out infinite alternate;
}

.music-bars i:nth-child(2) {
  height: 18px;
  animation-delay: 0.18s;
}

.music-bars i:nth-child(3) {
  height: 13px;
  animation-delay: 0.34s;
}

.music-toggle.is-muted .music-bars i {
  animation-play-state: paused;
  opacity: 0.48;
}

.fireflies span {
  position: fixed;
  z-index: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffe9a7;
  box-shadow: 0 0 18px #ffe9a7, 0 0 34px rgba(255, 222, 132, 0.48);
  animation: float 8s ease-in-out infinite;
  pointer-events: none;
}

.fireflies span:nth-child(1) { top: 22%; left: 18%; animation-delay: 0s; }
.fireflies span:nth-child(2) { top: 72%; left: 12%; animation-delay: 1.4s; }
.fireflies span:nth-child(3) { top: 18%; right: 18%; animation-delay: 2.2s; }
.fireflies span:nth-child(4) { top: 65%; right: 14%; animation-delay: 3.1s; }
.fireflies span:nth-child(5) { top: 46%; left: 50%; animation-delay: 4.3s; }

.petal-rain span {
  position: fixed;
  z-index: 0;
  top: -8vh;
  width: 11px;
  height: 18px;
  border-radius: 72% 18% 72% 22%;
  background: linear-gradient(135deg, rgba(255, 207, 204, 0.86), rgba(184, 92, 118, 0.38));
  box-shadow: 0 0 14px rgba(255, 189, 191, 0.24);
  pointer-events: none;
  animation: petalFall 16s linear infinite;
}

.petal-rain span:nth-child(1) { left: 4%; animation-delay: 0s; animation-duration: 17s; }
.petal-rain span:nth-child(2) { left: 13%; animation-delay: 2.3s; animation-duration: 19s; }
.petal-rain span:nth-child(3) { left: 21%; animation-delay: 5.6s; animation-duration: 14s; }
.petal-rain span:nth-child(4) { left: 32%; animation-delay: 1.1s; animation-duration: 18s; }
.petal-rain span:nth-child(5) { left: 41%; animation-delay: 7.4s; animation-duration: 16s; }
.petal-rain span:nth-child(6) { left: 49%; animation-delay: 3.5s; animation-duration: 20s; }
.petal-rain span:nth-child(7) { left: 58%; animation-delay: 6.2s; animation-duration: 15s; }
.petal-rain span:nth-child(8) { left: 66%; animation-delay: 4.1s; animation-duration: 18s; }
.petal-rain span:nth-child(9) { left: 74%; animation-delay: 8.5s; animation-duration: 17s; }
.petal-rain span:nth-child(10) { left: 83%; animation-delay: 2.8s; animation-duration: 21s; }
.petal-rain span:nth-child(11) { left: 91%; animation-delay: 6.9s; animation-duration: 15s; }
.petal-rain span:nth-child(12) { left: 96%; animation-delay: 10.1s; animation-duration: 19s; }

.snowfall span {
  position: fixed;
  z-index: 0;
  top: -7vh;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 12px rgba(210, 244, 255, 0.76);
  pointer-events: none;
  animation: snowFall 13s linear infinite;
}

.snowfall span:nth-child(1) { left: 6%; animation-delay: 0s; animation-duration: 12s; }
.snowfall span:nth-child(2) { left: 12%; animation-delay: 3.2s; animation-duration: 16s; }
.snowfall span:nth-child(3) { left: 19%; animation-delay: 1.1s; animation-duration: 14s; }
.snowfall span:nth-child(4) { left: 27%; animation-delay: 5.7s; animation-duration: 18s; }
.snowfall span:nth-child(5) { left: 35%; animation-delay: 2.4s; animation-duration: 13s; }
.snowfall span:nth-child(6) { left: 43%; animation-delay: 6.5s; animation-duration: 17s; }
.snowfall span:nth-child(7) { left: 51%; animation-delay: 4.3s; animation-duration: 15s; }
.snowfall span:nth-child(8) { left: 59%; animation-delay: 8s; animation-duration: 19s; }
.snowfall span:nth-child(9) { left: 66%; animation-delay: 1.7s; animation-duration: 12s; }
.snowfall span:nth-child(10) { left: 72%; animation-delay: 7.1s; animation-duration: 16s; }
.snowfall span:nth-child(11) { left: 78%; animation-delay: 3.9s; animation-duration: 14s; }
.snowfall span:nth-child(12) { left: 84%; animation-delay: 9.4s; animation-duration: 18s; }
.snowfall span:nth-child(13) { left: 89%; animation-delay: 2.8s; animation-duration: 13s; }
.snowfall span:nth-child(14) { left: 93%; animation-delay: 6.1s; animation-duration: 17s; }
.snowfall span:nth-child(15) { left: 97%; animation-delay: 10.6s; animation-duration: 20s; }
.snowfall span:nth-child(16) { left: 31%; animation-delay: 11.8s; animation-duration: 21s; }

.star-dust span {
  position: fixed;
  z-index: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 244, 204, 0.92);
  box-shadow: 0 0 12px rgba(255, 232, 167, 0.82), 0 0 24px rgba(132, 221, 205, 0.26);
  pointer-events: none;
  animation: drift 12s linear infinite, twinkle 2.8s ease-in-out infinite;
}

.star-dust span:nth-child(1) { left: 7%; top: 88%; animation-delay: 0s; }
.star-dust span:nth-child(2) { left: 15%; top: 76%; animation-delay: 1.1s; }
.star-dust span:nth-child(3) { left: 23%; top: 94%; animation-delay: 2.4s; }
.star-dust span:nth-child(4) { left: 31%; top: 83%; animation-delay: 0.8s; }
.star-dust span:nth-child(5) { left: 39%; top: 90%; animation-delay: 3.2s; }
.star-dust span:nth-child(6) { left: 48%; top: 79%; animation-delay: 1.8s; }
.star-dust span:nth-child(7) { left: 57%; top: 95%; animation-delay: 4.6s; }
.star-dust span:nth-child(8) { left: 66%; top: 86%; animation-delay: 2.9s; }
.star-dust span:nth-child(9) { left: 74%; top: 91%; animation-delay: 5.1s; }
.star-dust span:nth-child(10) { left: 83%; top: 78%; animation-delay: 3.9s; }
.star-dust span:nth-child(11) { left: 91%; top: 89%; animation-delay: 1.5s; }
.star-dust span:nth-child(12) { left: 11%; top: 55%; animation-delay: 6.2s; }
.star-dust span:nth-child(13) { left: 29%; top: 62%; animation-delay: 4.2s; }
.star-dust span:nth-child(14) { left: 71%; top: 58%; animation-delay: 6.8s; }
.star-dust span:nth-child(15) { left: 88%; top: 49%; animation-delay: 5.7s; }
.star-dust span:nth-child(16) { left: 3%; top: 67%; animation-delay: 7.4s; }
.star-dust span:nth-child(17) { left: 18%; top: 43%; animation-delay: 8.1s; }
.star-dust span:nth-child(18) { left: 27%; top: 71%; animation-delay: 6.6s; }
.star-dust span:nth-child(19) { left: 36%; top: 51%; animation-delay: 9.5s; }
.star-dust span:nth-child(20) { left: 45%; top: 68%; animation-delay: 7.9s; }
.star-dust span:nth-child(21) { left: 53%; top: 38%; animation-delay: 10.2s; }
.star-dust span:nth-child(22) { left: 61%; top: 73%; animation-delay: 8.7s; }
.star-dust span:nth-child(23) { left: 69%; top: 42%; animation-delay: 11.4s; }
.star-dust span:nth-child(24) { left: 77%; top: 69%; animation-delay: 9.1s; }
.star-dust span:nth-child(25) { left: 85%; top: 37%; animation-delay: 12.2s; }
.star-dust span:nth-child(26) { left: 94%; top: 64%; animation-delay: 10.7s; }
.star-dust span:nth-child(27) { left: 9%; top: 31%; animation-delay: 12.9s; }
.star-dust span:nth-child(28) { left: 34%; top: 24%; animation-delay: 13.6s; }
.star-dust span:nth-child(29) { left: 63%; top: 29%; animation-delay: 14.1s; }
.star-dust span:nth-child(30) { left: 92%; top: 22%; animation-delay: 14.8s; }

@keyframes pulse {
  from { transform: scaleY(0.65); }
  to { transform: scaleY(1.08); }
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.35; }
  45% { transform: translate3d(22px, -34px, 0); opacity: 0.95; }
}

@keyframes auroraMove {
  from { transform: translate3d(0, 0, 0) rotate(-10deg) scale(1); }
  to { transform: translate3d(4vw, -2vh, 0) rotate(5deg) scale(1.08); }
}

@keyframes petalFall {
  0% { transform: translate3d(0, -10vh, 0) rotate(0deg); opacity: 0; }
  12% { opacity: 0.88; }
  55% { transform: translate3d(38px, 52vh, 0) rotate(170deg); }
  100% { transform: translate3d(-26px, 112vh, 0) rotate(340deg); opacity: 0; }
}

@keyframes snowFall {
  0% { transform: translate3d(0, -8vh, 0) scale(0.65); opacity: 0; }
  10% { opacity: 0.9; }
  50% { transform: translate3d(22px, 48vh, 0) scale(1); }
  100% { transform: translate3d(-18px, 112vh, 0) scale(0.72); opacity: 0; }
}

@keyframes drift {
  from { transform: translate3d(0, 22px, 0); }
  to { transform: translate3d(18px, -110vh, 0); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; filter: blur(0); }
  45% { opacity: 0.95; filter: blur(0.4px); }
}

@keyframes pageInNext {
  from { opacity: 0; transform: translateX(18px) rotateY(-4deg); }
  to { opacity: 1; transform: translateX(0) rotateY(0); }
}

@keyframes pageInPrev {
  from { opacity: 0; transform: translateX(-18px) rotateY(4deg); }
  to { opacity: 1; transform: translateX(0) rotateY(0); }
}

@media (max-width: 760px) {
  .scene {
    padding: 28px 10px;
  }

  .letter-wrap {
    padding: 50px 0 12px;
  }

  .letter {
    padding: 30px 22px 34px;
  }

  .date {
    gap: 8px;
    margin-bottom: 22px;
    font-size: 0.84rem;
  }

  .date::before,
  .date::after {
    width: 28px;
  }

  .letter-page {
    min-height: 360px;
    padding-bottom: 74px;
    line-height: 1.95;
  }

  .page-controls {
    right: 16px;
    bottom: 16px;
    gap: 6px;
    max-width: calc(100% - 32px);
  }

  .page-btn {
    min-width: 58px;
    height: 32px;
    padding: 0 9px;
    font-size: 0.82rem;
  }

  .page-count {
    min-width: 38px;
    font-size: 0.78rem;
  }

  .corner-ribbon {
    right: 18px;
    width: 31px;
    height: 104px;
  }

  .corner-ribbon::after {
    border-right-width: 15.5px;
    border-bottom-width: 17px;
    border-left-width: 15.5px;
  }

  .stamp {
    right: 22px;
    bottom: 26px;
    width: 68px;
    height: 68px;
    font-size: 0.78rem;
  }

  .flower-a {
    top: 72px;
    left: 18px;
    transform: scale(0.72) rotate(-12deg);
    transform-origin: top left;
  }

  .flower-b,
  .keepsakes,
  .hanging-chain {
    display: none;
  }

  .top-string {
    width: 86vw;
  }

  .leaf-charm,
  .crystal-charm,
  .gourd-charm {
    display: none !important;
  }

  .zodiac,
  .constellation,
  .story-elements {
    display: none;
  }

  .music-toggle {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }
}

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