/* La folie des grandeurs — charte omniaamplecti (papier / or / bleu). */
:root {
  --ink: #1a1814;
  --paper: #f2f5fa;
  --paper-dark: #e6ecf6;
  --gold: #b89a5a;
  --muted: #7a7060;
  --brand: #1d3a5f;
  --nav-h: 72px;
  --line: rgba(184, 154, 90, 0.28);
  --ok: #4f8a5b;
  --mid: #c79a3a;
  --low: #cf7a3a;
  --ko: #b5544b;
  /* Couleurs des symboles par grandeur */
  --c-arrows: #1d3a5f;
  --c-leaf: #4f8a5b;
  --c-bolt: #d09a2c;
  --c-coin: #b8862a;
  --c-die: #7a5c9e;
  --c-watch: #3f8a8a;
  --c-star: #b89a5a;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: 'Montserrat', sans-serif; font-weight: 300;
  -webkit-font-smoothing: antialiased;
}

/* ── EN-TÊTE ── */
.entete { max-width: 900px; margin: 0 auto; padding: calc(var(--nav-h) + 2.5rem) 1.5rem 1rem; text-align: center; }
.eyebrow { font-size: 0.66rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--gold); margin: 0 0 0.7rem; }
.entete h1 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(2.3rem, 6vw, 3.6rem); line-height: 1.02; margin: 0; letter-spacing: 0.01em; color: var(--brand); }
.entete h1 em { font-style: italic; color: var(--brand); }
.accroche { max-width: 620px; margin: 0.9rem auto 0; font-size: 0.92rem; line-height: 1.6; color: var(--muted); }
.accroche b { color: var(--ink); font-weight: 500; }
.meta { margin: 1rem 0 0; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.meta b { color: var(--ink); }
.filet { width: 56px; height: 1px; background: var(--gold); margin: 1.3rem auto 0; }

main { max-width: 900px; margin: 0 auto; padding: 0 1.2rem; }

/* ── AIDE ── */
.help { max-width: 640px; margin: 1.4rem auto 0.5rem; }
.help details { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.9rem 0; }
.help summary { cursor: pointer; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.help summary:hover { color: var(--gold); }
.help p, .help ul { font-size: 0.85rem; line-height: 1.65; color: var(--ink); }
.help ul { padding-left: 1.2rem; }
.help code { background: var(--paper-dark); border: 1px solid var(--line); border-radius: 4px; padding: 0.05rem 0.35rem; font-size: 0.82em; }

/* ── CHOIX DE NOTATION ── */
.notation-bar { display: flex; align-items: center; justify-content: center; gap: 0.7rem; flex-wrap: wrap; margin: 1.2rem auto 0; }
.notation-label { font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.notation-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 2px; }
.notation-toggle button {
  font-family: 'Montserrat', sans-serif; font-size: 0.74rem; font-weight: 500; color: var(--muted);
  background: transparent; border: none; border-radius: 999px; padding: 0.35rem 0.9rem; cursor: pointer;
  transition: background .2s, color .2s;
}
.notation-toggle button:hover { color: var(--ink); }
.notation-toggle button.on { background: var(--brand); color: var(--paper); }

/* ── LES 8 MANCHES ── */
.manches {
  display: grid; grid-template-columns: 1fr; gap: 0.9rem;
  margin: 1.4rem auto 0; max-width: 820px;
}
@media (min-width: 720px) { .manches { grid-template-columns: 1fr 1fr; gap: 1rem; } }

.manche {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column;
  box-shadow: 0 6px 18px rgba(26, 24, 20, 0.04);
}
.manche-head { display: flex; align-items: center; gap: 0.55rem; margin-bottom: 0.6rem; }
.sym { display: inline-flex; width: 1.65rem; height: 1.65rem; flex: 0 0 auto; color: var(--c-star); }
.sym svg { width: 100%; height: 100%; }
.sym-arrows { color: var(--c-arrows); } .sym-leaf { color: var(--c-leaf); }
.sym-bolt { color: var(--c-bolt); } .sym-coin { color: var(--c-coin); }
.sym-die { color: var(--c-die); } .sym-watch { color: var(--c-watch); }
.sym-star { color: var(--c-star); }
.manche-head .grandeur { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.15rem; color: var(--brand); flex: 1 1 auto; }
.manche-head .num-manche { font-size: 0.58rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.manche-head .pts { font-size: 0.82rem; font-weight: 600; padding: 0.12rem 0.5rem; border-radius: 999px; }

.question { margin: 0 0 0.75rem; font-size: 0.95rem; line-height: 1.5; color: var(--ink); }
.question strong { font-weight: 500; }
.question .v-a { color: var(--brand); }
.question .v-b { color: var(--ink); border-bottom: 1.5px dotted var(--gold); }

/* Saisie */
.saisie { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.saisie .prefixe { font-size: 1.15rem; color: var(--gold); font-weight: 500; }
.saisie input {
  flex: 1 1 140px; min-width: 0; font-family: 'Montserrat', sans-serif; font-size: 0.95rem;
  padding: 0.55rem 0.7rem; border: 1.5px solid var(--line); border-radius: 7px;
  background: var(--paper); color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.saisie input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 154, 90, 0.15); }
.saisie input:disabled { background: var(--paper-dark); color: var(--muted); }
.saisie .apercu { flex: 0 0 auto; font-size: 0.78rem; color: var(--muted); min-height: 1em; }

/* Correction (après validation) */
.manche.corrige { }
.manche.corrige .saisie input { border-style: dashed; }
.manche.vide { opacity: 0.85; }
.correction { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px dashed var(--line); font-size: 0.82rem; }
.correction .montants { display: flex; align-items: stretch; gap: 0.5rem; margin-bottom: 0.5rem; }
.correction .cote { flex: 1 1 0; display: flex; flex-direction: column; gap: 0.15rem; background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 0.45rem 0.55rem; min-width: 0; }
.correction .cote em { font-style: normal; font-size: 0.72rem; color: var(--muted); line-height: 1.25; }
.correction .cote-val { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.correction .cote-a .cote-val { color: var(--brand); }
.correction .cote-sep { align-self: center; color: var(--gold); font-weight: 600; }
.correction .rapport { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; }
.correction .rapport span { color: var(--muted); }
.correction .rapport b { color: var(--ink); font-weight: 600; }
.correction .r-attendu b { color: var(--ok); }

/* Pastilles de qualité (points) */
.q-top { background: rgba(79, 138, 91, 0.15); color: var(--ok); }
.q-mid { background: rgba(199, 154, 58, 0.16); color: var(--mid); }
.q-low { background: rgba(207, 122, 58, 0.16); color: var(--low); }
.q-zero { background: var(--paper-dark); color: var(--muted); }

/* ── ACTION ── */
.actions { display: flex; justify-content: center; margin: 1.6rem 0 0.5rem; }
.btn-valider {
  font-family: 'Montserrat', sans-serif; font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 600; color: var(--paper); background: var(--brand); border: none; border-radius: 999px;
  padding: 0.9rem 2rem; cursor: pointer; transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 8px 22px rgba(29, 58, 95, 0.22);
}
.btn-valider:hover { background: #24476f; transform: translateY(-1px); }
.btn-valider:disabled { background: var(--muted); box-shadow: none; cursor: default; transform: none; }
.btn-valider[hidden] { display: none; }

/* ── RÉSUMÉ ── */
.resume { max-width: 560px; margin: 1.8rem auto 0; padding: 1.6rem; text-align: center;
  background: var(--paper-dark); border: 1px solid var(--line); border-radius: 12px; }
.resume[hidden] { display: none; }
.resume h2 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.9rem; margin: 0 0 0.4rem; color: var(--brand); }
.resume .score-total { margin: 0.2rem 0; font-size: 1rem; }
.resume .score-total b { font-size: 2.6rem; font-family: 'Cormorant Garamond', serif; color: var(--gold); line-height: 1; }
.resume .score-total span { color: var(--muted); font-size: 1.1rem; }
.resume .score-detail { font-size: 0.86rem; color: var(--muted); margin: 0.3rem 0 1rem; font-style: italic; }
.mini-scores { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
.mini { display: inline-flex; align-items: center; gap: 0.28rem; padding: 0.28rem 0.55rem; border-radius: 8px; font-size: 0.78rem; }
.mini i.sym { width: 0.95rem; height: 0.95rem; }
.mini b { font-weight: 600; }

/* ── PARTAGE ── */
.share-row { max-width: 460px; margin: 1.1rem auto 0; display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }
.share-row[hidden] { display: none; }
.share-btn {
  font-family: 'Montserrat', sans-serif; font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--paper); background: var(--ink); border: none; border-radius: 4px; padding: 0.7rem 1.3rem; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; transition: background .2s, opacity .2s;
}
.share-btn:hover { background: var(--gold); }
.share-tw { background: #1d9bf0; } .share-tw:hover { background: #0c7abf; }
.share-bsky { background: #1185fe; } .share-bsky:hover { background: #0a6ed6; }

/* ── CLASSEMENT ── */
.classement { max-width: 480px; margin: 1.8rem auto 0; }
.classement[hidden] { display: none; }
.classement h3 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.4rem; margin: 0 0 0.2rem; color: var(--brand); text-align: center; }
.classement .cl-count { text-align: center; font-size: 0.78rem; color: var(--muted); margin: 0 0 0.9rem; }
.cl-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.cl-list li { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--line); }
.cl-list li.moi { background: rgba(184, 154, 90, 0.12); border-radius: 7px; }
.cl-rang { flex: 0 0 1.6rem; text-align: right; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.05rem; color: var(--gold); }
.cl-nom { flex: 1 1 auto; font-size: 0.88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-nom a { color: var(--brand); text-decoration: none; }
.cl-nom a:hover { color: var(--gold); }
.cl-score { flex: 0 0 auto; font-weight: 600; color: var(--ink); }
.cl-list li:nth-child(1) .cl-rang { color: #d4af37; }
.cl-list li:nth-child(2) .cl-rang { color: #9aa3ad; }
.cl-list li:nth-child(3) .cl-rang { color: #cd7f32; }
.cl-moi { text-align: center; font-size: 0.82rem; color: var(--muted); margin: 0.7rem 0 0; }
.cl-moi b { color: var(--ink); }

/* ── PIED ── */
.pied { text-align: center; padding: 2.5rem 1rem; margin-top: 3rem; font-size: 0.75rem;
  letter-spacing: 0.05em; color: var(--muted); border-top: 1px solid var(--line); }
.pied a { color: var(--muted); text-decoration: none; transition: color .2s; }
.pied a:hover { color: var(--gold); }
.pied .sep { margin: 0 0.5rem; color: var(--gold); }

@media (max-width: 480px) {
  .entete { padding-top: calc(var(--nav-h) + 1.6rem); }
  .manche { padding: 0.85rem 0.9rem 1rem; }
  .correction .montants { flex-direction: column; }
  .correction .cote-sep { align-self: flex-start; }
}
