body {
  margin: 0;
  background: radial-gradient(circle at center, #050510, #000);
  color: #fff;
  font-family: system-ui, sans-serif;
  overflow: hidden;
}

#map {
  position: relative;
  width: 100vw;
  height: 100vh;
}

.star {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.star-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  margin: 0 auto;
}

.star-label {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 0 4px #000;
}

.star-title {
  font-weight: 600;
}

.star-owner {
  opacity: 0.8;
}
/*
.star-infra {
  font-size: 10px;
  opacity: 0.8;
  margin-top: 2px;
  color: #ffd166;
}*/

.star-infra {
  display: flex;
  gap: 6px;
  margin-top: 3px;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.infra-entry {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7em;
  color: #ffd166;
}

.infra-icon {
  image-rendering: pixelated;
  background-repeat: no-repeat;
}

.star-timer {
  font-size: 9px;
  opacity: 0.9;
  color: #ffd166;
}

.star.alliance {
  color: #4da6ff;
}
.star.none {
  color: #777;
}

.tooltip {
  position: absolute;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #333;
  padding: 6px 8px;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 10;
}

#legend {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  min-width: 140px;
  max-width: 200px;
  pointer-events: auto;
}

.legend-title {
  font-weight: 600;
  margin-bottom: 6px;
  opacity: 0.9;
}

.legend-item {
  display: flex;
  align-items: center;
  padding-bottom: 4px;
  white-space: nowrap;
}

.legend-item:last-child {
  margin-bottom: 0;
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 4px currentColor;
}

.legend-table {
  width: 100%;
  border-collapse: collapse;
  color: #dddddd;
}

.legend-row td {
  padding: 2px 4px;
  white-space: nowrap;
  vertical-align: middle;
}

.legend-row:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  cursor: crosshair;
}

#loader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #050510, #000);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  color: white;
  font-family: sans-serif;
  transition: opacity 0.3s ease;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top: 6px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  font-size: 18px;
  opacity: 0.8;
}
