:root {
  --felt: #0f5132;
  --felt-dark: #0a3622;
  --bg: #0b1f17;
  --card: #fdfcf7;
  --ink: #1d2521;
  --muted: #6b766f;
  --gold: #d4a017;
  --red: #b3261e;
  --green: #1e7d4b;
  --line: #e4e1d6;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(ellipse at top, var(--felt) 0%, var(--felt-dark) 55%, var(--bg) 100%) fixed;
  min-height: 100vh;
}
a { color: var(--felt); }
h1, h2 { line-height: 1.2; margin: 0 0 .6em; }
h1 { color: #fff; font-size: 1.8rem; }
.card h1, .card h2 { color: var(--ink); }
h2 { font-size: 1.2rem; }

.top {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem;
  padding: .7rem 1.5rem; background: rgba(0, 0, 0, .35); color: #fff;
  border-bottom: 2px solid var(--gold);
}
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: .05em; }
.brand small { font-weight: 400; font-size: .8rem; opacity: .7; letter-spacing: 0; }
.suit { color: var(--gold); }
.top nav { display: flex; flex-wrap: wrap; gap: .2rem; flex: 1; }
.top nav a { color: #e6efe9; text-decoration: none; padding: .35rem .7rem; border-radius: 999px; }
.top nav a:hover { background: rgba(255, 255, 255, .1); }
.top nav a.on { background: var(--gold); color: #1d1600; font-weight: 600; }
.me { display: flex; align-items: center; gap: .8rem; }
.me a { color: #fff; }
.me form { margin: 0; }
.me .link { color: #cfd9d3; }

main { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
footer { text-align: center; color: rgba(255, 255, 255, .4); padding: 1rem; letter-spacing: .3em; }

.hero { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.hero h1 { margin: 0; }
.hero p { color: #cfe0d6; margin: .3rem 0 0; }
.hero .muted { color: #a9c2b4; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 1.2rem 1.4rem; margin-bottom: 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}
.grid .card { margin-bottom: 0; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.item { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.muted { color: var(--muted); }
.ok { color: var(--green); }
.ko { color: var(--red); }
.pre { white-space: pre-wrap; margin: 0; }
.scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .45rem .5rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.num { text-align: right; white-space: nowrap; }
tr.top td { background: #fbf4dd; }

.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .15rem .55rem; border-radius: 999px; background: #e9e7df; color: #444; vertical-align: middle; }
.badge.sondage { background: #fdecc8; color: #7a5300; }
.badge.planifie { background: #d4f0df; color: #135c36; }
.badge.termine { background: #dfe3f7; color: #2c3a87; }
.badge.annule { background: #f6d8d5; color: var(--red); }

form { margin: 0; }
form > label, fieldset > label, #creneaux > label { display: block; margin-bottom: .8rem; font-weight: 600; font-size: .9rem; }
form > label input, form > label select, form > label textarea, fieldset label input, #creneaux input { display: block; width: 100%; margin-top: .25rem; }
input, select, textarea {
  font: inherit; padding: .45rem .6rem; border: 1px solid #c9c5b8; border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1rem; padding: .8rem 1rem; }
legend { font-weight: 700; padding: 0 .3rem; }
.w5 { width: 5rem; }
.w8 { width: 8rem; }

button, .btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  padding: .5rem 1rem; border: 0; border-radius: 8px; background: var(--gold); color: #1d1600;
}
button:hover, .btn:hover { filter: brightness(1.08); }
button.secondary, .btn.secondary { background: #e9e7df; color: var(--ink); }
button.danger { background: var(--red); color: #fff; }
button.small, .btn.small { padding: .25rem .6rem; font-size: .85rem; }
button.link { background: none; padding: 0; color: inherit; font-weight: 400; text-decoration: underline; }
.inline { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .6rem; }
td.actions { margin: 0; }
.card > form + form { margin-top: 1rem; }

.flash { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; background: #d4f0df; color: #135c36; font-weight: 600; }
.flash.err { background: #f6d8d5; color: var(--red); }

.sondage th, .sondage td { text-align: center; min-width: 110px; }
.sondage td:first-child, .sondage th:first-child { text-align: left; min-width: 140px; }
.sondage th { text-transform: none; font-size: .85rem; color: var(--ink); }
.sondage .best { background: #fbf4dd; }
.sondage th.best::before { content: "★ "; color: var(--gold); }
.vote { font-weight: 700; }
.vote.oui { background: #d4f0df; color: var(--green); }
.vote.peut { background: #fdecc8; color: #7a5300; }
.vote.non { background: #f6d8d5; color: var(--red); }
.choix { white-space: nowrap; }
.choix label { display: inline-block; cursor: pointer; }
.choix input { position: absolute; opacity: 0; pointer-events: none; }
.choix span { display: inline-block; width: 2rem; height: 2rem; line-height: 2rem; border-radius: 50%; background: #eee; font-weight: 700; margin: 0 1px; }
.choix .oui input:checked + span { background: var(--green); color: #fff; }
.choix .peut input:checked + span { background: var(--gold); color: #fff; }
.choix .non input:checked + span { background: var(--red); color: #fff; }
.sondage + button { margin-top: 1rem; }
.sondage .actions { justify-content: center; }

.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; }
.chips li { display: inline-flex; align-items: center; gap: .4rem; background: #e7f3ec; padding: .25rem .7rem; border-radius: 999px; }
.chips form { display: inline; }

.podium { list-style: none; padding: 0; margin: .5rem 0; }
.podium li { padding: .2rem 0; }
.champion { font-size: 1.1rem; margin: .4rem 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stats div { background: var(--card); border-radius: var(--radius); padding: .9rem; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.stats strong { display: block; font-size: 1.5rem; }
.stats span { color: var(--muted); font-size: .85rem; }

@media (max-width: 640px) {
  .top { padding: .6rem 1rem; }
  h1 { font-size: 1.4rem; }
  .card { padding: 1rem; }
}
