:root {
  --bg: #05070a;
  --panel: #080d12;
  --panel-2: #0a1117;
  --line: rgba(124, 245, 196, 0.12);
  --line-soft: rgba(207, 227, 227, 0.07);
  --text: #cfe3e3;
  --muted: #5d7576;
  --dim: #41565a;
  --accent: #7cf5c4;
  --amber: #ffb454;
  --red: #ff6b5e;
  --cyan: #67d8ff;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "IBM Plex Mono", Menlo,
    Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
}

a {
  color: var(--muted);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

.app {
  position: relative;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(1200px 600px at 30% 10%, rgba(20, 70, 60, 0.16), transparent 60%),
    var(--bg);
}

.app::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.022) 0 1px,
    transparent 1px 3px
  );
  opacity: 0.5;
  z-index: 40;
}

/* hud ------------------------------------------------------------------ */

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 7, 10, 0.72);
  backdrop-filter: blur(6px);
  z-index: 20;
}

.hud__group {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hud__title {
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--text);
  white-space: nowrap;
}

.hud__label {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--accent);
  white-space: nowrap;
}

.hud__dim {
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
}

.hud__group--clock {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  border: 1px solid rgba(124, 245, 196, 0.3);
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.2em;
  white-space: nowrap;
}

.live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: blink 2s steps(1) infinite;
}

.live.is-down {
  border-color: rgba(255, 107, 94, 0.4);
  color: var(--red);
}

.live.is-down i {
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: none;
}

.live.is-warn {
  border-color: rgba(255, 180, 84, 0.4);
  color: var(--amber);
}

.live.is-warn i {
  background: var(--amber);
  box-shadow: 0 0 10px var(--amber);
}

.chip {
  padding: 2px 7px;
  border: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.chip--demo {
  border-color: rgba(255, 180, 84, 0.4);
  color: var(--amber);
}

@keyframes blink {
  50% {
    opacity: 0.25;
  }
}

/* stage ---------------------------------------------------------------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(350px, 1fr);
  min-height: 0;
}

.globe {
  position: relative;
  min-height: 0;
  overflow: hidden;
}

#globe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

#globe:active {
  cursor: grabbing;
}

.globe__vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, transparent 42%, rgba(5, 7, 10, 0.55) 78%, var(--bg) 100%),
    linear-gradient(to right, transparent 80%, rgba(5, 7, 10, 0.65));
}

.globe__hint {
  position: absolute;
  left: 20px;
  bottom: 18px;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--dim);
  text-transform: uppercase;
  pointer-events: none;
}

.globe__legend {
  position: absolute;
  right: 20px;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--dim);
  text-transform: uppercase;
  pointer-events: none;
}

.globe__legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  justify-content: flex-end;
}

.legend-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.legend-dot--hit {
  background: var(--amber);
  box-shadow: 0 0 8px var(--amber);
}

.legend-dot--node {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.globe__count {
  position: absolute;
  left: 22px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}

.globe__count b {
  font-size: clamp(30px, 4.2vw, 54px);
  font-weight: 500;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.globe__count span {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--dim);
  text-transform: uppercase;
}

/* side panel ----------------------------------------------------------- */

.side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: linear-gradient(to bottom, rgba(8, 13, 18, 0.75), rgba(5, 7, 10, 0.9));
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.stat {
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.stat:nth-child(2n) {
  border-right: 0;
}

.stat:nth-child(n + 3) {
  border-bottom: 0;
}

.stat span {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.stat b {
  font-size: 20px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.stat--rate {
  position: relative;
}

#spark {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 66px;
  height: 22px;
  opacity: 0.7;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.feed {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 4px 0;
  mask-image: linear-gradient(to bottom, #000 82%, transparent);
}

.row {
  display: grid;
  grid-template-columns: 58px 24px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  padding: 4px 14px;
  font-size: 11px;
  border-left: 2px solid transparent;
  animation: row-in 0.4s ease both;
}

.row + .row {
  border-top: 1px solid rgba(207, 227, 227, 0.035);
}

.row__time {
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.row__cc {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.row__body {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
}

.row__body b {
  color: var(--text);
  font-weight: 500;
}

.row__body .pw {
  color: var(--red);
}

.row__body .ip {
  color: var(--muted);
}

.row__body code {
  color: var(--cyan);
  font-family: inherit;
  font-size: 10.5px;
}

.row__body .url {
  color: var(--amber);
}

.row--auth_ok {
  border-left-color: var(--accent);
  background: rgba(124, 245, 196, 0.035);
}

.row--auth_ok .row__body b {
  color: var(--accent);
}

.row--cmd {
  border-left-color: rgba(103, 216, 255, 0.55);
}

.row--payload {
  border-left-color: var(--amber);
  background: rgba(255, 180, 84, 0.04);
}

.row--alert {
  background: rgba(255, 180, 84, 0.09);
}

.row__tag {
  color: var(--dim);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.feed__empty {
  padding: 26px 16px;
  color: var(--dim);
  font-size: 11px;
  line-height: 1.7;
}

.feed__empty b {
  display: block;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 4px;
}

@keyframes row-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

/* tops ----------------------------------------------------------------- */

.tops {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}

.top {
  min-width: 0;
}

.top__head {
  display: block;
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
  margin-bottom: 6px;
}

.top__list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.top__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  font-size: 10px;
  color: var(--muted);
}

.top__row span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.top__row b {
  color: var(--dim);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.top__bar {
  height: 2px;
  grid-column: 1 / -1;
  background: rgba(207, 227, 227, 0.06);
  position: relative;
}

.top__bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  opacity: 0.55;
}

/* footer --------------------------------------------------------------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 18px;
  border-top: 1px solid var(--line);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  color: var(--dim);
  background: rgba(5, 7, 10, 0.8);
}

.foot__sep {
  margin: 0 6px;
  opacity: 0.5;
}

/* responsive ----------------------------------------------------------- */

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app {
    height: auto;
    min-height: 100dvh;
    grid-template-rows: auto auto auto;
  }

  .hud {
    padding: 8px 12px;
  }

  .hud__group--node {
    display: none;
  }

  .hud__title {
    letter-spacing: 0.18em;
  }

  .stage {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(340px, 52vh) auto;
  }

  .globe {
    min-height: 340px;
    border-bottom: 1px solid var(--line);
  }

  .side {
    border-left: 0;
  }

  .feed {
    max-height: 46vh;
    overflow: auto;
  }

  .tops {
    display: none;
  }

  .foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 560px) {
  .row {
    grid-template-columns: 52px 20px minmax(0, 1fr);
    gap: 6px;
    padding: 4px 10px;
    font-size: 10.5px;
  }

  .stats {
    grid-template-columns: 1fr 1fr;
  }

  .stat {
    padding: 9px 11px;
  }

  .stat b {
    font-size: 17px;
  }

  #spark {
    display: none;
  }

  .globe__count b {
    font-size: 34px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .app::after,
  .live i {
    animation: none;
  }

  .row {
    animation: none;
  }
}
