:root {
  --bg: #030405;
  --panel: rgba(7, 9, 10, 0.86);
  --line: #22282e;
  --text: #d7dfe2;
  --muted: #8b979c;
  --green: #2bff88;
  --blue: #2e9bff;
  --neutral: #bbbbbb;
  --cyan: #8cffff;
  --gold: #ffd652;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "DejaVu Sans Mono", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body.simgo {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
}

.simgo-map {
  position: fixed;
  inset: 0;
  background: var(--bg);
}

.hud {
  position: fixed;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  pointer-events: none;
}

.hud a {
  pointer-events: auto;
}

.hud-top {
  top: 0;
  left: 0;
  right: 0;
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(3, 4, 5, 0.92), rgba(3, 4, 5, 0));
  justify-content: space-between;
}

.hud-brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--cyan);
  text-decoration: none;
  text-shadow: 0 0 16px rgba(140, 255, 255, 0.45);
}

.hud-brand:hover {
  text-decoration: none;
}

.hud-score {
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  font-size: 13px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.hud-link {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}

.hud-link:hover {
  color: var(--text);
  text-decoration: none;
}

.hud-notice {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: 64px;
  transform: translateX(-50%);
  margin: 0;
  max-width: min(560px, 90vw);
  padding: 8px 14px;
  border: 1px solid rgba(255, 214, 82, 0.4);
  border-radius: 3px;
  background: var(--panel);
  color: var(--gold);
  font-family: var(--mono);
  font-size: 12px;
  text-align: center;
}

.hud-status {
  left: 18px;
  bottom: 16px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.hud-connection::before {
  content: "● ";
  color: var(--neutral);
}

.hud-connection.online::before {
  color: var(--green);
}

/* MapLibre popups */

.maplibregl-popup-content {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(7, 9, 10, 0.96);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  box-shadow: 0 0 24px rgba(0, 0, 0, 0.6);
}

.maplibregl-popup-tip {
  border-top-color: rgba(7, 9, 10, 0.96);
  border-bottom-color: rgba(7, 9, 10, 0.96);
}

.maplibregl-popup-close-button {
  color: var(--muted);
  font-size: 18px;
  padding: 2px 6px;
}

.popup h3 {
  margin: 0 0 6px;
  padding-right: 18px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.popup-green h3 {
  color: var(--green);
}

.popup-blue h3 {
  color: var(--blue);
}

.popup-neutral h3 {
  color: var(--neutral);
}

.popup-meta {
  margin: 4px 0;
  color: var(--muted);
}

.popup-resonators {
  margin: 8px 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.popup-resonators li {
  padding: 3px 0;
  color: var(--text);
}

.maplibregl-ctrl-attrib {
  font-family: var(--mono);
  font-size: 11px;
}

.maplibregl-ctrl-group {
  background: var(--panel);
  border: 1px solid var(--line);
}

.maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--line);
}

@media (max-width: 640px) {
  .hud-top {
    flex-wrap: wrap;
    gap: 8px;
  }

  .hud-score {
    order: 3;
    width: 100%;
    text-align: center;
  }
}
