/* Pet art motion (ported from Nimkat css/motion.css + app.css + game.css, plus the DarsGPT
   pet moods). Only transform and opacity animate. */

.ill { display: block; overflow: visible; width: 100%; height: auto; }
.ill.flame { height: 100%; }
.ill.head { overflow: hidden; }
.ill-breathe { animation: ill-breathe 3.4s var(--ease-soft) infinite; transform-origin: 80px 107px; }
@keyframes ill-breathe { 50% { transform: scale(1.025, .98); } }
.ill-ear { transform-box: fill-box; transform-origin: 50% 100%; animation: ill-ear-l 5.5s var(--ease-spring) infinite; }
.ill-ear.r { animation-name: ill-ear-r; animation-delay: -2.7s; }
@keyframes ill-ear-l { 0%, 84%, 100% { transform: rotate(0); } 88% { transform: rotate(-12deg); } 92% { transform: rotate(7deg); } 96% { transform: rotate(-3deg); } }
@keyframes ill-ear-r { 0%, 84%, 100% { transform: rotate(0); } 88% { transform: rotate(12deg); } 92% { transform: rotate(-7deg); } 96% { transform: rotate(3deg); } }
.ill-blush { animation: ill-blush 3.2s var(--ease-soft) infinite; }
@keyframes ill-blush { 50% { opacity: .45; } }
.ill-bob.happy { animation: ill-hop 2.6s var(--ease-out) infinite; transform-origin: 80px 107px; }
@keyframes ill-hop { 0%, 55%, 100% { transform: translateY(0) scale(1); } 62% { transform: translateY(1px) scale(1.04, .95); } 72% { transform: translateY(-9px) scale(.97, 1.04); } 84% { transform: translateY(0) scale(1.03, .97); } 90% { transform: scale(1); } }
.ill-wave { transform-box: fill-box; transform-origin: center; animation: ill-wave .7s var(--ease-soft) infinite alternate; }
.ill-wave.r { animation-delay: -.35s; }
@keyframes ill-wave { from { transform: translateY(2px); } to { transform: translateY(-9px) rotate(-12deg); } }
.ill-sip { transform-box: fill-box; transform-origin: 0% 100%; animation: ill-sip 6s var(--ease-soft) infinite; }
@keyframes ill-sip { 0%, 64%, 100% { transform: none; } 72%, 86% { transform: translate(-12px, -12px) rotate(-22deg); } }
.ill-bob.break { animation: ill-sway 4s var(--ease-soft) infinite; transform-origin: 80px 107px; }
@keyframes ill-sway { 50% { transform: rotate(1.6deg); } }
.ill-bob.studying { animation: ill-bob 2.6s var(--ease-soft) infinite; transform-origin: 80px 107px; }
@keyframes ill-bob { 50% { transform: rotate(-1.2deg) translateY(1.5px); } }
.ill-write { animation: ill-write .5s var(--ease-soft) infinite alternate; }
@keyframes ill-write { from { transform: translateX(-5px); } to { transform: translate(4px, 1px); } }
.ill-steam { animation: ill-steam 2.4s var(--ease-soft) infinite; }
@keyframes ill-steam { from { transform: translateY(3px); opacity: .1; } 50% { opacity: 1; } to { transform: translateY(-6px); opacity: 0; } }
.ill-blink { animation: ill-blink 4s infinite; transform-origin: 80px 75px; }
@keyframes ill-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
.ill-twinkle { animation: ill-twinkle 2.8s var(--ease-soft) infinite; transform-box: fill-box; transform-origin: center; }
.ill-twinkle.d2 { animation-delay: -1.4s; }
@keyframes ill-twinkle { 50% { opacity: .45; transform: scale(.7); } }
.ill-orbit { animation: ill-orbit 7s var(--ease-soft) infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes ill-orbit { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.ill-flicker { animation: ill-flicker 1.6s var(--ease-soft) infinite; transform-origin: 50% 90%; transform-box: fill-box; }
@keyframes ill-flicker { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(.96, 1.05); } 60% { transform: scale(1.03, .97); } }
.ill-ember { animation: ill-ember 1.9s var(--ease-out) infinite; opacity: 0; }
.ill-ember.e2 { animation-delay: -.6s; }
.ill-ember.e3 { animation-delay: -1.2s; }
@keyframes ill-ember { 0% { transform: translate(0, 6px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translate(-4px, -24px) scale(.4); opacity: 0; } }
.ill-drop { animation: ill-fall linear infinite; }
@keyframes ill-fall { from { transform: translate(4px, -20px); } to { transform: translate(-14px, 130px); } }
.ill-flake { animation: ill-snow linear infinite; }
@keyframes ill-snow { from { transform: translate(0, 0); } to { transform: translate(-8px, 130px); } }
.ill-spin { animation: ill-spin 16s linear infinite; }
.ill-rays { animation: ill-spin 22s linear infinite; transform-origin: 100px 100px; }
@keyframes ill-spin { to { transform: rotate(360deg); } }
.ill-cloud { animation: ill-cloud 6s var(--ease-soft) infinite alternate; }
@keyframes ill-cloud { to { transform: translateX(-10px); } }
.ill-aurora { animation: ill-aurora 7s var(--ease-soft) infinite alternate; }
@keyframes ill-aurora { from { transform: translateX(-8px); opacity: .7; } to { transform: translateX(8px); opacity: 1; } }
.ill-antenna { animation: ill-twinkle 1.8s var(--ease-soft) infinite; transform-box: fill-box; transform-origin: center; }
.ill-glow { opacity: 0; }
.lamp.on .ill-glow { opacity: .22; }

/* ---- DarsGPT pet moods ---- */
/* sad: slumps forward and down, slow heavy breath */
.ill-bob.sad { transform: translateY(7px) rotate(-5deg) scale(1, .95); transform-origin: 80px 107px; }
.ill-bob.sad .ill-breathe { animation-duration: 5.2s; }
.ill-bob.sad .ill-ear { animation: none; transform: rotate(-18deg); }
.ill-bob.sad .ill-ear.r { transform: rotate(18deg); }
.ill-tear { animation: ill-tear 3.6s var(--ease-soft) infinite; }
@keyframes ill-tear { 0%, 40% { opacity: 0; transform: translateY(-2px); } 55% { opacity: .9; } 100% { opacity: 0; transform: translateY(9px); } }
/* asleep: head down on the arms, deep slow breath, floating z's */
.ill-bob.asleep { transform: translateY(12px) rotate(9deg) scale(1, .92); transform-origin: 80px 107px; }
.ill-bob.asleep .ill-breathe { animation-duration: 6s; }
.ill-bob.asleep .ill-ear { animation: none; }
.ill-zzz text { animation: ill-zzz 3s var(--ease-soft) infinite; opacity: 0; }
.ill-zzz .z2 { animation-delay: .6s; }
.ill-zzz .z3 { animation-delay: 1.2s; }
@keyframes ill-zzz { 0% { opacity: 0; transform: translate(0, 4px); } 30% { opacity: .8; } 100% { opacity: 0; transform: translate(6px, -8px); } }
/* worried: small nervous tremble */
.ill-bob.worried { animation: ill-worry 2.2s var(--ease-soft) infinite; transform-origin: 80px 107px; }
@keyframes ill-worry { 0%, 70%, 100% { transform: none; } 75% { transform: translateX(-1.5px); } 80% { transform: translateX(1.5px); } 85% { transform: translateX(-1px); } }
/* reading: leans into the book, eyes scan the lines, pages turn */
.ill-bob.reading { animation: ill-lean 3s var(--ease-soft) infinite; transform-origin: 80px 107px; }
@keyframes ill-lean { 50% { transform: translateY(2px) rotate(-1.5deg); } }
.ill-read-eyes { animation: ill-scan 1.6s var(--ease-soft) infinite alternate; }
@keyframes ill-scan { from { transform: translateX(-2.5px); } to { transform: translateX(2.5px); } }
.ill-page { transform-box: view-box; transform-origin: 80px 104px; animation: ill-page 1.8s var(--ease-soft) infinite; }
.ill-page.p2 { animation-delay: .9s; }
@keyframes ill-page { 0% { transform: scaleX(1); opacity: 1; } 45% { transform: scaleX(.05); opacity: 1; } 50% { transform: scaleX(-.05); opacity: .9; } 100% { transform: scaleX(-1); opacity: 0; } }

/* ---- home stage (frameless pet peeking over the card's bottom edge, acting its mood) ----
   The body runs past the card's edge, so nothing here moves the pet up: hops are stretches
   from the bottom, so its flat base never shows. */
.ill.stage .stg-act, .ill.stage .ill-bob { transform-box: fill-box; transform-origin: 50% 100%; }
/* eyes: blink (ill-blink) and look around; worried eyes dart, sad eyes look down and away */
.ill.stage .ill-look { animation: stg-eyes 6.5s var(--ease-soft) infinite; }
@keyframes stg-eyes { 0%, 14%, 100% { transform: none; } 20%, 36% { transform: translateX(-2.4px); } 44%, 58% { transform: translateX(2.4px); } 64%, 72% { transform: none; } 78%, 88% { transform: translate(1px, -1.6px); } }
.ill.stage .ill-look.dart { animation: stg-dart 2.4s steps(1) infinite; }
@keyframes stg-dart { 0% { transform: none; } 15% { transform: translateX(-2.6px); } 30% { transform: translateX(2.6px); } 45% { transform: none; } 60% { transform: translateX(-2.6px); } 70% { transform: none; } }
.ill.stage .ill-look.down { animation: stg-eyes-down 7s var(--ease-soft) infinite; }
@keyframes stg-eyes-down { 0%, 30%, 100% { transform: translateY(.6px); } 40%, 70% { transform: translate(-2px, 1.2px); } }
.ill.stage .ill-blink { animation-duration: 3.6s; }
.ill.stage .ill-blink.slow { animation: stg-blink-slow 5s infinite; transform-origin: 80px 77px; }
@keyframes stg-blink-slow { 0%, 88%, 100% { transform: scaleY(1); } 92%, 94% { transform: scaleY(.1); } }
/* ears: twitch often when ok, wiggle when happy, droop when sad */
.ill.stage.st-idle .ill-ear { animation-duration: 3.4s; }
.ill.stage.st-happy .ill-ear { animation: stg-ear-wiggle .9s var(--ease-soft) infinite alternate; }
.ill.stage.st-happy .ill-ear.r { animation-delay: -.45s; }
@keyframes stg-ear-wiggle { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
.ill.stage .ill-bob.sad { animation: stg-sad-sway 5s var(--ease-soft) infinite; transform: none; }
@keyframes stg-sad-sway { 0%, 100% { transform: rotate(-2.5deg) scale(1, .985); } 50% { transform: rotate(-1deg) scale(1, 1); } }
.ill.stage .ill-bob.sad .ill-ear { animation: none; transform: rotate(-24deg); }
.ill.stage .ill-bob.sad .ill-ear.r { transform: rotate(24deg); }
/* asleep: head tipped onto the pillow, slow breath */
.ill.stage .ill-bob.asleep { transform: rotate(6deg) translateY(2px); }
/* happy: bouncy stretch in place, waving paws, hearts float up */
.ill.stage .ill-bob.happy { animation: stg-bounce 1.3s var(--ease-soft) infinite; }
@keyframes stg-bounce { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(1.04, .95); } 60% { transform: scale(.97, 1.05); } }
.stg-heart { animation: stg-heart 3.2s var(--ease-soft) infinite; opacity: 0; transform-box: fill-box; transform-origin: center; }
.stg-heart.d2 { animation-delay: 1.6s; }
@keyframes stg-heart { 0% { opacity: 0; transform: translateY(6px) scale(.5); } 25% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-16px) scale(.8) rotate(12deg); } }
/* ok: tilts its head now and then */
.ill.stage.st-idle .stg-act { animation: stg-look 7s var(--ease-soft) infinite; }
@keyframes stg-look { 0%, 30%, 100% { transform: none; } 38%, 50% { transform: rotate(-4deg); } 60%, 72% { transform: rotate(3.5deg); } 80% { transform: none; } }
/* worried: fidgeting paws by the mouth, a sweat drop slides down */
.stg-fidget { animation: stg-fidget .45s var(--ease-soft) infinite alternate; }
@keyframes stg-fidget { from { transform: translateY(0); } to { transform: translateY(-2px); } }
.stg-sweat { animation: stg-sweat 2.6s var(--ease-soft) infinite; }
@keyframes stg-sweat { 0%, 20% { opacity: 0; transform: translateY(-3px); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
/* sad: its own little rain cloud */
.stg-cloud { animation: stg-cloud 4s var(--ease-soft) infinite alternate; }
@keyframes stg-cloud { to { transform: translateX(-4px); } }
.stg-drop { animation: stg-drop 1.2s linear infinite; opacity: 0; }
.stg-drop.d2 { animation-delay: .4s; }
.stg-drop.d3 { animation-delay: .8s; }
@keyframes stg-drop { 0% { opacity: 0; transform: translateY(0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
/* asleep: the moon rocks slowly */
.stg-moon { transform-box: fill-box; transform-origin: center; animation: stg-moon 5s var(--ease-soft) infinite alternate; }
@keyframes stg-moon { from { transform: rotate(-10deg); } to { transform: rotate(8deg); } }

/* one-shot acts, played while the wrapper has data-act="act" */
/* happy: turns round on the spot (a flip that never lifts it off the edge) */
[data-act="act"] .ill.stage.st-happy .stg-act { animation: stg-turn 1.1s var(--ease-out) both; }
@keyframes stg-turn { 0% { transform: none; } 15% { transform: scale(1.08, .9); } 40% { transform: scale(-1, 1.06) rotate(4deg); } 65% { transform: scale(-1, 1); } 85% { transform: scale(1, 1.05) rotate(-4deg); } 100% { transform: none; } }
/* ok: tilts and waves hello */
[data-act="act"] .ill.stage.st-idle .stg-act { animation: stg-tilt 1.4s var(--ease-soft) both; }
@keyframes stg-tilt { 0%, 100% { transform: none; } 25%, 75% { transform: rotate(-6deg); } }
[data-act="act"] .ill.stage.st-idle .stg-hi { transform-box: fill-box; transform-origin: 50% 100%; animation: stg-hi 1.4s var(--ease-soft) both; }
@keyframes stg-hi { 0%, 100% { transform: none; } 20% { transform: translate(8px, -20px); } 35% { transform: translate(8px, -20px) rotate(-25deg); } 50% { transform: translate(8px, -20px) rotate(20deg); } 65% { transform: translate(8px, -20px) rotate(-25deg); } 80% { transform: translate(8px, -20px); } }
/* worried glances at the flame chip (to its left in RTL) */
[data-act="act"] .ill.stage.st-worried .stg-act { animation: stg-glance 1.4s var(--ease-soft) both; }
@keyframes stg-glance { 0%, 100% { transform: none; } 20%, 70% { transform: rotate(-9deg); } 80% { transform: rotate(2deg); } }
/* sad: wipes the tear with a paw, with a heavy sigh */
[data-act="act"] .ill.stage.st-sad .stg-act { animation: stg-sigh 1.8s var(--ease-soft) both; }
@keyframes stg-sigh { 0%, 100% { transform: none; } 30% { transform: scale(1.03, 1.04); } 70% { transform: scale(1.02, .94); } }
[data-act="act"] .ill.stage.st-sad .stg-wipe { transform-box: fill-box; transform-origin: center; animation: stg-wipe 1.8s var(--ease-soft) both; }
@keyframes stg-wipe { 0%, 100% { transform: none; } 25% { transform: translate(-1px, -14px); } 40% { transform: translate(-4px, -16px); } 55% { transform: translate(1px, -14px); } 70% { transform: translate(-3px, -16px); } }
/* asleep jolts half awake, then drops back */
[data-act="act"] .ill.stage.st-asleep .stg-act { animation: stg-jolt 1.6s var(--ease-soft) both; }
@keyframes stg-jolt { 0%, 100% { transform: none; } 12%, 30% { transform: rotate(-9deg) scale(1, 1.04); } 60% { transform: rotate(2deg); } }
/* tap: squish and bounce back, whatever the mood */
[data-act="boop"] .ill.stage .stg-act { animation: stg-boop .6s var(--ease-spring, cubic-bezier(.34, 1.56, .64, 1)) both; }
@keyframes stg-boop { 0% { transform: none; } 30% { transform: scale(1.14, .82); } 60% { transform: scale(.92, 1.1); } 100% { transform: none; } }


@media (prefers-reduced-motion: reduce) {
  .ill *, .ill { animation: none !important; }
}
