/* J-1001-TYPING-LICH-IMAGINE (DEV): Imagine lich, hall 8. Copy of mino-imagine.css rules. */
.monster-rect.lich-imagine.atk-lich { animation: none !important; } /* the frames carry the swing */
.monster-rect.lich-imagine img {
  transform-origin: 53.13% 99.53%; /* body x 323, ground row 850 of the 608x854 frames */
  animation: lich-breathe 2.9s ease-in-out infinite;
}
.monster-rect.lich-imagine.skel-knock img { animation: lich-breathe 2.9s ease-in-out infinite, lich-knock .3s ease-out; }
.monster-rect.lich-imagine.skel-knock-heavy img { animation: lich-breathe 2.9s ease-in-out infinite, lich-knock-heavy .36s ease-out; }
.monster-rect.lich-imagine.skel-dying img { animation: lich-fade var(--skel-fade-total, 1460ms) linear forwards; }

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

/* heavy chest rise, hooves stay planted */
@keyframes lich-breathe {
  0%, 100% { scale: 1 1; }
  50% { scale: 1.006 1.016; }
}
/* pushed away from the hero (right): same canvas px as the skeleton's knock */
@keyframes lich-knock {
  0% { translate: 0 0; }
  30% { translate: 1.5% 0; }
  100% { translate: 0 0; }
}
@keyframes lich-knock-heavy {
  0% { translate: 0 0; }
  25% { translate: 3% 0; }
  100% { translate: 0 0; }
}
/* heavy hit -> sink -> kneel, hold, then fade before the next foe steps up */
@keyframes lich-fade {
  0%, 70% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .monster-rect.lich-imagine img,
  .monster-rect.lich-imagine.skel-knock img,
  .monster-rect.lich-imagine.skel-knock-heavy img { animation: none; }
}

/* J-1001-TYPING-LICH-FLOAT: like the vampire, he drifts in toward the hero as the
   bolt fires (contact 240 ms), holds, then floats back. Rises a bit more than the
   vampire, so it reads as levitating. */
.monster-rect.lich-imagine.atk-lich img {
  animation: lich-breathe 2.9s ease-in-out infinite, lich-float-strike .78s cubic-bezier(.3,.1,.3,1) both;
}
@keyframes lich-float-strike {
  0%   { translate: 0 0; }
  31%  { translate: -18% -2.5%; }
  45%  { translate: -18% -2.5%; }
  100% { translate: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .monster-rect.lich-imagine.atk-lich img { animation: none; }
}

/* J-1001-TYPING-LICH-WISPS: rising soul wisps (spawned by lich-variant.js). */
.lich-wisps { position: absolute; inset: 0; pointer-events: none; z-index: 3; overflow: visible; }
.lich-wisps span {
  position: absolute; aspect-ratio: 1 / 3.4; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 55%, #fff 0%, rgba(235,244,255,.85) 30%, rgba(205,225,255,.35) 55%, rgba(200,220,255,0) 72%);
  filter: blur(.6px) drop-shadow(0 0 4px rgba(220,236,255,.95));
  mix-blend-mode: screen;
  opacity: 0; transform: translate(-50%, 0) scale(.6);
  animation-name: lich-wisp; animation-timing-function: cubic-bezier(.25,.6,.35,1); animation-fill-mode: forwards;
}
@keyframes lich-wisp {
  0%   { opacity: 0;   transform: translate(-50%, 0) scale(.5); }
  15%  { opacity: .9; }
  55%  { opacity: .85; transform: translate(calc(-50% + var(--sway) * .5), calc(var(--rise) * 3)) scale(1) rotate(8deg); }
  100% { opacity: 0;   transform: translate(calc(-50% + var(--sway)), calc(var(--rise) * 6)) scale(.4) rotate(-6deg); }
}
