/* СГЕНЕРИРОВАНО tools/build_anim_css.py — не править руками.
   Пересобрать: python3 tools/build_anim_css.py
   Источник чисел: game/assets/anim/<name>.json (см. tools/pack_sheet.py). */

.spr-anim {
  display: block;
  background-repeat: no-repeat;
  will-change: background-position;
  pointer-events: none; /* тапы ловит родитель .animal / зона пена */
}

/* butterfly: 4 кадров 448×371, 12.0 fps, движение 0.33 с + пауза 45% = цикл 0.61 с */
.spr-butterfly {
  background-image: url("../assets/anim/butterfly.webp");
  background-size: 1792px 371px;
  width: 448px;
  height: 371px;
  animation: anim-butterfly 0.606s linear infinite;
}
@keyframes anim-butterfly {
  0.00%, 13.74% { background-position: -0px 0; }
  13.75%, 27.49% { background-position: -448px 0; }
  27.50%, 41.24% { background-position: -896px 0; }
  41.25%, 100% { background-position: -1344px 0; }
}
.spr-butterfly.fast { animation: anim-butterfly-fast 0.133s linear infinite; }
@keyframes anim-butterfly-fast {
  0.00%, 24.99% { background-position: -0px 0; }
  25.00%, 49.99% { background-position: -448px 0; }
  50.00%, 74.99% { background-position: -896px 0; }
  75.00%, 100% { background-position: -1344px 0; }
}

/* cat: 4 кадров 408×406, 6.0 fps, движение 0.67 с + пауза 45% = цикл 1.21 с */
.spr-cat {
  background-image: url("../assets/anim/cat.webp");
  background-size: 1632px 406px;
  width: 408px;
  height: 406px;
  animation: anim-cat 1.212s linear infinite;
}
@keyframes anim-cat {
  0.00%, 13.74% { background-position: -0px 0; }
  13.75%, 27.49% { background-position: -408px 0; }
  27.50%, 41.24% { background-position: -816px 0; }
  41.25%, 100% { background-position: -1224px 0; }
}
.spr-cat.fast { animation: anim-cat-fast 0.267s linear infinite; }
@keyframes anim-cat-fast {
  0.00%, 24.99% { background-position: -0px 0; }
  25.00%, 49.99% { background-position: -408px 0; }
  50.00%, 74.99% { background-position: -816px 0; }
  75.00%, 100% { background-position: -1224px 0; }
}

/* cow: 4 кадров 476×318, 6.0 fps, движение 0.67 с + пауза 45% = цикл 1.21 с */
.spr-cow {
  background-image: url("../assets/anim/cow.webp");
  background-size: 1904px 318px;
  width: 476px;
  height: 318px;
  animation: anim-cow 1.212s linear infinite;
}
@keyframes anim-cow {
  0.00%, 13.74% { background-position: -0px 0; }
  13.75%, 27.49% { background-position: -476px 0; }
  27.50%, 41.24% { background-position: -952px 0; }
  41.25%, 100% { background-position: -1428px 0; }
}
.spr-cow.fast { animation: anim-cow-fast 0.267s linear infinite; }
@keyframes anim-cow-fast {
  0.00%, 24.99% { background-position: -0px 0; }
  25.00%, 49.99% { background-position: -476px 0; }
  50.00%, 74.99% { background-position: -952px 0; }
  75.00%, 100% { background-position: -1428px 0; }
}

/* dog: 4 кадров 399×430, 6.0 fps, движение 0.67 с + пауза 45% = цикл 1.21 с */
.spr-dog {
  background-image: url("../assets/anim/dog.webp");
  background-size: 1596px 430px;
  width: 399px;
  height: 430px;
  animation: anim-dog 1.212s linear infinite;
}
@keyframes anim-dog {
  0.00%, 13.74% { background-position: -0px 0; }
  13.75%, 27.49% { background-position: -399px 0; }
  27.50%, 41.24% { background-position: -798px 0; }
  41.25%, 100% { background-position: -1197px 0; }
}
.spr-dog.fast { animation: anim-dog-fast 0.267s linear infinite; }
@keyframes anim-dog-fast {
  0.00%, 24.99% { background-position: -0px 0; }
  25.00%, 49.99% { background-position: -399px 0; }
  50.00%, 74.99% { background-position: -798px 0; }
  75.00%, 100% { background-position: -1197px 0; }
}

/* hen: 4 кадров 414×405, 6.0 fps, движение 0.67 с + пауза 45% = цикл 1.21 с */
.spr-hen {
  background-image: url("../assets/anim/hen.webp");
  background-size: 1656px 405px;
  width: 414px;
  height: 405px;
  animation: anim-hen 1.212s linear infinite;
}
@keyframes anim-hen {
  0.00%, 13.74% { background-position: -0px 0; }
  13.75%, 27.49% { background-position: -414px 0; }
  27.50%, 41.24% { background-position: -828px 0; }
  41.25%, 100% { background-position: -1242px 0; }
}
.spr-hen.fast { animation: anim-hen-fast 0.267s linear infinite; }
@keyframes anim-hen-fast {
  0.00%, 24.99% { background-position: -0px 0; }
  25.00%, 49.99% { background-position: -414px 0; }
  50.00%, 74.99% { background-position: -828px 0; }
  75.00%, 100% { background-position: -1242px 0; }
}

/* wheat: 3 кадров 266×417, 1.0 fps, движение 3.00 с + пауза 45% = цикл 5.45 с */
.spr-wheat {
  background-image: url("../assets/anim/wheat.webp");
  background-size: 798px 417px;
  width: 266px;
  height: 417px;
  animation: anim-wheat 5.455s linear infinite;
}
@keyframes anim-wheat {
  0.00%, 18.32% { background-position: -0px 0; }
  18.33%, 36.66% { background-position: -266px 0; }
  36.67%, 100% { background-position: -532px 0; }
}
.spr-wheat.fast { animation: anim-wheat-fast 1.200s linear infinite; }
@keyframes anim-wheat-fast {
  0.00%, 33.32% { background-position: -0px 0; }
  33.33%, 66.66% { background-position: -266px 0; }
  66.67%, 100% { background-position: -532px 0; }
}

/* Укачивает — стоп всему движению. Показываем кадр 0. */
@media (prefers-reduced-motion: reduce) {
  .spr-anim {
    animation: none !important;
    background-position: 0 0 !important;
  }
}
