.territory-map {
  --tm-height: 32em;
  --tm-back: #354c26;
  --tm-marker-color: #e39a1a;
  --tm-marker-size: 16px;
  --tm-marker-border: 1px solid #ffffff;
  --tm-marker-shadow: 2px 2px 5px #00000066;
  --tm-marker-zindex: 1000;
  --tm-controls-zindex: 1100;
  position: relative;
}
.territory-map .viewer {
  background: var(--tm-back);
  height: var(--tm-height);
  overflow: hidden;
  pointer-events: auto;
  border-radius: 1em;
}
.territory-map .map-marker {
  width: var(--tm-marker-size);
  height: var(--tm-marker-size);
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease-out;
  background: var(--tm-marker-color);
  border: var(--tm-marker-border);
  box-shadow: var(--tm-marker-shadow);
  z-index: var(--tm-marker-zindex);
  pointer-events: auto;
}
.territory-map .map-marker:hover {
  transform: scale(1.1);
}
.territory-map .controls-wrapper {
  position: absolute;
  bottom: 1em;
  right: 1em;
  z-index: var(--tm-control-zindex);
}
.territory-map .controls {
  display: flex;
  align-items: center;
  position: relative;
  padding: 0.5em;
  border-radius: 1em;
  transform: rotate(90deg);
  transform-origin: 213px 19px;
  background: #ffffff14;
  gap: 0.5em;
}
.territory-map .zoom-btn {
  width: 1.5em;
  height: 1.5em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1em;
  background: #ffffff00;
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.2em;
  font-weight: 200;
  cursor: pointer;
  transform: rotate(-90deg);
  user-select: none;
  transition: all 0.5s;
}
.territory-map .zoom-btn:hover {
  background: #ffffff33;
}
.territory-map .zoom-slider {
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}
.territory-map .zoom-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
}
.territory-map .zoom-slider::-moz-range-track {
  width: 100%;
  height: 4px;
  background: #ccc;
  border-radius: 2px;
}
.territory-map .zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}
.territory-map .zoom-slider::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.4);
}
.territory-map .map-popup {
  pointer-events: auto !important;
  user-select: text !important;
  position: absolute;
  width: 250px;
  border-radius: 8px;
  box-shadow: 0 2px 14px #141414a8;
  padding: 0;
  z-index: 1000;
  left: 50%;
  bottom: calc(100% + 15px);
  transform: translateX(-50%);
  background: #8d8d8d73;
  backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid #708367;
}
.territory-map .map-popup.hidden {
  display: none;
}
.territory-map .popup-header,
.territory-map .popup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4em;
  color: currentColor;
}
.territory-map .popup-content {
  pointer-events: auto !important;
  user-select: text !important;
  padding: 0.4em;
  font-size: 0.9em;
  color: #dfdfdf;
}
.territory-map .popup-content p {
  margin: 0;
}
.territory-map .popup-title {
  font-weight: 600;
  font-size: 1em;
}
.territory-map .popup-close-btn {
  background: none;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: currentColor;
}
.territory-map .popup-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  width: 100%;
  border-radius: 1em;
  padding: 7px;
  text-align: center;
  font-size: 0.8em;
  cursor: pointer;
  line-height: 1;
  background: #0a0a0a66;
  color: #b5b5b5;
  transition: all 0.5s;
}
.territory-map .popup-btn:hover {
  background: #0a0a0ab0;
  color: #fff;
}
.territory-map .popup-arrow {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #d1d3cf;
}
@media only screen and (min-width: 0) and (max-width: 767px) {
  .territory-map .map-popup {
    font-size: 1.1em;
  }
  .territory-map .controls-wrapper {
    z-index: 5000;
  }
  .territory-map .controls {
    transform: rotate(90deg);
    background: #1f310bd4;
    transform-origin: 53px 23px;
    font-size: 1.3em;
  }
  .territory-map .controls .zoom-slider {
    display: none;
  }
  .territory-map .controls .zoom-home {
    display: none;
  }
}
