:root {
  --blue: #1769cf;
  --blue-deep: #174b98;
  --ink: #143d70;
  --muted: #4c6889;
  --sky: #e3f3ff;
  --gold: #ffd475;
  --gold-ink: #855514;
  --coral: #e85e50;
  --paper: #f8fcff;
  --line: #bdd5ee;
  --serif: "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { font-size: 16px; background: var(--sky); }
body { display: flex; flex-direction: column; height: 100vh; height: 100dvh; margin: 0; color: var(--ink); font-family: var(--sans); font-size: 1rem; line-height: 1.7; -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:disabled { cursor: default; }
button, a { -webkit-user-select: none; user-select: none; }
button:focus-visible, a:focus-visible { outline: 3px solid #b7501f; outline-offset: 5px; }
h1:focus, h2:focus, section:focus { outline: none; }
[hidden] { display: none !important; }
figure, h1, h2, p, blockquote { margin: 0; }
img { display: block; max-width: 100%; }
.experience { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.site-footer { flex-shrink: 0; margin-top: auto; padding: 0 12px var(--safe-bottom); background: var(--sky); text-align: center; }
.site-footer a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; max-width: 100%; padding: 4px 6px; color: var(--muted); font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.site-footer a:hover { color: var(--blue-deep); text-decoration: underline; text-underline-offset: 3px; }
.top-bar { position: absolute; z-index: 50; inset: 0 0 auto; height: calc(76px + var(--safe-top)); padding: calc(12px + var(--safe-top)) clamp(18px,4vw,56px) 12px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; background: linear-gradient(#e3f3ff 75%,#e3f3ff00); }
.back-button { border: 0; background: transparent; min-height: 44px; padding: 4px 12px 4px 0; font-size: .875rem; }
.back-button span { margin-right: 6px; }
.scene-counter { display: flex; align-items: center; gap: 16px; font-size: .875rem; letter-spacing: .05em; }
.counter-digits { color: var(--muted); font-size: .8125rem; word-spacing: .25em; }
.counter-digits strong { color: var(--blue); }
.music-button { justify-self: end; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 84px; min-height: 42px; padding: 7px 12px; border: 1px solid #7eaade; border-radius: 24px; background: #f6fbffe0; font-size: .875rem; white-space: nowrap; }
.music-bars { height: 15px; display: flex; gap: 3px; align-items: center; }
.music-bars i { width: 2px; height: 5px; border-radius: 2px; background: var(--blue); }
.music-bars i:nth-child(2) { height: 13px; animation-delay: -.2s !important; }
.music-bars i:nth-child(3) { height: 9px; animation-delay: -.5s !important; }
.music-bars i:nth-child(4) { height: 12px; animation-delay: -.35s !important; }
.music-button.is-playing i { animation: equalizer .7s ease-in-out infinite alternate; }
.scene { display: none; position: absolute; inset: 0; padding-top: calc(76px + var(--safe-top)); overflow: auto; overscroll-behavior: contain; background: radial-gradient(ellipse at 2% 30%,#b8dbff 0,transparent 50%), linear-gradient(125deg,#e6f5ff,#d7ecff 58%,#b7d7fa); scrollbar-width: thin; scrollbar-color: #9abce1 transparent; }
.scene.is-active { display: block; animation: page-arrive .65s both; }
.scene-shell { position: relative; max-width: 1180px; margin: 0 auto; padding: 28px 58px 30px; }
.opening-layout { min-height: calc(100svh - 148px - var(--safe-top) - var(--safe-bottom)); display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: clamp(36px,6vw,92px); align-items: center; }
.opening-visual { width: 100%; max-width: 470px; position: relative; justify-self: center; }
.portrait-frame { position: relative; height: clamp(370px,65svh,640px); padding: 10px; border: 1px solid #b38b43; border-radius: 48% 48% 8px 8px / 25% 25% 8px 8px; background: #f8fcff; box-shadow: 14px 20px 0 #82b1e633, 0 16px 40px #2462a516; overflow: hidden; isolation: isolate; }
.opening-photo { width: 100%; height: 100%; border-radius: inherit; overflow: hidden; }
.opening-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 34%; filter: brightness(.72); transform: scale(1.075); }
.reveal-door { position: absolute; top: 0; bottom: 0; width: 50.1%; z-index: 2; background: linear-gradient(125deg,#88baf2,#d1eaff); border: 10px solid #eff8ff; transition: transform 1.8s .45s cubic-bezier(.2,.75,.2,1); }
.door-left { left: 0; border-right: 1px solid #e9c575; }
.door-right { right: 0; border-left: 0; background: linear-gradient(45deg,#d1eaff,#a4cffa); }
.opening-seal { position: absolute; z-index: 3; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #204f89; transition: opacity .6s,transform .9s; }
.opening-seal > span { font-family: Georgia,serif; font-style: italic; font-size: clamp(130px,14vw,200px); font-weight: 400; line-height: 1; color: #ffecb4; text-shadow: 1px 2px 0 #ae7c2b, 0 8px 26px #3c719e1f; }
.opening-seal small { margin-top: 12px; font-size: 1rem; letter-spacing: .32em; }
.opening-seal i { margin-top: 24px; border-top: 1px solid #7ca7d0; padding-top: 16px; font-size: .875rem; font-style: normal; letter-spacing: .16em; }
.is-opened .door-left { transform: translateX(-102%); }
.is-opened .door-right { transform: translateX(102%); }
.is-opened .opening-seal { opacity: 0; transform: scale(1.06); pointer-events: none; }
.is-opened .opening-photo img { animation: photo-light 2.4s .25s both; }
.photo-tag { display: flex; justify-content: space-between; gap: 10px; padding: 16px 4px 0; font-size: .875rem; letter-spacing: .08em; }
.photo-tag span:first-child { color: var(--blue); font-weight: 700; }
.photo-tag span:last-child { color: var(--muted); }
.eyebrow { font-family: var(--sans); color: var(--blue-deep); font-size: .8125rem; font-weight: 600; letter-spacing: .2em; line-height: 1.5; }
.cover-greeting { margin-top: 28px; font-size: 1rem; color: var(--muted); line-height: 1.8; overflow-wrap: anywhere; }
.opening-copy h1 { margin-top: 20px; font-family: var(--serif); font-weight: 700; line-height: 1.3; }
.hero-name { display: block; font-size: clamp(3rem,5.6vw,4.9rem); letter-spacing: .13em; }
.hero-theme { display: block; margin-top: 14px; font-size: clamp(1.625rem,2.4vw,2.1rem); letter-spacing: .13em; color: var(--blue); }
.birthday-date { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 26px; }
.birthday-date time { font-family: Georgia,serif; font-size: 2rem; letter-spacing: .04em; line-height: 1.2; }
.birthday-date > span { font-size: .875rem; padding-left: 16px; border-left: 1px solid #789ac0; }
.birthday-date b { display: block; color: var(--blue-deep); font-weight: 600; white-space: nowrap; }
.birthday-countdown { width: 100%; max-width: 330px; margin-top: 16px; padding: 10px 16px; border: 1px solid #afcfee; border-radius: 6px; background: #f8fcffb8; }
.countdown-label { font-size: .875rem; color: var(--muted); line-height: 1.5; }
.countdown-values { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 3px; color: var(--muted); font-size: .875rem; }
.countdown-values > span { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.countdown-values strong { color: var(--blue-deep); font-size: 1.625rem; font-weight: 600; line-height: 1.35; font-variant-numeric: tabular-nums; }
.cover-wish { margin: 22px 0 26px; color: var(--muted); font-size: 1rem; }
.primary-action { display: inline-flex; justify-content: space-between; align-items: center; gap: 20px; width: 100%; max-width: 330px; min-height: 56px; padding: 13px 22px; border: 1px solid #e2b352; border-radius: 6px; background: linear-gradient(110deg,#ffe8aa,#ffd475); color: #4b371b; font-size: 1rem; font-weight: 600; box-shadow: 0 7px 18px #446ea417; transition: transform .2s,box-shadow .2s,opacity .2s; }
.primary-action b { font-size: 1.4rem; font-weight: 400; line-height: 1; }
.primary-action:hover { box-shadow: 0 9px 26px #446ea42c; transform: translateY(-2px); }
.primary-action:active { transform: translateY(1px); }
.primary-action:disabled { opacity: .68; transform: none; }
.tap-hint { margin-top: 12px; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.chapter-footer { max-width: 1064px; margin: 0 auto; padding: 10px 0 calc(70px + var(--safe-bottom)); display: flex; align-items: center; gap: 12px; color: #506d90; font-size: .8125rem; letter-spacing: .08em; }
.chapter-footer > span { display: block; width: 34px; height: 1px; background: #85a5c8; }
.page-progress { position: absolute; z-index: 40; left: 50%; bottom: calc(14px + var(--safe-bottom)); transform: translateX(-50%); display: flex; padding: 3px 8px; border: 1px solid #9ec3e9; border-radius: 30px; background: #f3faffed; box-shadow: 0 4px 18px #1c5da812; }
.page-progress button { background: transparent; border: 0; border-radius: 50%; width: 44px; height: 40px; font-size: .8125rem; color: #61748c; position: relative; }
.page-progress button:disabled { color: #8998aa; }
.page-progress button.is-current { background: var(--blue); color: #fff; }
.visual-star { position: absolute; color: #f2b546; pointer-events: none; }
.star-one { font-size: 46px; right: -24px; top: 4%; }
.star-two { font-size: 36px; left: -26px; bottom: 11%; color: #fff; }
/* 保留原版的灯串、气球和烛火，仅调整位置与出场节奏。 */
.string-lights { position: absolute; z-index: 4; top: 12px; left: 3%; width: 94%; height: 84px; display: flex; align-items: flex-end; justify-content: space-around; padding: 0 3%; pointer-events: none; }
.string-lights::before { content: ""; position: absolute; z-index: -1; top: -20px; left: 0; width: 100%; height: 84px; border-bottom: 1px solid #b59159; border-radius: 0 0 50% 50%; }
.string-lights span { position: relative; width: 8px; height: 12px; margin-bottom: calc(var(--i) * .3px); border-radius: 50% 50% 54% 54%; background: #ffe4a6; opacity: .28; }
.string-lights span::before { content: ""; position: absolute; left: 3px; top: -12px; width: 2px; height: 12px; background: #ae8d58; }
.is-opened .string-lights span { animation: bulb-on .55s calc(var(--i) * .13s) both; }
.balloon-field { position: absolute; z-index: 4; inset: 0; pointer-events: none; }
.balloon-field i { position: absolute; left: var(--x); top: var(--y); width: var(--size); height: calc(var(--size) * 1.22); border-radius: 51% 49% 48% 52% / 44% 44% 56% 56%; background: radial-gradient(circle at 31% 24%,#ffffff94 0 7%,transparent 20%),var(--tone); box-shadow: inset -10px -15px 24px #4c2d122e,0 12px 28px #325e8929; transform: rotate(-4deg); }
.balloon-field i::before { content: ""; position: absolute; left: calc(50% - 5px); bottom: -8px; width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 9px solid var(--tone); }
.balloon-field i::after { content: ""; position: absolute; left: 50%; top: calc(100% + 8px); width: 1px; height: 86px; background: #8aaed2a6; transform: rotate(4deg); transform-origin: top; }
.is-opened .balloon-field i { animation: balloon-bob 2.8s var(--delay) ease-in-out 2 alternate; }
.scene-cake { background: radial-gradient(ellipse at 80% 55%,#f0faff 0,transparent 54%),linear-gradient(115deg,#cee6ff,#bddcff 52%,#d5ecff); }
.birthday-layout { min-height: calc(100svh - 156px - var(--safe-top) - var(--safe-bottom)); display: grid; grid-template-columns: .78fr 1.45fr; column-gap: 52px; align-content: center; align-items: center; }
.growth-copy { grid-column: 1; grid-row: 1; padding-top: 30px; align-self: end; }
.growth-copy h2 { margin-top: 20px; font-family: var(--serif); font-size: clamp(2.75rem,4.8vw,4.5rem); line-height: 1.2; letter-spacing: .08em; }
.growth-copy h2 > span { display: block; font-size: clamp(1.25rem,1.9vw,1.75rem); color: var(--blue); line-height: 1.6; margin-top: 18px; letter-spacing: .04em; }
.birthday-wish { font-size: 1rem; line-height: 1.95; color: var(--muted); margin-top: 22px; }
.small-gold-rule { display: block; width: 42px; height: 3px; background: #e7b65b; margin-top: 24px; }
.birthday-stage { grid-column: 2; grid-row: 1 / 3; position: relative; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,.42fr); gap: 18px; align-items: end; min-width: 0; padding-top: 12px; }
.sport-photo { position: relative; width: 100%; max-width: 380px; justify-self: center; border: 7px solid #f8fcff; outline: 1px solid #9ebfe5; border-radius: 24px 24px 5px 5px; box-shadow: 10px 14px 0 #79ade324; background: #f8fcff; }
.sport-photo-crop { position: relative; width: 100%; aspect-ratio: 3 / 5; overflow: hidden; border-radius: 18px 18px 2px 2px; }
.sport-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; transform: scale(1.2); transform-origin: 50% 90%; }
.sport-photo figcaption { position: relative; width: 100%; padding: 12px 4px 6px; color: #385674; text-align: center; font-size: .875rem; line-height: 1.6; background: #f8fcff; }
.cake-column { z-index: 2; padding-bottom: 34px; text-align: center; min-width: 0; }
.cake-message { display: inline-block; padding: 7px 10px; color: #a14333; background: #fff1e7; border: 1px solid #efba9e; border-radius: 4px; font-size: .875rem; margin-bottom: 22px; transform: rotate(4deg); white-space: nowrap; }
.cake-stage { position: relative; width: 100%; max-width: 185px; margin-inline: auto; transform-origin: 50% 85%; }
.real-cake { width: 100%; height: auto; position: relative; z-index: 1; filter: drop-shadow(0 16px 12px #31659925); }
.cake-halo { position: absolute; z-index: 0; inset: 5% -6% -3%; background: radial-gradient(ellipse,#fff7cfac,transparent 72%); }
.real-flames { position: absolute; z-index: 2; inset: 0; }
.cake-flame { position: absolute; left: var(--fx); top: var(--fy); width: clamp(5px,.65vw,9px); height: clamp(10px,1.3vw,18px); border-radius: 70% 34% 63% 38% / 82% 35% 65% 25%; opacity: 0; background: radial-gradient(circle at 50% 68%,#fff 0 10%,#fff8b0 25%,#ffc84d 51%,#ff7a1a 72%,transparent 75%); box-shadow: 0 0 9px 3px #ffbb485e; transform: translate(-50%,-85%); transform-origin: 50% 90%; }
.cake-caption { font-size: .8125rem; color: var(--muted); margin-top: 18px; line-height: 1.6; }
.birthday-action { grid-column: 1; grid-row: 2; align-self: start; padding: 34px 0 20px; }
.scene-cake.is-active .growth-copy { animation: text-arrive .8s .2s both; }
.scene-cake.is-active .sport-photo { animation: photo-arrive 1.2s .25s both; }
.scene-cake.is-active .cake-stage { animation: cake-arrive 2.65s .2s both; }
.scene-cake.is-active .cake-message { animation: text-arrive .8s .8s both; }
.scene-cake.is-active .cake-flame { animation: flame-ignite .4s calc(.95s + var(--i) * .085s) forwards,flame-flicker .55s calc(1.5s + var(--i) * .085s) ease-in-out infinite alternate; }
.birthday-confetti { position: absolute; z-index: 4; inset: -25px -10px -20px; pointer-events: none; overflow: hidden; }
.birthday-confetti i { position: absolute; width: 7px; height: 14px; background: var(--tone); left: var(--x); top: -20px; opacity: 0; transform: rotate(var(--r)); }
.birthday-confetti i:nth-child(3n) { height: 8px; border-radius: 50%; }
.scene-cake.is-active .birthday-confetti i { animation: confetti-fall 2.6s calc(.7s + var(--i) * .045s) both; }
.stage-star { position: absolute; right: 11%; top: 9%; color: #eeb848; font-size: 48px; }
.scene-invite { background: linear-gradient(140deg,#e4f3ff,#cfe6ff 70%,#bedcff); }
.invite-wrap { position: relative; max-width: 1100px; margin: 0 auto; padding: 30px 40px calc(100px + var(--safe-bottom)); isolation: isolate; }
.invite-card { position: relative; z-index: 2; display: grid; grid-template-columns: 1.32fr 1fr; background: #f8fcff; border: 1px solid #c2a467; border-radius: 8px; box-shadow: 0 18px 58px #174b9817; padding: 12px; }
.invitation-details { padding: 34px 36px 34px 26px; }
.invitation-details .eyebrow { display: flex; justify-content: space-between; gap: 10px; }
.invitation-details .eyebrow span { color: #bd8a36; font-size: 1.25rem; }
.invitation-details h2 { font-family: var(--serif); font-size: 2.75rem; line-height: 1.3; letter-spacing: .14em; margin-top: 20px; }
.invitation-details h2 > span { display: block; color: var(--blue); font-size: 1.5rem; letter-spacing: .06em; margin-top: 12px; }
.gold-rule { margin: 25px 0; height: 1px; background: linear-gradient(90deg,#b9914e,#e5d8ba); }
.guest-greeting { font-size: 1.0625rem; font-weight: 600; line-height: 1.8; overflow-wrap: anywhere; }
.invite-intro { margin-top: 10px; color: var(--muted); font-size: 1rem; line-height: 1.9; }
.event-date { margin-top: 26px; padding: 16px 20px; background: #e4f1ff; border-left: 3px solid var(--blue); }
.detail-label { display: block; font-size: .875rem; color: #506c8c; line-height: 1.5; margin-bottom: 8px; }
.event-date time { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.event-date strong { font-size: 1.6rem; line-height: 1.6; font-weight: 700; }
.event-date time span { font-size: .875rem; }
.event-time { margin-top: 20px; }
.event-time strong { font-size: 1.5rem; }
.event-place { margin-top: 24px; }
.event-place > strong { font-size: 1.6rem; line-height: 1.6; }
.event-hall { width: fit-content; margin-top: 8px; padding: 3px 12px; border-left: 3px solid #e2b352; background: #edf6ff; color: var(--blue-deep); font-size: 1.25rem; font-weight: 600; line-height: 1.6; }
.event-place p { font-size: 1rem; line-height: 1.9; margin-top: 8px; color: var(--muted); }
.invite-actions { display: flex; align-items: center; gap: 12px; margin-top: 24px; }
.map-action { flex: 1; min-width: 0; font-size: .9375rem; padding-inline: 16px; gap: 8px; }
.secondary-action { min-height: 52px; flex-shrink: 0; padding: 10px 12px; border: 1px solid #b1c9e3; border-radius: 5px; background: #edf6ff; font-size: .9375rem; }
.invitation-keepsake { display: flex; flex-direction: column; border-radius: 3px; background: #e5f1ff; min-width: 0; }
.suit-photo { flex: none; position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 3px 3px 0 0; }
.suit-photo img { position: static; width: 100%; height: auto; object-fit: contain; object-position: center top; border-radius: inherit; }
.keepsake-caption { position: relative; text-align: center; padding: 26px 16px 30px; border-top: 3px solid #dfbd79; }
.keepsake-star { color: #b4802f; font-size: 1.35rem; line-height: 1; }
.keepsake-caption blockquote { margin-top: 12px; font-family: var(--serif); font-size: 1.375rem; font-weight: 600; line-height: 1.85; letter-spacing: .06em; }
.host-signature { margin-top: 20px; font-size: 1rem; }
.host-signature span { margin-left: 10px; color: var(--muted); font-size: .875rem; }
.invite-bottom { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 20px 4px; font-size: .875rem; color: #385c83; }
.replay-button { border: 0; padding: 10px 0 10px 16px; min-height: 44px; background: transparent; font-size: .875rem; }
.river-footer { position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 230px; overflow: hidden; opacity: .28; -webkit-mask-image: linear-gradient(transparent,#000); mask-image: linear-gradient(transparent,#000); }
.river-footer img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 67%; }
.scene-invite.is-active .invite-card { animation: invitation-unfold 1s .15s both; transform-origin: 50% 0; }
.scene-invite.is-active .invitation-keepsake { animation: text-arrive .95s .55s both; }
.toast { position: absolute; z-index: 100; left: 50%; bottom: calc(84px + var(--safe-bottom)); transform: translate(-50%,10px); padding: 12px 20px; max-width: min(90vw,440px); width: max-content; border-radius: 8px; background: #174777; color: #fff; font-size: .875rem; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s,transform .2s; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.noscript-card { max-width: 680px; padding: 40px 24px; margin: auto; }
.noscript-card p { margin-top: 20px; }
@keyframes page-arrive { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes text-arrive { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes photo-light { from { filter: brightness(.72); transform: scale(1.075); } to { filter: brightness(1.03); transform: scale(1); } }
@keyframes photo-arrive { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(20px); } to { opacity: 1; clip-path: inset(0); transform: none; } }
@keyframes bulb-on { from { opacity: .28; } to { opacity: 1; background: #fff4c8; box-shadow: 0 0 14px 5px #ffd06a99; } }
@keyframes balloon-bob { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-15px) rotate(5deg); } }
@keyframes cake-arrive { 0% { opacity: 0; transform: translateY(60px) scale(.75); } 45% { opacity: 1; transform: translateY(-8px) scale(1.04); } 100% { opacity: 1; transform: none; } }
@keyframes flame-ignite { to { opacity: 1; } }
@keyframes flame-flicker { from { opacity: .82; transform: translate(-50%,-85%) scale(.92,1.04) rotate(-3deg); } to { opacity: 1; transform: translate(-50%,-85%) scale(1.06,.94) rotate(4deg); } }
@keyframes confetti-fall { 0% { opacity: 0; transform: translateY(0) rotate(var(--r)); } 12% { opacity: .9; } 85% { opacity: .8; } 100% { opacity: 0; transform: translateY(620px) rotate(calc(var(--r) + 310deg)); } }
@keyframes invitation-unfold { from { opacity: 0; transform: perspective(1400px) rotateX(-8deg) translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes equalizer { from { transform: scaleY(.4); } to { transform: scaleY(1); } }
@media (max-width: 899px) {
  .scene-shell { padding: 14px 30px 24px; }
  .opening-layout { grid-template-columns: 1fr 1fr; gap: 36px; }
  .portrait-frame { height: clamp(380px,62svh,530px); }
  .hero-name { font-size: 3.2rem; }
  .hero-theme { font-size: 1.55rem; }
  .cover-greeting { margin-top: 18px; font-size: .9375rem; }
  .chapter-footer { padding-inline: 30px; }
  .birthday-layout { gap: 24px; grid-template-columns: .85fr 1.15fr; }
  .sport-photo { max-width: 340px; }
  .growth-copy h2 { font-size: 3rem; }
  .cake-message { font-size: .8125rem; padding: 6px; }
  .invite-wrap { padding-inline: 24px; }
  .invitation-details { padding: 24px; }
  .invitation-details h2 > span { font-size: 1.3rem; }
  .event-date { padding-inline: 14px; }
  .event-date strong { font-size: 1.35rem; }
  .event-place > strong { font-size: 1.4rem; }
  .keepsake-caption blockquote { font-size: 1.125rem; }
}
@media (max-width: 639px) {
  .top-bar { height: calc(68px + var(--safe-top)); padding: calc(10px + var(--safe-top)) 18px 8px; grid-template-columns: 74px 1fr 84px; gap: 6px; }
  .scene { padding-top: calc(68px + var(--safe-top)); }
  .scene-counter { gap: 7px; justify-content: center; font-size: .8125rem; }
  .counter-digits { font-size: .75rem; word-spacing: 0; }
  .music-button { min-width: 80px; padding-inline: 9px; font-size: .8125rem; }
  .scene-shell { padding: 12px 26px 14px; }
  .opening-layout { grid-template-columns: 1fr; gap: 18px; min-height: 0; }
  .opening-visual { width: min(88%,350px); }
  .portrait-frame { height: clamp(235px,37svh,350px); border-radius: 46% 46% 6px 6px / 28% 28% 6px 6px; padding: 7px; box-shadow: 8px 10px 0 #82b1e62c; }
  .opening-photo img { object-position: 50% 27%; }
  .opening-seal > span { font-size: 125px; }
  .opening-seal small { font-size: .875rem; margin-top: 6px; }
  .opening-seal i { font-size: .8125rem; padding-top: 9px; margin-top: 14px; }
  .photo-tag { padding-top: 10px; font-size: .75rem; }
  .balloon-field i { width: calc(var(--size) * .75); height: calc(var(--size) * .915); }
  .balloon-field i::after { height: 56px; }
  .string-lights { top: 3px; height: 65px; }
  .string-lights::before { height: 66px; }
  .string-lights span { width: 6px; height: 10px; }
  .star-one { right: -25px; font-size: 36px; }
  .star-two { left: -26px; font-size: 30px; bottom: 17%; }
  .opening-copy { text-align: center; }
  .opening-copy .eyebrow { display: none; }
  .cover-greeting { margin: 0; font-size: .875rem; }
  .opening-copy h1 { margin-top: 9px; }
  .hero-name { font-size: 2.75rem; letter-spacing: .12em; padding-left: .12em; }
  .hero-theme { margin-top: 6px; font-size: 1.5rem; letter-spacing: .14em; padding-left: .14em; }
  .birthday-date { justify-content: center; gap: 12px; margin-top: 13px; }
  .birthday-date time { font-size: 1.625rem; }
  .birthday-date > span { padding-left: 12px; }
  .birthday-countdown { margin: 12px auto 0; padding: 8px 12px; }
  .countdown-values { justify-content: center; }
  .cover-wish { font-size: .9375rem; margin: 12px 0 17px; }
  .primary-action { min-height: 52px; padding: 12px 18px; max-width: 340px; }
  .tap-hint { margin-top: 8px; font-size: .75rem; }
  .chapter-footer { justify-content: center; padding: 12px 18px calc(76px + var(--safe-bottom)); font-size: .75rem; letter-spacing: .02em; }
  .birthday-layout { display: flex; flex-direction: column; gap: 0; min-height: 0; }
  .growth-copy { padding: 8px 0 0; text-align: center; align-self: center; }
  .eyebrow { font-size: .75rem; }
  .growth-copy h2 { font-size: 2.5rem; margin-top: 10px; }
  .growth-copy h2 > span { font-size: 1.3125rem; margin-top: 7px; }
  .birthday-wish { margin-top: 11px; font-size: 1rem; line-height: 1.8; }
  .small-gold-rule { display: none; }
  .birthday-stage { width: 100%; max-width: 450px; margin-top: 24px; padding-top: 0; grid-template-columns: minmax(0,1fr) minmax(0,.42fr); gap: 12px; }
  .sport-photo { max-width: none; border-width: 5px; border-radius: 20px 20px 4px 4px; }
  .sport-photo-crop { border-radius: 15px 15px 2px 2px; }
  .sport-photo figcaption { font-size: .75rem; padding: 10px 2px 5px; }
  .cake-column { padding-bottom: 18px; }
  .cake-message { font-size: .75rem; margin-bottom: 16px; white-space: normal; }
  .cake-caption { font-size: .75rem; margin-top: 10px; }
  .cake-flame { width: 5px; height: 10px; box-shadow: 0 0 6px 2px #ffbb485e; }
  .stage-star { right: 12%; top: -14px; font-size: 34px; }
  .birthday-action { padding: 26px 0 0; width: 100%; text-align: center; }
  .invite-wrap { padding: 16px 18px calc(90px + var(--safe-bottom)); }
  .invite-card { grid-template-columns: 1fr; padding: 8px; border-radius: 6px; }
  .invitation-details { padding: 20px 16px 26px; }
  .invitation-details h2 { font-size: 2.5rem; margin-top: 15px; }
  .invitation-details h2 > span { font-size: 1.3125rem; margin-top: 9px; letter-spacing: .025em; }
  .gold-rule { margin: 20px 0; }
  .guest-greeting { font-size: 1rem; }
  .invite-intro { font-size: 1rem; line-height: 1.85; }
  .event-date { margin-top: 22px; padding: 13px 14px; }
  .event-date strong { font-size: 1.4rem; }
  .event-date time { gap: 0 12px; }
  .event-place { margin-top: 21px; }
  .event-place > strong { font-size: 1.5rem; }
  .event-place p { font-size: 1rem; line-height: 1.85; }
  .invite-actions { gap: 8px; margin-top: 22px; }
  .map-action { padding-inline: 12px; font-size: .875rem; }
  .secondary-action { padding-inline: 10px; font-size: .875rem; }
  .invitation-keepsake { margin: 0; }
  .suit-photo { flex: none; min-height: 0; height: auto; }
  .suit-photo img { object-position: center top; }
  .keepsake-caption { padding: 24px 10px 26px; }
  .keepsake-caption blockquote { font-size: 1.25rem; }
  .invite-bottom { padding: 10px 4px; }
}
@media (max-width: 639px) and (max-height: 740px) {
  .opening-layout { gap: 12px; }
  .portrait-frame { height: max(190px,30svh); }
  .hero-name { font-size: 2.5rem; }
  .cover-wish { margin: 9px 0 12px; }
  .opening-copy .tap-hint { margin-top: 5px; }
  .photo-tag { padding-top: 8px; }
  .birthday-stage { margin-top: 18px; }
}
@media (max-width: 359px) {
  .birthday-date { gap: 9px; }
  .birthday-date time { font-size: 1.5rem; }
  .birthday-date > span { padding-left: 9px; }
  .scene-shell { padding-inline: 20px; }
  .top-bar { padding-inline: 12px; grid-template-columns: 64px 1fr 76px; }
  .music-button { min-width: 76px; }
  .scene-counter { gap: 5px; }
  .counter-digits { display: none; }
  .invite-wrap { padding-inline: 12px; }
  .invitation-details { padding-inline: 12px; }
  .invitation-details h2 > span { font-size: 1.1875rem; }
  .event-date strong { font-size: 1.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .is-opened .opening-photo img { filter: brightness(1.03); transform: none; }
  .scene-cake.is-active .cake-flame { opacity: 1; }
  .birthday-confetti { display: none; }
}
@media print {
  body { display: block; height: auto; }
  .experience { height: auto; overflow: visible; }
  .top-bar, .page-progress, .scene-opening, .scene-cake, .invite-actions, .invite-bottom, .river-footer { display: none !important; }
  .scene-invite { position: static; display: block; padding: 0; overflow: visible; background: #fff; }
  .invite-wrap { padding: 0; }
  .invite-card, .invitation-keepsake { animation: none !important; opacity: 1 !important; transform: none !important; }
}
