/*
 * Sillage : une seule feuille, écrite à la main. L'interface est en noir, blanc et gris : la couleur est réservée
 * aux coureurs (--athlete-1 à 8), pour qu'on les repère du premier coup sur la carte et les courbes.
 * Classes du système : .btn, .card, .field, .input, .chip, .dot, .table, .stat, .seg, .chart, .runner.
 */

:root {
  --bg: #f4f4f1;
  --surface: #fcfcfb;
  --surface-2: #eeede8;
  --line: #e1e0d9;
  --line-strong: #c3c2b7;
  --text: #0b0b0b;
  --muted: #52514e;
  --faint: #898781;
  --primary: #0f1114;
  --primary-text: #ffffff;
  --danger: #b3261e;
  --danger-soft: #fdecea;
  --ok: #006300;
  --ok-soft: #e6f4e6;
  --shadow: 0 1px 2px rgb(11 11 11 / 5%), 0 6px 20px rgb(11 11 11 / 4%);
  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;

  /* Les huit couleurs de coureur, dans un ordre fixe, et l'encre lisible posée dessus. */
  --athlete-1: #2a78d6; --athlete-1-ink: #ffffff;
  --athlete-2: #eb6834; --athlete-2-ink: #0b0b0b;
  --athlete-3: #1baf7a; --athlete-3-ink: #0b0b0b;
  --athlete-4: #eda100; --athlete-4-ink: #0b0b0b;
  --athlete-5: #e87ba4; --athlete-5-ink: #0b0b0b;
  --athlete-6: #008300; --athlete-6-ink: #ffffff;
  --athlete-7: #4a3aa7; --athlete-7-ink: #ffffff;
  --athlete-8: #e34948; --athlete-8-ink: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #262624;
    --line: #2c2c2a;
    --line-strong: #383835;
    --text: #ffffff;
    --muted: #c3c2b7;
    --faint: #898781;
    --primary: #f1efea;
    --primary-text: #131311;
    --danger: #f2877f;
    --danger-soft: #3a1b18;
    --ok: #0ca30c;
    --ok-soft: #132a13;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%);

    --athlete-1: #3987e5; --athlete-1-ink: #ffffff;
    --athlete-2: #d95926; --athlete-2-ink: #ffffff;
    --athlete-3: #199e70; --athlete-3-ink: #0b0b0b;
    --athlete-4: #c98500; --athlete-4-ink: #0b0b0b;
    --athlete-5: #d55181; --athlete-5-ink: #ffffff;
    --athlete-6: #008300; --athlete-6-ink: #ffffff;
    --athlete-7: #9085e9; --athlete-7-ink: #0b0b0b;
    --athlete-8: #e66767; --athlete-8-ink: #0b0b0b;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
}

h1, h2, h3, p, figure { margin: 0; }
h1 { font-size: 1.65rem; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 1.08rem; line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 0.95rem; line-height: 1.3; }
a { color: inherit; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.num { font-variant-numeric: tabular-nums; }
.icon { flex: none; }
.nowrap { white-space: nowrap; }

:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 6px; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 2000; background: var(--surface); padding: 8px 12px; }

/* --- En-tête ------------------------------------------------------------ */

.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar__inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 8px 20px;
  flex-wrap: wrap;
}
.topbar__actions { margin-left: auto; display: flex; gap: 8px; }
.topbar form { margin: 0; }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; text-decoration: none; letter-spacing: -0.02em; font-size: 1.05rem; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
}

.nav { display: flex; gap: 2px; margin-right: auto; flex-wrap: wrap; }
@media (max-width: 640px) {
  .topbar__inner > form { margin-left: auto; }
  .nav { order: 3; width: 100%; margin: 0 -8px; }
}
.nav__link { padding: 6px 11px; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 500; }
.nav__link:hover, .nav__link.is-current { color: var(--text); background: var(--surface-2); }

/* --- Page ---------------------------------------------------------------- */

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 28px 20px 56px; flex: 1; }
.container.narrow { max-width: 460px; }
.container.medium { max-width: 720px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin-top: 4px; }
.page-head__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.page-head__actions form { margin: 0; }

.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 0.9rem; margin-bottom: 10px; }
.crumb:hover { color: var(--text); }

.stack { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.stack--lg { gap: 24px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.flash { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: var(--radius); margin-bottom: 18px; }
.flash .icon { margin-top: 3px; }
.flash--notice { background: var(--ok-soft); color: var(--text); }
.flash--notice .icon { color: var(--ok); }
.flash--alert { background: var(--danger-soft); color: var(--text); border-left: 3px solid var(--danger); }

/* --- Boutons ------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn--primary:hover { background: var(--primary); opacity: 0.88; }
.btn--quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn--quiet:hover { color: var(--text); }
.btn--danger { color: var(--danger); }
.btn--small { padding: 5px 10px; font-size: 0.9rem; }
.btn--wide { width: 100%; }
.btn--icon { padding: 8px; }

/* --- Cartes, formulaires ------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card--pad { padding: 18px 20px; }
.card__head { padding: 14px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card__body { padding: 16px 20px; }

.field { display: grid; gap: 5px; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: 6px; }
.field__label { font-weight: 550; font-size: 0.92rem; }
.field__hint { color: var(--muted); font-size: 0.88rem; }
.field__error { color: var(--danger); font-size: 0.88rem; }
.fields { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.input, .select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus-visible, .select:focus-visible { outline-offset: 0; }

.copy { display: flex; gap: 8px; }
.copy .input { font-variant-numeric: tabular-nums; min-width: 0; }

.auth-head { text-align: center; margin: 12px 0 22px; }
.auth-head p { color: var(--muted); margin-top: 6px; }
.auth-links { text-align: center; margin-top: 16px; color: var(--muted); }

/* --- Pastilles, vignettes -------------------------------------------------- */

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--faint); }
.chip { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 0.8rem; font-weight: 550; white-space: nowrap; }

.dot--1, .lane--1 { background: var(--athlete-1); color: var(--athlete-1-ink); }
.dot--2, .lane--2 { background: var(--athlete-2); color: var(--athlete-2-ink); }
.dot--3, .lane--3 { background: var(--athlete-3); color: var(--athlete-3-ink); }
.dot--4, .lane--4 { background: var(--athlete-4); color: var(--athlete-4-ink); }
.dot--5, .lane--5 { background: var(--athlete-5); color: var(--athlete-5-ink); }
.dot--6, .lane--6 { background: var(--athlete-6); color: var(--athlete-6-ink); }
.dot--7, .lane--7 { background: var(--athlete-7); color: var(--athlete-7-ink); }
.dot--8, .lane--8 { background: var(--athlete-8); color: var(--athlete-8-ink); }

.ink--1 { color: var(--athlete-1); } .ink--2 { color: var(--athlete-2); } .ink--3 { color: var(--athlete-3); }
.ink--4 { color: var(--athlete-4); } .ink--5 { color: var(--athlete-5); } .ink--6 { color: var(--athlete-6); }
.ink--7 { color: var(--athlete-7); } .ink--8 { color: var(--athlete-8); }

/* Numéro de couloir : la couleur ne porte jamais seule l'identité d'un coureur. */
.lane { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: 0.76rem; font-weight: 700; flex: none; font-variant-numeric: tabular-nums; }

.shape { display: block; flex: none; }
.shape__line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.shape__start { fill: var(--surface); stroke: var(--text); stroke-width: 2; }

/* --- Listes -------------------------------------------------------------- */

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }

.seg { display: flex; gap: 14px; align-items: center; padding: 14px 16px; text-decoration: none; }
.seg:hover { border-color: var(--line-strong); }
.seg__body { min-width: 0; display: grid; gap: 2px; }
.seg__name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg__meta { color: var(--muted); font-size: 0.9rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 12px 16px; display: grid; gap: 2px; }
.stat__label { color: var(--muted); font-size: 0.82rem; }
.stat__value { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.01em; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.table th { text-align: left; font-weight: 550; color: var(--muted); font-size: 0.82rem; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table a { text-decoration: none; font-weight: 550; }
.table a:hover { text-decoration: underline; }
.table__actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table__actions form { margin: 0; }

.empty { text-align: center; padding: 40px 24px; display: grid; gap: 10px; justify-items: center; }
.empty p { color: var(--muted); max-width: 52ch; }
.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); text-align: left; margin: 10px 0; width: 100%; padding: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); display: grid; gap: 4px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--primary-text); font-weight: 700; font-size: 0.8rem; }
.steps span { color: var(--muted); font-size: 0.9rem; }

.hint { margin-top: 14px; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; color: var(--muted); }

.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter { display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--line-strong); border-radius: 999px; text-decoration: none; font-size: 0.9rem; background: var(--surface); }
.filter.is-current { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }

/* --- Import -------------------------------------------------------------- */

.drop { display: grid; gap: 8px; justify-items: center; text-align: center; padding: 30px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; }
.drop.is-over { border-color: var(--text); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--text); outline-offset: 2px; }
.drop__files { color: var(--muted); font-size: 0.9rem; max-width: 60ch; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.swatch span { display: block; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.swatch input:checked + span { box-shadow: 0 0 0 2px var(--text); }
.swatch input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }

/* --- Cartes géographiques ------------------------------------------------- */

.map { height: 380px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: var(--surface-2); z-index: 0; }
.map--tall { height: 460px; }
.leaflet-container { font: inherit; background: var(--surface-2); }
.leaflet-control-attribution { font-size: 11px; }

/* Sélecteur de fond et logo Google : même allure que les boutons de zoom de la carte. */
.map-layers { appearance: none; padding: 6px 28px 6px 10px; border: 2px solid rgb(0 0 0 / 20%); border-radius: 4px; background-color: #ffffff; background-clip: padding-box; background-image: linear-gradient(45deg, transparent 50%, #52514e 50%), linear-gradient(135deg, #52514e 50%, transparent 50%); background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%; background-size: 5px 5px; background-repeat: no-repeat; color: #17191d; font: 550 13px/1.2 var(--sans); cursor: pointer; }
.map-layers:focus-visible { outline: 2px solid #17191d; outline-offset: 1px; }
.map-google { display: block; height: 18px; width: auto; }

.route-casing { stroke: #ffffff; stroke-width: 7; stroke-opacity: 0.9; fill: none; }
.route-line { stroke: #17191d; stroke-width: 3; stroke-opacity: 0.85; fill: none; }
.route-line--muted { stroke: #6b6a66; stroke-opacity: 0.7; }
.route-line--selected { stroke: #17191d; stroke-width: 5; stroke-opacity: 1; }

.pin { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #17191d; color: #ffffff; border: 2px solid #ffffff; font-size: 11px; font-weight: 700; box-shadow: 0 1px 4px rgb(0 0 0 / 35%); }
.pin--finish { background: #ffffff; color: #17191d; border-color: #17191d; }
.pin--loop { width: 34px; border-radius: 12px; }
.pin--drag { cursor: grab; width: 28px; height: 28px; }

.runner { position: relative; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #ffffff; font-size: 12px; font-weight: 700; box-shadow: 0 1px 5px rgb(0 0 0 / 40%); font-variant-numeric: tabular-nums; }
/* Le halo d'un coureur bat à sa fréquence cardiaque : --beat est la durée d'un battement. */
.runner.is-beating::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; background: inherit; z-index: -1; animation: halo var(--beat, 1s) ease-out infinite; }
@keyframes halo {
  0% { transform: scale(1); opacity: 0.55; }
  70%, 100% { transform: scale(2.3); opacity: 0; }
}

/* --- Sélection d'un tronçon ----------------------------------------------- */

.range2 { position: relative; height: 34px; }
.range2__track { position: absolute; left: 0; right: 0; top: 15px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.range2__fill { position: absolute; top: 15px; height: 4px; border-radius: 2px; background: var(--text); }
.range2 input { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; appearance: none; -webkit-appearance: none; height: 34px; }
.range2 input::-webkit-slider-runnable-track { background: none; height: 4px; }
.range2 input::-moz-range-track { background: none; height: 4px; }
.range2 input::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text); cursor: grab; }
.range2 input::-moz-range-thumb { pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text); cursor: grab; }
.range2 input:focus-visible { outline: none; }
.range2 input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--text); outline-offset: 2px; }
.range2 input:focus-visible::-moz-range-thumb { outline: 2px solid var(--text); outline-offset: 2px; }

.nudge { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.nudge__group { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9rem; }

/* --- Graphiques ---------------------------------------------------------- */

.chart { position: relative; }
.chart__title { font-size: 0.92rem; font-weight: 650; }
.chart__sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 6px; }
.chart canvas { display: block; width: 100%; touch-action: pan-y; border-radius: 6px; }
.chart canvas:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.chart__tip { position: absolute; top: 0; left: 0; z-index: 5; pointer-events: none; min-width: 150px; padding: 8px 10px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: 0.85rem; display: grid; gap: 3px; }
.chart__tip-head { color: var(--muted); font-size: 0.8rem; margin-bottom: 2px; }
.chart__tip-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.chart__tip-row strong { font-variant-numeric: tabular-nums; }
.chart__tip-row span:last-child { color: var(--muted); }
.key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; flex: none; background: var(--faint); }
.key--1 { background: var(--athlete-1); } .key--2 { background: var(--athlete-2); } .key--3 { background: var(--athlete-3); }
.key--4 { background: var(--athlete-4); } .key--5 { background: var(--athlete-5); } .key--6 { background: var(--athlete-6); }
.key--7 { background: var(--athlete-7); } .key--8 { background: var(--athlete-8); }

.legend { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-bottom: 8px; font-size: 0.88rem; color: var(--muted); }
.legend__item { display: inline-flex; align-items: center; gap: 7px; }

.tabs { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); gap: 2px; flex-wrap: wrap; }
.tab { padding: 5px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-weight: 550; font-size: 0.9rem; cursor: pointer; }
.tab:hover { color: var(--text); }
.tab.is-current, .tab[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / 12%); }

/* --- Comparaison --------------------------------------------------------- */

.compare__row { display: grid; grid-template-columns: auto minmax(120px, 1fr) minmax(220px, 2fr) auto; gap: 10px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.compare__row:last-of-type { border-bottom: 0; }
.compare__row.is-off .chip, .compare__row.is-off .select { opacity: 0.45; }
.check { width: 18px; height: 18px; accent-color: var(--primary); }
@media (max-width: 640px) {
  .compare__row { grid-template-columns: auto 1fr auto; }
  .compare__row .select { grid-column: 1 / -1; }
}

.race { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: stretch; }
.race__map { height: 520px; }
.race__side { display: flex; flex-direction: column; min-height: 0; }
.board { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; flex: 1; }
.board__row { display: grid; grid-template-columns: 18px 22px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 9px 16px; }
.board__row + .board__row { border-top: 1px solid var(--line); }
.board__rank { color: var(--faint); font-weight: 650; font-variant-numeric: tabular-nums; }
.board__name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board__date { color: var(--muted); font-size: 0.82rem; }
.board__speed { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.board__gap { text-align: right; color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pulse { grid-column: 3 / -1; display: flex; align-items: center; gap: 5px; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.pulse__heart { display: inline-grid; }
.pulse__heart.is-beating { animation: beat var(--beat, 1s) ease-in-out infinite; }
.pulse__value { font-size: 0.95rem; min-width: 3ch; text-align: right; }
.pulse__unit { color: var(--muted); white-space: nowrap; }
.pulse__meter { flex: 1; height: 6px; margin-left: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.pulse__fill { display: block; width: 0; height: 100%; border-radius: 3px; transition: width 0.25s linear; }
@keyframes beat {
  0%, 42%, 100% { transform: scale(1); }
  12% { transform: scale(1.3); }
  24% { transform: scale(1.02); }
  33% { transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .pulse__heart.is-beating { animation: none; }
  .runner.is-beating::after { content: none; }
}

.board__extra { grid-column: 3 / -1; color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; display: flex; gap: 12px; flex-wrap: wrap; }

.transport { display: grid; gap: 10px; padding: 14px 18px; }
.transport__bar { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.transport__clock { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; min-width: 5.2ch; }
.transport__total { color: var(--muted); font-variant-numeric: tabular-nums; }
.transport__speeds { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.play { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--primary); color: var(--primary-text); display: grid; place-items: center; cursor: pointer; flex: none; }
.play:hover { opacity: 0.88; }
.play:disabled { opacity: 0.4; cursor: progress; }
.scrub { width: 100%; accent-color: var(--primary); margin: 0; }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; color: var(--muted); cursor: pointer; }

@media (max-width: 900px) {
  .race { grid-template-columns: 1fr; }
  .race__map { height: 56vh; min-height: 320px; }
  .board { max-height: 260px; }
  .transport__speeds { margin-left: 0; }
}

details.more { margin-top: 16px; }
details.more > summary { cursor: pointer; color: var(--muted); font-weight: 550; padding: 4px 0; }
details.more[open] > summary { margin-bottom: 10px; }
