.osOverlayHighlight {
  background-color: rgba(56, 162, 204, 0.401);
  border: rgba(255, 0, 0, 0.1) dashed 1px;
  position: relative; /* Ensure positioning context for the span */
  overflow: hidden;
}

.osOverlayHighlight:hover {
  border: red dashed 2px;
  display: block;
}

.osOverlayHighlight span {
  display: none; /* Initially hide the span text */
}

.osOverlayHighlight:hover span {
  display: inline;
}

.osOverlayText {
  display: none;
  font-size: 1vw;
  line-height: 1.5em;
}
.osOverlayText:hover {
  display: block;
}

.overlay.biomes {
  background: rgba(0, 0, 0, 0.1);
  border: 0.15em solid;
  border-radius: 0.5em;

  & > span {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    & > span {
      text-align: center;
      font-weight: bold;
      font-size: 1.3em;
      text-shadow: 0 0 0.5em #000;
    }
  }
}

div:has(> div > .osOverlayPOI) {
  position: relative;
  transform: translate(-50%, -50%);
  --border-color: #47546b;
  pointer-events: auto;
  z-index: 10;
}

.osOverlayPOI {
  overflow: hidden;
  background-color: transparent;
  border: none;
  border-radius: 0.25em;
  line-height: 0;

  & > img {
    --size: 30px;
    min-width: var(--size);
    min-height: var(--size);
  }
}

.osOverlayPopup {
  position: absolute;
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, -5px) scale(0.9);
  padding: 0.5em;
  border: 2px solid var(--border-color);
  border-radius: 0.25em;
  background-color: #222933;
  left: 50%;
  bottom: 100%;
  min-width: 10em;
  transition: 0.1s ease-out;
  box-shadow: 0 0 0.5em rgba(0, 0, 0, 0.5);
}

.osOverlayPopup::before {
  content: '';
  position: absolute;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid var(--border-color);
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
}

div:has(> .osOverlayPOI):hover .osOverlayPopup {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, -5px) scale(1);
}

.osOverlayPopup h2 {
  font-size: 1.5em;
  text-wrap: nowrap;
}

.osOverlayPopup h3 {
  font-size: 1em;
  color: #ccc;
}

.osOverlayPopup p {
  font-size: 0.9em;
  color: #ccc;
}

.osOverlayPopup a {
  color: #ffc107;
}

#osContainer .overlay {
  display: none !important;
  position: relative; /* Ensure z-index works */
}

#osContainer.show-structures .overlay.structures,
#osContainer.show-items .overlay.items,
#osContainer.show-bosses .overlay.bosses,
#osContainer.show-orbAreas .overlay.orbAreas,
#osContainer.show-orbs .overlay.orbs,
#osContainer.show-spatialAwareness .overlay.spatialAwareness,
#osContainer.show-biomeBoundaries .overlay.biomeBoundaries,
#osContainer .overlay.biomes.show {
  display: block !important;
}

/* Ensure POI overlays are always on top */
.overlay.structures,
.overlay.items,
.overlay.bosses,
.overlay.orbs,
.overlay.spatialAwareness {
  z-index: 10 !important;
  pointer-events: auto;
}

/* Biome boundaries should be behind POIs */
.overlay.biomeBoundaries {
  z-index: 1 !important;
}

/* Biome overlays in the middle */
.overlay.biomes {
  z-index: 2 !important;
}

/* Area overlays */
.overlay.orbAreas {
  z-index: 3 !important;
}

img[src$="spatial_awareness_special_spot.png"] {
    transform: scale(0.75);
}