/* J-0927-SKEL-IMAGINE (DEV): Courtney's Imagine skeleton, hall 3.
   Breathing uses `scale`, knockback uses `translate`, death uses `opacity`, so
   none of them fight the shared `transform: rotate(--pose-rot)` on .ph-rect img.
   The slash-hit flash (#monster-rect.slash-hit img) replaces the animation list,
   so the combos below keep the breathing/knock/fade running under it. */
.monster-rect.skel-imagine img {
  transform-origin: 56.76% 99.35%; /* planted feet: x 482.5, ground row 843.5 of the 850x849 frames */
  animation: skel-breathe 2.6s ease-in-out infinite;
}
/* J-1021-4: the fall tweens are 616x652 (the 616x615 frame + 37 rows of feet the old
   build clipped). Grow the img box by 652/615 from the same top edge so scale and
   placement match every other frame; origin = the same planted-feet point. */
.monster-rect.skel-imagine img[src*="skeleton-imagine/t46_"] {
  height: calc(100% * 652 / 615); max-height: none;
  align-self: flex-start; object-position: 50% 0;
  transform-origin: 56.76% 93.71%;
}
.monster-rect.skel-imagine.skel-knock img { animation: skel-breathe 2.6s ease-in-out infinite, skel-knock .3s ease-out; }
.monster-rect.skel-imagine.skel-knock-heavy img { animation: skel-breathe 2.6s ease-in-out infinite, skel-knock-heavy .36s ease-out; }
.monster-rect.skel-imagine.skel-dying img { animation: skel-fade var(--skel-fade-total, 1460ms) linear forwards; }

#monster-rect.skel-imagine.slash-hit img { animation: slash-hit .3s ease-out, skel-breathe 2.6s ease-in-out infinite; }
#monster-rect.skel-imagine.slash-hit.skel-knock img { animation: slash-hit .3s ease-out, skel-breathe 2.6s ease-in-out infinite, skel-knock .3s ease-out; }
#monster-rect.skel-imagine.slash-hit.skel-knock-heavy img { animation: slash-hit .3s ease-out, skel-breathe 2.6s ease-in-out infinite, skel-knock-heavy .36s ease-out; }
#monster-rect.skel-imagine.slash-hit.skel-dying img { animation: slash-hit .3s ease-out, skel-fade var(--skel-fade-total, 1460ms) linear forwards; }

/* subtle: ~1.5% chest rise, feet stay planted */
@keyframes skel-breathe {
  0%, 100% { scale: 1 1; }
  50% { scale: 1.006 1.015; }
}
/* pushed away from the hero (right), same beat as the other foes' flinch.
   % of the 850-wide frame: same px as the old 3.5% / 7% of 575. */
@keyframes skel-knock {
  0% { translate: 0 0; }
  30% { translate: 2.37% 0; }
  100% { translate: 0 0; }
}
@keyframes skel-knock-heavy {
  0% { translate: 0 0; }
  25% { translate: 4.74% 0; }
  100% { translate: 0 0; }
}
/* tweens -> full4 -> fall -> full6, hold, then fade out before the next foe steps up */
@keyframes skel-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .monster-rect.skel-imagine img,
  .monster-rect.skel-imagine.skel-knock img,
  .monster-rect.skel-imagine.skel-knock-heavy img { animation: none; }
}

/* J-1001-TYPING-SKEL-STEP: the strike frames lean the body back (~17 px), so he
   steps in toward the hero for the blow (contact 240 ms) and back to ready.
   Ground-level `translate` only, so it stacks with breathing and the pose rotate. */
.monster-rect.skel-imagine.atk-skeleton img {
  animation: skel-step-strike .78s cubic-bezier(.3,.1,.3,1) both;
}
@keyframes skel-step-strike {
  0%   { translate: 0 0; }
  31%  { translate: -16% 0; }
  45%  { translate: -16% 0; }
  100% { translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) { .monster-rect.skel-imagine.atk-skeleton img { animation: none; } }
