*{box-sizing:border-box}html,body{margin:0;height:100%;background:#f7f1e5;color:#423243;font-family:system-ui,Arial}body{height:100dvh;display:flex;flex-direction:column;overflow:hidden}header{text-align:center;position:relative;padding:9px 75px 8px;flex:0 0 auto}.brand{font-weight:800;font-size:15px;margin-bottom:4px}h1{font-size:clamp(22px,2.5vw,32px);line-height:1;margin:0}header>.icon{position:absolute;top:6px;left:18px}main{width:100%;max-width:1500px;margin:auto;flex:1;min-height:0;padding:8px 16px}h2{font-size:32px;text-align:center;margin:0}.icon{border:0;padding:0;background:none;width:62px;height:62px;cursor:pointer}.icon img{width:100%;height:100%;object-fit:contain}.icon:hover{transform:translateY(-2px)}.icon:focus-visible,.piece:focus-visible{outline:3px solid #816298;outline-offset:3px}#welcome{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px}.title-number{height:70%;max-height:550px}.title-number svg{height:100%;width:auto}.start{width:84px;height:84px}#play{height:100%;display:grid;grid-template-rows:minmax(0,1fr) 30px}#heading{display:none}#board{position:relative;touch-action:none;overflow:hidden;min-height:0;border-radius:24px}.slots{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;gap:clamp(3px,1.5vw,22px);pointer-events:none;width:94%}.slot{width:min(190px,calc(90vw / var(--count,3) - 20px));height:min(270px,40vh);flex-shrink:1;pointer-events:auto;position:relative}.slot svg{height:100%;width:100%;overflow:visible}.slot:after{content:'';position:absolute;inset:0}.piece{position:absolute;width:clamp(70px,10vw,145px);height:clamp(100px,23vh,210px);border:0;background:none;padding:0;cursor:grab;touch-action:none;z-index:3;will-change:transform}.piece svg{height:100%;width:100%;overflow:visible}.piece.grabbed{cursor:grabbing;z-index:10;filter:drop-shadow(0 8px 8px #42314325)}.piece.grabbed svg[data-letter="+"]{animation:plus-wobble .18s infinite alternate}.piece.selected{outline:2px dashed #9d77a9;border-radius:14px}.slot.correct{animation:placed .3s}.eye-art{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);height:86%;width:auto;aspect-ratio:120/156;max-width:90%}.eye-art svg{width:100%;height:100%;overflow:visible}.eye-hit{pointer-events:all;cursor:pointer}.eye-hit[aria-disabled="true"]{pointer-events:none}.eye-hit:focus{stroke:#fff6d8;stroke-width:2}.opened .socket-lid{display:none!important}.opened .eye-hit{pointer-events:none}#eye-count{display:flex;justify-content:center;align-items:center;gap:12px}.count-dot{width:16px;height:16px;border-radius:50%;border:2px solid #7a657d}.count-dot.open{background:#7d5686}#reward{height:100%;display:grid;grid-template-rows:36px minmax(0,1fr) auto 65px;gap:10px;text-align:center}#story-image{height:100%;width:auto;max-width:100%;justify-self:center;border-radius:20px;overflow:hidden}.painted-story{background-image:url('assets/number-stories.png');background-repeat:no-repeat}.counting-story{width:min(100%,1050px)!important;display:flex;align-items:center;justify-content:center;background:linear-gradient(#e9e1ce,#efe7d5);padding:25px;gap:30px}.counting-story img{width:40%;height:95%;object-fit:contain}.reward-props{display:grid;grid-template-columns:repeat(3,1fr);gap:15px;width:45%;font-size:clamp(30px,5vw,70px)}#story-text{font-size:clamp(20px,2.4vw,32px);font-weight:650;margin:0}nav{display:flex;justify-content:center;gap:24px}[hidden]{display:none!important}.disrupted .slot{animation:scatter .7s forwards}.disrupted .slot:nth-child(even){animation-direction:reverse}@keyframes scatter{to{transform:translateY(180px) rotate(85deg);opacity:0}}@keyframes placed{50%{transform:scale(1.08)}}@keyframes plus-wobble{to{transform:rotate(9deg) scale(1.07)}}@media(max-width:700px){header{padding:10px 65px}.brand{font-size:13px}header>.icon{width:48px;height:48px;left:8px}.slot{width:calc(90vw / var(--count,3) - 6px);height:30vh}.piece{width:70px;height:110px}.reward-props{gap:8px}.counting-story{padding:12px;gap:10px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}
/* Larger wandering bodies, including a distinct enlargement while held. */
.piece{width:clamp(120px,15vw,215px);height:clamp(170px,34vh,310px)}
.piece.grabbed{width:clamp(150px,19vw,270px);height:clamp(200px,40vh,360px)}
.piece.compound{width:clamp(220px,29vw,385px);height:clamp(165px,31vh,280px)}
.piece.compound.grabbed{width:clamp(265px,34vw,440px);height:clamp(210px,38vh,345px)}
.eye-art .eye-hit:focus,.eye-art .eye-hit:focus-visible{outline:none!important;stroke:transparent!important;filter:none!important}
.eye-art .anatomy-eye:focus{outline:none!important}
.eye-art .eye-hit:focus-visible{stroke:#d2af64!important;stroke-width:1!important}
#level{position:absolute;right:18px;top:17px;width:66px;padding:6px 8px;border:1px solid #b8a8bd;border-radius:9px;background:#faf6eb;color:#58425b;font:inherit;font-size:15px}
.slots{width:95%;gap:16px}.slot{width:min(190px,calc(90vw / var(--count,3) - 20px));height:min(280px,43vh)}
.slots.two-rows{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));width:min(95%,1150px);gap:14px 20px}
.slots.two-rows .slot{width:100%;height:min(195px,28vh)}
.slots.two-rows:has(>.slot:nth-child(7):last-child){grid-template-columns:repeat(4,minmax(0,1fr))}
.slot.given{opacity:.85}.equation .slot{width:min(330px,27vw);height:min(300px,44vh)}
.compound-number{overflow:visible}.disrupted .slot:nth-child(even){animation-direction:normal;animation-name:scatter-other}
@keyframes scatter-other{to{transform:translateY(-160px) rotate(-70deg);opacity:0}}
.quantity-board .eye-art{left:27%;height:64%;width:48%;aspect-ratio:auto;max-width:none}
.ten-frames{position:absolute;right:3%;top:50%;transform:translateY(-50%);width:43%;max-height:94%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.ten-frame{min-height:54px;display:grid;grid-template-columns:repeat(5,1fr);grid-template-rows:repeat(2,1fr);gap:5px;padding:10px;background:#e4d8c1;border:2px solid #ab947a;border-radius:14px;cursor:pointer;box-shadow:0 3px 0 #9d8774;color:#473849}
.quantity-eye{display:block;width:100%;aspect-ratio:1.35;border-radius:55%;background:#af9688;border:1px solid #75615a;position:relative;min-height:7px}
.quantity-eye:before{content:'';position:absolute;left:15%;right:15%;top:48%;border-top:2px solid #594e4c;border-radius:50%}
.awake{background:#e9dfc9;border-color:#87689a}.awake .quantity-eye{background:#eee3c2}.awake .quantity-eye:before{left:39%;right:39%;top:16%;bottom:16%;border:0;border-radius:50%;background:#403138}
.ten-frame:focus-visible{outline:3px solid #b9914e;outline-offset:3px}
.ten-frame.awake{cursor:default}.counting-story{background:radial-gradient(ellipse at 20% 80%,#d8c7a8,transparent 55%),linear-gradient(#eee5d2,#e3d4b8);width:min(100%,1150px)!important;padding:20px;gap:24px}
.counting-story img{width:36%;height:95%;object-fit:contain;filter:drop-shadow(0 9px 6px #4c343028)}
.reward-props{display:flex;flex-wrap:wrap;align-content:center;justify-content:center;gap:10px;width:60%;height:95%;font-size:initial}
.prop-group{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;padding:5px;border-radius:10px;background:#ffffff30;box-shadow:inset 0 0 0 1px #987e5530;max-width:100%}
.prop-group span{width:var(--prop-size);height:var(--prop-size);display:block}.prop-group svg{width:100%;height:100%}
.scene-star{background:radial-gradient(ellipse at 30% 80%,#82779f,#423b61)}.scene-star .prop-group{background:#ffffff15}
.scene-flower,.scene-apple{background:linear-gradient(#e0e7d2 70%,#b7c295 70%)}
@media(max-height:760px){.prop-group span{width:calc(var(--prop-size)*.8);height:calc(var(--prop-size)*.8)}.ten-frames{gap:7px}.ten-frame{padding:7px;gap:3px}}
@media(max-width:700px){#level{right:8px;width:48px;font-size:13px}.piece{width:110px;height:160px}.piece.grabbed{width:135px;height:195px}.piece.compound{width:160px;height:145px}.piece.compound.grabbed{width:195px;height:175px}.slots.two-rows{gap:8px;grid-template-columns:repeat(5,minmax(0,1fr))}.slots.two-rows .slot{height:20vh}.ten-frames{gap:6px;width:48%;right:1%}.ten-frame{padding:5px;gap:2px}.quantity-board .eye-art{left:25%;width:46%;height:50%}.counting-story{gap:8px;padding:10px}.reward-props{gap:3px}.prop-group{padding:2px;gap:0}.prop-group span{width:calc(var(--prop-size)*.55);height:calc(var(--prop-size)*.55)}}

/* Sixty percent larger bodies, constrained only where the viewport requires it. */
.piece{width:clamp(192px,24vw,344px);height:min(54.4vh,496px)}
.piece.grabbed{width:clamp(240px,30.4vw,432px);height:min(64vh,576px)}
.piece.compound{width:min(46.4vw,616px);height:min(49.6vh,448px)}
.piece.compound.grabbed{width:min(54.4vw,704px);height:min(60.8vh,552px)}
.slot{height:min(448px,58vh);width:min(280px,calc(92vw / var(--count,3) - 20px))}
.slots.two-rows .slot{height:min(290px,36vh)}
.equation .slot{width:min(440px,30vw);height:min(460px,56vh)}
.eye-art.waking-number{left:50%;top:50%;height:92%;width:88%;max-width:1150px;aspect-ratio:auto}
.eye-art.waking-number svg{width:100%;height:100%;overflow:visible}
.waking-number .socket-lid,.waking-number .opened .socket-lid{display:block!important}
.waking-number .eye-hit{pointer-events:all;cursor:pointer}
.waking-number .opened .eye-hit{pointer-events:none}
.digit-body.sleeping{transform-box:fill-box;transform-origin:50% 90%;animation:sleep-heave 3.1s ease-in-out infinite}
.digit-body.stir{translate:0 -3px;transition:translate .35s ease-in-out}
.awake-digit .digit-body{animation-duration:3.8s}.all-awake .digit-body{animation:none;translate:0 0;transition:translate .5s}
@keyframes sleep-heave{0%,100%{transform:scale(1,1) translateY(0)}50%{transform:scale(1.018,1.027) translateY(-1.2px)}}
#welcome{display:grid;grid-template-rows:minmax(0,1fr) 90px;gap:12px;justify-items:center;padding:8px 25px}
.title-number{height:100%;width:100%;max-height:none;min-height:0}
.maths-classroom{height:100%;width:100%;object-fit:contain;border-radius:20px}
body:has(#welcome:not([hidden])) header h1{font-family:Georgia,serif;font-weight:900;letter-spacing:-.035em;color:#725578;font-size:clamp(30px,4vw,52px);text-shadow:0 2px 0 #fff5d7}
body:has(#welcome:not([hidden])) header{padding-top:12px}
@media(max-width:700px){.piece{width:176px;height:256px}.piece.grabbed{width:216px;height:312px}.piece.compound{width:min(75vw,256px);height:232px}.piece.compound.grabbed{width:min(88vw,312px);height:280px}.slot{height:35vh}.slots.two-rows .slot{height:25vh}.eye-art.waking-number{height:88%;width:92%}#welcome{padding:6px;grid-template-rows:minmax(0,1fr) 72px}.start{width:72px;height:72px}}
@media(prefers-reduced-motion:reduce){.digit-body.sleeping{animation:none}.socket-lid{transition:none!important}}

/* Every counting round occupies one line; pieces exactly inherit their slot size. */
#board .slots,#board .slots.two-rows{display:flex;flex-wrap:nowrap;grid-template-columns:none;width:96%;gap:clamp(4px,1vw,15px)}
#board .slots .slot{flex:1 1 0;min-width:0;max-width:300px;width:auto;height:min(44vh,calc(112vw / var(--count,3)))}
#board .slots.equation .slot{max-width:420px;height:min(52vh,370px)}
.piece,.piece.grabbed,.piece.compound,.piece.compound.grabbed{width:var(--piece-width,180px);height:var(--piece-height,240px)}
.waking-number .face,.waking-number .identity,.waking-number .number-skin-detail,.waking-number .number-eye{visibility:visible!important}
.waking-number .obvious-eye{visibility:visible!important;opacity:1}
.waking-number .opened .sleep-crease{opacity:0;transition:opacity .65s}
.waking-number .opened .number-pupil{transform-box:fill-box;transform-origin:center;animation:pupil-jiggle .8s ease-in-out infinite!important}
.digit-body.sleeping{animation:sleep-heave 2.6s ease-in-out infinite}
@keyframes sleep-heave{0%,100%{transform:scale(1)}50%{transform:scale(1.04,1.06) translateY(-1.5px)}}
@keyframes pupil-jiggle{0%,100%{transform:translate(-1px,0) scale(1)}30%{transform:translate(1px,-1px) scale(1.06,.95)}65%{transform:translate(-.5px,1px) scale(.94,1.05)}}
.target-number{height:94%;width:94%;left:50%;top:50%;max-width:1200px}
.wake-burst .digit-body{animation:big-awakening .65s ease-in-out infinite!important}
@keyframes big-awakening{0%,100%{transform:rotate(-5deg) scale(1.03)}35%{transform:rotate(7deg) scale(1.08,.94)}65%{transform:rotate(-7deg) scale(.97,1.07)}}
.disruption-monster{position:absolute;height:65%;width:32%;top:18%;left:-35%;z-index:20;pointer-events:none;animation:monster-rush 1.45s ease-in-out forwards}
.disruption-monster svg{width:100%;height:100%;overflow:visible}
@keyframes monster-rush{0%{left:-35%;transform:rotate(-10deg)}45%{left:35%;transform:rotate(8deg)}100%{left:110%;transform:rotate(-8deg)}}
.plus-art .plus-mouth{transform-origin:50px 72px;animation:plus-chat .333333s ease-in-out infinite}
@keyframes plus-chat{0%,100%{transform:scaleY(.55)}50%{transform:scaleY(1.2)}}
.eating .plus-mouth{animation:plus-gulp 3.5s ease-in-out forwards}
@keyframes plus-gulp{0%{transform:scale(1.5)}12%{transform:translateX(-4px) scale(10.5,11.25) rotate(-6deg)}23%{transform:translateX(4px) scale(10.5,1.05) rotate(6deg)}34%{transform:translateX(-4px) scale(11.1,11.7) rotate(-6deg)}45%{transform:translateX(4px) scale(10.8,0.975) rotate(6deg)}56%{transform:translateX(-4px) scale(11.4,12) rotate(-5deg)}67%{transform:translateX(4px) scale(10.95,0.9) rotate(5deg)}78%{transform:translateX(-3px) scale(10.5,10.8) rotate(-4deg)}90%{transform:scale(7.5,0.75) rotate(2deg)}100%{transform:scale(1.2)}}
.sucked{animation:swallow-number 1.85s .25s cubic-bezier(.6,0,.9,.8) forwards}
@keyframes swallow-number{0%,15%{transform:translateX(0) scale(1);opacity:1}100%{transform:translateX(var(--suck-x)) scale(.02);opacity:0}}

#board .slot.correct.sucked{animation:swallow-number 1.85s .25s cubic-bezier(.6,0,.9,.8) forwards}
#board .waking-number .opened .number-pupil{animation:pupil-jiggle .8s ease-in-out infinite!important}

#board .slots.equation{width:min(76%,850px);gap:clamp(10px,2vw,32px)}
#board .slots .slot{max-width:none;flex-basis:0}
.eye-button{position:absolute;z-index:50;margin:0;padding:0;border:0;border-radius:50%;background:transparent;cursor:pointer;touch-action:manipulation;box-shadow:none}
.eye-button:disabled{cursor:default}.eye-button:focus-visible{outline:2px solid #a87a4b;outline-offset:1px}
.waking-number .socket-lid{transition:none!important;animation:none!important}
.waking-number .eye-hit:focus{outline:none}

#music{position:absolute;right:98px;top:17px;border:1px solid #b8a8bd;border-radius:9px;background:#faf6eb;color:#58425b;font-size:23px;width:40px;height:36px;cursor:pointer}#music:focus-visible{outline:3px solid #b9914e}@media(max-width:700px){#music{right:66px;top:17px;width:32px}}

/* Override embedded character styles that suppress sleeping animations. */
#board .waking-number:not(.all-awake) .digit-body.sleeping{transform-box:fill-box;transform-origin:50% 85%;animation:monster-sleep-breath 3.2s ease-in-out infinite!important}
@keyframes monster-sleep-breath{0%,100%{transform:scale(.975,.98)}45%{transform:scale(1.04,1.055) translateY(-1px)}70%{transform:scale(1.012,1.02)}}
#board .waking-number.all-awake .digit-body{animation:big-awakening .65s ease-in-out infinite!important}
@media(prefers-reduced-motion:reduce){#board .waking-number:not(.all-awake) .digit-body.sleeping,#board .waking-number.all-awake .digit-body{animation:none!important}}

.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}}
header h1 .game-wordmark{width:clamp(180px,27vw,320px);height:80px;object-fit:contain;display:block;margin:auto}body:has(#welcome:not([hidden])) header h1{font-size:inherit}header:has(.game-wordmark){min-height:112px;padding-top:5px;padding-bottom:4px}header:has(.game-wordmark) .brand{margin-bottom:0}
@media(max-height:650px){header h1 .game-wordmark{height:55px}header:has(.game-wordmark){min-height:85px}}
@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}

/* The reward numeral belongs to the illustration itself. Keep the complete painting visible. */
#reward{grid-template-rows:minmax(0,1fr) auto 65px;gap:8px}
#reward-number{display:none}
#story-image.rich-reward{width:100%;height:100%;max-width:1250px;display:flex;justify-content:center;align-items:center;overflow:visible;border-radius:0;background:none;padding:0}
.rich-reward>img{display:block;width:100%;height:100%;object-fit:contain;border-radius:14px}
#story-text{font-size:clamp(17px,2vw,25px)}
@media(max-height:650px){#reward{grid-template-rows:minmax(0,1fr) auto 48px;gap:4px}#reward nav .icon{width:46px;height:46px}}

/* 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)}}

.plus-cross{transition:opacity .2s ease-out}.eating .plus-cross{opacity:0}

/* v32: the outline is a red pencil template; shaped lips stay readable during chewing. */
.plus-art .plus-mouth{transform-origin:50px 72px}
.eating .plus-art{position:relative;z-index:12}
.eating .plus-mouth{animation:plus-gulp 3.5s ease-in-out forwards}
.mouth-lips,.mouth-upper-lip{stroke-linejoin:round}
@media(prefers-reduced-motion:reduce){.eating .plus-mouth{animation:none!important;transform:scale(7,6)}}

/* Speech cues apply to the number art, leaving its slot position fixed. */
.slot.spoken-number > svg{transform-origin:50% 65%;animation:spoken-number-wobble .44s ease-in-out infinite}
@keyframes spoken-number-wobble{0%,100%{transform:rotate(0) scale(1)}25%{transform:rotate(-2.5deg) scale(1.035)}75%{transform:rotate(2.5deg) scale(1.035)}}
.eating-finished .plus-mouth{visibility:hidden!important}
@media(prefers-reduced-motion:reduce){.slot.spoken-number > svg{animation:none;filter:brightness(1.08)}}
