/* races.css — dérivé de theme.ts + composants RN (darkForest theme) */
:root {
  --bg:       #0c1410;
  --surface:  #162018;
  --surface2: #1d2a20;
  --surface3: #243328;
  --border:   #2c4233;
  --border2:  #3a5444;
  --accent:   #68d492;
  --accentDim: rgba(104,212,146,0.12);
  --text:     #e8ece9;
  --muted:    #82a08a;
  --muted2:   #6b8f74;
  --blue:     #5ba4cf;
  --red:      #f87171;
  --gold:     #fbbf24;
  --orange:   #ff6b35;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'DM Sans', system-ui, sans-serif; font-size: 14px;
}
a { color: inherit; text-decoration: none; }

/* ── Nav (identique landing.css) ── */
.page-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(12,20,16,.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px; padding: 0 20px; height: 48px;
}
.page-nav a { font-size: 13px; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.page-nav a:hover, .page-nav a.active { color: var(--accent); }
.page-nav-brand { font-size: 15px; font-weight: 700; color: var(--accent); margin-right: auto; }

/* ── Race header ── */
.race-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.race-header-inner { max-width: 960px; margin: 0 auto; padding: 16px 20px 0; }
.race-breadcrumb {
  font-size: 13px; color: var(--muted); font-weight: 400;
  margin-bottom: 6px; display: flex; gap: 5px; align-items: center; flex-wrap: wrap;
}
.race-breadcrumb a { color: var(--muted); }
.race-breadcrumb a:hover { color: var(--accent); }
.race-title-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.race-back {
  font-size: 22px; color: var(--muted); flex-shrink: 0;
  line-height: 1; padding: 8px 10px 8px 0;
  display: inline-flex; align-items: center;
}
.race-back:hover { color: var(--accent); }
.race-title { font-family: 'Bebas Neue', sans-serif; font-size: 32px; font-weight: 400; letter-spacing: 0.5px; flex: 1; line-height: 1; }
.race-title-year { font-size: 0; visibility: hidden; position: absolute; }
.race-header-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.btn-header-ghost {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border2);
  font-size: 13px; color: var(--text); background: transparent; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-header-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-header-green {
  padding: 7px 14px; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #081008;
  background: var(--accent); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-header-green:hover { opacity: .9; }
.race-meta {
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 0;
  font-size: 13px; color: var(--muted); align-items: center;
}
.race-chip {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px; font-size: 12px;
  color: var(--muted); letter-spacing: 0.3px;
}
.race-chip strong { color: var(--text); font-weight: 600; }
.race-meta-sep { color: var(--muted2); margin: 0 2px; }

/* ── Custom dropdowns ÉDITION / COURSE ── */
.race-dropdown { position: relative; display: inline-block; }
.race-dropdown-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; cursor: pointer;
  font-family: inherit; font-size: 13px; color: var(--text);
  white-space: nowrap;
}
.race-dropdown-btn:hover, .race-dropdown.open .race-dropdown-btn { border-color: var(--accent); }
.race-dropdown.open .race-dropdown-btn svg { transform: rotate(180deg); }
.race-dropdown-btn svg { color: var(--muted); flex-shrink: 0; transition: transform .2s; }
.dd-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.dd-value { font-weight: 700; color: var(--text); }
.race-dropdown-menu {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 6px; min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.race-dropdown.open .race-dropdown-menu { display: block; }
.dd-item {
  display: block; padding: 8px 12px; border-radius: 6px;
  font-size: 14px; color: var(--muted); text-decoration: none; cursor: pointer;
}
.dd-item:hover { background: var(--surface3); color: var(--text); }
.dd-item.active { color: var(--accent); font-weight: 700; }
.dd-item.active::after { content: ' ✓'; }

/* ── Tabs (RaceHeader.tsx style) ── */
.tabs-bar {
  display: flex; gap: 0; margin-top: 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab {
  padding: 11px 18px; font-size: 13px; font-weight: 500; color: var(--muted);
  border-bottom: 2px solid transparent; white-space: nowrap;
  text-decoration: none; display: inline-block; position: relative; top: 1px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab.soon { opacity: .45; cursor: default; }
.tab.soon::after {
  content: 'bientôt'; font-size: 9px; margin-left: 6px;
  background: var(--surface3); padding: 1px 6px; border-radius: 3px;
  text-transform: lowercase; letter-spacing: .3px;
}
/* ── Hero search (top of page) ── */
.hero-search-wrap { position: relative; margin: 20px 0 4px; }
.hero-search-inner {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 12px; padding: 12px 16px; color: var(--muted);
  transition: border-color .2s;
}
.hero-search-inner:focus-within { border-color: var(--accent); }
.hero-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; font-family: inherit;
}
.hero-search-input::placeholder { color: var(--muted2); }
.hero-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 300;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.hero-result-item {
  padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.hero-result-item:last-child { border-bottom: none; }
.hero-result-item:hover { background: var(--surface3); }
.hero-result-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.hero-result-cat { font-size: 11px; color: var(--muted); font-weight: 400; background: var(--surface3); padding: 1px 6px; border-radius: 4px; }
.hero-result-stats { font-size: 12px; color: var(--muted); margin-top: 2px; font-family: 'DM Mono', monospace; }
.hero-no-result { padding: 14px 16px; font-size: 13px; color: var(--muted); }

/* ── Runner search ── */
.results-search-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.results-search-wrap {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; color: var(--muted);
}
.runner-search-input {
  background: none; border: none; outline: none; color: var(--text);
  font-size: 13px; font-family: inherit; width: 200px;
}
.runner-search-input::placeholder { color: var(--muted2); }
.search-hint { font-size: 12px; color: var(--accent); margin-bottom: 8px; }
.runner-name-link { color: var(--text); font-weight: 600; }
#results-tbody tr:hover .runner-name-link { color: var(--accent); }

/* ── Runner profile modal ── */
.runner-modal-box { text-align: left; max-width: 500px; width: 95%; }
.rp-header { margin-bottom: 16px; }
.rp-name { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: -0.3px; }
.rp-meta { font-size: 12px; color: var(--muted); margin-top: 4px; letter-spacing: 0.5px; }
.rp-race { font-size: 12px; color: var(--muted2); margin-top: 2px; }
.rp-kpi-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-bottom: 14px;
}
.rp-kpi {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px;
}
.rp-kpi-locked { position: relative; overflow: hidden; }
.rp-kpi-label { font-size: 10px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 6px; }
.rp-kpi-val { font-size: 28px; font-weight: 800; line-height: 1; }
.rp-kpi-val.accent { color: var(--accent); }
.rp-kpi-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.rp-blur { filter: blur(5px); user-select: none; }
.rp-locked-banner { text-align: center; }
.rp-locked-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 20px; padding: 6px 14px; font-size: 12px; color: var(--muted);
  margin-bottom: 12px;
}
.rp-locked-desc { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; }

/* ── Signup modal ── */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
}
.modal-backdrop.open { display: flex; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: 16px; padding: 32px 28px; max-width: 400px; width: 90%;
  position: relative; text-align: center;
}
.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.modal-close:hover { color: var(--text); }
.modal-logo { font-size: 18px; font-weight: 800; color: var(--accent); margin-bottom: 16px; }
.modal-title { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.modal-desc { font-size: 14px; color: var(--muted); line-height: 1.5; margin-bottom: 24px; }
.modal-btn-primary {
  display: block; padding: 12px 20px; border-radius: 10px;
  background: var(--accent); color: #081008; font-weight: 700; font-size: 15px;
  margin-bottom: 10px;
}
.modal-btn-primary:hover { opacity: .9; }
.modal-btn-secondary {
  display: block; padding: 11px 20px; border-radius: 10px;
  border: 1px solid var(--border2); color: var(--muted); font-size: 14px;
}
.modal-btn-secondary:hover { border-color: var(--accent); color: var(--text); }

/* ── Layout ── */
.race-container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.section-gap { margin-bottom: 12px; }

/* ── KPI grid (cards individuelles, 4 en ligne) ── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin: 16px 0;
}
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 12px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.kpi-value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.kpi-label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.8px; margin-top: 2px;
}

/* ── KPI inline (multi-race section headers) ── */
.kpi-strip {
  display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px;
}
.kpi-inline { font-size: 13px; color: var(--muted); }
.kpi-inline span { font-weight: 700; }

/* ── App card (borderRadius:12, padding:16) ── */
.app-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
}
.app-card-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); margin-bottom: 12px;
}

/* ── Podium (PodiumCard.tsx) ── */
.podium-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.podium-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
  flex-grow: 1; flex-shrink: 1; flex-basis: auto; min-width: 240px;
}
.podium-card-title {
  font-size: 13px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--muted); margin-bottom: 12px;
}
.podium-entry {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.podium-entry:last-child { border-bottom: none; }
.podium-medal { font-size: 20px; width: 28px; text-align: center; }
.podium-info { flex: 1; min-width: 0; }
.podium-name { font-size: 14px; font-weight: 600; }
.podium-name a.runner-name-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
  padding: 2px 4px;
  margin: -2px -4px;
  transition: background 120ms ease;
}
.podium-name a.runner-name-link:hover {
  background: rgba(255, 255, 255, 0.06);
}
.podium-detail { font-size: 11px; color: var(--muted); margin-top: 1px; }
.podium-time {
  font-size: 15px; font-weight: 700; color: var(--accent);
  font-family: 'DM Mono', monospace;
}
.podium-gap { font-size: 11px; color: var(--muted); margin-top: 1px; text-align: right; }

/* ── Histogramme (TimeDistributionHistogram.tsx) ── */
.histogram-wrap { overflow-x: auto; }
.histogram-bars {
  display: flex; align-items: flex-end; gap: 2px; height: 140px; padding-top: 20px;
}
.histogram-bar {
  flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-width: 8px;
  position: relative; display: flex; align-items: flex-start; justify-content: center;
}
.histogram-bar-label {
  position: absolute; top: -16px; font-size: 10px; color: var(--muted);
  white-space: nowrap; pointer-events: none; text-align: center; width: 100%;
}
.histogram-axis {
  display: flex; gap: 2px; margin-top: 6px;
}
.histogram-axis span {
  flex: 1; font-size: 10px; color: var(--muted); text-align: center;
  min-width: 8px; white-space: nowrap;
}
.histogram-footer {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--muted); margin-top: 8px;
}

/* ── Sibling race tabs ── */
.race-siblings {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0;
}
.sibling-tab {
  padding: 7px 16px; border-radius: 20px; border: 1px solid var(--border);
  font-size: 13px; color: var(--muted); background: transparent;
  white-space: nowrap; text-decoration: none;
}
.sibling-tab:hover { border-color: var(--border2); color: var(--text); }
.sibling-tab.active {
  border-color: var(--accent); color: var(--accent); font-weight: 600;
}

/* ── Race sections (multi-race events) ── */
.race-section-header {
  margin: 24px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.race-section-title {
  font-size: 17px; font-weight: 700; margin-bottom: 4px;
}

/* ── Results footer ── */
.results-footer {
  font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px;
}
.results-footer a { color: var(--accent); }

/* ── ResultsTable (ResultsTable.tsx — chips + tableau) ── */
.filter-chips {
  display: flex; gap: 8px; margin-bottom: 8px;
  flex-wrap: wrap; align-items: center;
}
.chip {
  padding: 6px 12px; border-radius: 16px; border: 1px solid var(--border);
  font-size: 12px; color: var(--muted); background: var(--surface2);
  text-decoration: none; display: inline-block; cursor: default;
}
.chip.active {
  background: var(--accent); border-color: var(--accent);
  color: var(--bg); font-weight: 600;
}
.results-search {
  margin-left: auto; display: flex; align-items: center; gap: 6px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 10px; color: var(--muted);
}
.results-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.results-table th {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.7px;
  padding: 0 0 6px; text-align: left; border-bottom: 1px solid var(--border);
}
.results-table td {
  padding: 10px 0; border-bottom: 1px solid var(--border); vertical-align: middle;
}
.results-table tr:last-child td { border-bottom: none; }
.results-table tr:hover td { background: rgba(255,255,255,.015); }
.col-rank { width: 40px; font-size: 12px; color: var(--muted); font-weight: 600; }
.col-name a { color: var(--text); font-weight: 600; }
.col-name a:hover { color: var(--accent); }
.col-time {
  font-family: 'DM Mono', monospace; padding-right: 12px; white-space: nowrap;
}
.col-cat { font-size: 12px; color: var(--muted); padding-right: 12px; }
.col-nat { font-size: 12px; color: var(--muted2); }

/* ── Allures moyennes ── */
.pace-rows { display: flex; flex-direction: column; gap: 10px; }
.pace-row { display: flex; align-items: center; gap: 10px; }
.pace-label { font-size: 12px; color: var(--muted); width: 72px; flex-shrink: 0; }
.pace-bar-wrap { flex: 1; height: 10px; background: var(--surface2); border-radius: 5px; overflow: hidden; }
.pace-bar { height: 100%; border-radius: 5px; transition: width .3s; }
.pace-col { font-family: 'DM Mono', monospace; font-size: 13px; font-weight: 600; flex-shrink: 0; white-space: nowrap; text-align: right; }
.pace-minkm { width: 80px; }
.pace-kmh   { width: 72px; color: var(--muted); }

/* ── Répartition H/F + Nationalités ── */
.gender-natio-row { display: flex; gap: 12px; flex-wrap: wrap; }
.gender-card { flex: 1; min-width: 200px; }
.natio-card { flex: 2; min-width: 280px; }
.gender-bar { height: 12px; border-radius: 6px; overflow: hidden; display: flex; margin-bottom: 10px; }
.gender-bar-m { background: var(--blue); }
.gender-bar-f { background: #f472b6; }
.gender-legend { display: flex; gap: 16px; font-size: 12px; }
.gender-m { color: var(--blue); font-weight: 600; }
.gender-f { color: #f472b6; font-weight: 600; }
.natio-list { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.natio-item { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.natio-code { font-weight: 600; color: var(--text); }
.natio-count { color: var(--muted2); }

/* ── CTA banner ── */
.seo-cta {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; margin: 28px 0; text-align: center;
}
.seo-cta h3 { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.seo-cta p {
  font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.5;
}
.btn-cta {
  display: inline-block; padding: 11px 28px; border-radius: 8px;
  background: var(--accent); color: #081008; font-weight: 700;
  font-size: 14px;
}
.btn-cta:hover { opacity: .9; }

/* ── Back/nav links ── */
.back-link {
  font-size: 13px; color: var(--muted); display: inline-flex;
  align-items: center; gap: 4px; margin: 14px 0;
}
.back-link:hover { color: var(--accent); }

/* ── Listing page (/races/all alphabetical index) ── */
.listing-header { padding: 32px 0 24px; }
.listing-header h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.listing-header p { font-size: 14px; color: var(--muted); }
.listing-toc {
  display: flex; flex-wrap: wrap; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 24px;
  position: sticky; top: 0; z-index: 5;
}
.listing-toc a {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 30px; height: 30px; padding: 0 8px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  border-radius: 8px; transition: background .15s, color .15s;
}
.listing-toc a:hover { background: var(--surface2); color: var(--accent); }
.listing-section { scroll-margin-top: 70px; }
.listing-letter {
  font-size: 22px; font-weight: 700; color: var(--accent); margin: 24px 0 10px;
}
.listing-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px; list-style: none; padding: 0; margin: 0;
}
.listing-grid li { list-style: none; }
.listing-event-link {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; color: var(--text);
}
.listing-event-link:hover { border-color: var(--border2); }
.listing-event-name { display: block; font-size: 14px; font-weight: 600; }
.listing-event-meta { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; }

/* ── Editions list ── */
.editions-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px;
  margin-bottom: 20px;
}
.edition-link {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px; color: var(--text);
}
.edition-link:hover { border-color: var(--accent); }
.edition-year {
  font-family: 'DM Mono', monospace; font-size: 20px;
  font-weight: 700; color: var(--accent);
}
.edition-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ── Event page enrichment (CIM-325 anti-thin) ── */
.event-pitch {
  font-size: 15px; line-height: 1.6; color: #c4d6ca;
  margin: 0 0 20px; max-width: 720px;
}
.event-kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px; margin-bottom: 20px;
}
.event-kpi-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.event-kpi-value {
  font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 700;
  color: var(--accent); line-height: 1.1;
}
.event-kpi-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted); margin-top: 4px;
}
.event-history-card { margin-bottom: 20px; }
.event-history-scroll { overflow-x: auto; }
.event-history-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.event-history-table th {
  text-align: left; padding: 8px 10px; font-size: 11px;
  text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap;
}
.event-history-table td {
  padding: 10px; border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.event-history-table tbody tr:last-child td { border-bottom: none; }
.event-history-table .hist-year a {
  font-family: 'DM Mono', monospace; font-weight: 700; color: var(--accent);
}
.event-history-table .hist-date { color: var(--muted); white-space: nowrap; }
.event-history-table .hist-distance { white-space: nowrap; }
.hist-winner-name { display: block; }
.hist-winner-time {
  display: block; font-family: 'DM Mono', monospace;
  font-size: 12px; color: var(--muted); margin-top: 2px;
}
.hist-finishers { font-family: 'DM Mono', monospace; color: var(--muted); }
.event-records-card { margin-bottom: 20px; }
.event-records-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px;
}
.event-record {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.event-record-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
  color: var(--muted);
}
.event-record-time {
  font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 700;
  color: var(--accent); margin-top: 4px;
}
.event-record-runner { font-size: 13px; margin-top: 4px; }
.event-record-runner a { color: inherit; }
.event-record-distance {
  font-size: 12px; color: var(--muted); margin-top: 2px;
}

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border); padding: 24px 20px;
  text-align: center; font-size: 12px; color: var(--muted); margin-top: 40px;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 700px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-value { font-size: 22px; }
  .podium-grid { flex-direction: column; }
  .filter-chips { flex-wrap: wrap; }
  .results-search { margin-left: 0; width: 100%; }
  .race-title { font-size: 22px; }
  /* On mobile: stack title above actions instead of squeezing the title
     into a narrow side column when "Site web" / "Planifier" buttons are
     present. Otherwise the title wraps into 5–6 narrow lines. */
  .race-title-row { flex-wrap: wrap; gap: 8px; align-items: flex-start; }
  .race-header-inner { padding: 14px 16px 0; }
  .race-title { flex-basis: 100%; min-width: 0; }
  .race-header-actions { flex-basis: 100%; flex-wrap: wrap; }
  .btn-header-ghost, .btn-header-green { padding: 8px 12px; font-size: 13px; }
  .results-table { font-size: 12px; }
  .results-table th { font-size: 11px; padding-bottom: 4px; }
  .results-table td { padding: 8px 0; }
  .col-cat { font-size: 11px; }
  .col-nat { font-size: 11px; }
}
