:root {
  --void: #0b0d12;
  --panel: rgba(16, 19, 27, .78);
  --line: rgba(255, 255, 255, .09);
  --fg: #eef0f6;
  --muted: #9aa0b4;
  --accent: #7bd36a;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--void); color: var(--fg); font: 14px/1.4 var(--font); }
#map { position: fixed; inset: 0; background: var(--void); }

/* Blocks stay crisp when zoomed in past one pixel per block. */
#map.zoomed-in .leaflet-tile { image-rendering: pixelated; image-rendering: crisp-edges; }

.panel {
  position: fixed; z-index: 1000; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .35);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

#title { top: 12px; left: 12px; padding: 10px 14px; max-width: calc(100vw - 24px); }
#title h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
#title h1::before {
  content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
  background: linear-gradient(var(--accent) 0 45%, #865b3a 45%); border-radius: 2px;
}
#title p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

#goto { top: 12px; right: 12px; display: flex; padding: 4px; }
#goto input {
  width: 150px; border: 0; outline: 0; background: transparent; color: var(--fg);
  font: 14px var(--mono); padding: 6px 8px;
}
#goto input::placeholder { color: var(--muted); font-family: var(--font); }
#goto.bad input { color: #ff8a80; }
#pads {
  max-width: 150px; border: 0; border-right: 1px solid var(--line); outline: 0; border-radius: 0;
  background: transparent; color: var(--fg); font: 14px var(--font); padding: 6px 8px; cursor: pointer;
}
#pads option { background: #1a1d28; color: var(--fg); }
/* The rules above give these a display: hidden must still hide them. */
#pads[hidden], #pads-toggle[hidden] { display: none; }

button {
  font: inherit; color: var(--fg); background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 11px; cursor: pointer;
}
button:hover { background: rgba(255, 255, 255, .12); }
button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

#tools { bottom: 12px; right: 12px; display: flex; gap: 6px; padding: 6px; }

#coords {
  bottom: 12px; left: 12px; padding: 8px 12px; font: 13px var(--mono); pointer-events: none;
  display: flex; flex-direction: column; gap: 1px; min-width: 190px;
}
#coords b { color: var(--muted); font-weight: 400; }
#coords .xz span { display: inline-block; min-width: 6ch; }
#coords .sub { color: var(--muted); font-size: 11.5px; }

#error {
  position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 24px;
  color: var(--muted); text-align: center;
}
/* display above would override the hidden attribute: hidden, it must not
   cover the map and catch its clicks. */
#error[hidden] { display: none; }

/* Leaflet, dressed to match. */
.leaflet-container { background: var(--void); font: inherit; }
.leaflet-top.leaflet-right { top: 60px; }
.leaflet-bar { border: 1px solid var(--line) !important; border-radius: 10px; overflow: hidden; box-shadow: 0 8px 28px rgba(0, 0, 0, .35) !important; }
.leaflet-bar a, .leaflet-bar a:hover {
  background: var(--panel); color: var(--fg); border-bottom-color: var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.leaflet-bar a:hover { background: rgba(40, 45, 60, .9); }
.leaflet-bar a.leaflet-disabled { background: var(--panel); color: #555a6a; }
.leaflet-control-attribution {
  background: transparent !important; color: var(--muted); font-size: 11px;
}
.leaflet-control-attribution a { color: var(--muted); }
.leaflet-bottom.leaflet-right { bottom: 58px; }

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--panel); color: var(--fg); border: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 8px 28px rgba(0, 0, 0, .4);
}
.leaflet-popup-content { margin: 10px 14px; font: 13px var(--mono); }
.leaflet-popup-content .sub { color: var(--muted); font-size: 11.5px; }
.leaflet-popup-content button { margin-top: 8px; font: 12px var(--font); padding: 4px 9px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

.pad-marker {
  width: 16px; height: 16px; transform: rotate(45deg); border-radius: 3px;
  background: linear-gradient(135deg, #c79bff, #6d3fd6); border: 2px solid #f1e6ff;
  box-shadow: 0 0 10px rgba(180, 120, 255, .8);
}
.leaflet-tooltip.pad-label {
  background: rgba(16, 19, 27, .72); color: #f1e6ff; border: 0; border-radius: 6px; box-shadow: none;
  font: 600 12px var(--font); padding: 2px 7px;
}
.leaflet-tooltip.pad-label::before { display: none; }
/* Far out the labels would cover the map. */
#map.far .pad-label { display: none; }

.here-marker {
  width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff;
  background: rgba(123, 211, 106, .55); box-shadow: 0 0 0 4px rgba(123, 211, 106, .25);
}

@media (max-width: 600px) {
  #title { padding: 8px 12px; }
  #title h1 { font-size: 15px; }
  #goto { top: auto; bottom: 64px; right: 12px; }
  #goto input { width: 110px; }
  #pads { max-width: 110px; }
  #coords { min-width: 0; }
  #coords .sub { display: none; }
  .leaflet-top.leaflet-right { top: 72px; }
  .leaflet-bottom.leaflet-right { bottom: 112px; }
}
