/* v14.36 Story theatre (static/story-theatre.js): big cut-out friends on a transparent stage over the forest.
   No box, no sky: the forest is the scenery. Every selector starts with .st- so nothing leaks into the app.
   The host (the app's forest layer) decides where the stage sits; see the report for the geometry asked for. */

.st-theatre {
  --st-bar: 52px;
  --st-gold: #ffd54f;
  --st-ink: #3b2a1a;
  --st-cream: #fffaf0;
  position: absolute; inset: 0;
  pointer-events: none;
  font-family: inherit;
  color: var(--st-ink);
  -webkit-tap-highlight-color: transparent;
  user-select: none; -webkit-user-select: none;
}
.st-theatre .st-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ------------------------------------------------------------------ the stage */
.st-theatre .st-stage {
  position: absolute; left: 0; right: 0; top: 0; bottom: var(--st-bar);
  container-type: size;
  overflow: visible;
}
/* a soft pool of warm light on the forest floor, so the friends feel grounded (not a box) */
.st-theatre .st-floor {
  position: absolute; left: 4%; right: 4%; bottom: -3%; height: 24%;
  background: radial-gradient(ellipse 50% 48% at 50% 62%, rgba(255, 228, 170, .20), rgba(255, 228, 170, .07) 55%, rgba(255, 228, 170, 0) 100%);
  pointer-events: none;
}
.st-theatre .st-fx { position: absolute; inset: 0; pointer-events: none; z-index: 20; overflow: visible; }

/* one friend or prop: placed by its centre (--x, % of the stage), standing on the floor (--y), --h % of the stage tall */
.st-theatre .st-ent {
  position: absolute;
  left: calc(var(--x, 50) * 1%);
  bottom: calc(var(--y, 3) * 1%);
  height: calc(var(--h, 40) * 1%);
  /* --k shrinks the cast a little on narrow (phone) stages; the box always stays fully on the stage */
  --eh: min(calc(var(--h, 40) * var(--k, 1) * 1cqh), calc(96cqw / var(--ar, 1)));
  height: var(--eh);
  left: clamp(calc(var(--eh) * var(--ar, 1) / 2), calc(var(--x, 50) * 1%), calc(100% - var(--eh) * var(--ar, 1) / 2));
  aspect-ratio: var(--ar, 1);
  translate: -50% 0;
  z-index: var(--z, 3);
  transition: left var(--dur, 1s) cubic-bezier(.45, .05, .35, 1), bottom .9s cubic-bezier(.45, .05, .35, 1), height .6s ease, opacity .6s ease;
  pointer-events: auto;
  cursor: pointer;
}
.st-theatre .st-ent.st-notrans { transition: none !important; }
.st-theatre .st-ent.st-still { pointer-events: none; cursor: default; }
.st-theatre .st-ent.st-gone { opacity: 0; pointer-events: none !important; }
.st-theatre .st-ent.st-gone .st-target { display: none; }
/* contact shadow: stays on the floor while the friend bobs */
.st-theatre .st-ent::before {
  content: ""; position: absolute; left: 50%; bottom: -1.2%;
  width: calc(var(--sw, .7) * 100%); height: 9%; translate: -50% 0;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(3, 8, 20, .55), rgba(3, 8, 20, .22) 55%, rgba(3, 8, 20, 0) 100%);
  border-radius: 50%; pointer-events: none;
}
.st-theatre .st-ent.st-noshadow::before { display: none; }
.st-theatre .st-ent.st-overlay { pointer-events: none; z-index: 15; cursor: default; }
.st-theatre .st-act, .st-theatre .st-flip, .st-theatre .st-bob, .st-theatre .st-art { position: absolute; inset: 0; }
.st-theatre .st-act { transform-origin: 50% 100%; }
.st-theatre .st-flip { transform: scaleX(var(--face, 1)); }
.st-theatre .st-bob {
  transform-origin: 50% 100%;
  animation: st-bob 3.6s ease-in-out var(--bd, 0s) infinite;
}
.st-theatre .st-art {
  filter: drop-shadow(0 .9cqh .9cqh rgba(3, 8, 22, .42)) drop-shadow(0 0 1.6cqh rgba(150, 180, 255, .16));
  transition: filter .5s ease;
}
.st-theatre .st-svg, .st-theatre .st-png { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; transition: opacity .45s ease; }
.st-theatre .st-png { object-fit: contain; object-position: 50% 100%; opacity: 0; }
.st-theatre .st-art.st-png-on .st-png { opacity: 1; }
.st-theatre .st-art.st-png-on .st-svg { opacity: 0; }
.st-theatre .st-ent.st-still .st-bob { animation: none; }
.st-theatre .st-ent.st-sky .st-bob { animation: st-float 5.2s ease-in-out var(--bd, 0s) infinite; }
.st-theatre .st-ent.st-sky { cursor: pointer; }

/* the friend who is speaking or acting: a happy bounce and a warm glow */
.st-theatre .st-ent.st-focus .st-bob { animation: st-bounce 1.5s ease-in-out infinite; }
.st-theatre .st-ent.st-sky.st-focus .st-bob { animation: st-float-big 2.6s ease-in-out infinite; }
.st-theatre .st-ent.st-still.st-focus .st-bob { animation: st-glowpulse 1.8s ease-in-out infinite; }
.st-theatre .st-ent.st-focus .st-art {
  filter: drop-shadow(0 .9cqh .9cqh rgba(3, 8, 22, .42)) drop-shadow(0 0 2.2cqh rgba(255, 214, 120, .55));
}
.st-theatre .st-ent.st-walking .st-bob { animation: st-walkbob .38s ease-in-out infinite; }
.st-theatre .st-ent.st-sky.st-walking .st-bob { animation: st-float 5.2s ease-in-out infinite; }
.st-theatre .st-ent.st-focus { z-index: calc(var(--z, 3) + 1); }

@keyframes st-bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-1.4%) scale(.995, 1.012); } }
@keyframes st-float { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5%) rotate(1.5deg); } }
@keyframes st-float-big { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-7%) scale(1.05); } }
@keyframes st-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 28% { transform: translateY(-4.5%) scale(1.025, .985); } 55% { transform: translateY(0) scale(.99, 1.015); } 75% { transform: translateY(-1.2%) scale(1, 1); } }
@keyframes st-walkbob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-5%) rotate(1.5deg); } }
@keyframes st-glowpulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }

/* entrances, exits, one-off moves (on .st-act) and the little pop when a pose changes (on .st-art) */
.st-theatre .st-in-fade { animation: st-in-fade .7s ease both; }
.st-theatre .st-in-pop { animation: st-in-pop .7s cubic-bezier(.3, 1.6, .5, 1) both; }
.st-theatre .st-in-drop { animation: st-in-drop .8s cubic-bezier(.3, 1.4, .5, 1) both; }
.st-theatre .st-in-grow { animation: st-in-grow .9s cubic-bezier(.3, 1.3, .5, 1) both; }
.st-theatre .st-out-drop { animation: st-out-drop .7s ease-in both; }
.st-theatre .st-a-hop { animation: st-hop .42s ease-in-out 3; }
.st-theatre .st-a-jump { animation: st-jump .6s cubic-bezier(.3, 1.4, .5, 1) 2; }
.st-theatre .st-a-dash { animation: st-dash 1.3s cubic-bezier(.5, 0, .4, 1); }
.st-theatre .st-a-spin { animation: st-spin .9s ease-in-out 2; }
.st-theatre .st-a-wiggle { animation: st-wiggle .7s ease-in-out; }
.st-theatre .st-a-shake { animation: st-shake .6s ease-in-out 2; }
.st-theatre .st-a-bow { animation: st-bow 1.1s ease-in-out; }
.st-theatre .st-pose-pop { animation: st-pose-pop .45s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes st-in-fade { from { opacity: 0; transform: translateY(3%) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes st-in-pop { 0% { opacity: 0; transform: scale(.2); } 60% { opacity: 1; } 100% { transform: scale(1); } }
@keyframes st-in-drop { 0% { opacity: 0; transform: translateY(-55%); } 40% { opacity: 1; } 100% { transform: none; } }
@keyframes st-in-grow { 0% { opacity: 0; transform: scale(.05, .3); } 100% { opacity: 1; transform: none; } }
@keyframes st-out-drop { to { opacity: 0; transform: translateY(40%) scale(.9); } }
@keyframes st-hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9%); } }
@keyframes st-jump { 0%, 100% { transform: translateY(0) scale(1); } 15% { transform: scale(1.06, .92); } 50% { transform: translateY(-16%) scale(.96, 1.05); } 80% { transform: scale(1.04, .95); } }
@keyframes st-dash { 0% { transform: translateX(0); } 35% { transform: translateX(26cqw) scale(.96, 1); opacity: .9; } 36% { opacity: 0; } 60% { transform: translateX(-30cqw); opacity: 0; } 61% { opacity: 1; } 100% { transform: translateX(0); } }
@keyframes st-spin { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg) translateY(-6%); } 75% { transform: rotate(12deg) translateY(-6%); } }
@keyframes st-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-6deg); } 45% { transform: rotate(5deg); } 70% { transform: rotate(-3deg); } }
@keyframes st-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-2.5%); } 40% { transform: translateX(2.5%); } 60% { transform: translateX(-1.5%); } 80% { transform: translateX(1.5%); } }
@keyframes st-bow { 0%, 100% { transform: rotate(0); } 40%, 60% { transform: rotate(8deg) scaleY(.94); } }
@keyframes st-pose-pop { 0% { transform: scale(.94, 1.04); } 55% { transform: scale(1.04, .97); } 100% { transform: none; } }

/* little lives inside the drawings */
.st-theatre .st-zz { fill: #e9f0ff; font: 900 20px/1 system-ui, sans-serif; opacity: 0; animation: st-zz 2.1s ease-in-out infinite; }
@keyframes st-zz { 0% { opacity: 0; transform: translate(0, 6px); } 30% { opacity: .95; } 100% { opacity: 0; transform: translate(10px, -14px); } }
.st-theatre .st-gust { stroke-dasharray: 30 60; animation: st-gust .9s linear infinite; }
@keyframes st-gust { from { stroke-dashoffset: 90; } to { stroke-dashoffset: 0; } }
.st-theatre .st-flap { transform-box: fill-box; transform-origin: 50% 0; animation: st-flap 1.4s ease-in-out infinite; }
.st-theatre .st-flap-fast { animation: st-flap-fast .32s ease-in-out infinite; }
@keyframes st-flap { 0%, 100% { transform: skewX(0); } 50% { transform: skewX(-5deg); } }
@keyframes st-flap-fast { 0%, 100% { transform: skewX(4deg) scaleY(1); } 50% { transform: skewX(-16deg) scaleY(1.12); } }
.st-theatre .st-scarf { transform-box: fill-box; transform-origin: 0 0; animation: st-scarf .35s ease-in-out infinite; }
@keyframes st-scarf { 0%, 100% { transform: rotate(-30deg); } 50% { transform: rotate(-55deg); } }
.st-theatre .st-shiver { animation: st-shiver .25s linear infinite; }
@keyframes st-shiver { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(2px); } }
.st-theatre .st-rays { transform-box: view-box; transform-origin: 110px 110px; animation: st-spinslow 24s linear infinite; }
.st-theatre .st-sunglow { transform-box: fill-box; transform-origin: 50% 50%; animation: st-sunglow 2.4s ease-in-out infinite; }
@keyframes st-spinslow { to { transform: rotate(360deg); } }
@keyframes st-sunglow { 0%, 100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.08); } }
.st-theatre .st-bub { transform-box: fill-box; transform-origin: 50% 100%; animation: st-bub 1.5s ease-in-out infinite; }
@keyframes st-bub { 0%, 100% { transform: scale(.5); opacity: .4; } 60% { transform: scale(1.15); opacity: 1; } }
.st-theatre .st-steam { opacity: 0; animation: st-steam 2.2s ease-in-out infinite; }
@keyframes st-steam { 0% { opacity: 0; transform: translateY(8px); } 35% { opacity: .85; } 100% { opacity: 0; transform: translateY(-18px); } }
.st-theatre .st-leg { transform-box: fill-box; transform-origin: 50% 0; animation: st-leg .5s ease-in-out infinite; }
.st-theatre .st-leg2 { animation-delay: -.25s; }
@keyframes st-leg { 0%, 100% { transform: rotate(-14deg); } 50% { transform: rotate(14deg); } }
.st-theatre .st-nod { animation: st-nod 1s ease-in-out infinite; }
@keyframes st-nod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.st-theatre .st-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: st-flame .9s ease-in-out infinite alternate; }
.st-theatre .st-candleglow { animation: st-candle 1.6s ease-in-out infinite alternate; }
@keyframes st-flame { from { transform: scale(.92, 1) rotate(-3deg); } to { transform: scale(1.06, 1.12) rotate(3deg); } }
@keyframes st-candle { from { opacity: .7; } to { opacity: 1; } }
.st-theatre .st-wave { transform-box: fill-box; transform-origin: 0 50%; animation: st-wave 1.6s ease-in-out infinite; }
@keyframes st-wave { 0%, 100% { transform: skewY(0) scaleX(1); } 50% { transform: skewY(5deg) scaleX(.94); } }

/* the porridge flood grows across the floor */
.st-theatre .st-ent[data-art="flood"] .st-art { transform-origin: 50% 100%; transition: transform 1.4s cubic-bezier(.3, 1.2, .5, 1); }
.st-theatre .st-ent[data-art="flood"][data-state="1"] .st-art { transform: scale(.42, .7); }
.st-theatre .st-ent[data-art="flood"][data-state="2"] .st-art { transform: scale(.72, .9); }
.st-theatre .st-ent[data-art="flood"][data-state="3"] .st-art { transform: scale(1.12, 1.15); }

/* ------------------------------------------------------------------ effects (one-off, they tidy themselves away) */
.st-theatre .st-fxbox { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 30; animation: st-fxlife 2.4s linear forwards; }
.st-theatre .st-fx > .st-fxbox { inset: 0; width: auto; height: auto; }
.st-theatre .st-fx-confetti, .st-theatre .st-fx-gust { animation-duration: 3.2s !important; overflow: hidden; }
/* soft edges, so no effect ever shows the outline of the stage */
.st-theatre .st-fx-gust { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%); }
.st-theatre .st-fx-confetti { -webkit-mask-image: linear-gradient(180deg, #000 0, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, #000 0, #000 70%, transparent 100%); }
@keyframes st-fxlife { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
.st-theatre .st-fxbox > i, .st-theatre .st-fxbox > b { position: absolute; left: 0; top: 0; display: block; font-style: normal; }
.st-theatre .st-fxbox svg { display: block; width: 100%; height: 100%; overflow: visible; }

.st-theatre .st-spark { width: 5cqh; height: 5cqh; margin: -2.5cqh 0 0 -2.5cqh; opacity: 0; animation: st-spark 1.3s ease-out var(--d, 0s) forwards; filter: drop-shadow(0 0 .8cqh rgba(255, 240, 160, .9)); }
@keyframes st-spark { 0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(.2); } 25% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-11cqh) scale(1.1) rotate(90deg); } }
.st-theatre .st-heart { width: 4.6cqh; height: 4.6cqh; margin: -2.3cqh 0 0 -2.3cqh; opacity: 0; animation: st-rise 2s ease-out var(--d, 0s) forwards; }
.st-theatre .st-coin { width: 4cqh; height: 4cqh; margin: -2cqh 0 0 -2cqh; opacity: 0; animation: st-rise 1.6s ease-out var(--d, 0s) forwards; }
@keyframes st-rise { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx, 0), -14cqh) scale(1.1); } }
.st-theatre .st-zfx { color: #e9f0ff; font: 900 5cqh/1 system-ui, sans-serif; text-shadow: 0 0 1cqh rgba(170, 200, 255, .8); opacity: 0; animation: st-zfx 1.8s ease-out var(--d, 0s) forwards; }
@keyframes st-zfx { 0% { opacity: 0; transform: translate(0, 0) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(6cqh, -12cqh) scale(1.2); } }
.st-theatre .st-note { color: #fff3b0; font: 900 5.5cqh/1 system-ui, sans-serif; text-shadow: 0 0 1cqh rgba(255, 220, 120, .9); opacity: 0; animation: st-rise 1.9s ease-out var(--d, 0s) forwards; }
.st-theatre .st-ring { width: 8cqh; height: 8cqh; margin: -4cqh 0 0 -4cqh; border-radius: 50%; border: .9cqh solid rgba(255, 236, 170, .9); border-left-color: transparent; border-bottom-color: transparent; opacity: 0; transform: rotate(45deg); animation: st-ring 1.1s ease-out var(--d, 0s) 2 forwards; }
@keyframes st-ring { 0% { opacity: 0; transform: rotate(45deg) scale(.3); } 25% { opacity: 1; } 100% { opacity: 0; transform: rotate(45deg) scale(3.2); } }
.st-theatre .st-dust { width: 5cqh; height: 3.4cqh; margin: -1.7cqh 0 0 -2.5cqh; border-radius: 50%; background: radial-gradient(rgba(230, 215, 190, .85), rgba(230, 215, 190, 0) 70%); opacity: 0; animation: st-dust 1.1s ease-out var(--d, 0s) forwards; }
@keyframes st-dust { 0% { opacity: 0; transform: translate(0, 0) scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), -3cqh) scale(1.6); } }
.st-theatre .st-crumb { width: 1.2cqh; height: 1.2cqh; border-radius: 30%; background: #e3c48a; opacity: 0; animation: st-crumb 1s ease-in var(--d, 0s) 2 forwards; }
@keyframes st-crumb { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), 8cqh) rotate(200deg); } }
.st-theatre .st-bang { color: #fff3b0; font: 900 9cqh/1 system-ui, sans-serif; margin: -9cqh 0 0 -1.6cqh; text-shadow: 0 .4cqh 0 #c27f33, 0 0 1.4cqh rgba(255, 220, 120, .9); animation: st-bang 1.4s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes st-bang { 0% { opacity: 0; transform: scale(.2) rotate(-20deg); } 30% { opacity: 1; transform: scale(1.2) rotate(8deg); } 70% { opacity: 1; transform: scale(1) rotate(0); } 100% { opacity: 0; } }
.st-theatre .st-squeak { width: 7cqh; height: 7cqh; margin: -8cqh 0 0 -1cqh; border: .6cqh solid rgba(255, 255, 255, .9); border-radius: 50%; border-left-color: transparent; border-bottom-color: transparent; animation: st-ring 1s ease-out 3 forwards; }
.st-theatre .st-bubfx { width: calc(4cqh * var(--s, 1)); height: calc(4cqh * var(--s, 1)); margin: -2cqh 0 0 -2cqh; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0 18%, rgba(255, 248, 225, .75) 20%, rgba(247, 228, 187, .55) 70%); border: .3cqh solid rgba(255, 255, 255, .8); opacity: 0; animation: st-bubrise 1.6s ease-out var(--d, 0s) 2 forwards; }
@keyframes st-bubrise { 0% { opacity: 0; transform: translate(0, 0) scale(.3); } 25% { opacity: 1; } 90% { opacity: 1; transform: translate(var(--dx), -14cqh) scale(1); } 100% { opacity: 0; transform: translate(var(--dx), -15cqh) scale(1.4); } }
.st-theatre .st-zoom { width: 14cqh; height: .8cqh; margin: var(--dy, 0) 0 0 -22cqh; border-radius: 1cqh; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .85)); opacity: 0; animation: st-zoom .55s ease-out var(--d, 0s) 3 forwards; }
@keyframes st-zoom { 0% { opacity: 0; transform: translateX(6cqh); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateX(-8cqh); } }
.st-theatre .st-conf { left: var(--x) !important; top: -4% !important; width: calc(1.3cqh * var(--w, 1)); height: calc(2.2cqh * var(--w, 1)); border-radius: .3cqh; background: var(--c); opacity: 0; animation: st-conf 2.6s cubic-bezier(.3, .2, .5, 1) var(--d, 0s) forwards; }
@keyframes st-conf { 0% { opacity: 0; transform: translateY(0) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translateY(105cqh) rotate(var(--r)); } }
.st-theatre .st-gustline { left: -40% !important; top: var(--y) !important; width: var(--w); height: .9cqh; border-radius: 1cqh; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(235, 244, 255, .9) 60%, rgba(255, 255, 255, 0)); opacity: 0; animation: st-gustline 1.3s ease-in var(--d, 0s) 2 forwards; }
@keyframes st-gustline { 0% { opacity: 0; transform: translateX(0); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateX(170cqw); } }
.st-theatre .st-leaf { left: -6% !important; top: var(--y) !important; width: 4cqh; height: 4cqh; opacity: 0; animation: st-leaf 2.2s ease-in var(--d, 0s) forwards; }
@keyframes st-leaf { 0% { opacity: 0; transform: translate(0, 0) rotate(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(115cqw, -8cqh) rotate(720deg); } }
.st-theatre .st-warmglow { width: 150cqh; height: 150cqh; margin: -75cqh 0 0 -75cqh; border-radius: 50%; background: radial-gradient(circle closest-side, rgba(255, 214, 110, .5), rgba(255, 190, 90, .16) 45%, rgba(255, 190, 90, 0) 100%); opacity: 0; animation: st-warm 3s ease-in-out forwards; }
@keyframes st-warm { 0% { opacity: 0; } 35% { opacity: 1; } 100% { opacity: 0; } }
.st-theatre .st-badge {
  width: 6.4cqh; height: 6.4cqh; margin: -3.2cqh 0 0 -3.2cqh; border-radius: 50%;
  display: grid; place-items: center; background: var(--st-gold); color: #4a2c00; border: .45cqh solid #fff;
  font: 900 3.8cqh/1 system-ui, sans-serif; box-shadow: 0 .6cqh 1.4cqh rgba(0, 0, 0, .35);
  opacity: 0; animation: st-badge-in .45s cubic-bezier(.3, 1.6, .5, 1) var(--d, 0s) forwards, st-badge-out .5s ease 3.6s forwards;
}
@keyframes st-badge-in { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: scale(1); } }
@keyframes st-badge-out { to { opacity: 0; transform: scale(.6); } }

/* ------------------------------------------------------------------ buttons: the app's own button look is reset */
.st-theatre button.st-btn {
  appearance: none; -webkit-appearance: none; margin: 0; border: 0; padding: 0; background: none; font: inherit; color: inherit;
  filter: none; transform: none; pointer-events: auto; cursor: pointer; position: relative;
  transition: scale .18s ease, opacity .35s ease, box-shadow .2s ease, background .2s ease;
}
.st-theatre button.st-btn:hover { transform: none; filter: none; }
.st-theatre button.st-btn:focus-visible { outline: 4px solid rgba(255, 233, 120, .95); outline-offset: 4px; }
.st-theatre button.st-btn:active { scale: .95; }
.st-theatre.st-stopped button.st-btn:not(.st-nav), .st-theatre.st-paused button.st-btn:not(.st-nav) { pointer-events: none; }

/* ------------------------------------------------------------------ the moment layer: cards, big button, numbers */
.st-theatre .st-moment { position: absolute; left: 0; right: 0; top: 0; bottom: var(--st-bar); container-type: size; pointer-events: none; z-index: 40; }
.st-theatre[data-moment="choose"] .st-ent:not(.st-still), .st-theatre[data-moment="predict"] .st-ent:not(.st-still),
.st-theatre[data-moment="recap"] .st-ent:not(.st-still) { opacity: .5; transition: opacity .5s ease, left 1s ease; }
.st-theatre[data-moment="choose"] .st-ent.st-gone, .st-theatre[data-moment="predict"] .st-ent.st-gone, .st-theatre[data-moment="recap"] .st-ent.st-gone { opacity: 0; }

.st-theatre .st-cards {
  position: absolute; left: 0; right: 0; top: 8%; bottom: 4%;
  display: flex; align-items: center; justify-content: center; gap: 3cqw;
}
.st-theatre button.st-card {
  --cw: min(34cqw, 58cqh);
  width: var(--cw); height: calc(var(--cw) * 1.12); min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 2%;
  padding: 5% 5% 6%; box-sizing: border-box;
  border-radius: clamp(20px, 5cqh, 34px);
  background: linear-gradient(180deg, #fffdf6 0%, #fff3d8 62%, #fbe2b2 100%);
  border: clamp(3px, .8cqh, 6px) solid #fff;
  box-shadow: 0 1.6cqh 3.2cqh rgba(2, 8, 20, .45), inset 0 -1cqh 0 rgba(196, 140, 60, .18), 0 0 0 0 rgba(255, 214, 90, 0);
  animation: st-card-in .6s cubic-bezier(.3, 1.5, .5, 1) calc(var(--i, 0) * .12s) both;
}
.st-theatre .st-ideas button.st-card { --cw: min(30cqw, 50cqh); background: linear-gradient(180deg, #f6fbff 0%, #e4f0ff 62%, #cfe1fb 100%); }
.st-theatre .st-card-art { flex: 1 1 0; width: 100%; min-height: 0; position: relative; }
.st-theatre .st-card-art svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 .6cqh .6cqh rgba(60, 40, 10, .25)); }
/* a friend's real picture on a card (the same picture as on the stage), over its drawing; a rope can lie under it */
.st-theatre .st-card-art .st-card-png { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: 50% 50%; opacity: 0; transition: opacity .35s ease; filter: drop-shadow(0 .6cqh .6cqh rgba(60, 40, 10, .25)); }
.st-theatre .st-card-art.st-png-on .st-card-png { opacity: 1; }
.st-theatre .st-card-art.st-png-on .st-card-svg { opacity: 0; }
.st-theatre .st-card-art .st-card-under { position: absolute; inset: 0; }
.st-theatre .st-card-label { flex: 0 0 auto; font-weight: 850; font-size: clamp(15px, 5.4cqh, 28px); line-height: 1.05; text-align: center; color: var(--st-ink); }
.st-theatre .st-or {
  flex: 0 0 auto; display: grid; place-items: center; width: clamp(34px, 9cqh, 54px); height: clamp(34px, 9cqh, 54px); border-radius: 50%;
  background: rgba(16, 32, 44, .78); color: #fff6dc; font-weight: 850; font-size: clamp(13px, 3.6cqh, 19px); border: 2px solid rgba(255, 246, 220, .6);
  animation: st-card-in .5s ease .2s both;
}
.st-theatre.st-awaiting button.st-card { animation: st-card-in .6s cubic-bezier(.3, 1.5, .5, 1) calc(var(--i, 0) * .12s) both, st-breathe 2.4s ease-in-out calc(.6s + var(--i, 0) * .4s) infinite; }
.st-theatre.st-nudge button.st-card { animation: st-card-in .6s both, st-nudge 1s ease-in-out calc(var(--i, 0) * .5s) infinite; }
.st-theatre button.st-card:hover { scale: 1.04; }
.st-theatre .st-closing button.st-card.st-picked { animation: st-picked .9s cubic-bezier(.3, 1.5, .5, 1) forwards; box-shadow: 0 0 0 1cqh rgba(255, 214, 90, .85), 0 1.6cqh 3.2cqh rgba(2, 8, 20, .45); }
.st-theatre .st-closing button.st-card.st-unpicked, .st-theatre .st-closing .st-or { opacity: 0; scale: .9; }
.st-theatre .st-closing:not(:has(.st-picked)) button.st-card { opacity: 0; scale: .9; }
@keyframes st-card-in { from { opacity: 0; transform: translateY(8cqh) scale(.7) rotate(-4deg); } to { opacity: 1; transform: none; } }
@keyframes st-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.2cqh); } }
@keyframes st-nudge { 0%, 100% { transform: scale(1); box-shadow: 0 1.6cqh 3.2cqh rgba(2, 8, 20, .45), 0 0 0 0 rgba(255, 214, 90, 0); } 50% { transform: scale(1.05); box-shadow: 0 1.6cqh 3.2cqh rgba(2, 8, 20, .45), 0 0 0 1.2cqh rgba(255, 214, 90, .7); } }
@keyframes st-picked { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(2deg); } 100% { transform: scale(1.04); } }

/* the big action button: ROAR!, WHOOSH!, Cook, little pot! */
.st-theatre button.st-big {
  position: absolute; right: 3%; bottom: 5%;
  display: flex; align-items: center; gap: clamp(8px, 2cqh, 14px);
  min-height: 72px; min-height: max(72px, 15cqh);
  padding: 8px clamp(18px, 4.5cqh, 30px) 8px 8px; box-sizing: border-box;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff1a8 0%, #ffd34d 55%, #f7b52c 100%);
  border: 4px solid #fff8dc;
  color: #4a2a00; font-weight: 900; font-size: clamp(19px, 5.6cqh, 32px); line-height: 1; letter-spacing: .01em; white-space: nowrap;
  box-shadow: 0 1.4cqh 2.8cqh rgba(2, 8, 20, .5), inset 0 -.8cqh 0 rgba(190, 110, 0, .25);
  animation: st-big-in .6s cubic-bezier(.3, 1.6, .5, 1) both, st-big-pulse 1.6s ease-in-out .6s infinite;
}
.st-theatre .st-big-ico { display: grid; place-items: center; width: max(54px, 11.5cqh); height: max(54px, 11.5cqh); border-radius: 50%; background: #fffdf3; box-shadow: inset 0 -.5cqh 0 rgba(200, 150, 60, .25); font-size: max(30px, 6.6cqh); line-height: 1; }
.st-theatre.st-nudge button.st-big { animation: st-big-in .6s both, st-big-nudge .8s ease-in-out infinite; }
.st-theatre .st-closing button.st-big { animation: st-big-go .7s ease forwards; pointer-events: none; }
@keyframes st-big-in { from { opacity: 0; transform: translateY(6cqh) scale(.5); } to { opacity: 1; transform: none; } }
@keyframes st-big-pulse { 0%, 100% { box-shadow: 0 1.4cqh 2.8cqh rgba(2, 8, 20, .5), inset 0 -.8cqh 0 rgba(190, 110, 0, .25), 0 0 0 0 rgba(255, 214, 90, .6); } 50% { box-shadow: 0 1.4cqh 2.8cqh rgba(2, 8, 20, .5), inset 0 -.8cqh 0 rgba(190, 110, 0, .25), 0 0 0 1.4cqh rgba(255, 214, 90, 0); } }
@keyframes st-big-nudge { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.08) rotate(-3deg); } 75% { transform: scale(1.08) rotate(3deg); } }
@keyframes st-big-go { 0% { transform: scale(1); } 30% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(.6) translateY(-4cqh); opacity: 0; } }

/* number buttons for counting: the number, and dots to count */
.st-theatre .st-nums { position: absolute; left: 0; right: 0; top: 3%; display: flex; justify-content: center; gap: clamp(12px, 3cqw, 26px); }
.st-theatre .st-moment[data-side="right"] .st-nums { top: auto; bottom: 5%; left: auto; right: 3%; }
.st-theatre .st-moment[data-side="left"] .st-nums { top: auto; bottom: 5%; left: 3%; right: auto; }
.st-theatre .st-moment[data-side="left"] button.st-big { right: auto; left: 3%; }
.st-theatre button.st-num {
  width: max(72px, 18cqh); height: max(76px, 19cqh); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: clamp(18px, 4.5cqh, 28px); background: linear-gradient(180deg, #fffdf6, #fff0cc); border: 4px solid #ffe7a0;
  box-shadow: 0 1.2cqh 2.4cqh rgba(2, 8, 20, .45), inset 0 -.7cqh 0 rgba(196, 140, 60, .18);
  animation: st-card-in .55s cubic-bezier(.3, 1.5, .5, 1) calc(var(--i, 0) * .1s) both;
}
.st-theatre .st-num b { font-size: max(32px, 8.4cqh); font-weight: 900; line-height: 1; color: var(--st-ink); }
.st-theatre .st-num i { font-style: normal; font-size: max(9px, 2.2cqh); letter-spacing: 1px; color: #e3a12a; line-height: 1; }
.st-theatre.st-nudge button.st-num { animation: st-card-in .55s both, st-nudge 1s ease-in-out calc(var(--i, 0) * .3s) infinite; }
.st-theatre .st-closing button.st-num.st-picked { animation: st-picked .9s cubic-bezier(.3, 1.5, .5, 1) forwards; border-color: var(--st-gold); }
.st-theatre .st-closing button.st-num.st-unpicked { opacity: 0; scale: .85; }
.st-theatre .st-closing .st-nums:not(:has(.st-picked)) button.st-num { opacity: 0; }

/* things to tap on the stage: knots, clouds, stepping stones, leather */
.st-theatre button.st-target {
  position: absolute; width: max(64px, 15cqh); height: max(64px, 15cqh); translate: -50% -50%;
  display: grid; place-items: center; border-radius: 50%; z-index: 12;
  background: radial-gradient(circle, rgba(255, 240, 180, .45) 0%, rgba(255, 240, 180, .15) 45%, rgba(255, 240, 180, 0) 70%);
  animation: st-target-in .55s cubic-bezier(.3, 1.6, .5, 1) calc(var(--i, 0) * .15s) both, st-target-pulse 1.6s ease-in-out calc(.6s + var(--i, 0) * .25s) infinite;
}
.st-theatre button.st-target svg { width: 78%; height: 78%; overflow: visible; filter: drop-shadow(0 .5cqh .6cqh rgba(0, 0, 0, .35)); }
.st-theatre button.st-target.st-t-cloud svg { width: 120%; height: 120%; }
.st-theatre button.st-target.st-t-knot, .st-theatre button.st-target.st-t-leather:not(.st-done) { background: radial-gradient(circle, rgba(255, 250, 230, .55) 0%, rgba(255, 250, 230, .2) 55%, rgba(255, 250, 230, 0) 72%); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .75); }
.st-theatre button.st-target.st-t-stone, .st-theatre button.st-target.st-t-leather { border-radius: 40%; }
.st-theatre button.st-target.st-t-stone { width: max(76px, 18cqh); height: max(56px, 12cqh); }
.st-theatre button.st-target.st-t-stone svg { width: 100%; height: 100%; }
.st-theatre button.st-floor-target { translate: -50% 0; top: auto; }
.st-theatre button.st-target.st-done { pointer-events: none; animation: st-target-done .6s ease var(--delay, 0s) forwards; }
.st-theatre button.st-target.st-t-leather.st-done, .st-theatre button.st-target.st-t-stone.st-done { animation: st-target-keep .6s cubic-bezier(.3, 1.6, .5, 1) var(--delay, 0s) forwards; }
.st-theatre button.st-target.st-t-cloud.st-done { animation: st-cloud-away 1s ease-in var(--delay, 0s) forwards; }
.st-theatre.st-nudge button.st-target:not(.st-done) { animation: st-target-in .55s both, st-nudge-target .8s ease-in-out infinite; }
.st-theatre.st-nudge button.st-target:not(.st-done)::after { content: "👆"; position: absolute; left: 60%; top: 72%; font-size: max(26px, 6cqh); animation: st-point .8s ease-in-out infinite; pointer-events: none; }
@keyframes st-target-in { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
@keyframes st-target-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes st-nudge-target { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes st-target-done { 0% { transform: scale(1); opacity: 1; } 35% { transform: scale(1.4) rotate(20deg); opacity: 1; } 100% { transform: scale(.2) rotate(90deg); opacity: 0; } }
@keyframes st-target-keep { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); background: radial-gradient(circle, rgba(255, 240, 180, .25), rgba(255, 240, 180, 0) 70%); } }
@keyframes st-cloud-away { 0% { transform: translate(0, 0) scale(1); opacity: 1; } 100% { transform: translate(40cqh, -20cqh) scale(.6); opacity: 0; } }
@keyframes st-point { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-6px, -8px); } }

/* finding a friend: everybody can be tapped */
.st-theatre .st-ent.st-findable { cursor: pointer; }
.st-theatre.st-awaiting[data-moment="find"] .st-ent.st-findable .st-art { filter: drop-shadow(0 .9cqh .9cqh rgba(3, 8, 22, .42)) drop-shadow(0 0 1.4cqh rgba(255, 255, 255, .35)); }
.st-theatre.st-nudge .st-ent.st-find-target .st-art { filter: drop-shadow(0 0 2.6cqh rgba(255, 220, 110, .95)); animation: st-glowpulse 1s ease-in-out infinite; }
.st-theatre.st-nudge .st-ent.st-find-target::after { content: "👇"; position: absolute; left: 50%; top: -16%; translate: -50% 0; font-size: max(26px, 6cqh); animation: st-point .8s ease-in-out infinite; }

/* ------------------------------------------------------------------ stars for joining in, and the small buttons */
.st-theatre .st-stars { position: absolute; top: 1%; right: 2%; display: flex; gap: 4px; padding: 5px 8px; border-radius: 999px; background: rgba(10, 22, 36, .5); z-index: 45; }
.st-theatre .st-star { display: block; width: 18px; height: 18px; }
.st-theatre .st-star svg { width: 100%; height: 100%; display: block; }
.st-theatre .st-star path { fill: rgba(255, 255, 255, .22); stroke: rgba(255, 255, 255, .35); stroke-width: 1; transition: fill .4s ease; }
.st-theatre .st-star.st-lit path { fill: var(--st-gold); stroke: #fff6c9; }
.st-theatre .st-star-pop { animation: st-star-pop .7s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes st-star-pop { 0% { transform: scale(1); } 40% { transform: scale(1.9) rotate(30deg); } 100% { transform: scale(1); } }

.st-theatre .st-bar {
  transition: opacity .3s ease;
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--st-bar);
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: nowrap; z-index: 50; pointer-events: none;
}
.st-theatre button.st-nav {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 999px; white-space: nowrap;
  background: rgba(14, 34, 30, .74); border: 1.5px solid rgba(255, 246, 220, .55); color: #fff8e0;
  font-size: 15px; font-weight: 700; line-height: 1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.st-theatre button.st-nav:hover { background: rgba(22, 52, 44, .88); }
.st-theatre button.st-nav span { font-size: 16px; }

/* ------------------------------------------------------------------ phones: a smaller stage, the same theatre */
@media (max-width: 820px) {
  .st-theatre { --st-bar: 48px; }
  .st-theatre .st-bar { gap: 6px; }
  .st-theatre button.st-nav { padding: 0 11px; font-size: 13px; min-height: 40px; }
  .st-theatre button.st-nav span { display: none; }
  /* the big button and the numbers sit in the button row, so they never hide a friend's face */
  .st-theatre button.st-big { right: 50%; translate: 50% 0; bottom: calc(-1 * var(--st-bar) + 2px); min-height: 64px; }
  .st-theatre .st-nums, .st-theatre .st-moment[data-side] .st-nums { top: auto; left: 0; right: 0; bottom: calc(-1 * var(--st-bar) + 2px); }
  .st-theatre .st-moment[data-side="left"] button.st-big { left: auto; right: 50%; }
  .st-theatre button.st-num { width: 72px; height: 72px; }
  .st-theatre[data-moment="act"] .st-bar, .st-theatre[data-moment="say"] .st-bar, .st-theatre[data-moment="count"] .st-bar { opacity: 0; pointer-events: none; }
  .st-theatre[data-moment="act"] .st-bar button, .st-theatre[data-moment="say"] .st-bar button, .st-theatre[data-moment="count"] .st-bar button { pointer-events: none; }
  .st-theatre .st-cards { gap: 2cqw; top: 4%; bottom: 3%; }
  .st-theatre button.st-card { --cw: min(42cqw, 60cqh); }
  .st-theatre .st-ideas button.st-card { --cw: min(40cqw, 54cqh); }
  .st-theatre .st-stars { top: 0; right: 0; padding: 4px 6px; }
  .st-theatre .st-star { width: 14px; height: 14px; }
}

/* ------------------------------------------------------------------ calm motion: no bobbing or flying, gentle fades only */
@media (prefers-reduced-motion: reduce) {
  .st-theatre .st-bob, .st-theatre .st-ent.st-focus .st-bob, .st-theatre .st-ent.st-walking .st-bob, .st-theatre .st-ent.st-sky .st-bob,
  .st-theatre .st-rays, .st-theatre .st-flap, .st-theatre .st-scarf, .st-theatre .st-shiver, .st-theatre .st-leg, .st-theatre .st-nod,
  .st-theatre .st-gust, .st-theatre .st-bub, .st-theatre .st-wave, .st-theatre .st-flame, .st-theatre .st-sunglow { animation: none !important; }
  .st-theatre .st-act[class*="st-a-"], .st-theatre .st-act[class*="st-in-"], .st-theatre .st-act.st-out-drop, .st-theatre .st-pose-pop { animation: st-in-fade .4s ease both !important; }
  .st-theatre .st-ent { transition: opacity .4s ease !important; }
  .st-theatre .st-fxbox > i, .st-theatre .st-fxbox > b { animation: st-calm 1.6s ease forwards !important; transform: none !important; }
  .st-theatre .st-fx-confetti, .st-theatre .st-fx-gust, .st-theatre .st-fx-roar, .st-theatre .st-fx-zoom { display: none; }
  .st-theatre button.st-big, .st-theatre button.st-card, .st-theatre button.st-num, .st-theatre button.st-target,
  .st-theatre.st-nudge button.st-big, .st-theatre.st-nudge button.st-card, .st-theatre.st-nudge button.st-num, .st-theatre.st-nudge button.st-target:not(.st-done) { animation: st-in-fade .3s ease both !important; }
  .st-theatre.st-nudge button.st-card, .st-theatre.st-nudge button.st-big, .st-theatre.st-nudge button.st-num, .st-theatre.st-nudge button.st-target:not(.st-done) { box-shadow: 0 0 0 6px rgba(255, 214, 90, .8) !important; }
  .st-theatre button.st-target.st-done { animation: none !important; opacity: .0; }
  .st-theatre button.st-target.st-t-leather.st-done, .st-theatre button.st-target.st-t-stone.st-done { opacity: 1; }
  .st-theatre.st-nudge button.st-target:not(.st-done)::after, .st-theatre.st-nudge .st-ent.st-find-target::after { animation: none; }
  .st-theatre .st-zz, .st-theatre .st-steam { animation: none; opacity: .8; }
}
@keyframes st-calm { 0% { opacity: 0; } 20%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* a break: everything holds still */
.st-theatre.st-paused *, .st-theatre.st-paused *::before, .st-theatre.st-paused *::after { animation-play-state: paused !important; }

/* v14.37.1 Lion and Mouse together, made from the two friends' own pictures (on the stage it is an .st-svg) */
.st-theatre .st-card-art .st-card-png .st-card-duo { display: block; width: 100%; height: 100%; overflow: visible; }
