:root {
  --bg: #0b0c10;
  --card: #111218;
  --muted: #9aa3b2;
  --text: #e8ecf1;
  --accent: #21c55d;
  --accent-soft: rgba(33, 197, 93, 0.25);
  --border: #232634;
  --ring: #2b2f3a;
  --focus: #60a5fa;
  --warn: #f59e0b;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  line-height: 1.35;
  background: #131623;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}
header {
  margin-bottom: 16px;
}
header h1 {
  font-size: clamp(20px, 3vw, 28px);
  margin: 0;
  letter-spacing: 0.2px;
}
.updated {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
  white-space: nowrap;
}

/* Search */
.search-wrap {
  position: sticky;
  top: 55px;
  z-index: 10;
  padding: 10px 0 20px;
  background: linear-gradient(#121623, transparent);
}
.search {
  display: flex;
  gap: 10px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: #1e222e;
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 16px;
}
.search .clear {
  border: 0;
  background: #1a1d27;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 0.2px;
}
/* .search .clear:hover {
  color: #c6cfdd;
} */

/* Rangliste (collapsible) */
details.ranklist {
  margin: 0px 0 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border: 1px solid rgba(255, 255, 255, 0.3);
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  overflow: hidden;
}
details.ranklist > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 14px 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
details.ranklist > summary::marker {
  display: none;
}
details.ranklist > summary span.chev {
  transition: transform 0.2s ease;
}
details.ranklist[open] > summary span.chev {
  transform: rotate(90deg);
}
.rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-top: 1px solid var(--border);
}
.rank-table th,
.rank-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.rank-table th {
  color: #cbd5e1;
  font-weight: 600;
  background: #0f1117;
}
/* .rank-table tr:hover td {
  background: #0f1320;
} */

/* Filter */
.filter-wrap {
  position: sticky;
  z-index: 10;
  top: -1px;
  padding-top: 11px;
  padding-bottom: 11px;
  display: flex;
  margin: 30px 0 0 0;
  background: #121623;
}
.filter-wrap .filter {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0);
  padding: 6px 12px;
  margin: 0 10px 0 0;
  border-radius: 100px;
  cursor: pointer;
  opacity: 0.4;
}
.filter-wrap .filter span {
  user-select: none;
  white-space: nowrap;
}
.filter-wrap .filter.filter-active {
  opacity: 1;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Rennen grid */
.races {
}
.race {
  background: #fff;
  color: #333;
  border: 1px solid var(--border);
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: 20px;
  border-radius: 16px;
  padding: 12px;
  position: relative;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25);
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    border-color 0.2s ease;
}
/* .race:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.28);
} */
.race.live {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 28px rgba(0, 0, 0, 0.28);
}
.race-head > div {
  display: flex;
  align-items: center;

  gap: 10px;
  margin-bottom: 8px;
}
.race-description {
  display: block;
  min-width: 100%;
  font-size: 11px;
}
.badge {
  font-size: 11px;
  letter-spacing: 0.2px;
  color: #d5e7ff;
  background: #0f172a;
  border: 1px solid var(--ring);
  padding: 6px 8px;
  border-radius: 999px;
}
.photo-badge a {
  color: var(--border);
  display: flex;
  position: relative;
}
.photo-badge a:after {
  content: "";
  position: absolute;
  top: -10px;
  right: -10px;
  left: -10px;
  bottom: -10px;
}
.photo-badge a svg {
  width: 22px;
  height: 22px;
}
.title {
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
}
.sub {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
  text-align: right;
}
.live-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: rgba(33, 197, 93, 0.08);
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(33, 197, 93, 0.7);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(33, 197, 93, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(33, 197, 93, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(33, 197, 93, 0);
  }
}

.rows {
  display: grid;
  gap: 8px;
}
.row {
  display: grid;
  grid-template-columns: 60px 1fr 88px 56px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px dashed var(--ring);
  border-radius: 12px;
  /* background: #0d1018; */
}
.row:hover {
  /* background: #0f1320; */
}
.mono {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.lane {
  font-weight: 700;
  color: #cbd5e1;
}
.team {
  font-weight: 600;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}
.cell-label {
  color: #9fb0c3;
  font-size: 11px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.time {
  font-weight: 700;
}
.place {
  justify-self: end;
  font-weight: 800;
  border: 1px solid var(--ring);
  padding: 4px 4px;
  border-radius: 10px;
  min-width: 30px;
  text-align: center;
}

.empty,
.error {
  margin-top: 28px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--ring);
  border-radius: 12px;
  padding: 18px;
}

/* small screens */
@media (max-width: 420px) {
  .row {
    grid-template-columns: 40px 1fr 74px 31px;
  }
  .search input {
    font-size: 15px;
  }
}
