:root {
  color-scheme: dark;
  --surface-0: #0b0e12;   /* the map */
  --surface-1: #12161c;   /* panels */
  --surface-2: #1a2028;   /* raised */
  --line: #262e38;
  --text-primary: #e6e9ee;
  --text-secondary: #9aa4b0;
  --text-muted: #6b7582;
  --prey: #e76624;        /* categorical slot 2 (orange) */
  --combat: #338ced;      /* slot 1 (blue) */
  --capital: #00a888;     /* slot 3 (aqua) */
  --structure: #9c9c9c;
  --pod: #efefef;
  --other: #6f6f6f;
  --range: #9887ef;       /* Black Ops range (slot 7, violet): an area, not a kind of kill */
  --critical: #dc3c3d;
  --warning: #fbb315;
  --good: #0aac23;
  font: 13px/1.35 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--surface-0); color: var(--text-primary); overflow: hidden; }
body { display: flex; flex-direction: column; }
button, select, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#bar {
  min-height: 44px; display: flex; align-items: center; gap: 8px 16px; padding: 6px 12px; flex-wrap: wrap;
  background: var(--surface-1); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 600; letter-spacing: .04em; color: var(--text-secondary); text-transform: uppercase; font-size: 12px; }
.filters { display: flex; align-items: center; gap: 8px 14px; flex: 1; min-width: 0; flex-wrap: wrap; }
.control { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); white-space: nowrap; position: relative; }
.control select, .pick {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; cursor: pointer;
  color: var(--text-primary);
}
.pick:hover, .control select:hover { border-color: #3a4552; }
.check input { accent-color: var(--combat); }
.kinds { gap: 4px; }
.kind {
  display: flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-primary); user-select: none;
}
.kind.off { opacity: .4; }
.kind svg { width: 12px; height: 12px; }
.status { margin-left: auto; padding: 3px 10px; border-radius: 12px; background: var(--surface-2); color: var(--text-secondary); white-space: nowrap; }
.status .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }

.pop {
  position: absolute; top: 32px; left: 0; z-index: 20; width: 260px; max-height: 70vh; display: flex; flex-direction: column;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: 6px; padding: 8px; box-shadow: 0 8px 24px #0008;
}
.pop input[type=search] { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 4px 8px; }
.pop-actions { display: flex; justify-content: space-between; margin: 6px 0; }
.link { background: none; border: none; color: var(--combat); cursor: pointer; padding: 0; }
#region-list { overflow: auto; }
#region-list label { display: flex; gap: 6px; padding: 2px 4px; color: var(--text-primary); cursor: pointer; border-radius: 3px; }
#region-list label:hover { background: var(--surface-2); }
#region-list .n { margin-left: auto; color: var(--text-muted); }

main { display: flex; flex: 1; min-height: 0; }
#map-wrap { position: relative; flex: 1; min-width: 0; }
#map { display: block; width: 100%; height: 100%; cursor: grab; }
#map.dragging { cursor: grabbing; }
.overlay { position: absolute; background: #12161ce6; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; }
#sources { top: 10px; left: 10px; max-width: 380px; }
#sources:empty { display: none; }
#sources h4, #legend h4 { margin: 0 0 4px; font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
#sources .src { display: flex; gap: 8px; cursor: pointer; padding: 1px 0; }
#sources .src:hover .who { text-decoration: underline; }
#sources .where { color: var(--text-secondary); }
#sources .blops {
  margin-left: auto; font-size: 10px; font-weight: 600; letter-spacing: .04em; padding: 0 6px; border-radius: 8px;
  border: 1px solid var(--line); color: var(--text-muted); cursor: pointer; user-select: none;
}
#sources .blops.on { border-color: var(--range); color: var(--range); }
#sources .range-note { color: var(--text-secondary); margin-top: 6px; max-width: 300px; }
.drop { color: var(--range); }
#legend { bottom: 10px; left: 10px; display: grid; grid-template-columns: auto auto; gap: 2px 14px; color: var(--text-secondary); }
#legend .row { display: flex; align-items: center; gap: 6px; }
#legend svg { width: 12px; height: 12px; }
.hint { bottom: 10px; right: 10px; color: var(--text-muted); font-size: 12px; }

.tip {
  position: absolute; z-index: 10; pointer-events: none; max-width: 340px;
  background: var(--surface-1); border: 1px solid #3a4552; border-radius: 6px; padding: 8px 10px; box-shadow: 0 6px 18px #0009;
}
.tip .t-name { font-weight: 600; font-size: 14px; }
.tip .t-sub, .tip .t-dim { color: var(--text-secondary); }
.tip .t-row { margin-top: 4px; }
.tip ul { margin: 2px 0 0; padding-left: 16px; }

#side { width: 400px; display: flex; flex-direction: column; background: var(--surface-1); border-left: 1px solid var(--line); }
.list-head { display: flex; justify-content: space-between; padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--text-secondary); font-weight: 600; }
#list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#list li { padding: 7px 12px 7px 10px; border-bottom: 1px solid #1c222a; cursor: pointer; display: grid; grid-template-columns: 16px 1fr auto; gap: 0 8px; }
#list li:hover { background: var(--surface-2); }
#list li.fresh { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { background: #2a3442; } to { background: transparent; } }
#list .icon { padding-top: 2px; }
#list .icon svg { width: 12px; height: 12px; }
#list .l1 { font-weight: 600; }
#list .l2, #list .l3 { color: var(--text-secondary); grid-column: 2 / 4; }
#list .age { color: var(--text-muted); text-align: right; }
#list .value { color: var(--text-secondary); font-weight: 400; }
#list .far { color: var(--text-muted); }
#list .empty { display: block; color: var(--text-muted); cursor: default; padding: 16px 12px; }
.sec { font-weight: 600; font-variant-numeric: tabular-nums; }

#detail { border-bottom: 1px solid var(--line); max-height: 60%; overflow-y: auto; padding: 10px 12px; background: #151a21; }
#detail .d-head { display: flex; align-items: baseline; gap: 8px; }
#detail .d-name { font-size: 16px; font-weight: 600; }
#detail .d-close { margin-left: auto; background: none; border: none; color: var(--text-secondary); cursor: pointer; font-size: 16px; }
#detail .d-sub { color: var(--text-secondary); margin: 2px 0 6px; }
#detail .d-links a { color: var(--combat); margin-right: 12px; text-decoration: none; }
#detail h5 { margin: 12px 0 4px; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
#detail table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
#detail th { text-align: right; font-weight: 400; color: var(--text-muted); padding: 2px 4px; }
#detail th:first-child, #detail td:first-child { text-align: left; }
#detail td { text-align: right; padding: 2px 4px; border-top: 1px solid #1f262f; }
#detail tr.here td { color: var(--text-primary); font-weight: 600; }
#detail tr.nb { cursor: pointer; }
#detail tr.nb:hover td { background: var(--surface-2); }
#detail .note { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
#detail .facts div { margin: 2px 0; }
#detail .problem { color: var(--warning); }

/* Hunting from, web version: logged-in characters, typed exits, the login button */
#sources .src.off .who, #sources .src.off .where { color: var(--text-muted); }
#sources .x { margin-left: 6px; color: var(--text-muted); cursor: pointer; padding: 0 4px; }
#sources .x:hover { color: var(--text-primary); }
#sources .relogin { color: var(--warning); cursor: pointer; text-decoration: underline; }
#sources .problem { color: var(--warning); margin-bottom: 4px; max-width: 320px; }
#sources-controls { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
#sources-controls:empty { display: none; }
#exit-input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 3px 8px; width: 210px; }

/* credits under the kill list */
#credits { border-top: 1px solid var(--line); padding: 6px 12px; font-size: 11px; color: var(--text-muted); line-height: 1.4; }
#credits a { color: var(--text-secondary); }
