/* Agorama — feuille de style commune.
   « Pop sérieux » : couleurs franches, bords nets, ombres décalées, grands boutons.
   Tout passe par les jetons de :root ; le thème sombre les redéfinit. */

@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/bricolage-grotesque/bricolage-grotesque-normal-400-700-latin.woff2') format('woff2');
  font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../fonts/bricolage-grotesque/bricolage-grotesque-normal-400-700-latin-ext.woff2') format('woff2');
  font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-hyperlegible/atkinson-hyperlegible-normal-400-latin.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-hyperlegible/atkinson-hyperlegible-normal-700-latin.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  src: url('../fonts/atkinson-hyperlegible/atkinson-hyperlegible-normal-400-latin-ext.woff2') format('woff2');
  font-weight: 400; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF;
}

:root {
  --encre: #1c1d3a;
  --encre-douce: #4a4c6e;
  --papier: #fffaf1;
  --carte: #ffffff;
  --trait: #1c1d3a;
  --voile: #f1ebdf;

  --corail: #ff6b57;
  --tournesol: #ffc83d;
  --menthe: #3ec6a8;
  --lagon: #4f7cff;
  --prune: #8f5ce6;
  --rose: #ff8fc2;

  /* Couleurs des mots du nuage : contrastées sur le fond (4,5:1 au moins) */
  --mot-1: #c2361f; --mot-2: #2f45c9; --mot-3: #0f7a63; --mot-4: #7a3fd1; --mot-5: #9a5a00; --mot-6: #b8306f;

  --accent: #3b4fe0;          /* liens, focus */
  --accent-texte: #ffffff;
  --succes: #137a5f;
  --alerte: #b3261e;

  --titre: 'Bricolage Grotesque', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --texte: 'Atkinson Hyperlegible', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --rayon: 16px;
  --rayon-petit: 10px;
  --epaisseur: 2px;
  --ombre: 4px 4px 0 var(--trait);
  --ombre-forte: 6px 6px 0 var(--trait);
  --largeur: 1120px;
  /* Mouvement : chaque apparence règle son ressort et ses durées */
  --ressort: cubic-bezier(.34, 1.56, .64, 1);
  --duree: .35s;
  --anim-mot: pop;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:is(:not([data-apparence]), [data-apparence="agora"]):not([data-theme="light"]) {
    --encre: #f6f1e7; --encre-douce: #c9c4d9; --papier: #15162b; --carte: #212240;
    --trait: #0a0b18; --voile: #2b2c4d; --accent: #9fb0ff; --accent-texte: #15162b;
    --succes: #5fd8b6; --alerte: #ff8a80; color-scheme: dark;
    --ombre: 4px 4px 0 #000; --ombre-forte: 6px 6px 0 #000;
    --mot-1: #ff8a78; --mot-2: #9fb0ff; --mot-3: #5fd8b6; --mot-4: #c3a1ff; --mot-5: #ffd166; --mot-6: #ff9ccb;
  }
}
:root:is(:not([data-apparence]), [data-apparence="agora"])[data-theme="dark"] {
  --encre: #f6f1e7; --encre-douce: #c9c4d9; --papier: #15162b; --carte: #212240;
  --trait: #0a0b18; --voile: #2b2c4d; --accent: #9fb0ff; --accent-texte: #15162b;
  --succes: #5fd8b6; --alerte: #ff8a80; color-scheme: dark;
  --ombre: 4px 4px 0 #000; --ombre-forte: 6px 6px 0 #000;
  --mot-1: #ff8a78; --mot-2: #9fb0ff; --mot-3: #5fd8b6; --mot-4: #c3a1ff; --mot-5: #ffd166; --mot-6: #ff9ccb;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background-color: var(--papier); background-image: var(--fond-image, none); background-attachment: fixed;
  color: var(--encre);
  font: 400 1.0625rem/1.55 var(--texte);
}
main { flex: 1; width: 100%; }
h1, h2, h3 { font-family: var(--titre); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: .15em; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lien-evitement { position: absolute; left: -9999px; top: 0; background: var(--encre); color: var(--papier); padding: .5rem 1rem; z-index: 10; }
.lien-evitement:focus { left: 1rem; top: 1rem; }
[hidden] { display: none !important; }

.conteneur { width: min(100% - 32px, var(--largeur)); margin-inline: auto; }

/* ——— En-tête ——— */
.entete { border-bottom: var(--epaisseur) solid var(--trait); background: var(--carte); }
.entete .conteneur { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.marque { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--encre); font: 700 1.35rem var(--titre); }
.marque img { width: 36px; height: 36px; }
.entete nav { margin-left: auto; display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.entete nav a { color: var(--encre); text-decoration: none; font-weight: 700; padding: .45rem .75rem; border-radius: 999px; }
.entete nav a:hover, .entete nav a[aria-current="page"] { background: var(--voile); }
.choix-langue { font: inherit; padding: .35rem .5rem; border: var(--epaisseur) solid var(--trait); border-radius: var(--rayon-petit); background: var(--carte); color: var(--encre); }

/* ——— Pied de page (même mécanique qu’Inclus’IA) ——— */
.pied { border-top: var(--epaisseur) solid var(--trait); background: var(--carte); font-size: .8125rem; color: var(--encre-douce); }
.pied .conteneur { display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; justify-content: space-between; padding-block: .75rem; }
.pied ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.pied a { color: inherit; text-decoration: none; white-space: nowrap; }
.pied a:hover { color: var(--accent); text-decoration: underline; }
.pied .nom { font-weight: 700; color: var(--encre); white-space: nowrap; }
.pied .sep { color: var(--voile); }

/* ——— Boutons ——— */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .6rem 1.2rem; border-radius: 999px;
  border: var(--epaisseur) solid var(--trait); background: var(--carte); color: var(--encre);
  font: 700 1rem var(--texte); text-decoration: none; cursor: pointer;
  box-shadow: var(--ombre); transition: transform .15s var(--ressort), box-shadow .15s, background-color .2s;
}
.bouton:hover { transform: translate(-1px, -1px); box-shadow: var(--ombre-forte); }
.bouton:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--trait); }
.bouton:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.bouton.principal { background: var(--encre); color: var(--papier); }
.bouton.corail { background: var(--corail); color: #1c1d3a; }
.bouton.menthe { background: var(--menthe); color: #1c1d3a; }
.bouton.tournesol { background: var(--tournesol); color: #1c1d3a; }
.bouton.grand { min-height: 60px; font-size: 1.15rem; padding-inline: 1.6rem; }
.bouton.discret { box-shadow: none; border-color: transparent; background: transparent; text-decoration: underline; min-height: 40px; padding-inline: .5rem; }
.bouton svg { width: 1.2em; height: 1.2em; flex: none; }
.rangee { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* ——— Cartes ——— */
.carte {
  background: var(--carte); border: var(--epaisseur) solid var(--trait); border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 1.5rem;
}
.carte > :last-child { margin-bottom: 0; }
.grille { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.pastille { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 14px; border: var(--epaisseur) solid var(--trait); margin-bottom: 1rem; color: #1c1d3a; }
.pastille svg { width: 28px; height: 28px; }
.pastille.corail { background: var(--corail); } .pastille.tournesol { background: var(--tournesol); }
.pastille.menthe { background: var(--menthe); } .pastille.lagon { background: var(--lagon); } .pastille.prune { background: var(--prune); }

/* ——— Accueil ——— */
.bandeau { padding: clamp(2.5rem, 7vw, 5rem) 0 2.5rem; }
.bandeau p.chapeau { font-size: clamp(1.1rem, 2.2vw, 1.35rem); color: var(--encre-douce); max-width: 40ch; }
.bandeau h1 span + span { background: linear-gradient(transparent 62%, var(--tournesol) 62%); padding-inline: .1em; }
.section { padding: 1rem 0 3rem; }
.carte-action { display: flex; flex-direction: column; }
.carte-action p { color: var(--encre-douce); flex: 1; }
.rejoindre-rapide { display: flex; gap: .5rem; flex-wrap: wrap; }
.etapes { counter-reset: etape; list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.etapes li { counter-increment: etape; padding-left: 3.2rem; position: relative; }
.etapes li::before { content: counter(etape); position: absolute; left: 0; top: -.1rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 50%; background: var(--encre); color: var(--papier); font: 700 1.1rem var(--titre); }
.etiquette { display: inline-block; font-size: .8rem; font-weight: 700; padding: .15rem .6rem; border-radius: 999px; border: var(--epaisseur) solid var(--trait); background: var(--voile); }

/* ——— Formulaires ——— */
label { font-weight: 700; display: block; margin-bottom: .35rem; }
.aide { font-size: .9rem; color: var(--encre-douce); margin-top: .3rem; }
input[type="text"], textarea, select.champ {
  width: 100%; font: inherit; color: var(--encre); background: var(--carte);
  border: var(--epaisseur) solid var(--trait); border-radius: var(--rayon-petit); padding: .7rem .9rem; min-height: 48px;
}
textarea { min-height: 96px; resize: vertical; }
.champ-code { font: 700 1.6rem var(--titre); letter-spacing: .25em; text-transform: uppercase; text-align: center; max-width: 12ch; }
.bloc { margin-bottom: 1.25rem; }
.choix-ligne { display: flex; gap: .5rem; margin-bottom: .5rem; }
.choix-ligne input { flex: 1; }

/* ——— Choix de la mécanique ——— */
.mecaniques { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.mecanique { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.mecanique:hover { transform: translate(-2px, -2px); box-shadow: var(--ombre-forte); }
.mecanique[aria-pressed="true"] { outline: 4px solid var(--accent); outline-offset: 2px; }
.mecanique h3 { margin-bottom: .25rem; }
.mecanique p { color: var(--encre-douce); margin: 0; font-size: .95rem; }

/* ——— Pilotage ——— */
.pilotage { display: grid; gap: 1.5rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); padding-block: 1.5rem 3rem; }
@media (max-width: 880px) { .pilotage { grid-template-columns: 1fr; } }
.code-seance { font: 700 clamp(2rem, 6vw, 3rem) var(--titre); letter-spacing: .12em; margin: 0; }
.etat { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; padding: .2rem .7rem; border-radius: 999px; border: var(--epaisseur) solid var(--trait); }
.etat::before { content: ''; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.etat[data-etat="ouverte"] { background: var(--menthe); color: #0d3b30; }
.etat[data-etat="pause"] { background: var(--tournesol); color: #4a3500; }
.etat[data-etat="fermee"] { background: var(--voile); color: var(--encre); }
.compteurs { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 1rem 0; }
.compteurs strong { display: block; font: 700 1.8rem var(--titre); }
.qr { background: #fff; padding: 10px; border-radius: var(--rayon-petit); border: var(--epaisseur) solid var(--trait); width: 160px; height: 160px; }
.qr svg, .qr img, .qr canvas { width: 100% !important; height: 100% !important; display: block; }
.avis { border: var(--epaisseur) dashed var(--trait); border-radius: var(--rayon-petit); padding: .75rem 1rem; background: var(--voile); font-size: .95rem; }
.lien-copie { display: flex; gap: .5rem; align-items: center; margin-bottom: .75rem; }
.lien-copie input { font-size: .85rem; min-height: 40px; }

/* ——— Résultats : nuage ——— */
.nuage { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .2em .6em; padding: 1rem; min-height: 220px; line-height: 1.05; }
.nuage .mot { font-family: var(--titre); font-weight: 700; color: var(--c, var(--encre)); transition: font-size .6s var(--ressort), opacity .3s; display: inline-block; }
.nuage .mot.arrive { animation: var(--anim-mot) .7s var(--ressort) both; }
.nuage button.mot { background: none; border: 0; cursor: pointer; padding: 0 .1em; border-radius: 6px; }
.nuage button.mot:hover { text-decoration: line-through; }
.nuage .mot.masque { opacity: .3; text-decoration: line-through; }
.vide { color: var(--encre-douce); text-align: center; padding: 2rem 1rem; }

/* ——— Résultats : barres ——— */
.barres { list-style: none; margin: 0; padding: 0; display: grid; gap: .9rem; }
.barre { display: grid; grid-template-columns: 1fr auto; gap: .3rem .75rem; align-items: end; }
.barre .libelle { font-weight: 700; }
.barre .valeur { font: 700 1.1rem var(--titre); }
.barre .piste { display: block; grid-column: 1 / -1; height: 28px; border: var(--epaisseur) solid var(--trait); border-radius: 999px; background: var(--carte); overflow: hidden; }
.barre .rempli { display: block; height: 100%; width: var(--p, 0%); background: var(--c, var(--lagon)); transition: width .7s var(--ressort); border-right: var(--epaisseur) solid var(--trait); }
.barre .rempli[style*="--p: 0%"] { border-right: 0; }

/* ——— Écran projeté ——— */
body.ecran { background-color: var(--papier); }
.ecran-haut { display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; padding: 1.25rem 2rem; border-bottom: var(--epaisseur) solid var(--trait); background: var(--carte); }
.ecran-rejoindre { display: flex; align-items: center; gap: 1.25rem; }
.ecran-rejoindre .qr { width: 120px; height: 120px; padding: 6px; }
.ecran-rejoindre p { margin: 0; font-size: 1.1rem; }
.ecran-rejoindre .code-seance { font-size: 2.6rem; }
.ecran-corps { flex: 1; display: flex; flex-direction: column; padding: 2rem clamp(1rem, 4vw, 4rem); gap: 1.5rem; }
.ecran-question { font: 700 clamp(1.8rem, 4.2vw, 3.4rem) var(--titre); margin: 0; text-align: center; }
.ecran-corps .nuage { font-size: clamp(1rem, 2.4vw, 2rem); flex: 1; }
.ecran-corps .barres { max-width: 1000px; width: 100%; margin: 0 auto; font-size: 1.4rem; }
.ecran-corps .barre .piste { height: 44px; }
.ecran-bas { padding: .75rem 2rem; display: flex; justify-content: space-between; color: var(--encre-douce); font-size: 1rem; }

/* ——— Participant ——— */
body.participant main { display: flex; align-items: flex-start; justify-content: center; padding: 1.5rem 16px 3rem; }
.feuille { width: 100%; max-width: 520px; }
.feuille .question { font: 700 1.6rem var(--titre); margin-bottom: 1.25rem; }
.options { display: grid; gap: .75rem; }
.option {
  width: 100%; min-height: 60px; text-align: left; font: 700 1.1rem var(--texte); color: #1c1d3a;
  border: var(--epaisseur) solid var(--trait); border-radius: var(--rayon); padding: .8rem 1.1rem; cursor: pointer;
  background: var(--c, var(--carte)); box-shadow: var(--ombre);
}
.option[aria-pressed="true"] { outline: 4px solid var(--encre); outline-offset: 3px; }
.merci { text-align: center; padding: 2rem 1rem; }
.merci svg { width: 64px; height: 64px; color: var(--succes); }

/* ——— Pages de texte (mentions, accessibilité) ——— */
.texte-long { max-width: 760px; padding-block: 2.5rem 4rem; }
.texte-long h2 { margin-top: 2rem; font-size: 1.4rem; }
.texte-long ul { padding-left: 1.2rem; }
.texte-long li { margin-bottom: .4rem; }

/* ——— Mouvements communs ——— */
@keyframes pop { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes monter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.merci svg { animation: pop .6s var(--ressort) both; }
.ecran-question, .feuille .question { animation: monter .5s var(--ressort) both; }

/* ——— Choix de l’apparence ——— */
.apparences { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.apparence { position: relative; cursor: pointer; border-radius: 14px; border: 2px solid var(--trait); overflow: hidden; background: var(--carte); text-align: left; padding: 0; font: inherit; color: inherit; }
.apparence[aria-checked="true"] { outline: 4px solid var(--accent); outline-offset: 2px; }
.apparence .apercu { height: 64px; display: flex; align-items: center; justify-content: center; gap: .3rem; font: 700 1.1rem var(--titre); }
.apparence .apercu i { width: 14px; height: 14px; border-radius: 50%; display: inline-block; }
.apparence .nom { display: block; padding: .4rem .7rem .1rem; font-weight: 700; }
.apparence .desc { display: block; padding: 0 .7rem .6rem; font-size: .85rem; color: var(--encre-douce); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
