:root {
  --bg-base:      #0B0F14;
  --bg-surface:   #0F1623;
  --bg-card:      #141D2B;
  --bg-elevated:  #1A2438;
  --bg-hover:     rgba(255,255,255,0.04);

  --border:        rgba(255,255,255,0.07);
  --border-medium: rgba(255,255,255,0.10);

  --text-primary:   #E2E8F0;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;

  --accent:        #F97316;
  --accent-light:  #FB923C;
  --accent-dim:    rgba(249,115,22,0.10);

  --success:      #22C55E;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;

  --transition: 150ms ease;
}

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

html { font-size: 14px; }

body {
  background: var(--bg-base);
  background-image: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(249,115,22,0.05) 0%, transparent 60%);
  color: var(--text-primary);
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 0.875rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 99px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.app { max-width: 1280px; margin: 0 auto; padding: 0 24px 48px; }

/* ── Topbar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 1.05rem; }
.brand-emoji { font-size: 1.3rem; }

.live-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.78rem; color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 99px;
}
.live-badge--inline { padding: 3px 10px; }
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success);
  animation: pulse 1.6s ease-in-out infinite;
}

/* ── Top cards ── */
.top-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 860px) { .top-cards { grid-template-columns: 1fr; } }

.top-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.top-card-left { display: flex; flex-direction: column; gap: 4px; }
.top-card-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.top-card-rank { color: var(--text-muted); font-weight: 500; font-size: 0.8rem; }
.top-card-sub { color: var(--text-muted); font-size: 0.78rem; }
.top-card-online { font-size: 1.8rem; font-weight: 700; text-align: right; }

/* ── Card shell ── */
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px 20px; margin-bottom: 20px;
}

/* ── Compare card ── */
.compare-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px;
}
.compare-title { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.compare-subtitle { color: var(--text-muted); font-size: 0.76rem; margin-top: 3px; }
.compare-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.range-switch { display: flex; background: var(--bg-elevated); border-radius: var(--radius); padding: 3px; gap: 2px; }
.range-switch button {
  background: transparent; border: none; color: var(--text-secondary);
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: 0.8rem; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.range-switch button:hover { color: var(--text-primary); }
.range-switch button.active { background: var(--accent); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--border-medium); border-radius: 99px;
  padding: 6px 13px; font-size: 0.8rem; color: var(--text-secondary);
  cursor: pointer; background: var(--bg-elevated);
  transition: border-color var(--transition), color var(--transition);
}
.chip:hover { color: var(--text-primary); }
.chip.active { color: var(--text-primary); border-color: var(--chip-color, var(--accent)); }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--chip-color, var(--accent)); }

.chart-wrap { position: relative; height: 320px; }

.chart-legend {
  display: flex; flex-wrap: wrap; gap: 18px; justify-content: center;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 0.82rem; color: var(--text-secondary); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.legend-value { font-weight: 700; color: var(--text-primary); }

/* ── Table ── */
.table-card-head { font-weight: 600; margin-bottom: 12px; }
.servers-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.servers-table th {
  text-align: left; color: var(--text-muted); font-weight: 500; font-size: 0.75rem;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.servers-table td { padding: 10px 10px; border-bottom: 1px solid var(--border); }
.servers-table tr:last-child td { border-bottom: none; }
.servers-table tr:hover td { background: var(--bg-hover); }
.servers-table .srv-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }

.fill-bar { width: 100px; height: 6px; border-radius: 99px; background: var(--bg-elevated); overflow: hidden; }
.fill-bar-inner { height: 100%; background: var(--accent); }

.rp-badge {
  display: inline-block; font-size: 0.72rem; padding: 2px 8px; border-radius: 99px;
  background: var(--accent-dim); color: var(--accent-light);
}
