:root {
  --ink: #291820;
  --ink-soft: #71545f;
  --cream: #fffaf7;
  --blush: #f9e9eb;
  --rose: #a74660;
  --rose-dark: #7f2f48;
  --gold: #b89154;
  --line: rgba(127, 47, 72, .16);
  --card: rgba(255, 250, 247, .88);
  --shadow: 0 24px 80px rgba(72, 30, 44, .16);
  --radius: 28px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html { overflow-x: hidden; background: #24151d; scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(255,255,255,.95), transparent 28rem),
    linear-gradient(145deg, #fff8f4 0%, #f9e6e8 52%, #ecd6dd 100%);
  font-family: "Noto Serif TC", serif;
  font-size: 16px;
  line-height: 1.7;
  overscroll-behavior: contain;
}
body.identity-locked { overflow: hidden; }
button, select { font: inherit; touch-action: manipulation; }
input { font: inherit; }
button { cursor: pointer; }
img, video { display: block; max-width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 1000;
  padding: 10px 16px; color: white; background: var(--rose-dark);
}
.skip-link:focus { top: 12px; }
.film-grain {
  position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}
.petals { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.petal {
  position: absolute; top: -20px; width: 8px; height: 13px; border-radius: 80% 10% 70% 20%;
  background: rgba(167,70,96,.26); animation: fall var(--fall-time) ease-in forwards;
}
@keyframes fall { to { transform: translate3d(var(--drift), 105vh, 0) rotate(300deg); opacity: 0; } }
.app-shell { position: relative; z-index: 5; min-height: 100dvh; }
.identity-gate {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px;
  color: white; background:
    linear-gradient(rgba(35,18,27,.62), rgba(35,18,27,.82)),
    url("assets/photos/0029.webp") center/cover;
}
.identity-gate[hidden] { display: none; }
.identity-card {
  min-width: 0; width: 520px; max-width: calc(100vw - 40px); padding: clamp(30px, 6vw, 52px);
  text-align: center; background: rgba(43,24,34,.88); border: 1px solid rgba(255,255,255,.2);
  border-radius: 30px; box-shadow: 0 32px 100px rgba(0,0,0,.5); backdrop-filter: blur(18px);
}
.identity-kicker { color: #d7aa91; font-family: "Playfair Display", serif; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.identity-heart {
  display: grid; place-items: center; width: 64px; height: 64px; margin: 22px auto;
  border: 1px solid rgba(255,255,255,.3); border-radius: 50%;
}
.identity-heart svg { width: 28px; fill: none; stroke: #f4c9c1; stroke-width: 1.4; }
.identity-card h1 { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(30px, 7vw, 48px); }
.identity-card form { display: grid; gap: 12px; margin-top: 28px; text-align: left; }
.identity-card label { color: rgba(255,255,255,.76); font-size: 14px; }
.identity-card input {
  width: 100%; min-height: 54px; padding: 12px 16px; color: white;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.22); border-radius: 14px;
}
.identity-card input::placeholder { color: rgba(255,255,255,.4); }
.identity-card input:focus { outline: 3px solid rgba(244,201,193,.3); border-color: #f4c9c1; }
.identity-feedback { min-height: 27px; margin: 0; color: #e6b8ad; font-size: 14px; }
.identity-card .primary-btn { width: 100%; }
.topbar {
  position: fixed; z-index: 50; top: 0; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 18px clamp(20px, 4vw, 64px);
  color: white; background: linear-gradient(to bottom, rgba(35,18,27,.78), transparent);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: "Playfair Display", serif; letter-spacing: .04em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(255,255,255,.45); border-radius: 50%; }
.brand svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.progress-wrap { width: min(260px, 42vw); font-size: 12px; letter-spacing: .12em; text-align: right; }
.progress-track { height: 3px; margin-top: 5px; overflow: hidden; background: rgba(255,255,255,.24); border-radius: 4px; }
.progress-track span { display: block; width: 0; height: 100%; background: #f7d7c7; transition: width .5s var(--ease); }
.screen { display: none; min-height: 100dvh; opacity: 0; }
.screen { position: relative; }
.screen.active { display: grid; animation: reveal .7s var(--ease) forwards; }
@keyframes reveal { from { opacity: 0; } to { opacity: 1; } }
.hero { grid-template-columns: 1.08fr .92fr; background: #2c1922; color: white; }
.hero-photo { position: relative; min-height: 100dvh; overflow: hidden; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, transparent 58%, #2c1922 100%), linear-gradient(0deg, rgba(35,18,27,.38), transparent); }
.hero-content { display: flex; min-width: 0; width: 100%; flex-direction: column; justify-content: center; align-items: flex-start; padding: 120px clamp(32px, 7vw, 110px) 80px; }
.eyebrow { margin: 0 0 14px; color: #c29376; font-family: "Playfair Display", serif; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; }
h1,h2 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -.035em; }
h1 { font-size: clamp(44px, 6vw, 92px); }
h1 em { color: #f1c6bd; font-family: "Playfair Display", serif; font-weight: 600; }
h2 { font-size: clamp(34px, 4.6vw, 64px); }
.lead { max-width: 540px; margin: 28px 0 38px; overflow-wrap: anywhere; color: rgba(255,255,255,.78); font-size: clamp(16px, 1.5vw, 19px); }
.primary-btn, .secondary-btn {
  min-height: 52px; border: 0; border-radius: 999px; padding: 13px 24px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  transition: background .2s, box-shadow .2s, opacity .2s;
}
.primary-btn { color: white; background: var(--rose); box-shadow: 0 12px 30px rgba(127,47,72,.3); }
.primary-btn:hover { background: var(--rose-dark); box-shadow: 0 15px 34px rgba(127,47,72,.38); }
.primary-btn:active { opacity: .88; }
.primary-btn svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.primary-btn:disabled { cursor: not-allowed; opacity: .38; box-shadow: none; }
.secondary-btn { color: var(--rose-dark); background: transparent; border: 1px solid var(--line); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid rgba(167,70,96,.35); outline-offset: 3px; }
.level-screen {
  place-items: center; padding: 110px 20px 52px;
  background:
    radial-gradient(circle at 85% 12%, rgba(255,255,255,.8), transparent 27rem),
    linear-gradient(145deg, #fffaf7, #f6e4e8);
}
.chapter-card {
  width: min(760px, 100%); padding: clamp(28px, 5vw, 58px);
  background: var(--card); border: 1px solid rgba(255,255,255,.82);
  border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: blur(18px);
}
.chapter-card.wide { width: min(1040px, 100%); }
.chapter-number { display: inline-block; margin-bottom: 24px; color: var(--rose); font-family: "Playfair Display", serif; font-size: 13px; letter-spacing: .15em; text-transform: uppercase; }
.question-copy { margin: 22px 0 28px; color: var(--ink-soft); font-size: 17px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice {
  min-height: 58px; padding: 12px 18px; color: var(--ink); background: white;
  border: 1px solid var(--line); border-radius: 16px; text-align: left;
  transition: border .2s, background .2s, box-shadow .2s;
}
.choice:hover { border-color: rgba(167,70,96,.46); }
.choice.selected { color: var(--rose-dark); background: #fbecef; border-color: var(--rose); box-shadow: inset 0 0 0 1px var(--rose); }
.helper { color: var(--ink-soft); font-size: 13px; }
.feedback { min-height: 31px; margin: 14px 0; color: var(--rose-dark); font-weight: 600; }
.feedback.success { color: #326b53; }
.next-btn { width: 100%; }
.chat-quiz { display: grid; gap: 4px; max-width: 720px; margin: 0 auto; }
.date-divider { display: flex; align-items: center; gap: 12px; margin: 17px 0 9px; color: #9a7a85; font-size: 12px; }
.date-divider::before, .date-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.archive-date { transition: filter .35s, opacity .35s; }
.archive-date.locked { filter: blur(5px); opacity: .5; user-select: none; }
.chat-row { display: flex; align-items: flex-end; gap: 11px; }
.avatar {
  flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center;
  color: white; background: linear-gradient(145deg, #c37489, #8b4057); border-radius: 50%; font-weight: 700;
}
.chat-bubble {
  position: relative; max-width: calc(100% - 54px); padding: 12px 15px; color: var(--ink);
  background: white; border: 1px solid rgba(127,47,72,.09); border-radius: 7px 18px 18px 18px;
  box-shadow: 0 6px 18px rgba(69,30,42,.07);
}
.chat-bubble select {
  width: auto; min-width: 92px; min-height: 40px; margin: 0 5px; padding-block: 3px;
  color: var(--rose-dark); background: var(--blush); border-color: rgba(167,70,96,.22);
}
.song-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.song-card { margin: 0; padding: 20px; background: white; border: 1px solid var(--line); border-radius: 20px; }
.song-card legend { padding: 0 5px; font-weight: 600; line-height: 1.5; }
.song-card legend span { color: var(--gold); font-family: "Playfair Display", serif; margin-right: 7px; }
.song-preview {
  width: 100%; min-height: 50px; margin: 16px 0 4px; padding: 10px 15px;
  display: flex; align-items: center; gap: 11px;
  color: var(--rose-dark); background: linear-gradient(135deg, #fcecef, #fff8f5);
  border: 1px solid rgba(167,70,96,.2); border-radius: 14px; text-align: left;
  transition: border-color .2s, background .2s, transform .2s;
}
.song-preview:hover { border-color: var(--rose); transform: translateY(-1px); }
.song-preview.playing { color: white; background: linear-gradient(135deg, #b95f78, #87354e); }
.preview-icon {
  flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center;
  color: white; background: var(--rose); border-radius: 50%; font-family: sans-serif; font-size: 11px;
}
.song-preview.playing .preview-icon { color: var(--rose-dark); background: white; }
.preview-label { font-weight: 600; }
.song-card label { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; padding: 10px; border-radius: 10px; cursor: pointer; }
.song-card label:has(input:checked) { color: var(--rose-dark); background: var(--blush); }
.song-card input { margin-top: 6px; accent-color: var(--rose); }
.memory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 720px; margin: 0 auto; perspective: 900px; }
.memory-card { position: relative; aspect-ratio: 4/3; padding: 0; border: 0; background: transparent; transform-style: preserve-3d; transition: transform .45s var(--ease); }
.memory-card.flipped, .memory-card.matched { transform: rotateY(180deg); }
.memory-face { position: absolute; inset: 0; overflow: hidden; border-radius: 16px; backface-visibility: hidden; box-shadow: 0 10px 25px rgba(69,30,42,.13); }
.memory-front { display: grid; place-items: center; color: white; background: linear-gradient(145deg, #a74660, #733044); }
.memory-front svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.memory-back { transform: rotateY(180deg); background: white; }
.memory-back img { width: 100%; height: 100%; object-fit: cover; }
.photo-feature { overflow: hidden; margin: 26px 0; aspect-ratio: 16/7; border-radius: 20px; }
.photo-feature img { width: 100%; height: 100%; object-fit: cover; }
.dialogue-scene {
  margin: 26px 0; padding: 22px; background: linear-gradient(160deg, #f2e9e7, #eadadc);
  border: 1px solid rgba(255,255,255,.85); border-radius: 22px;
}
.dialogue-date { margin: 0 0 18px; color: #8d717a; font-size: 12px; text-align: center; }
.dialogue {
  width: fit-content; max-width: 82%; margin: 8px 0 8px auto; padding: 9px 14px;
  color: white; background: var(--rose); border-radius: 17px 5px 17px 17px;
  box-shadow: 0 5px 14px rgba(127,47,72,.14);
}
.dialogue.reply { margin-right: auto; margin-left: 0; color: var(--ink); background: white; border-radius: 5px 17px 17px 17px; }
.revealed-reply { animation: message-in .3s var(--ease) both; }
@keyframes message-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.typing-dots {
  display: flex; gap: 4px; width: fit-content; margin-top: 16px; padding: 12px 15px;
  background: white; border-radius: 5px 16px 16px 16px;
}
.typing-dots span { width: 6px; height: 6px; background: #b79ca5; border-radius: 50%; }
.fill-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.fill-row label { color: var(--ink-soft); font-weight: 600; }
select { width: 100%; min-height: 52px; margin-top: 8px; padding: 8px 38px 8px 14px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 13px; }
.final-question { text-align: center; }
.sentence { min-height: 82px; margin: 28px 0; padding: 18px; color: var(--rose-dark); background: white; border-bottom: 2px solid var(--rose); border-radius: 15px 15px 0 0; font-size: clamp(24px, 4vw, 36px); letter-spacing: .08em; }
.word-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.word-bank button { min-width: 72px; min-height: 52px; padding: 10px 18px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 999px; }
.word-bank button:disabled { opacity: .32; cursor: not-allowed; }
.text-btn { min-height: 44px; margin: 12px 0; padding: 6px 12px; color: var(--rose); background: transparent; border: 0; text-decoration: underline; text-underline-offset: 4px; }
.finale {
  place-items: center; padding: 120px 20px 70px; color: white; text-align: center;
  background: radial-gradient(circle at 50% 15%, #5c2e40, #24151d 58%);
}
.finale-inner { width: min(980px, 100%); }
.finale h2 { color: #fff8f4; }
.finale p { max-width: 660px; margin: 24px auto; color: rgba(255,255,255,.74); }
.confession-gate {
  width: min(620px, 100%); min-height: 230px; margin: 36px auto; padding: 32px;
  display: grid; place-content: center; gap: 14px; background: rgba(255,255,255,.055);
  border: 1px solid rgba(255,255,255,.15); border-radius: 24px;
}
.typing-line { display: flex; align-items: center; justify-content: center; gap: 11px; color: #f6ddd7; }
.mini-avatar {
  display: grid; place-items: center; width: 38px; height: 38px;
  color: white; background: var(--rose); border-radius: 50%; font-weight: 700;
}
.inline-dots { margin: 0; padding: 8px 10px; background: rgba(255,255,255,.12); }
.confession-gate > p { margin: 0 auto; color: white; font-size: clamp(19px, 3vw, 25px); animation: message-in .4s var(--ease) both; }
.confession-content { animation: reveal .65s var(--ease) both; }
.confession-content[hidden] { display: none; }
.video-frame { overflow: hidden; margin: 38px auto; background: black; border: 1px solid rgba(255,255,255,.18); border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.38); }
.video-frame video, .video-frame iframe { display: block; width: 100%; aspect-ratio: 16/9; background: black; border: 0; }
.final-note { font-size: 20px; }
.final-note strong { color: #f4c9c1; font-size: 28px; font-weight: 600; }
.bonus-unlock {
  max-width: 620px; margin: 30px auto 22px; padding: 24px;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.13); border-radius: 20px;
}
.bonus-unlock p { margin: 0 auto 16px; }
.bonus-unlock .manual-finish {
  position: fixed; z-index: 70; right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom)); display: block;
  min-height: 52px; padding: 13px 22px; color: #532335;
  background: #fff6f1; border: 2px solid #d996a7; border-radius: 999px;
  box-shadow: 0 14px 40px rgba(0,0,0,.36); font-weight: 700;
  cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.bonus-unlock .manual-finish:hover { transform: translateY(-2px); box-shadow: 0 18px 46px rgba(0,0,0,.42); }
.bonus-unlock .manual-finish:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.bonus-unlock .manual-finish[hidden] { display: none; }
.bonus-unlock .primary-btn.just-unlocked {
  animation: bonus-ready .6s var(--ease) both;
  box-shadow: 0 0 0 5px rgba(244,201,193,.18), 0 14px 34px rgba(0,0,0,.22);
}
@keyframes bonus-ready {
  from { opacity: .55; transform: scale(.97); }
  to { opacity: 1; transform: none; }
}
.finale .secondary-btn { color: #f6ddd7; border-color: rgba(255,255,255,.22); }
.bonus-screen { background: radial-gradient(circle at 50% 0%, #fff, transparent 30rem), linear-gradient(145deg, #fff8f4, #f2dce2); }
.bonus-progress {
  display: flex; justify-content: space-between; gap: 16px; margin: 24px 0 10px;
  color: var(--rose-dark); font-size: 13px; font-weight: 600; letter-spacing: .04em;
}
.bonus-dialogue { min-height: 190px; }
.bonus-choices .choice.correct { color: #245e47; background: #e5f3eb; border-color: #68a185; }
.bonus-choices .choice.wrong { color: #8b344a; background: #f9e1e6; border-color: #c97b8d; }
.bonus-feedback { min-height: 64px; }
.secret-heart {
  position: absolute; z-index: 15; width: 48px; height: 48px; padding: 0;
  background: transparent; border: 0; opacity: .2; transition: opacity .2s, transform .2s;
}
.secret-heart::before {
  content: ""; position: absolute; left: 15px; top: 16px; width: 15px; height: 13px;
  background: currentColor; transform: rotate(-45deg); transform-origin: 0 100%; border-radius: 7px 7px 0 0;
}
.secret-heart::after {
  content: ""; position: absolute; left: 8px; top: 16px; width: 15px; height: 13px;
  background: currentColor; transform: rotate(45deg); transform-origin: 100% 100%; border-radius: 7px 7px 0 0;
}
.secret-heart:hover, .secret-heart:focus-visible { opacity: .85; transform: scale(1.12); }
.secret-heart.collected { opacity: .9; color: #c66b82; pointer-events: none; }
.secret-heart-a { right: 5%; bottom: 8%; color: #f3c5bc; }
.secret-heart-b { left: 4%; top: 31%; color: #a74660; }
.secret-heart-c { right: 4%; top: 23%; color: #a74660; }
.secret-heart-d { left: 5%; bottom: 14%; color: #a74660; }
.secret-heart-e { right: 5%; bottom: 9%; color: #a74660; }
.secret-heart-f { left: 4%; top: 22%; color: #a74660; }
.secret-heart-g { right: 4%; top: 28%; color: #f3c5bc; }
.secret-heart-h { left: 4%; bottom: 12%; color: #a74660; }
.easter-egg, .memory-card-modal, .heart-secret {
  position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 20px;
  background: rgba(35,18,27,.82); backdrop-filter: blur(14px);
}
.easter-egg[hidden], .memory-card-modal[hidden], .heart-secret[hidden] { display: none; }
.easter-card, .heart-secret-card {
  width: min(700px, 100%); padding: clamp(30px, 6vw, 54px); text-align: center;
  background: #fffaf7; border-radius: 30px; box-shadow: 0 30px 100px rgba(0,0,0,.42);
  animation: reward-in .45s var(--ease) both;
}
.system-line { margin: 16px 0 24px; color: var(--ink-soft); }
.easter-card h2 { font-size: clamp(28px, 5vw, 46px); }
.easter-choices { margin-top: 30px; }
.easter-card .feedback { margin-bottom: 0; }
.memory-card-sheet {
  position: relative; width: min(610px, 100%); max-height: calc(100dvh - 32px); overflow: auto;
  padding: 18px; background: #f5e8e8; border-radius: 28px; box-shadow: 0 30px 100px rgba(0,0,0,.45);
}
.modal-close {
  position: absolute; z-index: 2; top: 26px; right: 26px; width: 44px; height: 44px;
  color: white; background: rgba(35,18,27,.62); border: 0; border-radius: 50%; font-size: 25px;
}
.completion-card {
  position: relative; overflow: hidden; padding: 30px; color: var(--ink); text-align: center;
  background: #fffaf7; border: 1px solid white; border-radius: 20px;
}
.completion-kicker { color: var(--gold); font-family: "Playfair Display", serif; font-size: 12px; letter-spacing: .16em; }
.completion-photo { overflow: hidden; margin: 22px 0; aspect-ratio: 16/10; border-radius: 16px; }
.completion-photo img { width: 100%; height: 100%; object-fit: cover; }
.completion-card h2 { font-size: clamp(28px, 6vw, 42px); }
#completionTitle { color: var(--rose-dark); font-size: 18px; font-weight: 700; }
.completion-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 20px; margin-top: 25px; color: var(--ink-soft); font-size: 13px; }
.completion-answer { min-height: 28px; margin: 16px 0 0; color: var(--rose-dark); }
.memory-card-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding: 18px 0 2px; }
.save-card-preview {
  margin-top: 18px; padding: 18px; text-align: center; background: #fffaf7;
  border: 1px solid white; border-radius: 20px;
}
.save-card-preview[hidden] { display: none; }
.save-card-preview p { margin: 0 0 16px; color: var(--ink-soft); }
.save-card-preview img { width: min(100%, 390px); margin: 0 auto 16px; border-radius: 14px; box-shadow: 0 14px 34px rgba(72,30,44,.18); }
.save-card-actions {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
  width: min(100%, 390px); margin: 0 auto;
}
.save-card-actions .primary-btn,
.save-card-actions .secondary-btn { flex: 1 1 160px; text-decoration: none; }
.story-modal {
  position: fixed; inset: 0; z-index: 420; display: grid; place-items: center; padding: 20px;
  background: rgba(35,18,27,.76); backdrop-filter: blur(12px);
}
.story-modal[hidden] { display: none; }
.story-modal-card {
  width: min(560px, 100%); max-height: calc(100dvh - 40px); overflow: auto;
  padding: 42px 32px 34px; color: var(--ink); text-align: center;
  background: linear-gradient(145deg, #fffaf7, #f8e9e8); border: 1px solid rgba(255,255,255,.88);
  border-radius: 28px; box-shadow: 0 32px 90px rgba(0,0,0,.38);
  animation: reward-in .48s var(--ease) both;
}
.story-modal-card h2 { margin: 10px 0 14px; font-size: clamp(29px, 6vw, 42px); }
.story-modal-card > p:not(.eyebrow) { color: var(--ink-soft); line-height: 1.9; }
.story-modal-note { margin: 20px 0 24px; font-size: 14px; }
.back-message-preview {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin: 26px 0 18px;
}
.back-message-preview span {
  display: grid; place-items: center; min-height: 112px; padding: 10px 6px;
  color: #713047; background: #fff; border: 1px solid #ead6d9; border-radius: 9px;
  box-shadow: 0 8px 20px rgba(72,30,44,.08); font-size: 14px; line-height: 1.6;
}
.coupon-ticket {
  position: relative; margin: 26px auto 18px; padding: 34px 26px;
  color: #fff9f5; background: linear-gradient(135deg, #9a3d5a, #c8758b);
  border: 1px solid rgba(255,255,255,.54); border-radius: 20px;
  box-shadow: 0 18px 44px rgba(127,47,72,.25);
}
.coupon-ticket::before,
.coupon-ticket::after {
  content: ""; position: absolute; top: 50%; width: 28px; height: 28px;
  background: #faeeee; border-radius: 50%; transform: translateY(-50%);
}
.coupon-ticket::before { left: -14px; }
.coupon-ticket::after { right: -14px; }
.coupon-label { display: block; color: #f5dca9; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.coupon-ticket strong { display: block; margin: 15px 0 10px; font-size: clamp(34px, 8vw, 54px); letter-spacing: .08em; }
.coupon-ticket p { margin: 0 0 14px; line-height: 1.8; }
.coupon-ticket small { color: #f9dfdf; }
.coupon-actions,
.coupon-save-actions {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 10px;
}
.coupon-actions > *,
.coupon-save-actions > * { flex: 1 1 190px; }
.coupon-save-panel {
  margin-top: 20px; padding: 18px; background: rgba(255,255,255,.72);
  border: 1px solid #ead6d9; border-radius: 18px;
}
.coupon-save-panel[hidden] { display: none; }
.coupon-save-panel p { margin: 0 0 14px; color: var(--ink-soft); font-size: 14px; }
.coupon-save-panel img {
  width: 100%; margin: 0 auto 14px; border-radius: 13px;
  box-shadow: 0 12px 30px rgba(72,30,44,.18);
}
.coupon-save-actions a { text-decoration: none; }
.local-test-tools {
  position: fixed; z-index: 600; top: 82px; left: 14px;
  display: grid; justify-items: start; gap: 8px;
}
.local-test-tools[hidden] { display: none; }
.test-tools-toggle {
  min-height: 46px; padding: 10px 16px; color: white;
  background: #34202a; border: 1px solid rgba(255,255,255,.34); border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28); font-weight: 700; cursor: pointer;
}
.test-tools-panel {
  display: grid; width: min(240px, calc(100vw - 28px)); padding: 14px; gap: 8px;
  color: var(--ink); background: rgba(255,250,247,.97); border: 1px solid #ead6d9;
  border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.3); backdrop-filter: blur(12px);
}
.test-tools-panel[hidden] { display: none; }
.test-tools-panel strong { padding: 3px 5px 7px; color: var(--rose-dark); }
.test-tools-panel button {
  min-height: 44px; padding: 9px 12px; color: var(--ink); text-align: left;
  background: white; border: 1px solid var(--line); border-radius: 11px; cursor: pointer;
}
.test-tools-panel button:hover,
.test-tools-panel button:focus-visible { color: var(--rose-dark); border-color: var(--rose); background: #fff5f5; }
.heart-secret-card { color: var(--ink); }
.heart-secret-card h2 { margin: 24px auto 30px; font-size: clamp(28px, 5vw, 46px); }
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translate(-50%, 24px);
  max-width: calc(100vw - 32px); padding: 12px 20px; color: white; background: #34202a;
  border-radius: 999px; box-shadow: 0 12px 36px rgba(0,0,0,.25); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.reward-modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.reward-modal[hidden] { display: none; }
.reward-backdrop { position: absolute; inset: 0; background: rgba(35,18,27,.72); backdrop-filter: blur(10px); }
.reward-card {
  position: relative; width: min(480px, 100%); padding: 44px 32px 34px; overflow: hidden;
  color: var(--ink); text-align: center; background: #fffaf7; border: 1px solid rgba(255,255,255,.82);
  border-radius: 28px; box-shadow: 0 32px 90px rgba(0,0,0,.34);
  animation: reward-in .42s var(--ease) both;
}
.reward-card::before {
  content: ""; position: absolute; width: 210px; height: 210px; top: -130px; right: -80px;
  background: radial-gradient(circle, rgba(212,144,160,.35), transparent 68%);
}
.reward-kicker { color: var(--gold); font-family: "Playfair Display", serif; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
.reward-seal {
  display: grid; place-items: center; width: 76px; height: 76px; margin: 24px auto 18px;
  color: white; background: linear-gradient(145deg, #bd667e, #84334d); border-radius: 50%;
  box-shadow: 0 12px 28px rgba(127,47,72,.28);
}
.reward-seal svg { width: 35px; fill: none; stroke: currentColor; stroke-width: 1.25; }
.reward-card h2 { font-size: clamp(28px, 6vw, 40px); }
.reward-card p { margin: 16px auto 26px; color: var(--ink-soft); }
@keyframes reward-in { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 820px) {
  .hero { width: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: 45dvh auto; }
  .hero-photo { min-height: 45dvh; }
  .hero-overlay { background: linear-gradient(0deg, #2c1922 0%, transparent 58%); }
  .hero-content { padding: 20px 24px 64px; }
  .topbar { padding: 16px 20px; }
  .song-list { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .brand span:last-child { display: none; }
  .progress-wrap { width: 54vw; }
  .choice-grid, .fill-row { grid-template-columns: 1fr; }
  .memory-grid { gap: 9px; }
  .chapter-card { padding: 28px 20px; border-radius: 22px; }
  .level-screen { padding-inline: 12px; }
  .photo-feature { aspect-ratio: 16/10; }
  .chat-bubble { font-size: 15px; }
  .chat-bubble select { display: inline-block; min-width: 88px; }
  .easter-choices { grid-template-columns: 1fr; }
  .completion-card { padding: 20px; }
  .bonus-unlock .manual-finish {
    right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); left: 12px;
    width: calc(100% - 24px);
  }
  .story-modal-card { padding: 34px 20px 28px; }
  .back-message-preview { grid-template-columns: repeat(5, minmax(54px, 1fr)); gap: 4px; }
  .back-message-preview span { min-height: 100px; padding: 8px 3px; font-size: 12px; }
  .secret-heart-b, .secret-heart-d, .secret-heart-f, .secret-heart-h { left: 0; }
  .secret-heart-c, .secret-heart-e, .secret-heart-g { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .petals { display: none; }
}
