/* === Leaderboard Page === */

.main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 6rem 2rem 2rem;
}

.pageHeader {
  margin-bottom: 2rem;
}

.pageHeaderTitle {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--plasma-cyan), var(--claw-red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pageHeaderSubtitle {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  color: var(--chrome-silver);
  font-size: 0.9rem;
}

/* Tab bar (Players / Factions / Exchange) */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tabBtn {
  font-family: var(--font-orbitron), 'Orbitron', sans-serif;
  font-size: 0.8rem;
  padding: 0.6rem 1.2rem;
  background: var(--nebula-blue);
  border: 1px solid var(--hull-grey);
  color: var(--chrome-silver);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tabBtn:hover,
.tabBtnActive {
  border-color: var(--plasma-cyan);
  color: var(--plasma-cyan);
}

.tabBtnActive {
  background: rgba(0, 212, 255, 0.15);
}

/* Category buttons (sub-filter within a tab) */
.categories {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.catBtn {
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  padding: 0.4rem 0.8rem;
  background: transparent;
  border: 1px solid rgba(61, 90, 108, 0.5);
  color: var(--chrome-silver);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.catBtn:hover,
.catBtnActive {
  border-color: var(--plasma-cyan);
  color: var(--plasma-cyan);
}

.catBtnActive {
  background: rgba(0, 212, 255, 0.08);
}

/* States */
.loading,
.error,
.empty {
  text-align: center;
  padding: 4rem 2rem;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  color: var(--chrome-silver);
  font-size: 0.9rem;
}

.error {
  color: var(--claw-red);
}

/* Table */
.tableContainer {
  overflow-x: auto;
  border: 1px solid var(--hull-grey);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--nebula-blue), var(--deep-void));
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 0.75rem;
  text-align: left;
  background: var(--nebula-blue);
  color: var(--chrome-silver);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--hull-grey);
}

.table tbody tr {
  transition: background 0.15s ease;
}

.table tbody tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.15);
}

.table tbody tr:hover {
  background: rgba(0, 212, 255, 0.06);
}

.table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(61, 90, 108, 0.3);
  color: var(--star-white);
}

/* Column sizing */
.colRank {
  width: 3rem;
  text-align: center !important;
}

.colTag {
  width: 5rem;
}

.colName {
  min-width: 10rem;
}

.colEmpire {
  min-width: 8rem;
}

.colValue {
  width: 8rem;
  text-align: right !important;
}

.cellRank {
  text-align: center;
  color: var(--chrome-silver);
  font-weight: 600;
}

.cellName {
  font-weight: 500;
}

.cellTag {
  color: var(--chrome-silver);
  font-weight: 600;
}

.cellEmpire {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cellValue {
  text-align: right;
  color: var(--bio-green, #2dd4bf);
  font-weight: 600;
}

/* Empire color dot */
.empireDot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Top 3 medal highlights */
.rank1 .cellRank {
  color: #ffd700;
}

.rank2 .cellRank {
  color: #c0c0c0;
}

.rank3 .cellRank {
  color: #cd7f32;
}

.rank1 .cellName {
  color: #ffd700;
}

/* Updated at footer */
.updatedAt {
  margin-top: 1.5rem;
  text-align: center;
  font-family: var(--font-jetbrains), 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--chrome-silver);
  opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
  .main {
    padding: 5rem 1rem 2rem;
  }

  .pageHeaderTitle {
    font-size: 1.5rem;
  }

  .tabs {
    gap: 0.3rem;
  }

  .tabBtn {
    font-size: 0.7rem;
    padding: 0.5rem 0.8rem;
  }

  .catBtn {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
  }

  .table {
    font-size: 0.75rem;
  }

  .table thead th {
    font-size: 0.6rem;
    padding: 0.5rem 0.5rem;
  }

  .table td {
    padding: 0.4rem 0.5rem;
  }

  .colEmpire {
    min-width: 6rem;
  }
}

@media (max-width: 480px) {
  .colEmpire,
  .cellEmpire {
    display: none;
  }

  .table {
    font-size: 0.7rem;
  }
}
