:root {
  --bg: #080912;
  --bg2: #0e1020;
  --surface: rgba(18, 20, 38, 0.72);
  --surface2: rgba(24, 27, 50, 0.9);
  --border: rgba(139, 92, 246, 0.18);
  --border-strong: rgba(139, 92, 246, 0.45);
  --violet: #8b5cf6;
  --violet-soft: #a78bfa;
  --gold: #f59e0b;
  --gold-soft: #fbbf24;
  --mint: #2dd4bf;
  --text: #f1f0ff;
  --muted: #8b8ca8;
  --danger: #f87171;
  --radius: 16px;
  --font: 'DM Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.aurora {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(139,92,246,.22), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(245,158,11,.12), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(45,212,191,.08), transparent);
}
.noise {
  position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

.topbar {
  max-width: 1180px; margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 44px; height: 44px; color: var(--violet);
  background: linear-gradient(135deg, rgba(139,92,246,.2), rgba(245,158,11,.1));
  border: 1px solid var(--border); border-radius: 12px;
  display: grid; place-items: center;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 1.05rem; letter-spacing: -.02em; }
.brand-text span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }

.net-tabs { display: flex; gap: 4px; margin-left: auto; }
.net-tab {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  font-family: var(--font); font-size: .78rem; font-weight: 600; padding: 7px 14px;
  border-radius: 999px; cursor: pointer; transition: .2s;
}
.net-tab:hover { color: var(--text); }
.net-tab.on { color: var(--text); background: rgba(139,92,246,.18); border-color: var(--border-strong); }
.net-tab.testnet.on { background: rgba(245,158,11,.15); border-color: rgba(245,158,11,.35); color: var(--gold-soft); }
body.testnet-mode .aurora {
  background:
    radial-gradient(ellipse 80% 50% at 20% -10%, rgba(245,158,11,.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 10%, rgba(139,92,246,.1), transparent),
    radial-gradient(ellipse 50% 30% at 50% 100%, rgba(45,212,191,.06), transparent);
}

.nav { display: flex; gap: 6px; }
.nav a {
  text-decoration: none; color: var(--muted); font-size: .88rem; font-weight: 500;
  padding: 8px 14px; border-radius: 999px; transition: .2s;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav a.on { color: var(--text); background: rgba(139,92,246,.18); border: 1px solid var(--border); }

.live-chip {
  font-family: var(--mono); font-size: .72rem; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--muted);
}
.live-chip.on { color: var(--mint); border-color: rgba(45,212,191,.35); background: rgba(45,212,191,.08); }
.live-chip.wait { color: var(--gold); border-color: rgba(245,158,11,.3); }

.main { max-width: 1180px; margin: 0 auto; padding: 0 24px 48px; }
.page { display: none; }
.page.on { display: block; }

.hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: end;
  padding: 32px 0 28px; border-bottom: 1px solid var(--border); margin-bottom: 28px;
}
.hero.compact { grid-template-columns: 1fr; }
.eyebrow {
  font-family: var(--mono); font-size: .72rem; color: var(--violet-soft);
  text-transform: uppercase; letter-spacing: .14em; margin-bottom: 10px;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.lede { color: var(--muted); margin-top: 12px; max-width: 42ch; font-size: .95rem; }

.wallet-search label { display: block; font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.search-row { display: flex; gap: 8px; }
.wallet-search input {
  flex: 1; min-width: 0; padding: 14px 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface2);
  color: var(--text); font-family: var(--mono); font-size: .82rem;
  outline: none; transition: .2s;
}
.wallet-search input:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(139,92,246,.15); }
.wallet-search button {
  padding: 14px 22px; border: none; border-radius: 12px; cursor: pointer;
  background: linear-gradient(135deg, var(--violet), #6d28d9);
  color: white; font-weight: 600; font-size: .88rem; white-space: nowrap;
}
.wallet-search button:hover { filter: brightness(1.08); }

.hero-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px;
}
.metric-card {
  background: var(--surface); backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
}
.metric-card .label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.metric-card .value { font-size: 1.55rem; font-weight: 700; margin-top: 8px; letter-spacing: -.02em; }
.metric-card .sub { font-size: .72rem; color: var(--muted); margin-top: 6px; font-family: var(--mono); }
.metric-card.accent .value { color: var(--violet-soft); }
.metric-card.gold .value { color: var(--gold-soft); }
.metric-card.mint .value { color: var(--mint); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }

.panel {
  background: var(--surface); backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 18px; overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: .92rem; font-weight: 600; }
.pill {
  font-family: var(--mono); font-size: .72rem; padding: 4px 10px;
  border-radius: 999px; background: rgba(139,92,246,.15); color: var(--violet-soft);
}
.pill.muted-pill { background: rgba(255,255,255,.06); color: var(--muted); }
.panel-body { padding: 4px 0; }

.hashrate-compare { padding: 20px; }
.hr-bar-group { margin-bottom: 18px; }
.hr-bar-group:last-child { margin-bottom: 0; }
.hr-bar-top { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 8px; }
.hr-bar-top span:last-child { font-family: var(--mono); color: var(--violet-soft); }
.hr-track { height: 10px; background: rgba(255,255,255,.06); border-radius: 999px; overflow: hidden; }
.hr-fill { height: 100%; border-radius: 999px; transition: width .6s ease; }
.hr-fill.pool { background: linear-gradient(90deg, var(--violet), var(--violet-soft)); }
.hr-fill.net { background: linear-gradient(90deg, #334155, #64748b); width: 100% !important; }

.network-facts { padding: 12px 20px 20px; }
.fact-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.04); font-size: .88rem;
}
.fact-row:last-child { border-bottom: none; }
.fact-row span:first-child { color: var(--muted); }
.fact-row span:last-child { font-family: var(--mono); font-size: .8rem; }

table { width: 100%; border-collapse: collapse; font-size: .84rem; }
th {
  text-align: left; padding: 10px 20px; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); font-weight: 500;
}
td { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,.04); }
tr:hover td { background: rgba(139,92,246,.04); }
.right { text-align: right; }
.mono { font-family: var(--mono); font-size: .78rem; }
.muted { color: var(--muted); }
.violet { color: var(--violet-soft); }
.gold { color: var(--gold-soft); }
.mint { color: var(--mint); }

.status {
  display: inline-flex; align-items: center; gap: 6px; font-size: .78rem;
  padding: 4px 10px; border-radius: 999px;
}
.status.online { background: rgba(45,212,191,.12); color: var(--mint); }
.status.offline { background: rgba(255,255,255,.05); color: var(--muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.empty { padding: 28px 20px; color: var(--muted); text-align: center; font-size: .88rem; }

.miner-hero { padding: 24px 0 8px; }
.miner-hero h1 { font-family: var(--mono); font-size: 1rem; font-weight: 500; color: var(--violet-soft); word-break: break-all; }

.miner-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px;
}

.code-block {
  font-family: var(--mono); font-size: .76rem; line-height: 1.7; color: var(--mint);
  white-space: pre-wrap; word-break: break-all; margin-bottom: 16px;
}
.btn-primary {
  display: inline-block; padding: 12px 20px; border-radius: 10px; text-decoration: none;
  background: linear-gradient(135deg, var(--gold), #d97706); color: #1a1000; font-weight: 600; font-size: .88rem;
}
.btn-primary:hover { filter: brightness(1.05); }

.wallet-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 16px 20px 20px;
}
.wallet-card {
  padding: 16px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--border);
}
.wallet-card .role { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.wallet-card .addr { font-family: var(--mono); font-size: .68rem; margin-top: 8px; word-break: break-all; color: var(--text); line-height: 1.5; }

.foot {
  max-width: 1180px; margin: 0 auto; padding: 24px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: .78rem; color: var(--muted); border-top: 1px solid var(--border);
}
.foot a { color: var(--violet-soft); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

a.table-link { color: var(--violet-soft); text-decoration: none; }
a.table-link:hover { text-decoration: underline; }

@media (max-width: 900px) {
  .hero, .grid-2, .hero-metrics, .miner-stats, .wallet-cards { grid-template-columns: 1fr; }
  .net-tabs { margin-left: 0; order: 2; width: 100%; }
  .nav { order: 3; width: 100%; }
}
