:root {
  /* Couleurs alignées sur le logiciel de bureau (blanc et bleu). */
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #15294f;
  --muted: #5f6f8c;
  --accent: #1f5ae0;
  --border: #dce5f4;
  --danger: #b42318;
  --present: #1f6feb;
  --absent: #c62828;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1.5rem;
  background: var(--accent);
  color: white;
}
.topbar .brand { color: white; font-size: 1.3rem; font-weight: 700; text-decoration: none; }
.topbar .subtitle { opacity: 0.85; }
.topbar .who { font-weight: 600; }

.spacer { flex: 1; }
.hidden { display: none; }

main { max-width: 1250px; margin: 1.25rem auto; padding: 0 1rem; display: grid; gap: 1rem; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.card h2 { margin: 0; font-size: 1.1rem; }
.card-head { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.75rem; }

.login { max-width: 460px; margin: 3rem auto; display: grid; gap: 0.75rem; }
.login form { display: flex; gap: 0.5rem; }
.login input { flex: 1; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"], select {
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
  color: var(--text);
  background: white;
}

button, .button {
  padding: 0.42rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}
button:disabled { opacity: 0.45; cursor: default; }
button.light, .button.light { background: white; color: var(--accent); }
.topbar button.light { border-color: white; }
button.danger { background: white; border-color: var(--danger); color: var(--danger); }
button.small { padding: 0.2rem 0.55rem; font-size: 0.85rem; }

/* Listes */
table.list { width: 100%; border-collapse: collapse; background: white; }
table.list th, table.list td { text-align: left; padding: 0.42rem 0.55rem; border-bottom: 1px solid var(--border); }
table.list th { font-size: 0.82rem; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: white; }
table.list td.name { font-weight: 600; }
table.list .number { text-align: right; }
table.list td.actions { text-align: right; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover { background: #f7f2f2; }
table.list tr.absent td { color: var(--muted); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid #0002; }

/* Compétition */
.contest-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  border: 1px solid #0002;
}
.contest-header .title { display: grid; gap: 0.1rem; }
.contest-header h2 { margin: 0; font-size: 1.25rem; }
.contest-header .back { color: #222; text-decoration: none; font-size: 0.85rem; }
.contest-header .meta { display: grid; text-align: right; font-weight: 600; }

.toolbar { display: flex; align-items: center; gap: 0.5rem; }
.stage-error { color: var(--danger); font-weight: 600; margin-right: 0.5rem; }

.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 2px solid var(--border); }
.tabs .tab {
  background: transparent;
  color: var(--text);
  border: none;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  padding: 0.5rem 0.8rem;
}
.tabs .tab.active { border-bottom-color: var(--accent); color: var(--accent); font-weight: 600; }

.stage { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; min-height: 300px; }
.stage-bar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.tally .present { color: var(--present); font-size: 1.2rem; }
.tally .absent { color: var(--absent); font-size: 1.2rem; }

/* Fenêtres */
.overlay {
  position: fixed;
  inset: 0;
  background: #0006;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5vh;
  z-index: 10;
}
.dialog {
  background: white;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  width: min(760px, 94vw);
  max-height: 88vh;
  overflow: auto;
  display: grid;
  gap: 0.8rem;
  box-shadow: 0 12px 40px #0004;
}
.dialog h2 { margin: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.6rem 1rem; }
.fields label, .dialog > label { display: grid; gap: 0.2rem; font-size: 0.85rem; color: var(--muted); }
.fields label.wide { grid-column: 1 / -1; }
label.check { display: flex !important; align-items: center; gap: 0.5rem; color: var(--text) !important; }
.buttons { display: flex; gap: 0.5rem; justify-content: flex-end; align-items: center; }

.muted { color: var(--muted); }
.error { color: var(--danger); }

/* Phases à venir (réglables avant leur début) */
.tabs .tab.future { color: var(--muted); font-style: italic; }
button.active { background: var(--accent) !important; color: white !important; }

label.inline { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.9rem; }
label.inline input[type="number"] { width: 4.5rem; }
.inline-list { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; align-items: center; margin-top: 0.3rem; }

/* Réglages repliables */
details.settings { border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.8rem; margin-bottom: 0.75rem; background: #fafbfc; }
details.settings summary { cursor: pointer; font-weight: 600; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.8rem 1.5rem; padding: 0.6rem 0; }
.settings-grid > div { display: grid; gap: 0.3rem; align-content: start; }
.settings-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; padding: 0.5rem 0; }

/* Entraînement des jeunes */
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0.8rem; }
.group-head { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; margin-bottom: 0.4rem; }
ul.fencers { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
ul.fencers li { display: flex; justify-content: space-between; padding: 0.2rem 0.4rem; border-radius: 4px; background: #f6f7f9; cursor: grab; }
.drop-over { outline: 3px dashed var(--accent); outline-offset: 2px; }

/* Composition des poules */
.pools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; }
@media (max-width: 900px) { .pools-grid { grid-template-columns: 1fr; } }
.pool-head { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.3rem; font-size: 1.05rem; }
.pool-head .ok { color: #2e7d32; }
.pool-head .ko { color: var(--danger); }
.roadmap { color: darkgreen; font-style: italic; font-weight: 600; }
table.compact td, table.compact th { padding: 0.2rem 0.4rem; }
tr.draggable { cursor: grab; }
td.mark { width: 1.2rem; color: #b26a00; }

/* Feuille de poule : les cases gardent leur taille, les noms se réduisent. */
.sheet-head { display: flex; gap: 1rem; align-items: baseline; }
.sheet-head h3 { margin: 0.2rem 0 0.6rem; }
.sheet-wrap { overflow-x: auto; }
table.sheet { border-collapse: collapse; }
table.sheet th, table.sheet td { white-space: nowrap; }
table.sheet th.num { width: 44px; min-width: 44px; max-width: 44px; text-align: center; font-weight: 600; padding: 0 0 2px; }
table.sheet th.head { font-size: 0.75rem; color: var(--muted); padding: 0 0.3rem; font-weight: 600; }
table.sheet td.name {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 0.5rem;
  text-align: right;
  color: #00008b;
  font-size: 0.9rem;
}
table.sheet td.pos { width: 1.8rem; padding-right: 0.3rem; text-align: right; font-weight: 700; }
table.sheet td.cell {
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  border: 2px solid #222;
  text-align: center;
  padding: 0;
  background: white;
}
table.sheet td.cell.grey { background: #bebebe; }
table.sheet td.dash { padding: 0 0.45rem; text-align: center; font-size: 0.95rem; }
table.sheet td.dash select { font-size: 0.8rem; padding: 0.1rem; }
table.sheet td.dash.rank { font-weight: 700; }
table.sheet td.cell input.score {
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: none;
  padding: 0;
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  background: transparent;
  text-transform: uppercase;
}
input.score:focus { outline: 3px solid #87ceeb; background: #eaf7ff; }
input.score.error { background: #f4b6b6; }
.bouts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0.4rem 1.5rem; }
.bout { display: flex; gap: 0.6rem; align-items: center; padding: 0.25rem 0; border-bottom: 1px solid var(--border); }
.bout .opponent { display: inline-flex; gap: 0.3rem; align-items: center; }
.bout input.score { width: 3rem; height: 1.8rem; border: 1px solid var(--border); border-radius: 4px; text-align: center; font-weight: 700; text-transform: uppercase; }

/* Tableaux */
.bracket-scroll { overflow: auto; max-height: 75vh; border: 1px solid var(--border); border-radius: 6px; }
.bracket { position: relative; }
.bracket svg.connectors { position: absolute; left: 0; top: 0; pointer-events: none; }
.b-header { position: absolute; font-weight: 700; display: flex; align-items: center; justify-content: center; background: #eef0f4; border-radius: 4px; }
.b-cell { position: absolute; display: flex; align-items: center; gap: 0.4rem; padding: 0 0.3rem; overflow: hidden; white-space: nowrap; font-size: 0.9rem; }
.b-cell strong { color: #00008b; }
.b-cell .club { color: dimgrey; font-style: italic; font-size: 0.8rem; }
.b-label { position: absolute; font-size: 0.75rem; color: var(--muted); display: flex; gap: 0.4rem; align-items: center; }
input.b-score { position: absolute; border: 1px solid #999; border-radius: 3px; background: white; font-size: 0.9rem; }

/* Impression */
@media print {
  .topbar, .toolbar, .tabs, .stage-bar, details.settings, .card-head button, .actions, button { display: none !important; }
  body { background: white; }
  main { max-width: none; margin: 0; padding: 0; }
  .stage { border: none; padding: 0; }
  .contest-header { border: 1px solid #888; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.sheet td.cell.grey, .b-header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .bracket-scroll { overflow: visible; max-height: none; border: none; }
  input.score { border: none !important; }
}

/* Feuilles de match (barrage, tableaux) */
.match-sheet { border-bottom: 1px dashed #c0c0c0; padding: 4mm 0 5mm; break-inside: avoid; }
.ms-head { display: flex; align-items: center; gap: 8mm; margin-bottom: 3mm; }
.ms-name { font-size: 1.15rem; font-weight: 700; color: grey; }
.ms-box { display: inline-flex; align-items: center; gap: 4px; min-width: 45mm; min-height: 7mm; border: 1px solid #ccc; padding: 0 6px; color: darkgreen; font-weight: 700; }
.ms-label { color: grey; font-size: 0.7rem; font-weight: 700; }
.ms-fencer { display: grid; grid-template-columns: 55mm 1fr 14mm 40mm; align-items: center; gap: 3mm; margin: 2mm 0; }
.ms-identity { display: flex; flex-direction: column; font-size: 0.8rem; }
.ms-identity strong { color: darkblue; }
.ms-identity .muted { font-style: italic; font-size: 0.7rem; }
.ms-touches { display: grid; grid-template-columns: repeat(15, 6.2mm); gap: 1px; }
.ms-touch { width: 6mm; height: 6mm; border: 1px solid #222; font-size: 0.6rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.ms-score { height: 8mm; border: 1.5px solid #222; }
.ms-signature { height: 8mm; background: #d9d9d9; color: #f2f2f2; font-weight: 700; display: flex; align-items: center; justify-content: center; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bout .winner { color: #168456; font-weight: 700; }

/* Feuilles des groupes (entraînement des jeunes) */
.print-sheets { position: fixed; inset: 0; z-index: 20; background: #e8eaee; overflow: auto; padding: 1rem; }
.print-bar { position: sticky; top: 0; display: flex; gap: 0.6rem; align-items: center; background: white; padding: 0.6rem 1rem; border-radius: 8px; margin-bottom: 1rem; box-shadow: 0 2px 8px #0002; }
.print-page { background: white; width: 210mm; min-height: 290mm; margin: 0 auto 1rem; padding: 10mm; box-shadow: 0 2px 10px #0003; }
.page-header { display: flex; justify-content: space-between; align-items: center; border: 1px solid #888; background: #eed680; padding: 6px 10px; margin-bottom: 8px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.page-header .group-title { font-size: 1.6rem; font-weight: 800; }
.page-pools { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin-bottom: 6mm; }
.print-pool .pp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; font-size: 0.85rem; }
.print-pool .box-label { color: grey; font-weight: 700; }
.print-pool .box-line { flex: 1; border-bottom: 1px solid #555; min-width: 40px; height: 1em; }
.print-pool .box-line.short { flex: 0 0 40px; }
table.sheet.print td.cell { width: 30px; min-width: 30px; max-width: 30px; height: 30px; border: 1.5px solid #222; }
table.sheet.print td.cell.small { width: 24px; min-width: 24px; max-width: 24px; border-width: 1px; }
table.sheet.print td.name { max-width: 120px; font-size: 0.72rem; }
table.sheet.print th.num { width: 30px; min-width: 30px; font-size: 0.75rem; }
table.sheet.print th.head { font-size: 0.6rem; padding: 0 2px; }
table.sheet.print td.cell.grey { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pp-bouts { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 4px; font-size: 0.68rem; }
.pp-bout { display: flex; gap: 6px; align-items: center; border-bottom: 1px dotted #bbb; }
.pp-bout > strong { width: 2.2em; }
.pp-bout > div { flex: 1; }
.pp-opp { display: flex; justify-content: space-between; gap: 4px; }
.touches { display: inline-flex; gap: 1px; }
.touch { display: inline-block; width: 10px; height: 10px; border: 1px solid #333; font-size: 6px; line-height: 10px; text-align: center; }
.print-bracket { position: relative; overflow: hidden; }
.bs-slot { position: absolute; border-bottom: 1.5px solid #333; font-size: 12px; font-weight: 700; color: #00008b; white-space: nowrap; overflow: hidden; }
.bs-score { position: absolute; border: 1px solid #555; background: white; }
.bs-match { position: absolute; font-size: 10px; color: #666; white-space: nowrap; }
.bs-title { position: absolute; font-size: 14px; font-weight: 800; white-space: nowrap; }

@media print {
  @page { size: A4; margin: 8mm; }
  body.print-groups * { visibility: hidden; }
  body.print-groups .print-sheets, body.print-groups .print-sheets * { visibility: visible; }
  body.print-groups .print-sheets { position: absolute; left: 0; top: 0; padding: 0; background: white; overflow: visible; }
  body.print-groups .print-bar { display: none !important; }
  body.print-groups .print-page { box-shadow: none; margin: 0; padding: 0; width: auto; min-height: 0; page-break-after: always; break-after: page; }
}

/* Navigation */
.topnav { display: flex; gap: 0.25rem; }
.topnav a { color: white; text-decoration: none; padding: 0.3rem 0.8rem; border-radius: 6px; opacity: 0.85; }
.topnav a.active, .topnav a:hover { background: #ffffff26; opacity: 1; }

/* Fenêtres modales */
.modal-backdrop { position: fixed; inset: 0; background: #0005; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal { background: white; border-radius: 10px; padding: 1.2rem 1.4rem; min-width: 320px; max-width: 640px; max-height: 90vh; overflow: auto; box-shadow: 0 10px 40px #0004; }
.modal h3 { margin-top: 0; }
.modal fieldset { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 0.8rem; }
.modal .actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; align-items: center; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.8rem; align-items: center; }
ul.plain { list-style: none; padding: 0; margin: 0 0 0.6rem; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }

/* Organisation */
.organisation .org-head { flex-wrap: wrap; gap: 1rem; }
.org-clock { font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.org-warnings { display: inline-flex; gap: 0.3rem; }
.warning-box { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.15rem 0.5rem; border-radius: 6px; font-size: 0.8rem; }
.org-time { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.5rem 0; }
.org-time .cursor-time { background: black; color: white; padding: 0.15rem 0.6rem; border-radius: 4px; font-variant-numeric: tabular-nums; }
.org-time .muted { font-size: 0.8rem; }
.org-timeline { width: 100%; height: 48px; display: block; background: white; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }
.org-overlaps { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.5rem 0; }
.org-overlaps button.warning { font-weight: 700; }
.org-columns { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.6fr) minmax(300px, 1.2fr); gap: 1rem; margin-top: 0.8rem; align-items: start; }
.org-columns.no-referees { grid-template-columns: minmax(320px, 1.6fr) minmax(300px, 1.2fr); }
.org-columns.no-pistes { grid-template-columns: minmax(260px, 1fr) minmax(300px, 1.4fr); }
.org-columns.no-referees.no-pistes { grid-template-columns: 1fr; }
@media (max-width: 1100px) { .org-columns, .org-columns.no-referees, .org-columns.no-pistes { grid-template-columns: 1fr; } }
.org-col { border: 1px solid var(--border); border-radius: 8px; padding: 0.6rem; background: #fbfcfe; min-width: 0; }
.org-toolbar { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.5rem; }
.org-toolbar.wrap { flex-wrap: wrap; }
.weapon-tabs, .batch-tabs { display: flex; gap: 0.25rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.batch-tabs { border-left: 4px solid; padding-left: 0.4rem; }
.weapon-tabs button.active, .batch-tabs button.active { background: var(--accent); color: white; }
.hall-scroll { overflow: auto; max-height: 70vh; background: white; border: 1px solid var(--border); border-radius: 6px; }
svg.hall { display: block; user-select: none; touch-action: none; }
svg.hall .piste { cursor: grab; }
svg.hall .piste-bg { stroke: black; stroke-width: 0.75; }
svg.hall .piste.selected .piste-bg { stroke-width: 3; }
svg.hall .piste-id { font: bold 13px sans-serif; }
svg.hall .piste-title { font: 10px sans-serif; }
svg.hall .piste-title.small { font-size: 8px; }
svg.hall .piste-referee { font: bold 8px sans-serif; }
svg.hall .piste-mark { font-size: 12px; }
table.list.jobs tr, table.list.referees tr { cursor: pointer; }
table.list tr.selected td { background: #e4edff; }
table.list tr.held td { outline: 2px solid var(--accent); }
table.list tr.unavailable td { color: #9aa; }
table.list td.icon { width: 1.5em; }
.hint { background: #fff7d6; border: 1px solid #f0d77a; border-radius: 6px; padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.job-board-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.5rem 0.8rem; border-radius: 6px; margin-bottom: 0.5rem; }
.job-board-head strong { font-size: 1.2rem; }
p.small { font-size: 0.78rem; }

/* Tickets repas et carnet de paiement */
.print-page.tickets { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 44mm; gap: 3mm; }
.ticket { border: 1px solid grey; border-radius: 4px; display: grid; grid-template-columns: 1fr 1fr; padding: 2mm; }
.ticket-name { font-size: 0.95rem; }
.ticket-food { display: grid; gap: 1px; }
.ticket-food span { background: #bbb; text-align: right; padding: 0 4px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.payment-title { text-align: center; }
table.payment { width: 100%; border-collapse: collapse; }
table.payment td { border-bottom: 1px solid #999; height: 11mm; padding: 0 4px; }
.page-number { text-align: right; font-weight: 700; }

/* Organisation : les matchs à placer, bien visibles en haut */
.org-columns .org-batches { grid-column: 1 / -1; order: -1; }
.jobs-summary { display: flex; align-items: center; gap: 0.5rem; margin: 0.4rem 0; }
.pill { border-radius: 999px; padding: 0.15rem 0.7rem; font-weight: 700; font-size: 0.85rem; }
.pill.pending { background: #fff3d6; color: #b45309; border: 1px solid #f5c26b; }
.pill.placed { background: #e7f6ec; color: #15803d; border: 1px solid #9fd8b3; }
table.list.jobs thead th { text-align: left; font-size: 0.8rem; color: var(--muted); border-bottom: 1px solid var(--border); }
table.list.jobs tr.to-place { background: #fff9eb; }
table.list.jobs tr.to-place td.state { color: #b45309; font-weight: 700; }
table.list.jobs td.state { white-space: nowrap; color: #15803d; }
table.list.jobs td.center { text-align: center; }
.two-lists { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; max-height: 50vh; overflow: auto; }
.two-lists fieldset { display: flex; flex-direction: column; gap: 0.2rem; }

/* Impression des groupes : arbitres et répartition des matchs */
.print-pool .pp-referees { flex: 1; color: #00008b; font-weight: 700; font-size: 0.75rem; }
.pp-bout .pp-res { width: 7.5em; font-size: 0.6rem; color: #555; line-height: 1.15; }
.pp-bout .pp-res b { color: #00008b; }
.page-header .group-referees { font-size: 0.7rem; font-weight: 700; color: #00008b; text-align: center; }

/* Tableau d'affichage d'une piste (/live/) */
.live-board { position: fixed; inset: 0; background: #000; color: #fff; display: flex; flex-direction: column; font-family: system-ui, sans-serif; }
.live-title { background: #1f5ae0; color: #fff; text-align: center; font-size: 4vh; font-weight: 800; padding: 1.5vh; min-height: 6vh; }
.live-scores { flex: 1; display: grid; grid-template-columns: 1fr 1fr; }
.live-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2vh; }
.live-side.red .live-score { color: #ff5252; }
.live-side.green .live-score { color: #00e676; }
.live-name { font-size: 5vh; font-weight: 700; text-align: center; padding: 0 2vw; }
.live-score { font-size: 30vh; font-weight: 900; line-height: 1; }
.live-clock { text-align: center; font-size: 16vh; font-weight: 800; font-variant-numeric: tabular-nums; }
.live-waiting { position: absolute; top: 45%; width: 100%; text-align: center; font-size: 4vh; color: #aaa; }
.live-piste { position: absolute; right: 1.5vw; bottom: 1.5vh; display: flex; align-items: center; gap: 0.8rem; font-size: 2.5vh; opacity: 0.6; }
.live-piste button { background: #333; color: #fff; border: none; border-radius: 6px; font-size: 2.5vh; padding: 0.2rem 0.9rem; }

/* Impression des groupes remplie */
table.sheet.print td.cell { text-align: center; font-weight: 700; font-size: 0.8rem; }
table.sheet.print td.cell.small { font-weight: 400; font-size: 0.65rem; }
table.sheet.print td.cell.small.rank { font-weight: 800; }
.pp-opp .pp-score { font-weight: 800; color: #00008b; min-width: 1.6em; text-align: right; }
.bs-score { display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }

/* Feuilles de match par équipes (relais) */
.print-page.relay-page { padding: 6mm; }
.print-page.relay-page svg { width: 100%; height: auto; display: block; }

/* Pied de page : licence et crédits */
.app-footer { text-align: center; font-size: 0.8rem; color: var(--muted); padding: 1.5rem 1rem; }
body.print-groups .app-footer { display: none; }
@media print { .app-footer { display: none; } }
