/* Page Résultats v3 : vues. Tableau pleine largeur SANS défilement interne : la page défile ;
   en-tête collant en haut, une seule colonne collante (« Élève ») à gauche → aucun recouvrement.
   Lettres = pastilles D34 ; juste / faux / pas répondu = teintes de --juste / --faux / --absent. */

.vue { min-width: 0; }

.legende {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0.7rem 0 0;
  color: var(--encre-douce);
  font-size: 0.9rem;
}

.legende-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.legende-aide { margin-left: auto; }
.legende-case {
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}
.legende-case.juste { background: var(--teinte-juste); box-shadow: inset 0 -3px 0 var(--juste); }
.legende-case.faux { background: var(--teinte-faux); box-shadow: inset 0 -3px 0 var(--faux); }
.legende-case.neutre { background: #fff; }
.legende-case.vide { background: var(--teinte-absent); }
.legende-case.sure-faux { color: var(--faux); box-shadow: inset 0 0 0 2px var(--faux); }

/* ---------- Tableau élève × question ---------- */

.tableau-resultats {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--carte-bord);
  border-radius: var(--rayon);
  background: var(--carte);
  color: var(--encre);
  font-size: 0.95rem;
  box-shadow: var(--ombre-carte);
}

.tableau-resultats th,
.tableau-resultats td {
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid var(--carte-bord);
  text-align: center;
  vertical-align: middle;
}

.tableau-resultats thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.5rem 0.4rem;
  background: #f3ecdb;
  font-weight: 600;
  vertical-align: bottom;
}

.tableau-resultats .col-eleve {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 13rem;
  min-width: 11rem;
  padding-left: 0.8rem;
  background: var(--carte);
  text-align: left;
  white-space: nowrap;
  box-shadow: 1px 0 0 var(--carte-bord);
}

.tableau-resultats thead .col-eleve { z-index: 3; background: #f3ecdb; }
.tableau-resultats tfoot .col-eleve { background: #f3ecdb; }
.eleve-num { display: inline-block; min-width: 1.8rem; color: var(--encre-douce); font-weight: 400; font-size: 0.85rem; }
.eleve-prenom { font-weight: 600; }
.hors-classe .eleve-prenom { font-weight: 400; font-style: italic; color: var(--encre-douce); }

.col-q { min-width: 4.4rem; }
.q-haut { display: flex; align-items: baseline; justify-content: center; gap: 0.35rem; }
.q-num { font-size: 1.05rem; font-weight: 700; }
.q-jour { color: var(--encre-douce); font-size: 0.8rem; font-weight: 500; }
.q-jour::before { content: '· '; }
.q-serie { display: block; color: var(--encre-douce); font-size: 0.72rem; font-weight: 600; }
.q-resume {
  display: -webkit-box;
  max-width: 12rem;
  margin: 0.1rem auto 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--encre-douce);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.2;
}
.q-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem; margin-top: 0.25rem; }
.q-badge { padding: 0 0.4rem; border-radius: 999px; background: #e4dcc6; color: var(--encre); font-size: 0.68rem; font-weight: 600; }
.badge-revote { background: #d9e6f8; color: #174a8c; }

.case-r { position: relative; min-width: 3.6rem; height: 3.4rem; }
.case-r.juste { background: var(--teinte-juste); box-shadow: inset 0 -3px 0 var(--juste); }
.case-r.faux { background: var(--teinte-faux); box-shadow: inset 0 -3px 0 var(--faux); }
.case-r.vide { background: var(--teinte-absent); }
.case-r.sure-faux { box-shadow: inset 0 0 0 3px var(--faux); }
.pastilles { display: inline-flex; gap: 0.15rem; vertical-align: middle; }
.trait-absent { color: var(--absent); font-weight: 600; }
.certitude-mot { display: block; margin-top: 0.1rem; color: var(--encre-douce); font-size: 0.82rem; font-weight: 600; line-height: 1; }
.certitude-S { color: var(--encre); }
.alerte-sure {
  position: absolute;
  top: 2px;
  right: 3px;
  display: grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: var(--faux);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.marque-corrigee { position: absolute; top: 2px; left: 4px; color: var(--encre); font-size: 1rem; line-height: 1; }

.tableau-resultats .col-pct { width: 6rem; min-width: 5.2rem; font-weight: 700; white-space: nowrap; }
.pct-repondu { display: block; color: var(--encre-douce); font-size: 0.78rem; font-weight: 500; }
.tableau-resultats tbody tr:hover > * { background-image: linear-gradient(rgba(31, 111, 214, 0.08), rgba(31, 111, 214, 0.08)); }
.tableau-resultats tfoot td, .tableau-resultats tfoot th { background: #f3ecdb; font-weight: 700; }
.tableau-resultats .ligne-nb td, .tableau-resultats .ligne-nb th { font-weight: 400; color: var(--encre-douce); }

/* ---------- Par élève ---------- */

.alerte { margin: 0 0 0.6rem; padding: 0.6rem 0.9rem; border: 1px solid var(--carte-bord); border-radius: 8px; background: var(--carte); color: var(--encre); }
.explication { margin: 0 0 0.6rem; color: var(--encre-douce); }
.liste-eleves { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.ligne-eleve {
  display: grid;
  grid-template-columns: minmax(10rem, 14rem) minmax(8rem, 1fr) 4rem minmax(12rem, 16rem) minmax(0, 12rem);
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--carte-bord);
  border-radius: 8px;
  background: var(--carte);
  color: var(--encre);
}
.eleve-nom { font-weight: 600; }
.barre-pct { height: 0.7rem; border-radius: 999px; background: var(--teinte-absent); overflow: hidden; }
.barre-rempli { display: block; height: 100%; border-radius: 999px; background: currentColor; }
.eleve-pct { font-weight: 700; text-align: right; }
.eleve-detail { color: var(--encre-douce); font-size: 0.9rem; }
.eleve-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.badge-rare, .badge-sure-faux { padding: 0.05rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.badge-rare { background: var(--teinte-absent); }
.badge-sure-faux { background: var(--teinte-faux); color: var(--niv-bas); }

/* ---------- Par question ---------- */

.tri { margin-bottom: 0.7rem; color: var(--encre); }
.grille-questions { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); gap: 1rem; }
.fiche-question { padding: 1rem 1.1rem; border: 1px solid var(--carte-bord); border-radius: var(--rayon); background: var(--carte); color: var(--encre); box-shadow: var(--ombre-carte); scroll-margin-top: 1rem; }
.fiche-question.a-retravailler { box-shadow: inset 6px 0 0 var(--faux); }
.fiche-question.reperee { outline: 3px solid var(--agir); }
.fiche-tete { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.7rem; }
.fiche-meta { color: var(--encre-douce); font-size: 0.9rem; }
.fiche-score { margin-left: auto; font-weight: 700; }
.fiche-texte { margin: 0.4rem 0 0.5rem; font-size: 1.1rem; font-weight: 500; }
.fiche-etiquettes { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0 0 0.5rem; }
.etiquette { padding: 0 0.5rem; border-radius: 999px; background: #efe8d6; font-size: 0.8rem; }
.note-melange { margin: 0 0 0.5rem; color: var(--encre-douce); font-size: 0.85rem; }
.distribution { display: grid; gap: 0.35rem; margin: 0; padding: 0; list-style: none; }
.dist-ligne { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) minmax(5rem, 9rem) 2rem; align-items: center; gap: 0.5rem; }
.dist-lettre { display: grid; place-items: center; }
.dist-mot { font-size: 0.8rem; font-weight: 600; }
.dist-choix { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dist-origine { color: var(--encre-douce); font-size: 0.8rem; }
.dist-bonne { margin-left: 0.4rem; padding: 0 0.45rem; border-radius: 999px; background: var(--juste); color: var(--juste-texte); font-size: 0.75rem; font-weight: 600; }
.dist-barre { height: 0.9rem; border-radius: 999px; background: var(--teinte-absent); overflow: hidden; }
.dist-rempli { display: block; height: 100%; border-radius: 999px; background: var(--rep, var(--absent)); }
.dist-ligne.bonne .dist-barre { box-shadow: 0 0 0 2px var(--juste); }
.orpheline .dist-rempli { background: var(--absent); }
.dist-n { font-weight: 700; text-align: right; }
.fiche-pied { margin: 0.6rem 0 0; color: var(--encre-douce); font-size: 0.85rem; }
.bloc-revote { display: grid; gap: 0.4rem; }
.revote-titre { margin: 0; }
.revote-gain { margin-left: 0.5rem; padding: 0 0.5rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.revote-gain.plus { background: var(--teinte-juste); color: var(--niv-haut); }
.revote-gain.moins { background: var(--teinte-faux); color: var(--niv-bas); }
.revote-deux { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.revote-deux .dist-ligne { grid-template-columns: 2rem minmax(0, 1fr) 2rem; }
.revote-deux .dist-choix { overflow: visible; white-space: normal; }
.revote-deux .dist-bonne { display: inline-block; margin: 0.1rem 0 0 0.3rem; white-space: nowrap; }
.revote-deux .dist-barre { grid-column: 2; grid-row: 2; }
.revote-deux .dist-n { grid-row: 1 / span 2; grid-column: 3; }
.revote-deux .dist-lettre { grid-row: 1 / span 2; }
.revote-sous { margin: 0 0 0.3rem; color: var(--encre-douce); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.bloc-certitude { margin-top: 0.8rem; }
.certitude-titre { margin: 0 0 0.3rem; font-size: 0.85rem; color: var(--encre-douce); text-transform: uppercase; letter-spacing: 0.05em; }
.matrice-certitude { border-collapse: collapse; }
.matrice-certitude th, .matrice-certitude td { padding: 0.2rem 0.7rem; border: 1px solid var(--carte-bord); text-align: center; }
.matrice-certitude th:first-child { text-align: left; }
.mc-juste { background: var(--teinte-juste); }
.mc-faux { background: var(--teinte-faux); }
.matrice-certitude .sure-faux { box-shadow: inset 0 0 0 3px var(--faux); font-weight: 700; }
.alerte-matrice { margin: 0.4rem 0 0; font-size: 0.9rem; }
.alerte-matrice strong { color: var(--niv-bas); }

/* ---------- Par notion (groupes de besoin) ---------- */

.outils-besoin { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.8rem 1.2rem; margin-bottom: 0.7rem; }
.filtre-besoin { min-width: 12rem; }
.filtre-besoin select, .filtre-besoin input { min-height: 48px; }
.astuce-objectif { color: var(--encre-douce); }
.grille-objectifs { display: grid; grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); gap: 1rem; }
.fiche-objectif { display: grid; gap: 0.4rem; padding: 1rem 1.1rem; border: 1px solid var(--carte-bord); border-radius: var(--rayon); background: var(--carte); color: var(--encre); box-shadow: var(--ombre-carte); }
.objectif-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.objectif-nom { margin: 0; font-size: 1.05rem; }
.objectif-pct { font-size: 1.4rem; font-weight: 700; }
.objectif-detail, .groupe-vide { margin: 0; color: var(--encre-douce); font-size: 0.9rem; }
.groupe-titre { margin: 0.2rem 0; font-weight: 600; }
.groupe-eleves { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.5rem; padding: 0; list-style: none; }
.btn-copier { background: #efe8d6; color: var(--encre); }

/* ---------- Équipes ---------- */

.bloc-equipes { display: grid; gap: 0.6rem; margin-bottom: 1.2rem; }
.equipes-titre { margin: 0; }
.classement-equipes { display: grid; gap: 0.3rem; margin: 0; padding: 0; list-style: none; }
.ligne-equipe { display: grid; grid-template-columns: minmax(10rem, 14rem) 6rem 1fr; align-items: center; gap: 0.8rem; padding: 0.4rem 0.9rem; border: 1px solid var(--carte-bord); border-radius: 8px; background: var(--carte); color: var(--encre); }
.ligne-equipe.premiere { box-shadow: inset 6px 0 0 var(--agir); }
.equipe-nom { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 600; }
.equipe-points { font-weight: 700; }
.equipe-membres { color: var(--encre-douce); font-size: 0.9rem; }
.pastille-equipe { display: inline-block; flex: none; width: 0.9rem; height: 0.9rem; margin-right: 0.45rem; border-radius: 50%; vertical-align: -0.08em; }
.equipe-nom .pastille-equipe { margin-right: 0; }
.tableau-equipes thead th { white-space: nowrap; }
.tableau-equipes { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--carte-bord); border-radius: var(--rayon); background: var(--carte); color: var(--encre); }
.tableau-equipes th, .tableau-equipes td { padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--carte-bord); text-align: center; }
.tableau-equipes thead th { position: sticky; top: 0; z-index: 2; background: #f3ecdb; }
.tableau-equipes .col-question {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 22rem;
  min-width: 14rem;
  background: var(--carte);
  text-align: left;
  box-shadow: 1px 0 0 var(--carte-bord);
}
.tableau-equipes thead .col-question { z-index: 3; background: #f3ecdb; }
.tableau-equipes .col-question .q-num { margin-right: 0.5rem; }
.tableau-equipes .col-question .q-resume { display: inline; max-width: none; margin: 0; font-size: 0.9rem; }
