:root {
  color-scheme: light;
  --navy: #05155e;
  --dupr-bright: #3a79e0;
  --blue: #2048a0;
  --blue-ink: #173a88;
  --line: #cbdbf4;
  --swiss: #fce0e0;
}
* { box-sizing: border-box; }
body { margin: 0; background: #eaf2ff; color: #172d55; font: 1rem/1.5 system-ui, sans-serif; }
.content { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.ranking-header {
  background: linear-gradient(152deg, var(--dupr-bright) 10%, #326acc 32%, var(--blue) 57%, var(--navy) 90%);
  border-bottom: 4px solid var(--dupr-bright);
  color: white;
  padding: 1rem 0 2rem;
}
.site-links { display: flex; justify-content: space-between; gap: 1rem; }
.site-links a { color: white; background: #05155e99; border-radius: .35rem; padding: .25rem .5rem; text-underline-offset: .18em; }
h1 { margin: 0; font-size: clamp(2rem, 6vw, 3.5rem); line-height: 1.15; }
.ranking-header h1 { margin-top: .9rem; }
main { padding-bottom: 2rem; }
.discipline-links { display: flex; flex-wrap: wrap; gap: .6rem; padding-top: 1.25rem; }
.discipline-links a {
  border-radius: .5rem;
  background: var(--blue);
  color: white;
  padding: .55rem .9rem;
  font-weight: 650;
  text-decoration: none;
}
.discipline-links a:hover { background: var(--navy); text-decoration: underline; }
a:focus-visible, .table-wrap:focus-visible { outline: 3px solid #3774e5; outline-offset: 3px; }
.ranking-note {
  background: #d9e8ff;
  border-left: 3px solid #3269c8;
  border-radius: .3rem;
  color: var(--blue-ink);
  padding: .65rem .8rem;
  margin: 1rem 0 .7rem;
}
.legend { display: flex; gap: .5rem; align-items: center; margin: .6rem 0 1rem; }
.legend span { width: 1rem; height: 1rem; background: var(--swiss); border: 1px solid #d9a6a6; border-radius: .2rem; }
section + section { margin-top: 2.25rem; }
h2, h3 { color: var(--navy); margin: 0 0 .65rem; }
h2 small {
  display: inline-block;
  background: #d6e6ff;
  border-radius: .35rem;
  color: var(--blue-ink);
  font-size: .6em;
  font-weight: 650;
  padding: .12rem .42rem;
  vertical-align: middle;
}
h3 { margin-top: 1.3rem; }
.table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: .65rem;
  box-shadow: 0 .3rem 1.1rem #0a358914;
}
table { width: 100%; border-collapse: collapse; font-size: .92rem; font-variant-numeric: tabular-nums; }
th, td { padding: .55rem .65rem; text-align: left; }
th { background: var(--blue-ink); color: white; white-space: nowrap; }
th:first-child { width: 1%; white-space: normal; line-height: 1.2; }
th:first-child, td:first-child { text-align: center; }
td { border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: 0; }
td:nth-child(2), td:nth-child(5) { white-space: nowrap; }
td:nth-last-child(-n+2), th:nth-last-child(-n+2) { text-align: right; }
td:last-child { color: var(--blue-ink); }
.flag { text-align: center; font-size: 1.15em; }
tbody tr:nth-child(even) { background: #edf4ff; }
tbody tr.swiss-player { background: var(--swiss); }
@media (max-width: 600px) {
  .content { width: calc(100% - 1.25rem); }
  th, td { padding: .48rem; }
  td:nth-child(4) { min-width: 8rem; }
}

.age-filter { margin: 1.1rem 0 0; }
.age-filter fieldset {
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: white;
  padding: .85rem 1rem;
  min-width: 0;
  margin: 0;
}
.age-filter legend { color: var(--navy); font-weight: 700; padding-inline: .35rem; }
.age-controls { display: flex; flex-wrap: wrap; align-items: end; gap: .55rem .75rem; }
.age-controls label { display: grid; gap: .25rem; color: var(--blue-ink); font-size: .9rem; }
.age-controls input, .age-controls button {
  min-height: 2.6rem;
  border: 1px solid #91addb;
  border-radius: .45rem;
  padding: .45rem .65rem;
  font: inherit;
}
.age-controls input { width: 6rem; color: var(--navy); }
.age-controls button { cursor: pointer; color: var(--blue-ink); background: #edf4ff; }
.age-controls button[type="submit"] { background: var(--blue); border-color: var(--blue); color: white; }
.age-controls :focus-visible { outline: 3px solid #3774e5; outline-offset: 2px; }
#age-hint, .age-feedback { margin: .5rem 0 0; font-size: .88rem; }
.age-feedback { font-weight: 650; color: var(--blue-ink); }
.age-feedback:empty { display: none; }

.age-controls .swiss-filter[aria-pressed="true"] {
  background: #fce0e0;
  border-color: #bd7373;
  color: #652b2b;
}

.age-controls select {
  min-height: 2.6rem;
  border: 1px solid #91addb;
  border-radius: .45rem;
  padding: .45rem .65rem;
  color: var(--navy);
  background: white;
  font: inherit;
}
.age-filter input[type="search"] { width: min(11rem, 100%); }
#open-tables, #senior-women-tables { margin-top: 1.2rem; }
