:root {
  --bg: #000000;
  --panel: #050805;
  --line: #145c22;
  --ink: #d8ffc8;
  --muted: #6fbf78;
  --accent: #39ff14;
  --ransomware: #39ff14;
  --vazamento: #39ff14;
  --ataque: #39ff14;
  --map: #000000;
  --glow: 0 0 10px rgba(57, 255, 20, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Share Tech Mono", "Cascadia Mono", Consolas, monospace;
}

body {
  min-height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--line);
  background: #000;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 12px;
  text-shadow: var(--glow);
}

h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #eaffd6;
  text-shadow: var(--glow);
}

.stats {
  display: flex;
  gap: 22px;
  margin: 0;
}

.stats div { text-align: right; }

.stats dt {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stats dd {
  margin: 2px 0 0;
  font-size: 22px;
  color: var(--accent);
  text-shadow: var(--glow);
  font-variant-numeric: tabular-nums;
}

.layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  min-height: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: var(--panel);
}

.filters {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.8fr;
  gap: 8px;
}

input, select {
  width: 100%;
  background: #000;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 8px 10px;
  font: inherit;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

input:focus, select:focus {
  outline: 1px solid var(--accent);
  box-shadow: var(--glow);
}

.filters .check {
  display: flex !important;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.check input {
  width: auto;
  accent-color: var(--accent);
}

.count {
  margin: 0;
  padding: 10px 14px 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.list {
  list-style: none;
  margin: 0;
  padding: 8px;
  overflow: auto;
}

.list button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 10px;
  cursor: pointer;
  font: inherit;
}

.list button:hover,
.list button.active {
  background: #07140c;
  border-color: var(--accent);
  box-shadow: inset 0 0 12px rgba(57, 255, 20, 0.12);
}

.item-title {
  display: block;
  font-size: 14px;
  line-height: 1.35;
  color: #eaffd6;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.tag {
  border: 1px solid currentColor;
  border-radius: 0;
  padding: 0 6px;
  background: #000;
  font-weight: 400;
}

.tag.ransomware { color: var(--ransomware); }
.tag.vazamento { color: var(--vazamento); }
.tag.ataque { color: var(--ataque); }

.map-wrap {
  position: relative;
  min-height: 420px;
  background: var(--map);
}

.map-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 400;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.08) 0 1px,
      transparent 1px 4px
    ),
    radial-gradient(ellipse at center, transparent 52%, rgba(0, 0, 0, 0.28) 100%),
    radial-gradient(ellipse at 50% 0%, rgba(186, 255, 150, 0.16), transparent 42%),
    linear-gradient(rgba(57, 255, 20, 0.05), rgba(8, 24, 6, 0.1));
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, 0.55),
    inset 0 0 28px rgba(57, 255, 20, 0.16);
  animation: tubo-fallout 6.5s steps(2, end) infinite;
}

#map { height: 100%; }

.hud {
  position: absolute;
  inset: 12px;
  z-index: 450;
  pointer-events: none;
}

.hud .c {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(57, 255, 20, 0.8);
}

.hud .tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.hud .tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.hud .bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.hud .br { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.coords {
  position: absolute;
  z-index: 500;
  right: 14px;
  bottom: 36px;
  margin: 0;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid #145c22;
  color: #7dff9a;
  font-size: 12px;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.rastros {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.legend {
  position: absolute;
  z-index: 500;
  left: 14px;
  bottom: 14px;
  display: flex;
  gap: 12px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid var(--accent);
  box-shadow: var(--glow);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.legend span {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}

.legend svg {
  width: 16px;
  height: 16px;
  margin-right: 6px;
  flex: none;
}

.legend .via::before {
  content: "";
  width: 16px;
  height: 2px;
  margin-right: 6px;
  background: #2d9a45;
}

.detail {
  position: absolute;
  z-index: 600;
  top: 14px;
  right: 14px;
  width: min(360px, calc(100% - 28px));
  max-height: calc(100% - 28px);
  overflow: auto;
  padding: 16px;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid var(--accent);
  box-shadow: var(--glow);
}

.detail h2 {
  margin: 8px 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.25;
  color: #eaffd6;
}

.detail p { color: var(--ink); line-height: 1.45; }

.detail a { color: var(--accent); }

.detail .close {
  float: right;
  background: #000;
  color: var(--accent);
  border: 1px solid var(--line);
  padding: 4px 8px;
  cursor: pointer;
  font: inherit;
}

.detail .close:hover {
  border-color: var(--accent);
}

.notes {
  padding: 10px 22px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  border-top: 1px solid var(--line);
  background: #000;
}

.maplibregl-map {
  font: inherit;
  overflow: hidden;
  isolation: isolate;
  background-color: #000;
  background-image:
    repeating-radial-gradient(circle at center,
      transparent 0 78px,
      rgba(57, 255, 20, 0.16) 79px,
      transparent 81px),
    linear-gradient(rgba(57, 255, 20, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 20, 0.09) 1px, transparent 1px);
  background-size: auto, 56px 56px, 56px 56px;
}

.maplibregl-map::before,
.maplibregl-map::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  pointer-events: none;
  z-index: 2;
}

.maplibregl-map::before {
  width: 200%;
  height: 200%;
  transform: translate(-50%, -50%);
  background: conic-gradient(
    from 0deg,
    rgba(57, 255, 20, 0) 0deg,
    rgba(57, 255, 20, 0.04) 18deg,
    rgba(57, 255, 20, 0.12) 46deg,
    rgba(57, 255, 20, 0.28) 52deg,
    rgba(57, 255, 20, 0) 54deg
  );
  animation: radar-giro 5.5s linear infinite;
}

.maplibregl-map::after {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid rgba(57, 255, 20, 0.7);
  box-shadow: 0 0 18px rgba(57, 255, 20, 0.35), inset 0 0 12px rgba(57, 255, 20, 0.2);
  transform: translate(-50%, -50%) scale(0.15);
  animation: radar-pulso 3.6s ease-out infinite;
}

@keyframes radar-giro {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes radar-pulso {
  0% { transform: translate(-50%, -50%) scale(0.15); opacity: 0.9; }
  75% { opacity: 0.35; }
  100% { transform: translate(-50%, -50%) scale(7); opacity: 0; }
}

@keyframes tubo-fallout {
  0%, 91%, 100% { opacity: 1; }
  93% { opacity: 0.92; }
  96% { opacity: 0.97; }
}

@media (prefers-reduced-motion: reduce) {
  .maplibregl-map::before,
  .maplibregl-map::after,
  .map-wrap::after { animation: none; }
}

.maplibregl-ctrl-top-left,
.maplibregl-ctrl-top-right,
.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
  z-index: 5;
}

.maplibregl-ctrl-group {
  background: #000 !important;
  border: 1px solid var(--accent) !important;
  box-shadow: var(--glow);
}

.maplibregl-ctrl-group button {
  background-color: #000 !important;
  border-bottom: 1px solid var(--line);
}

.maplibregl-ctrl-icon {
  filter: invert(1) sepia(1) saturate(6) hue-rotate(70deg) brightness(1.15);
}

.maplibregl-ctrl-attrib {
  background: rgba(0, 0, 0, 0.82) !important;
  color: #6fbf78 !important;
  font-family: "Share Tech Mono", Consolas, monospace;
  font-size: 10px;
}

.maplibregl-ctrl-attrib a { color: #39ff14 !important; }

@media (max-width: 860px) {
  .topbar { display: block; }
  .stats { display: flex; margin-top: 12px; }
  .stats div { text-align: left; }
  .layout { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 42vh) minmax(280px, 1fr); }
  .map-wrap { order: -1; min-height: 260px; }
  .panel { border-right: 0; border-top: 1px solid var(--line); }
}
