.scene[data-room=animals] .animal-train-objects{position:absolute;inset:0;z-index:2;pointer-events:none}
.scene[data-room=animals] .animal-train-stage{position:absolute;left:36%;top:43%;width:63%;height:35%;transform-origin:50% 90%;isolation:isolate;will-change:transform}
.scene[data-room=animals] .train-passengers,.scene[data-room=animals] .train-controls,.scene[data-room=animals] .train-fronts,.scene[data-room=animals] .train-paws{position:absolute;inset:0;pointer-events:none}
.scene[data-room=animals] .train-passengers{z-index:2}
.scene[data-room=animals] .animal-train-body,.scene[data-room=animals] .animal-train-front{position:absolute;left:0;bottom:0;width:100%;height:auto;display:block;pointer-events:none;user-select:none;-webkit-user-drag:none}
.scene[data-room=animals] .animal-train-body{z-index:1;filter:drop-shadow(0 .22cqw .18cqw #68421c25)}
.scene[data-room=animals] .train-fronts{z-index:3}
.scene[data-room=animals] .train-paws{z-index:4}
.scene[data-room=animals] .train-controls{z-index:5}
.scene[data-room=animals] .train-animal-window,.scene[data-room=animals] .train-paw-window{position:absolute;top:11%;bottom:45%;width:23%;height:auto;overflow:hidden;pointer-events:none}
.scene[data-room=animals] .train-paw-window{bottom:auto;overflow:visible}
.scene[data-room=animals] .train-animal-window[data-animal-word=rabbit]{top:-17%}
.scene[data-room=animals] .train-animal-window[data-animal-word=duck]{top:3%}
.scene[data-room=animals] .train-animal-window[data-animal-word=horse]{top:-2%}
.scene[data-room=animals] [data-slot="0"]{left:27%}
.scene[data-room=animals] [data-slot="1"]{left:51%}
.scene[data-room=animals] [data-slot="2"]{left:75%}
.scene[data-room=animals] .train-animal-motion{position:absolute;left:5%;top:0;width:90%;display:block;transform:scale(var(--passenger-scale,1));transform-origin:50% 75%;pointer-events:none}
.scene[data-room=animals] .train-animal-crop{position:relative;display:block;width:100%;overflow:hidden;pointer-events:none}
.scene[data-room=animals] .train-animal-crop img{position:absolute;display:block;max-width:none;user-select:none;-webkit-user-drag:none;pointer-events:none}
.scene[data-room=animals] .train-animal,.scene[data-room=animals] .train-next{position:absolute;top:-6%;width:23%;height:106%;padding:0;border:0;border-radius:15%;background:transparent;pointer-events:auto;touch-action:manipulation;-webkit-tap-highlight-color:transparent;color:#63391e;opacity:1}
.scene[data-room=animals] .train-animal:disabled,.scene[data-room=animals] .train-next:disabled{opacity:1;cursor:default}
.scene[data-room=animals] .train-animal-word{position:absolute;left:0;top:61.2%;width:100%;height:13%;display:flex;align-items:center;justify-content:center;border-radius:.8cqw;background:none;box-shadow:none;font-size:1.7cqw;font-weight:850;line-height:1;pointer-events:none;text-shadow:0 .05cqw .05cqw #e6cca2}
/* The wooden Next plaque sits below the engine without obscuring the toy. */
.scene[data-room=animals] .train-next{left:0;top:13%;width:27%;height:110%}
.scene[data-room=animals] .train-next-tag{position:absolute;left:18%;top:79%;width:64%;height:14%;display:flex;flex-direction:row;align-items:center;justify-content:center;gap:.6cqw;background:linear-gradient(150deg,#fff3da,#e9c89e);border:1px solid #d7b78b88;border-radius:.7cqw;box-shadow:inset 0 .12cqw .18cqw #fffdf0,0 .2cqw .25cqw #79502a35;font-size:1.5cqw;font-weight:850;line-height:1;pointer-events:none;color:#704326}
.scene[data-room=animals] .train-next-tag svg{width:1.4cqw;height:1.4cqw;fill:none;stroke:#397b9c;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.scene[data-room=animals] .train-animal:focus-visible,.scene[data-room=animals] .train-next:focus-visible{outline:.18cqw solid #fff6bc;outline-offset:.25cqw}
.scene[data-room=animals] .animal-train-objects[data-active=true][data-busy=false] .train-animal-motion:not(.train-animal-playing){animation:train-passenger-breathe 4.7s ease-in-out var(--passenger-delay,0s) infinite}
.scene[data-room=animals] .train-animal-motion.train-animal-playing{animation:train-passenger-hello 1.2s ease-in-out both}
.scene[data-room=animals] .train-animal-motion.train-animal-playing:is([data-animal-word=rabbit],[data-animal-word=bird]){animation:train-passenger-hop 1.2s ease-in-out both}
.scene[data-room=animals] .train-animal-motion.train-animal-playing:is([data-animal-word=pig],[data-animal-word=duck]){animation:train-passenger-wiggle 1.2s ease-in-out both}
.scene[data-room=animals] .train-animal-playing .train-animal-word,.scene[data-room=animals] .train-animal-static .train-animal-word{text-shadow:0 0 .45cqw #fff4b4;background:none}
.scene[data-room=animals] .animal-train-objects[data-active=false] *{animation-play-state:paused!important}
/* The three foreground pieces include the near rim, never the back of the wagon. */
.scene[data-room=animals] .animal-train-front[data-front="0"]{clip-path:polygon(28.17% 37.43%,49.08% 37.43%,49.50% 41.81%,49.17% 71.93%,27.92% 71.93%,27.83% 41.81%)}
.scene[data-room=animals] .animal-train-front[data-front="1"]{clip-path:polygon(52.17% 38.01%,73% 38.01%,73.42% 42.11%,73.08% 71.93%,51.83% 71.93%,51.75% 42.11%)}
.scene[data-room=animals] .animal-train-front[data-front="2"]{clip-path:polygon(76.25% 38.30%,97.17% 38.30%,97.67% 42.40%,97.33% 72.51%,75.75% 72.51%,75.75% 42.40%)}
@keyframes train-passenger-breathe{0%,100%{transform:scale(var(--passenger-scale,1))}50%{transform:scale(calc(var(--passenger-scale,1)*1.014),calc(var(--passenger-scale,1)*1.02))}}
@keyframes train-passenger-hello{0%,100%{transform:scale(var(--passenger-scale,1)) rotate(0)}22%{transform:translateY(-.35cqw) scale(var(--passenger-scale,1)) rotate(-3deg)}48%{transform:translateY(-.08cqw) scale(var(--passenger-scale,1)) rotate(2.5deg)}70%{transform:translateY(-.22cqw) scale(var(--passenger-scale,1)) rotate(-1.5deg)}}
@keyframes train-passenger-hop{0%,100%{transform:scale(var(--passenger-scale,1))}18%{transform:translateY(.16cqw) scale(calc(var(--passenger-scale,1)*1.025),calc(var(--passenger-scale,1)*.97))}36%{transform:translateY(-.65cqw) scale(var(--passenger-scale,1)) rotate(-2deg)}58%{transform:translateY(0) scale(var(--passenger-scale,1))}78%{transform:translateY(-.25cqw) scale(var(--passenger-scale,1)) rotate(1deg)}}
@keyframes train-passenger-wiggle{0%,100%{transform:scale(var(--passenger-scale,1)) rotate(0)}23%{transform:scale(var(--passenger-scale,1)) rotate(-4deg)}47%{transform:scale(var(--passenger-scale,1)) rotate(3.5deg)}70%{transform:scale(var(--passenger-scale,1)) rotate(-2deg)}86%{transform:scale(var(--passenger-scale,1)) rotate(1deg)}}
@media(prefers-reduced-motion:reduce){.scene[data-room=animals] .animal-train-objects *{animation:none!important;transition:none!important}}
