.retro-helper {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 999;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  color: #000000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  filter: drop-shadow(3px 3px 0 rgba(0, 0, 0, 0.22));
  animation: helper-arrives 360ms steps(4, end) both;
}

.retro-helper[hidden] {
  display: none;
}

.retro-helper__bubble {
  position: relative;
  flex: 1;
  padding: 10px 11px 9px;
  border: 3px outset #eeeeee;
  background: #ffffcc;
}

.retro-helper__bubble::after {
  position: absolute;
  right: -13px;
  bottom: 15px;
  width: 14px;
  height: 14px;
  border-top: 2px solid #666666;
  border-right: 2px solid #666666;
  background: #ffffcc;
  content: "";
  transform: rotate(45deg);
}

.retro-helper__title {
  margin: 0 24px 5px 0;
  color: #000080;
  font-family: "Courier New", Courier, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.retro-helper__message {
  margin: 0 0 9px;
}

.retro-helper__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.retro-helper button {
  min-height: 27px;
  padding: 3px 9px;
  border: 2px outset #eeeeee;
  border-radius: 0;
  background: #d4d0c8;
  color: #000000;
  font: 700 11px Arial, Helvetica, sans-serif;
}

.retro-helper button:active {
  border-style: inset;
}

.retro-helper button:focus-visible {
  outline: 2px dotted #000000;
  outline-offset: 2px;
}

.retro-helper__close {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 1;
  width: 21px;
  min-height: 21px !important;
  padding: 0 !important;
  line-height: 16px !important;
}

.retro-helper__mascot {
  display: grid;
  flex: 0 0 82px;
  width: 82px;
  height: 58px;
  place-items: end center;
  transform-origin: 50% 100%;
  animation: helper-bobs 2.8s steps(2, end) infinite;
}

.retro-helper__mascot img {
  display: block;
  width: 84px;
  max-width: none;
  height: auto;
  filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.22));
  image-rendering: pixelated;
  user-select: none;
}

@keyframes helper-arrives {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes helper-bobs {
  0%, 100% {
    transform: rotate(-2deg) translateY(0);
  }
  50% {
    transform: rotate(2deg) translateY(-4px);
  }
}

@media (max-width: 600px) {
  .retro-helper {
    right: 7px;
    bottom: 7px;
    width: min(315px, calc(100vw - 14px));
  }

  .retro-helper__mascot {
    flex-basis: 68px;
    width: 68px;
    height: 50px;
  }

  .retro-helper__mascot img {
    width: 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .retro-helper,
  .retro-helper__mascot {
    animation: none;
  }
}
