/* BBSoB TOKEN ANIMATION V1 — presentation only. Everything is scoped to .bb-anim-on (set by anim.js). */

/* ---- signs of life: every figure breathes in its own rhythm (--bb-* are set per token by anim.js) */
.bb-anim-on .tok img{ will-change: transform; }
.bb-anim-on .tok.st-standing img{ animation: bb-breathe var(--bb-d, 2.8s) ease-in-out var(--bb-o, 0s) infinite; }
.bb-anim-on .tok.st-standing.done img{ animation-name: bb-tired; }
.bb-anim-on .tok.st-standing.sel img{ animation: bb-ready .9s ease-in-out var(--bb-o2, 0s) infinite; }
.bb-anim-on .tok.st-prone img{ animation: bb-groan var(--bb-d, 2.8s) ease-in-out var(--bb-o, 0s) infinite; }
.bb-anim-on .tok.st-stunned img{ animation: bb-dizzy 1.6s ease-in-out var(--bb-o3, 0s) infinite; }
@keyframes bb-breathe{
  0%, 100%{ transform: translateY(0) scale(1, 1) rotate(0deg); }
  50%{ transform: translateY(-3%) scale(1.025, .975) rotate(var(--bb-r, .8deg)); }
}
@keyframes bb-tired{
  0%, 100%{ transform: translateY(0) scale(1, 1); }
  50%{ transform: translateY(1%) scale(1.012, .985); }
}
@keyframes bb-ready{
  0%, 100%{ transform: translateY(0) scale(1.04, .96); }
  45%{ transform: translateY(-9%) scale(.98, 1.04); }
}
@keyframes bb-groan{
  0%, 100%{ transform: rotate(90deg) scale(.72); }
  50%{ transform: rotate(86deg) scale(.735); }
}
@keyframes bb-dizzy{
  0%, 100%{ transform: rotate(90deg) scale(.72); }
  25%{ transform: rotate(95deg) scale(.71); }
  75%{ transform: rotate(85deg) scale(.71); }
}
/* little stars circle over a stunned figure */
.bb-anim-on .tok.st-stunned::after{
  content: '✦ ✦'; position: absolute; left: 50%; top: -6%; margin-left: -.9em; width: 1.8em; text-align: center;
  font: 900 clamp(5px, .62vw, 10px)/1 Arial, sans-serif; color: #ffe45e; text-shadow: 0 0 2px #000, 0 1px 1px #000; pointer-events: none;
  animation: bb-stars 1.6s linear var(--bb-o3, 0s) infinite;
}
@keyframes bb-stars{
  0%{ transform: translateX(-28%) scale(1); }
  25%{ transform: translateX(0) scale(.72); }
  50%{ transform: translateX(28%) scale(1); }
  75%{ transform: translateX(0) scale(1.2); }
  100%{ transform: translateX(-28%) scale(1); }
}

/* ---- the ball */
.bb-anim-on .ball img{ will-change: transform; }
.bb-anim-on .ball:not(.carried) img{ animation: bb-ball 1.8s ease-in-out var(--bb-o, 0s) infinite; }
.bb-anim-on .ball.carried img{ animation: bb-ball-held 1.1s ease-in-out var(--bb-o, 0s) infinite; }
@keyframes bb-ball{
  0%, 100%{ transform: rotate(-8deg) translateY(0); }
  50%{ transform: rotate(-1deg) translateY(-5%) scale(1.04); }
}
@keyframes bb-ball-held{
  0%, 100%{ transform: rotate(-8deg) translateY(0); }
  50%{ transform: rotate(-14deg) translateY(-9%); }
}

/* ---- one-shot extras */
.bb-ghost{ pointer-events: none; z-index: 6; }
.bb-fx{ z-index: 9; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.bb-fx-burst > i{
  position: absolute; inset: -22%; background: #ffe45e;
  clip-path: polygon(50% 0%, 61% 22%, 82% 9%, 78% 33%, 100% 38%, 82% 52%, 96% 74%, 72% 71%, 68% 96%, 50% 78%, 30% 98%, 28% 72%, 3% 76%, 18% 53%, 0% 36%, 23% 32%, 17% 8%, 39% 22%);
  filter: drop-shadow(0 0 1px #1a130b);
}
.bb-fx-burst > b{ position: relative; font: 900 clamp(5px, .66vw, 11px)/1 "Arial Black", Arial, sans-serif; color: #1a130b; letter-spacing: -.02em; white-space: nowrap; }
.bb-fx-burst.hit > i{ inset: 12%; background: #fff; }
.bb-fx-burst.cas > i{ background: #ff5a4a; }
.bb-fx-burst.cas > b{ color: #fff; }
.bb-fx-burst.ko > i{ background: #cfd6ff; }
.bb-fx-burst.boom > i{ inset: -55%; background: #ff9d2e; }
.bb-fx-burst.td > i{ inset: -40%; background: #7be08c; }
.bb-fx-dust > i{ position: absolute; width: 34%; aspect-ratio: 1; border-radius: 50%; background: rgba(240, 223, 189, .8); bottom: 6%; }
.bb-fx-dust > i:nth-child(1){ left: 6%; }
.bb-fx-dust > i:nth-child(2){ left: 34%; bottom: 0; width: 40%; }
.bb-fx-dust > i:nth-child(3){ right: 4%; }
.bb-fx-bit > i{ width: 16%; aspect-ratio: 1 / 1.6; border-radius: 1px; }
.bb-fx-bomb > i{ width: 34%; aspect-ratio: 1; border-radius: 50%; background: #1a130b; box-shadow: inset -2px -2px 0 #000, 0 0 0 1px #f0dfbd; }

/* ---- menu switch */
.bb-anim-switch{ display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 1px solid #665747; background: #201d1b; color: #f3e7d2; font: 700 12px system-ui, sans-serif; letter-spacing: .07em; cursor: pointer; }
