/* Mise en page : une colonne « feuille de match » — bandeaux par jour, chaque créneau en carte avec ses missions. */
/* Couleurs du site du Challenge (challenge.escrime-parmentier.fr) : bleu, rouge, orange, vert, bleu nuit. */
:root {
  --bg: #f2f6f8;
  --surface: #ffffff;
  --ink: #09212d;
  --muted: #4f6470;
  --line: #d3dee4;
  --accent: #1a7db3;        /* bleu du site, assombri pour rester lisible en blanc dessus */
  --accent-ink: #ffffff;
  --accent-soft: #dcedf7;
  --red: #ca2945;
  --ok: #3f6b0f; --ok-soft: #e8f3d3;
  --warn: #a5520f; --warn-soft: #fbe8d9;
  --crit: #ca2945; --crit-soft: #f9e0e4;
  --ven: #526d0d; --sam: #1a7db3; --dim: #b04a12;
  --display: "Space Grotesk", Helvetica, Arial, sans-serif;
  --body: "Poppins", Helvetica, Arial, sans-serif;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root {
  --bg: #09212d; --surface: #0f2d3c; --ink: #e9f1f5; --muted: #9db3bf; --line: #1f4558;
  --accent: #2c9cd8; --accent-ink: #04141c; --accent-soft: #113a50; --red: #e8566f;
  --ok: #93c318; --ok-soft: #1e2e0a; --warn: #ef7724; --warn-soft: #3a210d; --crit: #e8566f; --crit-soft: #3b1219;
  --ven: #93c318; --sam: #2c9cd8; --dim: #ef7724; color-scheme: dark } }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; }
[hidden] { display: none !important; }
.wrap { max-width: 860px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 28px 120px; display: grid; gap: 28px; }
.stack { display: grid; gap: 18px; }
.stack-lg { display: grid; gap: 28px; }
.stack-xs { display: grid; gap: 4px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.05; }
h1 { font-size: clamp(2rem, 6vw, 3rem); font-weight: 700; letter-spacing: -.01em; }
h1::after { content: ""; display: block; width: 64px; height: 4px; margin-top: 14px; background: var(--red); border-radius: 2px; }
h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.005em; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0; }
.eyebrow { font-family: var(--display); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--red); font-size: .85rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lede { max-width: 62ch; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }

header.hero { display: grid; gap: 10px; }
.dates { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.date-pill { font-family: var(--display); font-weight: 600; font-size: .95rem; padding: 4px 12px; border-radius: 999px; border: 1.5px solid currentColor; }
.c-ven { color: var(--ven); --day: var(--ven); } .c-sam { color: var(--sam); --day: var(--sam); } .c-dim { color: var(--dim); --day: var(--dim); }

.tabs { display: flex; gap: 6px; border-bottom: 1.5px solid var(--line); flex-wrap: wrap; }
.tab { background: none; border: 0; padding: 10px 14px; font-family: var(--display); font-size: 1.05rem; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1.5px; }
.tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.notice { padding: 12px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--ink); border: 1px solid var(--line); font-size: .95rem; }
.notice strong { color: var(--warn); }
.notice.info { background: var(--surface); }
.notice.success { background: var(--ok-soft); }
.notice.success strong { color: var(--ok); }


.day { display: grid; gap: 12px; color: var(--ink); }
.day-head { display: flex; align-items: baseline; gap: 12px; border-left: 6px solid var(--day); padding-left: 12px; }
.day-head h2 { color: var(--day); }
.slot { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 12px; }
.slot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.time { font-family: var(--display); font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.slot-hint { font-size: .85rem; color: var(--muted); }
.missions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.mission { position: relative; text-align: left; background: var(--bg); color: var(--ink); border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; cursor: pointer; display: grid; gap: 6px; min-width: 0; }
.mission:hover:not(:disabled) { border-color: var(--accent); }
.mission[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.mission:disabled { cursor: not-allowed; opacity: .6; }
.m-top { display: flex; justify-content: space-between; gap: 8px; align-items: start; }
.m-name { font-weight: 600; line-height: 1.25; }
.check { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; color: var(--accent-ink); }
.mission[aria-pressed="true"] .check { background: var(--accent); border-color: var(--accent); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; position: relative; }
.bar i { position: absolute; inset: 0 auto 0 0; background: var(--fill, var(--crit)); border-radius: 3px; }
.bar .min { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--ink); opacity: .45; }
.m-meta { display: flex; justify-content: space-between; gap: 8px; font-size: .85rem; font-variant-numeric: tabular-nums; }
.pill { font-size: .78rem; font-weight: 600; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.pill.crit { background: var(--crit-soft); color: var(--crit); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.names { font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; }
.fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
label { display: grid; gap: 4px; font-size: .9rem; font-weight: 500; min-width: 0; }
input[type=text], input[type=tel], input[type=password], select.field { width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
input:focus, select:focus { border-color: var(--accent); outline: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.recap { margin: 0; padding-left: 18px; display: grid; gap: 2px; }
.recap .none { list-style: none; margin-left: -18px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.spread { justify-content: space-between; }
.btn { border: 0; border-radius: 8px; padding: 11px 18px; font-weight: 600; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; display: inline-block; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.danger { background: transparent; color: var(--crit); border: 1.5px solid var(--crit); }
.btn.sm { padding: 6px 10px; font-size: .85rem; }
.msg { font-size: .95rem; }
.msg.err { color: var(--crit); }
.msg.ok { color: var(--ok); }
.privacy { font-size: .82rem; color: var(--muted); }
.link-box { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link-box input { flex: 1 1 260px; min-width: 0; font-size: .85rem; }

.bottom { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: var(--bg); padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding-top: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); z-index: 5; }
.bottom-in { max-width: 860px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bottom b { font-family: var(--display); font-size: 1.2rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--display); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--bg); white-space: nowrap; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td ul { margin: 0; padding-left: 16px; }
tr:last-child td { border-bottom: 0; }
.empty { padding: 22px; text-align: center; color: var(--muted); }

.need-rows { display: grid; gap: 8px; }
.need-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 90px auto; gap: 12px; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }
.need-row:first-child { border-top: 0; padding-top: 0; }
.num-field { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); font-weight: 500; }
input[type=number] { width: 64px; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font-variant-numeric: tabular-nums; }
input[type=number].invalid { border-color: var(--crit); }
select.add-m { justify-self: start; padding: 8px 10px; border: 1.5px dashed var(--line); border-radius: 8px; background: transparent; color: var(--ink); font-size: .9rem; cursor: pointer; }
.sticky-bar { position: sticky; bottom: env(safe-area-inset-bottom, 0px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: 0 -4px 16px rgba(0,0,0,.08); }
.slot-select { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: center; }
.slot-select span { font-variant-numeric: tabular-nums; font-size: .9rem; }
.login { max-width: 380px; }

@media (max-width: 640px) {
  .fields { grid-template-columns: 1fr; }
  .need-row { grid-template-columns: 1fr 1fr; }
  .need-row .m-name { grid-column: 1 / -1; }
  .slot-select { grid-template-columns: 1fr; gap: 4px; }
}
@media (prefers-reduced-motion: no-preference) { .mission, .btn { transition: border-color .15s, background-color .15s, opacity .15s; } }
