/* Pixel mascot speech bubbles ("Fight On!", "Yeehaw!", ...). */

/* Any image with data-say="..." is a clickable mascot. */
img[data-say] {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img.hop {
  animation: hop .45s steps(3) both;
}

.fo {
  position: fixed;
  z-index: 60;
  pointer-events: none;
  background: #FFFFFF;
  color: #141413;
  border: 2px solid #141413;
  box-shadow: 3px 3px 0 #141413;
  padding: 8px 10px 7px;
  font: 400 11px/1 "Press Start 2P",var(--mono);
  letter-spacing: .02em;
  white-space: nowrap;
  transform-origin: 0 50%;
  animation: foin .3s steps(3) both;
}

.fo::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -7px;
  width: 10px;
  height: 10px;
  background: #FFFFFF;
  border-left: 2px solid #141413;
  border-bottom: 2px solid #141413;
  transform: translateY(-50%) rotate(45deg);
}

.fo.fo-left {
  transform-origin: 100% 50%;
}

.fo.fo-left::before {
  left: auto;
  right: -7px;
  border-left: 0;
  border-bottom: 0;
  border-right: 2px solid #141413;
  border-top: 2px solid #141413;
}

.fo.below {
  transform-origin: 16px 0;
}

.fo.below::before {
  top: -7px;
  left: 14px;
  transform: rotate(135deg);
}

.fo.above {
  transform-origin: var(--tail,50%) 100%;
  white-space: normal;
  max-width: calc(100vw - 16px);
  line-height: 1.5;
}

.fo.above::before {
  top: auto;
  bottom: -7px;
  left: var(--tail,14px);
  transform: rotate(-45deg);
}

.fo.out {
  animation: foout .2s steps(2) both;
}

@media (prefers-reduced-motion: reduce) {
  img.hop,
  .fo,
  .fo.out {
    animation: none;
  }
}

@keyframes hop {
  40% {
    transform: translateY(-7px);
  }
  70% {
    transform: translateY(-2px);
  }
}

@keyframes foin {
  from {
    transform: scale(.4);
    opacity: 0;
  }
}

@keyframes foout {
  to {
    transform: scale(.6);
    opacity: 0;
  }
}
