/* The mallet, character, and burrow share one 160 × 160 SVG coordinate space.
   Crown and mallet underside meet at (80, 48). During squash both follow the
   same 14px displacement. Avoid independent icon positioning on keyboard keys. */
.scene-actor.mole-actor {
  width: 218px;
  height: 213px;
  bottom: 29px;
  z-index: 2;
  transition: left 360ms ease-in-out;
}
.adventure-trail { position: absolute; left: 120px; right: 120px; bottom: 61px; height: 12px; border-radius: 50%; background: #c4ae8055; box-shadow: 0 3px 0 #7c885820; }
.adventure-trail-fill { height: 100%; border-radius: inherit; background: #eac572; transition: width 260ms ease; }
.adventure-step { position: absolute; top: 4px; width: 4px; height: 4px; border-radius: 50%; background: #a3947188; }
.adventure-step.done { background: #fff9dd; }
.adventure-start { position: absolute; left: -10px; top: 17px; color: #82916a; font-size: 9px; }
.adventure-finish { position: absolute; right: -14px; bottom: 3px; color: #b97d46; font-size: 45px; line-height: 1; }
.adventure-finish small { position: absolute; white-space: nowrap; font-size: 9px; bottom: -23px; left: -18px; }
.adventure-complete .adventure-finish { color: #758c4e; }
.play-stage.mole .stage-top { z-index: 3; }
.stage-mole { position: absolute; width: 218px; height: 218px; bottom: 0; left: 0; }
.mole-actor .letter-bubble { top: -2px; z-index: 1; }
.letter-bubble.reacting { opacity: 0; }
.mole-rig { display: block; width: 100%; height: 100%; overflow: visible; }
.mole-rig .mole-body {
  transform-box: view-box;
  transform-origin: 80px 137px;
  transition: transform 140ms ease-out;
}
.mole-rig .mole-hammer {
  transform-box: view-box;
  transform-origin: 132px 78px;
  opacity: 0;
  transform: translate(16px, -58px) rotate(12deg);
  transition: transform 140ms ease-out, opacity 100ms;
}
.mole-face-hit, .mole-face-miss,
.mole-impact, .mole-exclamation-hit, .mole-exclamation-miss { display: none; }
.mole-rig[data-phase="windup"] .mole-hammer {
  opacity: 1;
  animation: mole-swing 170ms cubic-bezier(.5, 0, 1, .75) both;
}
.mole-rig[data-phase="contact"] .mole-hammer { opacity: 1; transform: translateY(14px); }
.mole-rig[data-outcome="hit"][data-phase="contact"] .mole-body {
  /* (137 - 48) × (1 - .84) = 14.24: mallet follows the compressed crown. */
  transform: scale(1.06, .84);
}
.mole-rig[data-outcome="hit"][data-phase="contact"] .mole-face-idle,
.mole-rig[data-outcome="hit"][data-phase="recover"] .mole-face-idle,
.mole-rig[data-outcome="miss"][data-phase="recover"] .mole-face-idle { display: none; }
.mole-rig[data-outcome="hit"][data-phase="contact"] .mole-face-hit,
.mole-rig[data-outcome="hit"][data-phase="recover"] .mole-face-hit,
.mole-rig[data-outcome="miss"][data-phase="recover"] .mole-face-miss { display: inline; }
.mole-rig[data-outcome="hit"][data-phase="contact"] .mole-impact {
  display: inline;
  transform: translateY(14px);
  animation: mole-spark 400ms ease-out both;
}
.mole-rig[data-outcome="hit"][data-phase="contact"] .mole-exclamation-hit,
.mole-rig[data-outcome="miss"][data-phase="recover"] .mole-exclamation-miss {
  display: inline;
  animation: mole-caption 180ms ease-out both;
}
.mole-rig[data-outcome="hit"][data-phase="recover"] .mole-body {
  transform: translateY(92px);
  transition-duration: 280ms;
}
.mole-rig[data-outcome="miss"][data-phase="windup"] .mole-body,
.mole-rig[data-outcome="miss"][data-phase="contact"] .mole-body {
  /* Duck below the foreground rim before the hammer arrives. */
  transform: translateY(94px);
  transition-duration: 110ms;
}
.mole-rig[data-outcome="miss"][data-phase="contact"] .mole-hammer { transform: translateY(64px) rotate(-7deg); }
.mole-rig[data-outcome="miss"][data-phase="recover"] .mole-body {
  transform: translateY(22px) rotate(-7deg);
  transition-duration: 120ms;
}
.mole-rig[data-phase="emerge"] .mole-body { animation: mole-emerge 250ms cubic-bezier(.2,.8,.3,1) both; }
.mole-rig[data-phase="finished"] .mole-body { transform: translateY(94px); }
.keyboard.is-mole { position: relative; isolation: isolate; }
.keyboard-mole {
  position: absolute;
  z-index: 8;
  pointer-events: none;
  transform-origin: center bottom;
}
.keyboard-mole[hidden] { display: none; }
.keyboard-mole .mole-exclamation-hit,
.keyboard-mole .mole-exclamation-miss { display: none !important; }
.keyboard.is-mole .key { height: 38px; }
.keyboard.is-mole .key.space-key { height: 33px; }
.keyboard.is-mole .key.mole-home .key-label { transform: translateY(8px); }
.keyboard.is-mole .key.mole-home .home-bump { opacity: .25; }
.keyboard.is-mole .key.wrong { animation: none; }
.keyboard.is-mole .key.struck { box-shadow: 0 2px 0 #91a976; }
.keyboard.is-mole .key.struck:not(.target) { background: #edf1e4 !important; }
@keyframes mole-swing {
  from { transform: translate(16px, -58px) rotate(12deg); }
  to { transform: translate(0, 0) rotate(0); }
}
@keyframes mole-emerge { from { transform: translateY(94px); } to { transform: translateY(0); } }
@keyframes mole-spark { from { opacity: 1; } 70% { opacity: 1; } to { opacity: 0; } }
@keyframes mole-caption { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 1600px) {
  .scene-actor.mole-actor { width: 240px; height: 232px; bottom: 27px; }
  .stage-mole { width: 240px; height: 240px; }
  .keyboard.is-mole .key { height: 42px; }
  .keyboard.is-mole .key.space-key { height: 36px; }
}
@media (max-width: 760px) {
  .scene-actor.mole-actor { width: 195px; height: 185px; bottom: 25px; }
  .stage-mole { width: 195px; height: 195px; }
  .keyboard.is-mole .key { height: 32px; }
  .keyboard.is-mole .key.space-key { height: 29px; }
  .keyboard.is-mole .key.mole-home .key-label { transform: translateY(7px); }
}
@media (prefers-reduced-motion: reduce) {
  .mole-rig *, .keyboard-mole, .scene-actor.mole-actor, .adventure-trail-fill { animation: none !important; transition: none !important; }
  .mole-rig[data-phase="windup"] .mole-hammer { transform: translate(16px, -58px) rotate(12deg); }
  .mole-rig[data-phase="emerge"] .mole-body { transform: none; }
}
