:root {
  --bg:        #0b0f14;
  --surface:   #141a22;
  --surface2:  #1c2430;
  --border:    #253040;
  --text:      #d4dde8;
  --muted:     #7a8fa6;
  --green:     #39d353;
  --green-dim: #1f6b2e;
  --gold:      #e3a52a;
  --red:       #e84040;
  --red-dim:   #6b1a1a;
  --radius:    6px;
  --font:      'Inter', system-ui, sans-serif;
  --mono:      'JetBrains Mono', 'Fira Code', monospace;
}

*, *::before, *::after { 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.6;
}

/* ── Header ── */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 64px;
}

.site-logo { height: 40px; width: auto; }

.logo-wrap {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  letter-spacing: -.01em;
}

nav { margin-left: auto; display: flex; gap: 1.5rem; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: color .15s;
}
nav a:hover { color: var(--green); }

/* ── Hero ── */
.hero {
  background:
    linear-gradient(180deg, rgba(11,15,20,.85) 0%, rgba(11,15,20,1) 100%),
    url('https://nepamesh.com/content/images/2025/02/NEPAMESH-Website-Background.png')
    center/cover no-repeat;
  padding: 3rem 1.5rem 2rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
}

.hero h1 span { color: var(--green); }

.hero p {
  margin-top: .5rem;
  color: var(--muted);
  font-size: .95rem;
}

/* ── Stats bar ── */
.stats-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.stat {
  text-align: center;
  min-width: 100px;
}

.stat-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
  font-family: var(--mono);
}

.stat-label {
  font-size: .75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Main layout ── */
main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
}

@media (max-width: 800px) {
  main { grid-template-columns: 1fr; }
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.card-header .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
}

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

/* ── Leaderboard table ── */
.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

.lb-table th {
  padding: .6rem 1rem;
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.lb-table th.right,
.lb-table td.right { text-align: right; }

.lb-table td {
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--border);
}

.lb-table tr:last-child td { border-bottom: none; }

.lb-table tr:hover td { background: var(--surface2); }

.rank {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
  width: 36px;
}

.rank-1 { color: var(--gold); font-weight: 700; }
.rank-2 { color: #b0b8c4; font-weight: 700; }
.rank-3 { color: #cd7f32; font-weight: 700; }

.node-id {
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--green);
}

.points {
  font-family: var(--mono);
  font-weight: 700;
  color: #fff;
}

.bar-cell { width: 120px; }

.bar-wrap {
  background: var(--surface2);
  border-radius: 3px;
  height: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--green-dim);
  border-radius: 3px;
  transition: width .3s;
}

.bar-fill.top { background: var(--green); }

/* ── Side panels ── */
.side { display: flex; flex-direction: column; gap: 1.5rem; }

.claim-row {
  display: flex;
  align-items: center;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: .75rem;
  font-size: .82rem;
}

.claim-row:last-child { border-bottom: none; }

.claim-rank {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
  width: 20px;
  flex-shrink: 0;
}

.claim-name {
  font-weight: 600;
  color: #fff;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.claim-pct {
  font-family: var(--mono);
  color: var(--green);
  font-size: .8rem;
  flex-shrink: 0;
}

.claim-by {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
}

/* ── Utility ── */
.muted  { color: var(--muted); }
.neg    { color: var(--red); }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: .7rem;
  padding: .15rem .4rem;
  border-radius: 3px;
  font-weight: 600;
}
.badge-active { background: var(--green-dim); color: var(--green); }
.badge-done   { background: var(--surface2); color: var(--muted); }

nav a.nav-active { color: var(--green); }

/* ── Empty state ── */
.empty {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}

/* ── Footer ── */
footer {
  margin-top: 3rem;
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: .78rem;
  color: var(--muted);
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--green); }
