/* Sound Buddies. Every class is prefixed sb- so nothing collides with the site nav. */
:root {
  --ink: #3b2c52; --cream: #fff8ec; --sky: #7fd0ff; --pink: #ff8cc6; --teal: #2fcfbf; --yellow: #ffd23f; --purple: #9b7bff;
  --nav: 0px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --round: "Fredoka", "Nunito", system-ui, sans-serif; --text: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: #bfe8ff; }
body { font-family: var(--text); color: var(--ink); -webkit-tap-highlight-color: transparent; }
random-express-nav { position: relative; z-index: 3000; }
body.sb-in-game random-express-nav, body.sb-pc-open random-express-nav { display: none; }
.sb-overlay[hidden], .sb-loading[hidden] { display: none !important; }
.sb-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sb-noscript { position: fixed; inset: 40% 10% auto; text-align: center; font: 700 22px var(--round); }

.sb-app { position: fixed; inset: 0; overflow: hidden; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sb-app.sb-playing { touch-action: none; }
.sb-scene, .sb-screen, .sb-fx { position: absolute; inset: 0; }
.sb-scene-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sb-fx { pointer-events: none; z-index: 40; width: 100%; height: 100%; }
.sb-screen { z-index: 2; }
.sb-defs { pointer-events: none; }
.sb-loading { position: absolute; inset: 0; display: grid; place-items: center; background: #bfe8ff; z-index: 100; transition: opacity .3s; }
.sb-loading.sb-done { opacity: 0; pointer-events: none; }
.sb-loading-dot { width: 46px; height: 46px; border-radius: 50%; background: var(--yellow); border: 5px solid var(--ink); animation: sb-bounce .7s ease-in-out infinite alternate; }
@keyframes sb-bounce { to { transform: translateY(-24px) scale(1.06, .94); } }

/* Scene transitions */
.sb-screen.sb-enter { animation: sb-screen-in .45s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes sb-screen-in { from { opacity: 0; transform: scale(1.04); } }
.sb-wipe { position: absolute; inset: 0; z-index: 60; pointer-events: none; background: radial-gradient(circle at var(--wx, 50%) var(--wy, 50%), transparent 0, transparent var(--wr, 0%), #fff8ec calc(var(--wr, 0%) + .5%)); }

/* SVG rig defaults */
.sb-obj, .sb-buddy { display: block; overflow: visible; }
.sb-obj *, .sb-buddy * { transform-box: view-box; }

/* Buddy mouths and life */
.sb-buddy .sb-b-mouth > g { display: none; }
.sb-buddy[data-mouth="smile"] .m-smile, .sb-buddy[data-mouth="grin"] .m-grin, .sb-buddy[data-mouth="open"] .m-open,
.sb-buddy[data-mouth="o"] .m-o, .sb-buddy[data-mouth="ee"] .m-ee { display: inline; }
.sb-buddy .sb-b-eyes { animation: sb-blink 5.2s infinite; animation-delay: var(--blink, 0s); }
@keyframes sb-blink { 0%, 94%, 100% { transform: scaleY(1); } 96.5% { transform: scaleY(.08); } }
.sb-buddy .sb-b-all { animation: sb-breathe 3.4s ease-in-out infinite; }
@keyframes sb-breathe { 50% { transform: scale(1.025, .975); } }
.sb-buddy .sb-b-ear-l { animation: sb-ear 4.4s ease-in-out infinite; } .sb-buddy .sb-b-ear-r { animation: sb-ear 4.4s ease-in-out infinite reverse; }
@keyframes sb-ear { 0%, 80%, 100% { transform: rotate(0); } 86% { transform: rotate(-9deg); } 92% { transform: rotate(5deg); } }
.sb-buddy .sb-b-wing-l, .sb-buddy .sb-b-wing-r { animation: sb-wing 2.6s ease-in-out infinite; }
.sb-buddy .sb-b-wing-r { animation-name: sb-wing-r; }
@keyframes sb-wing { 50% { transform: rotate(14deg); } } @keyframes sb-wing-r { 50% { transform: rotate(-14deg); } }
.sb-buddy .sb-b-tail { animation: sb-tail 2.2s ease-in-out infinite; } @keyframes sb-tail { 50% { transform: rotate(-12deg); } }
.sb-buddy .sb-b-antenna { animation: sb-antenna 2.8s ease-in-out infinite; } @keyframes sb-antenna { 30% { transform: rotate(-10deg); } 70% { transform: rotate(8deg); } }
.sb-buddy .sb-b-pupil { transition: transform .25s; }

/* Buddy actions (class set briefly by JS) */
.sb-buddy.sb-a-cheer .sb-b-all { animation: sb-cheer .9s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes sb-cheer { 0% { transform: scale(1.08,.9); } 30% { transform: translateY(-46px) scale(.94,1.08); } 60% { transform: translateY(0) scale(1.1,.9); } 80% { transform: translateY(-10px); } 100% { transform: none; } }
.sb-buddy.sb-a-cheer .sb-b-arm-l { animation: sb-arm-up-l .9s ease both; } .sb-buddy.sb-a-cheer .sb-b-arm-r { animation: sb-arm-up-r .9s ease both; }
@keyframes sb-arm-up-l { 25%, 75% { transform: rotate(120deg); } } @keyframes sb-arm-up-r { 25%, 75% { transform: rotate(-120deg); } }
.sb-buddy.sb-a-wave .sb-b-arm-r { animation: sb-wave 1.3s ease-in-out both; }
@keyframes sb-wave { 15% { transform: rotate(-130deg); } 30% { transform: rotate(-105deg); } 45% { transform: rotate(-135deg); } 60% { transform: rotate(-105deg); } 75% { transform: rotate(-130deg); } 100% { transform: rotate(0); } }
.sb-buddy.sb-a-wiggle .sb-b-all { animation: sb-wiggle .7s ease-in-out both; }
@keyframes sb-wiggle { 20% { transform: rotate(-7deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-4deg); } 80% { transform: rotate(2deg); } }
.sb-buddy.sb-a-dance .sb-b-all { animation: sb-dance 1.6s ease-in-out both; }
.sb-buddy.sb-a-dance .sb-b-arm-l { animation: sb-arm-up-l .8s ease 2 both; } .sb-buddy.sb-a-dance .sb-b-arm-r { animation: sb-arm-up-r .8s ease .4s 2 both; }
@keyframes sb-dance { 12% { transform: translateX(-14px) rotate(-8deg); } 25% { transform: translateY(-18px); } 37% { transform: translateX(14px) rotate(8deg); } 50% { transform: translateY(-18px); } 62% { transform: translateX(-14px) rotate(-8deg); } 75% { transform: translateY(-18px); } 87% { transform: translateX(14px) rotate(8deg); } }
.sb-buddy.sb-a-spin .sb-b-all { animation: sb-spin 1s cubic-bezier(.5,0,.3,1) both; }
@keyframes sb-spin { 20% { transform: scale(1.1,.9); } 60% { transform: translateY(-40px) rotateY(360deg); } 100% { transform: none; } }
.sb-buddy.sb-a-startle .sb-b-all { animation: sb-startle .6s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes sb-startle { 25% { transform: translateY(-26px) scale(.95,1.08); } 60% { transform: translateY(0) scale(1.06,.95); } }
.sb-buddy.sb-a-listen .sb-b-arm-r { animation: sb-listen 1.8s ease-in-out both; }
@keyframes sb-listen { 20%, 80% { transform: rotate(-150deg); } }
.sb-buddy.sb-a-listen .sb-b-all { animation: sb-tilt 1.8s ease-in-out both; } @keyframes sb-tilt { 20%, 80% { transform: rotate(-6deg); } }
.sb-buddy.sb-a-sip .sb-b-arm-r { animation: sb-sip 1.6s ease-in-out both; } @keyframes sb-sip { 25%, 75% { transform: rotate(-95deg); } }

/* Picture-word idle and "alive" reactions */
.sb-obj .sb-p-tail { animation: sb-swish 2.4s ease-in-out infinite; } @keyframes sb-swish { 50% { transform: rotate(-12deg); } }
.sb-obj .sb-p-eyes { animation: sb-blink 4.6s infinite; animation-delay: var(--blink, .8s); }
.sb-obj .sb-p-flame { animation: sb-flicker .5s ease-in-out infinite alternate; } @keyframes sb-flicker { to { transform: scale(.9, 1.1) rotate(4deg); } }
.sb-obj .sb-p-steam { animation: sb-steam 2.2s ease-in-out infinite; } @keyframes sb-steam { 50% { transform: translateY(-6px); opacity: .55; } }
.sb-obj .sb-p-waves { animation: sb-waves 2.6s ease-in-out infinite; } @keyframes sb-waves { 50% { transform: translateX(-6px); } }
.sb-obj .sb-p-boat, .sb-obj .sb-p-fin { animation: sb-rock 3s ease-in-out infinite; } @keyframes sb-rock { 50% { transform: rotate(4deg) translateY(2px); } }
.sb-obj .sb-p-star1, .sb-obj .sb-p-star2 { animation: sb-twinkle 1.8s ease-in-out infinite; } .sb-obj .sb-p-star2 { animation-delay: .9s; }
@keyframes sb-twinkle { 50% { transform: scale(.7) rotate(20deg); opacity: .6; } }
.sb-obj .sb-p-wing { animation: sb-wingflap 2.8s ease-in-out infinite; } @keyframes sb-wingflap { 0%, 80%, 100% { transform: none; } 86% { transform: rotate(-16deg); } 93% { transform: rotate(8deg); } }
.sb-obj[data-art="bee"] .sb-p-wing { animation: sb-buzz .12s linear infinite alternate; } @keyframes sb-buzz { to { transform: scaleY(.82); } }
.sb-obj[data-art="bee"] .sb-p-fly { animation: sb-hover 1.6s ease-in-out infinite; } @keyframes sb-hover { 50% { transform: translateY(-6px); } }
.sb-obj[data-art="fish"] .sb-p-tail { animation: sb-fishtail 1s ease-in-out infinite; } @keyframes sb-fishtail { 50% { transform: scaleX(.8) rotate(6deg); } }

.sb-obj.sb-alive { animation: sb-alive-hop .9s cubic-bezier(.3,1.5,.5,1) both; transform-origin: 50% 92%; }
@keyframes sb-alive-hop { 0% { transform: scale(1); } 15% { transform: scale(1.12,.86); } 45% { transform: translateY(-14%) scale(.94,1.08); } 70% { transform: scale(1.06,.95); } 100% { transform: none; } }
.sb-obj.sb-alive .sb-p-eyes { animation: none; }
.sb-obj.sb-alive .sb-p-tail { animation: sb-swish .3s ease-in-out 4; }
.sb-obj.sb-alive .sb-p-head { animation: sb-headtilt 1.2s ease-in-out both; } @keyframes sb-headtilt { 30%, 60% { transform: rotate(-10deg); } 80% { transform: rotate(6deg); } }
.sb-obj.sb-alive .sb-p-earL { animation: sb-flopl .3s ease-in-out 4 alternate; } .sb-obj.sb-alive .sb-p-earR { animation: sb-flopr .3s ease-in-out 4 alternate; }
@keyframes sb-flopl { to { transform: rotate(18deg); } } @keyframes sb-flopr { to { transform: rotate(-18deg); } }
.sb-obj.sb-alive .sb-p-tongue { animation: sb-lick .6s ease-in-out 2; } @keyframes sb-lick { 50% { transform: scaleY(1.5); } }
.sb-obj[data-art="chick"].sb-alive { animation: none; }
.sb-obj[data-art="chick"].sb-alive .sb-p-body { animation: sb-chick 1.6s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes sb-chick { 10% { transform: translateY(6px) scale(1.06,.9); } 30% { transform: translateY(-34px); } 45% { transform: translateY(-10px) rotate(-8deg); } 60% { transform: translateY(-30px) rotate(6deg); } 80% { transform: translateY(-4px); } 100% { transform: none; } }
.sb-obj[data-art="chick"].sb-alive .sb-p-wing { animation: sb-flapl .14s linear 8 alternate; } .sb-obj[data-art="chick"].sb-alive .sb-p-wing2 { animation: sb-flapr .14s linear 8 alternate; }
@keyframes sb-flapl { to { transform: rotate(40deg); } } @keyframes sb-flapr { to { transform: rotate(-40deg); } }
.sb-obj[data-art="chick"].sb-alive .sb-p-egg { animation: sb-eggshake .5s ease-in-out both; } @keyframes sb-eggshake { 20% { transform: rotate(-6deg); } 40% { transform: rotate(6deg); } 60% { transform: rotate(-3deg); } }
.sb-obj[data-art="kick"].sb-alive { animation: none; }
.sb-obj[data-art="kick"].sb-alive .sb-p-leg { animation: sb-kickleg .9s cubic-bezier(.4,0,.2,1.4) both; } @keyframes sb-kickleg { 25% { transform: rotate(30deg); } 45% { transform: rotate(-55deg); } 100% { transform: none; } }
.sb-obj[data-art="kick"].sb-alive .sb-p-ball { animation: sb-kickball 1.6s cubic-bezier(.2,.7,.4,1) .3s both; } @keyframes sb-kickball { 40% { transform: translate(30px, -120px) rotate(300deg); } 70% { transform: translate(10px, -30px) rotate(500deg); } 85% { transform: translate(4px, -14px) rotate(560deg); } 100% { transform: rotate(720deg); } }
.sb-obj[data-art="fan"].sb-alive .sb-p-blades, .sb-obj .sb-p-blades.sb-spin { animation: sb-rotate .25s linear 10; } @keyframes sb-rotate { to { transform: rotate(360deg); } }
.sb-obj[data-art="fan"].sb-alive { animation: sb-shake .2s linear 6; } @keyframes sb-shake { 50% { transform: translateX(2px); } }
.sb-obj[data-art="sun"].sb-alive .sb-p-rays { animation: sb-rotate 1.6s cubic-bezier(.3,0,.3,1) both; }
.sb-obj[data-art="car"].sb-alive, .sb-obj[data-art="wagon"].sb-alive { animation: sb-drive 1.6s cubic-bezier(.5,0,.5,1) both; } @keyframes sb-drive { 40% { transform: translateX(-12%); } 70% { transform: translateX(14%); } }
.sb-obj.sb-alive .sb-p-wheel1, .sb-obj.sb-alive .sb-p-wheel2 { animation: sb-rotate .4s linear 4; }
.sb-obj[data-art="ball"].sb-alive { animation: sb-ballbounce 1.3s cubic-bezier(.3,0,.5,1) both; } @keyframes sb-ballbounce { 25% { transform: translateY(-30%); } 50% { transform: translateY(0) scale(1.1,.9); } 70% { transform: translateY(-12%); } 85% { transform: scale(1.05,.95); } }
.sb-obj[data-art="ball"].sb-alive .sb-p-ball { animation: sb-rotate 1.3s linear both; }
.sb-obj[data-art="fish"].sb-alive .sb-p-swim { animation: sb-swim 1.4s ease-in-out both; } @keyframes sb-swim { 30% { transform: translateX(-16px) rotate(-8deg); } 60% { transform: translateX(18px) rotate(6deg); } }
.sb-obj[data-art="fish"].sb-alive .sb-p-bubbles { animation: sb-bubbleup 1.4s ease-out both; } @keyframes sb-bubbleup { to { transform: translateY(-40px); opacity: 0; } }
.sb-obj[data-art="frog"].sb-alive { animation: sb-frogjump 1.1s cubic-bezier(.3,1.3,.5,1) both; } @keyframes sb-frogjump { 15% { transform: scale(1.15,.82); } 45% { transform: translateY(-26%) scale(.9,1.12); } 75% { transform: scale(1.08,.92); } }
.sb-obj[data-art="frog"].sb-alive .sb-p-tongue path { animation: sb-tongue .8s ease .4s both; } @keyframes sb-tongue { 30%, 70% { opacity: 1; } }
.sb-obj[data-art="cake"].sb-alive .sb-p-flame { animation: sb-flame-out 1.4s ease both; } @keyframes sb-flame-out { 30% { transform: scale(.4) translateX(8px); opacity: .4; } 60% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.sb-obj[data-art="gift"].sb-alive .sb-p-lid { animation: sb-lid 1.4s cubic-bezier(.3,1.3,.5,1) both; } @keyframes sb-lid { 20% { transform: rotate(-4deg); } 45% { transform: translateY(-40px) rotate(-18deg); } 100% { transform: none; } }
.sb-obj[data-art="pin"].sb-alive .sb-p-pin { animation: sb-pinfall 1.4s cubic-bezier(.5,0,.5,1.3) both; transform-origin: 124px 186px; } @keyframes sb-pinfall { 30% { transform: rotate(-14deg); } 55% { transform: rotate(10deg); } 75% { transform: rotate(-5deg); } }
.sb-obj[data-art="fin"].sb-alive .sb-p-fin { animation: sb-fin 1.5s ease-in-out both; } @keyframes sb-fin { 40% { transform: translateX(-30px) translateY(-6px); } 80% { transform: translateX(26px); } }
.sb-obj[data-art="keys"].sb-alive .sb-p-keys { animation: sb-jingle .16s ease-in-out 8 alternate; transform-origin: 100px 30px; } @keyframes sb-jingle { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
.sb-obj[data-art="chain"].sb-alive .sb-p-chain { animation: sb-chain .9s ease-in-out both; } @keyframes sb-chain { 25% { transform: translateY(-10px) rotate(-4deg); } 50% { transform: translateY(4px) rotate(3deg); } 75% { transform: translateY(-4px); } }
.sb-obj[data-art="cane"].sb-alive .sb-p-cane { animation: sb-cane 1.2s ease-in-out both; } @keyframes sb-cane { 20% { transform: rotate(-12deg); } 45% { transform: rotate(10deg) translateY(-8px); } 70% { transform: rotate(-6deg); } }
.sb-obj[data-art="pan"].sb-alive .sb-p-pan { animation: sb-flip 1.2s cubic-bezier(.3,1.3,.5,1) both; } @keyframes sb-flip { 35% { transform: translateY(-30px) rotate(-14deg); } 70% { transform: rotate(6deg); } }
.sb-obj[data-art="pig"].sb-alive .sb-p-snout { animation: sb-snort .22s ease-in-out 4 alternate; } @keyframes sb-snort { to { transform: scale(1.18, .9); } }
.sb-obj[data-art="pig"].sb-alive .sb-p-ears, .sb-obj[data-art="goat"].sb-alive .sb-p-ears { animation: sb-earflap .2s ease-in-out 6 alternate; } @keyframes sb-earflap { to { transform: scaleY(.85) translateY(4px); } }
.sb-obj[data-art="goat"].sb-alive .sb-p-beard { animation: sb-beard .2s ease-in-out 6 alternate; } @keyframes sb-beard { to { transform: rotate(10deg); } }
.sb-obj[data-art="lion"].sb-alive .sb-p-mane { animation: sb-mane 1s ease-in-out both; } @keyframes sb-mane { 30% { transform: scale(1.14) rotate(8deg); } 60% { transform: scale(1.08) rotate(-6deg); } }
.sb-obj[data-art="leaf"].sb-alive .sb-p-leaf, .sb-obj[data-art="feather"].sb-alive .sb-p-feather { animation: sb-float 1.8s ease-in-out both; } @keyframes sb-float { 25% { transform: translate(-14px, -20px) rotate(-14deg); } 55% { transform: translate(14px, -10px) rotate(12deg); } 80% { transform: translate(-6px, -4px) rotate(-5deg); } }
.sb-obj[data-art="cocoa"].sb-alive .sb-p-steam { animation: sb-steam .5s ease-in-out 4; }
.sb-obj[data-art="popcorn"].sb-alive .sb-p-corn { animation: sb-corn .25s ease-in-out 5 alternate; } @keyframes sb-corn { to { transform: translateY(-14px); } }
.sb-obj[data-art="lollipop"].sb-alive .sb-p-candy { animation: sb-rotate 1s cubic-bezier(.3,0,.3,1) both; }
.sb-obj[data-art="window"].sb-alive .sb-p-curtainL { animation: sb-curtl 1.4s ease both; } .sb-obj[data-art="window"].sb-alive .sb-p-curtainR { animation: sb-curtr 1.4s ease both; }
@keyframes sb-curtl { 40%, 70% { transform: scaleX(.45); } } @keyframes sb-curtr { 40%, 70% { transform: scaleX(.45); } }
.sb-obj[data-art="moon"].sb-alive .sb-p-body { animation: sb-moon 1.4s ease-in-out both; } @keyframes sb-moon { 40% { transform: rotate(-16deg); } 75% { transform: rotate(8deg); } }
.sb-obj[data-art="mystery"].sb-alive .sb-p-box { animation: sb-wiggle .7s ease-in-out both; }

/* Shared child controls */
.sb-btn { appearance: none; border: 0; padding: 0; background: none; cursor: pointer; color: inherit; font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.sb-btn:focus-visible, .sb-card:focus-visible, .sb-portal:focus-visible { outline: 5px solid #fff; outline-offset: 4px; box-shadow: 0 0 0 10px var(--ink); }
.sb-round { position: absolute; z-index: 30; width: clamp(64px, 11vmin, 92px); height: clamp(64px, 11vmin, 92px); border-radius: 50%; background: radial-gradient(circle at 35% 28%, #fff 0, #fff7e0 40%, #ffd98a 100%); border: 5px solid var(--ink); box-shadow: 0 6px 0 rgba(59,44,82,.35); display: grid; place-items: center; transition: transform .12s; }
.sb-round svg { width: 58%; height: 58%; }
.sb-round:active, .sb-round.sb-press { transform: translateY(4px) scale(.94); box-shadow: 0 2px 0 rgba(59,44,82,.35); }
.sb-home { left: calc(14px + env(safe-area-inset-left, 0px)); top: calc(14px + var(--safe-t)); }
.sb-replay { background: radial-gradient(circle at 35% 28%, #fff 0, #dff6ff 40%, #7fd0ff 100%); }
.sb-replay.sb-hint { animation: sb-pulse 1.4s ease-in-out 3; }
@keyframes sb-pulse { 50% { transform: scale(1.12); box-shadow: 0 6px 0 rgba(59,44,82,.35), 0 0 0 14px rgba(255,255,255,.55); } }

/* Park */
.sb-park { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; }
.sb-logo { justify-self: center; margin-top: calc(10px + var(--safe-t)); font: 700 clamp(32px, 5vmin, 48px)/1 var(--round); letter-spacing: .01em; display: flex; gap: .02em; filter: drop-shadow(0 5px 0 rgba(59,44,82,.25)); pointer-events: none; }
.sb-logo span { color: var(--c); -webkit-text-stroke: .11em var(--ink); paint-order: stroke fill; display: inline-block; animation: sb-letter 3.6s ease-in-out infinite; animation-delay: calc(var(--i) * .12s); }
.sb-logo .sb-gap { width: .3em; }
@keyframes sb-letter { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-.12em) rotate(-4deg); } 90% { transform: translateY(.02em); } }
.sb-portals { display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 3vw, 44px); padding: 0 clamp(12px, 3vw, 48px) calc(clamp(18px, 5vh, 56px) + var(--safe-b)); min-height: 0; }
.sb-portal { position: relative; width: min(30vw, 54vh, 360px); aspect-ratio: 0.82; border-radius: 48% 48% 26px 26px / 38% 38% 26px 26px; border: 6px solid var(--ink); background: var(--bg); box-shadow: inset 0 -18px 0 rgba(0,0,0,.08), 0 10px 0 rgba(59,44,82,.28); overflow: visible; transition: transform .15s cubic-bezier(.3,1.5,.5,1); }
.sb-portal::before { content: ""; position: absolute; inset: 9% 9% 0; border-radius: 48% 48% 0 0 / 36% 36% 0 0; background: var(--inner); border: 5px solid rgba(59,44,82,.85); border-bottom: 0; }
.sb-portal:active { transform: scale(.96); }
.sb-portal .sb-buddy { position: absolute; left: 6%; right: 6%; bottom: 3%; width: 88%; height: auto; }
.sb-portal .sb-deco { position: absolute; width: 30%; animation: sb-deco 3s ease-in-out infinite; }
.sb-portal .sb-deco:nth-of-type(2) { animation-delay: -1.5s; }
@keyframes sb-deco { 50% { transform: translateY(-10px) rotate(6deg); } }
.sb-portal .sb-plate { position: absolute; left: 50%; bottom: -26px; transform: translateX(-50%); white-space: nowrap; background: #fff; border: 4px solid var(--ink); border-radius: 999px; padding: 4px 16px; font: 700 clamp(14px, 2.3vmin, 20px) var(--round); box-shadow: 0 4px 0 rgba(59,44,82,.25); }
.sb-portal[data-game="detective"] { --bg: linear-gradient(#7fd06a, #4aa94a); --inner: radial-gradient(circle at 50% 30%, #fff7c2, #bdf0b0 60%, #8fd67a); }
.sb-portal[data-game="party"] { --bg: repeating-linear-gradient(90deg, #ff8cc6 0 34px, #ffb3d8 34px 68px); --inner: radial-gradient(circle at 50% 30%, #fff, #ffe1f0 60%, #ffc2df); }
.sb-portal[data-game="echo"] { --bg: linear-gradient(#9b7bff, #6a54d0); --inner: radial-gradient(circle at 50% 30%, #e6fbff, #b9b0ff 60%, #7f6fd0); }
.sb-parent-btn { position: absolute; z-index: 30; right: calc(12px + env(safe-area-inset-right, 0px)); top: calc(12px + var(--safe-t)); width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,.75); border: 3px solid rgba(59,44,82,.55); display: grid; place-items: center; }
.sb-parent-btn svg.ic { width: 26px; height: 26px; }
.sb-parent-btn .ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; }
.sb-parent-btn .ring circle { fill: none; stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 189; stroke-dashoffset: 189; }
.sb-parent-btn.sb-holding .ring circle { transition: stroke-dashoffset 1.6s linear; stroke-dashoffset: 0; }
.sb-parent-tip { position: absolute; right: 70px; top: 50%; transform: translateY(-50%); white-space: nowrap; background: #fff; border: 3px solid var(--ink); border-radius: 12px; padding: 4px 10px; font: 700 14px var(--text); opacity: 0; transition: opacity .2s; pointer-events: none; }
.sb-parent-btn.sb-holding .sb-parent-tip, .sb-parent-btn.sb-tip .sb-parent-tip { opacity: 1; }
.sb-park-sun { position: absolute; right: 8%; top: 6%; width: 13vmin; height: 13vmin; z-index: 1; }
.sb-park-sun .sb-obj { width: 100%; height: 100%; }
.sb-butterfly { animation: sb-fly 14s ease-in-out infinite; } .sb-butterfly .wing { animation: sb-flutter .25s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes sb-fly { 25% { transform: translate(560px, -120px); } 50% { transform: translate(900px, 40px); } 75% { transform: translate(300px, -60px); } 100% { transform: translate(420px, 380px) translate(-420px, -380px); } }
@keyframes sb-flutter { to { transform: scaleX(.4); } }
.sb-cloud { animation: sb-cloud 40s linear infinite alternate; } .sb-cloud.c2 { animation-duration: 55s; } .sb-cloud.c3 { animation-duration: 47s; animation-direction: alternate-reverse; }
@keyframes sb-cloud { to { transform: translateX(120px); } }
.sb-scene-art .sb-cloud { transform-box: fill-box; }
.sb-fireflies .ff { animation: sb-ff 3s ease-in-out infinite; } .ff1 { animation-delay: -.8s !important; } .ff2 { animation-delay: -1.6s !important; } .ff3 { animation-delay: -2.3s !important; }
@keyframes sb-ff { 50% { opacity: .2; transform: translate(10px, -14px); } }
.sb-star { animation: sb-ff 2.4s ease-in-out infinite; } .sb-star.s1 { animation-delay: -1s; } .sb-star.s2 { animation-delay: -1.8s; }
.sb-flag { animation: sb-flag 2.2s ease-in-out infinite; } .sb-flag:nth-child(odd) { animation-delay: -1.1s; }
@keyframes sb-flag { 50% { transform: rotate(5deg); } }
.sb-scene.sb-windy .sb-flag { animation: sb-flag .3s ease-in-out 8; }

/* Detective */
.sb-det { position: absolute; inset: 0; }
.sb-det-bo { position: absolute; left: 2%; bottom: 2%; width: min(25vw, 36vh); z-index: 5; }
.sb-det-bo .sb-buddy { width: 100%; height: auto; }
.sb-det-replay { left: calc(2% + min(25vw, 36vh) * .62); bottom: calc(2% + min(25vw, 36vh) * 1.02); }
.sb-cards { position: absolute; left: min(24vw, 34vh); right: 3%; top: 12%; bottom: 6%; display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3.4vw, 48px); }
.sb-card { position: relative; flex: 0 1 auto; width: min(34vw, 62vh, 400px); aspect-ratio: 1; border-radius: 34px; background: radial-gradient(circle at 50% 40%, #fffdf3 0, #fff4d6 60%, #ffe6a8 100%); border: 6px solid var(--ink); box-shadow: 0 10px 0 rgba(59,44,82,.3), inset 0 -10px 0 rgba(214,160,60,.25); display: grid; place-items: center; cursor: pointer; transition: transform .18s cubic-bezier(.3,1.5,.5,1), opacity .3s, filter .3s; }
.sb-cards.sb-three .sb-card { width: min(25vw, 50vh, 320px); }
.sb-card .sb-obj { width: 84%; height: 84%; }
.sb-card::after { content: ""; position: absolute; inset: -6px; border-radius: 34px; pointer-events: none; }
.sb-card:active { transform: scale(.95); }
.sb-card.sb-in { animation: sb-card-in .6s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--d, 0s); }
@keyframes sb-card-in { from { transform: translateY(40%) scale(.3) rotate(-8deg); opacity: 0; } }
.sb-card.sb-in-peek { animation: sb-card-peek .8s cubic-bezier(.3,1.4,.5,1) both; animation-delay: var(--d, 0s); }
@keyframes sb-card-peek { 0% { transform: translateY(70%) scaleY(.2); opacity: 0; } 50% { transform: translateY(-6%) scaleY(1.08); opacity: 1; } }
.sb-card.sb-in-spin { animation: sb-card-spin .7s cubic-bezier(.3,1.3,.5,1) both; animation-delay: var(--d, 0s); }
@keyframes sb-card-spin { from { transform: rotateY(90deg) scale(.6); opacity: 0; } }
.sb-card.sb-out { animation: sb-card-out .45s ease-in both; animation-delay: var(--d, 0s); pointer-events: none; }
@keyframes sb-card-out { to { transform: translateY(30%) scale(.4); opacity: 0; } }
.sb-card.sb-found { transform: scale(1.1); z-index: 3; }
.sb-card.sb-found::after, .sb-card.sb-show::after { box-shadow: 0 0 0 8px #fff, 0 0 0 14px var(--yellow), 0 0 40px 18px rgba(255,236,140,.9); animation: sb-glow 1s ease-in-out infinite alternate; }
@keyframes sb-glow { to { box-shadow: 0 0 0 8px #fff, 0 0 0 16px var(--yellow), 0 0 60px 26px rgba(255,236,140,.6); } }
.sb-card.sb-show { transform: scale(1.08); z-index: 3; }
.sb-card.sb-dim { opacity: .55; transform: scale(.88); filter: saturate(.7); }
.sb-card.sb-poke { animation: sb-poke .4s ease-in-out; } @keyframes sb-poke { 30% { transform: rotate(-4deg) scale(1.03); } 65% { transform: rotate(3deg); } }
.sb-jar { position: absolute; right: calc(14px + env(safe-area-inset-right, 0px)); top: calc(14px + var(--safe-t)); width: clamp(64px, 11vmin, 96px); z-index: 6; pointer-events: none; }
.sb-jar svg { width: 100%; height: auto; display: block; overflow: visible; }
.sb-jar .glow circle { animation: sb-ff 2.6s ease-in-out infinite; transform-box: fill-box; }
.sb-flyer { position: fixed; z-index: 45; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(#fffbe0, #ffe45c 50%, rgba(255,228,92,0)); pointer-events: none; }
.sb-bubble { position: absolute; z-index: 32; background: #fff; border: 5px solid var(--ink); border-radius: 26px; padding: 10px 22px; font: 700 clamp(26px, 5vmin, 44px) var(--round); box-shadow: 0 6px 0 rgba(59,44,82,.25); pointer-events: none; animation: sb-pop-in .35s cubic-bezier(.3,1.6,.5,1) both; }
.sb-bubble small { display: block; font: 700 13px var(--text); opacity: .7; }
@keyframes sb-pop-in { from { transform: scale(.3); opacity: 0; } }
.sb-helper-note { position: absolute; z-index: 25; left: 50%; bottom: calc(10px + var(--safe-b)); transform: translateX(-50%); background: rgba(255,255,255,.92); border: 3px solid var(--ink); border-radius: 14px; padding: 6px 14px; font: 700 14px var(--text); max-width: 90vw; text-align: center; }

/* Party Pop */
.sb-party { position: absolute; inset: 0; }
.sb-party .sb-thing { position: absolute; z-index: 4; cursor: pointer; }
.sb-party .sb-thing > svg { width: 100%; height: auto; display: block; overflow: visible; }
.sb-monster { width: min(19vw, 30vh); bottom: 3%; z-index: 6 !important; }
.sb-monster.m-gus { left: 21%; } .sb-monster.m-mimi { right: 21%; } .sb-monster.m-tiki { right: 2%; width: min(16vw, 27vh); }
.sb-table { left: 50%; transform: translateX(-50%); bottom: 6%; width: min(40vw, 60vh); z-index: 5 !important; cursor: default !important; }
.sb-table .sb-tabletop { width: 100%; height: auto; display: block; }
.sb-gifts { position: absolute; left: 4%; right: 4%; bottom: 72%; display: flex; justify-content: space-around; align-items: flex-end; }
.sb-gift { width: 31%; position: relative; cursor: pointer; }
.sb-gift .sb-obj { width: 100%; height: auto; }
.sb-gift.sb-shake .sb-obj { animation: sb-giftshake .38s ease-in-out both; } @keyframes sb-giftshake { 20% { transform: rotate(-8deg) scale(1.05,.95); } 50% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.sb-gift.sb-open .sb-obj { animation: sb-giftgone .5s ease-in both; } @keyframes sb-giftgone { to { transform: scale(.2) translateY(40%); opacity: 0; } }
.sb-gift.sb-rewrap .sb-obj { animation: sb-card-in .6s cubic-bezier(.3,1.5,.5,1) both; }
.sb-popper { position: absolute; z-index: 20; pointer-events: none; }
.sb-popper .sb-obj { width: 100%; height: auto; }
.sb-surprise { position: absolute; z-index: 22; cursor: pointer; }
.sb-surprise .sb-obj { width: 100%; height: auto; }
.sb-popcorn { left: 2%; bottom: 10%; width: min(19vw, 30vh); }
.sb-cocoa { right: 4%; top: 19%; width: min(15vw, 23vh); }
.sb-fan { left: 4%; top: 18%; width: min(15vw, 23vh); }
.sb-banner { left: 50%; transform: translateX(-50%); top: calc(4% + var(--safe-t)); width: min(56vw, 90vh); z-index: 3 !important; }
.sb-balloon { position: absolute; left: 0; top: 0; z-index: 12; width: min(11vw, 16vh); cursor: pointer; will-change: transform; touch-action: none; }
.sb-balloon svg { width: 100%; height: auto; display: block; overflow: visible; }
.sb-balloon.sb-wob svg { animation: sb-wob .5s ease-in-out; } @keyframes sb-wob { 25% { transform: scale(1.12,.9); } 55% { transform: scale(.94,1.06); } }
.sb-kernel { position: absolute; z-index: 21; width: 26px; height: 26px; pointer-events: none; }
.sb-press-pop { animation: sb-press .35s cubic-bezier(.3,1.6,.5,1); } @keyframes sb-press { 30% { transform: scale(1.1,.9); } 65% { transform: scale(.96,1.05); } }
.sb-table.sb-press-pop { animation: none; }
.sb-banner.sb-press-pop { animation: sb-press-c .35s cubic-bezier(.3,1.6,.5,1); } @keyframes sb-press-c { 30% { transform: translateX(-50%) scale(1.06,.94); } }

/* Magic Echo */
.sb-echo { position: absolute; inset: 0; }
.sb-ember { position: absolute; left: 3%; bottom: 7%; width: min(28vw, 44vh); z-index: 6; cursor: pointer; }
.sb-ember .sb-buddy { width: 100%; height: auto; }
.sb-bench { position: absolute; left: 0; right: 0; bottom: 0; height: 12%; z-index: 5; pointer-events: none; }
.sb-station { position: absolute; left: min(30vw, 46vh); right: min(17vw, 24vh); top: 10%; bottom: 8%; z-index: 4; }
.sb-station.sb-arrive { animation: sb-arrive .7s cubic-bezier(.3,1.3,.5,1) both; } @keyframes sb-arrive { from { transform: translateX(70%); opacity: 0; } }
.sb-station.sb-leave { animation: sb-leave .45s ease-in both; pointer-events: none; } @keyframes sb-leave { to { transform: translateX(-60%); opacity: 0; } }
.sb-station svg.sb-rig { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sb-station svg.sb-rig * { transform-box: view-box; }
.sb-hit { cursor: pointer; }
.sb-magic { position: absolute; z-index: 30; right: calc(3% + env(safe-area-inset-right, 0px)); bottom: calc(6% + var(--safe-b)); width: clamp(110px, 20vmin, 180px); height: clamp(110px, 20vmin, 180px); border-radius: 50%; border: 6px solid var(--ink); background: radial-gradient(circle at 36% 30%, #fff 0, #ffe7a0 18%, #ff9f43 62%, #e0662a 100%); box-shadow: 0 10px 0 #7a3a1a, 0 0 0 0 rgba(255,214,120,.0); display: grid; place-items: center; transition: transform .1s; }
.sb-magic svg { width: 56%; height: 56%; }
.sb-magic:active, .sb-magic.sb-press { transform: translateY(7px); box-shadow: 0 3px 0 #7a3a1a; }
.sb-magic.sb-ready { animation: sb-magicglow 1.2s ease-in-out infinite; }
@keyframes sb-magicglow { 50% { box-shadow: 0 10px 0 #7a3a1a, 0 0 0 16px rgba(255,214,120,.55); } }
.sb-grownup { position: absolute; z-index: 31; right: calc(3% + env(safe-area-inset-right, 0px)); top: calc(12px + var(--safe-t)); display: flex; gap: 8px; align-items: center; background: rgba(255,255,255,.92); border: 3px solid var(--ink); border-radius: 16px; padding: 6px 8px 6px 12px; font: 700 13px var(--text); max-width: min(380px, 70vw); }
.sb-grownup button { font: 800 13px var(--text); background: var(--yellow); border: 3px solid var(--ink); border-radius: 12px; padding: 6px 10px; cursor: pointer; white-space: nowrap; }

/* Celebration */
.sb-overlay { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(circle, rgba(255,250,230,.85), rgba(255,236,200,.92)); animation: sb-fade .4s ease both; }
@keyframes sb-fade { from { opacity: 0; } }
.sb-celebrate { display: grid; justify-items: center; gap: 2vmin; }
.sb-celebrate .sb-cast { display: flex; align-items: flex-end; gap: 1vmin; }
.sb-celebrate .sb-cast .sb-buddy { width: min(20vw, 26vh); height: auto; }
.sb-celebrate .sb-cast .sb-buddy:nth-child(2) { width: min(26vw, 34vh); }
.sb-celebrate .sb-row { display: flex; gap: 6vmin; }
.sb-celebrate .sb-round { position: relative; width: clamp(84px, 16vmin, 140px); height: clamp(84px, 16vmin, 140px); }

/* Parent Corner (grown-up typography) */
.sb-pc { position: absolute; inset: 0; z-index: 70; background: #f6f3fb; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; user-select: text; -webkit-user-select: text; font: 16px/1.5 var(--text); }
.sb-pc-inner { max-width: 860px; margin: 0 auto; padding: calc(16px + var(--safe-t)) 16px calc(40px + var(--safe-b)); }
.sb-pc-head { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; background: #f6f3fb; padding: 8px 0; z-index: 2; }
.sb-pc-head h2 { font: 700 26px var(--round); margin: 0; flex: 1; }
.sb-pc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 14px; }
.sb-pc-tabs button { font: 800 15px var(--text); padding: 9px 14px; border-radius: 999px; border: 2px solid #d8d0ea; background: #fff; color: var(--ink); cursor: pointer; }
.sb-pc-tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sb-pc section { background: #fff; border-radius: 18px; padding: 16px 18px; margin-bottom: 14px; box-shadow: 0 1px 0 #e4ddf2, 0 6px 20px rgba(59,44,82,.06); }
.sb-pc h3 { font: 700 19px var(--round); margin: 0 0 6px; }
.sb-pc h4 { font: 800 15px var(--text); margin: 14px 0 6px; }
.sb-pc p { margin: 6px 0; }
.sb-pc .sb-muted { color: #6c6080; font-size: 14px; }
.sb-pc .sb-note { background: #fff7e0; border-left: 5px solid var(--yellow); padding: 8px 12px; border-radius: 8px; font-size: 14px; }
.sb-pc label.sb-row, .sb-pc .sb-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f0ebf7; }
.sb-pc .sb-row:last-child { border-bottom: 0; }
.sb-pc .sb-row > span { flex: 1 1 220px; }
.sb-pc .sb-row small { display: block; color: #6c6080; font-size: 13px; }
.sb-pc input[type="checkbox"].sb-switch { appearance: none; width: 50px; height: 30px; border-radius: 99px; background: #d8d0ea; position: relative; cursor: pointer; transition: background .2s; flex: none; }
.sb-pc input[type="checkbox"].sb-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.sb-pc input[type="checkbox"].sb-switch:checked { background: #2fb9a9; } .sb-pc input[type="checkbox"].sb-switch:checked::after { transform: translateX(20px); }
.sb-pc input[type="range"] { width: min(220px, 45vw); accent-color: #2fb9a9; }
.sb-pc select, .sb-pc input[type="text"], .sb-pc input[type="date"], .sb-pc textarea { font: 15px var(--text); padding: 8px 10px; border-radius: 10px; border: 2px solid #d8d0ea; background: #fff; color: var(--ink); max-width: 100%; box-sizing: border-box; }
.sb-pc textarea { width: 100%; min-height: 60px; }
.sb-pc .sb-seg { display: inline-flex; border: 2px solid #d8d0ea; border-radius: 12px; overflow: hidden; flex-wrap: wrap; }
.sb-pc .sb-seg button { font: 800 14px var(--text); padding: 7px 12px; border: 0; background: #fff; color: var(--ink); cursor: pointer; }
.sb-pc .sb-seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.sb-pc .sb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sb-pc .sb-chip { display: inline-flex; align-items: center; gap: 6px; font: 700 14px var(--text); padding: 6px 12px 6px 6px; border-radius: 999px; border: 2px solid #d8d0ea; background: #fff; cursor: pointer; color: var(--ink); }
.sb-pc .sb-chip svg { width: 30px; height: 30px; }
.sb-pc .sb-chip[aria-pressed="true"] { border-color: #2fb9a9; background: #e3f8f5; }
.sb-pc .sb-chip[aria-pressed="false"] { opacity: .6; }
.sb-pc .sb-chip .sb-flag-s { font-size: 11px; background: #fff0c0; border-radius: 6px; padding: 0 5px; }
.sb-pc .sb-act { font: 800 15px var(--text); padding: 9px 16px; border-radius: 12px; border: 2px solid var(--ink); background: var(--yellow); color: var(--ink); cursor: pointer; }
.sb-pc .sb-act.sb-ghost { background: #fff; } .sb-pc .sb-act.sb-danger { background: #ffe0e0; border-color: #b03a48; color: #8a1f2c; }
.sb-pc .sb-act:disabled { opacity: .45; cursor: not-allowed; }
.sb-pc .sb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sb-pc .sb-obs { border: 2px solid #eee8f6; border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.sb-pc .sb-obs-top { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.sb-pc .sb-obs-top b { font-size: 17px; }
.sb-pc .sb-tag { font: 800 12px var(--text); background: #efe8ff; border-radius: 8px; padding: 1px 8px; }
.sb-pc .sb-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.sb-pc .sb-form label { display: grid; gap: 4px; font: 800 13px var(--text); }
.sb-pc .sb-form .sb-wide { grid-column: 1 / -1; }
.sb-pc .sb-close { font: 800 15px var(--text); padding: 10px 18px; border-radius: 999px; border: 2px solid var(--ink); background: var(--yellow); cursor: pointer; color: var(--ink); }
.sb-pc a { color: #4b3ab0; font-weight: 700; }
.sb-pc ul { padding-left: 20px; margin: 6px 0; } .sb-pc li { margin: 4px 0; }
.sb-pc .sb-pairs { display: grid; gap: 8px; }
.sb-pc .sb-pair { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.sb-pc .sb-pair svg { width: 40px; height: 40px; }
.sb-pc .sb-ipa { font: 600 13px var(--text); color: #6c6080; }
.sb-pc .sb-artpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; max-height: 190px; overflow-y: auto; padding: 4px; border: 2px solid #eee8f6; border-radius: 12px; }
.sb-pc .sb-artpick button { border: 2px solid transparent; border-radius: 10px; background: #faf8ff; padding: 2px; cursor: pointer; }
.sb-pc .sb-artpick button[aria-pressed="true"] { border-color: #2fb9a9; background: #e3f8f5; }
.sb-pc .sb-artpick svg { width: 100%; height: auto; }
.sb-toast { position: absolute; z-index: 80; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; font: 700 15px var(--text); padding: 10px 18px; border-radius: 14px; animation: sb-pop-in .3s both; }

/* Portrait and small screens */
@media (orientation: portrait) {
  .sb-logo { margin-top: calc(68px + var(--safe-t)); font-size: clamp(28px, 8vw, 36px); }
  .sb-portals { flex-direction: column; align-items: center; justify-content: space-evenly; gap: 0; padding-bottom: calc(10px + var(--safe-b)); }
  .sb-portal { width: auto; height: min(25vh, 64vw); aspect-ratio: 1.55; border-radius: 46px 46px 22px 22px; }
  .sb-portal::before { inset: 10% 6% 0; border-radius: 40px 40px 0 0; }
  .sb-portal .sb-buddy { width: 52%; left: 24%; bottom: 2%; }
  .sb-portal .sb-deco { width: 22%; }
  .sb-portal .sb-plate { bottom: -20px; }
  .sb-det-bo { width: min(34vw, 22vh); left: 2%; bottom: 1%; }
  .sb-det-replay { left: auto; right: 4%; bottom: calc(2% + var(--safe-b)); top: auto; width: clamp(76px, 18vw, 110px); height: clamp(76px, 18vw, 110px); }
  .sb-cards { left: 4%; right: 4%; top: 13%; bottom: calc(min(34vw, 22vh) + 3%); flex-direction: column; gap: 3vh; }
  .sb-card { width: min(60vw, 30vh); }
  .sb-cards.sb-three .sb-card { width: min(50vw, 21vh); }
  .sb-monster { width: min(31vw, 19vh); } .sb-monster.m-gus { left: 2%; } .sb-monster.m-mimi { right: 2%; } .sb-monster.m-tiki { right: auto; left: 50%; transform: translateX(-50%); width: min(22vw, 14vh); bottom: 1%; }
  .sb-table { width: min(78vw, 44vh); bottom: 17%; }
  .sb-popcorn { left: 3%; bottom: auto; top: 44%; width: min(26vw, 17vh); }
  .sb-cocoa { right: 3%; top: 26%; width: min(22vw, 14vh); }
  .sb-fan { left: 3%; top: 26%; width: min(22vw, 14vh); }
  .sb-banner { width: 70vw; top: calc(12% + var(--safe-t)); }
  .sb-balloon { width: min(17vw, 11vh); }
  .sb-ember { width: min(40vw, 26vh); left: 2%; bottom: 3%; }
  .sb-station { left: 4%; right: 4%; top: 11%; bottom: calc(min(40vw, 26vh) + 4%); }
  .sb-magic { width: clamp(100px, 28vw, 150px); height: clamp(100px, 28vw, 150px); bottom: calc(4% + var(--safe-b)); }
}
@media (max-height: 520px) and (orientation: landscape) {
  .sb-logo { font-size: 30px; margin-top: 6px; }
  .sb-portal .sb-plate { font-size: 13px; bottom: -18px; }
}

/* Reduced motion */
.sb-reduce .sb-buddy .sb-b-all, .sb-reduce .sb-buddy .sb-b-ear-l, .sb-reduce .sb-buddy .sb-b-ear-r, .sb-reduce .sb-buddy .sb-b-wing-l, .sb-reduce .sb-buddy .sb-b-wing-r,
.sb-reduce .sb-buddy .sb-b-tail, .sb-reduce .sb-buddy .sb-b-antenna, .sb-reduce .sb-cloud, .sb-reduce .sb-butterfly, .sb-reduce .sb-fireflies .ff, .sb-reduce .sb-star, .sb-reduce .sb-flag,
.sb-reduce .sb-logo span, .sb-reduce .sb-portal .sb-deco, .sb-reduce .sb-obj:not(.sb-alive) *, .sb-reduce .sb-magic.sb-ready { animation: none !important; }
.sb-reduce .sb-buddy[class*="sb-a-"] .sb-b-all { animation-duration: .5s !important; }
.sb-paused *, .sb-paused *::before, .sb-paused *::after { animation-play-state: paused !important; }

/* Party Pop states */
.sb-banner .sb-unroll { display: none; }
.sb-banner.sb-unrolled .sb-roll { display: none; }
.sb-banner.sb-unrolled .sb-unroll { display: inline; }
.sb-banner.sb-unrolled .sb-pennant { animation: sb-pennant-in .55s cubic-bezier(.3,1.5,.5,1) both; animation-delay: calc(var(--i) * .08s); }
@keyframes sb-pennant-in { from { transform: scaleY(0) rotate(-20deg); } }
.sb-banner.sb-wave .sb-pennant { animation: sb-pennant-wave .6s ease-in-out both; animation-delay: calc(var(--i) * .07s); }
@keyframes sb-pennant-wave { 40% { transform: translateY(-14px) rotate(8deg); } }
.sb-banner .sb-roll { animation: sb-roll-jiggle 3s ease-in-out infinite; transform-origin: 300px 42px; }
@keyframes sb-roll-jiggle { 0%, 80%, 100% { transform: none; } 86% { transform: rotate(-4deg) scale(1.04); } 93% { transform: rotate(3deg); } }
.sb-cocoa .sb-stream { opacity: 0; }
.sb-cocoa .sb-mugfill, .sb-cocoa .sb-mugsteam { opacity: 0; transition: opacity .3s; }
.sb-cocoa.sb-pouring .sb-stream { opacity: 1; animation: sb-stream .2s linear infinite; }
@keyframes sb-stream { 50% { transform: translateX(1.5px); } }
.sb-cocoa.sb-pouring .sb-mugfill { opacity: .6; } .sb-cocoa.sb-full .sb-mugfill { opacity: 1; }
.sb-cocoa.sb-full .sb-mugsteam { opacity: 1; animation: sb-steam .7s ease-in-out infinite; }
.sb-cocoa.sb-full .sb-mug { animation: sb-press .5s ease both; transform-origin: 100px 222px; }
.sb-cocoa svg *, .sb-popcorn svg *, .sb-banner svg *, .sb-table svg * { transform-box: view-box; }
.sb-surprise { left: 0; top: 0; }
.sb-popcorn .sb-heap { animation: sb-heap 1.6s ease-in-out infinite; transform-origin: 100px 150px; }
@keyframes sb-heap { 50% { transform: scaleY(1.04); } }
.sb-popcorn.sb-press-pop .sb-heap { animation: sb-corn .12s ease-in-out 6 alternate; }

/* Magic Echo states */
.sb-rig .sb-bub { animation: sb-bubfloat 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.7s); cursor: pointer; }
@keyframes sb-bubfloat { 50% { transform: translate(6px, -14px) scale(1.04, .97); } }
.sb-rig .sb-bub.sb-gone { opacity: 0; pointer-events: none; animation: none; transition: opacity .08s; }
.sb-rig.sb-tease .sb-hit { animation: sb-tease .5s ease-in-out 3; }
@keyframes sb-tease { 50% { transform: translateY(-8px) scale(1.03); } }
.sb-rig .sb-tophat, .sb-rig .sb-kettle, .sb-rig .sb-cauldron { transform-origin: 300px 440px; }
.sb-rig .sb-carwrap.sb-driving .sb-wh { animation: sb-rotate .3s linear infinite; }
.sb-rig .sb-cocoamug .sb-p-steam { opacity: 0; transition: opacity .3s; }
.sb-rig .sb-cocoamug.sb-hot .sb-p-steam { opacity: 1; animation: sb-steam .5s ease-in-out infinite; }
.sb-rig .sb-bottle { cursor: grab; touch-action: none; }
.sb-rig .sb-hit { cursor: pointer; }
.sb-rig .sb-flame { animation: sb-flicker .12s linear infinite alternate; transform-origin: 300px 360px; }

/* Practice: the green continue arrow */
.sb-next { position: absolute; z-index: 31; right: calc(4% + env(safe-area-inset-right, 0px)); bottom: calc(5% + var(--safe-b)); width: clamp(96px, 17vmin, 150px); height: clamp(96px, 17vmin, 150px); border-radius: 50%; border: 6px solid var(--ink); background: radial-gradient(circle at 36% 30%, #b9f7a0 0, #4ccf5a 45%, #23a33c 100%); box-shadow: 0 9px 0 #16702a; display: grid; place-items: center; }
.sb-next svg { width: 58%; height: 58%; }
.sb-next[hidden] { display: none; }
.sb-next.sb-in { animation: sb-next-in .5s cubic-bezier(.3,1.6,.5,1) both, sb-next-pulse 1.6s ease-in-out 1.2s infinite; }
.sb-next:active { transform: translateY(6px); box-shadow: 0 3px 0 #16702a; }
@keyframes sb-next-in { from { transform: scale(0) rotate(-30deg); } }
@keyframes sb-next-pulse { 50% { box-shadow: 0 9px 0 #16702a, 0 0 0 16px rgba(120,230,120,.45); } }
@media (orientation: portrait) { .sb-next { right: auto; left: 50%; margin-left: calc(clamp(96px, 17vmin, 150px) / -2); bottom: calc(3% + var(--safe-b)); } }

/* Public instructions are a real disclosure; keep it clear of active game controls. */
body.sb-in-game .rex-project-info, body.sb-pc-open .rex-project-info { display:none; }
body .rex-project-info header :is(h1,h2) { font-size:clamp(24px,3vw,48px);line-height:1.15; }
@media(max-width:600px){body .rex-project-info header :is(h1,h2){font-size:clamp(24px,5vw,36px)}}
