*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#b69267;font-family:Arial,sans-serif}#viewport{position:fixed;inset:0;overflow:hidden;background:#f0d1a1 url("ui/teaching-background.png") center/cover no-repeat}#viewport[data-screen=challenge]{background-image:url("ui/challenge-background.png")}#scene{position:absolute;width:1500px;height:1049px;transform-origin:0 0;overflow:hidden;isolation:isolate}.background{position:absolute;inset:0;width:1500px;height:1049px;pointer-events:none}.challenge-background{opacity:0}#scene[data-screen=challenge] .challenge-background{opacity:1}section{position:absolute;inset:0}.image-button{position:absolute;padding:0;border:0;background:none;cursor:pointer;z-index:30;touch-action:manipulation;min-width:80px;min-height:80px}.image-button img{width:100%;height:100%;object-fit:contain;pointer-events:none}.image-button:active{transform:translateY(3px)}.image-button:focus-visible{outline:5px solid #fff2be;outline-offset:3px;border-radius:50%}.image-button:disabled{cursor:default}.parent{left:25px;top:26px;width:108px;height:111px}.repeat{left:1130px;top:230px;width:108px;height:108px;transition:none}#scene[data-phase=reveal] .repeat,#scene[data-phase=counting] .repeat,#scene[data-phase=lesson-ready] .repeat{left:913px;top:103px}#scene[data-screen=challenge] .repeat{left:657px;top:135px;width:104px;height:101px}.lesson-card{position:absolute;left:400px;top:165px;width:700px;height:585px;z-index:5;transition:left 1.2s cubic-bezier(.3,0,.2,1),top 1.2s cubic-bezier(.3,0,.2,1),width 1.2s cubic-bezier(.3,0,.2,1),height 1.2s cubic-bezier(.3,0,.2,1)}.lesson-card>img{width:100%;height:100%;pointer-events:none;filter:drop-shadow(0 6px 7px #5e452c26)}#trace{position:absolute;left:13%;top:17%;width:76%;height:80%;touch-action:none;cursor:crosshair;overflow:visible}.number-base{stroke:#24667b;stroke-width:76}.trace-guide{stroke:#fff0c9;stroke-width:8;stroke-dasharray:.025 .045;opacity:.18;transition:opacity .2s}.trace-guide.active{opacity:1}.trace-progress{stroke:#ee895b;stroke-width:39;transition:opacity .4s}.trace-dot{fill:#f59c6b;stroke:#fff0ce;stroke-width:3;animation:dot-breathe 1.7s ease-in-out infinite}#trace-dot{fill:#f59c6b;stroke:#fff0ce;stroke-width:3}#scene[data-phase=reveal] .lesson-card,#scene[data-phase=counting] .lesson-card,#scene[data-phase=lesson-ready] .lesson-card{left:448px;top:9px;width:454px;height:379px}#scene:not([data-phase=tracing]) .trace-guide,#scene:not([data-phase=tracing]) .trace-progress{opacity:0}#scene:not([data-phase=tracing]) #trace-dot{display:none}.lesson-mat{position:absolute;left:261.5px;top:394px;width:977px;height:610px;opacity:0;transform:translateY(35px);transition:opacity .7s,transform .7s;filter:drop-shadow(0 5px 5px #65452522)}#scene[data-phase=counting] .lesson-mat,#scene[data-phase=lesson-ready] .lesson-mat{opacity:1;transform:none}.lesson-part{position:absolute;width:195px;height:195px;opacity:0;transform:translateY(-100px) scale(.95);transition:opacity .192s,transform .336s ease-out}.lesson-part.arrived{opacity:1;transform:none}.lesson-part>img{width:100%;height:100%;object-fit:contain;position:relative;z-index:1}.lesson-part:before{content:'';position:absolute;inset:-40px;background:url('ui/count-highlight.png') center/contain no-repeat;opacity:0;transition:opacity .3s}.lesson-part.counted:before,.lesson-whole .lesson-part:before{opacity:1}.lesson-next{left:1243px;top:797px;width:205px;height:192px}.challenge-card{position:absolute;left:207px;top:119px;width:439px;height:342px}.challenge-card>img:first-child{width:100%;height:100%;filter:drop-shadow(0 5px 5px #65452522)}.target-number{position:absolute;left:141px;top:115px;width:159px;height:170px;object-fit:contain}.drawer{position:absolute;left:24px;top:542px;width:253px;height:427px}.mat{position:absolute;left:282px;top:538px;width:466px;height:438px}.drawer img,.mat img{width:100%;height:100%;pointer-events:none;filter:drop-shadow(0 4px 4px #65452522)}.drawer.over,.mat.over{filter:drop-shadow(0 0 12px #fff2b9)}.booth-interior{position:absolute;left:833px;top:193px;width:575px;height:609px}.booth-interior img{width:100%;height:100%}.booth-frame{position:absolute;left:758px;top:43px;width:735px;height:923px;z-index:14;pointer-events:none}.curtains{position:absolute;left:831px;top:190px;width:580px;height:616px;overflow:hidden;z-index:13;pointer-events:none;border-radius:45px 45px 0 0}.curtains img{position:absolute;top:0;height:616px;transition:transform 1.2s cubic-bezier(.45,0,.2,1)}.curtain-left{left:0;width:299px}.curtain-right{left:296px;width:284px}.curtains.open .curtain-left{transform:translateX(-102%)}.curtains.open .curtain-right{transform:translateX(102%)}.robot-area{position:absolute;left:833px;top:193px;width:575px;height:609px;overflow:hidden;z-index:10;pointer-events:none}.robot{position:absolute;left:10%;top:6%;width:80%;height:90%;transform-origin:50% 85%}.robot-piece{position:absolute;transition:transform .6s cubic-bezier(.3,0,.2,1)}.sprite{position:relative;width:100%;height:100%;overflow:hidden}.sprite img{position:absolute;max-width:none}.robot-piece.body{z-index:2}.robot-piece.head{z-index:3;--dx:0%;--dy:-12%}.robot-piece.left-arm{z-index:1;--dx:-30%;--dy:10%;transform-origin:85% 15%}.robot-piece.right-arm{z-index:1;--dx:30%;--dy:10%;transform-origin:15% 15%}.robot-piece.left-hand{z-index:1;--dx:-25%;--dy:35%}.robot-piece.right-hand{z-index:1;--dx:25%;--dy:35%}.robot-piece.left-ear{z-index:2;--dx:-50%;--dy:0%}.robot-piece.right-ear{z-index:2;--dx:50%;--dy:0%}.robot-piece.left-leg{z-index:1;--dx:-5%;--dy:20%}.robot-piece.right-leg{z-index:1;--dx:5%;--dy:20%}.robot-piece.detached{transform:translate(var(--dx),var(--dy)) rotate(-5deg)}.robot-piece.left-hand.arm-displaced{transform:translate(-30%,15%)}.robot-piece.right-hand.arm-displaced{transform:translate(30%,15%)}.robot-piece.left-hand.detached.arm-displaced{transform:translate(-40%,45%) rotate(-5deg)}.robot-piece.right-hand.detached.arm-displaced{transform:translate(40%,45%) rotate(-5deg)}.power-light{position:absolute;left:44%;top:33%;width:13%;height:14%;border-radius:50%;background:#ffe8a1;opacity:0;transition:opacity .5s;pointer-events:none}.robot-shadow{position:absolute;left:24%;right:24%;bottom:5%;height:4%;border-radius:50%;background:#62462e33;filter:blur(7px)}.success .power-light{opacity:.7;box-shadow:0 0 20px #ffda80}.part{position:absolute;width:84px;height:84px;padding:0;border:0;background:transparent;touch-action:none;cursor:grab;user-select:none;-webkit-user-select:none;z-index:20;transition:left .35s ease-out,top .35s ease-out,width .5s,height .5s,transform .3s}.part img{width:100%;height:100%;object-fit:contain;pointer-events:none;filter:drop-shadow(0 3px 3px #62432933)}.part:before{content:'';position:absolute;inset:-18px;background:url('ui/count-highlight.png') center/contain no-repeat;opacity:0;transition:opacity .2s}.part.focus:before{opacity:1}.part.focus{transform:scale(1.1)}.part.dragging{z-index:40;transition:none;transform:scale(1.08);cursor:grabbing}.part.installing{pointer-events:none;z-index:21}.part.tightening img{animation:tighten .63s ease-in-out forwards}.part.installed{pointer-events:none;z-index:5;clip-path:polygon(25% 5%,75% 5%,100% 50%,75% 95%,25% 95%,0 50%);background:radial-gradient(circle at 35% 25%,#d5e1e4,#7c969e 65%,#4a6973)}.part.installed img{display:none}.part.installed:after{content:'';position:absolute;inset:38% 24%;background:#536d76;border-radius:1px;transform:rotate(30deg)}.check,.challenge-next{left:628px;top:861px;width:108px;height:109px}.feedback{position:absolute;left:635px;top:551px;width:85px;height:85px;display:grid;place-items:center;border-radius:50%;background:#fff1d9e6;color:#ae5646;font-size:64px;opacity:0;z-index:25;transition:opacity .2s}.feedback.show{opacity:1}.feedback.correct{color:#377181}.gesture{position:absolute;font-size:62px;opacity:0;z-index:40;pointer-events:none;transition:left 1.1s,top 1.1s,opacity .2s}.emphasis{animation:emphasize .7s ease-in-out 2}.paused *{animation-play-state:paused!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}[hidden]{display:none!important}dialog{direction:rtl;max-width:480px;border:3px solid #bc9467;border-radius:20px;padding:26px;background:#fff4dd;color:#3b5e6d;font:18px/1.6 Arial}dialog::backdrop{background:#493b2c88}dialog h1{font-size:25px}dialog button{font:inherit;border:1px solid #a48b6b;border-radius:10px;padding:12px;background:#e7dcc4;cursor:pointer;margin:6px;min-height:48px}@keyframes tighten{0%{transform:scale(1.1) rotate(0)}80%{transform:scale(.8) rotate(680deg)}100%{transform:scale(.65) rotate(720deg)}}@keyframes emphasize{50%{filter:drop-shadow(0 0 15px #fff1b7)}}@keyframes dot-breathe{50%{r:20}}@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

/* Per-frame rig poses must not inherit the assembly easing. */
.robot[data-celebrating] .robot-piece,.robot[data-celebrating] .installed{transition:none}

dialog select{font:inherit;margin:12px;padding:10px}#scene[data-phase=ending] .robot{transform:translateY(6px);transition:transform 1.5s}

/* Artwork reaches the display edges; safe-area padding protects controls only. */
.parent{top:max(26px,calc((env(safe-area-inset-top,0px) + 8px)/var(--scene-scale,1)));left:max(25px,calc((env(safe-area-inset-left,0px) + 8px)/var(--scene-scale,1)))}

.feedback{border:0;padding:0;font-family:inherit;line-height:1;touch-action:manipulation}.feedback:not(:disabled){cursor:pointer;box-shadow:0 3px 0 #b18c7040}.feedback:not(:disabled):active{transform:translateY(2px)}.feedback:focus-visible{outline:4px solid #ae5646;outline-offset:4px}

#viewport[data-screen=recognition]{background-image:url('ui/challenge-background.png')}
#scene[data-screen=recognition] .challenge-background{opacity:1}
#scene[data-screen=recognition] .challenge-card,#scene[data-screen=recognition] .drawer,#scene[data-screen=recognition] .mat,#scene[data-screen=recognition] #parts,#scene[data-screen=recognition] #check,#scene[data-screen=recognition] #feedback,#scene[data-screen=recognition] #repeat{display:none!important}
#scene[data-screen=recognition][data-phase=ending] #recognition,#scene[data-screen=recognition][data-phase=finished] #recognition{display:none}
.recognition-speaker{left:315px;top:235px;width:150px;height:150px}
#recognition-choices{position:absolute;left:38px;top:485px;width:700px;display:flex;direction:ltr;justify-content:center;gap:18px}
.number-choice{position:relative;width:218px;height:260px;flex:none;border:0;padding:0;background:none;cursor:pointer;touch-action:manipulation;border-radius:25px;transition:transform .2s,filter .2s}
.number-choice img{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.number-choice svg{position:absolute;left:18%;top:25%;width:64%;height:62%;pointer-events:none}
.number-choice:active{transform:translateY(4px)}.number-choice:focus-visible{outline:5px solid #397286;outline-offset:4px}.number-choice.wrong{animation:wrong-card-shake .45s ease-in-out}.number-choice.right{filter:drop-shadow(0 0 12px #fff1b7)}
#recognition-dots{position:absolute;left:160px;top:840px;width:450px;display:flex;justify-content:center;gap:18px;direction:ltr}
.review-dot{width:17px;height:17px;border-radius:50%;background:#c7a47e}.review-dot.done{background:#397286}
#parent-progress{position:absolute;left:160px;top:40px;z-index:31;color:#526c70;font-size:22px;direction:ltr;opacity:.8}
#parent-prompt{position:absolute;left:160px;top:91px;max-width:550px;z-index:31;font-size:19px;color:#526c70;direction:rtl}

#scene[data-screen=recognition]:not([data-phase=ending]):not([data-phase=finished]) .robot-area{display:none}
#toy-stage{position:absolute;left:833px;top:193px;width:575px;height:609px;overflow:hidden;z-index:10;pointer-events:none}
#toy-vehicle{position:absolute;left:66px;top:101px;width:443px;height:443px}
#recognition-toy{position:relative;width:100%;height:100%;overflow:visible}
.toy-piece{opacity:0;transform:translate(var(--slide),var(--lift));transition:opacity .24s ease,transform .38s cubic-bezier(.2,.8,.25,1.12)}
.toy-piece.attached{opacity:1;transform:none}
.toy-shadow{position:absolute;left:25%;right:25%;bottom:11%;height:4%;border-radius:50%;background:#62462e33;filter:blur(7px)}
.rocket-flame{position:absolute;left:43%;top:94%;width:14%;height:26%;border-radius:20% 20% 50% 50% / 12% 12% 88% 88%;background:linear-gradient(#fff7c2 8%,#ffd05b 45%,#ef7c39 82%,transparent);filter:drop-shadow(0 0 10px #ffd47e);opacity:0}
[data-toy=rocket].departing #toy-vehicle{animation:rocket-lift-off 1.5s .12s cubic-bezier(.4,0,.58,1) both}
[data-toy=rocket].departing .rocket-flame{animation:rocket-ignition 1.5s .12s ease-out both}
#toy-stage[data-toy=fire-truck] #toy-vehicle{left:42px;top:275px;width:490px;height:276px}
[data-toy=fire-truck].departing #toy-vehicle{animation:truck-roll-out 1.5s .12s cubic-bezier(.52,0,.66,1) both}
.departing:not(:is([data-toy=airplane],[data-toy=city-bicycle],[data-toy=bmx-bicycle],[data-toy=motorcycle],[data-toy=scooter])) [data-part$="-wheel"]>g{transform-box:view-box;animation:truck-wheel-turn var(--drive-duration,1.5s) .12s var(--drive-easing,cubic-bezier(.52,0,.66,1)) both}
[data-toy=fire-truck] [data-part=rear-wheel]>g{transform-origin:337px 736px}
[data-toy=fire-truck] [data-part=front-wheel]>g{transform-origin:1235px 736px}
#toy-stage[data-toy=airplane] #toy-vehicle{left:42px;top:233px;width:490px;height:327px}
[data-toy=airplane].departing #toy-vehicle{animation:airplane-takeoff 1.55s .08s ease-in both}
.departing [data-part=propeller]>g{transform-box:view-box;animation:airplane-propeller .13s linear infinite}
[data-toy=airplane] [data-part=propeller]>g{transform-origin:1395px 456px}
[data-toy=submarine] [data-part=propeller]>g{transform-origin:135px 589px}
#toy-stage[data-toy=train] #toy-vehicle,#toy-stage[data-toy=tractor] #toy-vehicle{left:42px;top:237px;width:490px;height:327px}
#toy-stage[data-toy=submarine] #toy-vehicle{left:42px;top:243px;width:490px;height:276px}
#toy-stage[data-toy=sports-car] #toy-vehicle{left:42px;top:315px;width:490px;height:245px}
:is([data-toy=train],[data-toy=sports-car],[data-toy=tractor],[data-toy=bus],[data-toy=police-car],[data-toy=ambulance],[data-toy=concrete-mixer],[data-toy=excavator],[data-toy=forklift],[data-toy=jeep],[data-toy=caravan],[data-toy=city-bicycle],[data-toy=bmx-bicycle],[data-toy=skateboard],[data-toy=motorcycle],[data-toy=atv],[data-toy=tank],[data-toy=dump-truck],[data-toy=road-roller],[data-toy=scooter],[data-toy=crane-truck],[data-toy=red-blue-semi],[data-toy=garbage-truck]).departing #toy-vehicle{animation:truck-roll-out var(--drive-duration,1.5s) .12s var(--drive-easing,cubic-bezier(.52,0,.66,1)) both}
[data-toy=sports-car]{--drive-duration:1.05s;--drive-easing:cubic-bezier(.55,0,.8,.38)}
[data-toy=tractor]{--drive-duration:1.55s;--drive-easing:cubic-bezier(.37,0,.54,.87)}
[data-toy=train] [data-part=rear-wheel]>g{transform-origin:319px 782px}
[data-toy=train] [data-part=middle-wheel]>g{transform-origin:694px 782px}
[data-toy=train] [data-part=front-wheel]>g{transform-origin:1062px 782px}
[data-toy=sports-car] [data-part=rear-wheel]>g{transform-origin:402px 634px}
[data-toy=sports-car] [data-part=front-wheel]>g{transform-origin:1338px 636px}
[data-toy=tractor] [data-part=rear-wheel]>g{transform-origin:328px 708px;--wheel-rotation:385deg}
[data-toy=tractor] [data-part=front-wheel]>g{transform-origin:1114px 821px;--wheel-rotation:750deg}
[data-toy=submarine].departing #toy-vehicle{animation:submarine-dive 1.55s .08s ease-in both}
@keyframes submarine-dive{0%,12%{transform:translate(0,0) rotate(0)}30%{transform:translate(34px,4px) rotate(5deg)}100%{transform:translate(510px,325px) rotate(15deg)}}
@keyframes airplane-takeoff{0%,12%{transform:translate(0,0) rotate(0)}28%{transform:translate(42px,0) rotate(0)}100%{transform:translate(570px,-345px) rotate(-20deg)}}
@keyframes airplane-propeller{0%,100%{transform:scaleY(1)}50%{transform:scaleY(.22)}}
#toy-stage:is([data-toy=bus],[data-toy=ambulance],[data-toy=concrete-mixer]) #toy-vehicle{left:42px;top:var(--vehicle-top);width:490px;height:276px}
#toy-stage[data-toy=bus]{--vehicle-top:290px}
#toy-stage[data-toy=ambulance]{--vehicle-top:286px}
#toy-stage[data-toy=concrete-mixer]{--vehicle-top:280px}
#toy-stage[data-toy=police-car] #toy-vehicle{left:42px;top:234px;width:490px;height:327px}
[data-toy=bus] [data-part=rear-wheel]>g{transform-origin:416px 698px}
[data-toy=bus] [data-part=front-wheel]>g{transform-origin:1261px 698px}
[data-toy=police-car] [data-part=rear-wheel]>g{transform-origin:409px 791px}
[data-toy=police-car] [data-part=front-wheel]>g{transform-origin:1111px 791px}
[data-toy=ambulance] [data-part=rear-wheel]>g{transform-origin:422px 711px}
[data-toy=ambulance] [data-part=front-wheel]>g{transform-origin:1191px 711px}
[data-toy=concrete-mixer] [data-part=rear-wheel]>g{transform-origin:464px 740px}
[data-toy=concrete-mixer] [data-part=front-wheel]>g{transform-origin:1182px 740px}
#toy-stage:is([data-toy=excavator],[data-toy=forklift],[data-toy=jeep],[data-toy=bmx-bicycle],[data-toy=boat],[data-toy=motorcycle],[data-toy=atv]) #toy-vehicle{left:42px;top:var(--vehicle-top);width:490px;height:327px}
#toy-stage:is([data-toy=caravan],[data-toy=city-bicycle],[data-toy=skateboard],[data-toy=passenger-jet]) #toy-vehicle{left:42px;top:var(--vehicle-top);width:490px;height:245px}
#toy-stage[data-toy=hot-air-balloon] #toy-vehicle{left:137px;top:61px;width:301px;height:452px}
[data-toy=excavator],[data-toy=forklift]{--vehicle-top:231px}
[data-toy=jeep]{--vehicle-top:240px}
[data-toy=caravan]{--vehicle-top:307px}
[data-toy=city-bicycle]{--vehicle-top:300px}
[data-toy=bmx-bicycle]{--vehicle-top:226px}
[data-toy=skateboard]{--vehicle-top:331px}
[data-toy=passenger-jet]{--vehicle-top:303px}
[data-toy=boat]{--vehicle-top:220px}
[data-toy=motorcycle]{--vehicle-top:235px}
[data-toy=atv]{--vehicle-top:237px}
[data-toy=forklift] [data-part=rear-wheel]>g{transform-origin:330px 836px}
[data-toy=forklift] [data-part=front-wheel]>g{transform-origin:920px 836px}
[data-toy=jeep] [data-part=rear-wheel]>g{transform-origin:416px 758px}
[data-toy=jeep] [data-part=front-wheel]>g{transform-origin:1101px 758px}
[data-toy=caravan] [data-part=rear-wheel]>g{transform-origin:566px 741px}
[data-toy=caravan] [data-part=front-wheel]>g{transform-origin:758px 741px}
[data-toy=skateboard] [data-part=rear-wheel]>g{transform-origin:474px 613px}
[data-toy=skateboard] [data-part=front-wheel]>g{transform-origin:1288px 613px}
[data-toy=atv] [data-part=rear-wheel]>g{transform-origin:337px 753px}
[data-toy=atv] [data-part=front-wheel]>g{transform-origin:1104px 753px}
[data-toy=hot-air-balloon].departing #toy-vehicle{animation:balloon-rise 1.55s .08s ease-in both}
[data-toy=passenger-jet].departing #toy-vehicle{animation:airplane-takeoff 1.55s .08s ease-in both}
:is([data-toy=boat],[data-toy=jet-ski],[data-toy=sailboat]).departing #toy-vehicle{animation:boat-sail 1.55s .08s ease-in both}
[data-toy=excavator].departing [data-part=bucket]>g{transform-box:view-box;transform-origin:1219px 530px;animation:bucket-curl .9s ease-in-out}
[data-toy=forklift].departing [data-part=fork]>g{animation:fork-rise .55s ease-out both}
@keyframes balloon-rise{0%{transform:translate(0,0)}30%{transform:translate(19px,-20px) rotate(4deg)}100%{transform:translate(75px,-560px) rotate(-5deg)}}
@keyframes boat-sail{0%{transform:translateX(0)}25%{transform:translate(45px,-12px) rotate(-4deg)}55%{transform:translate(170px,2px)}100%{transform:translate(575px,-16px) rotate(-4deg)}}
@keyframes bucket-curl{50%{transform:rotate(-22deg)}}
@keyframes fork-rise{to{transform:translateY(-105px)}}
#toy-stage:is([data-toy=helicopter],[data-toy=jet-ski],[data-toy=dump-truck],[data-toy=road-roller],[data-toy=scooter],[data-toy=crane-truck],[data-toy=sailboat],[data-toy=red-blue-semi],[data-toy=garbage-truck]) #toy-vehicle{left:42px;top:var(--vehicle-top);width:490px;height:327px}
#toy-stage[data-toy=tank] #toy-vehicle{left:42px;top:278px;width:490px;height:276px}
[data-toy=helicopter]{--vehicle-top:232px}
[data-toy=jet-ski]{--vehicle-top:258px}
[data-toy=dump-truck]{--vehicle-top:240px}
[data-toy=road-roller]{--vehicle-top:233px;--drive-duration:1.55s}
[data-toy=scooter]{--vehicle-top:228px}
[data-toy=crane-truck],[data-toy=sailboat]{--vehicle-top:225px}
[data-toy=red-blue-semi]{--vehicle-top:230px}
[data-toy=garbage-truck]{--vehicle-top:248px}
[data-toy=dump-truck] [data-part=rear-wheel]>g{transform-origin:347px 786px}
[data-toy=dump-truck] [data-part=front-wheel]>g{transform-origin:1125px 785px}
[data-toy=road-roller] [data-part=rear-wheel]>g{transform-origin:302px 760px}
[data-toy=crane-truck] [data-part=rear-wheel]>g{transform-origin:440px 853px}
[data-toy=crane-truck] [data-part=front-wheel]>g{transform-origin:992px 851px}
[data-toy=red-blue-semi] [data-part=rear-wheel]>g{transform-origin:271px 827px}
[data-toy=red-blue-semi] [data-part=middle-wheel]>g{transform-origin:671px 827px}
[data-toy=red-blue-semi] [data-part=front-wheel]>g{transform-origin:1117px 813px}
[data-toy=garbage-truck] [data-part=rear-wheel]>g{transform-origin:405px 761px}
[data-toy=garbage-truck] [data-part=front-wheel]>g{transform-origin:1139px 761px}
[data-toy=helicopter].departing #toy-vehicle{animation:helicopter-takeoff 1.55s .08s ease-in both}
[data-toy=helicopter].departing [data-part=main-rotor]>g{transform-box:view-box;transform-origin:874px 145px;animation:main-rotor-turn .16s linear infinite}
[data-toy=helicopter].departing [data-part=tail-rotor]>g{transform-box:view-box;transform-origin:235px 518px;animation:truck-wheel-turn .45s linear infinite}
[data-toy=dump-truck].departing :is([data-part=bed],[data-part=tailgate])>g{transform-box:view-box;transform-origin:247px 616px;animation:dump-bed-tip 1.15s ease-in-out}
[data-toy=crane-truck].departing [data-part=hook]>g{transform-box:view-box;transform-origin:1275px 143px;animation:crane-hook-sway .8s ease-in-out}
@keyframes helicopter-takeoff{0%,12%{transform:translate(0,0)}45%{transform:translate(0,-155px)}100%{transform:translate(530px,-340px) rotate(10deg)}}
@keyframes main-rotor-turn{0%,100%{transform:scaleX(1)}50%{transform:scaleX(.17)}}
@keyframes dump-bed-tip{50%{transform:rotate(-16deg)}}
@keyframes crane-hook-sway{25%{transform:rotate(12deg)}65%{transform:rotate(-10deg)}}
@keyframes truck-roll-out{from{transform:translateX(0)}to{transform:translateX(575px)}}
@keyframes truck-wheel-turn{from{transform:rotate(0)}to{transform:rotate(var(--wheel-rotation,750deg))}}
@keyframes rocket-lift-off{0%,15%{transform:translateY(0)}100%{transform:translateY(-630px)}}
@keyframes rocket-ignition{0%{opacity:0;transform:scaleY(.25)}12%,90%{opacity:1;transform:scaleY(1)}100%{opacity:0}}

/* A visible face-down gather and deal separates recognition questions. */
.number-choice{transition:transform .24s cubic-bezier(.3,0,.2,1),filter .2s,opacity .2s}
.number-choice svg{transition:opacity .1s}
#scene[data-phase=recognition-shuffle] .number-choice{transform:translate(var(--gather-x,0px),var(--gather-y,-34px)) rotate(var(--gather-angle,0deg)) scale(.88)}
#scene[data-phase=recognition-shuffle] .number-choice svg{opacity:0}
#scene[data-phase=recognition-deal] .number-choice{transform:translate(0,0) rotate(0) scale(1)}
#scene[data-phase=recognition-deal] .number-choice svg{opacity:1;transition:opacity .16s .06s}
@media(prefers-reduced-motion:reduce){#scene[data-phase=recognition-shuffle] .number-choice{transform:none;opacity:0}#scene[data-phase=recognition-deal] .number-choice{transform:none;opacity:1}}

#recognition-choices.stack-seeding .number-choice{transition:none}

/* Suppress browser callouts and selection throughout the game. */
html,
body {
  overscroll-behavior: none;
  touch-action: pan-y;
}
body,
body * {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
body img {
  -webkit-user-drag: none;
}
#viewport,
#viewport * {
  touch-action: none;
}
#parent-panel,
#parent-panel * {
  touch-action: pan-y;
}

#goodbye-picture {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: #f0d1a1 url('ui/teaching-background.png') center / cover no-repeat;
}
#goodbye-picture .robot {
  position: relative;
  inset: auto;
  width: 460px;
  height: 548px;
}

#numeral-variants {
  position: absolute;
  z-index: 6;
  display: flex;
  direction: ltr;
  gap: 16px;
  top: 92px;
  left: 577px;
  pointer-events: none;
}

.numeral-variant {
  display: grid;
  place-items: center;
  width: 181px;
  height: 208px;
  border: 2px solid #d5b78d;
  border-radius: 22px;
  background: #f8edd4;
  box-shadow: 0 6px 12px #5e452c20;
  opacity: 0;
  --stack-x: calc(54px - var(--variant-index) * 169px);
  --stack-y: calc(269px + var(--variant-index) * 8px);
  --stack-angle: calc(-7deg + var(--variant-index) * 7deg);
  transform: translate(var(--stack-x), calc(var(--stack-y) - 560px)) rotate(var(--stack-angle)) scale(1.65);
}

.numeral-variant svg {
  width: 148px;
  height: 148px;
}

#scene:is([data-phase=reveal], [data-phase=counting], [data-phase=lesson-ready]) .lesson-card {
  left: 205px;
  top: 23px;
  width: 355px;
  height: 304px;
}

#scene:is([data-phase=reveal], [data-phase=counting], [data-phase=lesson-ready]) #teaching ~ .repeat {
  left: 1204px;
  top: 111px;
}

#scene[data-phase=stacking] .numeral-variant {
  opacity: 1;
  transform: translate(var(--stack-x), var(--stack-y)) rotate(var(--stack-angle)) scale(1.65);
  transition: opacity .22s ease-out, transform .68s cubic-bezier(.3,.05,.5,1);
  transition-delay: calc(var(--variant-index) * 1180ms);
}

#scene:is([data-phase=reveal], [data-phase=counting], [data-phase=lesson-ready]) .numeral-variant {
  opacity: 1;
  transform: none;
  transition: transform 1.2s cubic-bezier(.3,0,.2,1);
}

@media (prefers-reduced-motion: reduce) {
  #scene:is([data-phase=reveal], [data-phase=counting], [data-phase=lesson-ready]) .numeral-variant {
    transition: none;
  }
}

#parent-gate { width: min(300px, calc(100vw - 32px)); text-align: center; padding: 20px; }
#parent-gate h2 { margin: 0; font-size: 22px; }
#parent-gate p { margin: 8px 0; }
#gate-display { direction: ltr; font-size: 26px; letter-spacing: 4px; margin: 8px 0; }
#gate-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#gate-keys button { margin: 0; padding: 6px; min-height: 48px; font-size: 22px; }
#gate-keys #gate-cancel { font-size: 16px; }
#gate-error { color: #a43d32; }


#scene[data-phase=assembling] .curtains img { transition-duration: .84s; }
#scene[data-phase=assembling] .robot-piece { transition-duration: .42s; }
.part.installing { transition-duration: .72s, .72s, .72s, .72s, .21s; }

@keyframes wrong-card-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

#scene.resting .parent { z-index: 101; }
#parent-panel[data-resting] #end-after-round,
#parent-panel[data-resting] #restart,
#parent-panel[data-resting] #review-preview,
#parent-panel[data-resting] #assist,
#parent-panel[data-resting] #lesson-picker,
#parent-panel[data-resting] label[for="lesson-picker"] { display: none; }

#scene[data-number="10"] .number-base,
#scene[data-number="11"] .number-base,
#scene[data-number="12"] .number-base { stroke-width: 48; }
#scene[data-number="10"] #challenge-number,
#scene[data-number="11"] #challenge-number,
#scene[data-number="12"] #challenge-number { stroke-width: 48; }
#scene[data-number="10"] .trace-progress,
#scene[data-number="11"] .trace-progress,
#scene[data-number="12"] .trace-progress { stroke-width: 25; }
.robot-piece.body { --dx: 0%; --dy: 18%; }
.robot-piece.left-boot, .robot-piece.right-boot { z-index: 1; --dy: 59%; }
.robot-piece.left-boot { --dx: -16%; }
.robot-piece.right-boot { --dx: 16%; }
.robot-piece.left-leg.detached { transform: translate(-5%, 34%); }
.robot-piece.right-leg.detached { transform: translate(5%, 34%); }
.robot-piece.left-boot.leg-displaced { transform: translate(-5%, 53%); }
.robot-piece.right-boot.leg-displaced { transform: translate(5%, 53%); }
