/* Recipient adapter: keep the supplied theme styles, atmosphere and choreography.
   These rules only fit the original stage into a shop preview or shared page. */
.recipient-page{margin:0;background:#f4f1ea;min-width:280px}
.recipient-stage{margin:0;padding:0}
.recipient-stage .stage{border-radius:0;box-shadow:none;min-height:720px;height:max(720px,100svh);width:100%}
.local-preview-banner{padding:9px 16px;background:#eee8de;color:#62594f;font:12px/1.5 Arial,sans-serif;text-align:center}
.recipient-page:has(.local-preview-banner) .stage{height:max(720px,calc(100svh - 36px))}
.recipient-page .symbol-defs{position:absolute;width:0;height:0;overflow:hidden}
.recipient-page button:focus-visible{outline:3px solid var(--stage-accent,#7c2436);outline-offset:4px}
.recipient-page .stage [hidden]{display:none!important}
/* The animation delivers the note first. The portrait stays a surprise until
   the recipient explicitly opens it; source scene timing remains unchanged. */
.stage:not([data-gift-step=artwork]) .st-portrait,
.stage:not([data-gift-step=artwork]) .atelier-secret,
.stage:not([data-gift-step=artwork]) .ov2-photo{visibility:hidden!important}
.recipient-page .stage[data-gift-step=note]{height:auto;min-height:max(720px,100svh);padding:82px 24px 30px;display:flex;flex-direction:column;align-items:center;gap:26px}
.recipient-page:has(.local-preview-banner) .stage[data-gift-step=note]{min-height:max(720px,calc(100svh - 36px))}
.recipient-page .stage[data-gift-step=note] .gift-heading{position:relative;top:auto!important;left:auto;right:auto;margin:0;flex:none;width:100%}
.recipient-page .stage[data-gift-step=note] .gift-actions{position:relative;bottom:auto!important;left:auto;right:auto;margin:0;flex:none}
.stage[data-gift-step=note] .stage-progress{display:none}
.reveal-letter{z-index:8;position:relative;width:min(420px,100%);margin:auto 0;padding:30px 34px;background:var(--letter-paper);color:var(--letter-ink);text-align:center;box-shadow:0 16px 55px #0002,0 0 0 1px color-mix(in srgb,var(--letter-accent),transparent 65%);border-radius:3px;animation:letter-arrive .65s cubic-bezier(.22,1,.36,1) both}
.reveal-letter::before{content:"";position:absolute;inset:9px;border:1px solid var(--letter-accent);opacity:.28;pointer-events:none}
.reveal-letter .letter-paw{color:var(--letter-ink);margin:0 auto 14px}
.reveal-letter .letter-kicker{color:var(--letter-ink);opacity:.65;margin:0 0 20px}
.reveal-letter h3{font:italic 26px/1.2 Georgia,serif;margin:0 0 16px;overflow-wrap:anywhere}
#reveal-message{font:400 18px/1.65 Georgia,serif;margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
.reveal-signature{font:italic 18px/1.4 Georgia,serif;margin:24px 0 0;overflow-wrap:anywhere}
@keyframes letter-arrive{from{opacity:0;transform:translateY(14px) scale(.98)}to{opacity:1;transform:none}}
.recipient-page .note-dialog{max-height:calc(100dvh - 24px);overflow:auto}
@media(max-width:520px){
 .recipient-stage .stage{min-height:720px;height:max(720px,100svh)}
 .recipient-page:has(.local-preview-banner) .stage{height:max(720px,calc(100svh - 33px))}
 .recipient-page .stage-topline{left:20px;right:20px}
 .local-preview-banner{font-size:11px;padding:8px 12px}
 .recipient-page .stage[data-gift-step=note]{padding:82px 20px 28px;gap:22px}
 .reveal-letter{padding:26px 26px}
 #reveal-message{font-size:17px;line-height:1.6}
}
@media(prefers-reduced-motion:reduce){.reveal-letter{animation:none}}

/* Keep the original type and theme art. Functional captions need enough contrast
   on pale paper; the larger hit area doesn't enlarge the text or icon. */
.recipient-page .stage{--gift-readable-sub:var(--stage-sub)}
.recipient-page .stage[data-dark=false]{--gift-readable-sub:color-mix(in srgb,var(--stage-sub) 40%,var(--stage-ink))}
.recipient-page #gift-eyebrow,.recipient-page #gift-subtitle,.recipient-page #action-hint,.recipient-page .skip-button{color:var(--gift-readable-sub,var(--stage-ink,#243045))}
.recipient-page .sound-button,.recipient-page .icon-button{min-width:44px;min-height:44px;display:inline-grid;place-items:center}
.recipient-page .skip-button{min-height:44px;padding:8px 12px}
.recipient-page .stage-controls{align-items:center;gap:8px}
.recipient-page .sound-button{width:44px;height:44px}
.recipient-page .replay-button{min-height:44px;align-items:center}
.gift-load-state{position:absolute;z-index:15;left:24px;right:24px;top:43%;max-width:360px;margin:auto;text-align:center;color:#243045;background:#fffaf4;padding:24px;border-radius:16px;box-shadow:0 10px 30px #0001}
.gift-load-state p{margin:0;line-height:1.65}
.gift-load-state .open-gift{margin:18px auto 0;background:#243045;color:#fff;min-height:44px}
.recipient-page .note-dialog .dialog-close{top:8px;right:8px}
@media(max-width:850px){
 .recipient-stage .stage,.recipient-page:has(.local-preview-banner) .stage{min-height:600px;height:max(600px,100svh)}
 .recipient-page .stage[data-gift-step=note],.recipient-page:has(.local-preview-banner) .stage[data-gift-step=note]{min-height:calc(100svh - 1px);height:auto;padding-bottom:calc(24px + env(safe-area-inset-bottom))}
 .recipient-page .stage-topline{top:12px;left:16px;right:12px}
 .recipient-page .gift-actions{bottom:calc(24px + env(safe-area-inset-bottom))}
 .recipient-page .stage[data-gift-step=note] .gift-actions{position:relative;bottom:auto}
 .recipient-page .note-dialog{max-height:calc(100dvh - 24px);overscroll-behavior:contain}
 .recipient-page:has(dialog[open]){overflow:hidden}
 .recipient-page .toast{max-width:calc(100% - 32px);width:max-content;bottom:calc(20px + env(safe-area-inset-bottom));line-height:1.6}
}

@keyframes gift-sound-breathe{0%,100%{box-shadow:0 0 0 0 currentColor}50%{box-shadow:0 0 0 5px transparent}}
@media(prefers-reduced-motion:no-preference){.recipient-page .sound-button[aria-pressed="false"]{animation:gift-sound-breathe 2.8s ease-in-out infinite}.recipient-page .sound-button:hover,.recipient-page .sound-button:focus-visible{animation:none}}
.gift-gallery-footer .open-gift:disabled{opacity:.65;cursor:default}

.recipient-page[data-sender-preview]{overflow:hidden}
.recipient-page[data-sender-preview] .stage{min-height:0;height:100svh}
.recipient-page[data-sender-preview] :is(.stage-topline,.gift-actions){display:none}
.recipient-page[data-sender-preview] .stage .gift-heading{top:clamp(16px,9vh,64px)}
@media(max-height:420px){
  .recipient-page[data-sender-preview] #scene-host{transform:scale(.76)}
  .recipient-page[data-sender-preview] .stage .gift-heading{top:12px}
  .recipient-page[data-sender-preview] .gift-heading h2{font-size:clamp(18px,9vh,32px)}
  .recipient-page[data-sender-preview] .gift-heading :is(#gift-eyebrow,#gift-subtitle){display:none}
}
