/* League results pages (NJL + Mercian) */
:root {
  --pb-color: var(--green);
  --girls-color: var(--pink);
  --boys-color: var(--blue);
  --mixed-color: var(--purple);
  --grey: var(--muted);
}

.page-wrapper { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; }

.filter-bar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-btn {
  font-family: var(--font-cond); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--surface); color: var(--text-2); border: 1px solid var(--border-strong);
  padding: 7px 14px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s, border-color .15s;
}
.filter-btn:hover { border-color: var(--gold-dark); color: var(--text); }
.filter-btn.active { background: var(--navy); color: var(--gold); border-color: var(--navy); }
:root[data-theme="dark"] .filter-btn.active { background: var(--gold); color: var(--on-gold); border-color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .filter-btn.active { background: var(--gold); color: var(--on-gold); border-color: var(--gold); } }

.table-card { background: var(--surface); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
.table-card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-card thead tr { background: var(--card-head-bg); }
.table-card th {
  padding: 11px 16px; text-align: left; white-space: nowrap; color: var(--gold);
  font-family: var(--font-cond); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  border-bottom: 2px solid var(--gold);
}
.table-card th:first-child { width: 52px; text-align: center; }
.table-card th.time-col { text-align: right; }

.table-card tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
.table-card tbody tr:last-child { border-bottom: none; }
.table-card tbody tr.even { background: var(--surface-2); }
.table-card tbody tr.odd { background: var(--surface); }
.table-card tbody tr.relay-row { background: var(--blue-soft); }
.table-card tbody tr:hover { background: var(--row-hover) !important; }
.table-card td { padding: 10px 16px; vertical-align: middle; color: var(--text); }

td.event-num { text-align: center; font-family: var(--font-cond); font-weight: 700; font-size: 14px; color: var(--muted); }
.event-type { font-weight: 500; color: var(--text); }

.category-tag {
  display: inline-block; font-family: var(--font-cond); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; padding: 1px 7px; border-radius: 4px; margin-right: 6px;
  text-transform: uppercase; vertical-align: middle;
}
.tag-girls { background: var(--pink-soft);   color: var(--pink); }
.tag-boys  { background: var(--blue-soft);   color: var(--blue); }
.tag-mixed { background: var(--purple-soft); color: var(--purple); }
.tag-relay { background: var(--teal-soft);   color: var(--teal); }
.tag-9, .tag-open { background: var(--orange-soft); color: var(--orange); }
.tag-10, .tag-10u { background: var(--green-soft);  color: var(--green); }
.tag-11, .tag-12u { background: var(--purple-soft); color: var(--purple); }
.tag-12, .tag-14u { background: var(--red-soft);    color: var(--red); }

.swimmer-name { font-weight: 500; }
.swimmer-name .multi { display: flex; flex-direction: column; gap: 2px; }
.swimmer-name .multi span { font-size: 13.5px; }
.swimmer-name .multi span:not(:first-child) { color: var(--muted); font-size: 13px; }

td.time-col { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.time-improved { color: var(--green); }
.time-normal   { color: var(--text); }
.no-time       { color: var(--muted); font-style: italic; font-size: 13px; font-weight: 400; }

.pb-badge, .dq-badge {
  display: inline-block; font-family: var(--font-cond); font-size: 11px; font-weight: 700; letter-spacing: .06em;
  border-radius: 4px; padding: 0 6px; margin-left: 6px; vertical-align: middle;
}
.pb-badge { color: var(--green); background: var(--green-soft); }
.dq-badge { color: var(--red); background: var(--red-soft); }

.place-col { text-align: center; font-weight: 700; font-size: 14px; white-space: nowrap; }
.place-1st { color: var(--medal-gold); }
.place-2nd { color: var(--medal-silver); }
.place-3rd { color: var(--medal-bronze); }
.place-other { color: var(--muted); }
.place-dq { color: var(--red); font-size: 12px; font-weight: 700; }
.place-dns { color: var(--muted); font-size: 12px; font-weight: 700; }

.relay-times { display: flex; flex-direction: column; gap: 1px; align-items: flex-end; font-size: 13px; }
.relay-times .split { color: var(--muted); font-weight: 400; }
.relay-times .total { font-weight: 700; font-size: 14px; color: var(--text); border-top: 1px solid var(--border-strong); padding-top: 2px; margin-top: 2px; }

.section-header td {
  background: var(--surface-3) !important; color: var(--muted);
  font-family: var(--font-cond); font-size: 12px; font-weight: 700; letter-spacing: .15em;
  text-transform: uppercase; padding: 7px 16px; text-align: center;
}
.table-card tfoot tr td { background: var(--surface-2); color: var(--muted); font-size: 12px; text-align: center; padding: 14px; }

td.pb-col, th.pb-col { display: none; }

@media (max-width: 600px) {
  .page-wrapper { padding: 1rem 0.75rem 2rem; }
  .table-card td, .table-card th { padding: 8px 8px; }
  .category-tag { display: none; }
}
