:root {
  --bg: #0a2463;
  --bg-raised: #123a8f;
  --line: #3a5fb5;
  --text: #f4f8ff;
  --muted: #b4c6ee;
  --coral: #ff7a59;
  --gold: #ffd23f;
  --ink: #0a2463;
  --ok: #7be0a4;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-padding-bottom: 7rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.5 var(--sans);
  -webkit-text-size-adjust: 100%;
}

main { max-width: 42rem; margin: 0 auto; padding: 1.5rem 1rem 8rem; }

h1 {
  font: italic 800 clamp(2.4rem, 11vw, 4rem)/0.95 var(--serif);
  letter-spacing: -0.02em;
  margin: 1rem 0 0.5rem;
}
h1 span { color: var(--gold); }
h2 { font: italic 700 1.4rem/1.2 var(--serif); margin: 0 0 0.75rem; }
p { margin: 0 0 1rem; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 34rem; }

.countdown {
  display: inline-block;
  background: var(--coral);
  color: var(--ink);
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: 2rem;
  margin: 0.5rem 0 1.5rem;
}
.countdown.closed { background: var(--gold); }

label.field { display: block; font-weight: 600; margin-bottom: 0.4rem; }
input[type="text"], input[type="password"], select {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 2px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.75rem 0.9rem;
}
input:focus-visible, select:focus-visible, button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

.category { margin-top: 2.75rem; }
.category .count { color: var(--muted); font-size: 0.9rem; margin: -0.4rem 0 0.75rem; }

.options { display: grid; gap: 0.5rem; }
.option {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: var(--bg-raised);
  border: 2px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  min-height: 3rem;
}
.option::before {
  content: "";
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 2px solid var(--muted);
}
.option .sub { display: block; color: var(--muted); font-size: 0.9rem; }
.option[aria-checked="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.option[aria-checked="true"] .sub { color: #5a3a10; }
.option[aria-checked="true"]::before { background: var(--ink); border-color: var(--ink); box-shadow: inset 0 0 0 3px var(--gold); }

.savebar {
  position: fixed;
  inset: auto 0 0 0;
  background: var(--bg-raised);
  border-top: 2px solid var(--line);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
}
.savebar > div { max-width: 42rem; margin: 0 auto; display: flex; gap: 1rem; align-items: center; justify-content: space-between; }
.progress { font-size: 0.95rem; color: var(--muted); }
.progress strong { color: var(--text); }

button.primary {
  font: inherit;
  font-weight: 700;
  background: var(--coral);
  color: var(--ink);
  border: 0;
  border-radius: 0.6rem;
  padding: 0.75rem 1.25rem;
  cursor: pointer;
}
button.primary:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost {
  font: inherit;
  background: none;
  color: var(--text);
  border: 2px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.msg { padding: 0.75rem 1rem; border-radius: 0.6rem; margin: 1rem 0; font-weight: 600; }
.msg.ok { background: rgba(123, 224, 164, 0.15); color: var(--ok); }
.msg.err { background: rgba(255, 90, 122, 0.18); color: #ffb3c1; }

/* Résultats après la fermeture */
.results .option { cursor: default; flex-wrap: wrap; }
.results .option::before { display: none; }
.results .option.winner { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.results .option.winner .sub { color: #5a3a10; }
.results .who { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.15rem; }
.chip { font-size: 0.85rem; font-weight: 500; background: rgba(255, 255, 255, 0.12); border-radius: 1rem; padding: 0.05rem 0.6rem; }
.winner .chip { background: rgba(42, 16, 48, 0.18); }

.board { list-style: none; padding: 0; margin: 0 0 1rem; counter-reset: rank; }
.board li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
}
.board li:first-child { font-weight: 700; color: var(--gold); }
.board .pts { font-variant-numeric: tabular-nums; }

/* Admin */
.panel { border-top: 2px solid var(--line); padding-top: 1.5rem; margin-top: 2rem; }
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.75rem; }
.admin-cat { margin-bottom: 1rem; }
.admin-cat label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.person { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
.person small { color: var(--muted); display: block; }

@media (prefers-reduced-motion: no-preference) {
  .option { transition: background 0.12s, border-color 0.12s; }
}
