.character-rig{position:absolute;inset:0;container-type:size;transform-origin:50% 100%;transform:scale(var(--rig-body-scale,1));transition:transform .35s ease-out;will-change:transform}
.character-master{width:100%;height:100%;object-fit:contain;object-position:50% 100%;display:block;transform-origin:50% calc(var(--character-foot,1)*100%);transform:translateY(calc(var(--character-offset-y,0)*100%)) scale(var(--character-scale,1));filter:saturate(calc(.95 + var(--rig-belly-scale,1)*.05)) drop-shadow(0 8px 6px #0008)}
.chomper.blue .character-master{filter:saturate(calc(.98 + var(--authored-glow,0)*.12)) drop-shadow(0 0 calc(var(--authored-glow,0)*22px) #3de7ff) drop-shadow(0 8px 6px #0008)}
.chomper.blue[data-animation="idle"] .character-master{animation:blue-idle-glow 3.6s ease-in-out infinite}
@keyframes blue-idle-glow{50%{filter:saturate(calc(1 + var(--authored-glow,0)*.2)) drop-shadow(0 0 calc((var(--authored-glow,0)*22px + 8px)) #5cf0ff) drop-shadow(0 8px 6px #0008)}}
.chomper.blue[data-animation="coin-noticed"] .character-master,.chomper.blue[data-animation="swallow-grow"] .character-master,.chomper.blue[data-animation="swallow-no-growth"] .character-master{animation:none}
.chomper.red .character-master{filter:saturate(calc(.98 + var(--authored-glow,0)*.12)) drop-shadow(0 0 calc(var(--authored-glow,0)*20px) #ff4d3a) drop-shadow(0 0 calc(var(--authored-glow,0)*12px) #ffc14d) drop-shadow(0 8px 6px #0008)}
.chomper.red[data-animation="idle"] .character-master{animation:red-idle-glow 3.6s ease-in-out infinite}
@keyframes red-idle-glow{50%{filter:saturate(calc(1 + var(--authored-glow,0)*.2)) drop-shadow(0 0 calc((var(--authored-glow,0)*20px + 8px)) #ff6a4d) drop-shadow(0 0 calc(var(--authored-glow,0)*14px) #ffd27a) drop-shadow(0 8px 6px #0008)}}
.chomper.red[data-animation="coin-noticed"] .character-master,.chomper.red[data-animation="swallow-grow"] .character-master,.chomper.red[data-animation="swallow-no-growth"] .character-master{animation:none}
.chomper[data-animation="feature-trigger"]{filter:drop-shadow(0 0 18px var(--stage-color))}
.chomper::before{content:"";position:absolute;z-index:-1;left:50%;bottom:0;width:132%;height:34%;translate:-50% 0;border-radius:50%;opacity:0;pointer-events:none;background:radial-gradient(ellipse,var(--stage-color) 0,transparent 68%);filter:blur(7px)}
.chomper[data-animation="coin-noticed"]::before{animation:target-stage-light .72s ease-in-out infinite alternate}
.chomper[data-animation="coin-noticed"] .character-master{animation:target-character-light .72s ease-in-out infinite alternate}
.chomper[data-animation="swallow-no-growth"]::before{animation:miss-stage-light .62s ease-out both}
/* Coin feed: the target stage light pulses while a coin is on its way (opacity/scale only). */
.chomper[data-feed="incoming"]::before{animation:target-stage-light .36s ease-in-out infinite alternate}
@keyframes target-stage-light{from{opacity:.24;scale:.86}to{opacity:.88;scale:1.08}}
@keyframes target-character-light{from{filter:saturate(1) drop-shadow(0 8px 6px #0008)}to{filter:saturate(1.18) brightness(1.15) drop-shadow(0 0 15px var(--stage-color))}}
@keyframes miss-stage-light{0%{opacity:.8;scale:1.08}100%{opacity:0;scale:.72}}
.chomper.green::before{display:none}
.chomper.green[data-animation="coin-noticed"] .character-master{animation:none;filter:saturate(1) drop-shadow(0 8px 6px #0008)}
.chomper.green[data-animation="feature-trigger"]{filter:none}
/* Coin bite: authored 24 fps frame strip drawn into a canvas laid exactly over the contained
   idle image (square, bottom-centred like object-fit:contain; object-position:50% 100%). */
.chomper .character-bite{position:absolute;left:50%;bottom:0;display:block;width:min(100cqw,100cqh);height:auto;aspect-ratio:1;translate:-50% 0;pointer-events:none;filter:drop-shadow(0 8px 6px #0008)}
/* Own layer so hiding the idle during a bite is a compositor property change in the same frame as the canvas draw. */
.chomper .character-master{will-change:opacity}
.chomper.blue .character-bite{filter:saturate(calc(.98 + var(--authored-glow,0)*.12)) drop-shadow(0 0 calc(var(--authored-glow,0)*22px) #3de7ff) drop-shadow(0 8px 6px #0008)}
.chomper.red .character-bite{filter:saturate(calc(.98 + var(--authored-glow,0)*.12)) drop-shadow(0 0 calc(var(--authored-glow,0)*20px) #ff4d3a) drop-shadow(0 0 calc(var(--authored-glow,0)*12px) #ffc14d) drop-shadow(0 8px 6px #0008)}
@media(prefers-reduced-motion:reduce){.character-rig,.character-master,.chomper::before{animation:none!important;transition:none!important}.character-bite{display:none}}
