/* Easter eggs: a toast, and emoji reactions rising up the screen as in a video call. */

.eggs {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.eggs .toast {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  padding: 12px 20px;
  border-radius: 12px;
  background: rgb(20 20 19 / 85%);
  color: #fff; /* always on the dark toast, whatever the page's theme */
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
  animation: toast 2.8s ease-out forwards;
}

/* Emoji reactions rising up the whole screen, as in a video call. Each one pops
   in, rises while its inner span sways from side to side, and fades out near
   the top. */
.reactions {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

.reaction {
  position: absolute;
  bottom: -1.2em;
  line-height: 1;
  animation: float-up var(--duration) cubic-bezier(0.25, 0.6, 0.45, 1) var(--delay) both;
}

.reaction span {
  display: inline-block;
  animation: sway var(--sway-duration) ease-in-out var(--delay) infinite alternate;
}

@keyframes float-up {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.3);
  }
  8% {
    opacity: 1;
    transform: translateY(-6vh) scale(1);
  }
  70% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(calc(-100vh - 1.2em)) scale(1);
  }
}

@keyframes sway {
  from {
    transform: translateX(calc(-1 * var(--sway))) rotate(-10deg);
  }
  to {
    transform: translateX(var(--sway)) rotate(10deg);
  }
}

@keyframes toast {
  0% {
    opacity: 0;
    transform: translate(-50%, 12px);
  }
  12%,
  80% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  /* No flying emojis; the toast still says what happened. */
  .reactions {
    display: none;
  }
}
