/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0b0b0b;
  --bg2:      #111111;
  --bg3:      #1a1a1a;
  --card:     #161616;
  --border:   #2a2a2a;
  --yellow:   #FFD700;
  --yellow2:  #FFC200;
  --yellow3:  #cc9900;
  --text:     #e8e8e8;
  --text-dim: #888;
  --gold1:    #FFD700;
  --gold2:    #C0C0C0;
  --gold3:    #cd7f32;
  --radius:   12px;
  --shadow:   0 4px 24px rgba(0,0,0,0.6);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--yellow3); border-radius: 4px; }

/* ===== HEADER ===== */
header {
  background: linear-gradient(135deg, #0b0b0b 0%, #1a1400 50%, #0b0b0b 100%);
  border-bottom: 2px solid var(--yellow3);
  padding: 28px 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,215,0,0.06) 0%, transparent 70%);
  pointer-events: none;
}
header .server-icon {
  width: 72px; height: 72px;
  border-radius: 12px;
  border: 3px solid var(--yellow);
  box-shadow: 0 0 20px rgba(255,215,0,0.4);
  margin-bottom: 14px;
  image-rendering: pixelated;
}
header h1 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--yellow);
  text-shadow: 0 0 30px rgba(255,215,0,0.5);
  letter-spacing: 2px;
  text-transform: uppercase;
}
header p {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 4px;
  letter-spacing: 1px;
}
.status-dot {
  display: inline-block;
  width: 10px; height: 10px;
  background: #22c55e;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 8px #22c55e;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ===== NAV TABS ===== */
nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 20px 16px 0;
  flex-wrap: wrap;
}
nav a {
  padding: 10px 28px;
  border-radius: 8px 8px 0 0;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  border: 1px solid var(--border);
  border-bottom: none;
  background: var(--bg2);
  transition: all 0.2s;
}
nav a:hover, nav a.active {
  color: var(--yellow);
  background: var(--card);
  border-color: var(--yellow3);
  text-shadow: 0 0 12px rgba(255,215,0,0.4);
}

/* ===== MAIN ===== */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ===== SECTION ===== */
.section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  background: linear-gradient(90deg, rgba(255,215,0,0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
.section-header .icon { font-size: 1.4rem; }
.section-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--yellow);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.section-header .badge {
  margin-left: auto;
  background: rgba(255,215,0,0.1);
  border: 1px solid var(--yellow3);
  color: var(--yellow);
  padding: 2px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ===== LEADERBOARD TABLE ===== */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table thead tr {
  background: var(--bg3);
  color: var(--text-dim);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.lb-table thead th { padding: 10px 16px; text-align: left; font-weight: 600; }
.lb-table thead th:last-child { text-align: right; }
.lb-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.lb-table tbody tr:last-child { border-bottom: none; }
.lb-table tbody tr:hover { background: rgba(255,215,0,0.04); }
.lb-table td { padding: 13px 16px; vertical-align: middle; }
.lb-table td:last-child { text-align: right; }

/* rank */
.rank { font-weight: 800; font-size: 1rem; width: 50px; text-align: center !important; }
.rank-1 { color: var(--gold1); text-shadow: 0 0 10px rgba(255,215,0,0.6); }
.rank-2 { color: var(--gold2); }
.rank-3 { color: var(--gold3); }
.rank-other { color: var(--text-dim); font-size: 0.9rem; }

/* player */
.player-cell { display: flex; align-items: center; gap: 12px; }
.player-avatar {
  width: 36px; height: 36px;
  border-radius: 6px;
  image-rendering: pixelated;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.player-name { font-weight: 600; font-size: 0.98rem; }

/* values */
.value-money {
  font-weight: 700;
  color: var(--yellow);
  font-size: 1rem;
  font-family: 'Courier New', monospace;
}

/* top 3 highlights */
.lb-table tbody tr:nth-child(1) { background: rgba(255,215,0,0.04); }
.lb-table tbody tr:nth-child(2) { background: rgba(192,192,192,0.03); }
.lb-table tbody tr:nth-child(3) { background: rgba(205,127,50,0.03); }

/* stat pills */
.stat-pills { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pill { padding: 2px 10px; border-radius: 20px; font-size: 0.78rem; font-weight: 600; }
.pill-kills  { background: rgba(239,68,68,0.15);   color: #f87171; border: 1px solid rgba(239,68,68,0.3); }
.pill-deaths { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.3); }
.pill-time   { background: rgba(125,211,252,0.1);  color: #7dd3fc; border: 1px solid rgba(125,211,252,0.3); }
.pill-kd     { background: rgba(255,215,0,0.1);    color: var(--yellow); border: 1px solid rgba(255,215,0,0.3); }

/* empty */
.empty { text-align: center; padding: 50px; color: var(--text-dim); }
.empty .empty-icon { font-size: 2.5rem; margin-bottom: 12px; }

/* error */
.error-banner {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #f87171;
  padding: 14px 20px;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 0.9rem;
}

/* footer */
footer {
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
footer span { color: var(--yellow); }

/* responsive */
@media (max-width: 600px) {
  header h1 { font-size: 1.5rem; }
  .stat-pills { justify-content: flex-start; }
  .pill-time { display: none; }
}
