.d-flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5em 1.5em;
  border-radius: 10em;
  border: 1px solid var(--highlight);
  font-weight: bold;
  font-size: 14px;
  gap: 5px;
}

.btn-primary {
  background: var(--highlight);
  color: var(--body-bg);

  &:hover {
    text-decoration: none;
    background: white;
    border-color: white;
  }
}

.btn-secondary {
  background: transparent;
  color: var(--highlight);
  &:hover {
    text-decoration: none;
    background: #ffffff20;
    border-color: white;
  }
}

.btn-link {
  background: transparent;
  border: none;
  color: var(--highlight);
  font-size: inherit;
  &:hover {
    text-decoration: underline;
  }
}

.has-noise::after {
  content: "";
  background: url(./noise.webp) center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  opacity: 0.6;
  pointer-events: none;
}

.has-tooltip {
  position: relative;
  @media (pointer: fine) {
    &:hover .tooltip,
    &:focus-visible .tooltip,
    &:focus-within .tooltip {
      opacity: 1;
      transition: opacity var(--duration-slow) ease var(--duration-slow);
    }
  }
}

.focus-tooltip {
  &:hover .tooltip {
    opacity: 0;
  }

  &:focus-within .tooltip {
    opacity: 1;
    transition: opacity var(--duration-slow) ease var(--duration-slow);
  }
}

.tooltip {
  pointer-events: none;
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: max-content;
  font-weight: bold;
  font-size: 9px;
  line-height: 1;
  height: 17px;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity var(--duration-slow) ease 0s;
  background-color: var(--highlight);
  color: var(--body-bg);
  padding: 2px 5px;
  border-radius: 5px;

  kbd {
    font-family: inherit;
    font-size: 8px;
    border: 1px solid;
    border-radius: 2px;
    padding: 0 2px;
    line-height: 1.4;
  }
}

.tooltip-left {
  left: auto;
  right: -10px;
  transform: none;
}

.btn-icon {
  width: 1em;
  height: 1em;
}

@keyframes labelAnim {
  0% {
    transform: scaleX(0.5) scaleY(0.8);
  }
  100% {
    transform: none;
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0);
  }
  100% {
    transform: rotate(360deg);
  }
}
