/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ── */
.site-header {
  background: #1e293b;
  padding: 0 0.75rem;
  min-height: 50px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-bottom: 1px solid #334155;
}
.site-logo-link {
  display: inline-block;
  line-height: 0;
  opacity: 0.75;
  transition: opacity 0.15s ease;
}
.site-logo-link:hover { opacity: 1; }
.site-logo {
  height: 11px;
  width: auto;
  display: block;
}
.site-header-divider {
  width: 1px;
  align-self: stretch;
  margin: 0.5rem 0;
  background: #334155;
}
.site-header-event {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  min-width: 0;
}
.site-header-event-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.1;
}
.site-header-event-meta {
  font-size: 0.78rem;
  color: #94a3b8;
}

.site-main {
  flex: 1;
  padding: 1rem;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.site-footer {
  padding: 1rem;
  text-align: center;
  color: #64748b;
  border-top: 1px solid #1e293b;
  margin-top: 2rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 1rem;
}
.breadcrumb a { color: #94a3b8; }
.breadcrumb span { color: #e2e8f0; }

h1 { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; color: #f1f5f9; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: #f1f5f9; }
h3 { font-size: 1rem; font-weight: 600; margin: 1rem 0 0.5rem; color: #cbd5e1; }

h1 small { font-size: 0.8em; color: #94a3b8; font-weight: 400; }

/* ── Event list (home) ── */
.event-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.event-card { background: #1e293b; border: 1px solid #334155; border-radius: 8px; overflow: hidden; }
.event-card-link { display: block; padding: 0.75rem 1rem; color: inherit; text-decoration: none; }
.event-card-link:hover { background: #273449; text-decoration: none; }
.event-card-name { font-weight: 600; color: #f1f5f9; margin-bottom: 0.25rem; }
.event-card-meta { font-size: 0.85rem; color: #94a3b8; display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 0.5rem; }
.event-card-status { display: flex; gap: 0.75rem; align-items: center; font-size: 0.8rem; color: #94a3b8; }

/* ── Event detail ── */
.event-meta { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.75rem; font-size: 0.9rem; margin-bottom: 1.5rem; }
.event-meta dt { color: #94a3b8; }
.event-meta dd { color: #e2e8f0; }

.category-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.category-card { background: #1e293b; border: 1px solid #334155; border-radius: 8px; }
.category-card a { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; color: inherit; text-decoration: none; }
.category-card a:hover { background: #273449; text-decoration: none; }
.category-card-code { font-weight: 700; color: #60a5fa; min-width: 3.5rem; font-family: monospace; }
.category-card-name { flex: 1; color: #f1f5f9; }
.category-card-meta { display: flex; gap: 0.5rem; align-items: center; }

/* ── Badges ── */
.status-badge, .phase-badge, .race-status, .junior-badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.status-upcoming { background: #1e3a8a; color: #bfdbfe; }
.status-live     { background: #14532d; color: #86efac; }
.status-finished { background: #334155; color: #94a3b8; }

.phase-tt            { background: #3730a3; color: #c7d2fe; }
.phase-heats         { background: #1e40af; color: #bfdbfe; }
.phase-quarterfinals { background: #7c2d12; color: #fed7aa; }
.phase-semifinals    { background: #9a3412; color: #fed7aa; }
.phase-finals        { background: #166534; color: #86efac; }
.phase-done          { background: #334155; color: #94a3b8; }

.junior-badge { background: #6b21a8; color: #e9d5ff; }

.race-status-pending { background: #334155; color: #cbd5e1; }
.race-status-active  { background: #15803d; color: #bbf7d0; }
.race-status-done    { background: #1e293b; color: #94a3b8; border: 1px solid #334155; }

.race-time { font-size: 0.8rem; color: #94a3b8; font-weight: 400; margin-left: 0.5rem; }

/* ── Category dump ── */
.category-header { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 1rem; font-size: 0.9rem; color: #94a3b8; }

.dump-section { margin-bottom: 2rem; }
.dump-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.dump-table th, .dump-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid #1e293b;
}
.dump-table th {
  background: #1e293b;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.race-block { margin-bottom: 1.25rem; }

.race-athlete-empty td { color: #475569; font-style: italic; }

/* ── Bib colors ── */
.bib-color {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #0f172a;
}
.bib-red    { background: #ef4444; color: #fff; }
.bib-green  { background: #22c55e; color: #0f172a; }
.bib-blue   { background: #3b82f6; color: #fff; }
.bib-yellow { background: #eab308; color: #0f172a; }

/* ── Empty state ── */
.empty-state { color: #64748b; font-style: italic; text-align: center; padding: 2rem 1rem; }

/* ── Technical meta (collapsed details) ── */
.technical-meta {
  margin-top: 2rem;
  border-top: 1px solid #1e293b;
  padding-top: 1rem;
  font-size: 0.8rem;
  color: #64748b;
}
.technical-meta summary { cursor: pointer; color: #94a3b8; }
.technical-meta dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 0.75rem; margin-top: 0.5rem; }
.technical-meta dt { color: #64748b; }

/* ── 404 ── */
.error-page { text-align: center; padding: 3rem 1rem; }
.error-page h1 { font-size: 4rem; color: #334155; margin-bottom: 0.5rem; }

/* ── TT Live View ── */
.live-indicator {
  color: #ef4444;
  font-weight: bold;
  margin-right: 1rem;
}
.tt-refresh-info {
  color: #94a3b8;
  font-size: 0.9em;
}
.tt-live-header {
  margin-bottom: 1rem;
}
.tt-live-link {
  margin: 0.5rem 0 1rem 0;
}
.tt-live-link a {
  font-weight: bold;
}
.race-athlete-dnf {
  opacity: 0.65;
}

/* Wave 2.4.11: latest finisher highlight — green persistence (15s server-driven)
   plus a one-shot 2s pulse triggered by JS on 0→1 transition.
   box-shadow inset gives a 4px left accent bar without affecting layout. */
.dump-table tbody tr[data-latest-finisher="1"] {
  background-color: rgba(34, 197, 94, 0.22);
  box-shadow: inset 4px 0 0 #22c55e;
  transition: background-color 0.5s ease-out;
}
.dump-table tbody tr[data-latest-finisher="1"] td {
  color: #f1f5f9;
  font-weight: 600;
}
@keyframes latest-finisher-pulse {
  0%   { background-color: rgba(34, 197, 94, 0.70); }
  50%  { background-color: rgba(34, 197, 94, 0.45); }
  100% { background-color: rgba(34, 197, 94, 0.22); }
}
.dump-table tbody tr.latest-finisher-pulse {
  animation: latest-finisher-pulse 2s ease-out;
}
/* Defensive: latest finisher cannot have a finish_time AND be disqualified
   (server only flags rows with finish_time), but if data shape ever changes
   keep the DNF coloring visually dominant. */
.dump-table tbody tr.race-athlete-dnf[data-latest-finisher="1"] {
  background-color: rgba(239, 68, 68, 0.15);
  box-shadow: inset 4px 0 0 #ef4444;
}
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.on-track-running {
  font-variant-numeric: tabular-nums;
  color: #60a5fa;
  font-weight: 600;
}
.on-track-running.finished-pending {
  color: #22c55e;
}

/* Vlna 2.4.9: hlavička brán v "Na trati" — barevné odlišení dle typu */
.gate-th {
  text-align: center;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.35rem 0.2rem;
  min-width: 1.8rem;
}
/* Bumpne specificitu (0,2,1) přes .dump-table th/td (0,1,1), aby text-align:
   center skutečně vyhrál → digit v hlavičce a badge v body cellu jsou
   centrované ve sloupci (vizuální center-to-center alignment). */
.dump-table thead th.gate-th { text-align: center; }
.dump-table td.gate-cell     { text-align: center; }
/* Vlna 2.4.9.2: decentní styl podle hlavního KXRS — pozadí dědí z .dump-table
   thead th (#1e293b), žádný spodní border, jen barevný text. Specificita
   .dump-table thead th.gate-th-* (0,3,1) přebíjí .dump-table th (0,1,1) color. */
.dump-table thead th.gate-th-downstream { color: #4ade80; }   /* zelená — povodná */
.dump-table thead th.gate-th-upstream   { color: #f87171; }   /* červená — protivoda */
.dump-table thead th.gate-th-eskimo     { color: #fde047; }   /* žlutá — eskymák */

/* Vlna 2.4.9: penalty buňky jako badge, ne plnobarevné pozadí */
.gate-cell {
  text-align: center;
  background: transparent;
  padding: 0.2rem 0.15rem;
}
.gate-cell .penalty-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  height: 1.05rem;
  padding: 0 0.3rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
}
/* CLEAN en-dash: bez letter-spacing, ať pomlčka nevypadá zbytečně tažená */
.cell-clean .penalty-badge { letter-spacing: 0; }
.cell-flt .penalty-badge {
  background: #7f1d1d;
  color: #fecaca;
  border: 1px solid #ef4444;
}
.cell-clean .penalty-badge {
  background: #14532d;
  color: #86efac;
  border: 1px solid #22c55e;
}
.cell-pending .penalty-badge {
  background: transparent;
  color: #475569;
  border: none;
}
.flt-badge {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  font-weight: bold;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.85em;
}
.empty-note {
  color: #94a3b8;
  font-style: italic;
}


/* ─── Wave 2.4.12: Denser "Pořadí" table ─── */
/* Tighter padding + slightly smaller font for the ranking table.
   Scoped to #tt-section-ranking so the scoreboard "Na trati" keeps its
   own sizing. Specificity (1,1,1) wins over .dump-table th/td (0,1,1). */
#tt-section-ranking .dump-table th,
#tt-section-ranking .dump-table td {
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
  line-height: 1.25;
}
#tt-section-ranking .dump-table th {
  font-size: 0.68rem;
}

/* Wave 2.7.16: scoreboard look v2 — refactor of Wave 2.4.12.
   Unified yellow palette (FLT no longer red), modern monospace
   stack, dashed dividers, ID-scoped to prevent global bleed.
   Stadium LED feel for projector / event-center display.
   Gate header color rules (.gate-th-downstream/upstream/eskimo)
   are intentionally NOT overridden — those colors are part of
   the gate-type semantics, not the scoreboard chrome. */

#tt-section-on-course {
  background: #0a0a0a;
  border: 2px solid #facc15;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
}

#tt-section-on-course .dump-table,
#tt-section-on-course .dump-table th,
#tt-section-on-course .dump-table td {
  background: transparent;
  color: #facc15;
  font-family: ui-monospace, "SF Mono", Monaco, "Cascadia Code",
               "Roboto Mono", Consolas, "Liberation Mono",
               "Courier New", monospace;
  font-weight: 700;
}

#tt-section-on-course .dump-table thead {
  background: transparent;
  border-bottom: 1px solid #facc15;
}

#tt-section-on-course .dump-table thead th {
  color: #fde047;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
}

#tt-section-on-course .dump-table tbody tr {
  background: transparent;
}

#tt-section-on-course .dump-table tbody tr:hover {
  background: rgba(250, 204, 21, 0.08);
}

#tt-section-on-course .dump-table td {
  padding: 0.55rem 0.75rem;
  border: none;
  border-bottom: 1px dashed rgba(250, 204, 21, 0.2);
}

#tt-section-on-course .dump-table tbody tr:last-child td {
  border-bottom: none;
}

/* Running clock — focal point: larger, bolder, glow, tabular-nums. */
#tt-section-on-course .on-track-running {
  font-size: 1.15rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  text-shadow: 0 0 6px rgba(250, 204, 21, 0.4);
  white-space: nowrap;
}

/* Athlete finished but waiting for sync — dimmed, no glow. */
#tt-section-on-course .on-track-running.finished-pending {
  color: #ca8a04;
  text-shadow: none;
}

#tt-section-on-course .gate-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

#tt-section-on-course .gate-cell.cell-pending {
  color: #78716c;
}

#tt-section-on-course .gate-cell.cell-pending .penalty-badge {
  color: #78716c;
  background: transparent;
  border: none;
}

/* CLEAN cell — override the global green palette (background #14532d /
   color #86efac / border #22c55e) to fit the unified yellow scoreboard. */
#tt-section-on-course .gate-cell.cell-clean {
  color: #facc15;
  background: transparent;
}

#tt-section-on-course .gate-cell.cell-clean .penalty-badge {
  color: #facc15;
  background: transparent;
  border: 1px solid rgba(250, 204, 21, 0.4);
  font-weight: 600;
}

/* FLT cell — override the global red palette (background #7f1d1d /
   color #fecaca / border #ef4444). Yellow text + yellow border keeps
   FLT visually distinct without breaking the unified palette. */
#tt-section-on-course .gate-cell.cell-flt {
  background: transparent;
  color: #facc15;
}

#tt-section-on-course .gate-cell.cell-flt .penalty-badge {
  color: #facc15;
  background: transparent;
  border: 1px solid #facc15;
  font-weight: 800;
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
}

#tt-section-on-course .gate-th {
  color: #fde047;
}

#tt-section-on-course .scroll-x {
  background: transparent;
}

/* ─── Wave 2.6.0: Bracket live (mobile-first) ─── */

/* Sticky chip navigation. Base header is not sticky/fixed, so top: 0
   pins to the viewport once the header scrolls out. */
.bracket-nav-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  padding: 0.5rem 0;
  margin: -0.5rem -0.25rem 1rem;
}

.phase-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
  padding: 0 0.25rem;
}
.phase-tab {
  padding: 0.4rem 0.8rem;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.phase-tab:hover { background: #273449; }

.race-chips {
  display: flex;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: 0 0.25rem 0.2rem;
  -webkit-overflow-scrolling: touch;
}
.race-chip {
  flex: 0 0 auto;
  padding: 0.3rem 0.6rem;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.race-chip:hover { background: #273449; }
.race-chip-done {
  background: #0f172a;
  color: #64748b;
  border-color: #1e293b;
}
.race-chip-done::before { content: '✓ '; color: #22c55e; }
.race-chip-active {
  background: #064e3b;
  color: #6ee7b7;
  border-color: #10b981;
  animation: bracket-chip-pulse 1.5s ease-in-out infinite;
}
@keyframes bracket-chip-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.45); }
  50%      { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}

/* Race blocks — extends existing .race-block (which only sets margin) with
   a card look + active-status border. */
.bracket-race-block {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.8rem;
  scroll-margin-top: 6.5rem;   /* sticky-nav height clearance for chip-jump */
}
.bracket-race-block.race-status-active {
  border-color: #10b981;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35);
}
.bracket-race-block.race-status-done {
  border-color: #1e3a2e;
  opacity: 0.85;
}

.bracket-race-block .race-block-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.bracket-race-block .race-name {
  font-weight: 700;
  color: #e2e8f0;
}
.bracket-race-block .race-time {
  font-family: monospace;
  margin-left: 0;
}
.bracket-race-block .race-status-icon {
  margin-left: auto;
  font-size: 1rem;
}
.bracket-race-block.race-status-done .race-status-icon { color: #22c55e; }
.bracket-race-block.race-status-active .race-status-icon { color: #6ee7b7; }
.bracket-race-block.race-status-pending .race-status-icon { color: #64748b; }

/* Wave 2.6.6: compact bracket race table — no thead, fixed-layout columns
   so the BIB swatch sits next to its name regardless of how many cols
   the row has (4 for pending/active, 5 for done). */
.race-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  table-layout: fixed;
}
.race-results-table td {
  padding: 0.18rem 0.35rem;
  border-top: 1px solid #1e293b;
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-results-table .race-pos {
  width: 2rem;
  font-weight: 700;
  color: #38bdf8;
}
.race-results-table .race-stc {
  width: 2.2rem;
  color: #94a3b8;
}
.race-results-table .race-bib {
  width: 1.6rem;
  text-align: center;
  padding-left: 0.2rem;
  padding-right: 0.2rem;
}
/* Bib swatch — colored square only, no text. Reuses existing .bib-{color}
   classes from the .bib-color block (the per-color background rules apply
   to any element bearing the class). */
.bib-square {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  vertical-align: middle;
}
.race-results-table .race-name-cell { color: #e2e8f0; }
.race-results-table .race-flt {
  width: 3.4rem;
  text-align: right;
  font-family: monospace;
  color: #fca5a5;
}
.race-athlete-row.race-athlete-dnf .race-status-text {
  color: #fca5a5;
  font-size: 0.7rem;
  font-weight: 700;
}

.phase-heading {
  font-size: 0.95rem;
  color: #94a3b8;
  margin: 1rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.race-phase-section {
  scroll-margin-top: 6.5rem;
}

/* Wave 2.6.1: primary Live link in category.html — bolder green to signal
   it's the recommended single-URL entry point. */
.live-primary {
  font-weight: 700;
  color: #6ee7b7 !important;
}
.live-primary:hover { color: #a7f3d0 !important; }
.live-link-sep { color: #475569; }

/* ─── Wave 2.6.2b: live current_heat block ─── */
.live-current-heat {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem 0;
}
.live-current-heat[data-status="active"] {
  border-color: #ef4444;
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2);
}
.live-current-heat[data-status="done"] {
  border-color: #10b981;
  opacity: 0.85;
}
/* Wave 2.6.14: live-current-heat header redesign — pulsing status dot
   in the top-right corner replaces the textual AKTIVNÍ/DOKONČENO badge. */
.live-current-heat .live-header {
  position: relative;       /* anchor for the absolutely positioned dot */
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding-right: 1.25rem;   /* leave room for the corner dot */
}
.live-current-heat .live-heat-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e2e8f0;
}
.live-current-heat .live-status-dot {
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #94a3b8;       /* fallback grey */
}
.live-current-heat .live-status-dot-active {
  background: #ef4444;       /* red */
  animation: live-status-pulse 1.5s ease-in-out infinite;
}
.live-current-heat .live-status-dot-done {
  background: #10b981;       /* green, no animation */
}
@keyframes live-status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.8); }
}

/* Wave 2.6.14.2: gate progress bar lives inline inside .live-header
   (between label and the absolute status dot). Cells are bare 10×6
   rectangles — grey border when pending, green fill when visited. */
.live-gates {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin: 0;
}
/* Wave 2.6.14: visited progress instead of penalty-status colors.
   Gate cells turn green once the operator's focus has moved at or
   past that gate. Pending = neutral grey frame. Old gate-all_clean /
   gate-all_flt / gate-partial classes deprecated — kept in CSS as
   fallback so legacy snapshots don't render unstyled. */
.live-gates .gate-cell {
  display: inline-block;
  width: 10px;
  height: 6px;
  border-radius: 2px;
  background: transparent;
  border: 1px solid #475569;
  transition: background 0.25s ease, border-color 0.25s ease;
}
.live-gates .gate-cell.gate-pending {
  background: transparent;
  border-color: #475569;
}
.live-gates .gate-cell.gate-visited {
  background: #10b981;
  border-color: #10b981;
}
/* Legacy fallback — keep light styling so old snapshots without
   `visited` field render readable. */
.live-gates .gate-cell.gate-all_clean,
.live-gates .gate-cell.gate-all_flt,
.live-gates .gate-cell.gate-partial {
  background: #10b981;
  border-color: #10b981;
}

.live-current-heat .live-athletes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.live-current-heat .live-athlete {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
  font-size: 0.85rem;
  color: #e2e8f0;
}
.live-current-heat .athlete-final-pos {
  display: inline-block;
  min-width: 1.4rem;
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fbbf24;
  text-align: right;
}
.live-current-heat .lane-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.live-current-heat .lane-red    .lane-dot { background: #ef4444; }
.live-current-heat .lane-green  .lane-dot { background: #22c55e; }
.live-current-heat .lane-blue   .lane-dot { background: #3b82f6; }
.live-current-heat .lane-yellow .lane-dot { background: #eab308; }
.live-current-heat .athlete-stc {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.8rem;
  color: #64748b;
  min-width: 2rem;
}
.live-current-heat .athlete-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-current-heat .athlete-status {
  font-family: ui-monospace, "Courier New", monospace;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  transition: background-color 0.3s ease;
}
.live-current-heat .status-ok {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}
/* Match any FLT-N (FLT-1, FLT-2, FLT-start, ...) — class is status-flt_N. */
.live-current-heat .athlete-status[class*="status-flt"] {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  font-weight: 700;
}
.live-current-heat .status-dns,
.live-current-heat .status-dnf,
.live-current-heat .status-ral {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

/* Brief flash on per-cell update (driven by JS toggling .flash class). */
.live-gates .gate-cell.flash,
.live-current-heat .athlete-status.flash {
  animation: live-current-flash 0.6s ease-out;
}
@keyframes live-current-flash {
  0%   { background-color: rgba(56, 189, 248, 0.4); }
  100% { background-color: transparent; }
}

/* ─────────────────────────────────────────────────────────────────────
   Wave 2.7.5: a11y utilities
   ───────────────────────────────────────────────────────────────────── */

/* Screen-reader-only — visually hidden but in the accessibility tree. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus-visible: outline only on keyboard nav, suppressed on click/touch. */
*:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
  border-radius: 3px;
}
*:focus:not(:focus-visible) {
  outline: none;
}

