/* ==========================================================================
   A Little World × 2025 Wrapped — V2 Studio Polish Edition
   Mobile-First Portrait (390×844) + Desktop Editorial Wide (1440×900)
   ========================================================================== */

:root {
  --ink-plum: #4a383e;
  --ink-muted: #7e6c73;
  --ink-soft: #a39299;
  --cream-paper: #faf5ea;
  --terracotta: #bd776d;
  --champagne: #d5c49e;
  --rose-pill: #d4a4b4;
  --rose-deep: #b87e92;
  --parchment: #fbf4e4;
  --parchment-border: #e7dec9;
  --espresso: #3b281e;
  --kraft: #cfa97e;
  --mint-ticket: #67b390;
  --crimson-seal: #b33b34;

  --font-serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif SC", "SimSun", Georgia, serif;
  --font-serif-en: "Baskerville", "Cormorant Garamond", "Didot", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #edf5fc;
  color: var(--ink-plum);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

img {
  display: block;
  max-width: 100%;
  -webkit-user-drag: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

/* ---------- Minimal Floating Top HUD ---------- */
.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 16px 8px;
  pointer-events: none;
}

.hud-pill,
.hud-icon-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(74, 56, 62, 0.1);
  box-shadow: 0 4px 16px rgba(74, 56, 62, 0.06);
  color: var(--ink-plum);
  transition: transform 0.25s var(--ease-out), background 0.25s ease, color 0.25s ease;
}

.hud-pill {
  padding: 0 13px;
  font-family: var(--font-serif-en);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.hud-icon-btn {
  width: 34px;
  justify-content: center;
}

.hud-icon-btn.is-playing {
  background: rgba(212, 164, 180, 0.28);
  border-color: rgba(184, 126, 146, 0.42);
}

.hud-icon-btn.is-playing svg {
  animation: gentleSpin 4.2s linear infinite;
}

.hud.hud-dark .hud-pill,
.hud.hud-dark .hud-icon-btn {
  background: rgba(59, 40, 30, 0.72);
  border-color: rgba(250, 245, 234, 0.2);
  color: #faf5ea;
}

/* ---------- Chapter Drawer ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 78;
  background: rgba(34, 24, 28, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.chapter-drawer {
  position: fixed;
  top: calc(56px + env(safe-area-inset-top));
  left: 16px;
  z-index: 80;
  width: min(300px, calc(100vw - 32px));
  background: rgba(252, 249, 244, 0.96);
  border: 1px solid rgba(74, 56, 62, 0.1);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 20px 50px rgba(45, 30, 36, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.97);
  transition: opacity 0.3s ease, transform 0.35s var(--ease-out);
}

.chapter-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.drawer-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 8px 10px;
  border-bottom: 1px solid rgba(74, 56, 62, 0.08);
  margin-bottom: 8px;
}

.drawer-header h3 {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.drawer-header span {
  font-family: var(--font-serif-en);
  font-size: 12px;
  color: var(--ink-muted);
}

.drawer-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.drawer-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  text-align: left;
  transition: background 0.2s ease;
}

.drawer-item:hover { background: rgba(212, 164, 180, 0.14); }
.drawer-item.active { background: rgba(212, 164, 180, 0.24); }

.drawer-num {
  font-family: var(--font-serif-en);
  font-size: 13px;
  font-weight: 600;
  color: var(--terracotta);
  width: 22px;
}

.drawer-label { display: flex; flex-direction: column; }
.drawer-label-cn { font-family: var(--font-serif); font-size: 13px; color: var(--ink-plum); }
.drawer-label-en { font-family: var(--font-serif-en); font-size: 11px; color: var(--ink-muted); }

/* ---------- Scene Container System ---------- */
#app {
  position: relative;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
}

.scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(1.015);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), visibility 0.6s;
}

.scene.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: scale(1);
  z-index: 10;
}

.lw-header {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  text-align: center;
  position: relative;
  z-index: 6;
  flex-shrink: 0;
}

.lw-header h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(20px, 5vw, 25px);
  letter-spacing: 0.14em;
  color: var(--ink-plum);
}

.lw-header .en-sub {
  font-family: var(--font-serif-en);
  font-size: clamp(13px, 3.2vw, 15px);
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
}

.whisper-next {
  position: relative;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  border: 1px solid rgba(74, 56, 62, 0.14);
  background: rgba(255, 255, 255, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.35s var(--ease-out);
  flex-shrink: 0;
}

.whisper-next.is-highlighted {
  color: var(--ink-plum);
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(189, 119, 109, 0.45);
  box-shadow: 0 6px 20px rgba(189, 119, 109, 0.15);
}

.whisper-next.dark {
  color: rgba(250, 245, 234, 0.85);
  background: rgba(250, 245, 234, 0.1);
  border-color: rgba(250, 245, 234, 0.24);
}

.whisper-next.dark.is-highlighted {
  background: rgba(250, 245, 234, 0.22);
  color: #ffffff;
  border-color: rgba(250, 245, 234, 0.48);
}

.ambient-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.ambient-item {
  position: absolute;
  opacity: 0.5;
  animation: floatDrift var(--dur, 9s) ease-in-out infinite alternate;
  animation-delay: var(--delay, 0s);
}

/* ==========================================================================
   ACT 1 · ADMISSION TICKET NO.007
   ========================================================================== */
#scene-1 {
  background:
    radial-gradient(ellipse 68% 58% at 24% 30%, rgba(217, 235, 250, 0.86), transparent 68%),
    radial-gradient(ellipse 62% 55% at 78% 74%, rgba(252, 242, 214, 0.8), transparent 65%),
    linear-gradient(155deg, #eef6fc 0%, #fcfaf3 52%, #edf5fc 100%);
  padding: calc(64px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom));
}

.ticket-stage {
  position: relative;
  z-index: 4;
  width: min(550px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.ticket-wrapper {
  position: relative;
  width: min(520px, 100%);
  display: flex;
  align-items: stretch;
  filter: drop-shadow(0 20px 38px rgba(84, 70, 62, 0.12)) drop-shadow(0 4px 10px rgba(84, 70, 62, 0.06));
}

.ticket-main {
  flex: 1 1 70%;
  position: relative;
  background: var(--cream-paper);
  border-radius: 10px 0 0 10px;
  padding: clamp(18px, 4.5vw, 30px) clamp(14px, 3.8vw, 28px) clamp(16px, 4vw, 24px) clamp(22px, 5vw, 36px);
  overflow: hidden;
  border-right: 1.5px dashed rgba(154, 134, 118, 0.42);
  transform-origin: right center;
  transition: transform 0.25s var(--ease-out);
  mask-image:
    radial-gradient(circle 9px at 100% 0, transparent 98%, #000 100%),
    radial-gradient(circle 9px at 100% 100%, transparent 98%, #000 100%);
  -webkit-mask-image:
    radial-gradient(circle 9px at 100% 0, transparent 98%, #000 100%),
    radial-gradient(circle 9px at 100% 100%, transparent 98%, #000 100%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

.ticket-main::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: clamp(9px, 2.2vw, 13px);
  background: linear-gradient(180deg, #cf897e 0%, #bd746a 45%, #e2a499 55%, #b56d63 100%);
  background-size: 100% 240%;
  animation: foilSweep 5.5s ease-in-out infinite alternate;
}

.ticket-kicker { font-size: clamp(7.5px, 1.9vw, 9.5px); letter-spacing: 0.16em; color: #8c7a72; margin-bottom: 5px; white-space: nowrap; }
.ticket-italic { font-family: var(--font-serif-en); font-style: italic; font-size: clamp(12px, 3vw, 15px); color: #9e8a80; margin-bottom: 4px; }
.ticket-title { font-family: var(--font-serif-en); font-style: italic; font-weight: 600; font-size: clamp(26px, 7vw, 40px); line-height: 1.05; color: #3d2e28; margin-bottom: 8px; }

.ticket-cn {
  font-family: var(--font-serif);
  font-size: clamp(10.5px, 2.7vw, 13.5px);
  color: #7c6a62;
  letter-spacing: 0.06em;
  white-space: nowrap;
  margin-bottom: clamp(16px, 4vw, 24px);
}

.ticket-meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding-top: 10px; border-top: 1px solid rgba(154, 134, 118, 0.2); }
.ticket-meta-col { border-right: 1px solid rgba(154, 134, 118, 0.22); padding-right: 6px; }
.ticket-meta-col:last-child { border-right: none; padding-right: 0; }
.ticket-meta-label { display: block; font-size: 7.5px; letter-spacing: 0.14em; color: #a6958b; margin-bottom: 2px; }
.ticket-meta-val { display: block; font-family: var(--font-serif-en); font-weight: 600; font-size: clamp(10.5px, 2.7vw, 13px); color: #46362f; white-space: nowrap; }

.ticket-stub {
  flex: 0 0 30%;
  min-width: 102px;
  position: relative;
  background: var(--cream-paper);
  border-radius: 0 10px 10px 0;
  padding: clamp(14px, 3.5vw, 22px) clamp(8px, 2.4vw, 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  cursor: grab;
  touch-action: none;
  transform-origin: left top;
  transition: transform 0.35s var(--ease-spring), opacity 0.35s ease;
  mask-image:
    radial-gradient(circle 9px at 0 0, transparent 98%, #000 100%),
    radial-gradient(circle 9px at 0 100%, transparent 98%, #000 100%);
  -webkit-mask-image:
    radial-gradient(circle 9px at 0 0, transparent 98%, #000 100%),
    radial-gradient(circle 9px at 0 100%, transparent 98%, #000 100%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

.ticket-stub.is-dragging { cursor: grabbing; transition: none; box-shadow: -6px 0 18px rgba(189, 119, 109, 0.24); }
.ticket-stub.is-torn { transform: translate(110px, 68px) rotate(22deg) !important; opacity: 0; pointer-events: none; transition: transform 0.72s var(--ease-out), opacity 0.6s ease; }

.stub-top { font-size: 7.5px; letter-spacing: 0.14em; color: #9e8a80; display: flex; align-items: center; gap: 4px; }
.stub-top::before, .stub-top::after { content: "•"; color: var(--terracotta); }
.stub-number { font-family: var(--font-serif-en); font-weight: 700; font-size: clamp(26px, 7vw, 38px); line-height: 1; color: #46362f; }
.stub-rule { width: 78%; height: 1px; background: var(--champagne); position: relative; }
.stub-rule::before, .stub-rule::after { content: ""; position: absolute; top: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--champagne); }
.stub-rule::before { left: 0; }
.stub-rule::after { right: 0; }
.stub-sub { font-size: 7px; letter-spacing: 0.1em; color: #a6958b; }
.stub-barcode {
  width: 82%; height: 16px;
  background: repeating-linear-gradient(90deg, #bc7c74 0px, #bc7c74 1.5px, transparent 1.5px, transparent 3.5px, #bc7c74 3.5px, #bc7c74 6px, transparent 6px, transparent 7.5px, #bc7c74 7.5px, #bc7c74 8.5px, transparent 8.5px, transparent 11px);
  opacity: 0.72;
}
.stub-hand { position: absolute; top: 26px; right: 10px; width: 21px; height: 21px; color: #6b574e; opacity: 0.75; animation: tugHint 1.9s ease-in-out infinite; pointer-events: none; }
.ticket-drag-bar { width: 120px; height: 2px; border-radius: 99px; background: rgba(140, 122, 114, 0.18); overflow: hidden; }
.ticket-drag-fill { height: 100%; width: 0%; background: var(--terracotta); transition: width 0.08s linear; }
.ticket-hint { font-family: var(--font-serif); font-size: 12px; letter-spacing: 0.12em; color: #8c8287; text-align: center; }

/* ==========================================================================
   ACT 2 · 2019–2026 WRAPPED KRAFT ENVELOPE (Warm Oat-Milk Linen Palette)
   ========================================================================== */
#scene-2 {
  background:
    radial-gradient(ellipse 68% 58% at 50% 46%, #fffdf8 0%, #faf3e8 48%, #f1e3d1 100%);
  color: var(--ink-plum);
  padding: calc(56px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  justify-content: space-between;
}

.wrapped-header {
  text-align: center;
  position: relative;
  z-index: 30;
  flex-shrink: 0;
}

.wrapped-header .kicker {
  font-family: var(--font-serif-en);
  font-size: 11.5px;
  letter-spacing: 0.22em;
  color: var(--terracotta);
  margin-bottom: 3px;
}

.wrapped-header h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(20px, 5vw, 25px);
  letter-spacing: 0.14em;
  color: var(--ink-plum);
}

.envelope-arena {
  --env-w: min(346px, 90vw);
  --env-h: clamp(136px, 19.5dvh, 168px);
  position: relative;
  z-index: 4;
  width: min(460px, 100%);
  height: clamp(182px, 26dvh, 220px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: auto 0;
  perspective: 900px;
  transition: height 0.56s var(--ease-out);
}
.envelope-arena.is-open {
  height: clamp(296px, 45dvh, 392px);
}

/* Layer 1: Envelope Back Wall + Triangular Flap */
.kraft-back {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--env-w);
  height: var(--env-h);
  background: linear-gradient(180deg, #a67c52 0%, #8f6840 100%);
  border-radius: 6px;
  z-index: 1;
  pointer-events: none;
}

.kraft-flap {
  position: absolute;
  bottom: calc(var(--env-h) - 66px);
  left: 50%;
  width: var(--env-w);
  height: 66px;
  background: linear-gradient(180deg, #dfb98e 0%, #cca477 100%);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform: translateX(-50%) rotateX(0deg);
  transform-origin: top center;
  transition: transform 0.56s var(--ease-out), z-index 0s linear 0.16s;
  filter: drop-shadow(0 3px 4px rgba(59, 40, 30, 0.28));
  z-index: 16;
  pointer-events: none;
}

.envelope-arena.is-open .kraft-flap {
  transform: translateX(-50%) rotateX(174deg);
  background: linear-gradient(180deg, #c2986b 0%, #b08458 100%);
  z-index: 2;
}

/* Layer 2: Bottom-Only Clipped Pocket Window (Cards emerge cleanly from inside pocket, NEVER sliced at top!) */
.pocket-clip-window {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  top: 0;
  overflow: visible;
  clip-path: inset(-140px -28px 0px -28px);
  z-index: 6;
  pointer-events: none;
}

.w-emerging-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.w-card {
  position: absolute;
  left: 50%;
  bottom: 14px;
  /* Resting tucked deep INSIDE the kraft envelope pocket */
  transform: translate(-50%, 60px) scale(0.88) rotate(0deg);
  opacity: 0;
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.34s ease, box-shadow 0.28s ease;
  cursor: pointer;
  pointer-events: none;
  box-shadow: 0 10px 22px rgba(96, 68, 46, 0.18), 0 2px 6px rgba(96, 68, 46, 0.1);
  border: 1px solid rgba(145, 118, 92, 0.18);
  will-change: transform;
}

.envelope-arena.is-open .w-card {
  opacity: 1;
  pointer-events: auto;
}

/* When swapping deck: cards glide straight back DOWN into the kraft pocket! */
.envelope-arena.is-swapping .w-card {
  transform: translate(-50%, 72px) scale(0.86) rotate(0deg) !important;
  opacity: 0 !important;
  transition: transform 0.3s ease-in, opacity 0.22s ease-in !important;
}

/* Clean Single-Row Editorial Photo Stage (ZERO vertical stacking, ZERO cluttered side memos!) */
.w-photos-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.w-card-photo {
  --tx: -50%;
  --ty: calc(var(--env-h) * -0.84);
  --rot: 0deg;
  width: clamp(98px, 26vw, 130px);
  background: #fdfaf3;
  padding: 5px 5px 7px;
  border-radius: 3px;
  z-index: 8;
}
.envelope-arena.is-open .w-card-photo {
  transform: translate(var(--tx), var(--ty)) rotate(var(--rot));
}

/* Tactile Upward "抽动" Pull Motion: hover/touch lifts card straight UP in its own slot! */
.envelope-arena.is-open .w-card-photo:hover,
.envelope-arena.is-open .w-card-photo:focus-visible {
  transform: translate(var(--tx), calc(var(--ty) - 22px)) rotate(calc(var(--rot) * 0.42)) scale(1.06);
  z-index: 13 !important;
  box-shadow: 0 18px 34px rgba(52, 34, 20, 0.28);
  transition-delay: 0s !important;
}
.envelope-arena.is-open .w-card-photo.is-lifted {
  transform: translate(var(--tx), calc(var(--ty) - 32px)) rotate(0deg) scale(1.08);
  z-index: 14 !important;
  box-shadow: 0 22px 40px rgba(42, 26, 14, 0.34);
  transition-delay: 0s !important;
}

/* Tapping the open kraft envelope triggers a playful staggered upward "抽动" peek-up wave! */
.envelope-arena.is-open.is-nudging .w-card-photo {
  transform: translate(var(--tx), calc(var(--ty) - 20px)) rotate(calc(var(--rot) * 0.72)) scale(1.03);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.envelope-arena.is-open.is-nudging .w-card-photo[data-slot="0"] { transition-delay: 0s; }
.envelope-arena.is-open.is-nudging .w-card-photo[data-slot="1"] { transition-delay: 0.055s; }
.envelope-arena.is-open.is-nudging .w-card-photo[data-slot="2"] { transition-delay: 0.11s; }
.envelope-arena.is-open.is-nudging .w-card-photo[data-slot="3"] { transition-delay: 0.165s; }

/* Subtle Editorial Frame Accents */
.w-card-photo .w-photo-tape {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(-2.5deg);
  width: 34px;
  height: 10px;
  border-radius: 1px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(232, 198, 178, 0.72) 0 4px,
    rgba(255, 250, 244, 0.68) 4px 8px
  );
  box-shadow: 0 1px 2px rgba(74, 56, 62, 0.1);
  pointer-events: none;
}
.w-card-photo .w-photo-tape.tape-ice {
  background: repeating-linear-gradient(
    -45deg,
    rgba(176, 206, 232, 0.76) 0 4px,
    rgba(244, 250, 255, 0.74) 4px 8px
  );
}
.w-card-photo .w-photo-tape.tape-blush {
  background: repeating-linear-gradient(
    -45deg,
    rgba(236, 186, 198, 0.74) 0 4px,
    rgba(255, 247, 249, 0.72) 4px 8px
  );
}
.w-card-photo .w-photo-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  padding: 2px 6px;
  border-radius: 999px;
  font-family: var(--font-serif-en);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fffaf2;
  background: linear-gradient(135deg, #c46a5a, #9e4339);
  box-shadow: 0 3px 8px rgba(96, 36, 28, 0.25);
  transform: rotate(6deg);
  pointer-events: none;
}
.w-card-photo.is-gold-frame {
  background: linear-gradient(155deg, #fffdf7, #f5e9ce);
  border: 1.5px solid rgba(199, 159, 88, 0.68);
}
.w-card-photo.is-film-frame {
  background: #27211f;
  border-color: #423733;
}
.w-card-photo.is-film-frame .w-polaroid-cap {
  color: #f3e8d8;
}
.w-card-photo.is-mag-frame {
  background: #fdfbf7;
  padding: 5px 6px 7px;
  border: 1px solid rgba(140, 108, 74, 0.28);
}
.w-mag-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-serif-en);
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #7c5e3c;
  margin-bottom: 3px;
  padding-bottom: 2px;
  border-bottom: 0.5px solid rgba(140, 108, 74, 0.24);
}

.w-polaroid-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1px;
}

.w-polaroid-cap {
  margin-top: 4px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 9px;
  color: #4b3a32;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ================================================================
   7 CLEAN, SINGLE-ROW, ZERO-STACKING EDITORIAL LAYOUTS (y1 ~ y7)
   ================================================================ */

/* YEAR 1 (2 Spacious Large Polaroids — airy duo!) */
.year-layout-1 .w-card-photo[data-slot="0"] {
  width: clamp(114px, 31vw, 146px);
  z-index: 8;
  --tx: -104%;
  --ty: calc(var(--env-h) * -0.84);
  --rot: -6deg;
  transition-delay: 0.14s;
}
.year-layout-1 .w-card-photo[data-slot="1"] {
  width: clamp(118px, 32vw, 150px);
  z-index: 10;
  --tx: 2%;
  --ty: calc(var(--env-h) * -0.90);
  --rot: 5deg;
  transition-delay: 0.22s;
}

/* YEAR 2 (3 Classic Balanced Fan Polaroids — crisp symmetry!) */
.year-layout-2 .w-card-photo[data-slot="0"] {
  width: clamp(98px, 26vw, 128px);
  z-index: 7;
  --tx: -128%;
  --ty: calc(var(--env-h) * -0.82);
  --rot: -9deg;
  transition-delay: 0.14s;
}
.year-layout-2 .w-card-photo[data-slot="1"] {
  width: clamp(110px, 29.5vw, 142px);
  z-index: 10;
  --tx: -50%;
  --ty: calc(var(--env-h) * -0.92);
  --rot: 0deg;
  transition-delay: 0.22s;
}
.year-layout-2 .w-card-photo[data-slot="2"] {
  width: clamp(98px, 26vw, 128px);
  z-index: 8;
  --tx: 28%;
  --ty: calc(var(--env-h) * -0.82);
  --rot: 9deg;
  transition-delay: 0.28s;
}

/* YEAR 3 (3 Ascending Staircase Polaroids with Ice-Blue Tape — rhythmic height play!) */
.year-layout-3 .w-card-photo[data-slot="0"] {
  width: clamp(96px, 25.5vw, 124px);
  z-index: 8;
  --tx: -130%;
  --ty: calc(var(--env-h) * -0.84);
  --rot: -7deg;
  transition-delay: 0.14s;
}
.year-layout-3 .w-card-photo[data-slot="1"] {
  width: clamp(106px, 28vw, 136px);
  z-index: 10;
  --tx: -50%;
  --ty: calc(var(--env-h) * -0.96);
  --rot: -1deg;
  transition-delay: 0.22s;
}
.year-layout-3 .w-card-photo[data-slot="2"] {
  width: clamp(98px, 26vw, 128px);
  z-index: 9;
  --tx: 26%;
  --ty: calc(var(--env-h) * -0.86);
  --rot: 7deg;
  transition-delay: 0.28s;
}

/* YEAR 4 (2 Asymmetric Editorial Spread — Portrait Magazine Cover + Wide Landscape Frame!) */
.year-layout-4 .w-card-photo[data-slot="0"] {
  width: clamp(108px, 29vw, 138px);
  z-index: 10;
  --tx: -116%;
  --ty: calc(var(--env-h) * -0.86);
  --rot: -4deg;
  transition-delay: 0.16s;
}
.year-layout-4 .w-card-photo[data-slot="0"] .w-polaroid-img {
  aspect-ratio: 4 / 4.2;
}
.year-layout-4 .w-card-photo[data-slot="1"] {
  width: clamp(134px, 36vw, 174px);
  z-index: 9;
  --tx: -4%;
  --ty: calc(var(--env-h) * -0.86);
  --rot: 4deg;
  transition-delay: 0.24s;
}
.year-layout-4 .w-card-photo[data-slot="1"] .w-polaroid-img {
  aspect-ratio: 4 / 3;
}

/* YEAR 5 (4 Sleek Dark-Film Polaroids in Clean Single Row!) */
.year-layout-5 .w-card-photo {
  width: clamp(82px, 21.8vw, 110px);
  padding: 4px 4px 7px;
}
.year-layout-5 .w-card-photo[data-slot="0"] {
  z-index: 7;
  --tx: -164%;
  --ty: calc(var(--env-h) * -0.82);
  --rot: -11deg;
  transition-delay: 0.12s;
}
.year-layout-5 .w-card-photo[data-slot="1"] {
  z-index: 9;
  --tx: -92%;
  --ty: calc(var(--env-h) * -0.94);
  --rot: -3deg;
  transition-delay: 0.18s;
}
.year-layout-5 .w-card-photo[data-slot="2"] {
  z-index: 10;
  --tx: -10%;
  --ty: calc(var(--env-h) * -0.94);
  --rot: 3deg;
  transition-delay: 0.24s;
}
.year-layout-5 .w-card-photo[data-slot="3"] {
  z-index: 8;
  --tx: 64%;
  --ty: calc(var(--env-h) * -0.82);
  --rot: 11deg;
  transition-delay: 0.30s;
}

/* YEAR 6 (3 Wide-Border Postcard Trio — breezy island spacing!) */
.year-layout-6 .w-card-photo[data-slot="0"] {
  width: clamp(98px, 26vw, 128px);
  z-index: 8;
  --tx: -130%;
  --ty: calc(var(--env-h) * -0.84);
  --rot: -7deg;
  transition-delay: 0.14s;
}
.year-layout-6 .w-card-photo[data-slot="1"] {
  width: clamp(112px, 30vw, 144px);
  z-index: 10;
  --tx: -50%;
  --ty: calc(var(--env-h) * -0.92);
  --rot: 1deg;
  transition-delay: 0.22s;
}
.year-layout-6 .w-card-photo[data-slot="2"] {
  width: clamp(98px, 26vw, 128px);
  z-index: 8;
  --tx: 30%;
  --ty: calc(var(--env-h) * -0.84);
  --rot: 7deg;
  transition-delay: 0.28s;
}

/* YEAR 7 (4 Collector's Finale Crown — clean single row with dark polaroid & gold AI bonus!) */
.year-layout-7 .w-card-photo {
  width: clamp(82px, 21.8vw, 110px);
  padding: 4px 4px 7px;
}
.year-layout-7 .w-card-photo[data-slot="0"] {
  z-index: 7;
  --tx: -164%;
  --ty: calc(var(--env-h) * -0.82);
  --rot: -11deg;
  transition-delay: 0.12s;
}
.year-layout-7 .w-card-photo[data-slot="1"] {
  width: clamp(88px, 23.5vw, 118px);
  z-index: 10;
  --tx: -92%;
  --ty: calc(var(--env-h) * -0.96);
  --rot: -3deg;
  transition-delay: 0.18s;
}
.year-layout-7 .w-card-photo[data-slot="2"] {
  width: clamp(88px, 23.5vw, 118px);
  z-index: 9;
  --tx: -10%;
  --ty: calc(var(--env-h) * -0.96);
  --rot: 3deg;
  transition-delay: 0.24s;
}
.year-layout-7 .w-card-photo[data-slot="3"] {
  z-index: 8;
  --tx: 64%;
  --ty: calc(var(--env-h) * -0.82);
  --rot: 11deg;
  transition-delay: 0.30s;
}

/* Layer 3 (Front): Unified Classic Kraft Front Pocket */
.kraft-envelope {
  position: relative;
  z-index: 14;
  width: var(--env-w);
  height: var(--env-h);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 240, 215, 0.24), transparent 60%),
    linear-gradient(160deg, #dab890 0%, #cba377 100%);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 22px 44px rgba(112, 80, 50, 0.22), 0 4px 12px rgba(112, 80, 50, 0.12), inset 0 1px 0 rgba(255, 246, 230, 0.48);
  cursor: pointer;
  transition: transform 0.22s var(--ease-spring);
}
.kraft-envelope:active {
  transform: scale(0.99);
}
.envelope-arena.is-open .kraft-envelope {
  mask-image: radial-gradient(circle 13px at 50% 0, transparent 96%, #000 100%);
  -webkit-mask-image: radial-gradient(circle 13px at 50% 0, transparent 96%, #000 100%);
}

/* Bespoke Per-Year 3D Soft-Matte Porcelain Charm Pin (Matches Act 5/6/7 3D Toycraft DNA!) */
.kraft-charm-pin {
  position: absolute;
  top: 8px;
  left: 14px;
  z-index: 15;
  width: clamp(44px, 12vw, 54px);
  height: clamp(44px, 12vw, 54px);
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 5px 8px rgba(72, 46, 24, 0.28));
  transform: rotate(-8deg) scale(1);
  transition: transform 0.42s var(--ease-spring), opacity 0.28s ease;
}
.envelope-arena.is-swapping .kraft-charm-pin {
  transform: rotate(-18deg) scale(0.72);
  opacity: 0;
}

/* Closed state covers full top seam until flap flips back */
.envelope-arena:not(.is-open) .kraft-back .kraft-flap {
  z-index: 20;
}

.kraft-lip-shadow {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: linear-gradient(180deg, rgba(84, 54, 28, 0.22), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.envelope-arena.is-open .kraft-lip-shadow {
  opacity: 1;
}

/* String clasp sits cleanly above closed flap & pocket */
.string-clasp {
  position: absolute;
  bottom: calc(var(--env-h) - 90px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  pointer-events: none;
}

.clasp-btn {
  width: 17px; height: 17px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e4c49c, #ad8256);
  border: 2px solid #8a633e;
  box-shadow: 0 2px 5px rgba(30, 16, 8, 0.35);
  position: relative;
}
.clasp-btn::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #6b4829; }

.clasp-twine {
  position: absolute;
  top: 8px;
  width: 3px; height: 35px;
  background: repeating-linear-gradient(45deg, #f6ead4 0 3px, #d7bfa0 3px 5px);
  border-radius: 2px;
  transition: transform 0.55s var(--ease-out), opacity 0.45s ease;
}
.envelope-arena.is-open .clasp-twine { transform: scaleY(0.1) rotate(90deg); opacity: 0; }

.kraft-title-wrap { position: absolute; bottom: 12px; left: 18px; right: 18px; z-index: 15; pointer-events: none; }
.kraft-year { font-family: var(--font-serif-en); font-weight: 700; font-size: clamp(28px, 7.6vw, 40px); line-height: 0.9; color: #1c1512; }
.kraft-wrapped { font-family: var(--font-serif-en); font-weight: 600; font-size: clamp(30px, 8.2vw, 42px); line-height: 0.95; color: #1c1512; margin-left: 20px; }

.crimson-badge {
  position: absolute; top: 58px; left: 53%; z-index: 15;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--crimson-seal); color: #faf5ea;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-serif-en); font-size: 9px; line-height: 1.05;
  box-shadow: 0 5px 12px rgba(45, 14, 10, 0.32);
  border: 2px dotted rgba(250, 245, 234, 0.45);
  transform: rotate(-8deg);
}

.blue-stamp {
  position: absolute; top: 16px; right: 14px; z-index: 15;
  width: 58px; height: 42px; background: #faf5ea; padding: 4px;
  box-shadow: 0 4px 10px rgba(32, 18, 10, 0.25);
  transform: rotate(5deg); border: 2px dotted #d9cdb8;
}

.blue-stamp-inner {
  width: 100%; height: 100%;
  background: linear-gradient(145deg, #c9dff2, #a9cae8);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif-en); font-style: italic; font-weight: 700; font-size: 13px; color: #2c435a;
  transition: background 0.35s ease, color 0.35s ease;
}

/* ================================================================
   UNIFIED CLASSIC KRAFT ENVELOPE WITH SUBTLE VINTAGE STAMP ACCENTS (y1 ~ y7)
   ================================================================ */
.envelope-arena.is-open.theme-y1 .blue-stamp-inner { background: linear-gradient(145deg, #d7e8f6, #b6d3ea); color: #2c4b66; }
.envelope-arena.is-open.theme-y2 .blue-stamp-inner { background: linear-gradient(145deg, #d6e4d8, #b3cbb8); color: #264732; }
.envelope-arena.is-open.theme-y3 .blue-stamp-inner { background: linear-gradient(145deg, #e1eef8, #bdd6ea); color: #2b4b68; }
.envelope-arena.is-open.theme-y4 .blue-stamp-inner { background: linear-gradient(145deg, #f5e6c4, #e5cb94); color: #5e421b; }
.envelope-arena.is-open.theme-y5 .blue-stamp-inner { background: linear-gradient(145deg, #f2dbe2, #e0bac6); color: #633142; }
.envelope-arena.is-open.theme-y6 .blue-stamp-inner { background: linear-gradient(145deg, #d2ece8, #a7d5ce); color: #214e48; }
.envelope-arena.is-open.theme-y7 .blue-stamp-inner { background: linear-gradient(145deg, #f5dfe3, #e6caa0); color: #59333b; }

.wrapped-footer { z-index: 16; display: flex; flex-direction: column; align-items: center; gap: 9px; flex-shrink: 0; }
.wrapped-subhint { font-family: var(--font-serif); font-size: 11.5px; letter-spacing: 0.08em; color: var(--ink-muted); text-align: center; }
.wrapped-btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }

.wrapped-year-bar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 4px;
  max-width: min(460px, 98vw);
  margin-bottom: 4px;
  animation: fadeSlideUp 0.45s var(--ease-out);
}
.wrapped-year-pill {
  padding: 4px 6.5px;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: #7c6252;
  background: rgba(255, 252, 246, 0.86);
  border: 1px solid rgba(189, 119, 109, 0.24);
  transition: all 0.22s var(--ease-spring);
}
.wrapped-year-pill:hover { border-color: rgba(189, 119, 109, 0.52); transform: translateY(-1px); }
.wrapped-year-pill.is-active {
  background: var(--ink-plum);
  color: #faf5ea;
  border-color: var(--ink-plum);
  box-shadow: 0 4px 12px rgba(74, 56, 62, 0.2);
}

.wrapped-shuffle-btn {
  padding: 8px 15px;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--ink-plum);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(189, 119, 109, 0.36);
  box-shadow: 0 4px 14px rgba(112, 80, 50, 0.08);
  transition: transform 0.2s ease, background 0.2s ease;
}
.wrapped-shuffle-btn:active { transform: scale(0.95); }

/* ==========================================================================
   ACT 3 · PHYSICAL HANDMADE SCRAPBOOK JOURNAL (Dot-Grid, Washi Tape & Stubs!)
   ========================================================================== */
#scene-3 {
  background:
    radial-gradient(ellipse 74% 62% at 50% 24%, #fbf7ef 0%, #f1e9dc 58%, #e5dac9 100%);
  padding: calc(52px + env(safe-area-inset-top)) 12px calc(16px + env(safe-area-inset-bottom));
  justify-content: flex-start;
  gap: 8px;
}

.scrapbook-shell {
  width: min(880px, 100%);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Tactile Cardstock Index Tabs tucked cleanly behind the journal cover */
.folder-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  padding: 0 10px 0 18px;
  position: relative;
  z-index: 2;
}

.folder-tab {
  min-width: 0;
  padding: 7px 2px 8px;
  border-radius: 10px 10px 0 0;
  text-align: center;
  border: 1px solid rgba(110, 86, 66, 0.16);
  border-bottom: none;
  opacity: 0.78;
  overflow: hidden;
  outline: none;
  box-shadow: inset 0 -4px 8px rgba(110, 82, 58, 0.08);
  transition: transform 0.25s var(--ease-out), opacity 0.25s ease, box-shadow 0.25s ease;
}
.folder-tab:focus-visible {
  box-shadow: 0 0 0 2px rgba(189, 119, 109, 0.45);
}

.folder-tab[data-tab="cities"] { background: #f8ecc0; color: #544122; }
.folder-tab[data-tab="concerts"] { background: #d5e3c9; color: #2b4428; }
.folder-tab[data-tab="film"] { background: #f3cde3; color: #562849; }
.folder-tab[data-tab="food"] { background: #f8dbc6; color: #613924; }
.folder-tab.is-active {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 -4px 12px rgba(96, 70, 48, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.folder-tab-cn { display: block; font-family: var(--font-serif); font-size: clamp(11px, 2.9vw, 13px); font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; }
.folder-tab-en { display: block; font-family: var(--font-serif-en); font-size: 8.5px; letter-spacing: 0.06em; opacity: 0.72; white-space: nowrap; }

/* Physical Camel-Linen Hardcover Book Frame + Layered Stacked Paper Edges */
.scrapbook-book {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  padding: 6px 6px 8px 11px;
  border-radius: 6px 14px 14px 6px;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 2px, transparent 2px 5px),
    linear-gradient(155deg, #d7c1a5 0%, #c6ac8c 55%, #b99c7a 100%);
  border: 1px solid rgba(124, 94, 66, 0.34);
  box-shadow:
    0 18px 38px rgba(84, 62, 44, 0.18),
    0 3px 0 #ede4d4,
    0 5px 0 #d9cbb6,
    inset 0 1px 0 rgba(255, 248, 236, 0.55);
  z-index: 4;
}

/* Brushed Brass Twin-Wire Spiral Rings along Left Spine */
.journal-rings {
  position: absolute;
  left: -3px;
  top: 18px;
  bottom: 18px;
  width: 22px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}
.journal-rings span {
  position: relative;
  display: block;
  width: 19px;
  height: 9px;
  border-radius: 99px;
  background: linear-gradient(180deg, #f3e4c3 0%, #cfb37c 48%, #987b4b 100%);
  box-shadow: 0 2px 4px rgba(58, 38, 22, 0.34), inset 0 1px 1px rgba(255, 252, 240, 0.7);
}
.journal-rings span::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(114, 88, 66, 0.28);
  box-shadow: inset 1px 1px 2px rgba(62, 44, 30, 0.45);
}

/* Satin Terracotta Ribbon Bookmark */
.journal-ribbon {
  position: absolute;
  top: -1px;
  right: 18px;
  width: 22px;
  height: 36px;
  background: linear-gradient(180deg, #c9776b 0%, #b56155 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  box-shadow: 0 4px 10px rgba(96, 46, 38, 0.28);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5px;
  z-index: 10;
  pointer-events: none;
}
.journal-ribbon span {
  font-family: var(--font-serif-en);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: rgba(255, 246, 234, 0.92);
}

/* 5mm Dot-Grid Cotton Journal Paper Sheet */
.scrapbook-panel {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  border-radius: 3px 10px 10px 3px;
  padding: 14px 14px 18px 20px;
  border: 1px solid rgba(154, 132, 108, 0.24);
  box-shadow:
    inset 10px 0 14px -10px rgba(108, 82, 56, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 6px rgba(84, 62, 44, 0.08);
  background-image: radial-gradient(rgba(148, 126, 106, 0.25) 1px, transparent 1px);
  background-size: 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(164, 138, 114, 0.35) transparent;
}
.scrapbook-panel::-webkit-scrollbar { width: 5px; }
.scrapbook-panel::-webkit-scrollbar-track { background: transparent; }
.scrapbook-panel::-webkit-scrollbar-thumb { background: rgba(164, 138, 114, 0.34); border-radius: 99px; }

.scrapbook-panel.tab-cities { background-color: #fdfaf0; }
.scrapbook-panel.tab-concerts { background-color: #f4f7ef; }
.scrapbook-panel.tab-film { background-color: #fdf4f9; }
.scrapbook-panel.tab-food { background-color: #fef7f0; }

/* Subtle Journal Page Header Meta Bar */
.journal-page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(154, 132, 108, 0.32);
  padding-right: 26px;
}
.journal-date-stamp {
  font-family: var(--font-serif-en);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--terracotta);
  padding: 2px 7px;
  border: 1px solid rgba(189, 119, 109, 0.42);
  border-radius: 3px;
  background: rgba(255, 252, 246, 0.72);
}
.journal-page-note {
  font-family: var(--font-serif);
  font-size: 11px;
  color: #7c675d;
  letter-spacing: 0.03em;
}

/* Shared Translucent Washi Tape Palettes */
.tape-gold { background: repeating-linear-gradient(45deg, rgba(235, 206, 140, 0.72) 0 6px, rgba(246, 226, 174, 0.62) 6px 12px); }
.tape-pink { background: repeating-linear-gradient(-45deg, rgba(235, 178, 196, 0.72) 0 6px, rgba(246, 206, 219, 0.6) 6px 12px); }
.tape-sage { background: repeating-linear-gradient(45deg, rgba(178, 206, 174, 0.74) 0 6px, rgba(208, 228, 204, 0.62) 6px 12px); }
.tape-lavender { background: repeating-linear-gradient(-45deg, rgba(196, 182, 224, 0.72) 0 6px, rgba(220, 210, 238, 0.62) 6px 12px); }
.tape-apricot { background: repeating-linear-gradient(45deg, rgba(240, 194, 158, 0.74) 0 6px, rgba(248, 216, 190, 0.62) 6px 12px); }

/* --- TAB 1: 山海 7 城 (Passport Chips, Taped Polaroid & Ruled Memo Slip) --- */
.city-pill-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.city-pill {
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-serif);
  font-size: 11.5px;
  background: rgba(255, 253, 247, 0.88);
  border: 1px dashed rgba(132, 108, 86, 0.36);
  color: #6b574e;
  box-shadow: 0 2px 5px rgba(96, 72, 48, 0.05);
  transition: all 0.2s ease;
}
.city-pill small { opacity: 0.65; }
.city-pill.is-active {
  background: #4a383e;
  color: #faf5ea;
  border-style: solid;
  border-color: #4a383e;
  transform: rotate(-1deg);
  box-shadow: 0 4px 10px rgba(74, 56, 62, 0.22);
}

.city-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: fadeSlideUp 0.36s var(--ease-out);
}

.city-gallery-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(306px, 90%);
  flex-shrink: 0;
}

.stamp-photo-frame {
  position: relative;
  width: 100%;
  padding: 9px 9px 10px;
  border-radius: 3px;
  border: 1px solid rgba(154, 132, 108, 0.28);
  box-shadow: 0 12px 26px rgba(84, 62, 44, 0.14), 0 2px 5px rgba(84, 62, 44, 0.08);
  transform: rotate(-1.3deg);
  cursor: pointer;
  transition: transform 0.28s var(--ease-spring);
}
.stamp-photo-frame:hover { transform: rotate(0deg) translateY(-2px); }

.washi-tape {
  position: absolute;
  width: 62px;
  height: 17px;
  z-index: 4;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(84, 62, 44, 0.14);
}
.washi-tape.tape-tl {
  top: -8px;
  left: -14px;
  transform: rotate(-28deg);
  background: repeating-linear-gradient(45deg, rgba(176, 206, 224, 0.76) 0 5px, rgba(208, 228, 240, 0.64) 5px 10px);
}
.washi-tape.tape-br {
  bottom: -7px;
  right: -12px;
  transform: rotate(-26deg);
  background: repeating-linear-gradient(-45deg, rgba(235, 198, 152, 0.76) 0 5px, rgba(246, 222, 190, 0.64) 5px 10px);
}

.stamp-photo-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 4.05;
  overflow: hidden;
  border-radius: 2px;
  background: #ebe4d7;
}
.stamp-photo-inner img { width: 100%; height: 100%; object-fit: cover; }

.stamp-polaroid-foot {
  margin-top: 7px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 11px;
  color: #6b564b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stamp-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-plum);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  z-index: 4;
}
.stamp-nav-btn.prev { left: 8px; }
.stamp-nav-btn.next { right: 8px; }

.stamp-badge-corner {
  position: absolute; bottom: 8px; right: 8px;
  padding: 2px 7px; border-radius: 3px;
  background: rgba(34, 24, 20, 0.72); color: #faf5ea;
  font-family: var(--font-serif-en); font-size: 10.5px; letter-spacing: 0.08em;
}

.stamp-thumb-strip { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.stamp-thumb {
  width: 38px; height: 38px; padding: 2px; background: #fffdf8;
  border-radius: 3px; overflow: hidden;
  border: 1.5px solid rgba(154, 132, 108, 0.25);
  box-shadow: 0 2px 6px rgba(84, 62, 44, 0.1);
  opacity: 0.68; transition: all 0.22s ease;
}
.stamp-thumb.is-active { border-color: var(--terracotta); opacity: 1; transform: scale(1.08) rotate(-2deg); }
.stamp-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 1px; }

/* Ruled Cream Memo Slip + Vintage Circular Rubber Postmark */
.city-story-box {
  position: relative;
  width: 100%;
  max-width: 440px;
  text-align: left;
  padding: 16px 16px 14px;
  border-radius: 4px;
  background-color: #fffdf7;
  background-image: repeating-linear-gradient(to bottom, transparent 0 23px, rgba(176, 152, 128, 0.18) 23px 24px);
  border: 1px solid rgba(164, 140, 114, 0.28);
  box-shadow: 0 8px 20px rgba(96, 72, 48, 0.09);
  transform: rotate(0.6deg);
}
.memo-tape-top {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  width: 68px;
  height: 16px;
  background: repeating-linear-gradient(45deg, rgba(224, 198, 158, 0.74) 0 5px, rgba(242, 222, 192, 0.62) 5px 10px);
  box-shadow: 0 1px 3px rgba(84, 62, 44, 0.12);
  pointer-events: none;
}
.postal-stamp {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1.8px double var(--stamp-c, #bd776d);
  color: var(--stamp-c, #bd776d);
  opacity: 0.56;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  transform: rotate(13deg);
  pointer-events: none;
}
.postal-stamp .ps-top,
.postal-stamp .ps-bot { font-family: var(--font-serif-en); font-size: 7.5px; letter-spacing: 0.1em; line-height: 1.1; }
.postal-stamp strong { font-size: 11px; line-height: 1.25; }

.city-date-line { font-family: var(--font-serif-en); font-size: 11px; letter-spacing: 0.14em; color: var(--terracotta); }
.city-name-row { display: flex; align-items: baseline; gap: 10px; margin: 3px 0 6px; padding-right: 64px; }
.city-name-cn { font-family: var(--font-serif); font-size: 21px; font-weight: 600; color: var(--ink-plum); }
.city-name-en { font-family: var(--font-serif-en); font-size: 12.5px; letter-spacing: 0.12em; color: var(--ink-muted); }
.city-tags { display: inline-block; padding: 2px 9px; border-radius: 4px; background: rgba(189, 119, 109, 0.1); border: 1px dashed rgba(189, 119, 109, 0.32); font-size: 10.5px; color: #7a4c45; margin-bottom: 8px; }
.city-story-text { font-family: var(--font-serif); font-size: 12.5px; line-height: 24px; color: #544248; }
.city-photo-sub { margin-top: 8px; font-family: var(--font-serif); font-size: 10.5px; color: #9c7d72; }

/* --- TAB 2: 最佳搭子 (Hand-Pasted Die-Cut Physical Concert Ticket Stubs!) --- */
.concerts-grid { display: grid; grid-template-columns: 1fr; gap: 18px; padding: 6px 2px 4px; }
.a24-poster {
  position: relative;
  cursor: pointer;
  filter: drop-shadow(0 8px 16px rgba(52, 38, 32, 0.18));
  transition: transform 0.28s var(--ease-spring), filter 0.25s ease;
}
.a24-poster.tilt-0 { transform: rotate(-0.9deg); }
.a24-poster.tilt-1 { transform: rotate(0.85deg); }
.a24-poster.tilt-2 { transform: rotate(-0.65deg); }
.a24-poster.tilt-3 { transform: rotate(0.95deg); }
.a24-poster:hover { transform: rotate(0deg) translateY(-3px); filter: drop-shadow(0 14px 24px rgba(52, 38, 32, 0.24)); }

.ticket-washi {
  position: absolute;
  top: -9px;
  left: 28%;
  transform: rotate(-3deg);
  width: 68px;
  height: 17px;
  z-index: 6;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(74, 56, 42, 0.15);
}
.a24-poster.tilt-1 .ticket-washi,
.a24-poster.tilt-3 .ticket-washi { left: auto; right: 24%; transform: rotate(3.5deg); }

.a24-ticket-body {
  display: grid;
  grid-template-columns: 106px 1fr 34px;
  background: var(--t-bg, #243554);
  color: #faf5ea;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(255, 250, 238, 0.16);
  mask-image:
    radial-gradient(circle 7px at calc(100% - 34px) 0, transparent 96%, #000 100%),
    radial-gradient(circle 7px at calc(100% - 34px) 100%, transparent 96%, #000 100%),
    radial-gradient(circle 6px at 0 50%, transparent 96%, #000 100%);
  -webkit-mask-image:
    radial-gradient(circle 7px at calc(100% - 34px) 0, transparent 96%, #000 100%),
    radial-gradient(circle 7px at calc(100% - 34px) 100%, transparent 96%, #000 100%),
    radial-gradient(circle 6px at 0 50%, transparent 96%, #000 100%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

.a24-photo-wrap { position: relative; width: 100%; height: 100%; min-height: 138px; padding: 6px 0 6px 6px; }
.a24-photo-wrap img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; border: 1.5px solid rgba(255, 250, 238, 0.72); }
.a24-count-badge {
  position: absolute; bottom: 10px; left: 10px;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(18, 12, 16, 0.76); color: #faf5ea;
  font-size: 9px; letter-spacing: 0.04em;
}
.a24-info { padding: 11px 11px 11px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.a24-stub-row { display: flex; justify-content: space-between; font-family: var(--font-serif-en); font-size: 9.5px; letter-spacing: 0.12em; opacity: 0.85; }
.a24-artist { font-family: var(--font-serif); font-size: 17px; font-weight: 600; letter-spacing: 0.06em; }
.a24-venue { font-size: 10.5px; letter-spacing: 0.04em; }
.a24-tagline { font-family: var(--font-serif); font-size: 11px; line-height: 1.52; color: rgba(250, 245, 234, 0.9); }

.a24-tear-stub {
  border-left: 1.5px dashed rgba(255, 250, 238, 0.34);
  background: rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
}
.a24-stub-code {
  writing-mode: vertical-rl;
  font-family: var(--font-serif-en);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  color: var(--t-accent, #f7d394);
  opacity: 0.92;
}
.a24-stub-bars {
  width: 14px;
  height: 26px;
  background: repeating-linear-gradient(180deg, rgba(255, 250, 238, 0.72) 0 1.5px, transparent 1.5px 3.5px, rgba(255, 250, 238, 0.72) 3.5px 5.5px, transparent 5.5px 7.5px);
  opacity: 0.75;
}
.a24-stub-no { font-family: var(--font-serif-en); font-size: 11px; font-weight: 700; color: #faf5ea; }

/* --- TAB 3: 长沙胶片 (Punched-Sprocket 35mm Film Strip + Taped Polaroid Memo) --- */
.film-strip-wrap { display: flex; flex-direction: column; gap: 16px; }
.film-roll-shell { position: relative; padding-top: 4px; }
.film-tape {
  position: absolute;
  top: -4px;
  width: 54px;
  height: 15px;
  z-index: 6;
  pointer-events: none;
  background: rgba(236, 214, 174, 0.78);
  box-shadow: 0 1px 3px rgba(60, 42, 28, 0.18);
}
.film-tape.left { left: 16px; transform: rotate(-16deg); }
.film-tape.right { right: 16px; transform: rotate(14deg); }

.film-roll {
  position: relative;
  display: flex;
  gap: 11px;
  overflow-x: auto;
  padding: 20px 12px;
  background: #201b19;
  border-radius: 5px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 10px 24px rgba(52, 36, 28, 0.22);
  background-image:
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(250, 245, 235, 0.82) 8px 18px, transparent 18px 26px),
    repeating-linear-gradient(90deg, transparent 0 8px, rgba(250, 245, 235, 0.82) 8px 18px, transparent 18px 26px);
  background-size: 100% 7px, 100% 7px;
  background-position: 0 6px, 0 calc(100% - 6px);
  background-repeat: no-repeat;
}
.film-frame {
  flex: 0 0 176px; scroll-snap-align: center;
  background: #141110; border: 1.5px solid rgba(255, 245, 224, 0.16);
  border-radius: 3px; padding: 6px; cursor: pointer; transition: border-color 0.2s ease, transform 0.2s ease;
}
.film-frame.is-selected { border-color: #e4a957; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(228, 169, 87, 0.24); }
.film-frame img { width: 100%; aspect-ratio: 4 / 3.3; object-fit: cover; border-radius: 2px; }
.film-frame-meta { display: flex; justify-content: space-between; font-family: var(--font-serif-en); font-size: 9px; letter-spacing: 0.12em; color: #e4a957; margin-top: 5px; }
.film-frame-cap { margin-top: 2px; font-family: var(--font-serif); font-size: 11px; color: #faf5ea; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.film-highlight-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  background-color: #fffdf8;
  background-image: repeating-linear-gradient(to bottom, transparent 0 21px, rgba(176, 152, 128, 0.16) 21px 22px);
  border: 1px solid rgba(164, 140, 114, 0.28);
  border-radius: 4px;
  padding: 13px 12px 11px;
  box-shadow: 0 8px 20px rgba(84, 62, 44, 0.1);
  transform: rotate(-0.5deg);
  cursor: pointer;
}
.film-hl-polaroid {
  background: #ffffff;
  padding: 4px 4px 10px;
  border-radius: 2px;
  box-shadow: 0 4px 12px rgba(74, 56, 42, 0.16);
  transform: rotate(-2.5deg);
}
.film-hl-polaroid img { width: 88px; height: 84px; object-fit: cover; border-radius: 1px; }
.film-hl-code { font-family: var(--font-serif-en); font-size: 10px; letter-spacing: 0.1em; color: var(--terracotta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.film-hl-title { font-family: var(--font-serif); font-size: 15px; font-weight: 600; color: var(--ink-plum); margin: 2px 0 4px; }
.film-hl-cap { font-family: var(--font-serif); font-size: 12px; line-height: 22px; color: var(--ink-muted); }

/* --- TAB 4: 烟火食光 (Hand-Pasted Polaroid Food Scrapbook Collage!) --- */
.food-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 12px;
  padding: 8px 2px 6px;
  animation: fadeSlideUp 0.36s var(--ease-out);
}
.food-card {
  position: relative;
  background: #fffdf8;
  border: 1px solid rgba(168, 142, 116, 0.26);
  border-radius: 3px;
  padding: 7px 7px 10px;
  box-shadow: 0 8px 18px rgba(96, 68, 44, 0.11), 0 1px 3px rgba(96, 68, 44, 0.08);
  cursor: pointer;
  transition: transform 0.26s var(--ease-spring), box-shadow 0.24s ease;
}
.food-card.tilt-0 { transform: rotate(-1.4deg); }
.food-card.tilt-1 { transform: rotate(1.2deg); }
.food-card.tilt-2 { transform: rotate(0.8deg); }
.food-card.tilt-3 { transform: rotate(-1.1deg); }
.food-card:hover { transform: rotate(0deg) translateY(-4px) scale(1.02); box-shadow: 0 14px 26px rgba(96, 68, 44, 0.18); z-index: 4; }

.food-washi {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 52px;
  height: 15px;
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(84, 62, 44, 0.14);
}
.food-card.tilt-1 .food-washi,
.food-card.tilt-2 .food-washi { transform: translateX(-50%) rotate(2.5deg); }

.food-photo-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3.45; overflow: hidden; background: #efe4d8; border-radius: 1px; }
.food-photo-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.38s ease; }
.food-card:hover .food-photo-wrap img { transform: scale(1.04); }

.food-card-body { padding: 7px 2px 0; text-align: left; }
.food-stamp-tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(189, 119, 109, 0.45);
  background: rgba(252, 236, 226, 0.65);
  color: #a85b4f;
  font-family: var(--font-serif);
  font-size: 9px;
  letter-spacing: 0.04em;
}
.food-card-title { font-family: var(--font-serif); font-size: 12px; font-weight: 600; color: var(--ink-plum); line-height: 1.35; margin-bottom: 3px; }
.food-card-cap { font-family: var(--font-serif); font-size: 10.5px; line-height: 1.52; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.scrapbook-footer { display: flex; justify-content: center; padding-top: 12px; }

/* ==========================================================================
   ACT 4 · BAMEI & ROUROU (Flying Vector Props + Direct Tap-to-Pet!)
   ========================================================================== */
#scene-4 {
  background-color: #f7f5f0;
  background-image:
    linear-gradient(rgba(165, 160, 150, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(165, 160, 150, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  padding: calc(52px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  justify-content: center;
  gap: 12px;
}

.dogs-stage { width: min(640px, 100%); display: flex; flex-direction: column; align-items: center; gap: 9px; margin: 0; }
.dog-mode-switch { display: inline-grid; grid-template-columns: 1fr 1fr; background: rgba(255, 255, 255, 0.9); border: 1px solid rgba(74, 56, 62, 0.12); border-radius: 999px; padding: 3px; width: min(340px, 100%); box-shadow: 0 6px 18px rgba(74, 56, 62, 0.06); }
.dog-mode-btn { padding: 6px 10px; border-radius: 999px; font-family: var(--font-serif); font-size: 12px; color: var(--ink-muted); transition: all 0.28s var(--ease-out); }
.dog-mode-btn.is-active { background: #4a383e; color: #faf5ea; }

.dogs-art-frame {
  position: relative;
  width: min(442px, 94vw);
  height: clamp(246px, 35.5dvh, 314px);
  background: #fdf8f0;
  border-radius: 22px;
  border: 1px solid rgba(154, 128, 108, 0.22);
  box-shadow: 0 18px 42px rgba(96, 72, 56, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  overflow: hidden;
  transition: filter 0.45s ease;
}
.dogs-art-frame.do-storm-shake { animation: stormTremble 0.56s ease-in-out; }
.dogs-art-frame.do-thunder::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 22%, rgba(255, 245, 196, 0.88), rgba(88, 106, 134, 0.34));
  animation: lightningFlash 0.68s ease-out forwards;
  pointer-events: none;
  z-index: 16;
}

/* Cozy Sunlit Living-Room Diorama Backdrop */
.dog-room-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #fcf6eb 0%, #f8efe0 68%, #eedcc5 100%);
  z-index: 0;
  pointer-events: none;
  transition: filter 0.5s ease;
}
.dogs-art-frame.is-storming .dog-room-bg { filter: brightness(0.84) saturate(0.75) hue-rotate(-8deg); }

.room-window {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 34%;
  height: 52%;
  border-radius: 70px 70px 6px 6px;
  border: 5px solid #fffdf9;
  box-shadow: inset 0 4px 14px rgba(102, 126, 152, 0.16), 0 4px 14px rgba(132, 108, 86, 0.08);
  overflow: hidden;
}
.room-window-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #d8ecfa 0%, #eef7fc 62%, #fdf5e4 100%);
  transition: background 0.55s ease;
}
.dogs-art-frame.mode-boarding .room-window-sky {
  background: linear-gradient(180deg, #e5d8f0 0%, #f6dfea 58%, #fcecd8 100%);
}
.dogs-art-frame.is-storming .room-window-sky {
  background: linear-gradient(180deg, #5d6f86 0%, #8395aa 65%, #a5b2c2 100%);
}

/* Animated Rain Streaks inside Window during Thunder */
.room-rain-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.dogs-art-frame.is-storming .room-rain-layer { opacity: 1; }
.room-rain-layer span {
  position: absolute;
  top: -18px;
  width: 1.5px;
  height: 22px;
  border-radius: 99px;
  background: rgba(236, 244, 255, 0.72);
  transform: rotate(14deg);
  animation: rainFall 0.58s linear infinite;
}
.room-rain-layer span:nth-child(1) { left: 16%; animation-delay: 0s; }
.room-rain-layer span:nth-child(2) { left: 31%; animation-delay: 0.18s; }
.room-rain-layer span:nth-child(3) { left: 46%; animation-delay: 0.08s; }
.room-rain-layer span:nth-child(4) { left: 61%; animation-delay: 0.28s; }
.room-rain-layer span:nth-child(5) { left: 75%; animation-delay: 0.14s; }
.room-rain-layer span:nth-child(6) { left: 87%; animation-delay: 0.36s; }

.room-window-mullion-v {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  background: rgba(255, 253, 248, 0.92);
}
.room-window-mullion-h {
  position: absolute;
  top: 56%;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 253, 248, 0.92);
}

/* Warm Diagonal Morning Sunbeams */
.room-sunbeams {
  position: absolute;
  inset: 0;
  background: linear-gradient(126deg, transparent 22%, rgba(255, 246, 214, 0.42) 38%, rgba(255, 244, 206, 0.16) 54%, transparent 70%);
  opacity: 0.9;
  transition: opacity 0.45s ease;
}
.dogs-art-frame.is-storming .room-sunbeams { opacity: 0; }

/* Cozy Warm Lamp Halo (Blooms in Boarding / Thunder Comfort) */
.room-lamp-glow {
  position: absolute;
  left: 50%;
  bottom: 10%;
  transform: translateX(-50%) scale(0.72);
  width: 74%;
  height: 78%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 224, 190, 0.68) 0%, rgba(248, 204, 216, 0.32) 48%, rgba(255, 255, 255, 0) 76%);
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.65s var(--ease-out);
}
.dogs-art-frame.mode-boarding .room-lamp-glow { opacity: 1; transform: translateX(-50%) scale(1.06); }

/* Warm Oak Baseboard + Honey Wood Floor + Woven Cream Rug */
.room-baseboard {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 29%;
  height: 8px;
  background: linear-gradient(180deg, #fffdf8 0%, #ebe0cf 100%);
  border-top: 1px solid rgba(196, 174, 152, 0.32);
  border-bottom: 1px solid rgba(168, 138, 110, 0.28);
}
.room-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 29%;
  background:
    repeating-linear-gradient(90deg, transparent 0 74px, rgba(164, 130, 96, 0.08) 74px 75px),
    linear-gradient(180deg, #ecd8bf 0%, #e4cbb0 100%);
}
.room-rug {
  position: absolute;
  left: 50%;
  bottom: 4.5%;
  transform: translateX(-50%);
  width: 84%;
  height: 23%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 42%, #fffcf6 0%, #f6ede0 68%, #ebdccc 100%);
  border: 1.5px dashed rgba(194, 166, 138, 0.45);
  box-shadow: 0 4px 12px rgba(132, 102, 74, 0.14);
}

/* Interactive Tap-the-Rug Layer */
.dog-rug-hit {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 2%;
  height: 32%;
  z-index: 3;
  cursor: pointer;
  border-radius: 50%;
}

/* Subtle Floating Mood / Interactive Cue Pill */
.dog-mood-pill {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.86);
  border: 1px solid rgba(189, 119, 109, 0.22);
  font-family: var(--font-serif);
  font-size: 9.5px;
  color: var(--ink-muted);
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 10px rgba(112, 84, 62, 0.08);
  transition: transform 0.26s var(--ease-spring);
}
.dog-mood-pill.pop { transform: translateX(-50%) scale(1.1); }
.dog-mood-pill .mood-heart { color: #dd748b; font-size: 10px; }

/* Storm cloud & lightning overlay */
.dog-storm-layer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 110px;
  pointer-events: none;
  z-index: 14;
  opacity: 0;
}
.dog-storm-layer.is-active { opacity: 1; }
.storm-cloud {
  width: 112px;
  margin: 0 auto;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(72, 86, 108, 0.28));
  transform: translateY(-24px);
}
.dog-storm-layer.is-active .storm-cloud { animation: cloudDrop 1.35s ease-in-out forwards; }
.storm-bolt {
  width: 34px;
  margin: -14px auto 0;
  display: block;
  opacity: 0;
  filter: drop-shadow(0 0 10px rgba(255, 220, 96, 0.9));
}
.dog-storm-layer.is-active .storm-bolt { animation: boltStrike 0.95s ease-out forwards; }

/* Independent Living Multi-Pose Dog Actors */
.dog-actor {
  position: absolute;
  bottom: 12%;
  transform-origin: center bottom;
  cursor: pointer;
  z-index: 5;
  transition: opacity 0.32s ease, transform 0.45s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}
.dog-actor .actor-shadow {
  position: absolute;
  left: 50%;
  bottom: -2px;
  transform: translateX(-50%);
  width: 82%;
  height: 13px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(132, 102, 78, 0.28) 0%, transparent 72%);
  pointer-events: none;
  z-index: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.dog-actor .actor-sprite {
  position: relative;
  z-index: 1;
  display: block;
  height: 100%;
  width: auto;
  object-fit: contain;
  user-select: none;
  filter: drop-shadow(0 5px 8px rgba(102, 74, 58, 0.14));
  transform-origin: center bottom;
}

/* Preloaded multi-pose switching with ZERO flicker */
.dog-actor .pose-img { display: none; }
.actor-bamei.pose-idle .pose-img-idle,
.actor-bamei.pose-sausage .pose-img-sausage,
.actor-bamei.pose-leap .pose-img-leap,
.actor-rourou.pose-idle .pose-img-idle,
.actor-rourou.pose-duck .pose-img-duck {
  display: block;
}

/* Bamei (left) & Rourou (right) sizing + living idle breathing */
.actor-bamei {
  left: 28%;
  height: 58%;
  transform: translateX(-50%);
}
.actor-bamei.pose-sausage { height: 61%; z-index: 8; }
.actor-bamei.pose-leap { height: 59%; z-index: 8; transition: none; }
.actor-bamei.pose-leap .actor-shadow { opacity: 0.4; transform: translateX(-50%) scale(0.72); }
.actor-bamei.pose-idle .pose-img-idle { animation: dogIdleBreathe 3.2s ease-in-out infinite; }
.actor-bamei.pose-sausage .pose-img-sausage { animation: bameiMunchLoop 0.52s ease-in-out infinite; }

.actor-rourou {
  left: 72%;
  height: 60%;
  transform: translateX(-50%);
}
.actor-rourou.pose-duck { height: 61%; z-index: 8; }
.actor-rourou.pose-idle .pose-img-idle { animation: dogIdleBreathe 3.6s ease-in-out -1.5s infinite; }
.actor-rourou.pose-duck .pose-img-duck { animation: rourouDuckWiggleLoop 0.62s ease-in-out infinite; }

/* Boarding cheek-to-cheek cuddle actor */
.actor-boarding {
  left: 50%;
  bottom: 10%;
  height: 66%;
  transform: translateX(-50%) scale(0.92);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}
.actor-boarding .actor-sprite { animation: dogCuddleSway 3.4s ease-in-out infinite; }

/* Mode transitions: Home vs Boarding (Rush to center & hug!) */
.dogs-art-frame.mode-boarding .actor-bamei {
  opacity: 0;
  transform: translateX(calc(-50% + 44px)) scale(0.92);
  pointer-events: none;
}
.dogs-art-frame.mode-boarding .actor-rourou {
  opacity: 0;
  transform: translateX(calc(-50% - 44px)) scale(0.92);
  pointer-events: none;
}
.dogs-art-frame.mode-boarding .actor-boarding {
  opacity: 1;
  transform: translateX(-50%) scale(1);
  pointer-events: auto;
}

/* Expressive Action Transitions */
.actor-bamei.anim-sausage-stage { transform: translateX(calc(-50% + 22px)) translateY(-4px); }
.actor-bamei.anim-curious { animation: bameiCuriousLean 1.4s ease-in-out; }
.actor-bamei.anim-rush { animation: bameiRushCenter 0.36s ease-in forwards; }

.actor-rourou.anim-duck-stage { transform: translateX(calc(-50% - 22px)) translateY(-5px); }
.actor-rourou.anim-peek { animation: rourouPeekAway 1.4s ease-in-out; }
.actor-rourou.anim-cheer { animation: rourouCheerHop 1.3s ease-in-out; }
.actor-rourou.anim-rush { animation: rourouRushCenter 0.36s ease-in forwards; }

.dog-actor.anim-pet .actor-sprite { animation: dogPetWiggle 0.65s var(--ease-spring) !important; }
.actor-boarding.anim-shiver-hug .actor-sprite { animation: boardingShiverHug 1.2s ease-in-out !important; }

/* Interactive FX & 60fps Props Layer */
.dog-fx-layer { position: absolute; inset: 0; pointer-events: none; z-index: 12; overflow: hidden; }
.fx-prop-sprite {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  will-change: transform, opacity;
  filter: drop-shadow(0 4px 6px rgba(82, 58, 44, 0.18));
}
.fx-prop-shadow {
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 9px;
  border-radius: 50%;
  background: rgba(110, 86, 68, 0.24);
  pointer-events: none;
  will-change: transform, opacity;
}
.fx-heart {
  position: absolute;
  width: 16px;
  height: 16px;
  color: #e37b92;
  animation: fxHeartRise 1.15s ease-out forwards;
}
.fx-sparkle {
  position: absolute;
  width: 14px;
  height: 14px;
  color: #e5b34c;
  animation: fxSparklePop 0.72s ease-out forwards;
}
.fx-dust {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(210, 194, 178, 0.72);
  filter: blur(1.5px);
  animation: fxDustPuff 0.55s ease-out forwards;
}
.fx-squeak-ring {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(236, 172, 74, 0.85);
  animation: fxSqueakRing 0.75s ease-out forwards;
}
.fx-squeak-tag {
  position: absolute;
  font-family: var(--font-serif);
  font-size: 11px;
  font-weight: 600;
  color: #cc7a2b;
  background: rgba(255, 250, 232, 0.94);
  border: 1px solid rgba(232, 180, 84, 0.5);
  padding: 1px 6px;
  border-radius: 999px;
  white-space: nowrap;
  animation: fxSqueakTag 0.95s ease-out forwards;
}

.dog-bubble {
  position: absolute; top: 9px; max-width: 46.5%;
  padding: 5px 8px; border-radius: 12px;
  background: rgba(255, 252, 247, 0.95);
  border: 1px solid rgba(74, 56, 62, 0.12);
  font-family: var(--font-serif); font-size: 10px; line-height: 1.38;
  color: var(--ink-plum); box-shadow: 0 6px 16px rgba(74, 56, 62, 0.08);
  z-index: 9; transition: transform 0.24s var(--ease-spring); pointer-events: none;
}
.dog-bubble.left { left: 10px; }
.dog-bubble.right { right: 10px; }
.dog-bubble.pop { transform: scale(1.08); }
.dog-bubble .speaker { display: block; font-size: 9px; font-weight: 600; color: var(--terracotta); margin-bottom: 1px; }

.dogs-note { font-family: var(--font-serif); font-size: 11.5px; line-height: 1.5; color: var(--ink-muted); text-align: center; max-width: 460px; }
.dog-props-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; width: min(440px, 100%); }
.dog-prop-btn {
  display: flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 13px;
  background: rgba(255, 255, 255, 0.92); border: 1px solid rgba(74, 56, 62, 0.1);
  box-shadow: 0 5px 14px rgba(74, 56, 62, 0.05);
  font-family: var(--font-serif); font-size: 11.5px; color: var(--ink-plum);
  transition: transform 0.22s var(--ease-spring), border-color 0.2s ease, background 0.2s ease;
}
.dog-prop-btn:hover { border-color: rgba(189, 119, 109, 0.45); transform: translateY(-2px); }
.dog-prop-btn:active { transform: scale(0.96); }
.dog-prop-btn.is-firing { border-color: var(--terracotta); background: #fff7f4; }
.dog-prop-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.dog-photo-peeks { display: flex; gap: 10px; }
.dog-peek-chip {
  font-family: var(--font-serif); font-size: 11px; color: var(--terracotta);
  padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.82); border: 1px dashed rgba(189, 119, 109, 0.45);
}

/* ==========================================================================
   ACT 5 · THE CAROUSEL (Wind-Up Key + Floating Notes + Voice Slots)
   ========================================================================== */
#scene-5 {
  background: radial-gradient(ellipse 64% 56% at 50% 44%, #ffffff 0%, #fffbfd 36%, #fceef4 74%, #f9e3ec 100%);
  padding: calc(50px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  justify-content: space-between;
  gap: 6px;
}

.carousel-stage { position: relative; width: min(860px, 100%); display: flex; flex-direction: column; align-items: center; gap: 8px; margin: auto 0; }
.carousel-visual-area { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }

.carousel-visual-wrap {
  position: relative;
  width: min(224px, 56vw);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-aura {
  position: absolute; inset: 6%; border-radius: 50%;
  border: 1px dashed rgba(213, 196, 158, 0.55);
  opacity: 0; transition: opacity 0.6s ease; pointer-events: none;
}
.carousel-visual-wrap.is-playing .carousel-aura { opacity: 1; animation: gentleSpin 16s linear infinite; }

.carousel-notes-layer { position: absolute; inset: 0; pointer-events: none; z-index: 4; overflow: visible; }
.floating-note {
  position: absolute;
  bottom: 42%;
  color: #c891a6;
  font-size: 16px;
  opacity: 0;
  animation: noteFloatUp 2.6s ease-out forwards;
}

.carousel-canvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
}

/* Clickable Wind-Up Key Hotspot on Lower Right of Base */
.windup-hotspot {
  position: absolute;
  right: 11%;
  bottom: 13%;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.windup-ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(213, 196, 158, 0.92);
  animation: knobPulse 2.2s ease-out infinite;
  transition: transform 0.55s var(--ease-out);
}
.carousel-visual-wrap.is-playing .windup-ring {
  border-style: dashed;
  animation: gentleSpin 2.6s linear infinite;
}

.voice-pills { width: min(370px, 100%); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.voice-pill {
  display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 6px; border-radius: 999px;
  background: linear-gradient(135deg, #dab0be 0%, #cca0b0 100%);
  color: #ffffff; box-shadow: 0 7px 18px rgba(184, 126, 146, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease, border-color 0.25s ease;
}
.voice-pill.is-listened { border-color: rgba(255, 244, 214, 0.72); }
.voice-pill.is-playing { background: linear-gradient(135deg, #c6869c 0%, #b57389 100%); box-shadow: 0 10px 26px rgba(181, 115, 137, 0.42); }
.voice-play-circle { width: 24px; height: 24px; border-radius: 50%; background: #ffffff; color: #c2879b; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.voice-pill-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: left; }
.voice-pill-name { font-family: var(--font-serif); font-size: 9.5px; letter-spacing: 0.04em; color: rgba(255, 255, 255, 0.96); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.1; }
.voice-wave { width: 100%; height: 11px; display: flex; align-items: center; justify-content: space-between; gap: 2px; }
.voice-wave span { display: block; width: 2px; border-radius: 99px; background: rgba(255, 255, 255, 0.86); height: var(--h, 40%); }
.voice-pill.is-playing .voice-wave span { animation: waveDance 0.85s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.voice-dur { font-family: var(--font-serif-en); font-size: 10.5px; opacity: 0.92; flex-shrink: 0; }

.carousel-letter-box { width: min(520px, 100%); min-height: 76px; text-align: center; padding: 2px 6px; }
.carousel-letter-title { font-family: var(--font-serif); font-size: 11px; letter-spacing: 0.14em; color: var(--rose-deep); margin-bottom: 4px; }
.carousel-letter-text { font-family: var(--font-serif); font-size: clamp(12px, 3.1vw, 13.5px); line-height: 1.62; color: var(--ink-plum); }
.carousel-scrubber { display: flex; align-items: center; justify-content: center; gap: 10px; width: min(290px, 84%); font-family: var(--font-serif-en); font-size: 11.5px; color: var(--ink-muted); }
.listened-count { padding: 1px 7px; border-radius: 999px; background: rgba(212, 164, 180, 0.2); color: var(--rose-deep); font-size: 10.5px; }
.scrubber-track { flex: 1; height: 3px; border-radius: 99px; background: rgba(184, 126, 146, 0.2); overflow: hidden; }
.scrubber-fill { height: 100%; width: 0%; background: var(--rose-deep); transition: width 0.15s linear; }

/* ==========================================================================
   ACT 6 · GASHAPON MACHINE (Real Tumbling Dome + Miniature Vouchers!)
   ========================================================================== */
#scene-6 {
  background: radial-gradient(ellipse 62% 56% at 35% 44%, #ffffff 0%, #f8fcff 36%, #e9f5fd 74%, #deedfa 100%);
  padding: calc(50px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  justify-content: space-between;
  gap: 6px;
}

.gashapon-layout { position: relative; width: min(900px, 100%); display: flex; flex-direction: column; align-items: center; gap: 9px; margin: auto 0; }
.gasha-machine-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.gashapon-visual {
  position: relative;
  width: min(192px, 48vw);
  aspect-ratio: 896 / 1200;
  cursor: pointer;
}

.gasha-img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: brightness(1.045) contrast(1.04);
  mask-image: radial-gradient(ellipse 49% 49% at 50% 50%, #000 76%, transparent 99%);
  -webkit-mask-image: radial-gradient(ellipse 49% 49% at 50% 50%, #000 76%, transparent 99%);
}

.gashapon-visual.is-shaking .gasha-img,
.gashapon-visual.is-shaking .gasha-dome-canvas {
  animation: gashaShake 0.72s ease-in-out;
}

/* Circular Glass Dome Tumbling Capsules Canvas */
.gasha-dome-canvas {
  position: absolute;
  left: 22%;
  top: 13.5%;
  width: 56%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gashapon-visual.is-tumbling .gasha-dome-canvas {
  opacity: 1;
}

/* Rotating Champagne-Gold Turn-Knob Handle Overlay */
.gasha-knob-ring {
  position: absolute;
  left: 50%;
  top: 66.5%;
  transform: translate(-50%, -50%);
  width: 22%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid rgba(213, 196, 158, 0.88);
  animation: knobPulse 2.1s ease-out infinite;
  z-index: 5;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gasha-knob-bar {
  width: 68%;
  height: 22%;
  border-radius: 99px;
  background: linear-gradient(180deg, #e7d8b5 0%, #c6b082 100%);
  box-shadow: 0 1px 3px rgba(74, 56, 40, 0.28);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.gashapon-visual.is-turning .gasha-knob-ring {
  animation: knobTurn 0.72s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}
.gashapon-visual.is-turning .gasha-knob-bar {
  opacity: 0.95;
}

.gasha-chute-flap {
  position: absolute;
  left: 50%;
  bottom: 13.5%;
  transform: translateX(-50%) perspective(180px) rotateX(0deg);
  transform-origin: top center;
  width: 19%;
  height: 11%;
  border-radius: 3px 3px 5px 5px;
  background: linear-gradient(180deg, rgba(247, 214, 224, 0.92), rgba(235, 194, 208, 0.88));
  border: 1px solid rgba(196, 146, 162, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transition: transform 0.26s var(--ease-out), opacity 0.2s ease;
}
.gasha-chute-flap.is-open {
  opacity: 1;
  transform: translateX(-50%) perspective(180px) rotateX(62deg);
}

.gasha-drop-capsule {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translate(-50%, -18px) scale(0.4);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--drop-c, #f3d3dd) 50%, #faf5ea 50%);
  border: 1.5px solid rgba(74, 56, 62, 0.14);
  box-shadow: 0 6px 14px rgba(74, 56, 62, 0.18);
  opacity: 0;
  z-index: 6;
  pointer-events: none;
}

.gasha-drop-capsule.is-dropping { animation: capsulePop 0.72s var(--ease-spring) forwards; }
.gasha-status { font-family: var(--font-serif); font-size: 11.5px; letter-spacing: 0.08em; color: var(--ink-muted); text-align: center; }

/* Collector Board with Miniature Perforated Redemption Tickets! */
.collector-board {
  position: relative;
  width: min(475px, 100%);
  min-height: 196px;
  background: radial-gradient(circle at 50% 50%, #fffdf8 0%, var(--parchment) 100%);
  border: 1px solid var(--parchment-border);
  border-radius: 6px;
  padding: 15px 12px 12px;
  box-shadow: 0 14px 32px rgba(74, 96, 118, 0.08), inset 0 0 24px rgba(231, 222, 201, 0.45);
}

.board-pin { position: absolute; top: 8px; width: 5px; height: 5px; border-radius: 50%; }
.board-pin.left { left: 10px; background: #e6a4b4; }
.board-pin.right { right: 10px; background: #9dbce0; }
.board-clover { position: absolute; top: 10px; left: 14px; width: 22px; height: 22px; }
.board-header-row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-bottom: 8px; }
.board-count { font-family: var(--font-serif-en); font-size: 11px; letter-spacing: 0.1em; color: var(--ink-muted); }
.collect-all-link { font-family: var(--font-serif); font-size: 11px; color: var(--terracotta); border-bottom: 1px dashed rgba(189, 119, 109, 0.45); }

.coupons-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }

.coupon-slot {
  position: relative;
  min-height: 66px;
  border-radius: 6px;
  border: 1px dashed rgba(154, 134, 118, 0.3);
  background: rgba(255, 255, 255, 0.42);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px;
}

.coupon-slot.is-empty { color: rgba(163, 146, 153, 0.55); font-family: var(--font-serif-en); font-size: 11px; letter-spacing: 0.12em; }

/* Miniature Physical Ticket Design on Collector Board */
.coupon-slot.is-unlocked {
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  animation: couponLand 0.52s var(--ease-spring);
  filter: drop-shadow(0 4px 10px rgba(74, 56, 62, 0.1));
}

.mini-voucher {
  width: 100%;
  min-height: 66px;
  display: flex;
  background: #fffdf9;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(74, 56, 62, 0.08);
  mask-image:
    radial-gradient(circle 5px at 0 50%, transparent 96%, #000 100%),
    radial-gradient(circle 5px at 100% 50%, transparent 96%, #000 100%);
  -webkit-mask-image:
    radial-gradient(circle 5px at 0 50%, transparent 96%, #000 100%),
    radial-gradient(circle 5px at 100% 50%, transparent 96%, #000 100%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

.mini-v-stripe { width: 6px; background: var(--v-accent, #bd776d); flex-shrink: 0; }
.mini-v-body { flex: 1; padding: 8px 8px 8px 9px; text-align: left; display: flex; flex-direction: column; justify-content: center; background: linear-gradient(135deg, #fffdf9 0%, var(--slot-bg, #f8e9c8) 140%); }
.mini-v-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.mini-v-badge { font-size: 8.5px; color: var(--v-accent, #bd776d); font-weight: 600; letter-spacing: 0.04em; }
.mini-v-title { font-family: var(--font-serif); font-size: 11.5px; font-weight: 600; color: var(--ink-plum); line-height: 1.3; }
.mini-v-serial { font-family: var(--font-serif-en); font-size: 9px; letter-spacing: 0.08em; color: var(--ink-muted); margin-top: 3px; }
.mini-v-stub {
  width: 28px;
  border-left: 1px dashed rgba(74, 56, 62, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--slot-bg, #f8e9c8);
  font-family: var(--font-serif-en);
  font-weight: 700;
  font-size: 12px;
  color: var(--ink-plum);
}

/* ==========================================================================
   ACT 7 · CELEBRATION CAKE & FINALE SECRET CODE
   ========================================================================== */
#scene-7 {
  background: radial-gradient(ellipse 66% 58% at 50% 45%, #ffffff 0%, #fffef8 36%, #fdf6e0 74%, #f9edc7 100%);
  padding: calc(50px + env(safe-area-inset-top)) 16px calc(18px + env(safe-area-inset-bottom));
  justify-content: space-between;
  gap: 6px;
}

.cake-stage { position: relative; width: min(560px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; margin: auto 0; }
.cake-visual-wrap { --wind: 0deg; position: relative; width: min(320px, 82vw); aspect-ratio: 1 / 1; transition: width 0.65s var(--ease-out); }
.cake-stage.is-celebrating .cake-visual-wrap { width: min(148px, 38vw); }

.cake-img {
  position: relative; width: 100%; height: 100%; object-fit: contain;
  mix-blend-mode: multiply;
  filter: brightness(1.035) contrast(1.03);
  mask-image: radial-gradient(ellipse 49% 49% at 50% 50%, #000 76%, transparent 99%);
  -webkit-mask-image: radial-gradient(ellipse 49% 49% at 50% 50%, #000 76%, transparent 99%);
}

.cake-candle-glow {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translate(-50%, -50%);
  width: 68%;
  height: 36%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(255, 214, 122, 0.36) 0%, rgba(255, 186, 108, 0.14) 52%, transparent 78%);
  opacity: var(--lit-ratio, 1);
  pointer-events: none;
  z-index: 3;
  transition: opacity 0.45s ease;
  mix-blend-mode: screen;
}

.candles-layer { position: absolute; inset: 0; z-index: 5; touch-action: none; }
.candle-hotspot { position: absolute; transform: translate(-50%, -100%); width: 14px; height: 46px; display: flex; align-items: flex-end; justify-content: center; cursor: pointer; padding-bottom: 1px; }
.candle-hotspot.is-blown { pointer-events: none; }

.flame {
  position: relative; width: 10px; height: 22px;
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 72%, #fffbe8 0%, #ffd56b 45%, #ff9338 82%, rgba(255, 130, 40, 0) 100%);
  box-shadow: 0 0 12px 3px rgba(255, 185, 76, 0.55), 0 0 24px 6px rgba(255, 160, 60, 0.24);
  transform-origin: bottom center;
  transform: skewX(var(--wind));
  animation: flameFlicker 1.25s ease-in-out infinite alternate;
  animation-delay: var(--fd, 0s);
  transition: opacity 0.25s ease;
}
.flame::after { content: ""; position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%); width: 4px; height: 9px; border-radius: 50%; background: #ffffff; }
.candle-hotspot.is-blown .flame { opacity: 0; animation: none; }

.smoke-wisp { position: absolute; bottom: 4px; left: 50%; width: 7px; height: 7px; border-radius: 50%; background: rgba(160, 152, 158, 0.52); filter: blur(2.5px); opacity: 0; pointer-events: none; }
.candle-hotspot.is-blown .smoke-wisp { animation: smokeRise 1.6s ease-out forwards; }

.cake-controls { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.cake-stage.is-celebrating .cake-controls { display: none; }

.mic-meter-wrap { width: 140px; height: 4px; border-radius: 99px; background: rgba(74, 56, 62, 0.1); overflow: hidden; opacity: 0; transition: opacity 0.25s ease; }
.mic-meter-wrap.is-visible { opacity: 1; }
.mic-meter-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #e8b5c4, #bd776d); transition: width 0.08s linear; }
.cake-action-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.mic-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.88); border: 1px solid rgba(74, 56, 62, 0.14); font-family: var(--font-serif); font-size: 12px; color: var(--ink-plum); box-shadow: 0 6px 18px rgba(74, 56, 62, 0.06); }
.mic-btn.is-listening { border-color: var(--terracotta); background: rgba(246, 224, 218, 0.72); box-shadow: 0 0 0 5px rgba(189, 119, 109, 0.15); }
.mic-circle { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(74, 56, 62, 0.2); display: flex; align-items: center; justify-content: center; }
.tap-blow-btn { padding: 8px 14px; border-radius: 999px; font-family: var(--font-serif); font-size: 12px; color: var(--ink-muted); border: 1px dashed rgba(74, 56, 62, 0.24); }
.cake-hint-sub { font-size: 11px; color: var(--ink-soft); text-align: center; }

.finale-card-inline {
  display: none; width: min(415px, 100%);
  background: rgba(255, 253, 249, 0.96);
  border: 1px solid rgba(213, 196, 158, 0.55);
  border-radius: 20px; padding: 15px 16px 14px;
  text-align: center; box-shadow: 0 20px 52px rgba(105, 82, 68, 0.14);
  animation: fadeSlideUp 0.65s var(--ease-out);
}
.cake-stage.is-celebrating .finale-card-inline { display: block; }
.finale-eyebrow { font-family: var(--font-serif-en); font-size: 10.5px; letter-spacing: 0.2em; color: var(--terracotta); margin-bottom: 4px; }
.finale-headline { font-family: var(--font-serif); font-size: 18px; font-weight: 500; letter-spacing: 0.08em; color: var(--ink-plum); margin-bottom: 7px; }
.finale-ribbon {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px;
  background: rgba(213, 196, 158, 0.18); font-family: var(--font-serif); font-size: 10.5px; color: #7a6258; margin-bottom: 10px;
}
.finale-ribbon i { font-style: normal; opacity: 0.45; }
.finale-prompt { font-family: var(--font-serif); font-size: 12px; color: var(--ink-muted); margin-bottom: 10px; }

.secret-code-box {
  position: relative; min-height: 72px; border-radius: 14px;
  background: linear-gradient(135deg, #fdf4f6 0%, #fbf3e4 100%);
  border: 1.5px dashed rgba(189, 119, 109, 0.5);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden; margin-bottom: 10px;
}
.secret-veil {
  position: absolute; inset: 0;
  background: linear-gradient(125deg, #d7a6b6 0%, #c48e9f 45%, #e2b8c6 55%, #c48e9f 100%);
  background-size: 220% 100%;
  color: #ffffff; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 13px; letter-spacing: 0.12em;
  transition: opacity 0.6s ease, transform 0.6s var(--ease-out); z-index: 2;
  animation: silkShimmer 4.8s ease-in-out infinite alternate;
}
.secret-code-box.is-revealed .secret-veil { opacity: 0; transform: translateX(100%) rotate(4deg); pointer-events: none; }
.secret-revealed { padding: 10px; }
.secret-code-label { display: block; font-family: var(--font-serif-en); font-size: 10px; letter-spacing: 0.2em; color: var(--ink-muted); margin-bottom: 3px; }
.secret-code-text { font-family: var(--font-serif); font-size: 26px; font-weight: 600; letter-spacing: 0.18em; color: var(--terracotta); }
.finale-subnote { font-family: var(--font-serif); font-size: 11.5px; line-height: 1.6; color: var(--ink-muted); margin-bottom: 11px; }
.finale-actions { display: flex; justify-content: center; gap: 10px; }
.finale-btn { padding: 8px 16px; border-radius: 999px; font-family: var(--font-serif); font-size: 12px; letter-spacing: 0.06em; border: 1px solid rgba(74, 56, 62, 0.16); color: var(--ink-plum); }
.finale-btn.primary { background: var(--ink-plum); color: #faf5ea; border-color: var(--ink-plum); }

/* ==========================================================================
   MODALS: MULTI-PHOTO LIGHTBOX & PHYSICAL REDEMPTION VOUCHER
   ========================================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(28, 20, 22, 0.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  opacity: 0; pointer-events: none; transition: opacity 0.28s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }

.lightbox-card {
  width: min(440px, 100%); max-height: 88dvh; overflow-y: auto;
  background: #fbf8f1; border-radius: 16px; padding: 12px 12px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  transform: scale(0.95); transition: transform 0.35s var(--ease-spring);
}
.modal-backdrop.open .lightbox-card { transform: scale(1); }

.lightbox-media-wrap { position: relative; border-radius: 10px; overflow: hidden; background: #1e1818; }
.lightbox-img { width: 100%; max-height: 52dvh; object-fit: cover; }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.85); color: var(--ink-plum);
  font-size: 20px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.lb-nav.prev { left: 10px; }
.lb-nav.next { right: 10px; }
.lb-nav.is-hidden { display: none; }

.lb-counter {
  position: absolute; bottom: 8px; right: 10px;
  padding: 2px 9px; border-radius: 999px;
  background: rgba(24, 18, 20, 0.72); color: #faf5ea;
  font-family: var(--font-serif-en); font-size: 11px; letter-spacing: 0.1em;
}

.lightbox-meta { padding: 12px 6px 2px; }
.lightbox-date { font-family: var(--font-serif-en); font-size: 11.5px; letter-spacing: 0.14em; color: var(--terracotta); }
.lightbox-title { font-family: var(--font-serif); font-size: 18px; font-weight: 600; color: var(--ink-plum); margin: 3px 0 4px; }
.lightbox-sublabel { font-family: var(--font-serif); font-size: 12px; color: var(--rose-deep); margin-bottom: 6px; }
.lightbox-caption { font-family: var(--font-serif); font-size: 13px; line-height: 1.72; color: var(--ink-muted); }

.modal-close-btn { display: block; margin: 14px auto 0; padding: 8px 22px; border-radius: 999px; background: rgba(74, 56, 62, 0.08); font-family: var(--font-serif); font-size: 12px; color: var(--ink-plum); }

/* 2-Stage Capsule Crack-Open + Luxury Perforated Redemption Voucher */
.voucher-stage-wrap {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.capsule-crack-stage {
  position: relative;
  width: 96px;
  height: 96px;
  display: none;
  align-items: center;
  justify-content: center;
}

.capsule-crack-stage.is-active { display: flex; }

.cap-half {
  position: absolute;
  width: 78px;
  height: 39px;
  border: 2px solid rgba(74, 56, 62, 0.16);
  box-shadow: inset -6px -4px 12px rgba(74, 56, 62, 0.14), 0 8px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.42s var(--ease-out), opacity 0.35s ease;
}

.cap-top {
  top: 9px;
  border-radius: 40px 40px 2px 2px;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, var(--cap-c, #f3d3dd) 60%);
}

.cap-bottom {
  bottom: 9px;
  border-radius: 2px 2px 40px 40px;
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #f7efe2 70%);
}

.cap-glow {
  width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle, #fff9d6, rgba(255, 240, 170, 0));
  opacity: 0; transform: scale(0.4); transition: all 0.38s ease;
}

.capsule-crack-stage.is-cracking .cap-top { transform: translateY(-28px) rotate(-18deg); opacity: 0; }
.capsule-crack-stage.is-cracking .cap-bottom { transform: translateY(28px) rotate(14deg); opacity: 0; }
.capsule-crack-stage.is-cracking .cap-glow { opacity: 1; transform: scale(4.2); }

/* Authentic Perforated Physical Redemption Voucher */
.voucher-ticket {
  --v-color: #f3d3dd;
  --v-accent: #b4647b;
  width: 100%;
  display: none;
  align-items: stretch;
  filter: drop-shadow(0 22px 44px rgba(16, 10, 14, 0.42));
  animation: voucherUnfold 0.56s var(--ease-spring) forwards;
}

.voucher-ticket.is-shown { display: flex; }

.voucher-main {
  flex: 1 1 74%;
  position: relative;
  background: #fffdf8;
  border-radius: 10px 0 0 10px;
  overflow: hidden;
  border-right: 1.5px dashed rgba(120, 96, 86, 0.38);
  mask-image:
    radial-gradient(circle 9px at 100% 0, transparent 98%, #000 100%),
    radial-gradient(circle 9px at 100% 100%, transparent 98%, #000 100%),
    radial-gradient(circle 8px at 0 50%, transparent 98%, #000 100%);
  -webkit-mask-image:
    radial-gradient(circle 9px at 100% 0, transparent 98%, #000 100%),
    radial-gradient(circle 9px at 100% 100%, transparent 98%, #000 100%),
    radial-gradient(circle 8px at 0 50%, transparent 98%, #000 100%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

.voucher-top-band {
  background: var(--v-color);
  padding: 9px 14px 9px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(74, 56, 62, 0.08);
}

.voucher-brand {
  font-family: var(--font-serif-en);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--ink-plum);
  opacity: 0.78;
}

.voucher-badge-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--v-accent);
  font-family: var(--font-serif);
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.voucher-body-inner {
  position: relative;
  margin: 8px;
  padding: 12px 12px 10px;
  border: 1px solid rgba(213, 196, 158, 0.65);
  border-radius: 4px;
  text-align: left;
}

.voucher-en {
  font-family: var(--font-serif-en);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--v-accent);
  margin-bottom: 3px;
}

.voucher-title {
  font-family: var(--font-serif);
  font-size: clamp(17px, 4.5vw, 20px);
  font-weight: 600;
  color: var(--ink-plum);
  margin-bottom: 6px;
}

.voucher-desc {
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.65;
  color: #635056;
  margin-bottom: 12px;
  padding-right: 48px;
}

/* Red Circular Ink Seal Stamp Slam! */
.voucher-seal {
  position: absolute;
  right: 8px;
  bottom: 42px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px double rgba(179, 59, 52, 0.82);
  color: var(--crimson-seal);
  background: rgba(255, 250, 248, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 8.5px;
  line-height: 1.15;
  transform: rotate(-14deg);
  animation: stampSlam 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) 0.25s both;
}

.voucher-meta-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding-top: 8px;
  border-top: 1px dashed rgba(154, 134, 118, 0.3);
}

.voucher-meta-row small { display: block; font-size: 7px; letter-spacing: 0.1em; color: #a39299; }
.voucher-meta-row span { display: block; font-family: var(--font-serif-en); font-weight: 600; font-size: clamp(9.5px, 2.5vw, 10.5px); color: var(--ink-plum); white-space: nowrap; }

.voucher-stub {
  flex: 0 0 26%;
  min-width: 86px;
  background: linear-gradient(180deg, var(--v-color) 0%, #fffdf8 42%);
  border-radius: 0 10px 10px 0;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  mask-image:
    radial-gradient(circle 9px at 0 0, transparent 98%, #000 100%),
    radial-gradient(circle 9px at 0 100%, transparent 98%, #000 100%),
    radial-gradient(circle 8px at 100% 50%, transparent 98%, #000 100%);
  -webkit-mask-image:
    radial-gradient(circle 9px at 0 0, transparent 98%, #000 100%),
    radial-gradient(circle 9px at 0 100%, transparent 98%, #000 100%),
    radial-gradient(circle 8px at 100% 50%, transparent 98%, #000 100%);
  mask-composite: intersect;
  -webkit-mask-composite: source-in;
}

.v-stub-kicker { font-size: 7.5px; letter-spacing: 0.14em; color: var(--ink-plum); opacity: 0.72; }
.v-stub-no { font-family: var(--font-serif-en); font-size: 32px; font-weight: 700; line-height: 1; color: var(--v-accent); }
.v-stub-rule { width: 72%; height: 1px; background: var(--champagne); }
.v-stub-sub { font-size: 6.5px; letter-spacing: 0.1em; color: #9c8c84; }
.v-stub-barcode {
  width: 82%; height: 18px;
  background: repeating-linear-gradient(90deg, var(--v-accent) 0 1.5px, transparent 1.5px 3.5px, var(--v-accent) 3.5px 5.5px, transparent 5.5px 7px, var(--v-accent) 7px 8px, transparent 8px 10.5px);
  opacity: 0.72;
}

.voucher-collect-btn {
  display: none;
  padding: 10px 26px;
  border-radius: 999px;
  background: #faf5ea;
  color: var(--ink-plum);
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.voucher-collect-btn.is-shown { display: inline-block; animation: fadeSlideUp 0.35s ease; }

/* ==========================================================================
   DESKTOP LANDSCAPE EDITORIAL LAYOUT (>= 820px)
   ========================================================================== */
@media (min-width: 820px) {
  .hud { padding: 18px 28px 10px; }

  .city-showcase { flex-direction: row; align-items: center; justify-content: center; gap: 32px; padding: 8px 12px; }
  .city-gallery-col { width: 315px; }

  .concerts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; padding: 10px 6px; }
  .a24-ticket-body { grid-template-columns: 118px 1fr 34px; }
  .food-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 16px; padding: 10px 6px; }

  .dog-props-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(620px, 100%); }

  .carousel-visual-area { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
  .carousel-visual-wrap { grid-column: 2; width: 315px; }
  .voice-pills { display: contents; }
  .voice-pill[data-slot="0"] { grid-column: 1; grid-row: 1; justify-self: end; align-self: start; margin-top: 38px; width: 198px; }
  .voice-pill[data-slot="1"] { grid-column: 1; grid-row: 1; justify-self: center; align-self: end; margin-bottom: 50px; width: 198px; }
  .voice-pill[data-slot="2"] { grid-column: 3; grid-row: 1; justify-self: start; align-self: center; margin-top: -18px; width: 198px; }
  .voice-pill[data-slot="3"] { grid-column: 3; grid-row: 1; justify-self: center; align-self: end; margin-bottom: 30px; width: 198px; }

  .gashapon-layout { flex-direction: row; justify-content: center; align-items: center; gap: 42px; }
  .gashapon-visual { width: 268px; }
  .collector-board { width: 495px; min-height: 296px; padding: 26px 18px 18px; }
  .coupons-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .coupon-slot, .mini-voucher { min-height: 78px; }

  .cake-visual-wrap { width: 365px; }
  .cake-stage.is-celebrating .cake-visual-wrap { width: 186px; }
}

/* ==========================================================================
   KEYFRAMES
   ========================================================================== */
@keyframes floatDrift { from { transform: translate(0, 0) rotate(-4deg); } to { transform: translate(8px, -12px) rotate(6deg); } }
@keyframes tugHint { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(6px, 4px); } }
@keyframes gentleSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes fadeSlideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dogBounce { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.03) translateY(-4px); } 70% { transform: scale(0.99); } }
@keyframes flashFade { 0% { opacity: 0.92; } 100% { opacity: 0; } }
@keyframes propArc {
  0% { transform: translate(-50%, 0) scale(0.5) rotate(0deg); opacity: 0; }
  25% { opacity: 1; }
  75% { transform: translate(var(--tx, -50%), -130px) scale(1.18) rotate(22deg); opacity: 1; }
  100% { transform: translate(var(--tx, -50%), -115px) scale(0.35) rotate(40deg); opacity: 0; }
}
@keyframes carouselSway {
  0%, 100% { transform: translateY(0px) rotate(-0.8deg); }
  50% { transform: translateY(-6px) rotate(0.8deg); }
}
@keyframes noteFloatUp {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  25% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-76px) translateX(var(--nx, 14px)) scale(1.1); }
}
@keyframes waveDance { 0% { height: 22%; } 100% { height: 92%; } }
@keyframes gashaShake { 0%, 100% { transform: rotate(0deg); } 20% { transform: rotate(-3.2deg) translateY(-2px); } 45% { transform: rotate(3.2deg) translateY(-1px); } 70% { transform: rotate(-2deg); } }
@keyframes knobPulse { 0% { box-shadow: 0 0 0 0 rgba(213, 196, 158, 0.65); } 70% { box-shadow: 0 0 0 14px rgba(213, 196, 158, 0); } 100% { box-shadow: 0 0 0 0 rgba(213, 196, 158, 0); } }
@keyframes knobTurn { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes capsulePop { 0% { opacity: 0; transform: translate(-50%, -26px) scale(0.35); } 45% { opacity: 1; transform: translate(-50%, 6px) scale(1.12); } 75% { opacity: 1; transform: translate(-50%, -2px) scale(0.98); } 100% { opacity: 0; transform: translate(-50%, 14px) scale(1.35); } }
@keyframes couponLand { 0% { opacity: 0; transform: scale(0.76) rotate(-4deg); } 100% { opacity: 1; transform: scale(1) rotate(0deg); } }
@keyframes voucherUnfold { 0% { opacity: 0; transform: scale(0.82) translateY(16px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes stampSlam { 0% { opacity: 0; transform: scale(2.2) rotate(-28deg); } 70% { opacity: 1; transform: scale(0.92) rotate(-12deg); } 100% { opacity: 1; transform: scale(1) rotate(-14deg); } }
@keyframes flameFlicker { 0% { transform: skewX(var(--wind)) scale(0.94, 1.04); } 50% { transform: skewX(calc(var(--wind) + 3deg)) scale(1.04, 0.96); } 100% { transform: skewX(calc(var(--wind) - 2deg)) scale(0.97, 1.07); } }
@keyframes foilSweep { from { background-position: 0% 0%; } to { background-position: 0% 100%; } }
@keyframes silkShimmer { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes rainFall {
  0% { transform: translate(0, 0) rotate(14deg); opacity: 0; }
  20% { opacity: 0.8; }
  85% { opacity: 0.7; }
  100% { transform: translate(-18px, 140px) rotate(14deg); opacity: 0; }
}
@keyframes bameiMunchLoop {
  0%, 100% { transform: scale(1, 1) rotate(-2deg); }
  50% { transform: scale(1.05, 0.94) translateY(-5px) rotate(3deg); }
}
@keyframes rourouDuckWiggleLoop {
  0%, 100% { transform: scale(1, 1) translateY(0) rotate(-3deg); }
  50% { transform: scale(1.05, 0.94) translateY(-7px) rotate(4deg); }
}
@keyframes dogIdleBreathe {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  50% { transform: scale(1.016, 0.986) rotate(0.7deg); }
}
@keyframes dogCuddleSway {
  0%, 100% { transform: scale(1, 1) rotate(-0.6deg); }
  50% { transform: scale(1.018, 0.988) rotate(0.8deg); }
}
@keyframes dogPetWiggle {
  0% { transform: scale(1, 1) rotate(0deg); }
  22% { transform: scale(1.1, 0.88) rotate(-5deg); }
  48% { transform: scale(0.94, 1.09) translateY(-10px) rotate(5deg); }
  74% { transform: scale(1.05, 0.95) rotate(-3deg); }
  100% { transform: scale(1, 1) rotate(0deg); }
}
@keyframes bameiChompDance {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  16% { transform: translateX(calc(-50% + 18px)) translateY(-16px) rotate(5deg); }
  32% { transform: translateX(calc(-50% + 26px)) translateY(2px) scale(1.06, 0.93) rotate(-4deg); }
  48% { transform: translateX(calc(-50% + 28px)) translateY(-8px) scale(0.96, 1.05) rotate(6deg); }
  64% { transform: translateX(calc(-50% + 24px)) translateY(2px) scale(1.05, 0.94) rotate(-5deg); }
  82% { transform: translateX(calc(-50% + 12px)) translateY(-6px) rotate(3deg); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes bameiBallChase {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  12% { transform: translateX(calc(-50% - 6px)) translateY(3px) scale(1.08, 0.88); }
  30% { transform: translateX(calc(-50% + 48px)) translateY(-22px) rotate(8deg); }
  46% { transform: translateX(calc(-50% + 86px)) translateY(-42px) scale(0.95, 1.08) rotate(11deg); }
  62% { transform: translateX(calc(-50% + 66px)) translateY(2px) scale(1.08, 0.9) rotate(-4deg); }
  78% { transform: translateX(calc(-50% + 28px)) translateY(-14px) rotate(-6deg); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes bameiCuriousLean {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  35% { transform: translateX(calc(-50% + 14px)) translateY(-5px) rotate(7deg); }
  70% { transform: translateX(calc(-50% + 10px)) rotate(5deg); }
}
@keyframes bameiRushCenter {
  0% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(calc(-50% + 28px)) translateY(-12px) rotate(8deg); }
  100% { transform: translateX(calc(-50% + 52px)) translateY(0) scale(0.95); opacity: 0.2; }
}
@keyframes rourouPeekAway {
  0%, 100% { transform: translateX(-50%) rotate(0deg); }
  30% { transform: translateX(calc(-50% + 10px)) rotate(5deg); }
  65% { transform: translateX(calc(-50% - 8px)) translateY(-4px) rotate(-6deg); }
}
@keyframes rourouCheerHop {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  25% { transform: translateX(-50%) translateY(-18px) rotate(-5deg); }
  45% { transform: translateX(-50%) translateY(0) scale(1.06, 0.92); }
  68% { transform: translateX(-50%) translateY(-14px) rotate(5deg); }
  85% { transform: translateX(-50%) translateY(0) scale(1.04, 0.95); }
}
@keyframes rourouDuckJoy {
  0% { transform: translateX(-50%) translateY(0) scale(1); }
  18% { transform: translateX(calc(-50% - 22px)) translateY(-20px) rotate(-7deg); }
  36% { transform: translateX(calc(-50% - 26px)) translateY(2px) scale(1.08, 0.9) rotate(4deg); }
  54% { transform: translateX(calc(-50% - 20px)) translateY(-16px) rotate(-6deg); }
  74% { transform: translateX(calc(-50% - 12px)) translateY(2px) scale(1.05, 0.94) rotate(5deg); }
  100% { transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes rourouRushCenter {
  0% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(calc(-50% - 28px)) translateY(-12px) rotate(-8deg); }
  100% { transform: translateX(calc(-50% - 52px)) translateY(0) scale(0.95); opacity: 0.2; }
}
@keyframes boardingShiverHug {
  0% { transform: scale(0.92); }
  18% { transform: scale(1.04, 0.94) translateX(-3px); }
  32% { transform: scale(0.98, 1.03) translateX(3px); }
  48% { transform: scale(1.03, 0.96) translateX(-2px); }
  66% { transform: scale(1.05, 0.96); }
  100% { transform: scale(1); }
}
@keyframes stormTremble {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px) translateY(2px); }
  40% { transform: translateX(4px) translateY(-2px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
@keyframes lightningFlash {
  0% { opacity: 0; }
  14% { opacity: 0.95; }
  28% { opacity: 0.15; }
  44% { opacity: 0.82; }
  100% { opacity: 0; }
}
@keyframes cloudDrop {
  0% { transform: translateY(-26px); opacity: 0; }
  20% { transform: translateY(10px); opacity: 1; }
  78% { transform: translateY(10px); opacity: 1; }
  100% { transform: translateY(-22px); opacity: 0; }
}
@keyframes boltStrike {
  0%, 16% { opacity: 0; transform: scaleY(0.4); }
  24% { opacity: 1; transform: scaleY(1.05); }
  36% { opacity: 0.15; }
  48% { opacity: 1; transform: scaleY(1); }
  75% { opacity: 0; }
  100% { opacity: 0; }
}
@keyframes fxHeartRise {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.45); }
  22% { opacity: 1; transform: translate(-50%, -14px) scale(1.08); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--hx, 0px)), -68px) scale(0.85) rotate(var(--hr, 12deg)); }
}
@keyframes fxSparklePop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(0deg); }
  35% { opacity: 1; transform: translate(calc(-50% + var(--sx, 0px)), calc(-50% + var(--sy, -14px))) scale(1.15) rotate(45deg); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--sx, 0px)), calc(-50% + var(--sy, -26px))) scale(0.2) rotate(95deg); }
}
@keyframes fxDustPuff {
  0% { opacity: 0.82; transform: translate(-50%, -50%) scale(0.5); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, -16px)), -62%) scale(1.9); }
}
@keyframes fxSqueakRing {
  0% { opacity: 0.9; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2.6); }
}
@keyframes fxSqueakTag {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.6); }
  24% { opacity: 1; transform: translate(-50%, -16px) scale(1.06); }
  100% { opacity: 0; transform: translate(-50%, -44px) scale(0.95); }
}
@keyframes smokeRise { 0% { opacity: 0.72; transform: translate(-50%, 0) scale(0.7); } 55% { opacity: 0.45; transform: translate(-35%, -26px) scale(1.7); } 100% { opacity: 0; transform: translate(-65%, -52px) scale(2.8); } }

/* ==========================================================================
   ACT 5 · 100% TELEPATHY COUPLE QUIZ (客厅里的默契 · ZERO OVERFLOW)
   ========================================================================== */
#scene-quiz {
  background: radial-gradient(circle at 50% 24%, #fffdf8 0%, #f8f0e4 62%, #f1e5d6 100%);
  padding: calc(56px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  justify-content: flex-start;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tele-wrap {
  width: min(410px, 100%);
  margin: auto 0;
  padding: 6px 0 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  z-index: 4;
}

.tele-meter {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tele-meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--font-serif);
  font-size: 12px;
  color: var(--ink-muted);
}
.tele-meter-score {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8b4052;
  font-family: var(--font-serif-en);
  font-size: 14px;
}
.tele-pop {
  font-family: var(--font-serif-en);
  font-size: 11px;
  font-weight: 700;
  color: #c25b6e;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}
.tele-pop.is-popping {
  animation: telePopUp 0.9s var(--ease-out) forwards;
}
@keyframes telePopUp {
  0% { opacity: 0; transform: translateY(8px) scale(0.85); }
  25% { opacity: 1; transform: translateY(-2px) scale(1.06); }
  100% { opacity: 0; transform: translateY(-14px) scale(0.96); }
}

.tele-bar {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(168, 120, 130, 0.16);
  overflow: hidden;
}
.tele-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d896a4 0%, #9b4b5d 100%);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.tele-card,
.tele-done {
  width: 100%;
  background: rgba(255, 253, 249, 0.94);
  border: 1px solid rgba(186, 158, 144, 0.28);
  border-radius: 22px;
  padding: 22px 18px 20px;
  box-shadow: 0 14px 34px rgba(108, 78, 66, 0.08), 0 2px 8px rgba(108, 78, 66, 0.04);
  animation: fadeSlideUp 0.42s var(--ease-out);
}

.tele-eyebrow {
  text-align: center;
  font-family: var(--font-serif-en);
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin-bottom: 10px;
}

.tele-q {
  text-align: center;
  font-family: var(--font-serif);
  font-size: clamp(15.5px, 4.3vw, 18px);
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink-plum);
  margin-bottom: 16px;
}

.tele-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tele-opt {
  width: 100%;
  text-align: left;
  padding: 12px 15px;
  border-radius: 13px;
  background: #faf6f0;
  border: 1px solid rgba(168, 142, 128, 0.28);
  font-family: var(--font-serif);
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-plum);
  transition: transform 0.2s var(--ease-spring), background 0.25s ease, border-color 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}
.tele-opt:hover:not(:disabled) {
  border-color: rgba(155, 75, 93, 0.5);
  background: #fff9f5;
  transform: translateY(-1px);
}
.tele-opt:active:not(:disabled) {
  transform: scale(0.985);
}
.tele-opt:disabled {
  cursor: default;
  opacity: 0.62;
}
.tele-opt.is-picked {
  opacity: 1 !important;
  background: linear-gradient(135deg, #864352, #6f3341);
  border-color: #6f3341;
  color: #fffaf4;
  box-shadow: 0 8px 18px rgba(111, 51, 65, 0.24);
}

.tele-feedback-wrap {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: fadeSlideUp 0.35s var(--ease-out);
}

.tele-feedback {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8f1e4;
  border: 1px solid rgba(196, 166, 132, 0.28);
  font-family: var(--font-serif);
  font-size: 12.5px;
  line-height: 1.65;
  color: #5d453d;
  text-align: center;
}

.tele-proof-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: #fffdf9;
  border: 1px solid rgba(189, 119, 109, 0.32);
  font-family: var(--font-serif);
  font-size: 11px;
  color: #7a574d;
  box-shadow: 0 4px 12px rgba(108, 78, 66, 0.08);
  transition: transform 0.2s ease;
}
.tele-proof-chip:active { transform: scale(0.96); }
.tele-proof-chip img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.tele-next-btn {
  padding: 9px 22px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(134, 67, 82, 0.36);
  font-family: var(--font-serif);
  font-size: 12.5px;
  color: #6f3341;
  box-shadow: 0 4px 12px rgba(111, 51, 65, 0.08);
  transition: transform 0.2s ease, background 0.2s ease;
}
.tele-next-btn:active { transform: scale(0.96); }

/* 100% Completed Ceremony Card */
.tele-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 20px 22px;
}
.tele-stamp {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 2.5px dashed #a84556;
  background: radial-gradient(circle, rgba(248, 224, 228, 0.45), rgba(255, 250, 245, 0.9));
  color: #9e3849;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-10deg);
  margin-bottom: 16px;
  box-shadow: 0 6px 18px rgba(158, 56, 73, 0.14);
}
.tele-stamp.is-slamming {
  animation: stampSlam 0.56s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes stampSlam {
  0% { opacity: 0; transform: scale(2.1) rotate(-24deg); }
  65% { opacity: 1; transform: scale(0.92) rotate(-8deg); }
  100% { opacity: 1; transform: scale(1) rotate(-10deg); }
}
.tele-stamp span { font-family: var(--font-serif); font-size: 11px; letter-spacing: 0.12em; }
.tele-stamp strong { font-family: var(--font-serif-en); font-size: 20px; font-weight: 700; line-height: 1.1; }

.tele-done-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 500;
  color: var(--ink-plum);
  margin-bottom: 8px;
}
.tele-done-desc {
  font-family: var(--font-serif);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-muted);
  margin-bottom: 18px;
}
.tele-cta-btn {
  padding: 11px 24px;
  border-radius: 999px;
  background: #332523;
  color: #faf5ea;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 22px rgba(51, 37, 35, 0.22);
  margin-bottom: 10px;
  transition: transform 0.2s ease;
}
.tele-cta-btn:active { transform: scale(0.96); }
.tele-replay-btn {
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: var(--ink-soft);
  padding: 4px 10px;
}

/* ==========================================================================
   VOUCHER RED-STAMP CEREMONY (Act 7 Gashapon) & YEAR-8 WISH CAPSULE (Act 8)
   ========================================================================== */
.voucher-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.voucher-stamp-btn {
  display: none;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(255, 246, 244, 0.94);
  border: 1px dashed rgba(179, 59, 52, 0.65);
  font-family: var(--font-serif);
  font-size: 12.5px;
  color: #9e2f29;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, background 0.2s ease;
}
.voucher-stamp-btn.is-shown { display: inline-block; animation: fadeSlideUp 0.35s ease; }
.voucher-stamp-btn.is-stamped {
  background: #9e2f29;
  color: #fffaf2;
  border-style: solid;
}
.voucher-stamp-btn:active { transform: scale(0.96); }

.mini-v-signed {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--font-serif);
  font-size: 8px;
  color: #a3332d;
  border: 1px solid rgba(163, 51, 45, 0.5);
  background: rgba(255, 245, 244, 0.9);
  transform: rotate(-4deg);
}

/* Year 8 Wish Capsule inside Act 8 Finale Card */
.wish-capsule {
  margin: 10px 0 11px;
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(250, 243, 232, 0.85);
  border: 1px dashed rgba(189, 119, 109, 0.36);
  text-align: center;
}
.wish-capsule-head {
  font-family: var(--font-serif-en);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--terracotta);
  margin-bottom: 7px;
}
.wish-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-bottom: 8px;
}
.wish-chip {
  padding: 3px 9px;
  border-radius: 999px;
  background: #fffdf9;
  border: 1px solid rgba(189, 119, 109, 0.28);
  font-family: var(--font-serif);
  font-size: 10.5px;
  color: #6b5248;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.wish-chip:hover {
  background: #fff6f2;
  border-color: rgba(189, 119, 109, 0.58);
}
.wish-input-row {
  display: flex;
  gap: 6px;
}
.wish-input {
  flex: 1;
  min-width: 0;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(168, 140, 128, 0.34);
  background: #fff;
  font-family: var(--font-serif);
  font-size: 11.5px;
  color: var(--ink-plum);
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}
.wish-input:focus {
  border-color: var(--terracotta);
}
.wish-seal-btn {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--terracotta);
  color: #fffaf4;
  font-family: var(--font-serif);
  font-size: 11.5px;
  white-space: nowrap;
}
.wish-sealed-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(189, 119, 109, 0.16);
  color: #9e4b40;
  font-family: var(--font-serif);
  font-size: 10px;
  margin-bottom: 4px;
}
.wish-sealed-text {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-plum);
  margin-bottom: 4px;
}
.wish-edit-link {
  font-family: var(--font-serif);
  font-size: 10.5px;
  color: var(--ink-soft);
  text-decoration: underline;
}

/* Global Double-Tap Floating Hearts Easter Egg */
.tap-heart-float {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  font-size: 18px;
  line-height: 1;
  animation: tapHeartRise 1.05s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes tapHeartRise {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.4); }
  20% { opacity: 0.95; transform: translate(-50%, -18px) scale(1.1); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -86px) scale(0.8) rotate(var(--dr, 14deg)); }
}
