/* Change these variables to recolour the whole storybook. */

:root {

    color-scheme: light;

    --ink: #493a52;

    --muted: #877889;

    --pink: #efb9c8;

    --rose: #d9829b;

    --lavender: #c5b6dc;

    --blue: #c3deeb;

    --cream: #fff8f1;

    --gold: #c6a15d;

    --paper: #fffdf8;

    --serif: Georgia, "Times New Roman", serif;

    --script: "Segoe Print", "Bradley Hand", cursive;

}

* { box-sizing: border-box; }

html { min-width: 320px; scroll-behavior: smooth; }

body {

    min-height: 100vh;

    margin: 0;

    overflow-x: hidden;

    color: var(--ink);

    background:

        radial-gradient(ellipse at 12% 22%, rgba(255, 220, 229, .65), transparent 32rem),

        radial-gradient(ellipse at 85% 70%, rgba(218, 232, 244, .72), transparent 35rem),

        linear-gradient(150deg, #fff9f2 0%, #fff6f8 52%, #f5f1fa 100%);

    font-family: var(--serif);

}

button, input { font: inherit; }

button { color: inherit; }

.is-hidden { display: none !important; }

.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; }

.sky-specks {

    position: fixed;

    z-index: -1;

    inset: 0;

    pointer-events: none;

    opacity: .52;

    background-image: radial-gradient(#c5a86d 1px, transparent 1.5px), radial-gradient(#d88fa5 1px, transparent 1.5px);

    background-position: 13px 21px, 64px 73px;

    background-size: 112px 112px, 151px 151px;

    mask-image: linear-gradient(to bottom, #000 0%, transparent 80%);

}

.screen { min-height: 100svh; }

.gate { position: relative; display: grid; place-items: center; padding: 36px 18px; overflow: hidden; }

.gate-glow { position: absolute; width: min(72vw, 620px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(247, 213, 226, .3) 46%, transparent 70%); pointer-events: none; }

.gate-card { position: relative; width: min(100%, 398px); padding: 32px 32px 26px; text-align: center; border: 1px solid rgba(198, 161, 93, .55); border-radius: 46% 46% 9px 9px / 14% 14% 9px 9px; background: rgba(255, 253, 248, .77); box-shadow: 0 22px 80px rgba(102, 72, 91, .1), inset 0 0 0 5px rgba(255, 255, 255, .7); animation: card-arrive .9s both; }

.gate-card::before, .gate-card::after { position: absolute; right: 13px; left: 13px; height: 12px; content: "✧　·　✦　·　✧"; color: var(--gold); font-size: 12px; letter-spacing: 8px; }

.gate-card::before { top: 14px; }

.gate-card::after { bottom: 8px; }

.eyebrow, .section-kicker { margin: 0; color: #a77884; font: 600 10px/1.4 var(--serif); letter-spacing: 2.5px; text-transform: uppercase; }

.envelope { position: relative; display: grid; width: 54px; height: 40px; margin: 19px auto 16px; place-items: center; border: 1px solid var(--gold); border-radius: 4px; background: linear-gradient(145deg, #f7dce4, #eedff4); box-shadow: 0 6px 14px #c4a4a240; transform: rotate(-4deg); }

.envelope::before { position: absolute; inset: -1px; content: ""; background: linear-gradient(32deg, transparent 49%, #caaea8 50%, transparent 52%), linear-gradient(-32deg, transparent 49%, #caaea8 50%, transparent 52%); }

.envelope span { z-index: 1; display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; color: white; background: var(--rose); font: 12px var(--serif); }

.gate h1 { margin: 0; font-size: clamp(25px, 7vw, 34px); font-weight: 400; line-height: 1.2; }

.gate-hint { margin: 9px 0 17px; color: var(--muted); font-size: 13px; font-style: italic; }

.code-hint { display: flex; justify-content: center; gap: 9px; margin: 0 auto 15px; }

.code-hint span { display: grid; width: 34px; height: 38px; place-items: center; border: 1px solid #e4cfa5; border-radius: 50% 50% 46% 46%; color: #94764b; background: #fff9e9; font-size: 20px; box-shadow: 0 3px 10px #bc9c4930; animation: digit-glow 2.5s ease-in-out infinite; }

.code-hint span:nth-child(2) { animation-delay: .15s; }.code-hint span:nth-child(3) { animation-delay: .3s; }.code-hint span:nth-child(4) { animation-delay: .45s; }

.code-form { display: flex; width: min(100%, 235px); height: 48px; margin: 0 auto 13px; padding: 4px; border: 1px solid #e6d3d8; border-radius: 30px; background: white; box-shadow: 0 4px 16px #744e5e0c; }

.code-form input { min-width: 0; flex: 1; padding: 0 0 0 19px; border: 0; outline: 0; color: var(--ink); background: transparent; text-align: center; font-size: 19px; letter-spacing: 8px; }

.code-form input::placeholder { color: #c9bbc3; letter-spacing: 5px; }

.round-button { display: grid; width: 38px; flex: 0 0 38px; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--rose); cursor: pointer; transition: transform .2s, *background* .2s; }

.round-button:hover { transform: rotate(45deg); background: #bd6e88; }

.keypad { display: grid; width: min(100%, 228px); grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0 auto; }

.keypad button { min-height: 33px; border: 1px solid rgba(207, 180, 190, .5); border-radius: 17px; color: #655363; background: rgba(255, 255, 255, .7); cursor: pointer; transition: .18s ease; }

.keypad button:hover, .keypad button:focus-visible { border-color: var(--gold); color: #795f36; background: #fff7e6; transform: translateY(-1px); }

.keypad .keypad-clear, .keypad .keypad-back { color: var(--muted); font-size: 12px; }

.form-message { min-height: 17px; margin: 11px 0 0; color: #9b7889; font-size: 11px; }

.form-message.error { color: #b65d77; animation: shake .3s; }

.float-heart { position: absolute; color: #c69ab2; animation: drift 5s ease-in-out infinite; }

.heart-one { top: 18%; left: 16%; font-size: 32px; }.heart-two { top: 25%; right: 17%; color: var(--gold); animation-delay: .7s; }.heart-three { bottom: 17%; right: 20%; font-size: 25px; animation-delay: 1.2s; }

.birthday { width: min(100%, 980px); margin: 0 auto; padding: 66px 24px 30px; text-align: center; animation: page-arrive .9s both; }

.story-header { max-width: 690px; margin: 0 auto; }

.story-header h1 { margin: 11px 0 10px; font-size: clamp(32px, 7vw, 55px); font-weight: 400; line-height: 1.08; }

.story-header h1 em { color: #bd7189; font-weight: 400; }

.intro { max-width: 530px; margin: 0 auto; color: #776778; font-size: 15px; line-height: 1.7; }

.little-stars { margin-top: 17px; color: var(--gold); font-size: 14px; }

.cake-section { margin-top: 31px; }
.section-kicker { color: #b58d56; }
.cake-section h2 { margin: 5px 0 6px; font-size: clamp(22px, 4vw, 29px); font-weight: 400; }
.instruction { margin: 0; color: var(--muted); font-size: 13px; }
.cake-scene { position: relative; width: min(100%, 510px); margin: 12px auto 0; }
.cake-wrap { position: relative; width: min(100%, 460px); height: clamp(270px, 58vw, 385px); margin: 0 auto; touch-action: pan-y; }
.cake { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 12px #79596b24); user-select: none; }
.cake-topper { position: absolute; z-index: 3; top: 61%; left: 50%; color: #b87a91; font: 22px var(--script); transform: translateX(-50%) rotate(-6deg); text-shadow: 0 1px 2px #fff8; }
.cake-topper span { position: absolute; top: -11px; right: -13px; color: var(--gold); font-size: 12px; }
.candle-row { position: absolute; z-index: 4; top: 17%; left: 50%; width: 58%; height: 43%; transform: translateX(-50%); }
.candle { position: absolute; width: 24px; height: 56px; padding: 0; border: 0; background: transparent; cursor: pointer; transform: translate(-50%,-50%); }
.candle:nth-child(1) { top: 8%; left: 50%; }.candle:nth-child(2) { top: 35%; left: 82%; }.candle:nth-child(3) { top: 78%; left: 69%; }.candle:nth-child(4) { top: 78%; left: 31%; }.candle:nth-child(5) { top: 35%; left: 18%; }
.candle-stick { position: absolute; bottom: 0; left: 6px; width: 12px; height: 34px; border: 1px solid #dd9eac; border-radius: 4px 4px 2px 2px; background: repeating-linear-gradient(135deg, #fff3e9 0 5px, #f0b7c4 5px 9px); box-shadow: 0 2px 5px #85657828; }
.wick { position: absolute; z-index: 1; bottom: 33px; left: 11px; width: 2px; height: 7px; background: #755867; }
.flame { position: absolute; bottom: 39px; left: 7px; width: 10px; height: 16px; border-radius: 55% 45% 50% 50%; background: radial-gradient(ellipse at 50% 70%, #fffbd2 0 20%, #ffcb6b 45%, #ec8d69 80%); filter: drop-shadow(0 0 7px #ffbf65); transform-origin: 50% 100%; animation: flicker .5s ease-in-out infinite alternate; transition: opacity .2s, transform .3s; }
.candle.is-out .flame { opacity: 0; transform: scale(.2) translateY(8px); }
.candle.is-out::after { position: absolute; top: 0; left: 7px; content: "〰"; color: #b7a7bd; font-size: 15px; animation: smoke 1.2s ease-out both; }
.cut-line { position: absolute; z-index: 5; top: 21%; left: 50%; width: 0; height: 47%; border-left: 2px dashed rgba(255,255,255,.97); opacity: 0; pointer-events: none; transform: rotate(18deg); filter: drop-shadow(0 0 3px #b28b9c); }
.cake-wrap.is-cut .cut-line { width: 2px; opacity: 1; animation: cut-draw .5s ease-out both; }
.cake-wrap.is-cut { animation: cake-disappear 1.2s cubic-bezier(.2,.72,.24,1) both; }
.cake-section.is-finished .cake-scene, .cake-section.is-finished .gesture-fallback, .cake-section.is-finished #cut-instruction, .cake-section.is-finished .candle-note { display: none; }
.wish-message { min-height: 22px; margin: -1px 0 0; color: #a16f86; font: italic 15px var(--serif); }
.candle-note { margin: 2px 0 0; color: #9b8d9d; font: 11px var(--serif); }
.panda-pair-section { max-width: 680px; margin: 30px auto 22px; }
.panda-pair { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(10px,3vw,24px); align-items: center; }
.panda-pose { position: relative; min-width: 0; aspect-ratio: 1; display: grid; place-items: center; margin: 0; overflow: hidden; border: 1px solid #e4d3ba; border-radius: 16px; background: radial-gradient(ellipse at 50% 79%, #f3e6ee 0, #fffdf8 67%); box-shadow: 0 9px 24px #73596c18; }
.panda-pose img { display: block; width: 100%; height: 100%; object-fit: contain; }
.panda-pose-wave img { animation: panda-wave 2.25s ease-in-out infinite; transform-origin: 52% 86%; }
.panda-banner-text { position: absolute; top: 66%; left: 50%; width: 52%; color: #65506b; font: 700 clamp(15px,2.8vw,22px)/1.1 var(--script); text-align: center; white-space: nowrap; text-shadow: 0 1px 0 #fff; transform: translate(-50%,-50%); pointer-events: none; }
.chapter-letter-actions { position: relative; z-index: 2; display: flex; justify-content: center; margin: 18px 0 2px; }
.chapter-letter-actions[hidden] { display: none; }
.chapter-letter-next { min-width: 132px; min-height: 43px; padding: 9px 22px; border: 1px solid #d9c497; border-radius: 24px; color: #655363; background: linear-gradient(135deg,#f6dce4,#eee4f5); box-shadow: 0 5px 14px #765a701c; font: 600 15px var(--serif); cursor: pointer; }
.chapter-letter-next:hover, .chapter-letter-next:focus-visible { background: linear-gradient(135deg,#f3d2dd,#e6d8f0); }
.letter-dialog.chapter-letter-sequence .dialog-close { display: none; }
.letter-dialog.chapter-letter-sequence .letter-paper { max-height: min(82svh,680px); overflow-y: auto; }.memory-section { max-width: 690px; margin: 37px auto 0; }

.memory-heading { display: flex; align-items: center; gap: 13px; color: #a78368; font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; }

.memory-rule { height: 1px; flex: 1; background: linear-gradient(90deg, transparent, #d8c69d, transparent); }

.memory-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 15px; }

.memory-item { position: relative; display: grid; min-height: 100px; place-items: center; overflow: hidden; border: 5px solid #fffdf8; outline: 1px solid #ddcba8; background: linear-gradient(145deg, #f3dce4, #e8dff1 52%, #d8e9ef); box-shadow: 0 5px 16px #765c7414; transform: rotate(-2deg); }

.memory-item:nth-child(2) { background: linear-gradient(140deg, #f9e9cf, #f0dce3 58%, #dceaf0); transform: rotate(1.4deg) translateY(5px); }

.memory-item:nth-child(3) { background: linear-gradient(145deg, #d9e9ef, #e7dcf0 56%, #f4dce3); transform: rotate(2deg); }

.memory-art { color: #a4748b; font-size: 30px; text-shadow: 0 2px 5px #fff; }

.memory-photo { width: 100%; height: 100%; min-height: 100px; object-fit: cover; }

.memory-caption { margin: 19px 0 0; color: #786578; font: italic 16px var(--script); }

.story-footer { display: flex; justify-content: center; gap: 12px; margin-top: 32px; color: #a78f73; font-size: 11px; letter-spacing: 1.3px; }

.letter-dialog { position: fixed; width: min(calc(100% - 30px), 540px); max-height: min(84svh, 680px); padding: 0; overflow: auto; border: 1px solid var(--gold); border-radius: 3px; color: var(--ink); background: #FFFFFF; box-shadow: 0 24px 90px #44314c4a; }

.letter-dialog.balloon-message-mode .dialog-close { display: none; }
.letter-dialog.balloon-message-mode .letter-signoff { display: none; }
.letter-dialog.balloon-message-mode .letter-label { display: none; }
.letter-dialog.balloon-message-mode #letter-title { font-weight: 700; letter-spacing: .04em; }
.balloon-dialog-actions { margin: 18px auto 0; }
.balloon-dialog-actions[hidden] { display: none; }
.letter-dialog::backdrop { background: rgba(56, 43, 61, .42); backdrop-filter: blur(4px); }

.letter-paper { position: relative; min-height: 390px; padding: 42px clamp(24px, 8vw, 58px); border: 6px double #eadbb7; background: #FFFFFF; text-align: left; }

.letter-paper::before { position: absolute; inset: 10px; border: 1px solid #e5d4ac; content: ""; pointer-events: none; }

.paper-ornament { color: var(--gold); text-align: center; font-size: 18px; letter-spacing: 7px; }

.letter-label { margin: 20px 0 9px; color: #aa7c89; font-size: 10px; letter-spacing: 2px; text-align: center; text-transform: uppercase; }

.letter-paper h2 { margin: 0 0 18px; color: #83566c; font-size: 29px; font-weight: 400; text-align: center; }

.letter-body { min-height: 125px; color: #554858; font-size: 16px; line-height: 1.9; white-space: pre-line; }

.letter-signoff { margin: 20px 0 0; color: #806477; font-style: italic; text-align: right; }.letter-signoff span { color: #c87991; font-size: 22px; }

.bottom-ornament { margin-top: 23px; }

.dialog-close { position: absolute; z-index: 2; top: 11px; right: 13px; display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid #e8d8b4; border-radius: 50%; color: #846b75; background: #fffdf8; font-size: 22px; cursor: pointer; }

@keyframes card-arrive { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

@keyframes page-arrive { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@keyframes digit-glow { 50% { box-shadow: 0 3px 14px #bc9c4950; transform: translateY(-2px); } }

@keyframes flicker { to { transform: rotate(5deg) scale(.94); } }

@keyframes twinkle { 50% { opacity: .35; transform: scale(.75) rotate(20deg); } }

@keyframes drift { 50% { transform: translateY(-11px) rotate(8deg); } }

@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

@keyframes cut-draw { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
@keyframes cake-disappear { 0% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0); } 22% { transform: scale(1.015) rotate(.4deg); } 55% { opacity: .82; transform: translateY(8px) scale(.97) rotate(-1deg); } 100% { opacity: 0; transform: translateY(32px) scale(.83) rotate(-4deg); filter: blur(8px); } }
@keyframes panda-wave { 0%,100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-2px) rotate(-1deg); } 55% { transform: translateY(1px) rotate(.8deg); } 78% { transform: translateY(-1px) rotate(-.5deg); } }

@keyframes smoke { from { opacity: .8; transform: translateY(7px); } to { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 560px) {

    .gate-card { padding: 30px 21px 25px; }

    .birthday { padding: 43px 17px 26px; }

    .story-header h1 { font-size: clamp(32px, 10vw, 45px); }

    .intro { font-size: 14px; }

    .cake-section { margin-top: 26px; }

    .instruction { max-width: 310px; margin: 0 auto; line-height: 1.55; }

    .cake-wrap { height: 208px; padding-top: 47px; }

    .cake { height: 126px; }

    .cake-plate { bottom: 13px; }

    .cut-line { top: 40px; height: 137px; }

    .memory-row { gap: 9px; }

    .memory-item { min-height: 79px; border-width: 4px; }

    .memory-photo { min-height: 79px; }

    .memory-heading { gap: 8px; font-size: 8px; letter-spacing: 1.2px; }

    .memory-caption { font-size: 14px; }

    .story-footer { margin-top: 27px; }

}

@media (max-width: 390px) { .panda-pair { grid-template-columns: 1fr; } .panda-pose { width: min(100%,260px); justify-self: center; } }

@media (prefers-reduced-motion: reduce) {

    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }

}

[hidden] { display: none !important; }

button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid #a77c9c; outline-offset: 3px; }

.extra-letters { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px auto 24px; }

.extra-letter-button { min-height: 42px; padding: 8px 15px; border: 1px solid #ddc594; border-radius: 22px; color: #795c73; background: #fffdf8; cursor: pointer; }

.gift-section { position: relative; margin: 48px auto 24px; padding: 29px 18px 24px; border-top: 1px solid rgba(198, 161, 93, .42); }

.gift-section h2, .story-module h2 { margin: 6px 0 8px; font-size: clamp(24px, 4vw, 32px); font-weight: 400; }

.gift-wrap { position: relative; width: min(100%, 330px); height: 240px; margin: 2px auto 0; touch-action: none; }

.gift-illustration { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: transparent; cursor: pointer; }

.gift-body { position: absolute; z-index: 2; top: 96px; left: 50%; width: 174px; height: 102px; border: 1px solid #c19457; border-radius: 4px 4px 9px 9px; background: linear-gradient(110deg, #f4ccda, #efb5c6 50%, #e9a9bc); box-shadow: 0 13px 20px #795a6025; transform: translateX(-50%); }

.gift-body i, .gift-lid i { position: absolute; top: 0; left: 50%; width: 24px; height: 100%; background: linear-gradient(90deg, #d1ae69, #f5e4ad 50%, #c39b54); transform: translateX(-50%); }

.gift-lid { position: absolute; z-index: 4; top: 76px; left: 50%; width: 195px; height: 36px; border: 1px solid #c19457; border-radius: 5px; background: linear-gradient(120deg, #f7d7e0, #f1bccc 60%, #eab0c0); box-shadow: 0 5px 11px #795a6020; transform: translateX(-50%); transition: transform .8s cubic-bezier(.2,.8,.2,1); }

.gift-lid i { height: 36px; }

.gift-bow { position: absolute; z-index: 5; top: 41px; left: 50%; width: 75px; height: 43px; transform: translateX(-50%); transition: transform .8s cubic-bezier(.2,.8,.2,1); }

.gift-bow i, .gift-bow b { position: absolute; top: 7px; width: 39px; height: 27px; border: 3px solid #c7a15c; border-radius: 50% 50% 5px 50%; background: #f4d38b; }

.gift-bow i { left: 0; transform: rotate(28deg); }.gift-bow b { right: 0; border-radius: 50% 50% 50% 5px; transform: rotate(-28deg); }

.gift-tag { position: absolute; z-index: 6; top: 139px; left: calc(50% + 40px); padding: 3px 7px; border: 1px solid #dfcba0; border-radius: 2px; color: #8b687a; background: #fff8eb; font: 10px var(--script); transform: rotate(6deg); }

.gift-spark { position: absolute; z-index: 7; color: var(--gold); opacity: .9; animation: gift-twinkle 2.2s ease-in-out infinite; }

.gift-spark-one { top: 52px; left: 19%; font-size: 24px; }.gift-spark-two { top: 109px; right: 14%; color: #c5819a; font-size: 30px; animation-delay: .7s; }

.gift-wrap.is-open .gift-lid { transform: translate(-67px, -62px) rotate(-12deg); }

.gift-wrap.is-open .gift-bow { transform: translate(-98px, -58px) rotate(-13deg); }

.gift-wrap.is-open .gift-spark { animation: gift-burst .8s ease-out both; }

.gift-wrap.is-open .gift-spark-two { animation-delay: .12s; }

.gift-status { min-height: 20px; margin: -8px 0 0; color: #a16f86; font: italic 14px var(--serif); }
.gift-box-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 760px; margin: 5px auto 8px; }
.gift-box-item { display: grid; min-width: 0; justify-items: center; align-content: start; }
.gift-box-grid .gift-wrap { width: min(100%, 235px); height: 220px; margin: 2px auto 0; touch-action: manipulation; }
.gift-box-label { margin-top: -5px; color: #795f73; font: 15px var(--serif); }
.gift-box-item:nth-child(2) .gift-body { background: linear-gradient(110deg, #ded8f3, #c7bae8 50%, #b7a8de); }
.gift-box-item:nth-child(2) .gift-lid { background: linear-gradient(120deg, #e9e2fa, #d3c9ef 60%, #b9a9df); }
.gift-box-item:nth-child(3) .gift-body { background: linear-gradient(110deg, #d4e5ee, #b5d5e4 50%, #9fc5d8); }
.gift-box-item:nth-child(3) .gift-lid { background: linear-gradient(120deg, #e1eef4, #c3dce8 60%, #a4c9dc); }
.gift-box-grid .gift-illustration:focus-visible { outline: 2px solid #a77c9c; outline-offset: 4px; border-radius: 12px; }

.gift-video-dialog { max-width: 760px; padding: 27px 18px 18px; background: #fffdf8; }
.gift-video-content { display: grid; gap: 8px; justify-items: center; padding: 2px; text-align: center; }
.gift-video-content .section-kicker { margin: 0; }
.gift-video-content h2 { margin: 0 34px 5px; color: #735d70; font: 400 clamp(22px, 4vw, 30px) var(--serif); }
.gift-video-dialog video { display: block; width: 100%; max-height: min(64svh, 620px); border-radius: 8px; object-fit: contain; background: #211c24; }
.gift-video-status { margin: 4px 0 0; color: #8b687a; font: italic 14px var(--serif); line-height: 1.5; }
.gift-video-actions { display: flex; justify-content: center; margin-top: 5px; }
.gift-video-continue { min-height: 42px; padding: 9px 22px; border: 1px solid #c6a15d; border-radius: 24px; color: #fff; background: #a8778f; font: 15px var(--serif); cursor: pointer; transition: background .2s, transform .2s; }
.gift-video-continue:hover:not(:disabled) { background: #91627a; transform: translateY(-1px); }
.gift-video-continue:disabled { border-color: #ddd5d8; color: #8e858b; background: #e9e4e7; cursor: not-allowed; }
body.gift-video-open { overflow: hidden; }

@media (max-width: 620px) {
    .gift-box-grid { grid-template-columns: 1fr; gap: 2px; }
    .gift-box-grid .gift-wrap { width: min(100%, 260px); }
    .gift-video-dialog { padding: 36px 12px 14px; }
    .gift-video-dialog video { max-height: 56svh; }
}

.surprise-world { margin-top: 15px; }

.surprise-world:not([hidden]) { animation: page-arrive .65s both; }

.story-module { margin: 0 auto; padding: 47px 0; border-top: 1px solid rgba(198, 161, 93, .38); scroll-margin-top: 22px; }

.module-intro { max-width: 580px; margin: 0 auto 21px; color: var(--muted); font-size: 14px; line-height: 1.65; }

.file-action { position: relative; display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 8px; margin: 5px 0 20px; padding: 9px 17px; border: 1px solid #d4bd86; border-radius: 24px; color: #745c6d; background: rgba(255, 253, 248, .88); font-size: 13px; cursor: pointer; transition: *background* .2s, transform .2s; }

.file-action:hover { background: #fff6e4; transform: translateY(-1px); }

.file-action input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.music-panel { display: flex; max-width: 650px; min-height: 82px; align-items: center; gap: 13px; margin: 0 auto 11px; padding: 13px 16px; border: 1px solid #e1d1ae; border-radius: 7px; background: rgba(255, 253, 248, .83); box-shadow: 0 8px 24px #765a7010; text-align: left; }

.music-disc { display: grid; width: 47px; height: 47px; flex: 0 0 47px; place-items: center; border: 1px solid #d9bc79; border-radius: 50%; color: #fff9e8; background: linear-gradient(135deg, #d797aa, #be9ebf 56%, #94bbcd); font-size: 22px; }

.music-copy { min-width: 0; flex: 1; }.music-copy strong, .music-copy span { display: block; overflow-wrap: anywhere; }.music-copy strong { color: #685365; font-size: 14px; font-weight: 400; }.music-copy span { margin-top: 4px; color: var(--muted); font: 12px/1.4 var(--serif); }

.icon-button { display: grid; width: 39px; height: 39px; flex: 0 0 39px; place-items: center; border: 1px solid #d8c28d; border-radius: 50%; color: #866a4b; background: #fff9e9; cursor: pointer; }

.icon-button:hover { background: #f8e9c8; }.music-panel audio { display: none; }
.soundtracks-heading { margin: 8px auto 14px; color: #745d70; font: 400 20px var(--serif); }
.soundtrack-list { display: grid; max-width: 760px; gap: 13px; margin: 0 auto 24px; text-align: left; }
.soundtrack-card { display: grid; grid-template-columns: 47px minmax(0, 1fr); align-items: center; gap: 9px 13px; padding: 15px 17px 11px; border: 1px solid #e1d1ae; border-radius: 7px; background: rgba(255, 253, 248, .88); box-shadow: 0 8px 24px #765a7010; }
.soundtrack-card .music-disc { grid-row: 1; }
.soundtrack-copy { min-width: 0; }
.soundtrack-copy h3 { margin: 0; color: #685365; font-size: 15px; font-weight: 400; }
.soundtrack-status { margin: 4px 0 0; color: var(--muted); font: 12px/1.4 var(--serif); }
.soundtrack-player { grid-column: 1 / -1; display: block; width: 100%; min-width: 0; height: 40px; color-scheme: light; }
.soundtrack-time { grid-column: 1 / -1; justify-self: end; margin: -7px 1px 0; color: #8b7a8a; font: 11px var(--serif); font-variant-numeric: tabular-nums; }
.soundtrack-dialog { max-width: 560px; padding: 32px 22px 22px; background: #FFFFFF; }
.soundtrack-message-paper { padding: 30px clamp(18px, 5vw, 38px); border: 6px double #eadbb7; background: #FFFFFF; }
.soundtrack-message { margin: 0; color: #554858; font: 16px/1.85 var(--serif); text-align: center; }
.voice-list { display: grid; max-width: 760px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 12px; margin: 0 auto; }

.voice-card { padding: 16px; border: 1px solid #e5d8bd; border-radius: 6px; background: rgba(255, 253, 248, .76); text-align: left; }

.voice-card h4 { margin: 0; color: #765a70; font-size: 15px; font-weight: 400; }
.voice-card.personal-voice-card h4 { font-size: 17px; font-weight: 700; }.voice-card p { margin: 7px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }.voice-card audio { width: 100%; height: 40px; margin-top: 10px; }

.voice-error { color: #b65d77 !important; }.voice-placeholder { padding: 11px; border: 1px dashed #ddc79b; border-radius: 4px; }

.replay-button { min-height: 35px; padding: 6px 12px; border: 1px solid #ddc79b; border-radius: 19px; color: #745c6d; background: #fffaf0; cursor: pointer; }

.storage-note { margin: 14px auto 0; color: #968797; font-size: 11px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 20px; margin-top: 18px; text-align: left; }

.gallery-card { min-width: 0; padding: 10px; border: 1px solid #e2d2ae; border-radius: 5px; background: rgba(255, 253, 248, .88); box-shadow: 0 8px 20px #765a7012; animation: card-arrive .45s both; }

.photo-open { position: relative; display: grid; width: 100%; aspect-ratio: 4 / 3; place-items: center; padding: 0; overflow: hidden; border: 4px solid white; background: linear-gradient(140deg, #f2dce5, #e5ddf0 54%, #d8e9ef); box-shadow: 0 2px 8px #765a7020; cursor: zoom-in; }

.photo-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #aa7e98; font-size: 38px; background: radial-gradient(circle at 28% 28%, #fff8e7 0 3px, transparent 4px), radial-gradient(circle at 72% 69%, #fffbf0 0 2px, transparent 3px), linear-gradient(140deg, #f3dce5, #e5ddf0 54%, #d8e9ef); }

.gallery-subtitle { margin: -2px 0 4px; color: #8b6b83; font-size: 17px; font-weight: 600; line-height: 1.5; }

.gallery-section .module-intro { margin-bottom: 21px; font-size: 13px; }

.gallery-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0; visibility: hidden; transition: opacity .8s ease, visibility .8s ease; }

.photo-placeholder { opacity: 1; visibility: visible; transition: opacity .8s ease, visibility .8s ease; }

.gallery-card.is-revealed .gallery-image { opacity: 1; visibility: visible; }

.gallery-card.is-revealed .photo-placeholder { opacity: 0; visibility: hidden; }

.photo-caption { max-height: 0; margin: 0 2px; overflow: hidden; color: #786b7b; font-size: 12px; line-height: 1.65; opacity: 0; transition: max-height .65s ease, margin .65s ease, opacity .65s ease; }

.gallery-card.is-revealed .photo-caption { max-height: 180px; margin: 5px 2px 2px; opacity: 1; }

@media (prefers-reduced-motion: reduce) { .gallery-image, .photo-placeholder, .photo-caption { transition-duration: .01ms; } }

.photo-title { margin: 10px 2px 7px; color: #735a6c; font-size: 14px; line-height: 1.45; }

.photo-actions { display: flex; gap: 6px; }

.photo-actions button { min-width: 39px; min-height: 34px; padding: 5px 9px; border: 1px solid #e5d8bd; border-radius: 18px; color: #765e70; background: #fffdf8; cursor: pointer; }

.photo-actions button:last-child { margin-left: auto; }.photo-actions button:disabled { opacity: .45; cursor: default; }

.photo-details { margin-top: 9px; border-top: 1px solid #eee5d4; color: #7c6878; font-size: 12px; }

.photo-details summary { padding: 9px 1px 5px; cursor: pointer; }.photo-details label { display: block; margin: 8px 0; color: #786878; }

.photo-details input, .photo-details textarea { display: block; width: 100%; min-height: 34px; margin-top: 4px; padding: 7px 8px; border: 1px solid #e3d8c9; border-radius: 3px; color: var(--ink); background: white; resize: vertical; }

.empty-gallery { margin: 23px 0 0; padding: 22px; border: 1px dashed #d9c69c; border-radius: 5px; color: #89788b; background: #fffaf2a8; font-size: 13px; line-height: 1.7; }

.map-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(230px, .8fr); gap: 18px; align-items: stretch; margin-top: 25px; text-align: left; }

.storybook-map { position: relative; min-height: 330px; overflow: hidden; border: 1px solid #c9cfad; border-radius: 7px; background-color: #e6eacf; background-image: radial-gradient(ellipse at 18% 29%, #cfdec0 0 13%, transparent 13.5%), radial-gradient(ellipse at 73% 70%, #d1dfbf 0 17%, transparent 17.5%), radial-gradient(ellipse at 73% 20%, #d8e3c7 0 12%, transparent 12.5%), repeating-linear-gradient(28deg, transparent 0 45px, #d4d9bb 46px 48px, transparent 49px 95px), repeating-linear-gradient(112deg, transparent 0 61px, #d5dcc0 62px 64px, transparent 65px 124px); box-shadow: inset 0 0 36px #b9cba766; }

.storybook-map::before, .storybook-map::after { position: absolute; content: ""; border: 1px solid rgba(179, 166, 119, .55); border-radius: 50%; transform: rotate(-23deg); }.storybook-map::before { width: 76%; height: 32%; top: 14%; left: 7%; }.storybook-map::after { width: 56%; height: 26%; right: -4%; bottom: 13%; }

.map-river { position: absolute; inset: 0; width: 100%; height: 100%; }.map-river path { fill: none; stroke: #b4d5d9; stroke-width: 12px; }.map-river path + path { stroke: #d6ecdf; stroke-width: 2px; }

.map-marker-layer { position: absolute; z-index: 2; inset: 0; }

.map-marker { position: absolute; display: grid; width: 41px; height: 41px; place-items: center; border: 1px solid #bb9655; border-radius: 50% 50% 50% 5px; color: #fff9e8; background: #c48ca3; box-shadow: 0 4px 11px #58485a35; font-size: 20px; cursor: pointer; transform: translate(-50%, -50%) rotate(-45deg); transition: transform .2s, *background* .2s; }

.map-marker:hover, .map-marker:focus-visible { background: #ad6f89; transform: translate(-50%, -58%) rotate(-45deg) scale(1.08); }.map-marker::first-letter { transform: rotate(45deg); }

.map-label { position: absolute; z-index: 1; color: #78896e; font: italic 11px var(--serif); opacity: .86; }.map-label-one { top: 72%; left: 10%; transform: rotate(-8deg); }.map-label-two { top: 11%; left: 56%; transform: rotate(5deg); }.map-compass { position: absolute; top: 13px; right: 15px; color: #8c7b58; font-size: 11px; line-height: 1.3; text-align: center; }

.map-story { min-width: 0; padding: 12px; border: 1px solid #e1d3b8; border-radius: 6px; background: rgba(255, 253, 248, .86); }

.map-story > img, .map-photo-placeholder { display: grid; width: 100%; aspect-ratio: 4 / 3; place-items: center; border: 4px solid white; object-fit: cover; background: linear-gradient(140deg, #f2dce5, #e5ddf0 54%, #d8e9ef); box-shadow: 0 2px 8px #765a7020; }

.map-photo-placeholder { color: #ac8094; font-size: 32px; }

.map-story .section-kicker { margin-top: 14px; font-size: 9px; }.map-story h3 { margin: 5px 0; color: #72576d; font-size: 19px; font-weight: 400; line-height: 1.3; }.map-story p:not(.section-kicker) { margin: 7px 0; color: #786b7b; font-size: 13px; line-height: 1.6; }.map-story .map-memory-meta { color: #a17f65 !important; font-size: 11px !important; }

.surprise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); gap: 14px; margin-top: 23px; }
.finalize-button { display: block; width: min(100%, 250px); min-height: 46px; margin: 24px auto 0; padding: 10px 20px; border: 1px solid #d4bc8d; border-radius: 24px; color: #665464; background: linear-gradient(135deg, #f6dce4, #eee4f5); box-shadow: 0 5px 14px #765a701c; font: 600 15px/1.3 var(--serif); cursor: pointer; transition: transform .18s, box-shadow .18s; }
.finalize-button:hover { box-shadow: 0 8px 18px #765a7028; transform: translateY(-2px); }

.surprise-card { display: flex; min-height: 156px; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 18px; border: 1px solid #ddc99b; border-radius: 6px; background: linear-gradient(145deg, rgba(255,253,248,.95), rgba(248,232,239,.85)); box-shadow: 0 7px 18px #765a7012; cursor: pointer; transition: transform .2s, box-shadow .2s; }

.surprise-card:hover { box-shadow: 0 11px 23px #765a7024; transform: translateY(-3px); }.surprise-icon { display: grid; width: 46px; height: 46px; place-items: center; border: 1px solid #d5bb82; border-radius: 50%; color: #b37890; background: #fff9e8; font-size: 22px; }.surprise-card strong { color: #735d70; font-size: 14px; font-weight: 400; line-height: 1.4; }.surprise-action { color: #a38062; font-size: 11px; }

.media-dialog { position: fixed; width: min(calc(100% - 26px), 760px); max-height: min(90svh, 860px); padding: 0; overflow: auto; border: 1px solid var(--gold); border-radius: 5px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 90px #44314c4a; }

.media-dialog::backdrop { background: rgba(56, 43, 61, .5); backdrop-filter: blur(4px); }.lightbox-figure { margin: 0; padding: 17px; }.lightbox-figure > img, .lightbox-placeholder { display: grid; width: 100%; max-height: 66svh; min-height: 220px; place-items: center; object-fit: contain; background: #f6eff0; }.lightbox-placeholder { color: #aa7e98; font-size: 55px; }.lightbox-figure figcaption { display: grid; gap: 5px; padding: 12px 4px 2px; color: #79687a; font-size: 13px; }.lightbox-figure figcaption strong { color: #6d5368; font-size: 18px; font-weight: 400; }.lightbox-figure figcaption p { margin: 3px 0; line-height: 1.6; }

.surprise-dialog { max-width: 540px; background: #FFFFFF; }.surprise-paper { position: relative; min-height: 300px; padding: 43px clamp(24px, 7vw, 52px); border: 6px double #eadbb7; background: #FFFFFF; }.surprise-paper::before { position: absolute; inset: 10px; border: 1px solid #e5d4ac; content: ""; pointer-events: none; }.surprise-paper h2 { margin: 0 0 16px; color: #83566c; font-size: 25px; font-weight: 400; text-align: center; }.surprise-message { color: #554858; font-size: 16px; line-height: 1.9; white-space: pre-line; }.surprise-timeline { position: relative; margin: 20px 0 0; padding: 0 0 0 22px; list-style: none; }.surprise-timeline::before { position: absolute; top: 4px; bottom: 5px; left: 6px; width: 1px; content: ""; background: #d9c38e; }.surprise-timeline li { position: relative; margin: 0 0 19px; }.surprise-timeline li::before { position: absolute; top: 4px; left: -20px; width: 8px; height: 8px; border: 1px solid #b58e61; border-radius: 50%; content: ""; background: #fff9e9; }.surprise-timeline li span, .surprise-timeline li strong { display: block; color: #a17b6a; font-size: 11px; }.surprise-timeline li strong { margin-top: 3px; color: #765a70; font-size: 15px; font-weight: 400; }.surprise-timeline li p { margin: 5px 0; color: #655667; font-size: 13px; line-height: 1.6; }

.voice-section, .gallery-section, .map-section, .surprises-section { scroll-margin-top: 14px; }

@keyframes gift-twinkle { 50% { opacity: .4; transform: scale(.78) rotate(15deg); } }

@keyframes gift-burst { 0% { opacity: 1; transform: scale(.4); } 100% { opacity: 0; transform: scale(1.7) translateY(-20px); } }

@media (max-width: 620px) {

    .gift-section { margin-top: 32px; padding-inline: 8px; }

    .gift-wrap { height: 220px; }

    .story-module { padding: 36px 0; }

    .music-panel { gap: 8px; padding: 11px; }

    .music-disc { width: 39px; height: 39px; flex-basis: 39px; }

    .icon-button { width: 36px; height: 36px; flex-basis: 36px; }

    .voice-heading { align-items: flex-start; flex-wrap: wrap; }

    .map-layout { grid-template-columns: 1fr; }

    .storybook-map { min-height: 275px; }

    .map-story { display: grid; grid-template-columns: 38% 1fr; column-gap: 12px; }

    .map-story > img, .map-photo-placeholder { grid-row: span 5; align-self: start; }

    .map-story .section-kicker { align-self: end; margin-top: 5px; }

    .map-story h3 { font-size: 17px; }

    .map-story p:not(.section-kicker) { font-size: 12px; }

    .gallery-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }

    .surprise-paper { padding: 40px 25px; }

}
/* Opening balloon sequence */
.balloon-intro { position: relative; display: grid; min-height: 100svh; place-items: start center; padding: clamp(18px, 3.5vh, 34px) clamp(14px, 4vw, 42px) 26px; overflow: hidden; isolation: isolate; }
.balloon-intro::before, .balloon-intro::after { position: absolute; z-index: -1; width: min(72vw, 520px); aspect-ratio: 1; border-radius: 50%; content: ""; filter: blur(2px); pointer-events: none; }
.balloon-intro::before { top: -18%; left: -15%; background: radial-gradient(circle, #f7d9e4a8, transparent 69%); }
.balloon-intro::after { right: -17%; bottom: -25%; background: radial-gradient(circle, #dcd2f2a3, transparent 70%); }
.balloon-intro-card { width: min(100%, 1000px); padding-top: clamp(4px, 1.4vh, 14px); text-align: center; }
.balloon-intro-card h1 { margin: 5px 0 0; color: #735b72; font-size: clamp(29px, 6vw, 43px); font-weight: 400; }
.balloon-intro-hint { margin: 9px 0 0; color: var(--muted); font-size: 14px; font-style: italic; }
.balloon-row { position: relative; display: grid; width: min(100%, 1000px); height: clamp(330px, 58svh, 560px); grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 43% 57%; align-items: center; margin: clamp(22px, 4vh, 42px) auto 0; }
.intro-balloon { position: relative; display: block; width: clamp(100px, 14vw, 148px); aspect-ratio: .74; padding: 0; border: 0; background: transparent; cursor: pointer; transition: filter .25s, opacity .35s; }
.balloon-lavender { grid-column: 1; grid-row: 1; justify-self: start; align-self: start; z-index: 1; }
.balloon-pink { grid-column: 2; grid-row: 2; justify-self: center; align-self: center; z-index: 2; width: clamp(146px, 18vw, 190px); }
.balloon-blue { grid-column: 3; grid-row: 1; justify-self: end; align-self: start; z-index: 1; }
.balloon-body { position: absolute; inset: 0; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.58); border-radius: 50% 50% 48% 48%; box-shadow: inset 8px 5px 18px rgba(255,255,255,.44), inset -15px -20px 29px rgba(90,48,75,.22), 0 16px 30px rgba(108,72,94,.16); transform-origin: 50% 82%; animation: balloon-rise 1.2s cubic-bezier(.18,.72,.27,1) both, balloon-float 5.4s ease-in-out 1.25s infinite; }
.balloon-pink .balloon-body { background: radial-gradient(ellipse at 29% 20%, rgba(255,255,255,.9) 0 2%, rgba(255,255,255,.58) 5%, transparent 21%), radial-gradient(ellipse at 72% 73%, rgba(132,54,86,.29), transparent 48%), linear-gradient(118deg, #f7d9e3 0%, #efb6c9 48%, #d9829b 100%); }
.balloon-lavender .balloon-body { background: radial-gradient(ellipse at 29% 20%, rgba(255,255,255,.88) 0 2%, rgba(255,255,255,.54) 5%, transparent 21%), radial-gradient(ellipse at 72% 73%, rgba(80,58,119,.28), transparent 48%), linear-gradient(118deg, #e4ddf1 0%, #c5b6dc 48%, #9c86bd 100%); }
.balloon-blue .balloon-body { background: radial-gradient(ellipse at 29% 20%, rgba(255,255,255,.88) 0 2%, rgba(255,255,255,.54) 5%, transparent 21%), radial-gradient(ellipse at 72% 73%, rgba(50,92,118,.29), transparent 48%), linear-gradient(118deg, #deeff4 0%, #c3deeb 48%, #8bb9cc 100%); }
.balloon-highlight { position: absolute; top: 10%; left: 16%; width: 19%; height: 34%; border-radius: 65% 45% 60% 45%; background: linear-gradient(155deg, rgba(255,255,255,.82), rgba(255,255,255,.1)); filter: blur(.65px); opacity: .8; transform: rotate(15deg); }
.balloon-highlight::after { position: absolute; top: 39%; left: 120%; width: 38%; height: 14%; border-radius: 50%; content: ""; background: rgba(255,255,255,.54); filter: blur(.5px); transform: rotate(15deg); }
.balloon-number { position: relative; z-index: 1; color: #fffefa; font: 600 clamp(31px, 4.5vw, 43px)/1 var(--serif); text-shadow: 0 2px 6px rgba(75,49,68,.35); }
.balloon-body::before { position: absolute; bottom: -7px; left: calc(50% - 6px); width: 12px; height: 12px; content: ""; background: inherit; clip-path: polygon(0 0, 100% 0, 50% 100%); filter: brightness(.9); }
.balloon-tether { position: absolute; bottom: -53px; left: calc(50% - 1px); width: 16px; height: 52px; border-right: 1px solid rgba(120,101,117,.66); border-radius: 0 60% 0 0; transform: rotate(-5deg); transform-origin: top right; }
.intro-balloon:nth-child(2) .balloon-body { animation-delay: .18s, 1.43s; }
.intro-balloon:nth-child(3) .balloon-body { animation-delay: .36s, 1.61s; }
.intro-balloon:hover:not(:disabled) { filter: saturate(1.08) brightness(1.02); }
.intro-balloon:focus-visible { outline: 2px solid #c6a15d; outline-offset: 6px; }
.intro-balloon:disabled { cursor: default; filter: saturate(.9); }
.intro-balloon.balloon-vanishing { opacity: 0; transform: scale(.72); pointer-events: none; transition: opacity .26s ease, transform .26s ease; }
.balloon-message-card { width: min(100%, 540px); margin: 7px auto 0; padding: 22px clamp(18px, 5vw, 35px) 16px; border: 1px solid #d9c497b5; border-radius: 18px; background: #fffdf8e8; box-shadow: 0 15px 45px #70576d16, inset 0 0 0 4px #ffffffa8; animation: balloon-message-arrive .45s ease both; }
.balloon-message { margin: 12px 0 17px; color: #5d4c60; font-size: clamp(15px, 2.4vw, 18px); line-height: 1.75; }
.balloon-message-next { display: flex; position: relative; z-index: 2; width: 112px; min-height: 42px; align-items: center; justify-content: center; margin: 0 auto; padding: 0 22px; border: 0; border-radius: 24px; color: #fff; background: #d9829b; font: inherit; font-size: 14px; visibility: visible; opacity: 1; cursor: pointer; }
.balloon-message-next:disabled { opacity: .7; cursor: default; }
.balloon-cancel-zone { position: relative; width: min(100%, 300px); height: 40px; margin: 8px auto 0; }
.balloon-evasive-cancel { position: absolute; top: 50%; left: calc(50% - 56px); width: 112px; min-height: 34px; padding: 5px 14px; border: 1px solid #d6c5d0; border-radius: 20px; color: #826f80; background: #fffafd; font-size: 12px; cursor: pointer; transform: translateY(-50%); transition: left .16s ease, background .16s ease; touch-action: manipulation; }
.balloon-evasive-cancel:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

@keyframes balloon-rise { 0% { opacity: 0; transform: translateY(110vh) scale(.78); } 72% { opacity: 1; transform: translateY(-10px) scale(1.035); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes balloon-float { 0%, 100% { transform: translateY(0) rotate(-.6deg); } 50% { transform: translateY(-7px) rotate(.8deg); } }
@keyframes balloon-message-arrive { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) {
    .balloon-intro { padding-inline: 14px; }
    .balloon-intro-card { padding-top: 8px; }
    .balloon-row { height: clamp(300px, 55svh, 430px); grid-template-rows: 46% 54%; margin-top: 27px; }
    .intro-balloon { width: clamp(78px, 23vw, 116px); }
    .balloon-pink { width: clamp(108px, 31vw, 146px); }
    .balloon-message-card { padding: 20px 17px 14px; }
}
@media (max-width: 390px) { .panda-pair { grid-template-columns: 1fr; } .panda-pose { width: min(100%,260px); justify-self: center; } }

@media (prefers-reduced-motion: reduce) {
    .balloon-body { animation: none; transform: none; opacity: 1; }
    .intro-balloon.balloon-vanishing { transition-duration: .01ms; }
}
/* Panda surprise screen */
.panda-screen { position: relative; display: grid; place-items: center; padding: 30px 18px; overflow: hidden; }
.panda-card { position: relative; width: min(100%, 560px); padding: 31px clamp(20px, 6vw, 46px) 27px; border: 1px solid rgba(198,161,93,.58); border-radius: 18px; background: #FFFFFF; box-shadow: 0 18px 52px rgba(102,72,91,.12), inset 0 0 0 5px #fff; text-align: center; animation: card-arrive .7s both; }
.panda-card::before, .panda-card::after { position: absolute; color: var(--gold); content: "✧　·　✦　·　✧"; font-size: 11px; letter-spacing: 7px; }
.panda-card::before { top: 12px; left: 15px; }.panda-card::after { right: 15px; bottom: 10px; }
.panda-card h1 { max-width: 470px; margin: 10px auto 0; color: #735b72; font-size: clamp(27px, 6vw, 38px); font-weight: 400; line-height: 1.25; }
.panda-scene { display: grid; height: clamp(240px, 43svh, 315px); place-items: center; margin: 13px auto 0; }
.panda-character { position: relative; display: grid; width: min(100%, 310px); height: 100%; place-items: center; }
.panda-art { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center; }
.panda-art-crying { display: none; }
.panda-character.is-crying .panda-art-happy { display: none; }
.panda-character.is-crying .panda-art-crying { display: block; }
.panda-actions { position: relative; z-index: 2; display: flex; width: min(100%, 360px); height: 72px; gap: 10px; margin: 4px auto 0; }
.panda-yes-zone, .panda-no-zone { position: relative; min-width: 0; flex: 1; height: 68px; }
.panda-choice { position: relative; z-index: 2; display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 9px 24px; appearance: none; border: 2px solid #bd8292; border-radius: 24px; color: #543c54 !important; -webkit-text-fill-color: #543c54; background: #f4d4de; box-shadow: 0 5px 14px #765a701c; font-size: 16px; font-weight: 700; line-height: 1; visibility: visible !important; opacity: 1 !important; cursor: pointer; isolation: isolate; transition: transform .2s, box-shadow .2s, left .18s, top .18s; }
.panda-button-label { position: relative; z-index: 3; display: inline-block; color: #543c54 !important; -webkit-text-fill-color: #543c54; font-weight: 700; line-height: 1.2; visibility: visible !important; opacity: 1 !important; pointer-events: none; }
.panda-yes { width: 100%; height: 46px; margin-top: 11px; }
.panda-no { position: absolute; top: 36%; left: 38%; width: 100px; min-height: 46px; padding-inline: 20px; border-color: #a493b8; background: #e9e0f4; transform: translate(-50%,-50%); }
.panda-choice:hover { box-shadow: 0 8px 19px #765a7028; transform: translateY(-2px); }
.panda-no:hover { transform: translate(-50%,-50%); }
.panda-choice:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.panda-choice:disabled { cursor: default; opacity: .75 !important; }
@media (max-width: 480px) { .panda-screen { padding: 18px 14px; }.panda-card { padding: 29px 17px 25px; }.panda-card h1 { font-size: clamp(26px, 8vw, 34px); }.panda-scene { height: clamp(230px, 38svh, 280px); }.panda-actions { width: min(100%, 330px); } }
@media (max-width: 390px) { .panda-pair { grid-template-columns: 1fr; } .panda-pose { width: min(100%,260px); justify-self: center; } }

@media (prefers-reduced-motion: reduce) { .panda-card { animation: none; } }
.gallery-card[data-photo-id="time-capsule-1"] .gallery-image { object-position: center 70%; }
.gallery-card[data-photo-id="time-capsule-2"] .gallery-image { object-position: center 62%; }

.map-layout { display: block; margin-top: 25px; text-align: left; }

.storybook-map { width: min(100%, 620px); min-height: 330px; aspect-ratio: 700 / 380; margin: 0 auto; }

.map-marker::after { position: absolute; z-index: 4; bottom: calc(100% + 9px); left: 50%; padding: 5px 10px; border: 1px solid #d7c392; border-radius: 14px; color: #72576d; background: #fffdf8; box-shadow: 0 4px 12px #58485a24; content: attr(data-place); font: 600 11px/1.2 var(--serif); letter-spacing: .2px; white-space: nowrap; opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(-50%) rotate(45deg); transition: opacity .18s ease, visibility .18s ease; }

.map-marker:hover::after, .map-marker:focus-visible::after, .map-marker.is-selected::after { opacity: 1; visibility: visible; }

.map-photo-grid { display: grid; width: min(100%, 850px); grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 20px auto 0; }

.map-photo-grid[hidden] { display: none; }

.map-photo-slot { min-width: 0; padding: 8px; border: 1px solid #e2d2ae; border-radius: 5px; background: rgba(255, 253, 248, .88); box-shadow: 0 8px 20px #765a7012; animation: card-arrive .45s both; animation-delay: calc(var(--slot-index, 0) * .12s); }

.map-photo-open { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; overflow: hidden; border: 4px solid white; border-radius: 2px; background: linear-gradient(140deg, #f2dce5, #e5ddf0 54%, #d8e9ef); box-shadow: 0 2px 8px #765a7020; cursor: zoom-in; }

.map-place-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; visibility: hidden; transition: opacity .75s ease, visibility .75s ease; }

/* Keep every Retreat and Coaching frame the same size; School stays unchanged. */
.map-photo-slot[data-photo-id^="retreat-photo-"] .map-photo-open,
.map-photo-slot[data-photo-id^="coaching-photo-"] .map-photo-open { aspect-ratio: 3 / 4; }
.map-photo-slot[data-photo-id^="retreat-photo-"] .map-place-image,
.map-photo-slot[data-photo-id^="coaching-photo-"] .map-place-image { object-fit: contain; }

.map-photo-cover { position: absolute; inset: 0; width: auto; height: auto; opacity: 1; visibility: visible; transition: opacity .8s ease, visibility .8s ease; }

.map-photo-slot.is-revealed .map-place-image { opacity: 1; visibility: visible; }

.map-photo-slot.is-revealed .map-photo-cover { opacity: 0; visibility: hidden; }

.map-photo-caption { margin: 8px 2px 2px; color: #786b7b; font-size: 12px; line-height: 1.6; }

@media (max-width: 620px) {
    .storybook-map { min-height: 275px; }
    .map-photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .map-photo-slot { animation-delay: 0s; animation-duration: .01ms; }
    .map-place-image, .map-photo-cover { transition-duration: .01ms; }
}

/* Birthday letter reveal, scoped to this new section and its dedicated dialog. */
.birthday-letter-section { max-width: 720px; margin: 30px auto 24px; padding: 24px 18px 26px; border: 1px solid #d8c4e5; border-radius: 12px; background: linear-gradient(145deg, #fff6f8, #f8f1ff); box-shadow: 0 10px 28px #765a7012; text-align: center; }
.birthday-letter-section h3 { margin: 7px 0; color: #765c7c; font: 600 clamp(21px, 4vw, 27px)/1.3 var(--serif); letter-spacing: 1.2px; }
.birthday-letter-intro { margin: 6px 0 0; color: #806b83; font: italic 15px/1.6 var(--script); }
.birthday-envelope { position: relative; width: 150px; height: 96px; margin: 19px auto 15px; perspective: 500px; }
.birthday-envelope-body { position: absolute; z-index: 1; right: 0; bottom: 0; left: 0; height: 78px; border: 1px solid #d2b7d9; border-radius: 5px; background: linear-gradient(135deg, #f6dce8, #eee1f7); box-shadow: 0 6px 15px #765a7020; }
.birthday-envelope-body::before, .birthday-envelope-body::after { position: absolute; inset: 0; border-radius: inherit; content: ""; }
.birthday-envelope-body::before { background: linear-gradient(34deg, transparent 49%, #dfc5db 50%, transparent 51%); }
.birthday-envelope-body::after { background: linear-gradient(-34deg, transparent 49%, #e5cddd 50%, transparent 51%); }
.birthday-envelope-letter { position: absolute; z-index: 0; bottom: 12px; left: 25px; width: 100px; height: 64px; border: 1px solid #e5d5ea; background: #fffafd; box-shadow: 0 1px 4px #765a701c; transition: transform .48s cubic-bezier(.2,.8,.2,1); }
.birthday-envelope-letter::after { position: absolute; inset: 9px 12px; border-top: 1px solid #e6d9e9; border-bottom: 1px solid #e6d9e9; content: ""; }
.birthday-envelope-flap { position: absolute; z-index: 3; top: 18px; left: 0; width: 150px; height: 58px; border: 1px solid #d2b7d9; background: linear-gradient(145deg, #f2d3e2, #e6d9f2); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: 50% 0; transition: transform .48s cubic-bezier(.2,.8,.2,1); backface-visibility: hidden; }
.birthday-envelope.is-opening .birthday-envelope-flap { transform: rotateX(180deg); }
.birthday-envelope.is-opening .birthday-envelope-letter { transform: translateY(-33px); }
.birthday-envelope-sparkles { position: absolute; z-index: 4; top: -13px; right: -15px; color: #b294c3; font-size: 15px; letter-spacing: 3px; }
.birthday-letter-reveal { min-height: 44px; padding: 10px 22px; border: 1px solid #d3b6d9; border-radius: 25px; color: #fff; background: linear-gradient(135deg, #b87999, #987cab); box-shadow: 0 5px 14px #765a7020; font: 600 14px/1.3 var(--serif); cursor: pointer; transition: transform .2s, box-shadow .2s; }
.birthday-letter-reveal:hover { box-shadow: 0 8px 18px #765a7030; transform: translateY(-2px); }
.birthday-letter-reveal:focus-visible, .birthday-letter-close:focus-visible { outline: 3px solid #8c6fa1; outline-offset: 3px; }
.birthday-letter-dialog { position: fixed; width: min(calc(100% - 24px), 680px); height: min(88svh, 800px); max-height: 88svh; padding: 0; overflow: hidden; border: 6px double #cbb5dc; border-radius: 10px; color: #554858; background: #fff0f6; box-shadow: 0 24px 90px #44314c55; }
.birthday-letter-dialog::backdrop { background: rgba(56, 43, 61, .53); backdrop-filter: blur(4px); }
.birthday-letter-close { position: absolute; z-index: 3; top: 10px; right: 11px; display: grid; width: 36px; height: 36px; place-items: center; border: 1px solid #cbb5dc; border-radius: 50%; color: #674f70; background: #fffafd; font-size: 23px; cursor: pointer; }
.birthday-letter-paper { position: relative; width: 100%; height: 100%; padding: 57px clamp(22px, 6vw, 56px) 28px; overflow-y: auto; overscroll-behavior: contain; background: linear-gradient(135deg, #fff2f7, #fdf5ff); animation: birthday-letter-appear .55s cubic-bezier(.2,.8,.2,1) both; }
.birthday-letter-paper::before { position: absolute; z-index: 0; inset: 12px; border: 1px solid #ddc8e8; border-radius: 4px; content: ""; pointer-events: none; }
.birthday-letter-sparkles { position: relative; z-index: 1; margin: 0 0 16px; color: #a58ab5; font-size: 13px; letter-spacing: 4px; text-align: center; }
.birthday-letter-paper h2 { position: relative; z-index: 1; margin: 0 auto 22px; color: #805c7c; font: 700 clamp(20px, 4.5vw, 28px)/1.35 var(--serif); letter-spacing: .35px; text-align: center; }
.birthday-letter-copy { position: relative; z-index: 1; font: 400 15px/1.85 var(--serif); overflow-wrap: anywhere; }
.birthday-letter-copy p { margin: 0 0 17px; }
.birthday-letter-sparkles-bottom { margin: 21px 0 0; }
@keyframes birthday-letter-appear { from { opacity: 0; transform: translateY(15px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 480px) { .birthday-letter-section { padding-inline: 14px; }.birthday-letter-copy { font-size: 14px; line-height: 1.8; }.birthday-letter-paper { padding: 54px 22px 24px; } }
@media (prefers-reduced-motion: reduce) { .birthday-envelope-flap, .birthday-envelope-letter, .birthday-letter-reveal { transition-duration: .01ms; }.birthday-letter-paper { animation-duration: .01ms; } }

/* Five-question quiz, scoped to the section after the Chapter 3 map. */
.quiz-section { max-width: 850px; }
.quiz-panel { position: relative; width: min(100%, 760px); margin: 0 auto; padding: clamp(21px, 5vw, 36px); border: 1px solid #dfcbe3; border-radius: 12px; background: linear-gradient(145deg, #fff8f3, #f7f0ff); box-shadow: 0 10px 27px #765a7014; text-align: center; }
.quiz-panel::before { position: absolute; top: 12px; right: 17px; color: #b697bd; content: "✧　·　✦"; font-size: 12px; letter-spacing: 2px; }
.quiz-panel h3 { margin: 8px 0 12px; color: #725a73; font: 500 clamp(20px, 4vw, 27px)/1.35 var(--serif); }
.quiz-game-intro h2 { max-width: 640px; margin: 7px auto 20px; color: #725a73; font-size: clamp(21px, 4.5vw, 32px); line-height: 1.3; }
.quiz-progress { margin: 0; color: #9b7895; font: 600 12px/1.4 var(--serif); letter-spacing: 1.2px; text-transform: uppercase; }
.quiz-question-text { margin: 0 auto 21px; color: #756878; font: 15px/1.65 var(--serif); }
.quiz-answer-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.quiz-answer-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin: 0 0 22px; text-align: left; }
.quiz-answer-option { display: flex; min-height: 52px; align-items: center; gap: 10px; padding: 11px 14px; border: 1px solid #dfd1e5; border-radius: 9px; color: #67586d; background: #fffdfb; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.quiz-answer-option:hover { border-color: #bd9bc8; transform: translateY(-1px); }
.quiz-answer-option.is-selected { border-color: #a880b3; background: #f5eaf8; box-shadow: 0 0 0 2px #d9c2e3; }
.quiz-answer-option input { width: 17px; height: 17px; flex: 0 0 17px; margin: 0; accent-color: #9879a5; }
.quiz-answer-option span { overflow-wrap: anywhere; font: 14px/1.5 var(--serif); }
.quiz-custom-answer { display: grid; max-width: 620px; gap: 9px; margin: 0 auto 20px; text-align: left; }
.quiz-custom-answer label { color: #725a73; font: 600 14px/1.5 var(--serif); }
.quiz-custom-answer textarea { width: 100%; min-height: 86px; padding: 11px 13px; border: 1px solid #d9c8e0; border-radius: 8px; color: #554858; background: #fffdfb; font: 14px/1.55 var(--serif); resize: vertical; }
.quiz-local-notice { margin: 0; color: #807482; font: 12px/1.55 var(--serif); }
.quiz-custom-answer .quiz-button { justify-self: center; }
.quiz-replay { margin-top: 10px; }
.quiz-button { min-width: 130px; min-height: 44px; padding: 10px 22px; border: 1px solid #d4bc8d; border-radius: 24px; color: #665464; background: linear-gradient(135deg, #f6dce4, #eee4f5); box-shadow: 0 5px 14px #765a701c; font: 600 15px/1.3 var(--serif); cursor: pointer; transition: transform .18s, box-shadow .18s, opacity .18s; }
.quiz-button:not(:disabled):hover { box-shadow: 0 8px 18px #765a7028; transform: translateY(-2px); }
.quiz-button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.quiz-video { display: block; width: min(100%, 640px); max-height: 68svh; margin: 17px auto 21px; border: 1px solid #d7c4df; border-radius: 8px; background: #29232c; }
.quiz-video-message { max-width: 510px; margin: 16px auto 22px; padding: 12px 15px; border: 1px solid #e1d4e4; border-radius: 8px; color: #796d7b; background: #fffdfb; font: 13px/1.6 var(--serif); }
.quiz-video-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.quiz-secondary-button { min-height: 44px; padding: 9px 18px; border: 1px solid #d6c5df; border-radius: 24px; color: #715d78; background: #fffafd; font: 600 14px/1.3 var(--serif); cursor: pointer; }
.quiz-complete-panel:not([hidden]) { animation: card-arrive .55s both; }
@media (max-width: 560px) { .quiz-answer-list { grid-template-columns: 1fr; gap: 9px; }.quiz-answer-option { min-height: 48px; } }
@media (prefers-reduced-motion: reduce) { .quiz-answer-option, .quiz-button, .quiz-secondary-button { transition-duration: .01ms; }.quiz-complete-panel:not([hidden]) { animation-duration: .01ms; } }


/* Final audio and once-only birthday celebration. */
.final-audio-dialog { position: fixed; width: min(calc(100% - 24px), 520px); max-height: min(86svh, 650px); padding: 0; overflow: auto; border: 1px solid var(--gold); border-radius: 14px; color: var(--ink); background: #fffdf8; box-shadow: 0 24px 90px #44314c55; }
.final-audio-dialog::backdrop { background: rgba(56, 43, 61, .5); backdrop-filter: blur(4px); }
.final-audio-card { padding: 38px clamp(20px, 6vw, 42px) 30px; border: 7px double #eadbb7; border-radius: 12px; background: linear-gradient(145deg, #fffdf8, #fff4f8 58%, #f7f1ff); text-align: center; animation: final-audio-arrive .48s cubic-bezier(.2,.8,.2,1) both; }
.final-audio-card h2 { margin: 7px 0 17px; color: #795d77; font: 600 clamp(22px, 5vw, 31px)/1.3 var(--serif); }
.final-audio-status { min-height: 1.5em; margin: 0 0 13px; color: #796d7b; font: 13px/1.5 var(--serif); }
.final-audio-controls { display: grid; justify-items: center; gap: 12px; }
.final-audio-toggle { min-width: 120px; }
.final-audio-progress { width: 100%; accent-color: #a77c9c; cursor: pointer; }
.final-audio-progress:disabled { cursor: wait; opacity: .55; }
.final-audio-time { display: flex; justify-content: center; gap: 5px; margin: -6px 0 0; color: #8b7a8a; font: 12px var(--serif); font-variant-numeric: tabular-nums; }
.final-audio-dialog .dialog-close:focus-visible { outline: 3px solid #8c6fa1; outline-offset: 3px; }
.final-celebration-active, .final-page-active { overflow: hidden; }
.final-confetti-layer { position: fixed; z-index: 10001; inset: 0; overflow: hidden; pointer-events: none; }
.final-confetti-layer[hidden], .final-birthday-screen[hidden] { display: none !important; }
.final-confetti-piece { position: absolute; top: 0; left: var(--start-x); display: block; width: 8px; height: 13px; border-radius: 2px; color: var(--piece-color); background: var(--piece-color); opacity: 0; will-change: transform, opacity; }
.final-confetti-ribbon { width: 5px; height: 19px; border-radius: 50%; }
.final-confetti-spark { width: auto; height: auto; background: none; font-size: 17px; line-height: 1; text-shadow: 0 0 12px currentColor; }
.final-confetti-layer.is-active .final-confetti-piece { animation: final-confetti-flight var(--flight-duration) cubic-bezier(.18,.62,.38,1) var(--flight-delay) both; }
@keyframes final-confetti-flight {
    0% { opacity: 0; transform: translate3d(0, var(--start-y), 0) rotate(0) scale(.35); }
    12% { opacity: 1; }
    43% { opacity: 1; transform: translate3d(var(--burst-x), calc(var(--start-y) + var(--burst-y)), 0) rotate(var(--spin)) scale(1); }
    76% { opacity: .9; transform: translate3d(calc(var(--burst-x) + var(--drift-x)), 68svh, 0) rotate(var(--spin-mid)) scale(.9); }
    100% { opacity: 0; transform: translate3d(calc(var(--burst-x) + var(--drift-x)), 116svh, 0) rotate(var(--spin-end)) scale(.7); }
}
.final-birthday-screen { position: fixed; z-index: 10002; inset: 0; display: grid; min-height: 100svh; place-items: center; padding: clamp(22px, 6vw, 70px); overflow: hidden; background: radial-gradient(circle at 15% 20%, #fff9e3 0, transparent 30%), radial-gradient(circle at 88% 78%, #e7dff7 0, transparent 35%), linear-gradient(145deg, #fff2f6, #fffaf3 52%, #f3effb); text-align: center; }
.final-birthday-screen::before, .final-birthday-screen::after { position: absolute; color: #c6a15d; content: "✧　·　✦　·　✧"; font-size: clamp(13px, 2vw, 20px); letter-spacing: clamp(5px, 2vw, 17px); opacity: .8; }
.final-birthday-screen::before { top: 9%; left: 50%; transform: translateX(-50%); }
.final-birthday-screen::after { bottom: 9%; left: 50%; transform: translateX(-50%); }
.final-birthday-screen h1 { width: min(100%, 1050px); margin: 0; color: #8b5e82; background: linear-gradient(105deg, #b87991, #896fa5 48%, #b38b4d); background-clip: text; -webkit-text-fill-color: transparent; font: 800 clamp(56px, 10vw, 156px)/1.16 var(--serif); text-wrap: balance; overflow-wrap: anywhere; animation: final-page-arrive .9s cubic-bezier(.2,.8,.2,1) both; }
@keyframes final-audio-arrive { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes final-page-arrive { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .final-audio-card, .final-birthday-screen h1 { animation-duration: .01ms; }
    .final-confetti-layer.is-active .final-confetti-piece { animation-duration: .45s !important; animation-delay: 0s !important; }
}

.final-birthday-screen h1 .final-crown { display: inline-block; color: #d4a52e; -webkit-text-fill-color: #d4a52e; background: none; filter: drop-shadow(0 2px 2px #b18a3f55); }
