:root {
  --bg: #0f1419;
  --panel: #1a1f26;
  --border: #2a313b;
  --text: #d8dde4;
  --muted: #7e8896;
  --accent: #4aa3ff;
  --total: #f5d442;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.4;
}

header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.selector label {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: var(--muted);
}

.selector label.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text);
}

.selector select,
.selector button {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.9rem;
}

.selector button {
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent);
  color: #0a0e13;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  align-self: flex-end;
}

.disclaimer {
  margin: 0;
  padding: 0.75rem 1.5rem;
  background: #2a1f0f;
  border-bottom: 1px solid #5a3f1a;
  border-left: 4px solid #f5d442;
  color: #e8dec3;
  font-size: 0.85rem;
  line-height: 1.5;
}

.disclaimer strong {
  color: var(--total);
}

.disclaimer p {
  margin: 0;
}

.disclaimer p + p {
  margin-top: 0.5rem;
}

.disclaimer .sources a,
.disclaimer .contact a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 0.15rem;
}

.disclaimer .sources a:hover,
.disclaimer .contact a:hover {
  text-decoration: underline;
}

section {
  padding: 1rem 1.5rem;
}

section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}

.race h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1rem;
}

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

.race h3 a:hover { text-decoration: underline; }

.group h4 {
  margin: 0.75rem 0 0.3rem;
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lauf h5 {
  margin: 0.5rem 0 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.lauf h5 .meta {
  font-weight: normal;
  color: var(--muted);
  margin-left: 0.5rem;
  font-size: 0.75rem;
}

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

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

thead th {
  background: #232a33;
  position: sticky;
  top: 0;
  text-align: left;
  padding: 0.4rem 0.6rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th.race-col { text-align: center; border-left: 1px solid var(--border); }
thead th.lap { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

tbody td {
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid #232a33;
  white-space: nowrap;
}

tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.02); }
tbody tr:hover td { background: rgba(74, 163, 255, 0.08); }

td.num, td.lap {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

td.lap { color: var(--muted); }

td.total { font-weight: 700; color: var(--total); }

.empty { color: var(--muted); font-style: italic; padding: 0.4rem 0; margin: 0; }
.error { color: var(--error); padding: 0.4rem 0; margin: 0; }

footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

footer p {
  margin: 0.2rem 0;
}

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

footer a:hover {
  text-decoration: underline;
}
