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

body {
  background: #08151E;
  color: #FEF8F5;
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  padding-top: 64px;
}

/* ── PAGE LAYOUT ─────────────────────────────────────── */
.page-wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 32px 80px;
}

.comp-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(199,75,78,0.9);
  margin-bottom: 6px;
}

h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 44px;
  letter-spacing: 0.06em;
  color: #FEF8F5;
}

.btn-scan {
  background: #C74B4E;
  color: #FEF8F5;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-scan:hover { opacity: 0.85; transform: translateY(-1px); }

/* ── RANK BADGE ──────────────────────────────────────── */
.rank-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(199,75,78,0.15);
  color: #C74B4E;
  border: 1px solid rgba(199,75,78,0.3);
}
.rank-badge:empty { display: none; }

/* ── PODIUM ──────────────────────────────────────────── */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.pod-card {
  flex: 1;
  max-width: 240px;
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
  background: #0F1F2B;
  border: 1px solid rgba(254,248,245,0.08);
  transition: border-color 0.2s, transform 0.2s;
}
.pod-card:hover {
  border-color: rgba(254,248,245,0.16);
  transform: translateY(-2px);
}

.pod-card.gold {
  background: #0F1F2B;
  border-color: rgba(199,75,78,0.4);
  padding-top: 32px;
  padding-bottom: 32px;
  box-shadow: 0 0 32px rgba(199,75,78,0.1);
}

.pod-medal {
  font-size: 28px;
  margin-bottom: 12px;
}

.pod-username {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.1em;
  color: #FEF8F5;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pod-plates {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(254,248,245,0.45);
  margin-bottom: 2px;
}

.pod-cantons {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(254,248,245,0.25);
}

/* ── SEASON BANNER ───────────────────────────────────── */
.season-banner {
  background: #0F1F2B;
  border: 1px solid rgba(254,248,245,0.08);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.season-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(254,248,245,0.35);
}

.season-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: #FEF8F5;
}

.season-countdown {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(199,75,78,0.8);
}

/* ── LEADERBOARD TABLE ───────────────────────────────── */
.leaderboard-wrap {
  background: #0F1F2B;
  border: 1px solid rgba(254,248,245,0.08);
  border-radius: 14px;
  overflow: hidden;
}

.leaderboard {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard thead tr {
  border-bottom: 1px solid rgba(254,248,245,0.08);
}

.leaderboard th {
  font-family: 'DM Mono', monospace;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(254,248,245,0.3);
  padding: 14px 20px;
  text-align: left;
  font-weight: 500;
}

.leaderboard td {
  padding: 14px 20px;
  font-size: 14px;
  border-top: 1px solid rgba(254,248,245,0.05);
}

.leaderboard tbody tr:first-child td { border-top: none; }

.leaderboard tbody tr {
  transition: background 0.15s;
  cursor: default;
}
.leaderboard tbody tr:hover {
  background: rgba(254,248,245,0.03);
}

.leaderboard tbody tr.top-row {
  background: rgba(199,75,78,0.04);
}
.leaderboard tbody tr.top-row:hover {
  background: rgba(199,75,78,0.07);
}

.leaderboard tbody tr.my-row {
  background: rgba(95,179,170,0.06);
  border-left: 2px solid rgba(95,179,170,0.5);
}

.td-rank {
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  width: 52px;
  color: rgba(254,248,245,0.3);
}

.td-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: #FEF8F5;
}

.td-plates, .td-cantons {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #FEF8F5;
}

.td-rarity {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 500;
  text-transform: uppercase;
}

/* Rarity colour classes */
.rarity-legendary { color: #C74B4E; }
.rarity-epic      { color: #B78584; }
.rarity-rare      { color: #5FB3AA; }
.rarity-uncommon  { color: rgba(254,248,245,0.5); }
.rarity-common    { color: rgba(254,248,245,0.3); }

.loading-cell, .empty-cell, .error-cell {
  text-align: center;
  padding: 48px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(254,248,245,0.3);
}

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  background: #08151E;
  border-top: 0.5px solid rgba(254,248,245,0.06);
  color: rgba(254,248,245,0.25);
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
footer a { color: rgba(254,248,245,0.25); text-decoration: none; transition: color 0.2s; }
footer a:hover { color: rgba(254,248,245,0.65); }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 640px) {
  .page-wrap { padding: 24px 16px 60px; }
  .podium { flex-direction: column; align-items: stretch; }
  .pod-card { max-width: 100%; }
  .pod-card.gold { order: -1; }
  .leaderboard th, .leaderboard td { padding: 10px 12px; }
  .th-cantons, .td-cantons { display: none; }
  .th-rarity, .td-rarity { display: none; }
}
