:root {
  color-scheme: dark;
  --bg: #111;
  --fg: #eee;
  --muted: #9aa;
  --accent: #e23;
  --ok: #3c3;
  --flash: #c90;
  --row: #1c1c1c;
  font-family: system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  min-height: 100%;
}

body { padding: 0.75rem; }

h1 { font-size: 1.15rem; margin: 0.4rem 0; }
.muted { color: var(--muted); }
#board-list a, .results-link { color: var(--fg); }
h2 { font-size: 0.85rem; color: var(--muted); margin: 0.5rem 0; text-transform: uppercase; }

button, input {
  font: inherit;
  font-size: 1.05rem;
}

button {
  background: #333;
  color: var(--fg);
  border: 0;
  border-radius: 6px;
  padding: 0.45rem 0.8rem;
}

#btn-stop { background: var(--accent); font-weight: 700; }
#btn-start { background: var(--ok); color: #111; font-weight: 700; }

input {
  background: #222;
  color: var(--fg);
  border: 1px solid #444;
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  width: 100%;
}

form, .race-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
label { display: block; margin: 0.4rem 0; }

#flash, #banner {
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-weight: 700;
}
#flash { background: var(--flash); color: #111; }
#banner { background: var(--accent); }

.race-head { margin-bottom: 0.75rem; }
#clock {
  font-variant-numeric: tabular-nums;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.clocks { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
#wall {
  font-variant-numeric: tabular-nums;
  font-size: 1.4rem;
  color: var(--muted);
}
#status { color: var(--muted); margin: 0.25rem 0 0.5rem; }

.bib-wrap { font-size: 0.85rem; color: var(--muted); }
#bib {
  font-size: 2rem;
  letter-spacing: 0.08em;
  padding: 0.6rem;
}

.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

#recent, #ranking, #sklad-list, #race-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

#ranking { list-style: decimal; padding-left: 1.4rem; }

#recent li, #ranking li, #sklad-list li, #race-list li {
  background: var(--row);
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.3rem;
  border-radius: 4px;
  cursor: pointer;
}

#recent li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

#race-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: default;
}

#race-list .race-label { flex: 1; cursor: pointer; }
#race-list .race-del { background: #522; font-size: 0.9rem; }
.pass-del { background: #522; font-size: 0.8rem; margin-left: auto; }
.pass-edit { background: #333; font-size: 0.8rem; }
.suspect, tr.suspect {
  background: #4a3a10 !important;
  box-shadow: inset 3px 0 0 #c90;
}

.recent-bib { font-weight: 700; margin-right: 0.4rem; }
.recent-meta { color: var(--muted); font-variant-numeric: tabular-nums; }

#recent input {
  width: 5rem;
  font-size: 1rem;
  display: inline-block;
}

@media (max-width: 640px) {
  .cols { grid-template-columns: 1fr; }
  #clock { font-size: 1.8rem; }
}
