:root {
  color-scheme: dark;
  --bg: #070a12;
  --surface: #101722;
  --surface-soft: #0c121b;
  --text: #e6edf7;
  --muted: #8a9ab0;
  --line: #223044;
  --accent: #2dd4bf;
  --accent-strong: #67e8f9;
  --success: #34d399;
  --warning: #fbbf24;
  --danger: #f43f5e;
  --shadow: 0 20px 42px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 12% 0%, rgba(45, 212, 191, 0.14), transparent 28rem),
    radial-gradient(circle at 86% 8%, rgba(99, 102, 241, 0.13), transparent 24rem),
    linear-gradient(180deg, #090d17 0%, var(--bg) 44%, #05070c 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(16px, 4vw, 42px);
  background: rgba(6, 10, 18, 0.88);
  color: var(--text);
  border-bottom: 1px solid rgba(103, 232, 249, 0.22);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: #07111d;
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.22), 0 0 28px rgba(45, 212, 191, 0.18);
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.86rem;
}

.network-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  border-radius: 999px;
  background: rgba(16, 23, 34, 0.84);
  color: #cffafe;
  font-size: 0.9rem;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14), 0 0 16px rgba(52, 211, 153, 0.65);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 48px;
}

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

.stat-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat-card {
  min-height: 122px;
  padding: 18px;
  background:
    linear-gradient(145deg, rgba(45, 212, 191, 0.07), transparent 44%),
    var(--surface);
}

.stat-card span,
.stat-card small,
.row span,
.panel-header span {
  color: var(--muted);
}

.stat-card span {
  display: block;
  margin-bottom: 12px;
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: #f8fbff;
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.15;
}

.stat-card small {
  display: block;
  margin-top: 8px;
}

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  margin-bottom: 18px;
  overflow-x: auto;
  background: rgba(12, 18, 27, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.tab {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.tab:hover {
  background: rgba(45, 212, 191, 0.08);
  color: #c8f7ef;
}

.tab.active {
  background: linear-gradient(180deg, rgba(45, 212, 191, 0.18), rgba(45, 212, 191, 0.07));
  color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(103, 232, 249, 0.24), 0 10px 24px rgba(0, 0, 0, 0.18);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 18px;
}

#founders.active,
#mempool.active,
#blocks.active,
#miner.active {
  grid-template-columns: 1fr;
}

.panel {
  min-width: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 16rem),
    var(--surface);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #121b29, var(--surface-soft));
}

.panel-header h2 {
  margin: 0;
  color: #f8fbff;
  font-size: 1rem;
}

.chart-wrap {
  height: 360px;
  padding: 18px;
}

.list {
  display: grid;
  gap: 0;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.01);
}

.row:last-child {
  border-bottom: 0;
}

.row div {
  min-width: 0;
}

.row strong,
.row span {
  display: block;
}

.row strong {
  overflow-wrap: anywhere;
  color: #eef6ff;
}

.row span {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 0.9rem;
}

.row b {
  flex: 0 0 auto;
  color: var(--success);
  font-size: 0.95rem;
  white-space: nowrap;
}

.block-row b {
  color: var(--warning);
}

.empty {
  min-height: 120px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.miner-panel {
  overflow: hidden;
  background: #050907;
  border: 1px solid #1e4d42;
  border-radius: 8px;
  box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(69, 242, 143, 0.08);
  color: #d8ffe9;
}

.miner-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 16px 18px;
  background: #0d1914;
  border-bottom: 1px solid #1f3b32;
}

.miner-topbar h2 {
  margin: 0;
  color: #f1fff7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1rem;
  letter-spacing: 0;
}

.miner-topbar span,
.miner-stats span {
  color: #79a991;
}

.miner-leds {
  display: flex;
  gap: 8px;
}

.miner-leds span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #45f28f;
  box-shadow: 0 0 14px rgba(69, 242, 143, 0.8);
  animation: minerPulse 1.2s infinite alternate;
}

.miner-leds span:nth-child(2) {
  animation-delay: 0.25s;
}

.miner-leds span:nth-child(3) {
  animation-delay: 0.5s;
}

.miner-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #1f3b32;
}

.miner-stats div {
  min-height: 92px;
  padding: 16px 18px;
  border-right: 1px solid #1f3b32;
}

.miner-stats div:last-child {
  border-right: 0;
}

.miner-stats span,
.miner-stats strong {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.miner-stats span {
  margin-bottom: 12px;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.miner-stats strong {
  overflow-wrap: anywhere;
  color: #45f28f;
  font-size: clamp(1rem, 2vw, 1.45rem);
}

.miner-stream {
  height: min(56vh, 520px);
  min-height: 360px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  background:
    linear-gradient(rgba(69, 242, 143, 0.045) 50%, transparent 50%) 0 0 / 100% 8px,
    radial-gradient(circle at 20% 0%, rgba(47, 128, 237, 0.18), transparent 28%),
    #050907;
  color: #45f28f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(0.72rem, 1.45vw, 0.95rem);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-shadow: 0 0 8px rgba(69, 242, 143, 0.35);
}

@keyframes minerPulse {
  from {
    opacity: 0.35;
    transform: scale(0.86);
  }

  to {
    opacity: 1;
    transform: scale(1.1);
  }
}

@media (max-width: 820px) {
  .app-header,
  .row {
    align-items: flex-start;
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tab-panel.active {
    grid-template-columns: 1fr;
  }

  .chart-wrap {
    height: 300px;
  }

  .miner-topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .miner-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .miner-stats div:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
    margin-top: 14px;
  }

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

  .stat-card {
    min-height: 104px;
  }

  .tab {
    flex: 1 0 auto;
    padding: 0 14px;
  }

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

  .miner-stats div {
    border-right: 0;
  }
}
