:root {
  --bg: #0b1020;
  --card: #111a33;
  --text: #e9eefc;
  --muted: #a9b4d0;
  --border: rgba(233, 238, 252, 0.12);
  --accent: #7aa2ff;
  --notice-bg: rgba(255, 210, 120, 0.12);
  --notice-border: rgba(255, 210, 120, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg), #070a14);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.header {
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
}

.hero {
  padding-top: 22px;
  padding-bottom: 22px;
}

h1 {
  margin: 0 0 6px 0;
  font-size: 22px;
}

h2 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

h3 {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.lead {
  margin: 10px 0 0 0;
  max-width: 82ch;
  line-height: 1.55;
}

.notice {
  margin: 12px 0 0 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--notice-border);
  background: var(--notice-bg);
}

.section {
  margin: 18px 0 28px 0;
}

.introGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.infoCard {
  line-height: 1.5;
}

.infoList {
  margin: 8px 0 0 0;
  padding-left: 18px;
}

.infoList li {
  margin-bottom: 6px;
}

.contentLink {
  color: var(--accent);
  text-decoration: none;
}

.contentLink:hover {
  text-decoration: underline;
}

.controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin: 10px 0 14px 0;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

select,
input,
button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  padding: 9px 10px;
  border-radius: 10px;
  outline: none;
}

select {
  width: 100%;
}

select option {
  background: var(--card);
  color: var(--text);
}

button {
  cursor: pointer;
  background: rgba(122, 162, 255, 0.14);
  border-color: rgba(122, 162, 255, 0.35);
}

button:hover {
  background: rgba(122, 162, 255, 0.22);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.card {
  border: 1px solid var(--border);
  background: rgba(17, 26, 51, 0.6);
  border-radius: 14px;
  padding: 14px;
}

.pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  color: var(--text);
}

.tableWrap {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  overscroll-behavior-x: contain;
  background: rgba(17, 26, 51, 0.6);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
}

thead th.sortable {
  cursor: pointer;
  user-select: none;
}

thead th.sortable:hover {
  color: var(--text);
}

thead th.sortable.sorted[data-dir="asc"]::after {
  content: " \25B2";
  color: rgba(233, 238, 252, 0.55);
  font-size: 11px;
}

thead th.sortable.sorted[data-dir="desc"]::after {
  content: " \25BC";
  color: rgba(233, 238, 252, 0.55);
  font-size: 11px;
}

tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

a.tableLink {
  color: var(--accent);
  text-decoration: none;
}

a.tableLink:hover {
  text-decoration: underline;
}

.footer {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.footer .container {
  padding-top: 14px;
  padding-bottom: 18px;
}

.footer p {
  margin: 0 0 6px 0;
}

/* --- Athlete profile --- */

.profileSection {
  max-width: 100%;
}

.profileBack {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 14px;
}

.profileHeader {
  margin-bottom: 18px;
}

.profileName {
  font-size: 26px;
  margin: 0 0 4px 0;
}

.profileMeta {
  font-size: 14px;
}

.profileGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.profileResults h3 {
  margin-bottom: 6px;
}

#profileClubList {
  font-size: 13px;
  line-height: 1.7;
}

#profileClubList .clubEntry {
  padding: 3px 0;
}

#profileClubList .clubSeasons {
  color: var(--muted);
  margin-left: 6px;
}

@media (max-width: 900px) {
  .profileGrid {
    grid-template-columns: 1fr;
  }
}

/* --- End athlete profile --- */

@media (max-width: 900px) {
  .grid,
  .introGrid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  table {
    font-size: 12px;
    min-width: 720px;
  }

  thead th,
  tbody td {
    padding: 8px 10px;
  }

  .hideOnMobile {
    display: none;
  }
}
