/* THE BIRTHDAY PARTY (js/scenes/party.js + js/party/): the stage shell, then each step */
.bpbar { position: absolute; inset: 0; }
.bpbar.mixing { background: #fff8fb; }
.bpbar.mixing > :not(.mixstage-wrap) { visibility: hidden; }
body.party-staged #topbar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 50;
  background: none; pointer-events: none; border-bottom: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.party-staged #topbar > * { pointer-events: auto; }
.bpbar .mixstage-wrap { transition: opacity .45s ease, transform .55s cubic-bezier(.3,1,.4,1); }
.bpbar .mixstage-wrap.entering { opacity: 0; transform: translateX(16%); }
.bpbar .mixstage-wrap.leaving { opacity: 0; transform: translateX(-16%); }

/* ---------- planning: kid, theme, age ---------- */
.bps .pt-bd { position: absolute; left: 0; top: 0; }
.bps .pt-title { position: absolute; transform: translateX(-50%); padding: 10px 30px; border-radius: 34px; background: #fff; border: 4px solid #5a2d4c; box-shadow: 0 6px 0 rgba(90,45,76,.16); font-weight: 900; font-size: 34px; color: #5a2d4c; white-space: nowrap; z-index: 3; }
.bps .pt-grid { position: absolute; display: grid; gap: 18px; grid-auto-rows: 1fr; transition: opacity .2s, translate .2s; z-index: 2; }
.bps .pt-grid.out { opacity: 0; translate: 0 24px; }
.bps .pt-pick { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 0; padding: 10px 6px 12px; border-radius: 26px; background: #fff; border: 4px solid #5a2d4c; box-shadow: 0 7px 0 rgba(90,45,76,.16); cursor: pointer; color: #5a2d4c; animation: ptIn .5s cubic-bezier(.3,1.5,.5,1) calc(var(--i, 0) * 70ms) backwards; transition: transform .35s cubic-bezier(.3,1.6,.5,1), opacity .3s; }
.bps .pt-pick:active { transform: scale(.95); }
.bps .pt-pick b { font-weight: 900; font-size: 22px; white-space: nowrap; }
.bps .pt-pick.pick { transform: scale(1.12) rotate(-2deg); z-index: 2; box-shadow: 0 0 0 6px #ffd23f, 0 10px 0 rgba(90,45,76,.18); }
.bps .pt-pick.away { opacity: .25; transform: scale(.9); }
@keyframes ptIn { from { opacity: 0; transform: translateY(40px) scale(.7); } }
.bps .pt-kid svg.puppet { width: auto; max-width: 100%; height: calc(100% - 34px); min-height: 0; flex: 1; }
.bps .pt-kid .pt-hat { position: absolute; left: 50%; top: 2%; width: 34%; translate: -50% -30%; rotate: -8deg; animation: ptHat .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes ptHat { from { translate: -50% -140%; opacity: 0; } }
.bps .pt-theme svg { width: auto; height: calc(100% - 40px); max-width: 90%; flex: 1; min-height: 0; }
.bps .pt-theme.dark b { color: #fff; }
.bps .pt-age { background: none; border: 0; box-shadow: none; padding: 0; }
.bps .pt-age svg { height: 100%; width: auto; max-width: 100%; overflow: visible; animation: ptBob 2.4s ease-in-out calc(var(--i, 0) * -.3s) infinite; }
.bps .pt-age.pick { box-shadow: none; }
@keyframes ptBob { 0%, 100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -10px; rotate: 3deg; } }

/* ---------- the room (a framed picture) ---------- */
.mxs .pt-room { position: absolute; transform-origin: 0 0; border-radius: 30px; overflow: hidden; box-shadow: 0 0 0 10px #fff, 0 0 0 14px #5a2d4c, 0 22px 0 14px rgba(90,45,76,.14); z-index: 4; }
.mxs .pt-room > div { position: absolute; left: 0; top: 0; width: 1000px; height: 640px; }
.mxs .pt-room svg { display: block; overflow: hidden; }
.mxs .pt-back svg { pointer-events: auto; }
.mxs .pt-front svg { pointer-events: none; }
.mxs .pt-front .pt-plate, .mxs .pt-front .pt-tier { pointer-events: visiblePainted; cursor: pointer; }
.mxs .pt-guests, .mxs .pt-over { pointer-events: none; }
.mxs .pt-room.placing .pt-back svg { cursor: crosshair; }
.mxs .pt-bal { cursor: pointer; }
.mxs .pt-bal.new { transform-box: fill-box; transform-origin: 50% 100%; animation: ptBal .8s cubic-bezier(.3,1.5,.5,1); }
@keyframes ptBal { from { translate: 0 160px; scale: .3; opacity: 0; } 60% { opacity: 1; } }
.mxs .pt-bulb { animation: ptTwinkle 1.4s ease-in-out calc(var(--i, 0) * -.45s) infinite; }
@keyframes ptTwinkle { 50% { opacity: .55; } }
.mxs .pt-plate.new { transform-box: fill-box; transform-origin: 50% 100%; animation: ptPop .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes ptPop { from { scale: .2; } }
.mxs .pt-wob { transform-box: fill-box; transform-origin: 50% 100%; animation: ptWob 1.6s ease-in-out infinite; }
@keyframes ptWob { 0%, 100% { scale: 1 1; } 30% { scale: 1.05 .94; } 60% { scale: .97 1.04; } }
.mxs .pt-ccake.bump { transform-box: fill-box; transform-origin: 50% 100%; animation: ptBump .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes ptBump { 0% { scale: 1.06 .9; } 60% { scale: .98 1.04; } 100% { scale: 1 1; } }
.mxs .pt-tier.sel { filter: drop-shadow(0 0 5px #ffd23f) drop-shadow(0 0 3px #fff); }
.mxs .pt-flame { transform-box: fill-box; transform-origin: 50% 90%; animation: ptFlame .32s ease-in-out infinite alternate; }
.mxs .pt-room .pt-flame { transform: skewX(calc(var(--blow, 0) * -38deg)) scaleY(calc(1 - var(--blow, 0) * .35)); }
.mxs .pt-mic { position: absolute; z-index: 24; translate: -50% 0; display: flex; align-items: center; gap: 6px; padding: 6px 16px 6px 8px; border-radius: 30px; background: #fff; border: 4px solid #5a2d4c; box-shadow: 0 6px 0 rgba(90,45,76,.18); color: #5a2d4c; pointer-events: none; opacity: 0; scale: .5; transition: opacity .3s, scale .4s cubic-bezier(.3,1.6,.5,1); }
.mxs .pt-mic.in { opacity: 1; scale: calc(1 + var(--lv, 0) * .35); transition: opacity .3s, scale .08s; }
.mxs .pt-mic svg { width: 34px; height: 34px; }
.mxs .pt-mic b { font-weight: 900; font-size: 26px; }
.mxs .pt-mic small { font-weight: 800; font-size: 15px; opacity: .7; }
@keyframes ptFlame { from { scale: .9 1.06; rotate: -3deg; } to { scale: 1.06 .94; rotate: 3deg; } }
.mxs .pt-room.dim .pt-flame { filter: drop-shadow(0 0 8px #ffd23f); }

/* ---------- the tray of choices ---------- */
.mxs .pt-tray { position: absolute; z-index: 6; display: grid; gap: 10px; padding: 14px; box-sizing: border-box; border-radius: 28px; background: #fff; border: 4px solid #5a2d4c; box-shadow: 0 8px 0 rgba(90,45,76,.16); }
.mxs .pt-tray-t { grid-column: 1 / -1; text-align: center; font-weight: 900; font-size: 24px; color: #5a2d4c; line-height: 1; padding: 2px 0 2px; }
.mxs .pt-tool { position: relative; min-height: 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px; border-radius: 18px; background: #fff7fb; border: 3px solid #f4c4d8; cursor: pointer; color: #5a2d4c; transition: transform .15s, background .2s; }
.mxs .pt-tool:active { transform: scale(.94); }
.mxs .pt-tool .pt-ico { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
.mxs .pt-tool .pt-ico svg { height: 100%; max-height: 64px; width: auto; max-width: 100%; overflow: visible; }
.mxs .pt-tool b { font-weight: 900; font-size: 15px; white-space: nowrap; line-height: 1.1; }
.mxs .pt-tool.sel { background: #ffe3ef; border-color: #ff8fb1; box-shadow: inset 0 0 0 3px #ff8fb1; }
.mxs .pt-tool.nudge { animation: ptNudge .6s ease-in-out 2; }
@keyframes ptNudge { 30% { transform: scale(1.12) rotate(-4deg); } 60% { transform: scale(1.06) rotate(3deg); } }
.mxs .pt-fly, .mxs .pt-ghost { position: absolute; z-index: 30; pointer-events: none; }
.mxs .pt-fly svg, .mxs .pt-ghost svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 4px rgba(90,45,76,.25)); }
.mxs .pt-ghost { width: 76px; height: 76px; }

/* on a phone the stage is drawn small: bigger words and pictures in the tray */
.mxs .pt-tray.phone { gap: 8px; padding: 10px; }
.mxs .pt-tray.phone .pt-tray-t { font-size: 34px; }
.mxs .pt-tray.phone .pt-tool b { font-size: 21px; }
.mxs .pt-tray.phone .pt-tool .pt-ico svg { max-height: 130px; }
.mxs[data-mode="tall"] .pt-tray.phone .pt-tool b { font-size: 30px; }

/* ---------- the guests ---------- */
.mxs .pt-guest { position: absolute; top: 418px; width: 180px; height: 216px; transform-origin: 50% 100%; pointer-events: auto; opacity: 0; translate: 0 60px; transition: opacity .3s, translate .5s cubic-bezier(.3,1.5,.5,1); }
.mxs .pt-guest.in { opacity: 1; translate: 0 0; }
.mxs .pt-guest .puppet { width: 100%; height: auto; filter: drop-shadow(0 6px 5px rgba(90,45,76,.2)); }
.mxs .pt-guest .pt-hat { position: absolute; left: 50%; top: 2px; width: 31%; translate: -50% -42%; rotate: calc((var(--i, 2) - 2) * 5deg); overflow: visible; }
.mxs .pt-guest.kid .pt-hat { width: 36%; }
.mxs .pt-guest .pt-held { position: absolute; left: 50%; bottom: -14px; width: 92px; height: 92px; translate: -50% 0; z-index: 2; }
.mxs .pt-guest .pt-held svg { width: 100%; height: 100%; overflow: visible; animation: ptPop .45s cubic-bezier(.3,1.6,.5,1); }
.mxs .pt-guest .pt-bday { z-index: 3; position: absolute; left: 50%; bottom: 2px; translate: -50% 0; padding: 2px 12px; border-radius: 12px; background: #ffd23f; border: 3px solid #5a2d4c; font-weight: 900; font-size: 17px; color: #5a2d4c; white-space: nowrap; }
.mxs .pt-guest .pt-wish { position: absolute; left: 64%; top: -64px; width: 96px; height: 96px; border-radius: 50%; background: #fff; border: 4px solid #5a2d4c; display: flex; align-items: center; justify-content: center; scale: 0; transition: scale .4s cubic-bezier(.3,1.6,.5,1); box-shadow: 0 5px 0 rgba(90,45,76,.15); }
.mxs .pt-guest .pt-wish.show { scale: 1; animation: ptThink 2s ease-in-out .4s infinite; }
@keyframes ptThink { 50% { translate: 0 -6px; } }
.mxs .pt-guest .pt-wish svg { width: 70px; height: 70px; overflow: visible; }
.mxs .pt-guest .pt-wish i { position: absolute; border-radius: 50%; background: #fff; border: 3px solid #5a2d4c; }
.mxs .pt-guest .pt-wish i:nth-child(1) { width: 20px; height: 20px; left: -6px; bottom: -14px; }
.mxs .pt-guest .pt-wish i:nth-child(2) { width: 11px; height: 11px; left: -18px; bottom: -28px; }
.mxs .pt-guest .pt-gsay { position: absolute; left: 50%; bottom: calc(100% + 34px); translate: -50% 0; width: max-content; max-width: 230px; padding: 8px 16px; border-radius: 20px; background: #fff; border: 4px solid #5a2d4c; font-weight: 900; font-size: 22px; color: #5a2d4c; text-align: center; opacity: 0; scale: .5; transition: opacity .2s, scale .35s cubic-bezier(.3,1.6,.5,1); z-index: 3; }
.mxs .pt-guest .pt-gsay.show { opacity: 1; scale: 1; }
.mxs .pt-guest:first-child .pt-gsay { translate: -30% 0; }
.mxs .pt-guest:last-child .pt-gsay { translate: -70% 0; }
.mxs .pt-guest.eating .puppet .pp-mouth > *, .mxs .pt-guest.singing .puppet .pp-mouth > * { display: none; }
.mxs .pt-guest.eating .puppet .m-open { display: block; transform-box: fill-box; transform-origin: 50% 0; animation: ppTalk .26s ease-in-out infinite alternate; }
.mxs .pt-guest.singing .puppet .m-open { display: block; transform-box: fill-box; transform-origin: 50% 0; animation: ppTalk .4s ease-in-out infinite alternate; }
.mxs .pt-guest.singing { animation: ptSway 1.6s ease-in-out calc(var(--i, 0) * -.3s) infinite; }
@keyframes ptSway { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
.mxs .pt-guest.jump { animation: ptJump .55s cubic-bezier(.3,1.4,.5,1) 3; }
@keyframes ptJump { 40% { translate: 0 -46px; } }
.mxs .pt-guest.blow { animation: ptBlow .5s ease-out; }
@keyframes ptBlow { 30% { scale: 1.06 .96; } }
.mxs .pt-heart { position: absolute; width: 30px; height: 30px; z-index: 20; pointer-events: none; animation: ptHeart 1.3s ease-out forwards; }
@keyframes ptHeart { from { translate: 0 0; scale: .4; opacity: 0; } 20% { opacity: 1; scale: 1.1; } to { translate: 0 -110px; opacity: 0; } }

/* ---------- party time ---------- */
.mxs .pt-dark { position: absolute; inset: 0; background: radial-gradient(circle at 50% 44%, rgba(30,15,55,0) 0, rgba(30,15,55,0) 120px, rgba(30,15,55,.66) 340px); opacity: 0; transition: opacity 1.1s; }
.mxs .pt-dark.on { opacity: 1; }
.mxs .pt-sing { position: absolute; left: 512px; top: 104px; translate: -50% 0; z-index: 25; pointer-events: none; opacity: 0; }
.mxs .pt-sing.show { animation: ptSing .5s cubic-bezier(.3,1.6,.5,1) forwards; }
.mxs .pt-sing span { display: block; padding: 10px 30px; border-radius: 36px; background: #fff; border: 4px solid #5a2d4c; box-shadow: 0 7px 0 rgba(90,45,76,.18); font-weight: 900; font-size: 38px; color: #ff5f8f; white-space: nowrap; }
@keyframes ptSing { from { opacity: 0; scale: .5; } to { opacity: 1; scale: 1; } }
.mxs .pt-note { position: absolute; width: 38px; height: 46px; z-index: 22; pointer-events: none; opacity: 0; animation: ptNote 2s ease-out forwards; }
.mxs .pt-note svg { width: 100%; height: 100%; overflow: visible; }
@keyframes ptNote { 15% { opacity: 1; } to { translate: 30px -150px; rotate: 20deg; opacity: 0; } }
.mxs .pt-puff { position: absolute; z-index: 22; pointer-events: none; animation: ptPuff .7s ease-out forwards; }
.mxs .pt-puff svg { width: 100%; height: 100%; overflow: visible; }
@keyframes ptPuff { from { opacity: 0; scale: .5; translate: -20px 20px; } 30% { opacity: 1; } to { opacity: 0; scale: 1.2; translate: 20px -40px; } }
.mxs .pt-smoke { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: rgba(230,225,240,.85); z-index: 22; pointer-events: none; animation: ptSmoke 1.3s ease-out forwards; }
@keyframes ptSmoke { from { opacity: .9; scale: .5; } to { opacity: 0; scale: 2.4; translate: 10px -110px; } }
.mxs .pt-conf { position: absolute; width: 14px; height: 9px; border-radius: 2px; z-index: 40; pointer-events: none; animation: ptConf 3s linear forwards; }
@keyframes ptConf { from { translate: 0 0; rotate: 0deg; } to { translate: var(--dx, 0) 1100px; rotate: var(--r, 360deg); } }
.mxs .pt-veil { position: absolute; left: -1200px; top: -1200px; width: 3400px; height: 3200px; background: rgba(255,240,248,.55); opacity: 0; pointer-events: none; transition: opacity .5s; z-index: 18; }
.mxs .pt-veil.on { opacity: 1; }
.mxs .pt-gift { position: absolute; z-index: 19; opacity: 0; pointer-events: none; cursor: pointer; }
.mxs .pt-gift svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 10px 8px rgba(90,45,76,.25)); }
.mxs .pt-gift.in { opacity: 1; pointer-events: auto; animation: ptGift .7s cubic-bezier(.3,1.5,.5,1); }
.mxs .pt-gift.in:not(.open) svg { animation: ptShake 1.6s ease-in-out .8s infinite; }
@keyframes ptShake { 0%, 70%, 100% { rotate: 0deg; } 75% { rotate: -6deg; } 85% { rotate: 6deg; } 95% { rotate: -3deg; } }
@keyframes ptGift { from { translate: 0 -300px; } 70% { translate: 0 10px; } }
.mxs .pt-gift .pt-lid { transition: transform .6s cubic-bezier(.3,1.4,.5,1); }
.mxs .pt-gift .pt-toy { transform-box: fill-box; transform-origin: 50% 100%; animation: ptToy .7s cubic-bezier(.3,1.6,.5,1); }
@keyframes ptToy { from { scale: .2; translate: 0 60px; } }

/* ---------- the party card ---------- */
.bpn .bp-loved { font-weight: 900; font-size: 16px; color: #ff5f8f; }
.bpn .pt-room.photo { rotate: -1.5deg; }
.bpn .sdn-ribbon { transform-origin: 0 0; }
