:root {
  --bg: #131312;
  --panel: #1c1a17;
  --surface: #2b2723;
  --ink: #f2ece4;
  --muted: #9a938a;
  --accent: #ff8a3d;
  --line: #322e29;
}

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

html, body { height: 100%; }

body {
  display: flex;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Space Grotesk', sans-serif;
  overflow: hidden;
}

.panel {
  width: 300px;
  flex-shrink: 0;
  height: 100%;
  padding: 22px 20px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.brand .sub { color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 2px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

select {
  width: 100%;
  padding: 9px 10px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--muted);
}
.meta b { color: var(--ink); font-weight: 700; }

.hotspots { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.hotspots-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.hotspots-head .count { color: var(--accent); }

#hotspot-list { list-style: none; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
#hotspot-list li {
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  transition: border-color 0.12s ease, transform 0.12s ease;
}
#hotspot-list li:hover { border-color: var(--accent); transform: translateX(2px); }
#hotspot-list .rank { color: var(--muted); font-weight: 700; margin-right: 8px; }
#hotspot-list .coord { font-weight: 700; font-size: 14px; }
#hotspot-list .score {
  font-size: 12px; font-weight: 700; color: var(--accent);
  background: rgba(255, 138, 61, 0.12);
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}

.hint { font-size: 12px; color: var(--muted); line-height: 1.5; }

.stage { position: relative; flex: 1; height: 100%; overflow: hidden; background: #0d0c0b; }
#map { display: block; width: 100%; height: 100%; cursor: grab; }
#map.dragging { cursor: grabbing; }

.readout {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(19, 19, 18, 0.85);
  border: 1px solid var(--line);
  padding: 6px 11px; border-radius: 9px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  pointer-events: none;
}

.tooltip {
  position: absolute; z-index: 5;
  transform: translate(-50%, calc(-100% - 12px));
  background: rgba(19, 19, 18, 0.95);
  border: 1px solid var(--accent);
  padding: 7px 10px; border-radius: 9px;
  font-size: 12px; line-height: 1.4; white-space: nowrap;
  pointer-events: none;
}
.tooltip b { color: var(--accent); }

.loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0d0c0b; color: var(--muted); font-size: 14px;
}
.loading[hidden] { display: none; }

@media (max-width: 640px) {
  body { flex-direction: column; }
  .panel { width: 100%; height: auto; max-height: 45%; border-right: none; border-bottom: 1px solid var(--line); }
}
