/* ==========================================================================
   Zakzak as a character (js/character.js): sleep, hunger, pout, what he wears,
   his balloons and the food tray. Moods are #zakzak is-* classes; the parts are
   drawn into his SVG once and stay hidden until a mood shows them.
   ========================================================================== */

.zk-ch, .zk-acc { display: none; }
.zk-acc.is-on { display: inline; }

/* ---------- What he wears: one thing per finished level ---------- */
.zk-flower circle { fill: #ff9ccf; stroke: var(--zk-line); stroke-width: 2.5; }
.zk-flower .zk-flower-mid { fill: #ffd84d; }
.zk-bow { fill: #ff5e6e; stroke: var(--zk-line); stroke-width: 3; stroke-linejoin: round; }
.zk-bow-knot { fill: #e2475a; stroke: var(--zk-line); stroke-width: 3; }
.zk-cape { fill: #ff5e7a; stroke: var(--zk-line); stroke-width: 4; stroke-linejoin: round; }
.zk-cape-hi { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; opacity: .35; }
.zk-crown { fill: url(#rw-gold); stroke: #b77800; stroke-width: 3; stroke-linejoin: round; }
.zk-gem { fill: #ff5e7a; stroke: #fff; stroke-width: 1.5; }
.zk-gem--b { fill: #5bb8ff; }

.zk-acc.is-new { transform-box: fill-box; transform-origin: center; animation: zk-acc-in .8s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes zk-acc-in {
  0% { transform: scale(0) rotate(-30deg); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

/* ---------- His balloons: one per finished room, held in his left hand ---------- */
.zk-string { fill: none; stroke: rgba(60, 50, 100, .5); stroke-width: 1.3; }
.zk-balloon-skin { stroke: rgba(40, 30, 70, .25); stroke-width: 1.4; }
.zk-balloon-knot { stroke: rgba(40, 30, 70, .25); stroke-width: 1; }
.zk-balloon-hi { fill: #fff; opacity: .6; }
.zk-balloon {
  transform-box: view-box;
  transform-origin: 24px 146px;   /* the hand: they sway around it */
  animation: zk-bob 4s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes zk-bob {
  0%, 100% { transform: rotate(-2.5deg); }
  50% { transform: rotate(2.5deg); }
}
.zk-balloon.is-new { animation: zk-balloon-in 1.3s cubic-bezier(.3, 1.4, .5, 1) both, zk-bob 4s ease-in-out 1.3s infinite; }
@keyframes zk-balloon-in {
  0% { transform: scale(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: scale(1); }
}
/* In a lesson (the doors are hidden) his hands are free */
.doors[hidden] ~ .zakzak .zk-bunch { display: none; }

/* ---------- Sleep: nightcap, closed eyes, slow breathing, zzz ---------- */
.zk-sleep-eye { fill: none; stroke: var(--zk-line); stroke-width: 5; stroke-linecap: round; }
.zk-sleep-mouth { fill: var(--zk-line); transform-box: fill-box; transform-origin: center; }
.zk-cap { fill: #6f8cff; stroke: var(--zk-line); stroke-width: 4; stroke-linejoin: round; }
.zk-cap-band { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; }
.zk-cap-ball { fill: #fff; stroke: var(--zk-line); stroke-width: 3; }

.zakzak.is-asleep .zk-eye, .zakzak.is-asleep .zk-mouth--idle,
.zakzak.is-asleep .zk-horn, .zakzak.is-asleep .zk-horn-hi,
.zakzak.is-asleep .zk-acc--4 { display: none; }
.zakzak.is-asleep .zk-sleep-eye, .zakzak.is-asleep .zk-sleep-mouth,
.zakzak.is-asleep .zk-cap, .zakzak.is-asleep .zk-cap-band, .zakzak.is-asleep .zk-cap-ball { display: inline; }
.zakzak.is-asleep .zk-body { animation: zk-sleep-breathe 3.4s ease-in-out infinite; }
.zakzak.is-asleep .zk-sleep-mouth { animation: zk-snore 3.4s ease-in-out infinite; }
.zakzak.is-asleep .zk-arm { animation: none; transform: rotate(var(--sw)); }
@keyframes zk-sleep-breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.045, .95); }
}
@keyframes zk-snore {
  0%, 100% { transform: scale(.8); }
  50% { transform: scale(1.5, 1.7); }
}

.zk-zzz { display: none; position: absolute; right: 0; top: -4%; width: 34%; height: 40%; pointer-events: none; }
.zakzak.is-asleep .zk-zzz { display: block; }
.zk-zzz i {
  position: absolute;
  left: 0;
  bottom: 0;
  font: 900 7vmin/1 system-ui, sans-serif;
  font-style: normal;
  color: #7a68e0;
  text-shadow: 0 2px 0 #fff, 0 0 6px #fff;
  opacity: 0;
  animation: zk-z 3.6s linear infinite;
}
.zk-zzz i:nth-child(2) { animation-delay: 1.2s; font-size: 8.5vmin; }
.zk-zzz i:nth-child(3) { animation-delay: 2.4s; font-size: 10vmin; }
@keyframes zk-z {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  15% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(90%, -170%) scale(1.15) rotate(-12deg); }
}

/* Yawn before sleeping: half-shut eyes and a big round mouth */
.zakzak.is-yawn .zk-mouth--idle { display: none; }
.zakzak.is-yawn .zk-sleep-mouth { display: inline; animation: zk-yawn 2.2s ease-in-out; }
.zakzak.is-yawn .zk-eye { animation: none; transform: scaleY(.4); }
@keyframes zk-yawn {
  0% { transform: scale(1); }
  30%, 75% { transform: scale(2.6, 3); }
  100% { transform: scale(1.2); }
}

/* Waking up: a big stretch with both arms up */
.zakzak.is-waking .zk-body { animation: zk-stretch 1s ease-out; }
.zakzak.is-waking .zk-arm { animation: zk-arm-up 1s ease-out; }
@keyframes zk-stretch {
  0% { transform: scale(1.04, .94); }
  40% { transform: scale(.94, 1.08); }
  100% { transform: scale(1, 1); }
}

/* ---------- Hunger: licking his lips, a rumbling tummy ---------- */
.zk-yum-mouth { fill: var(--zk-line); stroke: var(--zk-line); stroke-width: 3; stroke-linejoin: round; }
.zk-yum-tongue { fill: #ff8fb6; stroke: var(--zk-line); stroke-width: 2.5; transform-box: fill-box; transform-origin: 30% 30%; }
.zakzak.is-hungry .zk-mouth--idle { display: none; }
.zakzak.is-hungry .zk-yum-mouth, .zakzak.is-hungry .zk-yum-tongue { display: inline; }
.zakzak.is-hungry.is-talking .zk-yum-mouth, .zakzak.is-hungry.is-talking .zk-yum-tongue { display: none; }
.zakzak.is-hungry .zk-yum-tongue { animation: zk-lick 1.2s ease-in-out infinite; }
.zakzak.is-hungry .zk-body { animation: zk-tummy 2.4s ease-in-out infinite; }
@keyframes zk-lick {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  50% { transform: translate(5px, -3px) rotate(-20deg); }
}
@keyframes zk-tummy {
  0%, 70%, 100% { transform: translateX(0); }
  75% { transform: translateX(-2.5%); }
  80% { transform: translateX(2.5%); }
  85% { transform: translateX(-1.5%); }
  90% { transform: translateX(1%); }
}

/* Eating: closed wavy mouth, full cheeks, chomp chomp */
.zk-munch-mouth { fill: none; stroke: var(--zk-line); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.zakzak.is-munch .zk-mouth--idle, .zakzak.is-munch .zk-talk { display: none; }
.zakzak.is-munch .zk-munch-mouth { display: inline; }
.zakzak.is-munch .zk-cheek { transform-box: fill-box; transform-origin: center; transform: scale(1.7); }
.zakzak.is-munch .zk-body { animation: zk-chomp .32s ease-in-out 4; }
@keyframes zk-chomp {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.05, .93); }
}

/* Lemon: squeezed eyes and a shiver */
.zk-sour-eye, .zk-sour-mouth { fill: none; stroke: var(--zk-line); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.zakzak.is-sour .zk-eye, .zakzak.is-sour .zk-mouth--idle, .zakzak.is-sour .zk-talk { display: none; }
.zakzak.is-sour .zk-sour-eye, .zakzak.is-sour .zk-sour-mouth { display: inline; }
.zakzak.is-sour .zk-body { animation: zk-shiver .12s linear 10; }
@keyframes zk-shiver {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-1.5%); }
  75% { transform: translateX(1.5%); }
}

/* Wrong food: a quick "no" shake of the head */
.zakzak.is-nope .zk-body { animation: zk-nope .5s ease-in-out; }
@keyframes zk-nope {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-7deg); }
  75% { transform: rotate(7deg); }
}

/* ---------- Pout: his guess was wrong (a moment, then the usual cheer) ---------- */
.zk-pout-brow, .zk-pout-mouth { fill: none; stroke: var(--zk-line); stroke-width: 5; stroke-linecap: round; }
.zakzak.is-sulk .zk-mouth--idle, .zakzak.is-sulk .zk-talk { display: none; }
.zakzak.is-sulk .zk-pout-brow, .zakzak.is-sulk .zk-pout-mouth { display: inline; }
.zakzak.is-sulk .zk-pupil, .zakzak.is-sulk .zk-shine { animation: none; transform: translate(0, 5px); }
.zakzak.is-sulk .zk-body { animation: zk-pout .45s ease-out; }
@keyframes zk-pout {
  0% { transform: scale(1, 1); }
  40%, 100% { transform: scale(1.04, .93); }
}

/* ---------- The food tray ---------- */
.modal.zk-tray { background: rgba(40, 34, 70, .14); align-items: flex-start; padding-top: max(14vh, 96px); }
.zk-plate {
  display: flex;
  gap: 4vmin;
  padding: 3.5vmin 4.5vmin;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 35%, #fff, #f1ebff 75%);
  border: 4px solid #fff;
  box-shadow: 0 7px 0 #d7cdf7, 0 12px 26px rgba(60, 40, 120, .2);
  animation: zk-plate-in .45s cubic-bezier(.3, 1.5, .5, 1);
}
@keyframes zk-plate-in {
  0% { transform: translateY(-30px) scale(.6); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.zk-food {
  position: relative;
  width: min(23vmin, 140px);
  height: min(23vmin, 140px);
  padding: min(3.5vmin, 20px);
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 5px 0 #e2dafb, inset 0 -4px 0 rgba(80, 60, 160, .06);
  cursor: pointer;
  transition: scale .1s;
}
.zk-food img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.zk-food.is-press { scale: .92; }
.zk-food.is-no { animation: opt-wiggle .4s ease-in-out; }
.zk-food.is-no::after {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #ef5b6b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7l10 10M17 7L7 17' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") center / 64% no-repeat;
  box-shadow: 0 3px 0 rgba(130, 30, 45, .35);
}
.zk-food.is-hint { box-shadow: 0 0 0 8px #ffd84d, 0 0 26px 6px rgba(255, 216, 77, .7); animation: opt-hint 1.1s ease-in-out 3; }
.zk-bite { position: fixed; z-index: 30; pointer-events: none; object-fit: contain; }
.zk-tray-me { position: fixed; padding: 0; border: 0; background: none; cursor: pointer; }
/* His thought: the food he wants, in a cloud over his head (two small puffs lead down to him) */
.zk-think {
  position: fixed;
  left: 0;
  top: 0;
  width: min(30vmin, 130px);
  height: min(24vmin, 104px);
  padding: min(4vmin, 18px) 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 0 #e2dafb, 0 10px 22px rgba(60, 40, 120, .18);
  pointer-events: none;
  animation: zk-think-in .5s cubic-bezier(.3, 1.5, .5, 1) both, zk-think-float 2.6s ease-in-out .5s infinite;
}
.zk-think img { display: block; width: 100%; height: 100%; object-fit: contain; }
.zk-think i {
  position: absolute;
  left: 8%;
  bottom: -14%;
  width: 20%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 0 #e2dafb;
}
.zk-think i + i { left: 0; bottom: -34%; width: 11%; }
.zk-think.is-bob { animation: zk-think-bob .5s ease-in-out, zk-think-float 2.6s ease-in-out .5s infinite; }
@keyframes zk-think-in {
  0% { transform: scale(.2); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes zk-think-float {
  0%, 100% { transform: none; }
  50% { transform: translateY(-5px); }
}
@keyframes zk-think-bob {
  0%, 100% { transform: none; }
  35% { transform: scale(1.15) rotate(-4deg); }
  70% { transform: scale(.96) rotate(3deg); }
}
.zakzak.is-growl .zk-body { animation: zk-growl .55s ease-in-out; transform-box: view-box; transform-origin: 100px 200px; }
@keyframes zk-growl {
  0%, 100% { transform: none; }
  20% { transform: scale(1.06, .95); }
  45% { transform: scale(.96, 1.04); }
  70% { transform: scale(1.03, .98); }
}

@media (orientation: landscape) {
  .modal.zk-tray { align-items: center; justify-content: flex-end; padding: 0 max(6vw, 24px) 0 0; }
  .zk-plate { flex-direction: column; border-radius: 48px; padding: 3.5vmin; }
  .zk-food { width: min(23vh, 130px); height: min(23vh, 130px); }
}

@media (prefers-reduced-motion: reduce) {
  .zk-balloon, .zk-zzz i, .zakzak.is-asleep .zk-body, .zakzak.is-asleep .zk-sleep-mouth,
  .zakzak.is-hungry .zk-body, .zakzak.is-hungry .zk-yum-tongue { animation: none !important; }
  .zk-think, .zk-think.is-bob, .zakzak.is-growl .zk-body { animation: none !important; }
  .zk-zzz i { opacity: 1; }
  .zk-zzz i:nth-child(2) { transform: translate(40%, -80%); }
  .zk-zzz i:nth-child(3) { transform: translate(80%, -160%); }
}

/* ---------- Pokes: a tap on him in the house (js/character.js POKES) ----------
   Motion lives on .zk-body (never on the svg, which js/zakzak.js listens to). */
.zk-raz { fill: #ff8fb6; stroke: var(--zk-line); stroke-width: 3.5; stroke-linejoin: round; transform-box: fill-box; transform-origin: 50% 0; }
.zk-raz-line { fill: none; stroke: #d65f8a; stroke-width: 2.5; stroke-linecap: round; }
.zk-puff circle { fill: #fff; stroke: #c9d6ee; stroke-width: 2; }
.zk-paw { fill: #ab97fa; stroke: var(--zk-line); stroke-width: 4; }
.zk-hearts path { fill: #ff6b8a; stroke: #fff; stroke-width: 2; }
.zk-stars path { fill: #ffd84d; stroke: #e0a800; stroke-width: 1.5; stroke-linejoin: round; }
.zk-hearts, .zk-stars, .zk-puff { transform-box: view-box; }

/* a voice line during a poke: the talking mouth wins */
.zakzak.is-talking[class*=" pk-"] .zk-mouth--right,
.zakzak.is-talking[class*=" pk-"] .zk-mouth--wrong,
.zakzak.is-talking[class*=" pk-"] .zk-raz { display: none; }

/* tickle: happy squeezed eyes, big smile, a fast wriggle */
.zakzak.pk-tickle .zk-eye, .zakzak.pk-tickle .zk-mouth--idle { display: none; }
.zakzak.pk-tickle .zk-happy-eye, .zakzak.pk-tickle .zk-mouth--right { display: inline; }
.zakzak.pk-tickle .zk-body { animation: pk-wriggle .13s linear 10; }
.zakzak.pk-tickle .zk-arm { animation: zk-arm-up 1.3s ease-out; }
@keyframes pk-wriggle {
  0%, 100% { transform: rotate(0) scale(1, 1); }
  25% { transform: rotate(-5deg) scale(1.03, .97); }
  75% { transform: rotate(5deg) scale(.97, 1.03); }
}

/* sneeze: eyes shut, head goes back... then forward with a puff */
.zakzak.pk-sneeze .zk-eye, .zakzak.pk-sneeze .zk-mouth--idle { display: none; }
.zakzak.pk-sneeze .zk-sleep-eye, .zakzak.pk-sneeze .zk-mouth--wrong, .zakzak.pk-sneeze .zk-puff { display: inline; }
.zakzak.pk-sneeze .zk-body { animation: pk-sneeze 1.4s ease-in-out; }
.zakzak.pk-sneeze .zk-puff { opacity: 0; animation: pk-puff 1.4s ease-out; }
@keyframes pk-sneeze {
  0% { transform: rotate(0) scale(1, 1); }
  45% { transform: rotate(-9deg) scale(.96, 1.06); }
  55% { transform: rotate(-11deg) scale(.95, 1.08); }
  62% { transform: rotate(8deg) scale(1.08, .9); }
  80% { transform: rotate(-2deg) scale(1, 1); }
  100% { transform: rotate(0) scale(1, 1); }
}
@keyframes pk-puff {
  0%, 58% { opacity: 0; transform: translateY(0) scale(.4); }
  66% { opacity: 1; transform: translateY(6px) scale(1); }
  100% { opacity: 0; transform: translateY(18px) scale(1.4); }
}

/* spin: a full turn on the spot */
.zakzak.pk-spin .zk-body { animation: pk-spin .9s ease-in-out; }
@keyframes pk-spin {
  0% { transform: scaleX(1); }
  25% { transform: scaleX(0) translateY(-6%); }
  50% { transform: scaleX(-1) translateY(-8%); }
  75% { transform: scaleX(0) translateY(-6%); }
  100% { transform: scaleX(1); }
}

/* hiccup: wide eyes, small "o", three little hops */
.zakzak.pk-hiccup .zk-mouth--idle { display: none; }
.zakzak.pk-hiccup .zk-mouth--wrong { display: inline; }
.zakzak.pk-hiccup .zk-eye { animation: none; transform: scale(1.12); }
.zakzak.pk-hiccup .zk-body { animation: pk-hic .42s ease-out 3; }
@keyframes pk-hic {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  20% { transform: translateY(-9%) scale(.96, 1.05); }
  45% { transform: translateY(0) scale(1.04, .96); }
}

/* jump: a big happy jump */
.zakzak.pk-jump .zk-eye, .zakzak.pk-jump .zk-mouth--idle { display: none; }
.zakzak.pk-jump .zk-happy-eye, .zakzak.pk-jump .zk-mouth--right { display: inline; }
.zakzak.pk-jump .zk-body { animation: pk-jump .9s ease-out; }
.zakzak.pk-jump .zk-arm { animation: zk-arm-up .9s ease-out; }
@keyframes pk-jump {
  0% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(0) scale(1.1, .88); }
  45% { transform: translateY(-30%) scale(.94, 1.08); }
  80% { transform: translateY(0) scale(1.08, .92); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* dizzy: eyes go round and round, stars circle his head, he wobbles */
.zakzak.pk-dizzy .zk-stars { display: inline; transform-origin: 100px 30px; animation: pk-orbit 1s linear infinite; }
.zakzak.pk-dizzy .zk-pupil, .zakzak.pk-dizzy .zk-shine { animation: pk-roll .45s linear infinite; }
.zakzak.pk-dizzy .zk-mouth--idle { display: none; }
.zakzak.pk-dizzy .zk-sour-mouth { display: inline; }
.zakzak.pk-dizzy .zk-body { animation: pk-wobble .6s ease-in-out 3; }
@keyframes pk-orbit { to { transform: rotate(360deg); } }
@keyframes pk-roll {
  0%, 100% { transform: translate(5px, 0); }
  25% { transform: translate(0, 5px); }
  50% { transform: translate(-5px, 0); }
  75% { transform: translate(0, -5px); }
}
@keyframes pk-wobble {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-8deg); }
  70% { transform: rotate(8deg); }
}

/* peek-a-boo: hands over the eyes... boo! */
.zakzak.pk-boo .zk-paw { display: inline; transform-box: fill-box; transform-origin: center; animation: pk-paw-l 1.7s ease-in-out; }
.zakzak.pk-boo .zk-paw--r { animation-name: pk-paw-r; }
.zakzak.pk-boo .zk-arm { opacity: 0; transition: opacity .1s; }
.zakzak.pk-boo .zk-mouth--idle { display: none; }
.zakzak.pk-boo .zk-mouth--right { display: inline; }
.zakzak.pk-boo .zk-eye { animation: pk-boo-eye 1.7s ease-out; }
.zakzak.pk-boo .zk-body { animation: pk-boo 1.7s ease-out; }
@keyframes pk-paw-l {
  0% { transform: translate(-48px, 46px) scale(.7); opacity: 1; }
  18%, 48% { transform: translate(0, 0) scale(1); opacity: 1; }
  60% { transform: translate(-56px, -10px) scale(.95); opacity: 1; }
  100% { transform: translate(-48px, 46px) scale(.7); opacity: 0; }
}
@keyframes pk-paw-r {
  0% { transform: translate(48px, 46px) scale(.7); opacity: 1; }
  18%, 48% { transform: translate(0, 0) scale(1); opacity: 1; }
  60% { transform: translate(56px, -10px) scale(.95); opacity: 1; }
  100% { transform: translate(48px, 46px) scale(.7); opacity: 0; }
}
@keyframes pk-boo-eye {
  0%, 50% { transform: scale(1); }
  58% { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@keyframes pk-boo {
  0%, 48% { transform: scale(.96, 1.02); }
  56% { transform: translateY(-10%) scale(1.08, .95); }
  75% { transform: translateY(0) scale(1, 1); }
  100% { transform: scale(1, 1); }
}

/* shy: rosy cheeks, eyes down, a little sway */
.zakzak.pk-shy .zk-cheek { transform-box: fill-box; transform-origin: center; transform: scale(1.8, 1.5); opacity: 1; }
.zakzak.pk-shy .zk-pupil, .zakzak.pk-shy .zk-shine { animation: none; transform: translate(-2px, 6px); }
.zakzak.pk-shy .zk-body { animation: pk-sway 1.5s ease-in-out; }
@keyframes pk-sway {
  0%, 100% { transform: rotate(0); }
  30% { transform: rotate(-6deg); }
  65% { transform: rotate(4deg); }
}

/* dance: left, right, arms up */
.zakzak.pk-dance .zk-eye, .zakzak.pk-dance .zk-mouth--idle { display: none; }
.zakzak.pk-dance .zk-happy-eye, .zakzak.pk-dance .zk-mouth--right { display: inline; }
.zakzak.pk-dance .zk-body { animation: pk-dance .48s ease-in-out 4; }
.zakzak.pk-dance .zk-arm { animation: zk-arm-up .95s ease-in-out 2; }
@keyframes pk-dance {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-5%) rotate(-8deg) scale(1, .96); }
  75% { transform: translateX(5%) rotate(8deg) scale(1, .96); }
}

/* squish: jelly */
.zakzak.pk-squish .zk-body { animation: pk-squish .7s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pk-squish {
  0% { transform: scale(1, 1); }
  20% { transform: scale(1.22, .74); }
  45% { transform: scale(.9, 1.12); }
  70% { transform: scale(1.05, .96); }
  100% { transform: scale(1, 1); }
}

/* raspberry: tongue out, cheeks puffed, a buzz */
.zakzak.pk-raspberry .zk-mouth--idle { display: none; }
.zakzak.pk-raspberry .zk-raz, .zakzak.pk-raspberry .zk-raz-line { display: inline; }
.zakzak.pk-raspberry .zk-raz { animation: pk-raz .12s linear 9; }
.zakzak.pk-raspberry .zk-cheek { transform-box: fill-box; transform-origin: center; transform: scale(1.6); }
.zakzak.pk-raspberry .zk-eye { animation: none; transform: scaleY(.55); }
@keyframes pk-raz {
  0%, 100% { transform: scaleY(1) rotate(0); }
  50% { transform: scaleY(1.12) rotate(4deg); }
}

/* wave: hello with his right hand */
.zakzak.pk-wave .zk-arm--r { animation: pk-wave 1.5s ease-in-out; }
.zakzak.pk-wave .zk-mouth--idle { display: none; }
.zakzak.pk-wave .zk-mouth--right { display: inline; }
@keyframes pk-wave {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  15%, 85% { transform: translate(6px, -16px) rotate(-110deg); }
  30%, 60% { transform: translate(6px, -16px) rotate(-80deg); }
  45%, 75% { transform: translate(6px, -16px) rotate(-120deg); }
}

/* love: hearts float up */
.zakzak.pk-love .zk-eye, .zakzak.pk-love .zk-mouth--idle { display: none; }
.zakzak.pk-love .zk-happy-eye, .zakzak.pk-love .zk-mouth--right, .zakzak.pk-love .zk-hearts { display: inline; }
.zakzak.pk-love .zk-hearts { animation: pk-hearts 1.6s ease-out; }
.zakzak.pk-love .zk-cheek { transform-box: fill-box; transform-origin: center; transform: scale(1.5); }
@keyframes pk-hearts {
  0% { transform: translateY(30px) scale(.5); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(-24px) scale(1.1); opacity: 0; }
}

/* surprise: big eyes, "o", a hop */
.zakzak.pk-surprise .zk-mouth--idle { display: none; }
.zakzak.pk-surprise .zk-mouth--wrong { display: inline; }
.zakzak.pk-surprise .zk-eye { animation: none; transform: scale(1.22); }
.zakzak.pk-surprise .zk-body { animation: pk-hic .5s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .zakzak[class*=" pk-"] .zk-body, .zakzak[class*=" pk-"] .zk-arm, .zakzak[class*=" pk-"] .zk-stars,
  .zakzak[class*=" pk-"] .zk-pupil, .zakzak[class*=" pk-"] .zk-shine { animation: none !important; }
}
