* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, sans-serif;
  background: #0d1117;
  color: #e6edf3;
}

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

header h1 {
  font-size: 18px;
  margin: 0;
}

#status {
  font-size: 13px;
  color: #7d8590;
}

#status.connected {
  color: #3fb950;
}

#status.error {
  color: #f85149;
}

#worldname {
  margin-left: auto;
  font-size: 12px;
  color: #7d8590;
  font-family: monospace;
}

main {
  display: flex;
  gap: 16px;
  padding: 16px;
}

#map-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  justify-content: center;
}

#map {
  background: #010409;
  border: 1px solid #30363d;
  border-radius: 6px;
  cursor: grab;
}

#zoom-controls {
  position: absolute;
  top: 176px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#zoom-controls button {
  width: 28px;
  height: 28px;
  background: #21262d;
  color: #e6edf3;
  border: 1px solid #30363d;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
}

#zoom-controls button:hover {
  background: #30363d;
}

#legend {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(22, 27, 34, 0.85);
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 11px;
  display: flex;
  gap: 12px;
}

#legend label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
}

#legend input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

#legend .sw {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  vertical-align: middle;
}

#minimap {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #010409;
  border: 1px solid #30363d;
  border-radius: 4px;
  cursor: pointer;
}

#tooltip {
  display: none;
  position: fixed;
  z-index: 50;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  pointer-events: none;
  max-width: 280px;
}

#tooltip .tt-type {
  color: #7d8590;
  font-family: monospace;
  font-size: 10px;
}

#tooltip .tt-pos {
  color: #58a6ff;
  font-family: monospace;
  font-size: 11px;
}

#sidebar {
  width: 280px;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
}

#sidebar h2 {
  font-size: 14px;
  margin: 0 0 8px 0;
  color: #7d8590;
  text-transform: uppercase;
}

#filter {
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 8px;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #e6edf3;
  font-size: 13px;
}

#object-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12px;
  overflow-y: auto;
  max-height: 700px;
}

#object-list li {
  padding: 6px 4px;
  border-bottom: 1px solid #21262d;
}

#object-list .obj-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

#object-list .obj-name {
  color: #e6edf3;
  font-weight: 600;
}

#object-list .obj-type {
  color: #7d8590;
  font-family: monospace;
  font-size: 10px;
  display: block;
}

#object-list .obj-pos {
  color: #58a6ff;
  font-family: monospace;
  font-size: 11px;
}

#object-list li.inactive {
  opacity: 0.4;
}

#object-list li {
  cursor: pointer;
}

#object-list li:hover {
  background: #1c2128;
}
