/* The same paper mascot as the puzzle board, on a lily-pad stage. */
.pip-dance {
  --pip-dance-tempo: 1.65s;
  position: relative;
  isolation: isolate;
  width: 158px;
  max-width: 100%;
  height: 145px;
  pointer-events: none;
}

.pip-dance::before,
.pip-dance::after {
  content: "";
  position: absolute;
  left: 50%;
}

.pip-dance::before {
  width: 86%;
  height: 24px;
  bottom: 10px;
  border-radius: 54% 43% 55% 46%;
  background: linear-gradient(165deg, #80bb8c 0 53%, #6aaa81 54% 100%);
  box-shadow: inset 0 2px 0 #acda9e, 0 3px 0 #4e8870, 1px 6px 4px #284a3c25;
  transform: translateX(-50%) rotate(-4deg);
}

.pip-dance::after {
  width: 51%;
  height: 10px;
  bottom: 20px;
  border-radius: 50%;
  background: #31534835;
  transform: translateX(-50%);
}

.pip-dance .mascot {
  position: absolute;
  left: 50%;
  top: 50%;
  margin: -88px 0 0 -85px;
  width: 170px;
  height: 176px;
  scale: .47;
  transform: rotate(-5deg);
  animation: none;
  background: linear-gradient(135deg, #d6ee91, #bddf81 70%);
  box-shadow: inset 5px 4px 0 #e7f6af, inset -9px -8px 0 #95bc71, 3px 3px 0 #749a68;
}

.pip-dance .mascot-top {
  transform-origin: 5% 95%;
  background: linear-gradient(55deg, #639758 49%, #9aca63 50%);
}
.pip-dance .arm {
  top: 77px;
  transform-origin: 50% 13%;
  background: #a4c980;
  box-shadow: inset -3px -3px 0 #87b07b;
}
.pip-dance .arm-left { left: -7px; transform: rotate(39deg); }
.pip-dance .arm-right { right: -7px; transform: rotate(-45deg); }
.pip-dance .foot { transform-origin: 50% 10%; }
.pip-dance.is-celebrating .arm-left { transform: rotate(124deg); }
.pip-dance.is-celebrating .arm-right { transform: rotate(-118deg); }
.pip-dance.is-celebrating .smile { transform: scale(1.09); }

@media (prefers-reduced-motion: no-preference) {
  .pip-dance.is-celebrating .mascot,
  .pip-dance.is-celebrating .arm,
  .pip-dance.is-celebrating .foot,
  .pip-dance.is-celebrating .mascot-top,
  .pip-dance.is-celebrating::after {
    animation-duration: var(--pip-dance-tempo);
    animation-timing-function: ease-in-out;
    animation-iteration-count: 2;
  }

  .pip-dance.is-celebrating .mascot { animation-name: pip-two-step; }
  .pip-dance.is-celebrating .arm-left { animation-name: pip-left-swing; }
  .pip-dance.is-celebrating .arm-right { animation-name: pip-right-swing; }
  .pip-dance.is-celebrating .foot-left { animation-name: pip-left-step; }
  .pip-dance.is-celebrating .foot-right { animation-name: pip-right-step; }
  .pip-dance.is-celebrating .mascot-top { animation-name: pip-leaf-sway; }
  .pip-dance.is-celebrating::after { animation-name: pip-step-shadow; }
}

@keyframes pip-two-step {
  0%, 100% { transform: rotate(-5deg); }
  18% { transform: translate(-13px,-8px) rotate(-11deg); }
  31% { transform: translate(-14px,2px) rotate(-7deg); }
  49% { transform: translate(0,-1px) rotate(2deg); }
  66% { transform: translate(14px,-8px) rotate(10deg); }
  77% { transform: translate(12px,2px) rotate(6deg); }
  90% { transform: translate(2px,-20px) rotate(-2deg); }
}
@keyframes pip-left-step {
  0%, 38%, 100% { transform: rotate(8deg); }
  15% { transform: translate(-9px,-3px) rotate(30deg); }
  64% { transform: translate(-7px,-13px) rotate(37deg); }
  89% { transform: translate(-3px,-5px) rotate(18deg); }
}
@keyframes pip-right-step {
  0%, 45%, 100% { transform: rotate(-10deg); }
  18% { transform: translate(6px,-14px) rotate(-32deg); }
  65% { transform: translate(9px,-3px) rotate(-27deg); }
  89% { transform: translate(3px,-5px) rotate(-19deg); }
}
@keyframes pip-left-swing {
  0%, 100% { transform: rotate(124deg); }
  22% { transform: rotate(62deg); }
  64% { transform: rotate(127deg); }
  78% { transform: rotate(85deg); }
}
@keyframes pip-right-swing {
  0%, 100% { transform: rotate(-118deg); }
  22% { transform: rotate(-132deg); }
  64% { transform: rotate(-61deg); }
  78% { transform: rotate(-84deg); }
}
@keyframes pip-leaf-sway {
  0%, 100% { transform: rotate(35deg); }
  24% { transform: rotate(50deg); }
  68% { transform: rotate(17deg); }
  92% { transform: rotate(40deg); }
}
@keyframes pip-step-shadow {
  0%, 100% { transform: translateX(-50%); }
  21% { transform: translateX(-56%) scaleX(.92); }
  66% { transform: translateX(-44%) scaleX(.92); }
  90% { transform: translateX(-49%) scaleX(.77); }
}
