/* ================================================================
   THE BANANA THAT COULDN'T STOP DANCING — 30s vertical animatic
   Design: claymorphism, rose + engagement blue, Baloo 2 / Comic Neue
   ================================================================ */
:root {
  --rose: #E11D48;
  --rose-soft: #FB7185;
  --blue: #2563EB;
  --bg: #FFF1F2;
  --ink: #3B1A46;
  --ink-soft: #6B4159;
  --card: #FFFFFF;
  --line: #FECDD3;
  --mint: #22B8A6;
  --sun: #FFC93C;
  --beat: .469s;              /* 128 BPM */
  --shadow-sm: 0 2px 0 rgba(225, 29, 72, .12), 0 8px 20px rgba(136, 19, 55, .08);
  --shadow-lg: 0 4px 0 rgba(225, 29, 72, .10), 0 22px 48px rgba(136, 19, 55, .14);
  --font-head: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  --font-body: 'Comic Neue', 'Comic Sans MS', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 8% -6%, #FFE3EC 0%, transparent 60%),
    radial-gradient(800px 620px at 96% 4%, #E7F7F4 0%, transparent 58%),
    radial-gradient(700px 520px at 50% 108%, #FFF3D6 0%, transparent 62%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.blob { position: fixed; border-radius: 50%; filter: blur(6px); opacity: .5; pointer-events: none; z-index: 0; }
.b1 { width: 300px; height: 300px; left: -90px; top: 24%; background: radial-gradient(circle at 34% 30%, #FFD3E2, #FFB3CC); }
.b2 { width: 240px; height: 240px; right: -70px; top: 12%; background: radial-gradient(circle at 34% 30%, #CFF5EE, #9BE6DA); }
.b3 { width: 190px; height: 190px; right: 12%; bottom: -40px; background: radial-gradient(circle at 34% 30%, #FFF0B8, #FFDE7A); }

/* ---------------- top bar ---------------- */
.topbar {
  position: relative; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(14px, 4vw, 40px) 10px;
  max-width: 1180px; margin: 0 auto; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  font-size: 24px; border-radius: 16px;
  background: linear-gradient(160deg, #FFF3C4, #FFD84D);
  box-shadow: inset 0 -4px 0 rgba(180, 120, 0, .25), 0 8px 18px rgba(200, 150, 0, .22);
}
.brand-text { display: grid; line-height: 1.15; min-width: 0; }
.brand-text strong {
  font-family: var(--font-head); font-weight: 800; letter-spacing: -.3px;
  font-size: clamp(15px, 2.2vw, 20px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text em { font-style: normal; font-size: 12.5px; color: var(--ink-soft); letter-spacing: .3px; }
.top-actions { display: flex; gap: 8px; flex: none; }
.chip {
  font-family: var(--font-head); font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  padding: 9px 14px; border-radius: 999px; border: 2px solid var(--line);
  background: #fff; color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.chip:hover { transform: translateY(-2px); box-shadow: 0 4px 0 rgba(225, 29, 72, .12), 0 14px 26px rgba(136, 19, 55, .14); }
.chip:active { transform: translateY(0) scale(.97); }
.chip[aria-pressed="false"] { opacity: .55; }
.chip:focus-visible, .ctrl:focus-visible, .big-play:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
/* ---------------- layout ---------------- */
.wrap {
  position: relative; z-index: 2;
  max-width: 1180px; margin: 0 auto;
  padding: 6px clamp(14px, 4vw, 40px) 44px;
  display: grid; grid-template-columns: auto minmax(260px, 330px);
  gap: clamp(20px, 3vw, 34px); align-items: start; justify-content: center;
}
.player-card {
  background: #fff; border: 2px solid #FFE0E7; border-radius: 34px;
  padding: 14px 14px 10px; box-shadow: var(--shadow-lg);
  position: relative;
}
.stage-shell { display: grid; place-items: center; position: relative; }

.stage {
  position: relative; width: min(100%, 392px); aspect-ratio: 9 / 16;
  border-radius: 26px; overflow: hidden; isolation: isolate;
  container-type: size;
  background: #FFD9E6;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55), inset 0 0 60px rgba(180, 60, 110, .18);
}
@media (max-height: 780px) { .stage { width: min(100%, 330px); } }
.frame-glow {
  position: absolute; inset: -10px -10px auto; height: 70%; z-index: -1;
  background: radial-gradient(60% 60% at 50% 20%, rgba(255, 190, 210, .55), transparent 70%);
  filter: blur(18px);
}

/* ---------------- stage background ---------------- */
.bg, .bg > * { position: absolute; }
.bg { inset: 0; }
.wall {
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 4%, #FFF3F8 0%, #FFE1EE 38%, #FFCCE0 68%, #FBB6D0 100%);
}
.beam {
  inset: -30%;
  background: linear-gradient(112deg, transparent 32%, rgba(255, 255, 255, .55) 46%, transparent 58%);
  mix-blend-mode: screen; opacity: .75;
}
.counter {
  left: -14%; right: -14%; bottom: -1px; height: 30%;
  background: linear-gradient(180deg, #FFF8E9, #FFE9C8 54%, #F6D3AC);
  border-radius: 46% 46% 0 0 / 16% 16% 0 0;
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, .85), inset 0 20px 40px rgba(214, 140, 90, .18);
}
.counter-edge {
  left: -14%; right: -14%; bottom: 28.4%; height: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
  border-radius: 50%; filter: blur(2px);
}
.sunburst {
  left: 50%; top: 36%; width: 190%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .38) 0deg 5deg, transparent 5deg 17deg);
  -webkit-mask-image: radial-gradient(closest-side, rgba(0, 0, 0, .9) 12%, transparent 74%);
  mask-image: radial-gradient(closest-side, rgba(0, 0, 0, .9) 12%, transparent 74%);
  opacity: .3; animation: slowSpin 60s linear infinite;
}
@keyframes slowSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.bokeh i {
  position: absolute; display: block; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fff, rgba(255, 255, 255, .1));
  opacity: .55; animation: floaty 9s ease-in-out infinite;
}
.bokeh i:nth-child(1) { width: 26px; height: 26px; left: 12%; top: 22%; animation-delay: -1s; }
.bokeh i:nth-child(2) { width: 14px; height: 14px; left: 78%; top: 16%; animation-delay: -3s; }
.bokeh i:nth-child(3) { width: 34px; height: 34px; left: 66%; top: 52%; animation-delay: -5s; opacity: .3; }
.bokeh i:nth-child(4) { width: 10px; height: 10px; left: 24%; top: 62%; animation-delay: -2s; }
.bokeh i:nth-child(5) { width: 18px; height: 18px; left: 86%; top: 68%; animation-delay: -7s; opacity: .35; }
.bokeh i:nth-child(6) { width: 12px; height: 12px; left: 44%; top: 10%; animation-delay: -4s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-22px) scale(1.14); }
}
/* ---------------- staging ---------------- */
.set { position: absolute; inset: 0; }
.slot {
  position: absolute; bottom: 20%; left: 50%; width: 40%;
  transform: translateX(-50%);
  transition: left .52s cubic-bezier(.4, 0, .2, 1), bottom .52s cubic-bezier(.4, 0, .2, 1),
              width .52s cubic-bezier(.4, 0, .2, 1), opacity .34s ease;
  will-change: left, bottom, width;
}
.slot .rig { width: 100%; }
.slot-lunchbox { z-index: 2; }
.slot-pillow { z-index: 1; }
.slot-banana { z-index: 4; }
.slot-strawberry { z-index: 5; }
.slot-blueberry { z-index: 6; }
.slot-broccoli { z-index: 7; }

/* off-stage rest positions */
.slot-strawberry { left: 126%; bottom: 24%; width: 34%; }
.slot-blueberry { left: -26%; bottom: 14%; width: 28%; }
.slot-broccoli { left: 124%; bottom: 10%; width: 32%; }
.slot-lunchbox { left: 50%; bottom: 5%; width: 46%; }
.slot-pillow { left: 50%; bottom: 3%; width: 34%; opacity: 0; }

/* SCENE 1 — the hook */
.stage[data-scene="hook"] .slot-banana { left: 50%; bottom: 21%; width: 44%; }
.stage[data-scene="hook"] .slot-lunchbox { z-index: 8; }

/* SCENE 2 — the surprise */
.stage[data-scene="scene2"] .slot-banana { left: 37%; bottom: 24%; width: 42%; }
.stage[data-scene="scene2"] .slot-strawberry { left: 74%; bottom: 22%; width: 34%; }
.stage[data-scene="scene2"] .slot-lunchbox { left: 10%; bottom: 2%; width: 28%; opacity: .5; }

/* SCENE 3 — the challenge */
.stage[data-scene="scene3"] .slot-banana { left: 32%; bottom: 34%; width: 36%; }
.stage[data-scene="scene3"] .slot-strawberry { left: 74%; bottom: 29%; width: 32%; }
.stage[data-scene="scene3"] .slot-blueberry { left: 28%; bottom: 11%; width: 26%; }
.stage[data-scene="scene3"] .slot-lunchbox { opacity: 0; bottom: -10%; }

/* SCENE 4 — the chaos */
.stage[data-scene="scene4"] .slot-banana { left: 29%; bottom: 37%; width: 32%; }
.stage[data-scene="scene4"] .slot-strawberry { left: 73%; bottom: 34%; width: 28%; }
.stage[data-scene="scene4"] .slot-blueberry { left: 25%; bottom: 13%; width: 24%; }
.stage[data-scene="scene4"] .slot-broccoli { left: 75%; bottom: 11%; width: 30%; }
.stage[data-scene="scene4"] .slot-lunchbox { opacity: 0; }

/* SCENE 5 — the payoff */
.stage[data-scene="scene5"] .slot-banana { left: 23%; bottom: 37%; width: 30%; }
.stage[data-scene="scene5"] .slot-strawberry { left: 77%; bottom: 35%; width: 26%; }
.stage[data-scene="scene5"] .slot-blueberry { left: 24%; bottom: 12%; width: 22%; }
.stage[data-scene="scene5"] .slot-broccoli { left: 51%; bottom: 15%; width: 34%; }
.stage[data-scene="scene5"] .slot-lunchbox { opacity: 0; }

/* SCENE 6 — the loop */
.stage[data-scene="scene6"] .slot-banana { left: 63%; bottom: 25%; width: 38%; }
.stage[data-scene="scene6"] .slot-pillow { left: 66%; bottom: 7%; width: 38%; opacity: 1; }
.stage[data-scene="scene6"] .slot-lunchbox { left: 30%; bottom: 5%; width: 42%; opacity: 1; z-index: 8; }
.stage[data-scene="scene6"] .slot-strawberry { left: 126%; opacity: 0; }
.stage[data-scene="scene6"] .slot-blueberry { left: -30%; opacity: 0; }
.stage[data-scene="scene6"] .slot-broccoli { left: 128%; opacity: 0; }
/* ---------------- characters ---------------- */
.char { display: block; width: 100%; height: auto; overflow: visible; }
.rig { transform-origin: 50% 96%; will-change: transform; }
.rig, .body, .arm, .leg { transform-box: view-box; }

/* mouths (one visible at a time) */
.mouths .m { opacity: 0; transition: opacity .1s linear; }
.stage[data-mood="smile"] .mouths .m.smile,
.stage[data-mood="open"] .mouths .m.open,
.stage[data-mood="shout"] .mouths .m.shout,
.stage[data-mood="o"] .mouths .m.o,
.stage[data-mood="flat"] .mouths .m.flat,
.stage[data-mood="laugh"] .mouths .m.laugh { opacity: 1; }
.rig[data-mood] .mouths .m { opacity: 0; }
.rig[data-mood="smile"] .mouths .m.smile,
.rig[data-mood="open"] .mouths .m.open,
.rig[data-mood="shout"] .mouths .m.shout,
.rig[data-mood="o"] .mouths .m.o,
.rig[data-mood="flat"] .mouths .m.flat,
.rig[data-mood="laugh"] .mouths .m.laugh { opacity: 1; }

/* eyes */
.lid { transform-box: fill-box; transform-origin: center; transform: scaleY(0); animation: blink 5.2s infinite; }
.strawberry .lid { fill: #F43F5E; } .blueberry .lid { fill: #5B6BF0; }
.broccoli .lid { fill: #B6E07C; } .banana .lid { fill: #FFD028; }
@keyframes blink { 0%, 91%, 97%, 100% { transform: scaleY(0); } 94% { transform: scaleY(1); } }
.brow { transform-box: fill-box; transform-origin: center; transition: transform .18s ease; }
.eyes-under { opacity: 0; transition: opacity .22s ease; }
.shades { transform-box: fill-box; transform-origin: center; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.rig[data-mood="shock"] .shades { transform: translateY(-26px) rotate(-7deg); }
.rig[data-mood="shock"] .eyes-under { opacity: 1; }
.rig[data-mood="shock"] .brow { transform: translateY(-9px); }
.blush { transition: opacity .2s; }

/* limb pivots */
.banana .arm-l { --ax: 56px; --ay: 116px; } .banana .arm-r { --ax: 132px; --ay: 104px; }
.banana .leg-l { --ax: 80px; --ay: 188px; } .banana .leg-r { --ax: 112px; --ay: 190px; }
.strawberry .arm-l { --ax: 52px; --ay: 122px; } .strawberry .arm-r { --ax: 146px; --ay: 120px; }
.strawberry .leg-l { --ax: 82px; --ay: 186px; } .strawberry .leg-r { --ax: 114px; --ay: 186px; }
.blueberry .arm-l { --ax: 40px; --ay: 122px; } .blueberry .arm-r { --ax: 160px; --ay: 122px; }
.blueberry .leg-l { --ax: 78px; --ay: 176px; } .blueberry .leg-r { --ax: 122px; --ay: 176px; }
.broccoli .arm-l { --ax: 62px; --ay: 150px; } .broccoli .arm-r { --ax: 138px; --ay: 150px; }
.broccoli .leg-l { --ax: 80px; --ay: 192px; } .broccoli .leg-r { --ax: 120px; --ay: 192px; }
.arm, .leg { transform: translate(var(--ax, 0px), var(--ay, 0px)) rotate(0deg); }

/* ---------------- motion library ---------------- */
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-4%) rotate(1.5deg); } }
@keyframes dance {
  0%   { transform: translateY(0) rotate(-5deg) scale(1.07, .93); }
  32%  { transform: translateY(-15%) rotate(4deg) scale(.95, 1.07); }
  62%  { transform: translateY(-3%) rotate(-2deg) scale(1.03, .97); }
  100% { transform: translateY(0) rotate(-5deg) scale(1.07, .93); }
}
@keyframes danceFast {
  0%   { transform: translateY(-2%) rotate(7deg) scale(.92, 1.1); }
  50%  { transform: translateY(-16%) rotate(-8deg) scale(1.1, .9); }
  100% { transform: translateY(-2%) rotate(7deg) scale(.92, 1.1); }
}
@keyframes popOut {
  0%   { transform: translateY(46%) scale(.16, .12); opacity: 0; }
  45%  { transform: translateY(-18%) scale(1.16, .92); opacity: 1; }
  68%  { transform: translateY(4%) scale(.94, 1.07); }
  100% { transform: translateY(0) scale(1, 1); opacity: 1; }
}
@keyframes hop {
  0% { transform: translateY(0) scale(1.1, .88); }
  42% { transform: translateY(-30%) scale(.94, 1.08) rotate(-7deg); }
  100% { transform: translateY(0) scale(1.1, .88); }
}
@keyframes spin { to { transform: rotate(360deg) scale(1, 1); } }
@keyframes spinOnce {
  0% { transform: rotate(0) scale(1.06, .94); }
  100% { transform: rotate(360deg) scale(1.06, .94); }
}
@keyframes wobble {
  0%, 100% { transform: rotate(-9deg) translateX(-2%); }
  50% { transform: rotate(9deg) translateX(2%); }
}
@keyframes enterRight {
  0% { opacity: 0; transform: translateX(180%) rotate(18deg); }
  70% { opacity: 1; transform: translateX(-6%) rotate(-6deg); }
  100% { opacity: 1; transform: translateX(0) rotate(0); }
}
@keyframes enterTop {
  0% { opacity: 0; transform: translateY(-160%) scale(.8); }
  62% { opacity: 1; transform: translateY(6%) scale(1.08, .9); }
  100% { opacity: 1; transform: translateY(0) scale(1, 1); }
}
@keyframes squashLand {
  0% { transform: scale(1.28, .74) translateY(6%); }
  40% { transform: scale(.9, 1.14) translateY(-6%); }
  100% { transform: scale(1, 1) translateY(0); }
}
@keyframes moonwalk {
  0% { transform: translateX(6%) rotate(-4deg) scale(1.02, .98); }
  50% { transform: translateX(-16%) rotate(3deg) scale(.98, 1.02); }
  100% { transform: translateX(-34%) rotate(-2deg) scale(1.02, .98); }
}
@keyframes laughBounce {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-9%) rotate(3deg); }
}
@keyframes armWagL { 0%, 100% { transform: translate(var(--ax), var(--ay)) rotate(-14deg); } 50% { transform: translate(var(--ax), var(--ay)) rotate(-62deg); } }
@keyframes armWagR { 0%, 100% { transform: translate(var(--ax), var(--ay)) rotate(14deg); } 50% { transform: translate(var(--ax), var(--ay)) rotate(62deg); } }
@keyframes armUpL { 0%, 100% { transform: translate(var(--ax), var(--ay)) rotate(-96deg); } 50% { transform: translate(var(--ax), var(--ay)) rotate(-118deg); } }
@keyframes armUpR { 0%, 100% { transform: translate(var(--ax), var(--ay)) rotate(96deg); } 50% { transform: translate(var(--ax), var(--ay)) rotate(118deg); } }
@keyframes armFlail { 0% { transform: translate(var(--ax), var(--ay)) rotate(-24deg); } 30% { transform: translate(var(--ax), var(--ay)) rotate(-128deg); } 60% { transform: translate(var(--ax), var(--ay)) rotate(-14deg); } 100% { transform: translate(var(--ax), var(--ay)) rotate(-134deg); } }
@keyframes legStepL { 0%, 100% { transform: translate(var(--ax), var(--ay)) rotate(9deg); } 50% { transform: translate(var(--ax), var(--ay)) rotate(-11deg); } }
@keyframes legStepR { 0%, 100% { transform: translate(var(--ax), var(--ay)) rotate(-11deg); } 50% { transform: translate(var(--ax), var(--ay)) rotate(9deg); } }
@keyframes legShuffleL { 0% { transform: translate(var(--ax), var(--ay)) rotate(16deg) translateX(0); } 50% { transform: translate(var(--ax), var(--ay)) rotate(-6deg) translateX(-6px); } 100% { transform: translate(var(--ax), var(--ay)) rotate(16deg) translateX(0); } }
@keyframes legShuffleR { 0% { transform: translate(var(--ax), var(--ay)) rotate(-6deg) translateX(-6px); } 50% { transform: translate(var(--ax), var(--ay)) rotate(16deg) translateX(0); } 100% { transform: translate(var(--ax), var(--ay)) rotate(-6deg) translateX(-6px); } }

/* continuous dance states */
.stage.dancing .rig { animation: dance calc(var(--beat) * 2) cubic-bezier(.45, .05, .55, .95) infinite; }
.stage.dancing .arm-l { animation: armWagL calc(var(--beat) * 2) ease-in-out infinite; }
.stage.dancing .arm-r { animation: armWagR calc(var(--beat) * 2) ease-in-out infinite; animation-delay: calc(var(--beat) * -1); }
.stage.dancing .leg-l { animation: legStepL var(--beat) ease-in-out infinite; }
.stage.dancing .leg-r { animation: legStepR var(--beat) ease-in-out infinite; animation-delay: calc(var(--beat) * -.5); }
.stage.dancing.shout .arm-l { animation-name: armFlail; animation-duration: calc(var(--beat) * 1.5); }
.stage.dancing.shout .arm-r { animation-name: armFlail; animation-duration: calc(var(--beat) * 1.5); animation-direction: reverse; }
.stage.dancing.fast .rig { animation: danceFast var(--beat) ease-in-out infinite; }
.stage.dancing.fast .leg-l { animation-duration: calc(var(--beat) * .62); }
.stage.dancing.fast .leg-r { animation-duration: calc(var(--beat) * .62); }
.stage.dancing.up .arm-l { animation-name: armUpL; }
.stage.dancing.up .arm-r { animation-name: armUpR; }
.stage.moonwalking .arm-l { animation: armUpL calc(var(--beat) * 2) ease-in-out infinite; }
.stage.moonwalking .arm-r { animation: armUpR calc(var(--beat) * 2) ease-in-out infinite; }
.stage.moonwalking .leg-l { animation: legShuffleL calc(var(--beat) * .8) ease-in-out infinite; }
.stage.moonwalking .leg-r { animation: legShuffleR calc(var(--beat) * .8) ease-in-out infinite; }
.stage.idle .rig { animation: bob calc(var(--beat) * 4) ease-in-out infinite; }

/* one-shots live on the inner svg so they compose with the dance loop */
.char { transform-box: view-box; transform-origin: 50% 96%; }
.a-pop { animation: popOut .78s cubic-bezier(.34, 1.42, .64, 1) both; }
.a-hop { animation: hop .58s cubic-bezier(.3, .9, .4, 1); }
.a-spin { animation: spinOnce .9s cubic-bezier(.4, 0, .2, 1); }
.a-wobble { animation: wobble .42s ease-in-out 3; }
.a-in-r { animation: enterRight .85s cubic-bezier(.2, .9, .3, 1) both; }
.a-in-t { animation: enterTop .8s cubic-bezier(.3, 1.3, .6, 1) both; }
.a-squash { animation: squashLand .62s ease-out; }
.a-moon { animation: moonwalk 1.8s ease-in-out both; }
.a-laugh { animation: laughBounce .3s ease-in-out infinite; }
.a-out { animation: popOut .45s ease-in reverse both; }
.stage.frozen .rig, .stage.frozen .char, .stage.frozen .arm, .stage.frozen .leg,
.stage.frozen .body, .stage.frozen .pupil, .stage.frozen .brow { animation-play-state: paused !important; }
.stage.frozen .sunburst { animation-play-state: paused; }

/* ---------------- FX layer ---------------- */
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.star { position: absolute; width: 0; height: 0; }
.star svg { position: absolute; transform: translate(-50%, -50%); animation: starPop .85s ease-out forwards; overflow: visible; }
@keyframes starPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.15) rotate(0deg); }
  32% { opacity: 1; transform: translate(-50%, -50%) scale(1.2) rotate(38deg); }
  100% { opacity: 0; transform: translate(-50%, -140%) scale(.55) rotate(110deg); }
}
.confetti {
  position: absolute; top: -8%; width: 9px; height: 14px; border-radius: 3px;
  animation: confettiFall var(--dur, 2.6s) linear var(--delay, 0s) forwards;
  opacity: .95;
}
@keyframes confettiFall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(var(--sc, 1)); opacity: 0; }
  8% { opacity: 1; }
  100% { transform: translate3d(var(--dx, 0px), 118cqh, 0) rotate(var(--rot, 720deg)) scale(var(--sc, 1)); opacity: .85; }
}
.ring {
  position: absolute; border-radius: 50%; border: 4px solid #fff;
  animation: ringOut .7s ease-out forwards; pointer-events: none;
}
@keyframes ringOut { 0% { transform: translate(-50%, -50%) scale(.2); opacity: .95; } 100% { transform: translate(-50%, -50%) scale(2.4); opacity: 0; } }
.speedline {
  position: absolute; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .95));
  animation: speedZip .45s ease-out forwards;
}
@keyframes speedZip { 0% { transform: translateX(30%) scaleX(.4); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateX(-140%) scaleX(1.4); opacity: 0; } }

/* ---------------- captions & sound words ---------------- */
.caption {
  position: absolute; left: 50%; top: 11.5%; transform: translateX(-50%);
  width: 90%; display: flex; justify-content: center; z-index: 24;
  opacity: 0; transition: opacity .16s ease; pointer-events: none;
}
.caption.show { opacity: 1; }
.caption span {
  display: inline-block; font-family: var(--font-head); font-weight: 800;
  font-size: clamp(17px, 6.6cqw, 34px); line-height: 1.08; letter-spacing: -.4px;
  color: #43172F; text-align: center; padding: .24em .62em;
  background: rgba(255, 255, 255, .93); border: 3px solid #fff; border-radius: 18px;
  box-shadow: 0 3px 0 rgba(225, 29, 72, .14), 0 12px 26px rgba(136, 19, 55, .2);
  animation: capIn .3s cubic-bezier(.34, 1.56, .64, 1);
  max-width: 100%;
}
.caption span.kid { color: #C4103F; }
.caption span.yell { background: #FFE24A; border-color: #fff; color: #7A2A00; transform: rotate(-1.5deg); }
@keyframes capIn { 0% { transform: scale(.7) rotate(-3deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.stage[data-scene="hook"] .caption, .stage[data-scene="scene6"] .caption { top: 9%; }

.sfx-word {
  position: absolute; left: 50%; top: 46%; z-index: 23; pointer-events: none;
  font-family: var(--font-head); font-weight: 800; font-size: 11cqw;
  color: #fff; letter-spacing: -1px; opacity: 0;
  -webkit-text-stroke: 7px #C4103F; paint-order: stroke fill;
  text-shadow: 0 6px 0 rgba(140, 20, 60, .25);
}
.sfx-word.go { animation: wordPop .72s cubic-bezier(.34, 1.56, .64, 1) forwards; }
@keyframes wordPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3) rotate(-14deg); }
  30% { opacity: 1; transform: translate(-50%, -50%) scale(1.18) rotate(4deg); }
  62% { opacity: 1; transform: translate(-50%, -58%) scale(1) rotate(-2deg); }
  100% { opacity: 0; transform: translate(-50%, -88%) scale(1.02) rotate(2deg); }
}

/* ---------------- HUD ---------------- */
.hud {
  position: absolute; left: 4%; right: 4%; top: 3.2%; z-index: 26;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  pointer-events: none;
}
.hud-chip {
  font-family: var(--font-head); font-weight: 700; font-size: clamp(9px, 2.5cqw, 12px);
  padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .78);
  color: #7A2A4E; box-shadow: 0 2px 8px rgba(136, 19, 55, .12);
  letter-spacing: .4px; text-transform: uppercase; white-space: nowrap;
}
.hud-chip.time { margin-left: auto; font-variant-numeric: tabular-nums; background: rgba(255, 255, 255, .62); }
.hud-chip.loop { opacity: 0; transition: opacity .3s; }
.stage[data-scene="scene6"] .hud-chip.loop { opacity: 1; animation: pulseLoop 1.1s ease-in-out infinite; }
@keyframes pulseLoop { 50% { transform: scale(1.09); } }

/* ---------------- cover ---------------- */
.cover {
  position: absolute; inset: 0; z-index: 30; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(255, 245, 250, .96), rgba(255, 214, 232, .96));
  transition: opacity .4s ease, visibility .4s;
  text-align: center; padding: 8%;
}
.cover-inner { display: grid; justify-items: center; gap: 10px; }
.cover .kicker {
  margin: 0; font-family: var(--font-head); font-weight: 700; font-size: clamp(9px, 3cqw, 12px);
  letter-spacing: 2.4px; text-transform: uppercase; color: #C4103F;
}
.cover h1 {
  margin: 0; font-family: var(--font-head); font-weight: 800; letter-spacing: -1.6px;
  font-size: clamp(24px, 10.4cqw, 46px); line-height: .98; color: #43172F;
  text-shadow: 0 4px 0 rgba(255, 255, 255, .9);
}
.cover-sub { margin: 0; font-size: clamp(11px, 3.2cqw, 14px); color: #7A2A4E; }
.big-play {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  margin-top: 6px; padding: 14px 26px; border: 0; border-radius: 999px;
  font-family: var(--font-head); font-weight: 800; font-size: clamp(15px, 4.6cqw, 20px);
  color: #fff; background: linear-gradient(165deg, #FF5C7C, #E11D48 60%, #BE1139);
  box-shadow: inset 0 -5px 0 rgba(120, 0, 30, .3), 0 12px 26px rgba(225, 29, 72, .38);
  transition: transform .18s ease, box-shadow .18s ease;
}
.big-play:hover { transform: translateY(-3px) scale(1.03); box-shadow: inset 0 -5px 0 rgba(120, 0, 30, .3), 0 18px 34px rgba(225, 29, 72, .44); }
.big-play:active { transform: translateY(0) scale(.97); }
.tri {
  width: 0; height: 0; border-left: 13px solid #fff;
  border-top: 8px solid transparent; border-bottom: 8px solid transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .15));
}
.cover-hint { margin: 2px 0 0; font-size: clamp(10px, 2.8cqw, 12px); color: #8C4A67; }
.stage.playing .cover { opacity: 0; visibility: hidden; }

/* ---------------- controls ---------------- */
.controls {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 6px 4px;
}
.ctrl {
  flex: none; width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  border: 2px solid #FFE0E7; background: #fff; color: var(--ink);
  font-size: 16px; line-height: 1; display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: transform .16s, box-shadow .16s, background .16s;
}
.ctrl:hover { transform: translateY(-2px); }
.ctrl.main { background: linear-gradient(165deg, #FF5C7C, #E11D48); color: #fff; border-color: transparent; width: 46px; height: 46px; font-size: 17px; }
.progress {
  position: relative; flex: 1; height: 12px; border-radius: 999px;
  background: #FFE4EA; cursor: pointer; overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(180, 60, 100, .16);
}
.progress-fill { position: absolute; inset: 0 auto 0 0; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #FFB03A, #FF5C7C 60%, #E11D48); }
.progress-marks { position: absolute; inset: 0; display: flex; }
.progress-marks i { flex: 1; border-right: 1.5px solid rgba(255, 255, 255, .85); }
.progress-marks i:last-child { border-right: 0; }
.tc { font-family: var(--font-head); font-weight: 700; font-size: 12px; color: #8C4A67; font-variant-numeric: tabular-nums; min-width: 46px; text-align: right; }

.beats { display: flex; gap: 6px; padding: 8px 6px 2px; overflow-x: auto; scrollbar-width: none; }
.beats::-webkit-scrollbar { display: none; }
.beat-btn {
  flex: 1 1 0; min-width: 62px; cursor: pointer; border: 2px solid #FFE0E7; background: #fff;
  border-radius: 12px; padding: 6px 4px 7px; font-family: var(--font-head); font-weight: 700;
  font-size: 10.5px; color: #8C4A67; line-height: 1.15; transition: all .18s ease; text-align: center;
}
.beat-btn b { display: block; font-size: 11px; color: var(--ink); }
.beat-btn:hover { transform: translateY(-2px); border-color: #FFB3C4; }
.beat-btn[aria-current="true"] { background: linear-gradient(165deg, #FFF0F4, #FFE0E9); border-color: #FF9BB2; color: #C4103F; }

/* ---------------- side panel ---------------- */
.side {
  background: #fff; border: 2px solid #FFE0E7; border-radius: 28px;
  padding: 22px 22px 18px; box-shadow: var(--shadow-lg);
}
.side h2 { margin: 0 0 8px; font-family: var(--font-head); font-weight: 800; font-size: 19px; letter-spacing: -.3px; }
.side p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.beat-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.beat-list li {
  display: grid; grid-template-columns: 46px 1fr; gap: 10px; align-items: start;
  font-size: 13px; line-height: 1.4; color: var(--ink-soft);
  padding: 8px 10px; border-radius: 12px; background: #FFF7F9; border: 1px solid #FFE7ED;
  transition: background .2s, transform .2s;
}
.beat-list li.on { background: #FFE9F0; border-color: #FFB3C4; transform: translateX(2px); }
.beat-list b { font-family: var(--font-head); font-weight: 800; color: #C4103F; font-size: 12px; font-variant-numeric: tabular-nums; }
.beat-list strong { display: block; font-family: var(--font-head); color: var(--ink); font-size: 13px; }
.side .note { font-size: 12px; color: #9A6478; margin: 0; }

.foot {
  position: relative; z-index: 2; max-width: 1180px; margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 40px) 34px; font-size: 12px; color: #9A6478; line-height: 1.6;
}

/* camera shake */
.stage.shake { animation: camShake .42s ease-in-out; }
@keyframes camShake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-4px, 3px) rotate(-.5deg); }
  40% { transform: translate(5px, -2px) rotate(.4deg); }
  60% { transform: translate(-3px, -3px) rotate(-.3deg); }
  80% { transform: translate(3px, 2px) rotate(.25deg); }
}

@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; padding-bottom: 28px; }
  .player-card { width: min(100%, 430px); padding: 10px 10px 6px; border-radius: 28px; }
  .stage { width: 100%; }
  .side { width: min(100%, 430px); }
  .topbar { padding-bottom: 4px; }
  .beat-btn { min-width: 54px; }
}
@media (max-width: 420px) {
  .brand-text em { display: none; }
  .beats { gap: 4px; }
  .beat-btn { font-size: 9.5px; min-width: 50px; padding: 5px 3px 6px; }
  .beat-btn b { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .sunburst, .bokeh i, .stage.shake { animation: none !important; }
  .slot { transition-duration: .01ms; }
  .rig, .char, .arm, .leg { animation-duration: 1.6s !important; }
  .confetti { display: none; }
}

/* ---------------- individual overrides ---------------- */
.char.hidden { opacity: 0 !important; visibility: hidden; }
.rig.still, .rig.still .char, .rig.still .body, .rig.still .arm, .rig.still .leg {
  animation: none !important;
}
.rig.still .char { transform: none; }
.slot-blueberry .rig { opacity: 0; transition: opacity .3s ease; }
.stage[data-scene="scene3"] .slot-blueberry .rig,
.stage[data-scene="scene4"] .slot-blueberry .rig,
.stage[data-scene="scene5"] .slot-blueberry .rig { opacity: 1; }
.slot-broccoli .rig { opacity: 0; transition: opacity .3s ease; }
.stage[data-scene="scene4"] .slot-broccoli .rig,
.stage[data-scene="scene5"] .slot-broccoli .rig { opacity: 1; }
.slot-strawberry .rig { opacity: 1; }
.lunchbox .lid { transition: transform .38s cubic-bezier(.34, 1.56, .64, 1); }
.lunchbox.open .lid { transform: rotate(-104deg); }
.pillow.sq { animation: pillowSquish .5s ease-out; }
@keyframes pillowSquish { 40% { transform: scale(1.12, .72) translateY(14%); } 100% { transform: none; } }

/* ---------------- timeline marks + toggles ---------------- */
.progress-marks { position: absolute; inset: 0; pointer-events: none; }
.progress-marks i {
  position: absolute; top: 0; bottom: 0; width: 0;
  border-right: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 1px rgba(196, 16, 63, .12);
}
.stage[data-cc="off"] .caption { display: none; }
.chip.off { opacity: .45; text-decoration: line-through; }
.beat-btn em { font-style: normal; }
