/* ============================================================
   Excel Quiz — Feuille de style principale
   Mode sombre par défaut · Responsive mobile-first
   ============================================================ */

/* ── 1. VARIABLES DE COULEURS & TOKENS ── */
:root {
  /* Fonds */
  --fond-app:     #0d1117;
  --fond-carte:   #161b22;
  --fond-carte2:  #1c2130;
  --fond-overlay: rgba(0, 0, 0, 0.75);

  /* Bordures */
  --bordure:      #30363d;
  --bordure-vive: #484f58;

  /* Textes */
  --texte:        #e6edf3;
  --texte2:       #8b949e;
  --texte3:       #656d76;

  /* Couleur principale : vert Excel */
  --vert:         #217346;
  --vert-clair:   #2d9f5d;
  --vert-vif:     #3fb870;
  --vert-fond:    rgba(63, 184, 112, 0.12);

  /* Feedback */
  --correct:      #3fb870;
  --correct-fond: rgba(63, 184, 112, 0.12);
  --incorrect:    #f85149;
  --incorrect-fond: rgba(248, 81, 73, 0.12);
  --warning:      #d29922;
  --warning-fond: rgba(210, 153, 34, 0.12);

  /* Couleurs catégories */
  --cat-fondamentaux:  #217346;
  --cat-formules-base: #1f6feb;
  --cat-avancees:      #8957e5;
  --cat-tcd:           #e3a21a;
  --cat-graphiques:    #e85d4a;
  --cat-outils:        #4a8fa8;
  --cat-vba:           #a0724a;
  --cat-mixte:         #d29922;

  /* Effets */
  --rayon:     12px;
  --rayon-sm:  8px;
  --ombre:     0 4px 24px rgba(0, 0, 0, 0.4);
  --ombre-btn: 0 2px 8px rgba(0, 0, 0, 0.3);
  --transition: 0.25s ease;
}

/* ── 2. RESET & BASE ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--fond-app);
  color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--vert-vif);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: none;
}

input, select {
  font-family: inherit;
  font-size: inherit;
}

/* ── 3. ÉCRANS (SPA) ── */
.ecran {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  animation: fonduEntree 0.35s ease both;
}

.ecran.actif {
  display: flex;
}

@keyframes fonduEntree {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* ── 4. PIED DE PAGE ── */
.pied-page {
  text-align: center;
  padding: 16px;
  color: var(--texte3);
  font-size: 0.85rem;
  border-top: 1px solid var(--bordure);
  margin-top: auto;
}
.pied-page a { color: var(--vert-vif); }

/* ════════════════════════════════════════════
   ACCUEIL
   ════════════════════════════════════════════ */

/* En-tête */
.accueil-entete {
  background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
  border-bottom: 1px solid var(--bordure);
  padding: 32px 20px 28px;
  text-align: center;
}

.logo-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.logo-icone {
  font-size: 3rem;
  filter: drop-shadow(0 0 12px rgba(33, 115, 70, 0.6));
  animation: flotterLogo 3s ease-in-out infinite;
}

@keyframes flotterLogo {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(-6px); }
}

.logo-titre {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--texte);
  letter-spacing: -0.5px;
}

.logo-sous-titre {
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--texte2);
  margin-top: 2px;
}

/* Contenu principal accueil */
.accueil-contenu {
  flex: 1;
  padding: 32px 16px 24px;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
}

/* Sections */
.section-accueil {
  margin-bottom: 40px;
}

.section-masquee {
  display: none;
}

.section-titre {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--texte2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

/* ── Grille catégories ── */
.grille-categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 600px) {
  .grille-categories { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 900px) {
  .grille-categories { grid-template-columns: repeat(4, 1fr); }
}

.carte-categorie {
  background: var(--fond-carte);
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 18px 14px;
  cursor: pointer;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition),
              box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.carte-categorie::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--couleur-cat, var(--vert));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}

.carte-categorie:hover {
  transform: translateY(-3px);
  border-color: var(--couleur-cat, var(--vert));
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.carte-categorie:hover::before,
.carte-categorie.selectionnee::before {
  transform: scaleX(1);
}

.carte-categorie.selectionnee {
  border-color: var(--couleur-cat, var(--vert));
  background: color-mix(in srgb, var(--couleur-cat, var(--vert)) 8%, var(--fond-carte));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--couleur-cat, var(--vert)) 25%, transparent);
}

.cat-icone {
  display: block;
  font-size: 2rem;
  margin-bottom: 8px;
}

.cat-nom {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--texte);
  margin-bottom: 4px;
}

.cat-desc {
  font-size: 0.75rem;
  color: var(--texte2);
  line-height: 1.4;
}

.carte-mixte { grid-column: span 2; }
@media (min-width: 600px) { .carte-mixte { grid-column: span 1; } }

/* ── Boutons de niveau ── */
.btns-niveaux {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

@media (min-width: 600px) {
  .btns-niveaux { grid-template-columns: repeat(4, 1fr); }
}

.btn-niveau {
  background: var(--fond-carte);
  border: 2px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 14px 10px;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transition), background var(--transition),
              transform var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.btn-niveau:hover {
  border-color: var(--vert-clair);
  transform: translateY(-2px);
}

.btn-niveau.actif {
  border-color: var(--vert-vif);
  background: var(--vert-fond);
  color: var(--vert-vif);
}

.niv-icone  { font-size: 1.4rem; }
.niv-label  { font-size: 0.9rem; font-weight: 600; }
.niv-desc   { font-size: 0.72rem; color: var(--texte2); }

.btn-niveau.actif .niv-desc { color: var(--vert-vif); }

/* ── Panel configuration ── */
.config-panel {
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.config-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.config-label-texte {
  font-size: 0.95rem;
  color: var(--texte2);
}

.select-styled {
  background: var(--fond-carte2);
  color: var(--texte);
  border: 1px solid var(--bordure-vive);
  border-radius: var(--rayon-sm);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color var(--transition);
}
.select-styled:hover, .select-styled:focus {
  border-color: var(--vert-clair);
  outline: none;
}

.config-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.info-quiz {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.info-item {
  background: var(--fond-carte2);
  border: 1px solid var(--bordure);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--texte2);
}
.info-item strong { color: var(--texte); }

.avertissement {
  color: var(--warning);
  font-size: 0.9rem;
  padding: 8px 12px;
  background: var(--warning-fond);
  border-radius: var(--rayon-sm);
  border: 1px solid var(--warning);
  width: 100%;
}

/* ── Bouton démarrer ── */
.btn-demarrer {
  display: block;
  width: 100%;
  padding: 16px 24px;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
  background: linear-gradient(135deg, var(--vert) 0%, var(--vert-clair) 100%);
  border-radius: var(--rayon);
  border: none;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition),
              box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(33, 115, 70, 0.4);
}
.btn-demarrer:hover:not(:disabled) {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(33, 115, 70, 0.5);
}
.btn-demarrer:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}


/* ════════════════════════════════════════════
   ÉCRAN QUIZ
   ════════════════════════════════════════════ */

/* En-tête quiz */
.quiz-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--fond-carte);
  border-bottom: 1px solid var(--bordure);
  position: sticky;
  top: 0;
  z-index: 10;
  gap: 12px;
}

.quiz-meta-gauche,
.quiz-meta-droite {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-quitter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fond-carte2);
  border: 1px solid var(--bordure);
  color: var(--texte2);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.btn-quitter:hover {
  background: var(--incorrect-fond);
  color: var(--incorrect);
  border-color: var(--incorrect);
}

.quiz-categorie-label {
  font-size: 0.85rem;
  color: var(--texte2);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.quiz-score {
  font-size: 1rem;
  font-weight: 700;
  color: var(--vert-vif);
  background: var(--vert-fond);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--vert-clair);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

/* ── Timer SVG ── */
.quiz-timer {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timer-svg {
  width: 40px;
  height: 40px;
  position: absolute;
  top: 0;
  left: 0;
}

.timer-fond {
  stroke: var(--bordure-vive);
  stroke-width: 3;
}

.timer-arc {
  stroke: var(--vert-vif);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.timer-texte {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--texte);
  position: relative;
  z-index: 1;
}

/* Timer urgent (< 10s) */
.quiz-timer.urgent .timer-arc  { stroke: var(--incorrect); }
.quiz-timer.urgent .timer-texte { color: var(--incorrect); }
.quiz-timer.urgent { animation: pulsationUrgente 0.8s ease-in-out infinite; }

@keyframes pulsationUrgente {
  0%, 100% { transform: scale(1);    }
  50%       { transform: scale(1.12); }
}

/* ── Barre de progression ── */
.progression-wrapper {
  height: 4px;
  background: var(--bordure);
  overflow: hidden;
}

.progression-barre {
  height: 100%;
  background: linear-gradient(90deg, var(--vert) 0%, var(--vert-vif) 100%);
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}

.progression-texte {
  text-align: center;
  font-size: 0.78rem;
  color: var(--texte3);
  padding: 6px 0 2px;
  letter-spacing: 0.5px;
}

/* ── Contenu quiz ── */
.quiz-contenu {
  flex: 1;
  padding: 16px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* ── Carte question ── */
.carte-question {
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--ombre);
  animation: glisserQuestion 0.3s ease both;
}

@keyframes glisserQuestion {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0);   }
}

.carte-question.entree {
  animation: glisserQuestion 0.3s ease both;
}

/* Badges */
.question-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-type {
  background: rgba(33, 115, 70, 0.2);
  color: var(--vert-vif);
  border: 1px solid var(--vert);
}

.badge-niveau {
  background: var(--fond-carte2);
  color: var(--texte2);
  border: 1px solid var(--bordure);
}

/* Texte de la question */
.question-texte {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  color: var(--texte);
  line-height: 1.65;
  margin-bottom: 20px;
}

.question-texte .blank-placeholder {
  display: inline-block;
  min-width: 80px;
  border-bottom: 2px solid var(--vert-vif);
  color: var(--vert-vif);
  font-weight: 700;
  padding: 0 4px;
}

/* ── Options QCM ── */
.options-container { width: 100%; }
.options-qcm { display: flex; flex-direction: column; gap: 10px; }

.option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--fond-carte2);
  border: 2px solid var(--bordure);
  border-radius: var(--rayon-sm);
  color: var(--texte);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
              transform var(--transition);
  width: 100%;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--vert-clair);
  background: rgba(45, 159, 93, 0.08);
  transform: translateX(3px);
}

.option-lettre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  background: var(--fond-carte);
  border: 1px solid var(--bordure-vive);
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
  color: var(--texte2);
  transition: background var(--transition), color var(--transition);
}

.option-texte { flex: 1; line-height: 1.4; }

.option-btn.correct {
  border-color: var(--correct);
  background: var(--correct-fond);
  color: var(--correct);
}
.option-btn.correct .option-lettre {
  background: var(--correct);
  color: #fff;
  border-color: var(--correct);
}

.option-btn.incorrect {
  border-color: var(--incorrect);
  background: var(--incorrect-fond);
  color: var(--incorrect);
}
.option-btn.incorrect .option-lettre {
  background: var(--incorrect);
  color: #fff;
  border-color: var(--incorrect);
}

.option-btn:disabled { cursor: default; transform: none !important; }

/* ── Vrai/Faux ── */
.options-vrai-faux {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vf-btn {
  padding: 20px 12px;
  border-radius: var(--rayon);
  font-size: 1.1rem;
  font-weight: 700;
  border: 2px solid var(--bordure);
  background: var(--fond-carte2);
  color: var(--texte);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
              transform var(--transition);
  text-align: center;
}

.vf-btn:hover:not(:disabled) { transform: translateY(-3px); }

.vf-vrai:hover:not(:disabled) {
  border-color: var(--correct);
  background: var(--correct-fond);
  color: var(--correct);
}

.vf-faux:hover:not(:disabled) {
  border-color: var(--incorrect);
  background: var(--incorrect-fond);
  color: var(--incorrect);
}

.vf-btn.correct { border-color: var(--correct); background: var(--correct-fond); color: var(--correct); }
.vf-btn.incorrect { border-color: var(--incorrect); background: var(--incorrect-fond); color: var(--incorrect); }
.vf-btn:disabled { cursor: default; transform: none !important; }

/* ── QCM Multiple ── */
.instruction-multiple {
  font-size: 0.85rem;
  color: var(--texte2);
  margin-bottom: 10px;
  font-style: italic;
}

.option-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--fond-carte2);
  border: 2px solid var(--bordure);
  border-radius: var(--rayon-sm);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}

.option-checkbox:hover { border-color: var(--vert-clair); }

.option-checkbox input[type="checkbox"] { display: none; }

.checkbox-custom {
  min-width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid var(--bordure-vive);
  background: var(--fond-carte);
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}

.option-checkbox input:checked + .checkbox-custom {
  background: var(--vert);
  border-color: var(--vert);
}

.option-checkbox input:checked + .checkbox-custom::after {
  content: '✓';
  color: #fff;
  font-size: 0.8rem;
  font-weight: 900;
}

.option-checkbox.correct { border-color: var(--correct); background: var(--correct-fond); }
.option-checkbox.incorrect { border-color: var(--incorrect); background: var(--incorrect-fond); }

.btn-valider-multiple,
.btn-valider-saisie {
  margin-top: 14px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--vert) 0%, var(--vert-clair) 100%);
  color: #fff;
  border-radius: var(--rayon-sm);
  font-weight: 600;
  font-size: 0.95rem;
  transition: opacity var(--transition);
  border: none;
  cursor: pointer;
  display: block;
  width: 100%;
}
.btn-valider-multiple:hover,
.btn-valider-saisie:hover { opacity: 0.88; }

/* ── Saisie texte / complétion ── */
.options-texte,
.options-completion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saisie-wrapper {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.input-texte {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  background: var(--fond-carte2);
  border: 2px solid var(--bordure-vive);
  border-radius: var(--rayon-sm);
  color: var(--texte);
  font-size: 1rem;
  outline: none;
  transition: border-color var(--transition);
}

.input-texte:focus { border-color: var(--vert-clair); }
.input-texte.correct { border-color: var(--correct); background: var(--correct-fond); color: var(--correct); }
.input-texte.incorrect { border-color: var(--incorrect); background: var(--incorrect-fond); color: var(--incorrect); }
.input-texte:disabled { opacity: 0.7; cursor: default; }

.btn-valider-saisie {
  width: auto;
  flex-shrink: 0;
  margin-top: 0;
  padding: 12px 20px;
}

/* ── Panneau indice ── */
.indice-panel {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--warning-fond);
  border: 1px solid var(--warning);
  border-radius: var(--rayon-sm);
  padding: 12px 16px;
  margin-top: 16px;
  animation: glisserBas 0.25s ease both;
}

.indice-icone { font-size: 1.2rem; flex-shrink: 0; }
.indice-texte { font-size: 0.9rem; color: var(--texte); line-height: 1.5; }

/* ── Panneau feedback ── */
.feedback-panel {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--rayon-sm);
  border-left: 4px solid transparent;
  animation: glisserBas 0.3s ease both;
}

.feedback-panel.correct {
  background: var(--correct-fond);
  border-color: var(--correct);
}
.feedback-panel.incorrect {
  background: var(--incorrect-fond);
  border-color: var(--incorrect);
}

.feedback-entete {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.feedback-icone { font-size: 1.4rem; }

.feedback-titre {
  font-size: 1rem;
  font-weight: 700;
}

.feedback-panel.correct  .feedback-titre { color: var(--correct);   }
.feedback-panel.incorrect .feedback-titre { color: var(--incorrect); }

.feedback-explication {
  font-size: 0.9rem;
  color: var(--texte);
  line-height: 1.65;
}

.feedback-explication strong { color: var(--texte); font-weight: 600; }

@keyframes glisserBas {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* ── Boutons d'action quiz ── */
.quiz-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-action {
  padding: 12px 18px;
  border-radius: var(--rayon-sm);
  font-size: 0.9rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition),
              border-color var(--transition), background var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;
  min-width: 120px;
}
.btn-action:hover:not(:disabled) { transform: translateY(-2px); }
.btn-action:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

.btn-indice {
  background: var(--warning-fond);
  color: var(--warning);
  border-color: var(--warning);
}
.btn-indice:hover:not(:disabled) { background: rgba(210, 153, 34, 0.2); }

.btn-passer {
  background: var(--fond-carte2);
  color: var(--texte2);
  border-color: var(--bordure-vive);
}
.btn-passer:hover:not(:disabled) { border-color: var(--texte2); color: var(--texte); }

.btn-suivant {
  background: linear-gradient(135deg, var(--vert) 0%, var(--vert-clair) 100%);
  color: #fff;
  border-color: var(--vert-clair);
  box-shadow: 0 2px 10px rgba(33, 115, 70, 0.3);
  flex: 2;
}
.btn-suivant:hover { opacity: 0.88; }

.badge-malus {
  font-size: 0.7rem;
  background: rgba(210, 153, 34, 0.25);
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 700;
}


/* ════════════════════════════════════════════
   ÉCRAN RÉSULTATS
   ════════════════════════════════════════════ */

.resultats-wrapper {
  flex: 1;
  padding: 24px 16px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

/* En-tête */
.resultats-entete {
  text-align: center;
  margin-bottom: 28px;
}
.resultats-entete h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin-bottom: 4px;
}
.resultats-entete p { color: var(--texte2); font-size: 0.95rem; }

/* Score principal */
.resultats-score-wrapper {
  display: flex;
  align-items: center;
  gap: 24px;
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.score-cercle {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: conic-gradient(var(--couleur-score, var(--vert-vif)) var(--pct, 0%), var(--bordure) 0%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.score-cercle::before {
  content: '';
  position: absolute;
  inset: 8px;
  background: var(--fond-carte);
  border-radius: 50%;
}

.score-pct,
.score-label {
  position: relative;
  z-index: 1;
}

.score-pct {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--couleur-score, var(--vert-vif));
  line-height: 1;
}

.score-label { font-size: 0.7rem; color: var(--texte2); letter-spacing: 1px; text-transform: uppercase; }

.score-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.stat-item {
  background: var(--fond-carte2);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon-sm);
  padding: 12px;
  text-align: center;
}

.stat-valeur {
  display: block;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--texte);
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--texte2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Niveau estimé */
.niveau-estime {
  text-align: center;
  padding: 12px 20px;
  background: var(--vert-fond);
  border: 1px solid var(--vert);
  border-radius: var(--rayon-sm);
  color: var(--vert-vif);
  font-size: 0.95rem;
  margin-bottom: 20px;
}
.niveau-estime strong { font-size: 1.05rem; }

/* Boutons résultats */
.resultats-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.btn-recommencer {
  background: linear-gradient(135deg, var(--vert) 0%, var(--vert-clair) 100%);
  color: #fff;
  border-color: var(--vert-clair);
}

.btn-changer-cat {
  background: var(--fond-carte);
  color: var(--texte);
  border-color: var(--bordure-vive);
}
.btn-changer-cat:hover { border-color: var(--texte2); }

.btn-revoir-erreurs {
  background: var(--incorrect-fond);
  color: var(--incorrect);
  border-color: var(--incorrect);
}

.btn-partager {
  background: var(--fond-carte2);
  color: var(--texte2);
  border-color: var(--bordure-vive);
}
.btn-partager:hover { border-color: var(--texte); color: var(--texte); }

/* Récapitulatif réponses */
.recap-reponses h2 {
  font-size: 1rem;
  color: var(--texte2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.liste-reponses { display: flex; flex-direction: column; gap: 8px; }

.reponse-item {
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-left: 4px solid var(--bordure);
  border-radius: var(--rayon-sm);
  padding: 12px 14px;
  transition: border-color 0.2s;
}

.reponse-item.correct   { border-left-color: var(--correct);   }
.reponse-item.incorrect { border-left-color: var(--incorrect); }

.reponse-entete {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.reponse-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--texte3);
  min-width: 20px;
}

.reponse-icone { font-size: 1rem; }

.reponse-pts {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--texte2);
}
.reponse-item.correct .reponse-pts { color: var(--correct); }

.reponse-question {
  font-size: 0.88rem;
  color: var(--texte);
  line-height: 1.4;
  margin-bottom: 2px;
}

.reponse-correction {
  font-size: 0.82rem;
  color: var(--correct);
  margin-top: 4px;
}

/* ════════════════════════════════════════════
   MODAL RÉVISION DES ERREURS
   ════════════════════════════════════════════ */

.revue-erreurs-modal {
  position: fixed;
  inset: 0;
  background: var(--fond-overlay);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px 12px;
  animation: fonduEntree 0.2s ease;
}

.revue-erreurs-contenu {
  background: var(--fond-carte);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--ombre);
}

.revue-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--bordure);
  position: sticky;
  top: 0;
  background: var(--fond-carte);
}

.revue-entete h2 { font-size: 1rem; color: var(--texte); }

.revue-entete button {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--fond-carte2);
  border: 1px solid var(--bordure);
  color: var(--texte2);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition), color var(--transition);
}
.revue-entete button:hover { background: var(--incorrect-fond); color: var(--incorrect); }

.revue-liste { padding: 16px 20px; display: flex; flex-direction: column; gap: 20px; }

.revue-item {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--bordure);
}
.revue-item:last-child { border-bottom: none; padding-bottom: 0; }

.revue-question {
  font-size: 0.95rem;
  color: var(--texte);
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.45;
}

.revue-type {
  font-size: 0.75rem;
  color: var(--texte3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.revue-options { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.revue-options li {
  font-size: 0.85rem;
  color: var(--texte2);
  padding: 4px 0;
}
.revue-options li.option-correcte {
  color: var(--correct);
  font-weight: 600;
}

.revue-bonne-rep {
  font-size: 0.88rem;
  color: var(--correct);
  margin-bottom: 8px;
}
.revue-bonne-rep strong { color: var(--correct); }

.revue-explication {
  font-size: 0.85rem;
  color: var(--texte2);
  line-height: 1.6;
  padding: 10px 12px;
  background: var(--fond-carte2);
  border-radius: var(--rayon-sm);
  border-left: 3px solid var(--vert);
  margin-top: 8px;
}

/* ════════════════════════════════════════════
   RESPONSIVE — GRANDS ÉCRANS
   ════════════════════════════════════════════ */
@media (min-width: 768px) {
  .accueil-contenu { padding: 40px 24px 32px; }
  .quiz-contenu    { padding: 24px; }
  .resultats-wrapper { padding: 32px 24px; }

  .quiz-categorie-label { max-width: none; }

  .quiz-actions { flex-wrap: nowrap; }
  .btn-action   { flex: initial; }

  .resultats-actions .btn-action { flex: 1; }

  .score-details { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
  .accueil-entete { padding: 48px 24px 40px; }
  .logo-icone { font-size: 3.5rem; }
}
