* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  background: #555555;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

.site-title {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  font-weight: 400;
  white-space: nowrap;
  user-select: none;
  z-index: 10;
}

/*
 * This is the permanent anchor.
 * Its position never changes when a sprite changes.
 */
.mascot {
  position: fixed;
  left: 50%;
  top: 65%;
  width: 160px;
  height: 160px;
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%);
  z-index: 5;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}

/*
 * Fixed viewport for the character.
 * Nothing inside can change its size or position.
 */
.mascot-frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 160px;
  height: 160px;
  overflow: hidden;
}

/*
 * Both sheets occupy exactly the same fixed viewport.
 * The sprite itself is never resized between states.
 */
.mascot-body {
  position: absolute;
  left: 0;
  top: 0;
  width: 160px;
  height: 160px;
  transform-origin: 80px 125px;
}

.mascot-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 160px;
  height: 160px;

  background-repeat: no-repeat;
  background-size: 480px 480px;
  background-origin: border-box;
  background-clip: border-box;

  pointer-events: none;
}

.mascot-directions {
  opacity: 1;
}

.mascot-reactions {
  opacity: 0;
}

@keyframes mascot-boop {
  0%   { transform: scale(1, 1); }
  18%  { transform: scale(1.10, 0.86); }
  45%  { transform: scale(0.95, 1.08); }
  72%  { transform: scale(1.03, 0.97); }
  100% { transform: scale(1, 1); }
}

.mascot-body.booping {
  animation: mascot-boop 420ms linear;
}

@media (prefers-reduced-motion: reduce) {
  .mascot-body.booping {
    animation: none;
  }
}
