/* Native canvas: 600 × 100. All selectors are scoped to this custom element. */
animal-loader {
  display: block;
  position: relative;
  width: 600px;
  max-width: 100%;
  aspect-ratio: 6 / 1;
  overflow: hidden;
  contain: layout paint;
}
animal-loader[hidden] { display: none !important; }
animal-loader .animal-loader__scene {
  position: absolute;
  width: 600px;
  height: 100px;
  left: 0;
  top: 0;
  transform-origin: top left;
}
animal-loader .animal-loader__window {
  position: absolute;
  left: 12px;
  top: 0;
  width: 576px;
  height: 80px;
  overflow: hidden;
}
animal-loader .animal-loader__family {
  position: absolute;
  left: 0;
  top: 0;
}
animal-loader .animal-loader__character {
  position: absolute;
  animation: animal-loader-bob .5s steps(1, end) infinite;
}
animal-loader .animal-loader__sprite {
  display: block;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  animation: animal-loader-walk var(--walk-duration, 1s) steps(var(--frames, 4), end) infinite;
}
animal-loader .animal-loader__bar {
  position: absolute;
  left: 9px;
  top: 80px;
  width: 582px;
  height: 18px;
  background: #303030;
  clip-path: polygon(3px 0, calc(100% - 3px) 0, calc(100% - 3px) 3px,
    100% 3px, 100% calc(100% - 3px), calc(100% - 3px) calc(100% - 3px),
    calc(100% - 3px) 100%, 3px 100%, 3px calc(100% - 3px),
    0 calc(100% - 3px), 0 3px, 3px 3px);
}
animal-loader .animal-loader__track,
animal-loader .animal-loader__fill {
  position: absolute;
  left: 3px;
  top: 3px;
  width: 576px;
  height: 12px;
  background: repeating-linear-gradient(to right, #f0f0f0 0 21px, #303030 21px 24px);
}
animal-loader .animal-loader__fill {
  width: 0;
  background: repeating-linear-gradient(to right, #707070 0 21px, #303030 21px 24px);
}
animal-loader .animal-loader__scene.is-running .animal-loader__family {
  animation: animal-loader-advance var(--travel-duration, 7s) steps(24, end) 1 forwards;
}
animal-loader .animal-loader__scene.is-running .animal-loader__fill {
  animation: animal-loader-fill var(--travel-duration, 7s) steps(24, end) 1 forwards;
}
animal-loader .animal-loader__scene:not(.is-running) .animal-loader__character,
animal-loader .animal-loader__scene:not(.is-running) .animal-loader__sprite {
  animation-play-state: paused;
}
animal-loader .animal-loader__label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
@keyframes animal-loader-advance { from { transform: translateX(0); } to { transform: translateX(576px); } }
@keyframes animal-loader-fill { from { width: 0; } to { width: 576px; } }
@keyframes animal-loader-walk { from { background-position-x: 0; } to { background-position-x: var(--sheet-end, -264px); } }
@keyframes animal-loader-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
/* Presets may pause once and switch to a seated sprite strip. The Web
   Animations API supplies the shared travel/fill/pose timeline. */
animal-loader .animal-loader__scene.has-pause.is-running .animal-loader__family,
animal-loader .animal-loader__scene.has-pause.is-running .animal-loader__fill {
  animation: none;
}
animal-loader .animal-loader__scene.has-pause .animal-loader__character { animation: none; }
animal-loader .animal-loader__sitting { position: absolute; left: 0; top: 0; opacity: 0; }

/* Arrival actions have separate roaring and idle sprite strips. */
animal-loader .animal-loader__scene.has-finish .animal-loader__character { animation: none; }
animal-loader .animal-loader__roaring,
animal-loader .animal-loader__idle { position: absolute; left: 0; top: 0; opacity: 0; }
animal-loader .animal-loader__roaring { animation: none; }

/* No reduced-motion variant: the owner chose to animate for everyone (2026-10-14). */
