/* $VIRUS — dark lab dashboard. Charcoal canvas instead of bright paper.
   White-ish text + hairline white-grey UI details + deep green virus
   accents. Same clinical/scientific vibe but easier on the eyes. */
:root {
  --bg-0: #0a0e0f;          /* page (deep charcoal) */
  --bg-1: #131819;          /* cards */
  --bg-2: #1a1f20;          /* nested */
  --ink: #e8eaed;           /* primary text — off-white */
  --ink-2: #b0b6ba;         /* secondary text */
  --ink-3: #6b7280;         /* muted */
  --green: #22c55e;
  --green-bright: #4ade80;
  --green-deep: #15803d;
  --green-glow: rgba(34, 197, 94, 0.45);
  --hairline: #262d2f;
  --hairline-2: #353d40;
  --warn: #b91c1c;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);

  --font-display: "Orbitron", "Inter", sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg-0); }
body {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle blueprint grid + paper-grain dots, but DARK */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    /* Fine grid like graph paper, white-grey on dark */
    repeating-linear-gradient(0deg,  transparent 0 39px, rgba(255,255,255,0.035) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,0.035) 39px 40px),
    /* Paper grain — micro speckle */
    radial-gradient(circle, rgba(255,255,255,0.05) 0.5px, transparent 1px);
  background-size: 40px 40px, 40px 40px, 6px 6px;
}
.bg-glow {
  position: fixed; inset: -10%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 700px 500px at 50% 35%, rgba(34, 197, 94, 0.10), transparent 60%),
    radial-gradient(ellipse 500px 400px at 20% 80%, rgba(34, 197, 94, 0.06), transparent 60%);
  filter: blur(50px);
}

.topbar, .main { position: relative; z-index: 2; }

/* ─── Topbar ───────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(15, 18, 19, 0.80);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  position: sticky; top: 0; z-index: 20;
  box-shadow: 0 1px 0 rgba(255,255,255,0.04);
}
.topbar-brand {
  font-family: var(--font-display);
  font-weight: 900; font-size: 18px;
  color: var(--ink);
  letter-spacing: 0.18em;
}
.topbar-brand::before {
  content: "● ";
  color: var(--green);
  text-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}
.ca-link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--green-bright);
  text-decoration: none;
  padding: 6px 14px;
  border: 1px solid var(--green-deep, rgba(34, 197, 94, 0.45));
  border-radius: 5px;
  background: rgba(34, 197, 94, 0.07);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.06);
  transition: all 0.18s ease;
  /* Full CA address can be 44 chars — keep it on one line */
  white-space: nowrap;
}
.ca-link:hover {
  border-color: var(--green);
  color: var(--green-bright);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

/* ─── Layout ─────────────────────────────────────── */
.main {
  max-width: 1900px;
  margin: 0 auto;
  padding: 36px 28px 60px;
  display: flex; flex-direction: column;
  gap: 36px;
}

/* ─── Hero ─────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 480px 1fr;
  gap: 50px;
  align-items: center;
  min-height: 460px;
  padding: 30px 0;
}
.virus-stage {
  position: relative;
  width: 480px; height: 480px;
  display: flex; align-items: center; justify-content: center;
}
@keyframes virus-breathe {
  0%,100% { transform: scale(1);
            filter: drop-shadow(0 0 50px rgba(34, 197, 94, 0.55))
                    drop-shadow(0 0 100px rgba(34, 197, 94, 0.30)); }
  50%     { transform: scale(1.05);
            filter: drop-shadow(0 0 80px rgba(34, 197, 94, 0.85))
                    drop-shadow(0 0 140px rgba(34, 197, 94, 0.45)); }
}
@keyframes virus-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
.virus-img {
  position: relative; z-index: 2;
  width: 380px; height: 380px;
  object-fit: contain;
  animation: virus-breathe 4s ease-in-out infinite, virus-spin 80s linear infinite;
  pointer-events: none;
}
.virus-img.flash {
  animation: virus-flash 0.6s ease-out, virus-breathe 4s ease-in-out infinite, virus-spin 80s linear infinite;
}
@keyframes virus-flash {
  0%   { filter: drop-shadow(0 0 100px rgba(255,255,255,0.95)) brightness(1.7); }
  100% { filter: drop-shadow(0 0 50px rgba(34, 197, 94, 0.55)); }
}
.virus-rings { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.ring {
  position: absolute;
  border: 2px solid var(--green);
  border-radius: 50%;
  opacity: 0;
  animation: ring-radiate 4s ease-out infinite;
}
.ring.r1 { width: 380px; height: 380px; animation-delay: 0s;   }
.ring.r2 { width: 380px; height: 380px; animation-delay: 1.3s; }
.ring.r3 { width: 380px; height: 380px; animation-delay: 2.6s; }
@keyframes ring-radiate {
  0%   { transform: scale(0.85); opacity: 0.55; border-width: 2px; }
  100% { transform: scale(1.7); opacity: 0;    border-width: 0.5px; }
}

.hero-stats { display: flex; flex-direction: column; gap: 24px; }
.hero-counter { display: flex; flex-direction: column; line-height: 0.95; }
.hero-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 110px;
  color: var(--ink);
  text-shadow:
    0 0 30px rgba(34, 197, 94, 0.55),
    0 0 70px rgba(34, 197, 94, 0.25);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
@keyframes counter-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); color: #fff; text-shadow: 0 0 70px rgba(74, 222, 128, 0.95); }
  100% { transform: scale(1); }
}
.hero-num.pulse-bump { animation: counter-pulse 0.55s ease-out; }
.hero-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--green);
  letter-spacing: 0.36em;
  margin-top: 16px;
  text-shadow: 0 0 12px rgba(34, 197, 94, 0.45);
}
.hero-substats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 28px;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 16px 0;
}
.sub { display: flex; flex-direction: column; gap: 2px; }
.sub-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.sub-lab {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: 0.22em;
}
.hero-tag {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
  letter-spacing: 0.18em;
}

/* ─── Map ─────────────────────────────────────── */
.map {
  position: relative;
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 16px 20px 22px;
  box-shadow: var(--shadow);
}
.map-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 14px;
  color: var(--ink);
  letter-spacing: 0.22em;
  margin: 0;
}
.section-title::before {
  content: "▮ ";
  color: var(--green);
}
.map-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}
.map-hint {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  margin-left: 14px;
}
#virus-canvas {
  width: 100%; height: 500px;
  display: block;
  background: radial-gradient(ellipse at center, #0e1314 0%, #060a0b 80%);
  border-radius: 10px;
  border: 1px solid var(--hairline);
}

/* ─── Map row: side panels flank canvas (3-col grid) ─── */
.map-row {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 20px;
  align-items: start;
}
.recent-card, .info-card {
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 18px 22px 20px;
  box-shadow: var(--shadow);
}
.panel-col {
  /* Side panels MUST match map height exactly — not just a min. With
     min-height alone, a long recent list would grow the panel past the
     map. height: pins the box so .recent-list flex-scrolls inside it. */
  height: 568px;
  min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.info-blurb {
  margin: 10px 0 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}
.info-blurb:first-of-type { margin-top: 14px; }
.recent-list {
  margin-top: 12px;
  /* Fill the rest of the panel column (panel-col is flex container) so
     short lists don't leave a big empty gap below. Scroll kicks in
     automatically once content exceeds the available height. */
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  /* Firefox scrollbar styling — match the dark theme. */
  scrollbar-color: var(--hairline-2) transparent;
  scrollbar-width: thin;
}
.recent-list::-webkit-scrollbar { width: 4px; }
.recent-list::-webkit-scrollbar-thumb {
  background: var(--hairline-2); border-radius: 2px;
}
.recent-empty {
  padding: 20px 4px; color: var(--ink-3); font-style: italic; text-align: center;
}
@keyframes recent-pop {
  from { opacity: 0; transform: translateX(-10px); background: rgba(34, 197, 94, 0.18); }
  to   { opacity: 1; transform: translateX(0); background: transparent; }
}
.recent-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px dashed var(--hairline);
  animation: recent-pop 0.5s ease-out;
}
.recent-row:last-child { border-bottom: none; }
.recent-pubkey {
  color: var(--green-bright); cursor: pointer; text-decoration: none; font-weight: 500;
}
.recent-pubkey:hover { text-decoration: underline; color: #6ef090; }
.recent-amount { color: var(--ink); font-weight: 500; }
.recent-time { color: var(--ink-3); font-size: 10px; }

.info-steps {
  list-style: none; padding: 0; margin: 10px 0 0 0;
  counter-reset: step;
  display: flex; flex-direction: column; gap: 9px;
}
.info-steps li {
  counter-increment: step;
  position: relative;
  padding: 6px 6px 6px 36px;
  font-size: 13px; color: var(--ink-2);
  line-height: 1.5;
  border-left: 2px solid var(--hairline);
}
.info-steps li::before {
  content: counter(step);
  position: absolute; left: 6px; top: 7px;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--green-deep);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 10px; font-weight: 700;
  color: var(--green-bright);
  background: rgba(34, 197, 94, 0.07);
}
.info-steps li b { color: var(--green-bright); font-weight: 700; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; gap: 30px; text-align: center; min-height: auto; padding: 16px 0; }
  .virus-stage { width: 340px; height: 340px; margin: 0 auto; }
  .virus-img { width: 280px; height: 280px; }
  .ring.r1, .ring.r2, .ring.r3 { width: 280px; height: 280px; }
  .hero-num { font-size: 80px; }
  .hero-stats { align-items: center; }
  .hero-substats { width: 100%; max-width: 460px; }
}
/* Below this width side panels would crush the map — fall back
   to a single column stack. */
@media (max-width: 1280px) {
  .map-row { grid-template-columns: 1fr; }
  .panel-col { min-height: 0; }
}
@media (max-width: 720px) {
  .main { padding: 20px 14px 40px; gap: 26px; }
  .virus-stage { width: 240px; height: 240px; }
  .virus-img { width: 200px; height: 200px; }
  .ring.r1, .ring.r2, .ring.r3 { width: 200px; height: 200px; }
  .hero-num { font-size: 60px; }
}
