/* Drawn animals: idle wiggles always run; walking motions run while a friend is .moving (or inside
   anything marked .walking, such as a game character on the move). */
.critter .cr-leg-a, .critter .cr-leg-b { transform-box: fill-box; transform-origin: 50% 0; }
:is(.friend.moving, .walking) .cr-leg-a { animation: cr-leg .3s ease-in-out infinite alternate; }
:is(.friend.moving, .walking) .cr-leg-b { animation: cr-leg .3s ease-in-out infinite alternate-reverse; }
.critter .cr-tail { transform-box: fill-box; animation: cr-wag .55s ease-in-out infinite alternate; }
.critter .cr-wing { transform-box: fill-box; animation: cr-flap .2s ease-in-out infinite alternate; }
.critter .cr-fin { transform-box: fill-box; animation: cr-wag .8s ease-in-out infinite alternate; }
.critter .cr-ear { transform-box: fill-box; transform-origin: 50% 100%; animation: cr-ear 3.4s ease-in-out infinite; }
.critter .cr-blink { transform-box: fill-box; transform-origin: 50% 50%; animation: cr-blink 4.6s infinite; }
.critter .cr-body { transform-box: fill-box; transform-origin: 50% 100%; animation: cr-breathe 2.6s ease-in-out infinite; }
.critter .cr-motion { transform-box: fill-box; transform-origin: 50% 100%; }
.critter.jump { animation: jumpy .6s ease-out 2; }

/* ways of moving */
:is(.friend.moving, .walking) .mv-hop .cr-motion { animation: cr-hop .42s ease-out infinite; }
:is(.friend.moving, .walking) .mv-trot .cr-motion { animation: cr-trot .26s ease-in-out infinite alternate; }
:is(.friend.moving, .walking) .mv-prance .cr-motion { animation: cr-prance .36s ease-in-out infinite alternate; }
:is(.friend.moving, .walking) .mv-waddle .cr-motion { animation: cr-waddle .34s ease-in-out infinite alternate; }
:is(.friend.moving, .walking) .mv-scuttle .cr-motion { animation: cr-scuttle .12s linear infinite alternate; }
:is(.friend.moving, .walking) .mv-plod .cr-motion { animation: cr-trot .7s ease-in-out infinite alternate; }
:is(.friend.moving, .walking) .mv-slide .cr-motion { animation: cr-slide .9s ease-in-out infinite alternate; }
.mv-flutter .cr-motion { animation: cr-flutter .7s ease-in-out infinite alternate; }
.mv-fly .cr-motion { animation: cr-fly 1.6s ease-in-out infinite alternate; }
.mv-swim .cr-motion { animation: cr-swim 1.4s ease-in-out infinite alternate; }
:is(.friend.moving, .walking) .mv-fly .cr-wing { animation-duration: .12s; }

@keyframes cr-leg { from { transform: rotate(-24deg); } to { transform: rotate(24deg); } }
@keyframes cr-wag { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes cr-flap { from { transform: scaleY(1) rotate(0); } to { transform: scaleY(.5) rotate(-12deg); } }
@keyframes cr-ear { 0%, 86%, 100% { transform: rotate(0); } 91% { transform: rotate(-14deg); } 96% { transform: rotate(7deg); } }
@keyframes cr-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(.1); } }
@keyframes cr-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, .98); } }
@keyframes cr-hop { 0%, 100% { transform: translateY(0) scale(1.06, .9); } 15% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-36px) scale(.94, 1.08); } }
@keyframes cr-trot { from { transform: translateY(0); } to { transform: translateY(-6px); } }
@keyframes cr-prance { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-16px) rotate(3deg); } }
@keyframes cr-waddle { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
@keyframes cr-scuttle { from { transform: translateY(0) rotate(-2deg); } to { transform: translateY(-3px) rotate(2deg); } }
@keyframes cr-slide { from { transform: scale(1, 1); } to { transform: scale(1.1, .92); } }
@keyframes cr-flutter { 0% { transform: translateY(0) rotate(-6deg); } 100% { transform: translateY(-18px) rotate(6deg); } }
@keyframes cr-fly { from { transform: translateY(0); } to { transform: translateY(-14px); } }
@keyframes cr-swim { from { transform: rotate(-6deg) translateY(0); } to { transform: rotate(6deg) translateY(-6px); } }

/* an animal drawn into an HTML screen (critterSVG): sized like an emoji glyph */
.critter-svg { display: inline-block; vertical-align: -.1em; overflow: visible; }
.no-ground .cr-shadow, .no-ground .cr-ripple { display: none; }
.underwater .cr-ripple { display: none; }

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