.local-collision{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:30}
.collision-actor{position:absolute;top:var(--sprite-y);left:0;width:var(--sprite-size);height:var(--sprite-size);animation:collision-travel 4.4s linear forwards;will-change:transform}
.collision-body{width:100%;height:100%;transform-origin:90% 80%;animation:rook-body 4.4s linear forwards}.collision-actor.right .collision-body{transform-origin:10% 80%;animation-name:moss-body}
.collision-body img{display:block;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 7px 4px #45334725)}
@keyframes collision-travel{0%{transform:translateX(var(--start))}7%{transform:translateX(var(--start))}34.09%,38%{transform:translateX(var(--contact))}56%,70%{transform:translateX(var(--recoil))}100%{transform:translateX(var(--exit))}}
@keyframes rook-body{0%{transform:rotate(5deg)}10%,20%,30%{transform:translateY(-8px) rotate(7deg) scale(1.02,.98)}15%,25%{transform:translateY(0) rotate(4deg)}34.09%{transform:rotate(7deg)}37%{transform:rotate(12deg) scale(.86,1.09)}43%{transform:translateY(-12px) rotate(-12deg) scale(1.07,.94)}50%{transform:rotate(8deg)}57%{transform:rotate(-5deg)}65%,70%{transform:rotate(0)}80%,90%{transform:translateY(-7px) rotate(-7deg)}100%{transform:rotate(0)}}
@keyframes moss-body{0%{transform:rotate(-5deg)}10%,20%,30%{transform:translateY(-13px) rotate(-8deg) scale(1.03,.97)}15%,25%{transform:translateY(0) rotate(-4deg)}34.09%{transform:rotate(-7deg)}37%{transform:rotate(-12deg) scale(.84,1.1)}43%{transform:translateY(-18px) rotate(12deg) scale(1.08,.92)}50%{transform:rotate(-8deg)}57%{transform:rotate(5deg)}65%,70%{transform:rotate(0)}80%,90%{transform:translateY(-11px) rotate(8deg)}100%{transform:rotate(0)}}
.collision-burst{position:absolute;left:50%;top:48%;width:80px;height:80px;transform:translate(-50%,-50%);opacity:0}
.collision-burst span{position:absolute;left:38px;top:0;width:5px;height:18px;background:#e1b955;border-radius:5px;transform-origin:2px 40px}.collision-burst span:nth-child(2){rotate:60deg}.collision-burst span:nth-child(3){rotate:120deg}.collision-burst span:nth-child(4){rotate:180deg}.collision-burst span:nth-child(5){rotate:240deg}.collision-burst span:nth-child(6){rotate:300deg}
.bumped .collision-burst{animation:local-impact .45s ease-out forwards}@keyframes local-impact{0%{opacity:1;scale:.5}100%{opacity:0;scale:2}}
#board .collision-scattered .slot{animation:local-scatter .8s ease-in forwards;animation-delay:var(--scatter-delay,0s)}
@keyframes local-scatter{to{transform:translate(var(--scatter-x),var(--scatter-y)) rotate(var(--scatter-spin));opacity:0}}
.collision-scattered.target-number{animation:target-scatter .8s ease-in forwards}@keyframes target-scatter{to{transform:translate(-50%,-100%) rotate(22deg) scale(.2);opacity:0}}
@media(prefers-reduced-motion:reduce){.collision-body{animation:none}.collision-actor{animation-duration:4.4s}.bumped .collision-burst{display:none}}

.running-rig{display:block;width:100%;height:100%;overflow:visible}.rig-facing.faces-left{transform:translateX(530px) scaleX(-1)}
.rig-gait{transform-origin:265px 490px;animation:rig-bounce .32s ease-in-out infinite}
.running-rig .limb{transform-box:view-box}.running-rig .arm{transform-origin:274px 166px;animation:arm-stride .48s ease-in-out infinite}.running-rig .far-arm{animation-delay:-.24s;filter:brightness(.88)}
.running-rig .leg{transform-origin:252px 325px;animation:leg-stride .48s ease-in-out infinite}.running-rig .far-leg{animation-delay:-.24s;filter:brightness(.88)}
@keyframes arm-stride{0%,100%{transform:rotate(-30deg)}50%{transform:rotate(30deg)}}
@keyframes leg-stride{0%,100%{transform:rotate(30deg)}50%{transform:rotate(-30deg) translateY(-9px)}}
@keyframes rig-bounce{0%,100%{transform:translateY(0) rotate(3deg)}50%{transform:translateY(-7px) rotate(5deg)}}
.bumped .running-rig .arm{animation:arms-brace .35s ease-out forwards}.bumped .running-rig .leg{animation:legs-brace .35s ease-out forwards}.bumped .rig-gait{animation:rig-recover .85s ease-in-out forwards}
@keyframes arms-brace{to{transform:rotate(-38deg)}}@keyframes legs-brace{to{transform:rotate(0)}}@keyframes rig-recover{0%{transform:rotate(12deg)}50%{transform:rotate(-6deg)}100%{transform:rotate(0)}}
.collision-dust{position:absolute;left:50%;top:56%;pointer-events:none;z-index:5}.dust-puff{position:absolute;left:0;top:0;width:var(--puff-size);height:var(--puff-size);margin:calc(var(--puff-size) / -2);border-radius:46% 54% 58% 42%;background:radial-gradient(circle at 35% 25%,#f3e9d6,var(--puff-colour));box-shadow:inset -5px -7px 10px #8e775328;opacity:0}
.bumped .dust-puff{animation:dust-expand 1.5s var(--dust-delay) ease-out forwards}
@keyframes dust-expand{0%{opacity:0;transform:scale(.15)}12%{opacity:.92}55%{opacity:.65;transform:translate(var(--dust-x),var(--dust-y)) scale(1.8)}100%{opacity:0;transform:translate(calc(var(--dust-x) * 1.4),calc(var(--dust-y) - 65px)) scale(2.3)}}
.dust-stone{position:absolute;left:-5px;top:-5px;width:11px;height:9px;background:var(--stone-colour);clip-path:polygon(12% 20%,67% 0,100% 45%,75% 100%,0 78%);opacity:0}.bumped .dust-stone{animation:stone-fly 1s ease-out forwards}
@keyframes stone-fly{0%{opacity:0;transform:scale(.2)}8%{opacity:1}55%{opacity:1;transform:translate(var(--dust-x),var(--dust-y)) rotate(var(--stone-turn))}100%{opacity:0;transform:translate(calc(var(--dust-x) * 1.4),95px) rotate(calc(var(--stone-turn) * 1.6))}}
@media(prefers-reduced-motion:reduce){.rig-gait,.running-rig .limb{animation:none!important}.bumped .dust-puff{animation-duration:.5s}.bumped .dust-stone{display:none}}

.retreat .running-rig .arm{animation:arm-stride .48s ease-in-out infinite}.retreat .running-rig .far-arm{animation-delay:-.24s}.retreat .running-rig .leg{animation:leg-stride .48s ease-in-out infinite}.retreat .running-rig .far-leg{animation-delay:-.24s}.retreat .rig-gait{animation:rig-bounce .32s ease-in-out infinite}

/* A seated slump replaces the walk-away ending. */
.settling .collision-actor{animation:none;transform:translateX(var(--recoil))}
.settling .collision-body,.settling .rig-gait{animation:none;transform:none}
.settling .rig-torso{transform-origin:260px 320px;animation:torso-slump .65s ease-out forwards}
.settling .running-rig .arm{animation:arms-slump .65s ease-out forwards}
.settling .running-rig .leg{animation:legs-sit .65s ease-out forwards}
.settling .running-rig .leg-shin{transform-origin:252px 410px;animation:shins-sit .65s ease-out forwards}
@keyframes torso-slump{0%{transform:translateY(0)}75%{transform:translateY(115px) rotate(8deg)}100%{transform:translateY(108px) rotate(5deg)}}
@keyframes arms-slump{0%{transform:rotate(-38deg)}100%{transform:translateY(105px) rotate(12deg)}}
@keyframes legs-sit{0%{transform:rotate(0)}100%{transform:translateY(112px) rotate(-65deg)}}
@keyframes shins-sit{0%{transform:rotate(0)}100%{transform:rotate(15deg)}}
.fading .collision-actor{animation:seated-fade 1.2s ease-in forwards}
@keyframes seated-fade{0%{opacity:1;transform:translateX(var(--recoil))}100%{opacity:0;transform:translateX(var(--recoil))}}
@media(prefers-reduced-motion:reduce){.settling .rig-torso,.settling .running-rig .arm,.settling .running-rig .leg,.settling .running-rig .leg-shin{animation-duration:.01s!important}}


.settling .running-rig .leg-foot{transform-origin:245px 475px;animation:feet-settle .65s ease-out forwards}@keyframes feet-settle{0%{transform:rotate(0)}100%{transform:rotate(50deg)}}

.settling .running-rig .leg-foot{animation:none;transform:none}

/* Anchor each seated silhouette to the same floor, including its SVG margins. */
.settling .collision-actor{top:var(--seated-y);transition:top .65s ease-out}
.seated-contact-shadow{position:absolute;top:calc(var(--floor-y) - 8px);height:17px;border-radius:50%;transform:translateX(-50%);background:radial-gradient(ellipse,#56453848 0%,#56453820 45%,transparent 72%);opacity:0;z-index:0;pointer-events:none}
.settling .seated-contact-shadow{animation:ground-contact .65s ease-out forwards}
@keyframes ground-contact{from{opacity:0;scale:.65}to{opacity:1;scale:1}}
.fading .seated-contact-shadow{animation:ground-contact-fade 1.2s ease-in forwards}
@keyframes ground-contact-fade{from{opacity:1}to{opacity:0}}
@media(prefers-reduced-motion:reduce){.settling .collision-actor{transition:none}}

.collision-actor{z-index:2}

.actor-skip .running-rig .arm,.actor-skip .running-rig .leg{animation-duration:.40s}.actor-skip .running-rig .far-arm,.actor-skip .running-rig .far-leg{animation-delay:-.20s}
.actor-riff .running-rig .arm,.actor-riff .running-rig .leg{animation-duration:.46s}.actor-riff .running-rig .far-arm,.actor-riff .running-rig .far-leg{animation-delay:-.23s}
.rig-tail{transform-origin:245px 325px;animation:runner-tail .55s ease-in-out infinite alternate}@keyframes runner-tail{from{transform:rotate(-7deg)}to{transform:rotate(7deg)}}
.settling .rig-tail{animation:tail-slump .65s ease-out forwards}@keyframes tail-slump{to{transform:translateY(108px) rotate(-8deg)}}
@media(prefers-reduced-motion:reduce){.rig-tail{animation:none!important}}

.actor-brass .running-rig .arm,.actor-brass .running-rig .leg{animation-duration:.52s}.actor-brass .running-rig .far-arm,.actor-brass .running-rig .far-leg{animation-delay:-.26s}
.actor-glint .running-rig .arm,.actor-glint .running-rig .leg{animation-duration:.38s}.actor-glint .running-rig .far-arm,.actor-glint .running-rig .far-leg{animation-delay:-.19s}

.collision-actor{top:var(--actor-y,var(--sprite-y))}
.settling .collision-actor{top:var(--seated-y)}
.fading .collision-actor,.fading .seated-contact-shadow{animation-duration:.7s}
.crowd-collision .collision-dust{scale:1.25}

.crowd-collision .collision-dust{z-index:20}.crowd-collision .collision-burst{z-index:21}

/* Sit back around the pelvis, with thighs forward and feet lifted naturally. */
.settling .rig-gait{transform-origin:var(--seat-pivot);animation:pelvis-settle .65s ease-out forwards}
@keyframes pelvis-settle{0%{transform:rotate(0deg)}75%{transform:rotate(-25deg)}100%{transform:rotate(-22deg)}}
.settling .rig-torso{animation:grounded-torso-slump .65s ease-out forwards}
@keyframes grounded-torso-slump{0%{transform:translateY(0)}75%{transform:translateY(calc(var(--sit-drop) + 5px))}100%{transform:translateY(var(--sit-drop))}}
.settling .running-rig .leg{animation:grounded-legs-sit .65s ease-out forwards}
@keyframes grounded-legs-sit{0%{transform:rotate(0)}100%{transform:translateY(112px) rotate(-85deg)}}
.settling .running-rig .leg-shin{animation:none;transform:none}
@media(prefers-reduced-motion:reduce){.settling .rig-gait{animation:none!important;transform:rotate(-22deg)}.settling .rig-torso{animation:none!important;transform:translateY(var(--sit-drop))}.settling .running-rig .leg{animation:none!important;transform:translateY(112px) rotate(-85deg)}}

.settling .rig-tail{animation:grounded-tail .65s ease-out forwards}@keyframes grounded-tail{to{transform:translateY(var(--tail-drop)) rotate(-8deg)}}
