body,
html {
  margin: 0px;
  padding: 0px;
  background-color: black;
  overflow: hidden;
}

.navbar.mapNavbar {
  background-color: oklch(12.9% 0.042 264.695) !important;
}

.dropdown-item.active {
  background-color: oklch(37.9% 0.146 265.522) !important;
}
.dropdown-item.active,
.dropdown-item:active {
  background-color: oklch(37.9% 0.146 265.522) !important;
}

.dropdown-item:focus,
.dropdown-item:hover {
  background-color: oklch(37.2% 0.044 257.287) !important;
}

.flex {
  display: flex;
}

.flex-col-reverse {
  flex-direction: column-reverse;
}

.full-viewport-wrapper {
  width: 100vw;
  height: 100vh;
  position: fixed;
}

#osContainer {
  height: 100%;
  width: 100%;
}

.menu img {
  float: left;
  width: 62px;
  height: 60px;
}

:root {
  font-family: system-ui, sans-serif;
}



.coordinate {
  position: absolute;
  pointer-events: none;
  color: white;
  font-family: system-ui, sans-serif;
  font-weight: 400;
}

.coordinate-content {
  position: relative;
  top: 2em;
}

.loadingIndicator {
  margin-bottom: 1vw;
  margin-left: 1vw;
  position: fixed;
  bottom: 0;
}

.spinningIcon::before {
  animation-name: spin;
  animation-duration: 3s;
  animation-iteration-count: infinite;
  animation-timing-function: linear(
    0 0%,
    0.22 2.1%,
    0.86 6.5%,
    1.11 8.6%,
    1.3 10.7%,
    1.35 11.8%,
    1.37 12.9%,
    1.37 13.7%,
    1.36 14.5%,
    1.32 16.2%,
    1.03 21.8%,
    0.94 24%,
    0.89 25.9%,
    0.88 26.85%,
    0.87 27.8%,
    0.87 29.25%,
    0.88 30.7%,
    0.91 32.4%,
    0.98 36.4%,
    1.01 38.3%,
    1.04 40.5%,
    1.05 42.7%,
    1.05 44.1%,
    1.04 45.7%,
    1 53.3%,
    0.99 55.4%,
    0.98 57.5%,
    0.99 60.7%,
    1 68.1%,
    1.01 72.2%,
    1 86.7%,
    1 100%
  );
  /*animation-timing-function: linear;*/
  /* use this if you don't like the above */
}

.loadingIndicator::after {
  content: 'L\00A0 \00A0 \00A0 ADING';
  position: absolute;
  font-size: 0.875rem;
  left: -0.25rem;
  z-index: -100;
  color: transparent;
  text-shadow:
    -1px 0 white,
    0 1px white,
    1px 0 white,
    0 -1px white;
  opacity: 0.4;
}

@-ms-keyframes spin {
  from {
    -ms-transform: rotate(0deg);
  }

  to {
    -ms-transform: rotate(360deg);
  }
}

@-moz-keyframes spin {
  from {
    -moz-transform: rotate(0deg);
  }

  to {
    -moz-transform: rotate(360deg);
  }
}

@-webkit-keyframes spin {
  from {
    -webkit-transform: rotate(0deg);
  }

  to {
    -webkit-transform: rotate(360deg);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

body.toggle-hidden div.osOverlayHighlight {
  display: none !important;
}

.icon-button.btn {
  display: flex;
  flex-direction: row;
  gap: 4px;
  flex-wrap: nowrap;
  align-items: center;
}

.icon-runfast {
  background-image: url(../assets/runfast-logo.svg);
  background-size: cover;
  display: inline-block;
  height: 10px;
  width: 50px;
  margin-top: 3%;
  vertical-align: center;
}

.pixelated-image {
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.icp-record {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: #aaaaaa;
  z-index: 1100;
  padding: 4px 0;
}
.icp-record a {
  color: #aaaaaa;
  text-decoration: none;
}
.icp-record a:hover {
  text-decoration: underline;
  color: #dddddd;
}

.icon-structures {
  background-image: url(../assets/icons/overlay-toggles/icon-structures.svg);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.icon-orbs {
  background-image: url(../assets/icons/overlay-toggles/icon-orbs.webp);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.icon-items {
  background-image: url(../assets/icons/overlay-toggles/icon-items.webp);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.icon-bosses {
  background-image: url(../assets/icons/overlay-toggles/icon-bosses.webp);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

.icon-spatialAwareness {
  background-image: url(../assets/icons/overlay-toggles/icon-spatial-awareness.webp);
  background-size: cover;
  display: inline-block;
  height: 16px;
  width: 16px;
}

#searchResults {
  position: absolute;
  top: 100%;
  max-width: 100%;
  background: #000a;
  height: 0;
  border: 0px solid #fff;
  border-radius: 0.25em;
  overflow: hidden;
  list-style-type: none;
  padding: 0;
}

#searchInput {
  background-color: #030712;
  border: solid 1px white;
}

#searchInput::placeholder {
  font-style: italic;
}

#search-form:focus-visible + #searchResults:has(> .search-result),
#searchResults:active,
#searchResults:focus-within {
  height: auto;
  border-width: 1px;
}

.search-result {
  padding: 0.5em;
  border-bottom: 1px solid #fff8;
  overflow: hidden;
  text-wrap: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
}

.search-result:hover {
  background: #fff2;
}

.search-result:focus {
  background: #fff2;
}

#osContainer :focus-visible {
  outline: none;
}

#spellList {
  visibility: hidden;
  position: absolute;
  top: 100%;
  background: #000a;
  backdrop-filter: blur(0.25em);
  border: 1px solid #fff8;
  border-radius: 0.25em;
  overflow-y: auto;
  max-height: calc(100vh - 100%);
  padding: 0;
}

#spellSelector:focus + #spellList,
#spellList:focus-within,
#spellList:active {
  visibility: visible;
}

#spellList li {
  list-style-type: none;
  padding: 0.5em;
  border-bottom: 1px solid #fff8;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5em;
}

#spellList li:hover {
  background: #fff2;
}

#spellList li img {
  width: 2em;
}

#spellList li div {
  display: flex;
  flex-direction: column;
}

#spellList li div span:first-child {
  font-weight: bolder;
}

#spellList li div span:not(:first-child) {
  font-size: 0.75em;
}

#spellChanceInfoButton {
  & + div {
    position: absolute;
    top: 100%;
    max-height: calc(100vh - 100%);
    overflow: auto;
    background: #000a;
    border: 1px solid #fff8;
    border-radius: 0.25em;
    padding: 0.5em;
    visibility: hidden;
    backdrop-filter: blur(0.25em);

    & > blockquote {
      font-size: 0.75em;
    }
  }

  &:focus + div {
    visibility: visible;
  }
}

.icon-label-hover .label-text {
  display: none;
}

.icon-label-hover:hover .label-text,
.icon-label-hover:focus .label-text,
.icon-label-hover:focus-visible .label-text {
  display: inline;
}

#unifiedSearchResultsOverlay {
  position: absolute;
  z-index: 9999;
  background: #181a20ee;
  border-radius: 0.25em;
  box-shadow: 0 2px 16px #000a;
  padding: 0;
  margin: 0;
  min-width: 300px;
  max-width: 400px;
  overflow: visible;
}

#unifiedSearchResults {
  list-style-type: none;
  margin: 0;
  padding: 0;
  max-height: 350px;
  overflow-y: auto;
}

.navbar .btn {
  flex-shrink: 0;
}

#map-selector .dropdown-toggle {
  min-width: 180px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#overlay-selector .btn {
  min-height: 31px; /* Match other btn-sm heights */
  padding: 0.25rem 0.5rem; /* Match btn-sm padding */
}

/* Fix inconsistent gaps between menu elements */
.navbar .d-flex > * {
  margin: 0.25rem !important;
}

/* Make search form wider to prevent placeholder clipping and add focus glow padding */
#search-form {
  min-width: 280px;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

#shareButton i {
  margin-top: -1px;
  margin-right: -3px;
}

/* Fix renderer info button to show popover */
#renderer-form .btn:first-child {
  cursor: pointer;
}

/* Make overlay button images grayscale when disabled */
#overlay-selector input:disabled + label i,
#overlay-selector input[disabled] + label i,
#overlay-selector .btn:disabled i,
#overlay-selector .btn[disabled] i,
#overlay-selector .btn.disabled i {
  filter: brightness(0.5) contrast(0.5) saturate(0) !important;
  opacity: 0.6 !important;
}

#unifiedSearchResults .search-result {
  padding: 0.5em;
  border-bottom: 1px solid #fff8;
  overflow: hidden;
  text-wrap: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
  background: none;
}

.btn-custom {
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
}

#unifiedSearchResults .search-result:hover,
#unifiedSearchResults .search-result:focus {
  background: #fff2;
}

#spellModalOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

#spellModalOverlay[style*='display: flex'] {
  display: flex !important;
}

#spellModalContent {
  background: #222933;
  padding: 2em;
  border-radius: 0.5em;
  min-width: 300px;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
  position: relative;
  color: #fff;
  box-shadow: 0 2px 32px #000a;
}

#closeSpellModal {
  position: absolute;
  top: 0.5em;
  right: 0.5em;
  font-size: 1.5em;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  transition: color 0.2s;
}

#closeSpellModal:hover {
  color: #ffc107;
}

#unifiedSearchResultsOverlay {
  min-width: 600px;
  max-width: 800px;
}

/* Multi-line search result styles */
.search-result-content,
.spell-search-content,
.overlay-search-content {
  line-height: 1.3;
}

.search-result-name,
.spell-main-line,
.overlay-main-line {
  font-weight: 500;
  color: #fff;
}

.search-result-english,
.spell-english-line,
.overlay-english-line {
  font-size: 0.85em;
  color: #888;
  font-style: italic;
  margin-top: 2px;
}

.search-result-aliases,
.spell-info-line,
.overlay-aliases-line {
  font-size: 0.85em;
  color: #666;
  margin-top: 2px;
}

.spell-info-line .spell-availability-line {
  margin-left: 1em;
}

/* Override text wrapping for multi-line search results */
#unifiedSearchResults .search-result {
  text-wrap: wrap;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}

.maggot-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

.maggot {
  position: absolute;
}
