@font-face {
  font-family: "Korataki";
  src: url("fonts/korataki_extrabold.otf") format("opentype");
  font-weight: 800;
  font-display: swap;
}

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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  background: #fafafa;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-family: "Korataki", sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.tagline {
  font-size: 1rem;
  color: #666;
  font-weight: 400;
}

/* Leaderboard */
.leaderboard {
  margin-bottom: 3rem;
}

.leaderboard h2 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #999;
  margin-bottom: 1rem;
}

.status {
  text-align: center;
  padding: 2rem;
  color: #999;
}

.status button {
  margin-left: 0.5rem;
  padding: 0.25rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
}

.status button:hover {
  background: #f5f5f5;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

thead th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 2px solid #e5e5e5;
  font-weight: 600;
  font-size: 0.8125rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tbody tr {
  border-bottom: 1px solid #f0f0f0;
}

tbody tr:hover {
  background: #f8f8f8;
}

tbody td {
  padding: 0.625rem 0.75rem;
}

/* Columns */
.col-rank {
  width: 3rem;
  text-align: center;
}

.col-rating, .col-games {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
}

.col-tier {
  width: 6rem;
}

td.col-rank {
  text-align: center;
  font-weight: 600;
  color: #999;
}

td.col-rating {
  font-weight: 600;
}

/* Top 3 accents */
tr.rank-1 td.col-rank { color: #d4a017; }
tr.rank-2 td.col-rank { color: #8a8a8a; }
tr.rank-3 td.col-rank { color: #b87333; }

tr.rank-1 td.col-name { font-weight: 700; }
tr.rank-2 td.col-name { font-weight: 600; }
tr.rank-3 td.col-name { font-weight: 600; }

/* Tier badges */
.tier {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.tier-iron     { background: #e8e8e8; color: #666; }
.tier-bronze   { background: #f0e0d0; color: #8b5e3c; }
.tier-silver   { background: #e8e8e8; color: #555; }
.tier-gold     { background: #fff3d0; color: #b8860b; }
.tier-platinum { background: #e0f0f0; color: #2e8b8b; }
.tier-diamond  { background: #e0e8ff; color: #4a5fc1; }
.tier-master   { background: #f0e0ff; color: #8b45a6; }

/* Meta */
.meta {
  text-align: right;
  font-size: 0.75rem;
  color: #bbb;
  margin-top: 0.5rem;
}

/* Download */
.download {
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid #eee;
  margin-bottom: 2rem;
  flex: 1;
}

.download p {
  margin-bottom: 1rem;
  color: #666;
}

.badges {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.badge img {
  height: 40px;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.badge:hover img {
  opacity: 0.8;
}

/* Footer */
footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

footer p {
  font-size: 0.75rem;
  color: #bbb;
}

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

  h1 {
    font-size: 1.5rem;
  }

  table {
    font-size: 0.8125rem;
  }

  thead th, tbody td {
    padding: 0.5rem 0.5rem;
  }

  .col-games {
    display: none;
  }

  th.col-games {
    display: none;
  }
}
