/* Video Replay — leaderboard styles.
   Two consumers: the Top 10 showcase on the front page, and the full table page. */

/* ── Top 10 showcase (front page) ─────────────────────────────────────── */

.top10 {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.top10-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #1c1c20, var(--surface));
}

.top10-head h2 { margin: 0; font-size: 20px; }
.top10-head .season { color: var(--text-faint); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.top10-head .spacer { margin-left: auto; }

.top10-list { list-style: none; margin: 0; padding: 0; }

.top10-row {
  display: grid;
  grid-template-columns: 54px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 13px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.top10-row:last-child { border-bottom: 0; }
.top10-row:hover { background: rgba(255, 255, 255, 0.02); }

.medal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 14px;
  color: var(--text-dim);
}

.medal.g { background: rgba(245, 192, 48, 0.14); border-color: rgba(245, 192, 48, 0.5); color: var(--gold); }
.medal.s { background: rgba(201, 204, 212, 0.12); border-color: rgba(201, 204, 212, 0.45); color: var(--silver); }
.medal.b { background: rgba(205, 131, 65, 0.14); border-color: rgba(205, 131, 65, 0.5); color: var(--bronze); }

.alias { font-weight: 700; letter-spacing: 0.2px; }
.alias .flag { margin-left: 8px; font-size: 12px; color: var(--text-faint); font-weight: 600; }

.refs { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 17px; }
.refs small { color: var(--text-faint); font-weight: 600; font-size: 11px; margin-left: 4px; letter-spacing: 1px; }

.delta { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: var(--good); min-width: 56px; text-align: right; }
.delta.zero { color: var(--text-faint); }

.top10-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* The whole card is the link through to the full table — the brief was "click the top 10
   and it takes you to the searchable list", so the target is the card, not a small link. */
a.top10-link { text-decoration: none; color: inherit; display: block; }
a.top10-link:hover .top10 { border-color: var(--text-faint); }

/* ── Controls ─────────────────────────────────────────────────────────── */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.field {
  flex: 1 1 280px;
  position: relative;
  min-width: 220px;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 42px 0 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}

.field input:focus { outline: none; border-color: var(--accent); }
.field .icon { position: absolute; left: 14px; top: 14px; color: var(--text-faint); }
.field .clear {
  position: absolute; right: 8px; top: 8px;
  width: 32px; height: 32px; border-radius: 8px;
  border: 0; background: none; color: var(--text-faint);
  cursor: pointer; font-size: 16px;
}
.field .clear:hover { color: var(--text); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Table ────────────────────────────────────────────────────────────── */

.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-x: auto;
}

table.board { width: 100%; border-collapse: collapse; min-width: 620px; }

table.board th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--surface-2);
  position: sticky;
  top: 0;
}

table.board th.sortable { cursor: pointer; user-select: none; }
table.board th.sortable:hover { color: var(--text); }
table.board th .arrow { opacity: 0.5; margin-left: 4px; }

table.board td {
  padding: 13px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

table.board tr:last-child td { border-bottom: 0; }
table.board tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

/* Your own row, and rows you've starred, have to be findable at a glance in a list that
   could be a hundred thousand long. */
table.board tr.is-me { background: rgba(255, 107, 53, 0.09); }
table.board tr.is-me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
table.board tr.is-fav td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
table.board tr.is-me.is-fav td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

.rank { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--text-dim); width: 76px; }
.rank .up { color: var(--good); font-size: 11px; margin-left: 6px; }

.star {
  border: 0;
  background: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  color: var(--text-faint);
  filter: grayscale(1);
  opacity: 0.45;
}

.star[aria-pressed="true"] { filter: none; opacity: 1; }
.star:hover { opacity: 1; }

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 5px;
  margin-left: 8px;
  vertical-align: 1px;
}

.tag.me { background: var(--accent); color: #fff; }
.tag.fav { background: rgba(245, 192, 48, 0.16); color: var(--gold); border: 1px solid rgba(245, 192, 48, 0.4); }

/* ── Summary strip ────────────────────────────────────────────────────── */

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}

.stat .n { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--text-faint); font-size: 11px; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 700; }

/* ── Your standing banner ─────────────────────────────────────────────── */

.standing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.16), rgba(255, 107, 53, 0.04));
  border: 1px solid rgba(255, 107, 53, 0.4);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 22px;
}

.standing .big { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.standing .spacer { margin-left: auto; }

/* ── Pagination ───────────────────────────────────────────────────────── */

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 18px 0 0;
  color: var(--text-dim);
  font-size: 14px;
}

.pager button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.pager button:disabled { opacity: 0.4; cursor: default; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-dim); }

@media (max-width: 640px) {
  .top10-row { grid-template-columns: 44px 1fr auto; padding: 12px 16px; }
  .top10-row .delta { display: none; }
  .top10-head, .top10-foot { padding: 16px; }
}
