body {
  margin: 0;
  padding: 0;
  background: #000000;
  overflow: hidden;
}
ul, li {
  list-style-type: none;
  display: inline-block;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}
#map {
  width: 100%;
  height: 100vh;
  background: black;
}
img.leaflet-tile {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  transform: translateZ(0);
  backface-visibility: hidden;
  vertical-align: top;
}

.leaflet-tile-container {
  line-height: 0;
  font-size: 0;
}
div.leaflet-nameplate-pane div {
  background: rgba(0, 0, 0, 0.5);
  color: #ffffff;
  font-weight: 700;
  padding: 2px 5px 1px;
  margin: 0;
  border-color: rgba(0, 0, 0, 0.75);
}
div.leaflet-nameplate-pane div:before {
  border-color: transparent;
}
div.leaflet-nameplate-pane div img.head {
  vertical-align: middle;
  margin-right: 6px;
}
img.head {
  height: 16px;
}
div.leaflet-nameplate-pane div img.armor,
div.leaflet-nameplate-pane div img.health {
  display: block;
}
div.leaflet-nameplate-pane div,
div.leaflet-marker-pane img {
  transition: all 0.25s;
}
.leaflet-bottom.leaflet-left .link,
.leaflet-bottom.leaflet-left .coordinates {
  display: inline-block;
  float: none;
}
div.leaflet-control-layers.link img {
  width: 34px;
  height: 34px;
  vertical-align: bottom;
  bottom: 0;
  background-image: url("../images/link.png");
  background-size: 20px 20px;
  background-repeat: no-repeat;
  background-position: 50% 50%;
}
div.leaflet-control-layers.coordinates {
  vertical-align: bottom;
  padding: 2px 5px;
  line-height: 14px;
  height: 30px;
}
#sidebar {
  display: flex;
  flex-flow: column;
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 100vh;
  padding-left: 10px;
  z-index: 10000;
  font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
  border-left: 1px solid #000000;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  text-align: right;
  transition: all 0.25s;
}
#sidebar.show {
  width: 200px;
  padding-left: 0;
}
#sidebar fieldset {
  clear: right;
  margin: 30px 0;
  border: none;
  border-top: 1px solid rgba(196, 196, 196, 0.4);
  text-align: left;
  transition: all 0.25s;
  white-space: nowrap;
}
#sidebar fieldset#worlds {
  margin: -15px 0 0;
}
#sidebar fieldset#players {
  margin: 10px 0 0;
  overflow-y: auto;
}
#sidebar fieldset#players::-webkit-scrollbar {
  width: 6px;
}
#sidebar fieldset#players::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 0;
}
#sidebar fieldset#players::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0);
  border-right: 2px solid rgba(112, 128, 144, 0.75);
  border-radius: 1px;
}
#sidebar fieldset#players::-webkit-scrollbar-thumb:hover {
  border-radius: 3px;
  border: 0;
  background-color: rgba(112, 128, 144, 0.75);
}
#sidebar legend {
  display: block;
  margin: 10px 5px;
}
#sidebar fieldset a,
#sidebar fieldset a:visited {
  display: block;
  color: #ffffff;
  text-decoration: none;
  padding: 5px 10px;
  transition: all 0.25s;
}
#sidebar fieldset a.following {
  background-color: rgba(128, 128, 255, 0.25);
}
#sidebar fieldset a:hover,
#sidebar fieldset a.following:hover {
  background-color: rgba(255, 255, 255, 0.15);
  cursor: pointer;
}
#sidebar fieldset a .other-world {
  filter: brightness(50%) !important;
  font-style: italic;
}
#sidebar fieldset a img {
  vertical-align: middle;
  padding-right: 10px;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
  -webkit-filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}
#sidebar fieldset#players a {
  padding: 10px;
}
#sidebar #pin {
  position: relative;
  right: -160px;
  width: 23px;
  height: 23px;
  margin: 5px 5px 10px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0);
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
  -webkit-filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
  cursor: pointer;
}
#sidebar #pin.pinned:hover {
  background: rgba(0, 128, 0, 0.5);
  border: 1px solid rgba(0, 128, 0, 0.75);
}
#sidebar #pin.unpinned:hover {
  background: rgba(128, 0, 0, 0.5);
  border: 1px solid rgba(128, 0, 0, 0.75);
}

.leaflet-control-layers {
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  backdrop-filter: blur(5px);
  color: white;
}

.leaflet-control-layers a img {
  filter: invert(1);
}

.leaflet-bar a {
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  backdrop-filter: blur(5px);
  color: white;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  transition: 0.5s cubic-bezier(0.075, 0.82, 0.165, 1);
}

.leaflet-bar a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Makes the map darker but not the nameplates */
#map .leaflet-tile-pane {
  filter: brightness(0.6);
}

/* Changes styling for town information / nation info */

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background-color: rgba(0, 0, 0, 0.6);
  box-shadow: unset;
  color: white;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1100 !important;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Force popup container to also have high z-index */
.leaflet-popup {
  z-index: 1100 !important;
}

.leaflet-tooltip {
  z-index: 99999 !important;
  background-color: rgba(0, 0, 0, 0.6);
  box-shadow: unset;
  color: white;
}

/* Override any inline z-index styles for tooltips */
.leaflet-tooltip[style*="z-index"] {
  z-index: 99999 !important;
}

/* Override any inline z-index styles for popups */
.leaflet-popup[style*="z-index"],
.leaflet-popup-content-wrapper[style*="z-index"],
.leaflet-popup-tip[style*="z-index"] {
  z-index: 1100 !important;
}

.leaflet-tooltip * {
  border-radius: 2px;
}

.leaflet-tooltip-top:before {
  border-top-color: rgba(0, 0, 0, 0.6);
}

.leaflet-bar a.leaflet-disabled{
  background-color: rgba(64, 0, 0, 0.5);
  border-radius: 3px;
  backdrop-filter: blur(5px);
}

/* Enhanced player nameplate styles */
.leaflet-nameplate-pane {
  z-index: 99999 !important;
}

.leaflet-tooltip[data-enhanced="true"] {
  z-index: 99999 !important;
  pointer-events: all !important;
}

/* Player info popup styles */
.player-info-popup {
  z-index: 999999;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  color: white;
  min-width: 250px;
  max-width: 300px;
  font-family: "Helvetica Neue", Arial, Helvetica, sans-serif;
}

.player-info-content {
  padding: 0;
}

.player-info-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px 6px 0 0;
}

.player-info-header img.player-head {
  width: 24px;
  height: 24px;
  margin-right: 10px;
  border-radius: 2px;
}

.player-info-header h3 {
  margin: 0;
  flex-grow: 1;
  font-size: 16px;
  font-weight: bold;
}

.close-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.player-info-body {
  padding: 16px;
}

.player-info-body p {
  font-size: 16px;
  margin: unset;
  color: #ccc;
}

.player-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.follow-btn:hover {
  background: rgba(0, 123, 255, 0.3);
  border-color: rgba(0, 123, 255, 0.5);
}

.message-btn:hover {
  background: rgba(40, 167, 69, 0.3);
  border-color: rgba(40, 167, 69, 0.5);
}

.info-btn:hover {
  background: rgba(255, 193, 7, 0.3);
  border-color: rgba(255, 193, 7, 0.5);
}