/* Make a Wish — the experience page */
html, body.exp { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.exp { background: var(--wall); touch-action: manipulation; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }

/* top bar */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 8px; padding: calc(var(--safe-t) + 8px) calc(var(--safe-r) + 10px) 0 calc(var(--safe-l) + 10px); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.topbar .spacer { flex: 1; pointer-events: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; text-decoration: none; background: rgba(20, 10, 30, 0.5); color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-family: var(--display); font-weight: 600; font-size: 16px; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .ic-off { display: none; }
.icon-btn.muted .ic-on { display: none; }
.icon-btn.muted .ic-off { display: block; }
.ribbon { font-family: var(--display); font-weight: 500; font-size: 14px; text-decoration: none; padding: 0 14px; min-height: 36px; display: inline-flex; align-items: center; border-radius: 999px; background: rgba(20, 10, 30, 0.55); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100vw - 140px); }

/* headline */
.hero { position: fixed; left: 0; right: 0; top: 0; z-index: 5; text-align: center; padding: calc(var(--safe-t) + 54px) calc(var(--safe-r) + 16px) 0 calc(var(--safe-l) + 16px); pointer-events: none; opacity: 0; transition: opacity 0.6s; }
body:not([data-step="cover"]) .hero { opacity: 1; }
body.wishing .hero { opacity: 0; }
.hero-kicker { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(17px, min(4.6vw, 3.4svh), 26px); color: var(--muted); letter-spacing: 0.02em; }
.hero-name { font-weight: 700; font-size: clamp(30px, min(calc(170vw / (var(--len, 6) + 2)), 13vw, 9.5svh), 92px); line-height: 1.05; margin: 2px 0 0; white-space: nowrap; letter-spacing: 0.01em; }
.hero-name .ch { display: inline-block; color: #fff; text-shadow: 0 0.06em 0 var(--accent-d), 0 0.14em 0.3em rgba(0, 0, 0, 0.35); }
.hero-name .ch:nth-child(4n+1) { color: var(--accent-l); }
.hero-name .ch:nth-child(4n+2) { color: #ffe27a; }
.hero-name .ch:nth-child(4n+3) { color: #ffffff; }
.hero-name .ch:nth-child(4n) { color: #9ff0d2; }
.hero-name .sp { width: 0.3em; }
.hero.in .ch { animation: drop 0.75s cubic-bezier(0.25, 1.7, 0.45, 1) both, bob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * 60ms + 0.15s), calc(var(--i) * 120ms + 1.2s); }
.hero-sub { margin: 4px auto 0; font-size: 15px; color: var(--muted); max-width: 32ch; }
.hero.in .hero-kicker, .hero.in .hero-sub { animation: fadeUp 0.6s 0.1s both; }
@keyframes drop { from { transform: translateY(-1.2em) scale(0.4) rotate(-12deg); opacity: 0; } 70% { opacity: 1; } to { transform: none; opacity: 1; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -0.06em; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* dock */
.dock { position: fixed; z-index: 10; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 560px); padding: 12px calc(var(--safe-r) + 16px) calc(var(--safe-b) + 14px) calc(var(--safe-l) + 16px); background: var(--panel); border-radius: 26px 26px 0 0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 -10px 40px rgba(0, 0, 0, 0.3); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); text-align: center; transition: opacity 0.4s; }
body[data-step="cover"] .dock, body[data-step="intro"] .dock { opacity: 0; pointer-events: none; }
.step { animation: stepIn 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes stepIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hint { margin: 0 0 10px; font-size: 15.5px; color: var(--muted); line-height: 1.35; }
.hint b { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--ink); display: block; margin-bottom: 1px; }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row .btn { flex: 0 1 auto; }
.small-links { margin: 4px 0 -6px; font-size: 15px; }
.small-links a { color: var(--muted); text-underline-offset: 3px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
.btn-glow { animation: glow 1.8s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35), 0 5px 0 var(--accent-d), 0 0 30px var(--accent); } }

/* toppings tray */
.tray { display: flex; gap: 8px; overflow-x: auto; padding: 4px 4px 10px; margin: 0 -8px 6px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; justify-content: safe center; }
.tray::-webkit-scrollbar { display: none; }
.top-chip { flex: 0 0 auto; scroll-snap-align: center; min-width: 66px; padding-inline: 8px !important; min-height: 72px; padding: 6px 2px 5px; border: 0; border-radius: 18px; background: rgba(255, 255, 255, 0.09); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.14); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform 0.15s, background 0.2s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.top-chip:active { transform: scale(0.94); }
.top-chip[aria-checked="true"] { background: rgba(255, 255, 255, 0.2); box-shadow: inset 0 0 0 2.5px var(--accent), 0 0 18px rgba(255, 255, 255, 0.1); transform: translateY(-2px); }
.top-ic { width: 42px; height: 42px; display: block; }
.top-lbl { font-size: 13.5px; font-weight: 600; line-height: 1.1; color: var(--ink); white-space: nowrap; }

/* breath meter */
.meter { position: relative; height: 16px; margin: 2px auto 12px; max-width: 360px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.15); overflow: hidden; opacity: 0.35; transition: opacity 0.3s; }
.meter.on { opacity: 1; }
.meter-fill { position: absolute; inset: 0; transform-origin: left center; transform: scaleX(0.02); background: linear-gradient(90deg, #9ff0d2, #ffe27a 45%, var(--accent)); border-radius: 999px; }
.meter.hot .meter-fill { box-shadow: 0 0 16px #ffe27a; }
.meter-mark { position: absolute; top: 2px; bottom: 2px; width: 3px; left: 30%; border-radius: 2px; background: #fff; opacity: 0.8; }
.meter-lbl { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); mix-blend-mode: difference; }
.btn-blow { min-width: 170px; touch-action: none; }
#b-mic { white-space: nowrap; padding: 0 14px; }
.btn-blow:active { transform: translateY(3px) scale(0.98); }

/* gifts */
.gifts { --gs: clamp(58px, min(11.5svh, 22vw), 92px); display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 14px; margin: 0 auto 12px; max-width: 520px; }
.gift { position: relative; width: var(--gs); height: var(--gs); padding: 0; border: 0; background: none; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; animation: giftIn 0.6s var(--d) cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.gift:not(.open) { animation: giftIn 0.6s var(--d) cubic-bezier(0.2, 1.6, 0.4, 1) both, giftIdle 2.6s calc(var(--d) + 1s) ease-in-out infinite; }
@keyframes giftIn { from { transform: translateY(40px) scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes giftIdle { 0%, 80%, 100% { transform: none; } 85% { transform: translateY(-6px) rotate(-3deg); } 92% { transform: translateY(0) rotate(2deg); } }
.g-box { position: absolute; left: 7%; right: 7%; bottom: 0; height: 64%; border-radius: 6px 6px 10px 10px; background-color: var(--gc); box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.14), 0 6px 12px rgba(0, 0, 0, 0.3); overflow: hidden; }
.g-box::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 17%; transform: translateX(-50%); background: var(--rc); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1); }
.wrap-stripes .g-box { background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.32) 0 6px, transparent 6px 14px); }
.wrap-dots .g-box { background-image: radial-gradient(rgba(255, 255, 255, 0.45) 2.5px, transparent 3px); background-size: 12px 12px; }
.wrap-zig .g-box { background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%), linear-gradient(225deg, rgba(255, 255, 255, 0.3) 25%, transparent 25%); background-size: 14px 14px; }
.g-lid { position: absolute; left: 0; right: 0; top: 22%; height: 20%; border-radius: 6px; background: var(--gc); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18), 0 3px 6px rgba(0, 0, 0, 0.25); transition: transform 0.55s cubic-bezier(0.2, 1.6, 0.4, 1); transform-origin: 20% 100%; z-index: 2; }
.g-lid::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 17%; transform: translateX(-50%); background: var(--rc); }
.g-bow { position: absolute; left: 50%; bottom: 82%; width: 0; height: 0; }
.g-bow::before, .g-bow::after { content: ''; position: absolute; bottom: -3px; width: calc(var(--gs) * 0.26); height: calc(var(--gs) * 0.2); border: calc(var(--gs) * 0.06) solid var(--rc); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
.g-bow::before { right: -2px; transform: rotate(-24deg); }
.g-bow::after { left: -2px; transform: rotate(24deg); }
.g-peek { position: absolute; left: 50%; bottom: 30%; font-size: calc(var(--gs) * 0.42); line-height: 1; transform: translate(-50%, 30%) scale(0.4); opacity: 0; transition: transform 0.55s 0.12s cubic-bezier(0.2, 1.8, 0.4, 1), opacity 0.3s 0.12s; z-index: 1; }
.g-num { position: absolute; right: -4px; top: 10%; z-index: 3; min-width: 22px; height: 22px; border-radius: 11px; background: #fff; color: #2c1a2e; font-family: var(--display); font-weight: 700; font-size: 13px; display: grid; place-items: center; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.gift.open .g-lid { transform: translate(-28%, -70%) rotate(-32deg); }
.gift.open .g-peek { transform: translate(-50%, -38%) scale(1); opacity: 1; }
.gift.open .g-num { background: var(--accent); color: var(--on-accent); }
.gift.shaking { animation: shake 0.62s ease-in-out both !important; }
@keyframes shake { 0%, 100% { transform: none; } 15% { transform: rotate(-9deg) scale(1.04); } 30% { transform: rotate(8deg) scale(1.06); } 45% { transform: rotate(-7deg) scale(1.08); } 60% { transform: rotate(6deg) scale(1.1); } 80% { transform: translateY(-8px) scale(1.14); } }

/* cover */
.cover { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: calc(var(--safe-t) + 20px) 20px calc(var(--safe-b) + 20px); background: radial-gradient(120% 80% at 50% 30%, var(--wall2), #0d0612 75%); transition: opacity 0.85s, transform 0.85s; overflow: auto; }
.cover.gone { opacity: 0; transform: scale(1.08); pointer-events: none; }
.cover-card { text-align: center; max-width: 420px; }
.cover-cake { width: clamp(90px, 18svh, 140px); height: auto; display: block; margin: 0 auto 6px; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4)); }
.cover-flame { transform-origin: 60px 34px; animation: flick 0.18s ease-in-out infinite alternate; filter: drop-shadow(0 0 8px #ffb13b); }
@keyframes flick { from { transform: scale(1, 1) skewX(-3deg); } to { transform: scale(0.94, 1.06) skewX(3deg); } }
.cover-for { margin: 0; font-family: var(--display); font-weight: 500; font-size: 18px; color: var(--muted); }
.cover-name { margin: 0 0 6px; font-family: var(--display); font-weight: 700; font-size: clamp(40px, 12vw, 72px); line-height: 1.05; overflow-wrap: anywhere; text-shadow: 0 4px 0 var(--accent-d); }
.cover-line { margin: 0 auto 22px; max-width: 28ch; color: var(--muted); font-size: 16.5px; }
.cover-note { margin: 16px 0 0; font-size: 14px; color: rgba(255, 240, 232, 0.6); }
.cover .btn-big { animation: glow 1.8s ease-in-out infinite; }

/* wish moment */
.wish-ov { position: fixed; inset: 0; z-index: 6; pointer-events: none; text-align: center; padding: calc(var(--safe-t) + 60px) 24px 0; opacity: 0; transition: opacity 1.2s; }
.wish-ov.on { opacity: 1; }
.wish-ov::before { content: ''; position: absolute; inset: 0; background: radial-gradient(70% 55% at 50% 58%, transparent 30%, rgba(4, 2, 10, 0.7)); }
.wish-close { position: relative; margin: 0 0 6px; font-family: var(--display); font-weight: 500; font-size: 17px; color: rgba(255, 236, 214, 0.7); letter-spacing: 0.06em; }
.wish-text { position: relative; margin: 0 auto; max-width: 22ch; font-family: var(--display); font-weight: 600; font-size: clamp(21px, min(6vw, 4svh), 32px); line-height: 1.25; color: #fff1dc; text-shadow: 0 0 24px rgba(255, 180, 90, 0.5); }
.wish-ov.on .wish-close { animation: fadeUp 1.2s 0.4s both; }
.wish-ov.on .wish-text { animation: fadeUp 1.4s 1s both; }
.breathe { position: absolute; left: 50%; top: 58%; width: 60vmin; height: 60vmin; margin: -30vmin 0 0 -30vmin; border-radius: 50%; background: radial-gradient(circle, rgba(255, 190, 110, 0.18), transparent 65%); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(0.75); opacity: 0.5; } 50% { transform: scale(1.1); opacity: 1; } }

/* modals */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: calc(var(--safe-t) + 16px) calc(var(--safe-r) + 16px) calc(var(--safe-b) + 16px) calc(var(--safe-l) + 16px); background: rgba(8, 4, 16, 0.55); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.25s; overflow: auto; }
.modal.on { opacity: 1; }
.sheet, .gift-card, .letter { color: var(--paper-ink); background: var(--paper); border-radius: 28px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5); }
.sheet { width: min(100%, 420px); padding: 24px 22px 22px; text-align: center; max-height: calc(100svh - 32px); overflow: auto; transform: translateY(30px) scale(0.96); transition: transform 0.4s cubic-bezier(0.2, 1.5, 0.4, 1); }
.modal.on .sheet { transform: none; }
.sheet h2 { font-size: 26px; margin-bottom: 8px; }
.sheet p { margin: 0 0 12px; font-size: 16px; }
.sheet-emoji { font-size: 44px; line-height: 1; margin-bottom: 6px; animation: puffy 1.6s ease-in-out infinite; }
@keyframes puffy { 50% { transform: translateX(6px) scale(1.08); } }
.privacy { background: rgba(0, 0, 0, 0.05); border-radius: 16px; padding: 12px 14px; font-size: 15px !important; color: var(--paper-muted); text-align: left; }
.privacy b { color: var(--paper-ink); }
.warn { color: #9a3a12; font-weight: 600; }
.col { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.sheet .btn-ghost, .gift-card .btn-ghost, .letter .btn-ghost { color: var(--paper-ink); background: rgba(0, 0, 0, 0.06); box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.14), 0 3px 0 rgba(0, 0, 0, 0.12); }

/* gift cards */
.gift-card { width: min(100%, 400px); max-height: calc(100svh - 32px); overflow: auto; padding: 18px 18px 20px; text-align: center; transform: scale(0.6) rotate(-6deg); opacity: 0; transition: transform 0.5s cubic-bezier(0.2, 1.6, 0.4, 1), opacity 0.25s; position: relative; }
.modal.on .gift-card { transform: none; opacity: 1; }
.gc-art { display: grid; place-items: center; height: 120px; border-radius: 20px; background: radial-gradient(circle at 30% 30%, var(--accent-l), var(--accent)); margin-bottom: 14px; }
.gc-emoji { font-size: 64px; line-height: 1; animation: floaty 3s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(4deg); } }
.gc-kind { margin: 0 0 4px; font-family: var(--display); font-weight: 600; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-d); }
.gc-title { font-size: 25px; margin: 0 0 10px; overflow-wrap: anywhere; }
.gc-text { margin: 0 0 12px; font-size: 17px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.gc-meta { margin: 0 0 14px; font-size: 14px; color: var(--paper-muted); }
.gc-body { position: relative; }
.kind-memory { background: #fff; padding-top: 14px; transform: scale(0.6) rotate(6deg); }
.modal.on .kind-memory { transform: rotate(-1.2deg); }
.kind-memory .gc-art { height: auto; aspect-ratio: 4 / 3; max-height: 34svh; border-radius: 4px; background: linear-gradient(160deg, var(--accent-l), var(--accent) 60%, var(--accent-d)); box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.2); }
.kind-memory .gc-emoji { font-size: 84px; }
.kind-coupon { background: #fff4d6; border: 3px dashed rgba(120, 70, 20, 0.35); }
.kind-coupon .gc-art { height: 96px; background: repeating-linear-gradient(-45deg, #ffe08a 0 10px, #ffd25a 10px 20px); }
.kind-coupon .gc-kind { color: #a35a00; }
.gc-claim { margin-bottom: 12px; }
.gc-art { position: relative; }
.stamp { position: absolute; right: 10px; bottom: 10px; padding: 4px 12px; border: 3px solid #d93a4a; color: #d93a4a; border-radius: 10px; font-family: var(--display); font-weight: 700; font-size: 22px; text-transform: uppercase; transform: rotate(-14deg); opacity: 0.9; background: rgba(255, 244, 214, 0.6); }
.stamp.thunk { animation: thunk 0.45s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes thunk { from { transform: rotate(-14deg) scale(2.4); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: 0.9; } }

/* letter */
.letter-modal { place-items: center; }
.envelope { position: absolute; left: 50%; top: 50%; width: min(300px, 78vw); aspect-ratio: 3 / 2; transform: translate(-50%, -40%) scale(0.85); opacity: 0; transition: transform 0.6s cubic-bezier(0.2, 1.4, 0.4, 1), opacity 0.4s; perspective: 800px; }
.modal.on .envelope { transform: translate(-50%, -50%); opacity: 1; }
/* Layers, back to front: back (1) · open flap (2) · letter (3) · front pocket (4) · closed flap (5) · seal (6).
   The front is ONE solid pocket with a V-shaped top, and the flap drops behind the letter halfway through its flip. */
.envelope { filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.3)); }
.env-back { position: absolute; inset: 0; border-radius: 10px; background: var(--accent-d); z-index: 1; }
.env-paper {
  position: absolute; left: 7%; right: 7%; top: 7%; bottom: 12%; border-radius: 6px; z-index: 3;
  background: repeating-linear-gradient(to bottom, transparent 0 14px, rgba(0, 0, 0, 0.07) 14px 15px) 50% 72% / 74% 46% no-repeat, var(--paper);
  transition: transform 0.8s 0.35s cubic-bezier(0.3, 1.3, 0.4, 1);
}
.env-front { position: absolute; inset: 0; border-radius: 10px; background: var(--accent); clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%); z-index: 4; }
.env-front::after { content: ''; position: absolute; inset: 0; background: rgba(255, 255, 255, 0.14); clip-path: polygon(0 100%, 50% 47%, 100% 100%); }
.env-flap {
  position: absolute; left: 0; right: 0; top: 0; height: 58%; background: var(--accent-l); clip-path: polygon(0 0, 100% 0, 50% 100%);
  border-radius: 10px 10px 0 0; transform-origin: top; z-index: 5;
  transition: transform 0.5s cubic-bezier(0.45, 0, 0.2, 1), z-index 0s linear 0.25s;
}
.env-seal { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: #d93a4a; color: #fff; display: grid; place-items: center; font-size: 22px; z-index: 6; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); transition: opacity 0.3s, transform 0.3s; }
.envelope.open .env-flap { transform: rotateX(180deg); z-index: 2; }
.envelope.open .env-seal { opacity: 0; transform: translate(-50%, -50%) scale(1.6); }
.envelope.open .env-paper { transform: translateY(-46%); }
.letter-modal.opened .envelope { opacity: 0; transform: translate(-50%, -60%) scale(1.2); pointer-events: none; }
.letter { position: relative; width: min(100%, 540px); max-height: calc(100svh - 32px - var(--safe-t) - var(--safe-b)); overflow: auto; padding: 28px 24px 24px; text-align: left; opacity: 0; transform: translateY(40px) scale(0.92); transition: transform 0.6s cubic-bezier(0.2, 1.3, 0.4, 1), opacity 0.4s; pointer-events: none; outline: none;
  background: radial-gradient(120% 60% at 100% 0%, rgba(255, 214, 230, 0.55), transparent 60%), var(--paper); overscroll-behavior: contain; }
.letter-modal.opened .letter { opacity: 1; transform: none; pointer-events: auto; }
.letter:focus-visible { box-shadow: 0 0 0 3px var(--accent), 0 30px 80px rgba(0, 0, 0, 0.5); }
.letter-hi { font-size: 27px; margin: 0 0 14px; color: var(--accent-d); }
.letter-body p { margin: 0 0 14px; font-size: 17.5px; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere; }
.letter-sign { margin: 18px 0 0; font-size: 17px; color: var(--paper-muted); }
.letter-from { margin: 0 0 22px; font-family: var(--display); font-weight: 700; font-size: 34px; color: var(--accent-d); overflow-wrap: anywhere; }
.polaroid { margin: 0 auto 18px; width: min(220px, 70%); background: #fff; padding: 10px 10px 8px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18); transform: rotate(2deg); }
.polaroid img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #eee; }
.polaroid figcaption { text-align: center; font-family: var(--display); font-weight: 500; font-size: 16px; padding-top: 6px; }
.letter .row { justify-content: flex-start; }

/* toast */
.toast { position: fixed; z-index: 60; left: 50%; top: calc(var(--safe-t) + 62px); transform: translate(-50%, -10px); max-width: min(92vw, 420px); padding: 12px 18px; border-radius: 18px; background: #fff; color: var(--paper-ink); font-weight: 600; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); opacity: 0; transition: opacity 0.25s, transform 0.25s; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.nojs { position: fixed; inset: auto 16px 16px; padding: 16px; background: #fff; color: #222; border-radius: 16px; z-index: 99; }

/* short screens (in-app browsers, landscape phones) */
@media (max-height: 700px) {
  .hero { padding-top: calc(var(--safe-t) + 50px); }
  .hero-sub { display: none; }
  .hint { font-size: 15px; margin-bottom: 8px; }
  .hint b { font-size: 17px; }
  .dock { padding-top: 10px; padding-bottom: calc(var(--safe-b) + 10px); }
  .top-chip { min-height: 64px; }
  .top-ic { width: 36px; height: 36px; }
}
@media (max-height: 480px) {
  .hero { padding-top: calc(var(--safe-t) + 8px); padding-left: 120px; padding-right: 120px; }
  .hero-kicker { display: inline; font-size: 16px; }
  .hero-name { display: inline; font-size: clamp(24px, 9svh, 40px); margin-left: 6px; }
  .hint span { display: none; }
  .hint b { display: inline; }
  .hint { margin-bottom: 6px; }
  .dock { width: min(100%, 620px); padding-top: 8px; padding-bottom: calc(var(--safe-b) + 8px); }
  .btn { min-height: 44px; font-size: 16px; }
  .meter { margin-bottom: 8px; height: 12px; }
  .tray { padding-bottom: 6px; margin-bottom: 2px; }
  .top-chip { min-height: 56px; padding-top: 3px; }
  .top-ic { width: 30px; height: 30px; }
  .gifts { --gs: 56px; margin-bottom: 6px; }
  .small-links { margin-top: 6px; }
  .cover-cake { width: 70px; }
  .cover-name { font-size: 40px; }
  .cover-line { margin-bottom: 12px; }
}
@media (min-width: 900px) {
  .dock { bottom: 18px; border-radius: 26px; padding-bottom: 16px; }
  .hero { padding-top: calc(var(--safe-t) + 40px); }
}
@media (max-height: 480px) {
  .sheet { padding: 14px 18px; }
  .sheet-emoji { display: none; }
  .sheet h2 { font-size: 21px; margin-bottom: 4px; }
  .sheet p { margin-bottom: 8px; font-size: 15px; }
  .privacy { padding: 8px 12px; }
  .col { flex-direction: row; justify-content: center; }
  .sheet .btn-big { min-height: 46px; font-size: 17px; }
  .gift-card { width: min(100%, 640px); display: grid; grid-template-columns: 170px 1fr; gap: 0 16px; text-align: left; align-items: start; padding: 14px; }
  .gift-card .gc-art, .kind-memory .gc-art { height: 100%; min-height: 140px; aspect-ratio: auto; max-height: none; margin: 0; grid-row: 1 / 3; }
  .gc-title { font-size: 21px; margin-bottom: 6px; }
  .gc-text { font-size: 16px; margin-bottom: 6px; }
  .gc-meta { margin-bottom: 8px; }
  .gift-card .row { justify-content: flex-start; }
}
