/* null · radar. Same language as thenull.cc: near-black neutral surfaces, white primary actions,
   a faint lilac glow for the brand. Map markers keep their meaning colours, softened to match. */
:root {
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --bg: #0b0b0c;
  --surface: #121213e6;
  --surface-solid: #141415;
  --raised: #1b1b1d;
  --line: #ffffff14;
  --line-strong: #ffffff26;
  --text: #ededed;
  --soft: #c9c9cc;
  --muted: #9a9a9f;
  --faint: #6f6f75;
  --glow: #bba1d3;
  --enemy: #ef7480;
  --ally: #6fcf9f;
  --down: #e8c06a;
  --vehicle: #7cc4e0;
  --loot: #d8b96a;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --panel-width: 288px;
  --edge: 20px;
  --top: 76px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  overflow: hidden;
  min-width: 320px;
}
button,
a,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
:is(button, a, summary):focus-visible,
input:focus-visible + .switch,
.item-filter input:focus-visible {
  outline: 2px solid #c4c4c4;
  outline-offset: 3px;
}
svg {
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg .fill {
  fill: currentColor;
  stroke: none;
}
@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.985);
  }
}
@keyframes appear-centered {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 8px)) scale(0.985);
  }
}
@keyframes drop {
  from {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 currentColor;
  }
  70%,
  100% {
    box-shadow: 0 0 0 6px transparent;
  }
}

/* ---- map ---------------------------------------------------------------------------- */
#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  background: var(--bg);
}
#map:active {
  cursor: grabbing;
}
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 70% at 55% 45%, transparent 55%, #0b0b0c99 100%),
    linear-gradient(#0b0b0cd9, transparent 92px),
    linear-gradient(0deg, #0b0b0cd9, transparent 84px);
}

/* ---- top bar ------------------------------------------------------------------------ */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  padding: 0 var(--edge);
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 3;
}
.topbar > * {
  pointer-events: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.3px;
  border-radius: 8px;
}
.brand-mark {
  width: 28px;
  height: 28px;
  stroke: #d9d8e9;
  stroke-width: 3.2;
  filter: drop-shadow(0 0 10px #bba1d340);
}
.brand-name b {
  font-weight: 450;
  color: var(--muted);
}
.connection {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  font-size: 12px;
  color: var(--soft);
  white-space: nowrap;
  transition: color 0.3s, border-color 0.3s;
}
.connection i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  color: var(--faint);
  background: currentColor;
  transition: background-color 0.3s, color 0.3s;
}
.connection.live i {
  color: var(--ally);
  animation: pulse 2.4s infinite;
}
.connection.connecting i,
.connection.waiting i {
  color: var(--soft);
  animation: pulse 1.4s infinite;
}
.connection.warn {
  border-color: #e8c06a33;
}
.connection.warn i {
  color: var(--down);
}
.connection.preview i {
  color: var(--glow);
}

/* ---- settings panel ----------------------------------------------------------------- */
.panel {
  position: fixed;
  left: var(--edge);
  top: var(--top);
  width: var(--panel-width);
  max-height: calc(100dvh - var(--top) - var(--edge));
  padding: 22px 20px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #ffffff26 transparent;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 24px 70px #0008;
  backdrop-filter: blur(20px);
  z-index: 2;
  transition:
    opacity 0.28s var(--ease),
    transform 0.28s var(--ease),
    visibility 0s linear 0s;
}
body:not(.panel-open) .panel {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-12px);
  pointer-events: none;
  transition:
    opacity 0.22s var(--ease),
    transform 0.22s var(--ease),
    visibility 0s linear 0.22s;
}
.eyebrow {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 10px;
}
.map-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.6px;
}
.badge {
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 1.2px;
  color: var(--soft);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}
.intro {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  margin: 8px 0 18px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff05;
}
.stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px 10px;
  min-width: 0;
}
.stats > div + div {
  border-left: 1px solid var(--line);
}
.stats strong {
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.4px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
.section-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--faint);
  margin: 22px 0 6px;
}
.toggle {
  position: relative;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--soft);
  border-radius: 8px;
  transition: color 0.2s;
}
.toggle:hover {
  color: var(--text);
}
.toggle > span:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.toggle input {
  position: absolute;
  right: 0;
  width: 34px;
  height: 20px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch {
  position: relative;
  flex: none;
  width: 32px;
  height: 18px;
  border-radius: 999px;
  background: #2a2a2d;
  box-shadow: inset 0 0 0 1px #ffffff0d;
  transition: background-color 0.22s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #8b8b91;
  transition:
    transform 0.22s var(--ease),
    background-color 0.22s var(--ease);
}
.toggle input:checked + .switch {
  background: #e6e6e8;
}
.toggle input:checked + .switch::after {
  background: #111113;
  transform: translateX(14px);
}
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.dot.plain {
  background: transparent;
  box-shadow: inset 0 0 0 1px #ffffff2e;
}
.enemy {
  background: var(--enemy);
}
.ally {
  background: var(--ally);
}
.down {
  background: var(--down);
}
.vehicle {
  background: var(--vehicle);
}
.loot {
  background: var(--loot);
}
.layer-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.layer-help {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--faint);
  margin: 12px 0 0;
}
.layer-help.warning {
  color: var(--down);
  margin: 6px 0 2px;
}
.item-filters {
  margin: 2px 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff04;
}
.item-filters summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--soft);
  cursor: pointer;
  border-radius: 10px;
}
.item-filters summary::-webkit-details-marker {
  display: none;
}
.item-filters summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.22s var(--ease);
}
.item-filters[open] summary::after {
  transform: translateY(1px) rotate(225deg);
}
.item-filters > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  padding: 2px 10px 10px;
}
.item-filters[open] > div {
  animation: fade 0.22s var(--ease);
}
.item-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  font-size: 12px;
  color: var(--soft);
  cursor: pointer;
}
.item-filter input {
  appearance: none;
  flex: none;
  display: grid;
  place-content: center;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1px solid #ffffff38;
  border-radius: 4px;
  background: #0f0f10;
  cursor: pointer;
  transition:
    background-color 0.18s,
    border-color 0.18s;
}
.item-filter input::before {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 1.7px solid #111113;
  border-bottom: 1.7px solid #111113;
  transform: translateY(-1px) rotate(-45deg);
  opacity: 0;
  transition: opacity 0.15s;
}
.item-filter input:checked {
  background: #e6e6e8;
  border-color: #e6e6e8;
}
.item-filter input:checked::before {
  opacity: 1;
}

/* ---- buttons ------------------------------------------------------------------------ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    color 0.2s,
    transform 0.2s var(--ease);
}
.button svg {
  width: 16px;
  height: 16px;
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.button.primary,
.button[aria-pressed="true"] {
  background: #ededed;
  border-color: #ffffff99;
  color: #111113;
}
.button.primary:hover,
.button[aria-pressed="true"]:hover {
  background: #fff;
}
.button.secondary,
.button[aria-pressed="false"] {
  background: #ffffff08;
  border-color: var(--line-strong);
  color: var(--soft);
}
.button.secondary:hover,
.button[aria-pressed="false"]:hover {
  border-color: #ffffff4d;
  color: var(--text);
}
.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}
.panel-actions .button {
  padding: 0 10px;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--muted);
}
.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend .arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 10px solid #f4f4f6;
  filter: drop-shadow(0 0 4px #bba1d399);
}
.legend .ring {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--enemy);
  border-right-color: #ffffff1f;
  border-bottom-color: #ffffff1f;
}

/* ---- empty state and notices -------------------------------------------------------- */
.empty-state {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(380px, calc(100vw - 32px));
  padding: 30px 28px 28px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 30px 100px #000a;
  backdrop-filter: blur(20px);
  z-index: 1;
  animation: appear-centered 0.32s var(--ease);
  transition: left 0.28s var(--ease);
}
.empty-symbol {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 18px;
}
.empty-symbol > span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid #ffffff1f;
}
.empty-symbol > span:nth-child(2) {
  inset: 14px;
  border-color: #ffffff29;
}
.empty-symbol > span:nth-child(3) {
  inset: 0;
  border: 0;
  background: conic-gradient(from 0deg, #bba1d300 0deg, #bba1d32e 70deg, #bba1d300 72deg);
  animation: sweep 3.2s linear infinite;
}
.empty-symbol i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: #f4f4f6;
  box-shadow: 0 0 16px #bba1d3aa;
}
@keyframes sweep {
  to {
    transform: rotate(360deg);
  }
}
h2 {
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.4px;
  font-weight: 600;
  margin: 0 0 8px;
}
.empty-state p {
  font-size: 13px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 22px;
}
.empty-state .button {
  width: 100%;
}
.notice {
  position: fixed;
  top: var(--top);
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 9px 16px;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--soft);
  background: var(--surface);
  border: 1px solid var(--line);
  /* A pill on one line, a rounded card when it wraps on a phone. */
  border-radius: 18px;
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px #0006;
  z-index: 1;
  animation: drop 0.28s var(--ease);
  transition: left 0.28s var(--ease);
}
@media (min-width: 761px) {
  body.panel-open .empty-state,
  body.panel-open .notice {
    left: calc(50% + (var(--panel-width) + var(--edge)) / 2);
  }
}

/* ---- marker details ----------------------------------------------------------------- */
.entity-tooltip {
  position: fixed;
  z-index: 5;
  width: 250px;
  max-width: calc(100vw - 24px);
  padding: 15px 16px;
  background: #141415f2;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  box-shadow: 0 18px 50px #000a;
  backdrop-filter: blur(16px);
  pointer-events: none;
  animation: fade 0.16s var(--ease);
}
.detail-kind {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.entity-tooltip h2 {
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  margin: 0 0 10px;
}
.detail-health {
  height: 4px;
  border-radius: 999px;
  background: #ffffff14;
  margin-bottom: 12px;
  overflow: hidden;
}
.detail-health > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s var(--ease);
}
.detail-equipped {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #ffffff05;
  margin-bottom: 12px;
}
.detail-equipped img {
  width: 64px;
  height: 26px;
  object-fit: contain;
}
.detail-equipped span {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  overflow-wrap: anywhere;
}
.entity-tooltip dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0;
  font-size: 12px;
}
.entity-tooltip dt {
  color: var(--muted);
}
.entity-tooltip dd {
  margin: 0;
  text-align: right;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}
.entity-tooltip ul {
  list-style: none;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.75;
  color: var(--soft);
}
.entity-tooltip li {
  overflow-wrap: anywhere;
}

/* ---- map controls ------------------------------------------------------------------- */
.map-tools {
  position: fixed;
  right: var(--edge);
  top: var(--top);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 2;
}
.tool,
.zoom-controls {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: 0 8px 26px #0006;
  backdrop-filter: blur(16px);
}
.tool {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--soft);
  transition:
    color 0.2s,
    border-color 0.2s,
    background-color 0.2s;
}
.tool svg,
.zoom-controls svg {
  width: 17px;
  height: 17px;
}
.tool:hover {
  color: var(--text);
  border-color: var(--line-strong);
}
.tool[aria-expanded="true"] {
  background: #ffffff12;
  color: var(--text);
}
.compass {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 40px;
  padding: 6px 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.5px;
}
.compass svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.2;
}
.compass .fill {
  fill: #f4f4f6;
}
.zoom-controls {
  position: fixed;
  right: var(--edge);
  bottom: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40px;
  z-index: 2;
}
.zoom-controls button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--soft);
  border-radius: 10px;
  transition: color 0.2s, background-color 0.2s;
}
.zoom-controls button:hover {
  color: var(--text);
  background: #ffffff0a;
}
.zoom-controls > span {
  width: 18px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

/* ---- footer ------------------------------------------------------------------------- */
footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  padding: 0 var(--edge);
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  align-items: center;
  gap: 22px;
  pointer-events: none;
  z-index: 1;
}
footer > a {
  min-width: 0;
  font-size: 11px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
  transition: color 0.2s;
}
@media (min-width: 761px) {
  /* The panel reaches the bottom edge; the scale and credits sit to its right. */
  footer {
    transition: padding-left 0.28s var(--ease);
  }
  body.panel-open footer {
    padding-left: calc(var(--edge) + var(--panel-width) + 18px);
  }
}
@media (min-width: 761px) and (max-height: 820px) {
  .panel {
    padding: 18px 18px 14px;
  }
  .intro {
    margin: 6px 0 14px;
  }
  .stats > div {
    padding: 8px 11px 7px;
  }
  .section-label {
    margin: 16px 0 4px;
  }
  .toggle {
    min-height: 34px;
  }
  .panel-actions {
    margin-top: 14px;
  }
  .legend {
    margin-top: 14px;
  }
  .panel > .layer-help:last-child {
    display: none;
  }
}
footer > a:hover {
  color: var(--soft);
}
.scale {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.scale > span {
  width: 80px;
  height: 5px;
  border: 1px solid #ffffff8c;
  border-top: 0;
  transition: width 0.2s var(--ease);
}
.scale > b {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.private-label {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---- phones ------------------------------------------------------------------------- */
@media (max-width: 760px) {
  :root {
    --edge: 12px;
    --top: 62px;
    /* Leaves the right-hand tool column (and its close button) uncovered. */
    --panel-width: min(340px, calc(100vw - 76px));
  }
  .topbar {
    height: 56px;
  }
  .brand {
    font-size: 15px;
  }
  .brand-mark {
    width: 25px;
    height: 25px;
  }
  .connection {
    min-height: 30px;
    padding: 0 11px;
    font-size: 11.5px;
  }
  .panel {
    max-height: calc(100dvh - var(--top) - 76px);
    padding: 18px 16px 16px;
  }
  .zoom-controls {
    bottom: 70px;
  }
  footer {
    height: 52px;
    gap: 14px;
  }
  footer > a {
    font-size: 10px;
    max-width: 190px;
  }
  .private-label {
    display: none;
  }
  .empty-state {
    padding: 26px 22px 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
