:root {
  --w: 640px;
  --h: 1008px;
  --gold: #e6c56a;
  --gold-deep: #b8892c;
  --cinnabar: #c4452f;
  --ivory: #f3e6c8;
  --ink: #1a140f;
  --night: #070b14;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  inset: 0;
  background: #050505;
  color: var(--ivory);
  font-family: "Noto Serif SC", "STSong", "SimSun", serif;
  user-select: none;
  touch-action: none;
}

button {
  font-family: inherit;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

#viewport {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, #1a120c 0%, #050505 70%);
}

#stage-shell {
  position: relative;
  width: min(100dvw, calc(100dvh * 640 / 1008));
  height: min(100dvh, calc(100dvw * 1008 / 640));
  overflow: hidden;
  flex-shrink: 0;
}

#stage {
  width: var(--w);
  height: var(--h);
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  transform-origin: 0 0;
  transform: scale(min(calc(100dvw / 640), calc(100dvh / 1008)));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(230, 197, 106, 0.18);
  background: var(--night);
}

#fx-canvas {
  position: absolute;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}

/* ===== loading ===== */
.loading {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 38%, #1e2a44 0%, #070b14 62%);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.loading.hide { opacity: 0; visibility: hidden; }
.loading-moon {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 32px rgba(230, 197, 106, 0.35);
}
.loading-moon-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 0%;
  background: linear-gradient(180deg, #f8e7a8, #d4a84b);
  transition: height 0.2s linear;
}
.loading-title {
  margin-top: 28px;
  font-family: "Ma Shan Zheng", "KaiTi", "STKaiti", cursive;
  font-size: 54px;
  letter-spacing: 10px;
  color: var(--gold);
}
.loading-sub { margin-top: 8px; font-size: 15px; color: #cbb992; letter-spacing: 4px; }
.loading-bar {
  width: 180px; height: 2px; margin-top: 28px;
  background: rgba(230, 197, 106, 0.2);
}
.loading-bar i {
  display: block; height: 100%; width: 0;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
  transition: width 0.2s linear;
}
.loading-pct { margin-top: 10px; font-size: 13px; color: #9a8860; letter-spacing: 2px; }

/* ===== pages ===== */
.pages {
  position: absolute;
  inset: 0;
  transition: transform 0.72s var(--ease);
  will-change: transform;
}
.page {
  position: relative;
  width: var(--w);
  height: var(--h);
  overflow: hidden;
  padding: 42px 32px 150px;
  pointer-events: none;
}
.page.is-current { pointer-events: auto; }
.page:not(.is-current) * { pointer-events: none !important; }
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: 0.55;
  z-index: 1;
}
.page > * { position: relative; z-index: 2; }

.page[data-theme="cover"] {
  background:
    radial-gradient(ellipse at 50% 28%, #243056 0%, #0b1020 46%, #07080e 100%);
}
.page[data-theme="spring"] {
  background:
    radial-gradient(ellipse at 50% 0%, #7a1c1c 0%, #3a0c12 42%, #1a070a 100%);
}
.page[data-theme="lantern"] {
  background:
    radial-gradient(ellipse at 50% 20%, #3a2458 0%, #140c28 50%, #080612 100%);
}
.page[data-theme="qingming"] {
  background:
    radial-gradient(ellipse at 50% 80%, #2c4038 0%, #15241f 48%, #0c1412 100%);
}
.page[data-theme="duanwu"] {
  background:
    linear-gradient(180deg, #12323c 0%, #0a2430 38%, #0c3a44 70%, #0a2a28 100%);
}
.page[data-theme="qixi"] {
  background:
    radial-gradient(ellipse at 50% 30%, #1c1638 0%, #090816 55%, #05040c 100%);
}
.page[data-theme="zhongqiu"] {
  background:
    radial-gradient(ellipse at 50% 32%, #3a2a18 0%, #1a120c 50%, #0c0906 100%);
}
.page[data-theme="end"] {
  background:
    radial-gradient(ellipse at 50% 40%, #2a2218 0%, #120e0a 60%, #080604 100%);
}

.page-index {
  position: absolute;
  top: 28px;
  left: 28px;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 28px;
  color: var(--gold);
  opacity: 0.7;
  z-index: 5;
}
.seal-mini {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 42px;
  height: 42px;
  border: 1.5px solid #c4452f;
  color: #c4452f;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 18px;
  transform: rotate(-12deg);
  background: rgba(196, 69, 47, 0.08);
}

.fest-tag {
  text-align: center;
  letter-spacing: 8px;
  font-size: 14px;
  color: var(--gold);
  opacity: 0.85;
  margin-top: 18px;
}
.fest-title {
  text-align: center;
  font-family: "Ma Shan Zheng", "KaiTi", "STKaiti", cursive;
  font-size: 58px;
  font-weight: 400;
  letter-spacing: 10px;
  margin-top: 8px;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.fest-poem {
  text-align: center;
  font-size: 15px;
  color: #e8d9b0;
  opacity: 0.78;
  letter-spacing: 2px;
  margin-top: 6px;
  line-height: 1.8;
}
.fest-hint {
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
  letter-spacing: 2px;
  color: #f0d48a;
  min-height: 22px;
}

/* ===== ornaments ===== */
.ornament.corner {
  position: absolute;
  width: 54px;
  height: 54px;
  z-index: 6;
  pointer-events: none;
  border-color: var(--gold);
  opacity: 0.55;
}
.ornament.tl { top: 16px; left: 16px; border-top: 2px solid; border-left: 2px solid; }
.ornament.tr { top: 16px; right: 16px; border-top: 2px solid; border-right: 2px solid; }
.ornament.bl { bottom: 16px; left: 16px; border-bottom: 2px solid; border-left: 2px solid; }
.ornament.br { bottom: 16px; right: 16px; border-bottom: 2px solid; border-right: 2px solid; }

/* ===== cover ===== */
.cover-title {
  text-align: center;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 92px;
  letter-spacing: 18px;
  margin-top: 118px;
  color: #f3e6c8;
  text-shadow: 0 0 28px rgba(230, 197, 106, 0.35);
  animation: titleIn 1.2s var(--ease) both;
}
.cover-en {
  text-align: center;
  font-size: 11px;
  letter-spacing: 7px;
  color: var(--gold);
  opacity: 0.7;
  margin-top: 4px;
}
.cover-sub {
  text-align: center;
  margin-top: 16px;
  font-size: 16px;
  letter-spacing: 4px;
  color: #d8c8a0;
  animation: fadeUp 1s 0.4s both;
}
.cover-clouds {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 20% 78%, rgba(180, 190, 210, 0.14) 0%, transparent 42%),
    radial-gradient(ellipse at 80% 82%, rgba(180, 190, 210, 0.12) 0%, transparent 40%);
  animation: cloudDrift 12s ease-in-out infinite alternate;
}
.cover-pouch {
  display: block;
  margin: 72px auto 0;
  width: 160px;
  text-align: center;
}
.pouch-body {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 128px;
  margin: 0 auto;
  background:
    linear-gradient(180deg, #8b1e1e 0%, #c4452f 38%, #7a1a18 100%);
  border-radius: 54px 54px 46px 46px;
  box-shadow:
    inset 0 8px 16px rgba(255, 210, 160, 0.2),
    0 14px 28px rgba(0, 0, 0, 0.4);
  border: 2px solid #e6c56a;
  position: relative;
  transition: transform 0.25s var(--ease);
}
.cover-pouch:active .pouch-body,
.cover-pouch.opened .pouch-body { transform: scale(0.94) rotate(-6deg); }
.pouch-knot {
  position: absolute;
  top: -14px;
  width: 36px; height: 22px;
  background: #e6c56a;
  border-radius: 20px 20px 6px 6px;
  box-shadow: 0 4px 0 #8a6a22;
}
.pouch-char {
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 36px;
  line-height: 1;
  color: #f8e7a8;
}
.pouch-tassel {
  display: block;
  width: 4px;
  height: 36px;
  margin: 0 auto 6px;
  background: linear-gradient(#e6c56a, #c4452f);
  border-radius: 2px;
}
.pouch-hint {
  display: block;
  margin-top: 16px;
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--gold);
}
.cover-lanterns { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.mini-lantern {
  position: absolute;
  width: 28px;
  height: 36px;
  background: radial-gradient(circle at 40% 30%, #ffd48a, #d4522a 70%);
  border-radius: 12px;
  box-shadow: 0 0 16px rgba(255, 140, 60, 0.55);
  animation: lanternFloat 4.5s ease-in-out infinite;
  pointer-events: auto;
  cursor: pointer;
}
.mini-lantern::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 2px;
  height: 10px;
  background: #e6c56a;
  transform: translateX(-50%);
}
.mini-lantern.lit { filter: brightness(1.35); transform: scale(1.15); }

/* ===== spring ===== */
.couplet {
  position: absolute;
  top: 210px;
  width: 46px;
  padding: 14px 0;
  background: linear-gradient(180deg, #c4452f, #8b1a18);
  border: 2px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 26px;
  color: #f8e7a8;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}
.couplet.left { left: 28px; }
.couplet.right { right: 28px; }
.fu-board {
  position: absolute;
  top: 200px;
  left: 50%;
  transform: translateX(-50%) rotate(180deg) scale(0.4);
  width: 96px;
  height: 96px;
  background: #c4452f;
  border: 3px solid var(--gold);
  color: #f8e7a8;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: transform 0.8s var(--ease), opacity 0.6s;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}
.fu-board.show {
  opacity: 1;
  transform: translateX(-50%) rotate(180deg) scale(1);
}
.cracker-row {
  display: flex;
  justify-content: center;
  gap: 36px;
  margin-top: 56px;
}
.cracker {
  width: 42px;
  height: 118px;
  background:
    repeating-linear-gradient(180deg, #c4452f 0 14px, #f0d48a 14px 18px);
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}
.cracker::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 50%;
  width: 3px;
  height: 16px;
  background: #e6c56a;
  transform: translateX(-50%);
}
.cracker.boom {
  animation: crackerBoom 0.45s forwards;
}
.packet-row {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 36px;
}
.packet {
  width: 86px;
  height: 118px;
  background: linear-gradient(180deg, #e25a42, #9b1d18);
  border: 2px solid var(--gold);
  border-radius: 6px 6px 10px 10px;
  position: relative;
  cursor: pointer;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.32);
  transition: transform 0.35s var(--ease);
  animation: packetSway 3.2s ease-in-out infinite;
}
.packet:nth-child(2) { animation-delay: -1s; }
.packet:nth-child(3) { animation-delay: -2s; }
.packet::after {
  content: "福";
  position: absolute;
  inset: 28px 12px 12px;
  border: 1.5px solid #f0d48a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 32px;
  color: #f8e7a8;
}
.packet.open {
  transform: rotateY(180deg) scale(0.2);
  opacity: 0;
}
.blessing-toast {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(0.7);
  padding: 14px 28px;
  background: rgba(20, 8, 8, 0.82);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 36px;
  letter-spacing: 6px;
  opacity: 0;
  pointer-events: none;
  z-index: 8;
}
.blessing-toast.show {
  animation: toastIn 1.6s var(--ease) forwards;
}

/* ===== lantern festival ===== */
.lantern-stage {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-top: 48px;
  min-height: 280px;
}
.fest-lantern {
  width: 118px;
  cursor: pointer;
  text-align: center;
}
.fest-lantern .lantern-body {
  width: 96px;
  height: 124px;
  margin: 0 auto;
  background:
    radial-gradient(circle at 50% 30%, #ffd27a 0%, #e07030 55%, #a83818 100%);
  border-radius: 48px;
  border: 3px solid #f0d48a;
  box-shadow: 0 0 28px rgba(255, 140, 50, 0.45);
  position: relative;
  animation: lanternSway 3.4s ease-in-out infinite;
  transition: filter 0.3s, transform 0.3s;
}
.fest-lantern:nth-child(2) .lantern-body { animation-delay: -1.1s; }
.fest-lantern:nth-child(3) .lantern-body { animation-delay: -2.2s; }
.fest-lantern .lantern-body::before,
.fest-lantern .lantern-body::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: #e6c56a;
}
.fest-lantern .lantern-body::before {
  top: -10px; width: 40px; height: 10px; border-radius: 4px;
}
.fest-lantern .lantern-body::after {
  bottom: -14px; width: 2px; height: 14px;
}
.fest-lantern .lantern-char {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 42px;
  color: #5a1808;
}
.fest-lantern.done .lantern-body {
  filter: grayscale(0.15) brightness(1.15);
  box-shadow: 0 0 36px rgba(255, 210, 100, 0.8);
}
.fest-lantern.active .lantern-body { transform: scale(1.08); }
.riddle-panel {
  margin: 20px 12px 0;
  padding: 18px 16px 16px;
  background: rgba(12, 8, 22, 0.78);
  border: 1px solid rgba(230, 197, 106, 0.45);
  min-height: 180px;
}
.riddle-panel[hidden] { display: none; }
.riddle-q {
  font-size: 18px;
  line-height: 1.7;
  text-align: center;
  color: #f3e6c8;
}
.riddle-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.riddle-opts button {
  padding: 12px;
  min-height: 48px;
  border: 1px solid rgba(230, 197, 106, 0.4);
  background: rgba(230, 197, 106, 0.08);
  color: var(--ivory);
  font-size: 17px;
  letter-spacing: 2px;
  transition: background 0.2s, border-color 0.2s;
}
.riddle-opts button:hover,
.riddle-opts button:focus-visible {
  background: rgba(230, 197, 106, 0.2);
  border-color: var(--gold);
}
.riddle-opts button.correct { background: rgba(46, 140, 90, 0.45); border-color: #7dcea0; }
.riddle-opts button.wrong { background: rgba(160, 40, 40, 0.4); border-color: #e07070; }

/* ===== qingming ===== */
.willow-ground {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 280px;
  z-index: 2;
  cursor: pointer;
  background:
    linear-gradient(180deg, transparent 0%, rgba(30, 50, 40, 0.55) 100%);
}
.willow {
  position: absolute;
  bottom: 70px;
  width: 40px;
  height: 110px;
  margin-left: -20px;
  transform-origin: bottom center;
  animation: willowGrow 1.1s var(--ease) forwards;
}
.willow .stem {
  width: 6px;
  height: 0;
  margin: 0 auto;
  background: linear-gradient(#6b8f4e, #2d4a32);
  border-radius: 4px;
  animation: stemGrow 0.9s var(--ease) forwards;
}
.willow .leaf {
  position: absolute;
  width: 18px;
  height: 7px;
  background: #7da45a;
  border-radius: 0 10px 0 10px;
  animation: leafIn 0.5s 0.6s both;
}
.censer {
  position: absolute;
  left: 50%;
  bottom: 168px;
  transform: translateX(-50%);
  width: 90px;
  height: 110px;
  z-index: 4;
}
.censer-body {
  position: absolute;
  bottom: 0; left: 10px;
  width: 70px; height: 42px;
  background: linear-gradient(#4a3a28, #2a2018);
  border: 2px solid var(--gold);
  border-radius: 6px 6px 10px 10px;
}
.censer-label {
  position: absolute;
  bottom: 10px; left: 0; right: 0;
  text-align: center;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  color: var(--gold);
  font-size: 18px;
}
.censer-smoke {
  position: absolute;
  left: 50%;
  bottom: 44px;
  width: 20px;
  height: 70px;
  transform: translateX(-50%);
  opacity: 0;
  background:
    radial-gradient(circle at 50% 80%, rgba(220, 220, 220, 0.5), transparent 60%);
  filter: blur(2px);
}
.censer.lit .censer-smoke {
  opacity: 1;
  animation: smokeUp 2.4s ease-in-out infinite;
}
.kite {
  position: absolute;
  width: 54px;
  height: 70px;
  z-index: 6;
  cursor: grab;
  left: 420px;
  top: 280px;
}
.kite[hidden] { display: none; }
.kite-diamond {
  width: 46px;
  height: 46px;
  background: #c4452f;
  border: 2px solid var(--gold);
  transform: rotate(45deg);
  box-shadow: 0 0 16px rgba(196, 69, 47, 0.4);
}
.kite-tail {
  width: 2px;
  height: 40px;
  background: #e6c56a;
  margin: 4px auto 0;
}

/* ===== duanwu ===== */
.river {
  position: relative;
  margin-top: 22px;
  height: 300px;
  overflow: hidden;
  border-top: 1px solid rgba(180, 220, 210, 0.2);
  border-bottom: 1px solid rgba(180, 220, 210, 0.2);
}
.wave-band {
  position: absolute;
  left: -20%;
  width: 140%;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(160, 210, 200, 0.18);
  animation: waveMove 6s linear infinite;
}
.wave-band.w1 { top: 70px; }
.wave-band.w2 { top: 180px; animation-duration: 7.5s; }
.wave-band.w3 { top: 290px; animation-duration: 5.4s; }
.lane { height: 50%; position: relative; }
.boat {
  position: absolute;
  top: 38px;
  left: 16px;
  width: 120px;
  height: 36px;
  background: linear-gradient(180deg, #8b3a1a, #4a1e0c);
  border-radius: 4px 40px 12px 20px;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
  transition: left 0.12s linear;
}
.boat::before {
  content: "";
  position: absolute;
  right: 10px;
  top: -22px;
  width: 4px;
  height: 28px;
  background: #d4c4a0;
}
.boat-flag {
  position: absolute;
  right: -6px;
  top: -28px;
  font-size: 12px;
  background: #c4452f;
  color: #f8e7a8;
  padding: 2px 6px;
}
.boat.player { top: 48px; background: linear-gradient(180deg, #c4452f, #6a1810); }
.race-meta {
  display: flex;
  justify-content: space-between;
  padding: 12px 8px 0;
  font-size: 14px;
  color: #cde8e0;
}
.paddle-btn {
  display: block;
  margin: 18px auto 0;
  width: 180px;
  height: 56px;
  border-radius: 40px;
  background: linear-gradient(180deg, #e6c56a, #b8892c);
  color: #3a2208;
  font-size: 24px;
  letter-spacing: 8px;
  font-family: "ZCOOL XiaoWei", "Noto Serif SC", serif;
  box-shadow: 0 10px 0 #7a5a18, 0 16px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s, box-shadow 0.08s;
}
.paddle-btn:active {
  transform: translateY(6px);
  box-shadow: 0 4px 0 #7a5a18, 0 8px 12px rgba(0, 0, 0, 0.3);
}
.paddle-btn:disabled { opacity: 0.45; }
.race-result {
  text-align: center;
  margin-top: 14px;
  min-height: 28px;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 28px;
  color: var(--gold);
}

/* ===== qixi ===== */
.star-field { position: absolute; inset: 0; z-index: 3; }
.star-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6d2 0%, #e6c56a 40%, transparent 70%);
  box-shadow: 0 0 16px rgba(255, 230, 150, 0.7);
  cursor: pointer;
  font-size: 12px;
  color: #3a2a08;
  font-weight: 700;
  animation: twinkle 2.2s ease-in-out infinite;
}
.star-btn.on {
  background: radial-gradient(circle, #fff 0%, #ffe08a 45%, transparent 72%);
  box-shadow: 0 0 28px #ffe08a;
  transform: scale(1.2);
}
.bridge-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.lovers {
  position: absolute;
  top: 560px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 70px;
  z-index: 4;
}
.lovers[hidden] { display: none; }
.lover {
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 22px;
  color: #f8e7a8;
  padding: 8px 14px;
  border: 1px solid var(--gold);
  background: rgba(20, 12, 40, 0.55);
  animation: fadeUp 0.8s both;
}
.magpies { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.magpie {
  position: absolute;
  width: 22px;
  height: 10px;
  background: #d8dce8;
  border-radius: 10px 2px 10px 2px;
  animation: magpieFly 2.8s var(--ease) forwards;
  box-shadow: 0 0 8px rgba(220, 220, 240, 0.5);
}

/* ===== zhongqiu ===== */
.moon {
  display: block;
  width: 168px;
  height: 168px;
  margin: 56px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff4c8, #e6c56a 55%, #b8892c);
  box-shadow: 0 0 48px rgba(230, 197, 106, 0.55), 0 0 120px rgba(230, 180, 80, 0.22);
  position: relative;
  overflow: hidden;
}
.moon-shadow {
  position: absolute;
  inset: 0;
  background: #1a120c;
  border-radius: 50%;
  transform-origin: right center;
  transition: transform 0.45s var(--ease), opacity 0.45s;
}
.moon-face {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 40%, rgba(160, 120, 60, 0.18), transparent 40%),
    radial-gradient(circle at 62% 58%, rgba(140, 100, 50, 0.16), transparent 36%);
}
.osmanthus { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.petal {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #e8c547;
  border-radius: 10px 0 10px 0;
  opacity: 0.85;
  animation: petalFall 5s linear forwards;
}
.sky-lanterns {
  position: absolute;
  left: 0; right: 0;
  bottom: 168px;
  display: flex;
  justify-content: center;
  gap: 28px;
  z-index: 5;
}
.sky-lantern {
  width: 54px;
  height: 70px;
  background: linear-gradient(180deg, #ffd48a, #d4522a);
  border-radius: 8px 8px 20px 20px;
  border: 2px solid #f0d48a;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 140, 50, 0.4);
  position: relative;
  transition: transform 0.2s;
}
.sky-lantern::after {
  content: "";
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  height: 10px;
  background: rgba(255, 240, 180, 0.5);
  border-radius: 50%;
}
.sky-lantern.fly {
  animation: lanternRise 3.2s var(--ease) forwards;
  pointer-events: none;
}

/* ===== ending ===== */
.end-title { font-size: 52px; }
.stamp-ring {
  width: 168px;
  height: 168px;
  margin: 36px auto 12px;
  border: 1px dashed rgba(230, 197, 106, 0.45);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.year-stamp {
  width: 112px;
  height: 112px;
  border: 3px solid #c4452f;
  color: #c4452f;
  font-family: "Ma Shan Zheng", "KaiTi", cursive;
  font-size: 36px;
  line-height: 1.15;
  background: rgba(196, 69, 47, 0.08);
  transform: rotate(-14deg) scale(0.85);
  transition: transform 0.35s var(--ease), background 0.35s;
}
.year-stamp.stamped {
  background: rgba(196, 69, 47, 0.22);
  transform: rotate(-8deg) scale(1);
  box-shadow: 0 0 24px rgba(196, 69, 47, 0.35);
  animation: stampHit 0.45s var(--ease);
}
.fest-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 14px;
  list-style: none;
  margin: 18px 20px 0;
}
.fest-list li {
  padding: 8px 14px;
  border: 1px solid rgba(230, 197, 106, 0.35);
  font-size: 15px;
  letter-spacing: 3px;
  color: #e8d9b0;
  opacity: 0.45;
  transition: opacity 0.4s, border-color 0.4s, color 0.4s;
}
.fest-list li.on {
  opacity: 1;
  color: var(--gold);
  border-color: var(--gold);
}
.end-copy {
  text-align: center;
  margin-top: 22px;
  font-size: 15px;
  letter-spacing: 2px;
  color: #d8c8a0;
  min-height: 24px;
}
.replay-btn {
  display: block;
  margin: 24px auto 72px;
  padding: 14px 36px;
  min-height: 48px;
  border: 1px solid var(--gold);
  color: var(--gold);
  letter-spacing: 6px;
  font-size: 16px;
  opacity: 0;
  pointer-events: none;
  transition: background 0.2s, color 0.2s, opacity 0.4s;
}
.replay-btn.show {
  opacity: 1;
  pointer-events: auto;
}
.replay-btn:hover,
.replay-btn:focus-visible {
  background: var(--gold);
  color: #2a1a08;
}

/* ===== chrome ===== */
.nav-btn {
  position: absolute;
  z-index: 50;
  bottom: 22px;
  min-width: 88px;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--gold);
  border: 1px solid rgba(230, 197, 106, 0.55);
  background: rgba(8, 8, 12, 0.78);
}
.nav-btn.prev { left: 20px; }
.nav-btn.next { right: 20px; }
.nav-btn:disabled { opacity: 0; pointer-events: none; }
.dots {
  position: absolute;
  z-index: 50;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(243, 230, 200, 0.28);
  min-width: 16px;
  min-height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dots button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(243, 230, 200, 0.28);
}
.dots button.on::after {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}
.swipe-tip {
  position: absolute;
  z-index: 50;
  left: 50%;
  bottom: 86px;
  transform: translateX(-50%);
  font-size: 12px;
  letter-spacing: 4px;
  color: rgba(230, 197, 106, 0.7);
  animation: tipBounce 1.6s ease-in-out infinite;
  pointer-events: none;
}
.swipe-tip.hide { opacity: 0; }
.sound-btn {
  position: absolute;
  z-index: 50;
  top: 24px;
  right: 72px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(230, 197, 106, 0.45);
  color: var(--gold);
  font-size: 13px;
  border-radius: 50%;
  background: rgba(8, 8, 12, 0.35);
}
.sound-btn.muted { opacity: 0.4; }

/* ===== keyframes ===== */
@keyframes titleIn {
  from { opacity: 0; letter-spacing: 32px; filter: blur(6px); }
  to { opacity: 1; letter-spacing: 18px; filter: blur(0); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cloudDrift {
  from { transform: translateX(-12px); }
  to { transform: translateX(12px); }
}
@keyframes lanternFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
@keyframes lanternSway {
  0%, 100% { transform: rotate(-4deg); }
  50% { transform: rotate(4deg); }
}
@keyframes packetSway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}
@keyframes crackerBoom {
  0% { transform: scale(1); opacity: 1; }
  40% { transform: scale(1.3); }
  100% { transform: scale(0.2); opacity: 0; }
}
@keyframes toastIn {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(0.7); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -62%) scale(1.05); }
}
@keyframes stemGrow {
  to { height: 90px; }
}
@keyframes willowGrow {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes leafIn {
  from { opacity: 0; transform: scale(0.2); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes smokeUp {
  0% { transform: translate(-50%, 10px) scale(0.6); opacity: 0; }
  40% { opacity: 0.7; }
  100% { transform: translate(-30%, -40px) scale(1.4); opacity: 0; }
}
@keyframes waveMove {
  from { transform: translateX(0); }
  to { transform: translateX(-40px); }
}
@keyframes twinkle {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
@keyframes magpieFly {
  from { transform: translateX(-40px); opacity: 0; }
  20% { opacity: 1; }
  to { transform: translateX(80px); opacity: 0.9; }
}
@keyframes petalFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  10% { opacity: 0.9; }
  100% { transform: translateY(720px) rotate(220deg); opacity: 0; }
}
@keyframes lanternRise {
  to { transform: translateY(-720px) scale(0.6); opacity: 0.2; }
}
@keyframes stampHit {
  0% { transform: rotate(-14deg) scale(1.25); }
  100% { transform: rotate(-8deg) scale(1); }
}
@keyframes tipBounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -8px); }
}

.page .fest-title,
.page .fest-tag,
.page .fest-poem,
.page .fest-hint {
  animation: fadeUp 0.7s var(--ease) both;
}
.page .fest-title { animation-delay: 0.12s; }
.page .fest-poem { animation-delay: 0.22s; }
.page .fest-hint { animation-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
