:root {
  --cream: #fff8f0;
  --ivory: #fffdf9;
  --blush: #f6c9d2;
  --rose: #e8a1b1;
  --deep-rose: #c96f89;
  --lavender: #e8dff5;
  --ink: #5b3a42;
  --muted: #876e77;
  --line: rgba(201, 111, 137, .22);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-width: 320px; min-height: 100vh; min-height: 100svh; min-height: 100dvh; margin: 0; color: var(--ink); background: linear-gradient(145deg, var(--cream), var(--ivory) 45%, #f7eef8); font-family: "DM Sans", sans-serif; overflow-x: hidden; }
button, input { font: inherit; touch-action: manipulation; }
button { cursor: pointer; }
.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; }
.hidden { display: none !important; }
.mode-selector, .error-view { position: fixed; inset: 0; display: grid; place-items: center; align-items: safe center; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); background: radial-gradient(circle at 50% 15%, var(--ivory), var(--blush) 75%, var(--lavender)); }
.mode-selector { z-index: 100; transition: opacity 1.8s cubic-bezier(.22,.61,.36,1); }
.mode-selector.mode-selector-reveal { opacity: 0; pointer-events: none; }
.mode-selector-card, .error-card { width: min(560px, 100%); padding: 34px 26px; border: 1px solid rgba(255,255,255,.85); border-radius: 27px; background: rgba(255,253,249,.88); box-shadow: 0 25px 70px rgba(120,74,89,.18); text-align: center; }
.mode-selector-card { transition: opacity 1.8s ease, transform 1.8s ease, filter 1.8s ease; }
.mode-selector-reveal .mode-selector-card { opacity: 0; transform: translateY(12px) scale(.97); filter: blur(8px); }
.mode-selector-card h1, .error-card h1 { font-size: clamp(38px, 10vw, 54px); line-height: 1.05; }
.mode-selector-copy, .error-card > p:not(.kicker) { max-width: 390px; margin: 15px auto 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.sound-choice { position: fixed; inset: 0; z-index: 130; display: grid; place-items: center; align-items: safe center; overflow-y: auto; overscroll-behavior: contain; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); color: #fff3f6; background: radial-gradient(circle at 50% 20%, rgba(201,111,137,.16), transparent 46%), #050507; transition: opacity .7s ease, transform .7s ease, filter .7s ease; }
.sound-choice-card { width: min(460px, 100%); padding: 34px 26px; border: 1px solid rgba(247,220,229,.2); border-radius: 26px; background: rgba(15,12,17,.82); box-shadow: 0 24px 80px rgba(0,0,0,.4); text-align: center; }
.sound-choice-card h1 { color: #fff3f6; font-size: clamp(34px, 9vw, 48px); line-height: 1.08; }
.sound-choice-card h1 i { color: #e8a1b1; }
.sound-choice-copy { margin: 14px 0 0; color: rgba(255,243,246,.72); font-size: 14px; line-height: 1.6; }
.sound-choice-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 25px; }
.sound-choice-button { min-height: 48px; padding: 11px 13px; border: 1px solid rgba(232,161,177,.48); border-radius: 999px; color: #fff3f6; background: rgba(201,111,137,.22); font-size: 12px; font-weight: 600; transition: background .2s, transform .2s; }
.sound-choice-button:hover { transform: translateY(-2px); background: rgba(201,111,137,.4); }
.sound-choice-button:focus-visible { outline: 2px solid #f3bfd0; outline-offset: 3px; }
.sound-choice-no { border-color: rgba(247,220,229,.2); background: rgba(255,255,255,.06); }
.sound-choice-dismissing { opacity: 0; transform: scale(1.02); filter: blur(8px); pointer-events: none; }
.mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 25px; }
.mode-option { display: flex; min-height: 92px; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.76); color: var(--ink); text-align: left; transition: transform .2s, border-color .2s, box-shadow .2s; }
.mode-option:hover, .mode-option:focus-visible { transform: translateY(-2px); border-color: var(--deep-rose); box-shadow: 0 10px 24px rgba(201,111,137,.14); }
.mode-option:focus-visible { outline: 2px solid var(--deep-rose); outline-offset: 3px; }
.mode-option-icon { flex: 0 0 38px; color: var(--deep-rose); font-size: 27px; text-align: center; }
.mode-option strong, .mode-option small { display: block; }
.mode-option strong { font-size: 13px; }
.mode-option small { margin-top: 5px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.error-view { z-index: 90; }
.error-card .rose-button { display: inline-flex; align-items: center; justify-content: center; margin-top: 24px; text-decoration: none; }
.error-card .rose-button span { margin-left: 9px; }
.portrait-intro { position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow: hidden; padding: max(18px, env(safe-area-inset-top)) 10px max(18px, env(safe-area-inset-bottom)); color: #f7dce5; background: #050507; transition: background .8s, opacity 1.8s cubic-bezier(.22,.61,.36,1), transform 1.8s cubic-bezier(.22,.61,.36,1), filter 1.8s cubic-bezier(.22,.61,.36,1); }
.portrait-heading { position: relative; z-index: 1; margin-top: clamp(12px, 4vh, 42px); text-align: center; text-shadow: 0 2px 18px rgba(0,0,0,.8); transition: opacity .6s; }
.portrait-kicker { margin: 0 0 7px; color: #d998ae; font-size: 9px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.portrait-status { margin: 0; color: rgba(247,220,229,.76); font-size: 12px; }
.portrait-canvas { position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; cursor: crosshair; }
.portrait-progress { position: absolute; z-index: 1; bottom: max(30px, env(safe-area-inset-bottom)); display: flex; width: min(220px, 60vw); align-items: center; gap: 10px; color: rgba(247,220,229,.82); font: 10px ui-monospace, SFMono-Regular, Menlo, monospace; text-shadow: 0 2px 10px #000; transition: opacity .6s; }
.portrait-progress-track { height: 2px; flex: 1; overflow: hidden; border-radius: 2px; background: rgba(247,220,229,.17); }
.portrait-progress-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: #e8a1b1; box-shadow: 0 0 9px rgba(232,161,177,.8); transition: width .08s linear; }
.portrait-continue-button { position: absolute; z-index: 1; bottom: max(24px, env(safe-area-inset-bottom)); display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 10px; padding: 11px 22px; border: 1px solid rgba(232,161,177,.58); border-radius: 999px; color: #fff3f6; background: rgba(201,111,137,.24); box-shadow: 0 8px 26px rgba(0,0,0,.28); font-size: 13px; font-weight: 600; opacity: 0; transform: translateY(8px); transition: opacity .45s, transform .45s, background .2s; }
.portrait-continue-button span { color: #e8a1b1; }
.portrait-continue-button:focus-visible { outline: 2px solid #f3bfd0; outline-offset: 4px; }
.portrait-continue-button:hover { background: rgba(201,111,137,.4); }
.portrait-intro.portrait-finished { background: #050507; }
.portrait-intro.portrait-dissolving { opacity: 0; transform: scale(1.02); filter: blur(9px); pointer-events: none; }
.portrait-finished .portrait-heading, .portrait-finished .portrait-progress { opacity: 0; }
.portrait-finished .portrait-canvas, .portrait-finished .portrait-heading, .portrait-finished .portrait-progress { pointer-events: none; }
.portrait-finished .portrait-continue-button:not(.hidden) { opacity: 1; transform: translateY(0); }
.portrait-mode-selector { z-index: 120; background: rgba(5,5,7,.16); backdrop-filter: blur(1px); animation: portrait-options-in .8s both; }
.portrait-mode-selector .mode-selector-card { width: min(510px, 100%); padding: 28px 24px; border-color: rgba(247,220,229,.24); background: rgba(15,12,17,.76); box-shadow: 0 24px 80px rgba(0,0,0,.4); backdrop-filter: blur(12px); }
.portrait-mode-selector .kicker, .portrait-mode-selector .mode-selector-card h1 i { color: #e8a1b1; }
.portrait-mode-selector .mode-selector-card h1 { color: #fff3f6; }
.portrait-mode-selector .mode-selector-copy { color: rgba(255,243,246,.72); }
.portrait-mode-selector .mode-option { border-color: rgba(247,220,229,.22); background: rgba(255,255,255,.08); color: #fff3f6; backdrop-filter: blur(8px); }
.portrait-mode-selector .mode-option:hover, .portrait-mode-selector .mode-option:focus-visible { border-color: #e8a1b1; background: rgba(232,161,177,.15); box-shadow: 0 10px 24px rgba(0,0,0,.22); }
.portrait-mode-selector .mode-option-icon { color: #e8a1b1; }
.portrait-mode-selector .mode-option small { color: rgba(255,243,246,.68); }
@keyframes portrait-options-in { from { opacity: 0; } to { opacity: 1; } }
.view-popup { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; align-items: safe center; overflow-y: auto; overscroll-behavior: contain; padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); background: rgba(75,48,57,.28); backdrop-filter: blur(12px); }
.view-popup-card { width: min(390px, 100%); padding: 38px 24px 34px; border: 1px solid rgba(255,255,255,.9); border-radius: 28px; background: rgba(255,253,249,.96); text-align: center; box-shadow: 0 24px 70px rgba(91,58,66,.22); animation: rise .7s both; }
.view-popup-heart { width: 70px; height: 70px; display: grid; place-items: center; margin: 0 auto 24px; border-radius: 50%; color: #fff; background: var(--deep-rose); font-size: 38px; box-shadow: 0 0 0 8px rgba(201,111,137,.10); animation: heartbeat 2s infinite; }
.view-popup-card h2 { font-size: clamp(39px, 11vw, 54px); }
.view-popup-card p:last-child { margin: 24px 0 0; color: var(--muted); font: 21px "Caveat", cursive; }
.lock-screen { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 20%, #fffdf9, var(--blush) 75%, var(--lavender)); transition: opacity .7s, visibility .7s; }
.lock-screen.unlocking { opacity: 0; visibility: hidden; pointer-events: none; }
.sparkle-field { position: absolute; top: 10%; color: var(--deep-rose); opacity: .48; font-size: 15px; letter-spacing: .2em; animation: drift 4s ease-in-out infinite; }
.lock-card { width: min(390px, 100%); padding: 31px 23px 26px; border: 1px solid rgba(255,255,255,.85); border-radius: 27px; background: rgba(255,253,249,.7); box-shadow: 0 25px 70px rgba(120,74,89,.18); text-align: center; animation: rise .8s both; }
.lock-heart { width: 78px; height: 78px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: var(--ivory); color: var(--deep-rose); font-size: 42px; box-shadow: 0 0 0 9px rgba(255,255,255,.3), 0 0 32px rgba(201,111,137,.25); animation: heartbeat 2s infinite; }
.kicker { margin: 0 0 13px; color: var(--deep-rose); font-size: 10px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: "Playfair Display", serif; letter-spacing: -.05em; line-height: 1; }
h1 { font-size: clamp(42px, 12vw, 61px); }
h1 i, h2 i { color: var(--deep-rose); font-style: italic; }
.lock-intro { color: var(--muted); font-size: 13px; margin: 21px 0; }
.question-box { padding: 13px 15px; margin-bottom: 12px; border: 1px dashed var(--rose); border-radius: 13px; background: rgba(255,255,255,.5); text-align: left; }
.question-box span { display: block; color: var(--deep-rose); font-size: 9px; letter-spacing: .15em; text-transform: uppercase; }
.question-box strong { display: block; margin-top: 5px; font-size: 13px; font-weight: 500; line-height: 1.4; }
#secret-answer { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: rgba(255,255,255,.72); color: var(--ink); text-align: center; }
#secret-answer:focus { border-color: var(--deep-rose); box-shadow: 0 0 0 3px rgba(201,111,137,.1); }
.rose-button { border: 0; border-radius: 13px; padding: 14px 18px; background: var(--deep-rose); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; box-shadow: 0 10px 24px rgba(201,111,137,.22); transition: transform .25s, box-shadow .25s; }
.rose-button:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(201,111,137,.3); }
.rose-button span { margin-left: 12px; font-size: 17px; }
.lock-card .rose-button { width: 100%; margin-top: 12px; }
.lock-error { min-height: 17px; color: var(--deep-rose); font: 500 16px "Caveat", cursive; margin: 9px 0 0; }
.lock-card.shake { animation: shake .45s; }
.lock-footer { margin: 22px 0 0; color: #ad8992; font: 17px "Caveat", cursive; }
.ambient { position: fixed; width: 55vw; height: 55vw; border-radius: 50%; filter: blur(80px); opacity: .35; pointer-events: none; }
.ambient-one { top: -30vw; right: -25vw; background: var(--blush); }
.ambient-two { bottom: -30vw; left: -28vw; background: var(--lavender); }
.app { position: relative; z-index: 2; width: min(100% - 32px, 620px); min-height: 100vh; min-height: 100svh; min-height: 100dvh; margin: auto; padding-bottom: 45px; }
.topbar { display: flex; justify-content: space-between; align-items: center; height: 68px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.brand i { color: var(--deep-rose); font-style: normal; }
.top-heart { color: var(--deep-rose); font-size: 23px; }
.progress-area { padding: 24px 0 0; }
.progress-copy { display: flex; align-items: end; justify-content: space-between; margin-bottom: 9px; color: var(--muted); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.progress-copy strong { color: var(--deep-rose); font-family: "Playfair Display", serif; font-size: 21px; }
.progress-copy small { color: var(--muted); font: 10px "DM Sans", sans-serif; }
.progress-track { height: 4px; overflow: hidden; border-radius: 9px; background: rgba(232,161,177,.2); }
.progress-fill { width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--deep-rose), var(--lavender)); transition: width .5s; }
.stage { display: none; min-height: calc(100vh - 150px); padding: 63px 4px 40px; text-align: center; animation: stage-in .6s both; }
.stage.active { display: block; }
.stage h2 { position: relative; z-index: 3; font-size: clamp(43px, 12vw, 67px); color: #4f3037; text-shadow: 0 2px 10px rgba(255,253,249,.95), 0 0 24px rgba(255,248,240,.95); }
.stage-copy { position: relative; z-index: 3; max-width: 430px; margin: 21px auto 28px; padding: 11px 14px; border: 1px solid rgba(201,111,137,.12); border-radius: 12px; background: rgba(255,253,249,.88); color: #684e56; font-size: 14px; line-height: 1.75; box-shadow: 0 8px 22px rgba(91,58,66,.06); backdrop-filter: blur(6px); }
.stage .kicker { position: relative; z-index: 3; display: table; margin-inline: auto; padding: 6px 9px; border-radius: 8px; background: rgba(255,253,249,.82); text-shadow: none; }
.memory-whispers { display: grid; gap: 10px; max-width: 390px; margin: 34px auto 28px; }
.memory-whispers { position: relative; z-index: 3; }
.memory-whispers span { color: #684e56; font: 20px "Caveat", cursive; opacity: 0; padding: 2px 8px; text-shadow: 0 1px 8px rgba(255,253,249,.95); animation: whisper-in .7s forwards; }
.memory-whispers span:nth-child(2) { animation-delay: .25s; }
.memory-whispers span:nth-child(3) { animation-delay: .5s; }
.memory-background { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .8s; }
.memory-background.visible { opacity: 1; }
.background-photo { position: absolute; width: clamp(118px, 24vw, 180px); height: clamp(150px, 30vw, 220px); object-fit: cover; border: 7px solid rgba(255,253,249,.92); border-bottom-width: 22px; border-radius: 7px; box-shadow: 0 16px 38px rgba(91,58,66,.16); opacity: .82; filter: saturate(.92); transition: opacity 1.2s, transform 1.2s; animation: photo-breathe 8s ease-in-out infinite; }
.memory-background.memory-heavy .background-photo { opacity: .78; }
.memory-background.memory-heavy .photo-one,
.memory-background.memory-heavy .photo-three { transform: translateX(18px) rotate(-8deg); }
.memory-background.memory-heavy .photo-two,
.memory-background.memory-heavy .photo-four { transform: translateX(-18px) rotate(8deg); }
.photo-one { left: -12px; top: 20%; transform: rotate(-8deg); }
.photo-two { right: -14px; top: 12%; transform: rotate(8deg); animation-delay: 2s; }
.photo-three { left: -18px; bottom: 7%; transform: rotate(7deg); animation-delay: 4s; }
.photo-four { right: -10px; bottom: 10%; transform: rotate(-6deg); animation-delay: 6s; }
.app, .progress-area, .topbar { position: relative; z-index: 2; }
.stage-art { position: relative; width: 142px; height: 142px; margin: 0 auto 45px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #fff, var(--blush)); box-shadow: 0 20px 40px rgba(201,111,137,.18); }
.welcome-art span { color: var(--deep-rose); font-size: 65px; animation: heartbeat 2s infinite; }
.welcome-art i, .welcome-art b { position: absolute; color: var(--deep-rose); font-size: 20px; font-style: normal; }
.welcome-art i { top: 8px; right: 15px; animation: twinkle 1.6s infinite; }
.welcome-art b { left: 18px; bottom: 17px; animation: twinkle 1.6s .5s infinite; }
.stage > .rose-button { margin-top: 8px; }
.memory-card { width: min(100%, 340px); margin: 31px auto 16px; padding: 12px 12px 18px; border-radius: 6px; background: #fff; box-shadow: 0 12px 30px rgba(91,58,66,.13); transform: rotate(-1.5deg); animation: card-float 4s ease-in-out infinite; }
.polaroid-scene { height: 225px; display: grid; align-content: center; justify-items: center; gap: 8px; background: linear-gradient(145deg, var(--lavender), var(--blush)); color: var(--deep-rose); }
.polaroid-scene span { font-size: 55px; }
.polaroid-scene small { font: 17px "Caveat", cursive; }
.polaroid-scene[style*="background-image"] { align-items: end; }
.polaroid-scene[style*="background-image"] small {
  width: 100%;
  margin: 0;
  padding: 7px 8px;
  background: rgba(255,253,249,.86);
  color: var(--ink);
  backdrop-filter: blur(5px);
}
.memory-caption { padding-top: 15px; font-family: "Playfair Display", serif; font-size: 16px; line-height: 1.3; }
.hand-note { margin-top: 10px; color: var(--deep-rose); font: 18px "Caveat", cursive; text-align: right; }
.memory-dots { display: flex; justify-content: center; gap: 6px; margin: 20px 0; }
.memory-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--rose); opacity: .35; }
.memory-dots i.active { width: 18px; border-radius: 4px; opacity: 1; }
.quiet-button { display: block; margin: 14px auto 0; border: 0; background: transparent; color: var(--deep-rose); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.quiet-button span { margin-left: 7px; }
.letter-card { position: relative; z-index: 3; max-width: 500px; margin: 27px auto 17px; padding: 25px 22px; border: 1px solid var(--rose); border-radius: 20px 5px 20px 5px; background: rgba(255,253,249,.96); box-shadow: 0 15px 35px rgba(120,74,89,.14); text-align: left; backdrop-filter: blur(8px); }
.letter-card:before { content: "♡"; position: absolute; top: 12px; right: 18px; color: var(--rose); font-size: 24px; }
.letter-top { padding-bottom: 18px; border-bottom: 1px solid var(--line); color: var(--deep-rose); font: 19px "Caveat", cursive; }
.letter-top span { float: right; }
.letter-card h2 { padding: 20px 0; font-size: 37px; }
.letter-text { min-height: 265px; color: #50383f; font-size: 14px; font-weight: 500; line-height: 1.8; white-space: pre-line; }
.letter-sign { margin-top: 19px; color: var(--muted); font: 18px "Caveat", cursive; text-align: right; }
.letter-sign strong { color: var(--deep-rose); font-size: 24px; font-weight: 500; }
.after-letter { position: relative; z-index: 3; width: fit-content; max-width: 90%; margin-inline: auto; padding: 7px 10px; border-radius: 10px; background: rgba(255,253,249,.9); color: #a84f69; font: 21px "Caveat", cursive; }
.stage .rose-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.gift-wrap { position: relative; width: 190px; height: 165px; margin: 55px auto 25px; }
.gift-box { position: absolute; bottom: 0; left: 20px; width: 150px; height: 105px; border-radius: 5px; background: var(--rose); box-shadow: 0 17px 0 -7px rgba(91,58,66,.12); }
.gift-box i { position: absolute; left: 62px; width: 27px; height: 100%; background: #fff5dc; opacity: .9; }
.gift-lid { position: absolute; z-index: 2; top: 32px; left: 12px; width: 166px; height: 32px; border-radius: 5px; background: var(--deep-rose); transition: transform .8s; }
.gift-lid span { position: absolute; top: -28px; left: 65px; color: #fff5dc; font-size: 30px; }
.gift-ribbon { position: absolute; z-index: 3; left: 76px; top: 8px; width: 38px; height: 38px; border: 7px solid #fff5dc; border-radius: 50%; transform: rotate(45deg); }
.gift-photo { position: absolute; z-index: 5; left: 20px; top: -35px; width: 150px; height: 150px; border: 5px solid #fff; border-radius: 50%; object-fit: cover; box-shadow: 0 12px 30px rgba(91,58,66,.18); opacity: 0; transform: scale(.4) translateY(35px); pointer-events: none; transition: opacity .7s .35s, transform .8s .35s; }
.gift-wrap.opened .gift-photo { opacity: 1; transform: scale(1) translateY(0); }
.gift-glow { position: absolute; inset: 15px; border-radius: 50%; background: var(--blush); filter: blur(25px); opacity: .6; }
.gift-wrap.opened .gift-lid { transform: translateY(-45px) rotate(-8deg); }
.gift-wrap.opened .gift-box { animation: gift-pop .7s; }
.gift-message { display: none; position: relative; z-index: 3; max-width: 280px; margin: 24px auto; padding: 10px 13px; border-radius: 12px; background: rgba(255,253,249,.92); color: #a84f69; font: 22px "Caveat", cursive; line-height: 1.25; }
.gift-message.visible { display: block; animation: rise .7s both; }
.final-stage { padding-top: 95px; }
.final-preview { position: relative; z-index: 3; }
.goodbye-card { position: relative; z-index: 3; max-width: 470px; margin: auto; padding: 34px 25px 29px; border: 1px solid rgba(201,111,137,.32); border-radius: 28px; background: rgba(255,253,249,.94); box-shadow: 0 22px 55px rgba(91,58,66,.14); backdrop-filter: blur(12px); animation: rise .8s both; }
.goodbye-card h2 { font-size: clamp(38px, 10vw, 58px); }
.goodbye-seal { width: 68px; height: 68px; display: grid; place-items: center; margin: 0 auto 20px; border-radius: 50%; color: #fff; background: var(--deep-rose); font-size: 35px; box-shadow: 0 0 0 8px rgba(201,111,137,.11), 0 12px 28px rgba(201,111,137,.24); animation: heartbeat 2s infinite; }
.goodbye-card .kicker { margin-bottom: 17px; }
.final-heart { color: var(--deep-rose); font-size: 78px; text-shadow: 0 0 25px rgba(201,111,137,.25); animation: heartbeat 2s infinite; }
.final-copy { position: relative; z-index: 3; max-width: 420px; margin: 26px auto; padding: 12px 15px; border-radius: 14px; background: rgba(255,253,249,.88); color: #684e56; font-size: 15px; line-height: 1.8; box-shadow: 0 8px 24px rgba(91,58,66,.07); }
.final-note { margin: 28px 0 35px; color: var(--deep-rose); font: 28px "Caveat", cursive; }
.confetti-field { position: fixed; inset: 0; z-index: 30; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; top: -20px; width: 8px; height: 13px; background: var(--rose); animation: confetti-fall 2.8s linear forwards; }
.goodbye-heart { position: absolute; bottom: -50px; color: var(--deep-rose); text-shadow: 0 4px 16px rgba(201,111,137,.28); opacity: 0; animation: goodbye-rise 4.8s ease-out forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes stage-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.09); } 24% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
@keyframes twinkle { 50% { transform: scale(1.4) rotate(15deg); opacity: .35; } }
@keyframes drift { 50% { transform: translateY(10px) rotate(5deg); } }
@keyframes card-float { 50% { transform: rotate(1.5deg) translateY(-4px); } }
@keyframes whisper-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes photo-breathe { 50% { filter: saturate(.9); } }
@keyframes gift-pop { 50% { transform: translateY(-7px); } }
@keyframes confetti-fall { to { transform: translateY(110vh) rotate(540deg); opacity: 0; } }
@keyframes goodbye-rise {
  0% { transform: translateY(0) scale(.55) rotate(-12deg); opacity: 0; }
  12% { opacity: .9; }
  70% { opacity: .68; }
  100% { transform: translateY(-115vh) scale(1.35) rotate(18deg); opacity: 0; }
}
@media (min-width: 700px) { .app { width: min(100% - 48px, 700px); } .stage { padding-top: 75px; } }
@media (max-width: 640px) {
  .mode-selector-card, .error-card { padding: 28px 18px; }
  .mode-options { grid-template-columns: 1fr; gap: 9px; margin-top: 20px; }
  .mode-option { min-height: 72px; }
  .sound-choice-card { padding: 28px 18px; }
  .sound-choice-actions { grid-template-columns: 1fr; margin-top: 21px; }
  .sound-choice-button { min-height: 46px; }
  .portrait-intro { padding: max(14px, env(safe-area-inset-top)) max(5px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(5px, env(safe-area-inset-left)); }
  body[data-theme="dark"] .portrait-canvas { filter: brightness(1.32) contrast(1.14); }
  body[data-theme="paper"] .portrait-canvas { filter: contrast(1.14); }
  .portrait-heading { margin-top: clamp(12px, 3vh, 28px); }
  .portrait-kicker { color: #efb1c1; font-size: 10px; }
  .portrait-status { color: rgba(255,243,246,.92); font-size: 13px; }
  .portrait-mode-selector { padding: 12px; }
  .portrait-mode-selector .mode-selector-card { padding: 24px 16px; }
  .portrait-mode-selector .mode-selector-card h1 { font-size: clamp(35px, 10vw, 48px); }
  .portrait-mode-selector .mode-options { gap: 7px; margin-top: 17px; }
  .portrait-mode-selector .mode-option { min-height: 64px; }
  .lock-screen { place-items: start center; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
  .lock-card { margin-block: auto; padding: 26px 18px 22px; }
  .lock-card h1 { font-size: clamp(38px, 11vw, 52px); }
  .lock-heart { width: 66px; height: 66px; margin-bottom: 16px; font-size: 35px; }
  .lock-intro { margin: 16px 0; }
  .lock-footer { margin-top: 16px; }
  #secret-answer { min-height: 48px; font-size: 16px; }
  .rose-button, .quiet-button { min-height: 44px; }
  .quiet-button { padding: 10px 12px; }
  .app { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .stage { padding: 42px 2px 34px; min-height: calc(100dvh - 132px); }
  .stage-art { width: 112px; height: 112px; margin-bottom: 32px; }
  .background-photo { width: 118px; height: 150px; border-width: 5px; border-bottom-width: 17px; opacity: .48; }
  .memory-background.memory-heavy .background-photo { opacity: .58; }
  .stage h2 { font-size: clamp(40px, 12vw, 54px); }
  .stage-copy { font-size: 13px; }
  .letter-card { padding: 20px 17px; background: rgba(255,253,249,.98); }
  .letter-text { font-size: 13.5px; line-height: 1.75; }
  .final-stage { padding: 42px 0 32px; min-height: calc(100vh - 150px); min-height: calc(100dvh - 150px); display: none; align-items: center; }
  .final-stage.active { display: flex; }
  .goodbye-card { width: 100%; padding: 27px 17px 24px; border-radius: 22px; }
  .goodbye-card h2 { font-size: clamp(36px, 11vw, 46px); }
  .goodbye-seal { width: 58px; height: 58px; font-size: 29px; }
  .final-copy { margin: 19px auto; font-size: 13.5px; }
  .final-note { margin: 20px 0 25px; font-size: 24px; }
}
.relation-status-link {
  position: fixed;
  z-index: 70;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(255, 253, 249, .7);
  border-radius: 999px;
  color: #fffdf9;
  background: var(--deep-rose);
  box-shadow: 0 10px 28px rgba(91, 58, 66, .22);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  transition: background .2s, box-shadow .2s, transform .2s;
}
.relation-status-link:hover { background: #b95e79; box-shadow: 0 13px 32px rgba(91, 58, 66, .28); transform: translateY(-2px); }
.relation-status-link:focus-visible { outline: 2px solid #5b3a42; outline-offset: 3px; }
@media (max-width: 640px) {
  .relation-status-link {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    width: fit-content;
    min-height: 44px;
    margin-inline: auto;
    padding: 10px 13px;
    font-size: 8px;
    letter-spacing: .06em;
  }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* Interview countdown */
.interview-dialog {
  width: min(900px, calc(100% - 28px));
  max-width: none;
  max-height: min(90vh, 840px);
  max-height: min(90dvh, 840px);
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(243, 191, 208, .38);
  border-radius: 28px;
  color: #fff3f6;
  background: #171321;
  box-shadow: 0 34px 100px rgba(0, 0, 0, .48), 0 0 55px rgba(201, 111, 137, .15);
}
.interview-dialog::backdrop { background: rgba(5, 5, 9, .76); backdrop-filter: blur(12px); }
.interview-card {
  position: relative;
  display: grid;
  min-height: 520px;
  grid-template-areas: "details portrait";
  grid-template-columns: minmax(0, 1.18fr) minmax(0, .82fr);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 100% 0, rgba(146, 118, 170, .17), transparent 46%),
    linear-gradient(135deg, #211827, #121722 75%);
}
.interview-close {
  position: absolute;
  z-index: 3;
  top: 14px;
  right: 14px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(255, 243, 246, .22);
  border-radius: 50%;
  color: #fff3f6;
  background: rgba(255, 255, 255, .08);
  font-size: 25px;
  line-height: 1;
  transition: background .2s, transform .2s;
}
.interview-close:hover { background: rgba(255, 255, 255, .16); transform: rotate(90deg); }
.interview-close:focus-visible { outline: 2px solid #f3bfd0; outline-offset: 3px; }
.interview-portrait {
  position: relative;
  display: grid;
  grid-area: portrait;
  min-height: 520px;
  place-items: center;
  overflow: hidden;
  padding: 28px 20px;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(201, 111, 137, .19), transparent 48%),
    linear-gradient(160deg, rgba(255, 255, 255, .06), transparent 62%);
}
.passport-card {
  position: relative;
  z-index: 1;
  width: min(100%, 300px);
  padding: 16px;
  overflow: hidden;
  border: 1px solid rgba(116, 94, 65, .3);
  border-radius: 20px;
  color: #2a3440;
  background:
    radial-gradient(circle at 100% 0, rgba(203, 178, 136, .28), transparent 42%),
    linear-gradient(155deg, #fff8e9, #e9dcc4);
  box-shadow: 0 20px 42px rgba(0, 0, 0, .28), inset 0 0 0 4px rgba(255, 255, 255, .28);
}
.passport-card::before {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(132deg, transparent 0 18px, rgba(132, 112, 80, .045) 19px 20px);
  content: "";
  pointer-events: none;
}
.passport-header,
.passport-photo-frame,
.passport-identity,
.passport-footer {
  position: relative;
  z-index: 1;
}
.passport-header {
  display: grid;
  grid-template-columns: 30px 1fr 28px;
  align-items: center;
  gap: 9px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(80, 68, 51, .2);
}
.passport-emblem,
.passport-mark {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(112, 91, 61, .35);
  border-radius: 50%;
  color: #81643f;
}
.passport-emblem { font-size: 15px; }
.passport-mark { font-size: 14px; }
.passport-heading { display: grid; gap: 2px; }
.passport-heading small {
  color: #786b58;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .18em;
}
.passport-heading strong {
  color: #344452;
  font-size: 12px;
  letter-spacing: .12em;
}
.passport-photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin-top: 12px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, .92);
  border-radius: 10px;
  background: #f5f4ef;
  box-shadow: 0 5px 16px rgba(31, 37, 42, .16);
}
.interview-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.boarding-call-stamp {
  position: absolute;
  right: 9px;
  bottom: 11px;
  display: grid;
  grid-template-columns: 17px auto;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border: 2px double #a64c59;
  border-radius: 5px;
  color: #98434f;
  background: rgba(255, 247, 232, .94);
  box-shadow: 0 3px 9px rgba(35, 29, 26, .15);
  font-size: 8px;
  letter-spacing: .08em;
  line-height: 1.25;
  transform: rotate(-7deg);
}
.boarding-call-stamp span { font-size: 14px; }
.boarding-call-stamp strong { white-space: nowrap; }
.passport-identity {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.passport-identity span {
  display: block;
  margin-bottom: 3px;
  color: #84745d;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .16em;
}
.passport-identity strong {
  display: block;
  color: #30404d;
  font-size: 10px;
  letter-spacing: .08em;
}
.passport-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px solid rgba(80, 68, 51, .2);
  color: #76664e;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .12em;
}
.passport-footer i {
  color: #a64c59;
  font-size: 9px;
  font-style: normal;
  letter-spacing: .2em;
}
.interview-details {
  grid-area: details;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(32px, 5vw, 56px) clamp(24px, 5vw, 52px);
}
.interview-kicker {
  margin: 0 0 14px;
  color: #e8a1b1;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.interview-details h2 {
  margin: 0;
  color: #fff3f6;
  font: 500 clamp(29px, 4vw, 43px)/1.12 "Playfair Display", serif;
  letter-spacing: -.04em;
}
.interview-details h2 em { display: inline-block; margin-top: 7px; color: #efb4c3; font-size: .68em; font-weight: 500; }
.interview-wish { margin: 17px 0 22px; color: rgba(255, 243, 246, .78); font-size: 13px; line-height: 1.7; }
.interview-countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.countdown-unit {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: 4px;
  padding: 12px 4px 10px;
  border: 1px solid rgba(243, 191, 208, .2);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .035));
}
.countdown-unit strong { color: #fff3f6; font: 600 clamp(21px, 3vw, 29px)/1 "DM Sans", sans-serif; font-variant-numeric: tabular-nums; }
.countdown-unit span { color: rgba(255, 243, 246, .62); font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.countdown-label { margin: 10px 0 0; color: #e8a1b1; font-size: 8px; font-weight: 700; letter-spacing: .17em; text-align: right; }
.airport-reminder {
  margin: 20px 0 0;
  padding: 11px 0 0 13px;
  border-top: 1px solid rgba(243, 191, 208, .17);
  border-left: 2px solid #c96f89;
  color: rgba(255, 243, 246, .72);
  font: 15px/1.6 "Playfair Display", serif;
}
@media (max-width: 680px) {
  .interview-dialog { width: calc(100% - 20px); max-height: 92vh; max-height: 92dvh; border-radius: 22px; }
  .interview-card {
    min-height: 0;
    grid-template-areas: "portrait" "details";
    grid-template-columns: 1fr;
  }
  .interview-portrait { min-height: 0; padding: 18px 14px 12px; }
  .passport-card { width: min(100%, 230px); padding: 12px; border-radius: 16px; }
  .passport-header { grid-template-columns: 26px 1fr 24px; gap: 7px; padding-bottom: 8px; }
  .passport-emblem, .passport-mark { width: 24px; height: 24px; }
  .passport-heading small { font-size: 6px; }
  .passport-heading strong { font-size: 10px; }
  .passport-photo-frame { margin-top: 9px; border-radius: 8px; }
  .boarding-call-stamp { right: 7px; bottom: 9px; padding: 5px 6px; font-size: 7px; }
  .passport-identity { margin-top: 9px; gap: 6px; }
  .passport-identity span { font-size: 6px; }
  .passport-identity strong { font-size: 8px; }
  .passport-footer { margin-top: 9px; padding-top: 7px; font-size: 6px; }
  .interview-details { padding: 24px 20px 25px; }
  .interview-kicker { margin-bottom: 10px; }
  .interview-details h2 { font-size: clamp(27px, 7vw, 36px); }
  .interview-wish { margin: 12px 0 16px; font-size: 12px; }
  .interview-countdown { gap: 6px; }
  .countdown-unit { padding: 10px 2px 8px; border-radius: 10px; }
  .countdown-unit strong { font-size: clamp(19px, 6vw, 24px); }
  .countdown-unit span { font-size: 7px; letter-spacing: .06em; }
  .airport-reminder { margin-top: 15px; font-size: 14px; }
}
