/* Idle motion for companions and avatars. Calm mode freezes everything. */
.cmp, .avt { overflow: visible; }
.cmp *, .avt * { transform-box: fill-box; transform-origin: center; }
.cmp .bob { animation: c-bob 3.2s ease-in-out infinite; }
.cmp .wag { transform-origin: 0% 50%; animation: c-wag 1.1s ease-in-out infinite; }
.cmp .glow, .avt .glow { animation: c-glow 1.6s ease-in-out infinite; }
.cmp .spin { animation: c-spin 9s linear infinite; }
.cmp .orbit { animation: c-spin 7s linear infinite; }
.cmp .pulse { animation: c-pulse 2.2s ease-out infinite; }
.cmp .drift { animation: c-drift 4s ease-in-out infinite; }
.cmp .twinkle, .avt .twinkle { animation: c-twinkle 2s ease-in-out infinite; }
.cmp .wing.l { transform-origin: 100% 60%; animation: c-flapl .9s ease-in-out infinite; }
.cmp .wing.r { transform-origin: 0% 60%; animation: c-flapr .9s ease-in-out infinite; }
.cmp .flame { transform-origin: 50% 100%; animation: c-flame .5s ease-in-out infinite alternate; }
.cmp .fade { animation: c-fade 4s ease-in-out infinite; }
.cmp .eye, .avt .eye { animation: c-blink 4.6s infinite; }
.avt .av-bob { animation: c-bob 2.8s ease-in-out infinite; }
.avt .flutter { transform-origin: 0% 50%; animation: c-wag .7s ease-in-out infinite; }
/* rarity auras */
.cmp[data-rarity="rare"] { filter: drop-shadow(0 0 8px rgba(116,201,243,.55)); }
.cmp[data-rarity="epic"] { filter: drop-shadow(0 0 10px rgba(185,161,245,.7)); }
.cmp[data-rarity="legendary"] { filter: drop-shadow(0 0 12px rgba(255,213,110,.85)); }
.cmp[data-rarity="mythic"] { filter: drop-shadow(0 0 14px rgba(142,219,114,.85)) drop-shadow(0 0 4px #fff); }
/* reactions */
.cmp.hop { animation: c-hop .6s var(--spring, cubic-bezier(.34,1.56,.64,1)); }
.cmp.shake { animation: c-shake .45s; }
@keyframes c-bob { 50% { transform: translateY(-6px); } }
@keyframes c-wag { 50% { transform: rotate(14deg); } }
@keyframes c-glow { 50% { opacity: .45; } }
@keyframes c-spin { to { transform: rotate(360deg); } }
@keyframes c-pulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes c-drift { 50% { transform: translate(5px, -9px) rotate(8deg); } }
@keyframes c-twinkle { 50% { transform: scale(.3) rotate(45deg); opacity: .3; } }
@keyframes c-flapl { 50% { transform: rotate(-22deg) scaleY(.9); } }
@keyframes c-flapr { 50% { transform: rotate(22deg) scaleY(.9); } }
@keyframes c-flame { to { transform: scale(1.25, 1.4); } }
@keyframes c-fade { 40%, 60% { opacity: .35; } }
@keyframes c-blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes c-hop { 40% { transform: translateY(-26px) rotate(-6deg) scale(1.08); } }
@keyframes c-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
html[data-motion="calm"] .cmp *, html[data-motion="calm"] .avt *, html[data-motion="calm"] .cmp, html[data-motion="calm"] .avt { animation: none !important; }

.mon .m-bob { animation: c-bob 2.4s ease-in-out infinite; }
.mon.hit { animation: c-shake .4s; filter: brightness(1.4) saturate(1.4); }
.mon.boss { filter: drop-shadow(0 0 10px rgba(255,150,125,.6)); }
.mon.die { animation: m-die .8s forwards; }
.mon.atk { animation: m-atk .5s; }
@keyframes m-die { 30% { transform: scale(1.15) rotate(6deg); } 100% { transform: scale(.1) rotate(-40deg) translateY(40px); opacity: 0; } }
@keyframes m-atk { 40% { transform: translateX(-60px) scale(1.12); } }
html[data-motion="calm"] .mon, html[data-motion="calm"] .mon * { animation: none !important; }
