/* Pixel-art box that follows the cursor. Positioned by tooltip.js. */
.tooltip {
  position: fixed;
  z-index: 1000;
  width: max-content;
  max-width: calc(var(--site-viewport-width) - 8px);
  padding: 1px 3px 4px;
  font-family: "1980 P03", "Mona", monospace;
  line-height: 7px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #000000;
  filter: drop-shadow(1px 2px 0 rgb(0 0 0 / 0.3));
  isolation: isolate;
  pointer-events: none;
}

.tooltip:empty {
  display: none;
}

/* White box with 1px cut corners. */
.tooltip::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #ffffff;
  clip-path: polygon(0 0, calc(100% - 1px) 0, calc(100% - 1px) 1px, 100% 1px,
    100% calc(100% - 1px), calc(100% - 1px) calc(100% - 1px), calc(100% - 1px) 100%, 1px 100%,
    1px calc(100% - 1px), 0 calc(100% - 1px));
}

/* Arrow on the top-left corner, cropped from the rounded-rect-with-arrow texture. */
.tooltip::after {
  content: "";
  position: absolute;
  top: 0;
  left: -3px;
  z-index: -1;
  width: 6px;
  height: 6px;
  background: url("../assets/textures/round_rect_with_arrow.png") 0 -3px / 16px no-repeat;
}
