* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  background: #1a1a2e;
  color: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  z-index: 1000;
}

#header h1 {
  font-size: 1.1rem;
  white-space: nowrap;
  color: #f0a500;
}

#controls {
  display: flex;
  gap: 8px;
  flex: 1;
  flex-wrap: wrap;
}

#controls input {
  flex: 1;
  min-width: 140px;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  font-size: 0.9rem;
}

#controls button {
  padding: 8px 16px;
  background: #f0a500;
  color: #1a1a2e;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

#controls button:hover { background: #d4941a; }
#controls button:disabled { background: #555; cursor: not-allowed; }

.spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#map { flex: 1; }

#info-panel {
  display: none;
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26,26,46,0.92);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 1000;
  font-size: 0.85rem;
  display: none;
  gap: 24px;
  text-align: center;
}

#info-panel.visible { display: flex; }

.info-item span { display: block; font-size: 1.2rem; font-weight: 700; }
.info-item label { color: #aaa; font-size: 0.75rem; }

.legend { display: flex; align-items: center; gap: 6px; margin-left: 16px; }
.legend-line { width: 24px; height: 4px; display: inline-block; border-radius: 2px; }
.legend-lit   { background: #f0a500; }
.legend-unlit { background: #e05555; }
.legend-short { background: #888; }

#error-msg {
  display: none;
  position: absolute;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #c0392b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  z-index: 2000;
  font-size: 0.9rem;
}
