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

:root {
  --hud-bg: rgba(8, 14, 22, 0.82);
  --hud-border: rgba(80, 180, 255, 0.18);
  --hud-text: #8fb8d8;
  --hud-accent: #4fc3f7;
  --danger: #ff4757;
}

html, body { height: 100%; overflow: hidden; font-family: 'SF Mono', 'JetBrains Mono', monospace; }

#map { position: absolute; inset: 0; }

#fog {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

/* ── Compass ─────────────────────────────────── */
#compass {
  position: absolute;
  top: 14px; left: 14px;
  z-index: 10;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 12px rgba(79, 195, 247, 0.12), inset 0 0 8px rgba(0,0,0,0.4);
  user-select: none;
}
#compass-needle {
  position: relative;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease-out;
}
#compass-needle .n,
#compass-needle .s {
  position: absolute;
  font-size: 10px;
  font-weight: 700;
}
#compass-needle .n { top: 7px; color: var(--danger); }
#compass-needle .s { bottom: 7px; color: var(--hud-text); }
#compass-needle::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 2px; height: 28px;
  margin-left: -1px; margin-top: -14px;
  background: linear-gradient(to bottom, var(--danger) 50%, var(--hud-text) 50%);
  border-radius: 1px;
}

/* ── Zoom HUD ────────────────────────────────── */
#zoom-hud {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 10;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  padding: 6px 10px;
  border-radius: 8px;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1;
}
#zoom-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--hud-accent);
}
.zoom-label {
  font-size: 9px;
  color: var(--hud-text);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* ── Minimap overview ────────────────────────── */
#minimap-container {
  position: absolute;
  bottom: 80px; right: 14px;
  z-index: 10;
  width: 130px; height: 130px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--hud-border);
  box-shadow: 0 0 0 1px rgba(8,14,22,0.9), 0 0 20px rgba(79,195,247,0.15);
}
#minimap { width: 100%; height: 100%; }
#minimap-frame {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(79, 195, 247, 0.25);
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(8,14,22,0.45) 100%);
}
#minimap-cursor {
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  pointer-events: none;
}
#minimap-cursor::before,
#minimap-cursor::after {
  content: '';
  position: absolute;
  background: var(--hud-accent);
  opacity: 0.7;
}
#minimap-cursor::before { top: 4px; left: 0; width: 10px; height: 1px; }
#minimap-cursor::after  { top: 0; left: 4px; width: 1px; height: 10px; }

/* ── Bottom UI ───────────────────────────────── */
#ui {
  position: absolute;
  z-index: 10;
  left: 14px; bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
#ui button {
  width: 48px; height: 48px;
  border-radius: 10px;
  border: 1px solid var(--hud-border);
  background: var(--hud-bg);
  color: var(--hud-text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#ui button:hover { background: rgba(79,195,247,0.1); color: var(--hud-accent); border-color: rgba(79,195,247,0.4); }
#ui button:active { transform: scale(0.93); }
#locate.tracking { background: rgba(79,195,247,0.15); color: var(--hud-accent); border-color: rgba(79,195,247,0.5); }
#pin-btn.active { background: rgba(255, 200, 0, 0.15); color: #ffc800; border-color: rgba(255,200,0,0.4); }

#status {
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  color: var(--hud-text);
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  backdrop-filter: blur(6px);
  max-width: 55vw;
  letter-spacing: 0.3px;
}

/* ── Waypoints panel ─────────────────────────── */
#pins-panel {
  position: absolute;
  z-index: 20;
  bottom: 80px; left: 14px;
  width: 220px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  border-radius: 10px;
  backdrop-filter: blur(8px);
  overflow: hidden;
}
#pins-panel.hidden { display: none; }
#pins-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hud-border);
  font-size: 11px;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--hud-accent);
}
#pins-close {
  background: none; border: none; color: var(--hud-text);
  cursor: pointer; font-size: 14px;
}
#pins-list { list-style: none; max-height: 200px; overflow-y: auto; }
#pins-list:empty::after {
  content: 'No waypoints.\AClick map to place one.';
  white-space: pre;
  display: block;
  padding: 14px 12px;
  font-size: 12px;
  color: var(--hud-text);
  opacity: 0.6;
}
#pins-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  font-size: 12px;
  color: var(--hud-text);
  border-bottom: 1px solid rgba(80,180,255,0.06);
  cursor: pointer;
  transition: background 0.12s;
}
#pins-list li:hover { background: rgba(79,195,247,0.07); }
#pins-list li .pin-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pins-list li .pin-del {
  opacity: 0; font-size: 13px; color: var(--danger);
  background: none; border: none; cursor: pointer;
}
#pins-list li:hover .pin-del { opacity: 1; }

/* ── Radar ping on player ────────────────────── */
@keyframes radar-ping {
  0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 0.8; }
  100% { transform: translate(-50%, -50%) scale(2.5); opacity: 0; }
}
.player-ping {
  position: absolute;
  width: 28px; height: 28px;
  border: 2px solid var(--hud-accent);
  border-radius: 50%;
  pointer-events: none;
  animation: radar-ping 1.4s ease-out infinite;
}

/* ── MapLibre overrides ──────────────────────── */
.maplibregl-ctrl-bottom-right,
.maplibregl-ctrl-attrib { display: none; }
