:root {
  color-scheme: dark;
  --bg: #0b0f14;
  --panel: #111925;
  --line: #1d2733;
  --text: #d7e0ea;
  --muted: #7b8ca0;
  --accent: #6ea8fe;
  --ok: #5fd18c;
  --bad: #ff7b72;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px/1.45 system-ui, "Segoe UI", Roboto, sans-serif;
}

#app { display: flex; flex-direction: column; height: 100%; }

header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 14px;
  background: #0e141d;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  z-index: 5;
}

.brand { font-weight: 600; letter-spacing: .3px; }
.brand span {
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 1.2px;
}

nav { display: flex; gap: 4px; }
nav button {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 7px;
  padding: 5px 11px;
  cursor: pointer;
  font-size: 12px;
}
nav button:hover { color: var(--text); border-color: #2a3644; }
nav button.on { background: #1f2a3a; color: var(--text); border-color: #2f4159; }
nav button .n { color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }

.spacer { flex: 1 1 auto; }
.stats { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.stats b { color: var(--text); font-weight: 500; }

#stage { position: relative; flex: 1 1 auto; overflow: hidden; background: #070a0e; }
/* `pixelated` also covers the case where the element ends up scaled by a
   fractional device pixel ratio: the browser must never resample the map. */
canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  image-rendering: pixelated;
}
canvas.dragging { cursor: grabbing; }

.chip {
  display: inline-block;
  background: rgba(11, 15, 20, .82);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 4px 9px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  backdrop-filter: blur(3px);
}
.chip b { color: var(--text); font-weight: 500; }

#hud {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
  pointer-events: none;
}

#controls {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 84px;
}
#controls button {
  background: rgba(17, 25, 37, .92);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 0;
  cursor: pointer;
  font-size: 12px;
  width: 100%;
}
#controls button:hover { border-color: #2f4159; }
#controls button.toggle { color: var(--muted); }
#controls button.toggle.on { color: var(--text); background: #1f2a3a; }

#jump {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 5px;
  background: rgba(17, 25, 37, .92);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 6px;
}
#jump input {
  width: 76px;
  background: #0b0f14;
  border: 1px solid #2a3644;
  border-radius: 6px;
  color: var(--text);
  padding: 5px 7px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#jump button {
  background: #1f4fa8;
  border: 0;
  color: #fff;
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  font-size: 12px;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 11.5px;
  background: rgba(11, 15, 20, .7);
  padding: 4px 10px;
  border-radius: 999px;
  transition: opacity .6s;
  pointer-events: none;
}
.hint.fade { opacity: 0; }

/* The `hidden` attribute only sets `display: none` in the UA stylesheet, so an
   author rule with `display: flex` overrides it and the panel stays on screen
   over a full map. This is the line that keeps it off. */
.empty[hidden] { display: none; }

.empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
  padding: 30px;
  pointer-events: none;
}
.empty h2 { color: var(--text); margin: 0 0 6px; font-size: 15px; font-weight: 600; }
.empty p { max-width: 420px; margin: 0; }

.pins { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
}
.pin i {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  background: #ffcf4d;
  border: 1px solid #6b5200;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.pin b {
  position: absolute;
  left: 16px;
  top: -3px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 500;
  color: #ffdf8a;
  background: rgba(11, 15, 20, .85);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 620px) {
  header { flex-wrap: wrap; gap: 8px; }
  .brand span { display: none; }
  #controls { width: 66px; }
  #jump input { width: 58px; }
  .hint { display: none; }
}
