:root {
  --bg-a: #051019;
  --bg-b: #122438;
  --ink: #d9f6ff;
  --muted: #8db6c5;
  --accent: #f6ba35;
  --tab-bg: rgba(6, 22, 36, 0.8);
  --tab-active: rgba(246, 186, 53, 0.2);
  --card: rgba(2, 11, 19, 0.94);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 15% 10%, #1a3550, transparent 45%),
              radial-gradient(circle at 80% 80%, #224445, transparent 40%),
              linear-gradient(130deg, var(--bg-a), var(--bg-b));
  overflow: hidden;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background-image: repeating-radial-gradient(circle at 0 0, transparent 0, #fff 2px, transparent 3px);
  animation: grain 3s steps(4) infinite;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 14px;
}

.top-banner {
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.02em;
  color: #ffd772;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(246, 186, 53, 0.25);
  border-radius: 999px;
  padding: 6px 10px;
}

.tabs-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  border: 1px solid rgba(180, 220, 234, 0.25);
  background: var(--tab-bg);
  color: var(--ink);
  font: 600 12px 'IBM Plex Mono', monospace;
  padding: 7px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.tab.active {
  border-color: rgba(246, 186, 53, 0.7);
  background: var(--tab-active);
}

main { height: 100%; padding-top: 92px; }

#bubbleCanvas {
  display: block;
  width: 100%;
  height: calc(100% - 92px);
}

.status {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  font: 500 12px 'IBM Plex Mono', monospace;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  padding: 6px 10px;
}

.hover-card {
  position: fixed;
  z-index: 15;
  pointer-events: none;
  min-width: 180px;
  max-width: 260px;
  background: rgba(2, 11, 19, 0.96);
  border: 1px solid rgba(183, 219, 232, 0.24);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.35;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.hover-card .sym {
  font: 700 13px 'IBM Plex Mono', monospace;
  margin-bottom: 2px;
}

.hover-card .name {
  color: var(--muted);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  z-index: 20;
}

.hidden { display: none; }

.modal {
  width: min(92vw, 560px);
  background: var(--card);
  border: 1px solid rgba(183, 219, 232, 0.18);
  border-radius: 14px;
  padding: 16px;
  position: relative;
}

.modal h2 { margin: 0 0 8px; }
.modal-stats {
  margin-bottom: 10px;
  color: var(--muted);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  font-size: 13px;
}

.modal-close {
  position: absolute;
  right: 8px;
  top: 8px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-4px, 2px); }
  100% { transform: translate(0, 0); }
}

@media (max-width: 860px) {
  header { padding: 8px; }
  main { padding-top: 122px; }
  #bubbleCanvas { height: calc(100% - 122px); }
}
