/* Attack Radar — Beacon theme (ink-slate / indigo / emerald) */
:root {
  --bg: #0c0e13;
  --bg-2: #12151d;
  --panel: #141824;
  --panel-2: #1a1f2e;
  --line: #232838;
  --ink: #e8ecf6;
  --muted: #8b93a7;
  --brand: #6f78ff;
  --brand-2: #9aa2ff;
  --online: #33d1a3;
  --warn: #f2b03d;
  --fault: #ff5d78;
  --crit: #ff3860;
  --display: 'Sora', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(1200px 700px at 70% -10%, #161b2b 0%, var(--bg) 55%) fixed;
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
}

.app { height: 100vh; display: flex; flex-direction: column; }

/* ---- Header ---- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(20,24,36,.85), rgba(12,14,19,.4));
  backdrop-filter: blur(6px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-text h1 {
  margin: 0; font-family: var(--display); font-weight: 700;
  letter-spacing: .12em; font-size: 20px;
}
.brand-text p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.beacon { position: relative; width: 34px; height: 34px; display: grid; place-items: center; }
.beacon-node {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); box-shadow: 0 0 14px var(--brand);
  z-index: 2;
}
.beacon-scan {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--brand);
  animation: ping 2s cubic-bezier(0,.2,.8,1) infinite;
}
@keyframes ping { 0% { transform: scale(.35); opacity: .9; } 100% { transform: scale(1.15); opacity: 0; } }

.status { display: flex; align-items: center; gap: 22px; }
.threat { display: grid; gap: 4px; min-width: 180px; }
.threat-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.threat-value { font-family: var(--display); font-weight: 700; font-size: 16px; }
.threat-bar { height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.threat-bar i {
  display: block; height: 100%; width: 10%;
  background: linear-gradient(90deg, var(--online), var(--warn) 55%, var(--crit));
  transition: width .5s ease;
}
.live { display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 12px; color: var(--online); letter-spacing: .1em; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--online); box-shadow: 0 0 10px var(--online); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .3; } }
.clock { font-family: var(--mono); font-size: 15px; color: var(--brand-2); }
.manage-link {
  font-size: 12px; color: var(--brand-2); text-decoration: none;
  border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; white-space: nowrap;
}
.manage-link:hover { border-color: var(--brand); }
.node-list-title { margin-bottom: 2px; }
.node-card .node-head .st { margin-left: auto; font-size: 10px; font-family: var(--mono); padding: 1px 7px; border-radius: 20px; letter-spacing: 0; }
.node-card .st.up { color: var(--online); background: rgba(51,209,163,.14); }
.node-card .st.down { color: var(--crit); background: rgba(255,56,96,.16); }
.node-card .st.unknown { color: var(--muted); background: var(--panel-2); }

/* ---- Stage ---- */
.stage { flex: 1; display: grid; grid-template-columns: 260px 1fr 300px; min-height: 0; }
.panel { padding: 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.panel.left { border-right: 1px solid var(--line); }
.panel.right { border-left: 1px solid var(--line); }
.panel::-webkit-scrollbar { width: 8px; }
.panel::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; display: grid; gap: 2px;
}
.stat-num { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: 1; }
.stat-cap { color: var(--muted); font-size: 12px; }
.stat.ok .stat-num { color: var(--online); }
.stat.bad .stat-num { color: var(--crit); }

.node-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.node-card.hit { border-color: var(--crit); box-shadow: 0 0 0 1px var(--crit), 0 0 18px rgba(255,56,96,.25); }
.node-head { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; font-size: 13px; letter-spacing: .08em; }
.node-head .ico { font-size: 15px; }
.node-ip { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0; }
.hp { height: 7px; border-radius: 6px; background: var(--panel-2); overflow: hidden; margin: 9px 0 6px; }
.hp i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--online), var(--brand)); transition: width .35s ease, background .35s; }
.node-meta { font-size: 12px; color: var(--muted); }
.node-meta .crit { color: var(--crit); font-weight: 600; }

.breakdown, .top-src { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.bd-title, .feed-title { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; margin-bottom: 7px; font-size: 12px; }
.bar-row .track { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; background: var(--brand); transition: width .4s ease; }
.bar-row .n { font-family: var(--mono); color: var(--muted); }

/* ---- Map ---- */
.map-wrap { position: relative; min-height: 0; }
#map { width: 100%; height: 100%; display: block; }
.map-legend {
  position: absolute; left: 16px; bottom: 14px; display: flex; gap: 16px;
  font-size: 12px; color: var(--muted); background: rgba(12,14,19,.55);
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px; backdrop-filter: blur(4px);
}
.map-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.sw.blocked { background: var(--online); box-shadow: 0 0 8px var(--online); }
.sw.breached { background: var(--crit); box-shadow: 0 0 8px var(--crit); }
.sw.home { background: var(--brand); box-shadow: 0 0 8px var(--brand); }

/* ---- Feed ---- */
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow: hidden; }
.feed li {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-left-width: 3px;
  border-radius: 9px; padding: 7px 10px; font-size: 12px;
  animation: slideIn .3s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } }
.feed li.blocked { border-left-color: var(--online); }
.feed li.breached { border-left-color: var(--crit); }
.feed .flag { font-size: 15px; }
.feed .info { min-width: 0; }
.feed .info b { font-weight: 600; }
.feed .info .sub { color: var(--muted); font-family: var(--mono); font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed .tag { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.feed .tag.blocked { color: var(--online); background: rgba(51,209,163,.12); }
.feed .tag.breached { color: var(--crit); background: rgba(255,56,96,.14); }

.src-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; }
.src-row .n { font-family: var(--mono); color: var(--muted); }

@media (max-width: 1100px) {
  .stage { grid-template-columns: 210px 1fr; }
  .panel.right { display: none; }
}
