/* ============================
   VARIABLES — palette reprise du logo MathsMDE
============================ */
:root {
  --bleu-clair: #d0e4ff;
  --bleu-accent: #7fb3ff;
  --bleu-primaire: #0050a0;
  --bleu-fonce: #003a80;
  --bleu-marine: #002a60;
  --bleu-nuit: #001a40;

  --primary: var(--bleu-primaire); /* conserve pour compat avec l'existant */

  --bg: #f4f8ff;
  --text: #1c2b3a;
  --text-muted: #5b6b7d;
  --card-bg: #fff;
  --shadow: rgba(0, 42, 96, 0.10);
  --shadow-strong: rgba(0, 42, 96, 0.18);
  --radius: 18px;
}

/* ============================
   RESET & BASE
============================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background:
    radial-gradient(circle at 15% 0%, var(--bleu-clair) 0%, transparent 45%),
    radial-gradient(circle at 100% 20%, #eaf2ff 0%, transparent 40%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
}

/* Garde-fous anti-debordement (mobile/tablette surtout) : un tableau, une
   image ou un bloc de code trop large ne doit jamais casser la mise en
   page globale — il doit rester DANS son conteneur, quitte a scroller
   localement (voir .ens-table-wrap plus bas pour les tableaux). */
img, svg, video, canvas {
  max-width: 100%;
  height: auto;
}

table {
  max-width: 100%;
}

pre, code {
  max-width: 100%;
  overflow-x: auto;
  word-wrap: break-word;
}

.cours, .cours-importe, .exercice, .question {
  max-width: 100%;
  overflow-x: auto;
}

h1, h2, h3, .brand-text, .chap-title {
  font-family: 'Lexend', 'Inter', sans-serif;
}

a { color: inherit; }

/* ============================
   HEADER
============================ */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border-bottom: 1px solid rgba(0, 58, 128, 0.08);
  box-shadow: 0 2px 20px rgba(0, 42, 96, 0.06);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 100;
}

.brand {
  min-width: 0;
}

.brand-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Filet degrade en bas du header, clin d'oeil a l'anneau du logo */
header::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 3px;
  background: linear-gradient(90deg, var(--bleu-fonce), var(--bleu-accent), var(--bleu-clair));
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--bleu-fonce);
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text small {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.logo img {
  height: 52px;
  width: auto;
  filter: drop-shadow(0 3px 8px rgba(0, 58, 128, 0.25));
}

.badge-ens {
  background: linear-gradient(135deg, var(--bleu-primaire), var(--bleu-fonce));
  color: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--shadow-strong);
  letter-spacing: 0.02em;
}

/* ============================
   MENU BOUTON + LATERAL
============================ */
.menu-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--bleu-primaire), var(--bleu-fonce));
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--shadow-strong);
  transition: transform 0.15s ease;
}

.menu-button:hover {
  transform: scale(1.06);
}

#side-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 26, 64, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 98;
}

#side-menu-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

#side-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100vh;
  background: #fff;
  box-shadow: -8px 0 30px var(--shadow-strong);
  transition: right 0.3s cubic-bezier(.25,.8,.25,1);
  padding: 100px 20px 24px;
  z-index: 99;
}

#side-menu.open {
  right: 0;
}

#side-menu nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  margin-bottom: 4px;
  text-decoration: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  border-radius: 12px;
  transition: background 0.15s ease, color 0.15s ease;
}

#side-menu nav a .ic {
  font-size: 18px;
}

#side-menu nav a:hover {
  background: var(--bleu-clair);
  color: var(--bleu-fonce);
}

.side-menu-sep {
  height: 1px;
  background: #e6edf7;
  margin: 12px 4px;
}

/* ============================
   MAIN
============================ */
main {
  flex: 1;
  padding: 130px 20px 40px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

h1 {
  text-align: center;
  color: var(--bleu-fonce);
  margin-bottom: 8px;
  font-size: 30px;
  font-weight: 800;
}

main > p {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* ============================
   CARTES CHAPITRES
============================ */
.chap-grid {
  max-width: 950px;
  margin: 30px auto 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 22px;
}

.chap-card {
  background: var(--card-bg);
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--shadow);
  border: 1px solid rgba(0, 58, 128, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  display: block;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.chap-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--bleu-primaire), var(--bleu-accent));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.chap-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px var(--shadow-strong);
}

.chap-card:hover::before {
  opacity: 1;
}

.chap-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--bleu-clair), var(--bleu-fonce));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 12px;
  box-shadow: 0 4px 10px var(--shadow);
}

.chap-title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--bleu-fonce);
  line-height: 1.35;
}

.chap-desc {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ============================
   BOUTONS
============================ */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--bleu-primaire), var(--bleu-fonce));
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px var(--shadow-strong);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px var(--shadow-strong);
}

/* ============================
   COURS
============================ */
.cours {
  background: var(--card-bg);
  padding: 28px 30px;
  border-radius: var(--radius);
  box-shadow: 0 10px 28px var(--shadow);
  border: 1px solid rgba(0, 58, 128, 0.06);
  margin-bottom: 30px;
}

.cours h2 {
  color: var(--bleu-fonce);
  font-size: 20px;
  margin: 22px 0 10px;
}

.cours h2:first-child { margin-top: 0; }

.cours p, .cours li { margin-bottom: 10px; }
.cours ul, .cours ol { padding-left: 22px; margin-bottom: 14px; }

section > h2 {
  color: var(--bleu-fonce);
  font-size: 21px;
  margin: 36px 0 16px;
  padding-left: 14px;
  border-left: 4px solid var(--bleu-accent);
}

section:first-of-type > h2 { margin-top: 0; }

/* ============================
   EXERCICES / QCM
============================ */
.exercice, .question {
  background: #fff;
  padding: 18px 20px;
  border-radius: 14px;
  box-shadow: 0 6px 20px var(--shadow);
  border: 1px solid rgba(0, 58, 128, 0.06);
  margin-bottom: 18px;
}

.correction {
  background: var(--bleu-clair);
  padding: 14px 16px;
  border-radius: 10px;
  margin-top: 10px;
}

.question p { margin-bottom: 10px; }

.question label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.15s ease;
  cursor: pointer;
}

.question label:hover {
  background: var(--bleu-clair);
}

/* ============================
   RESULTAT / FEEDBACK
============================ */
.resultat, .login-error {
  padding: 14px 16px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
}

.login-error {
  background: #ffe3e3;
  color: #b42318;
  margin-bottom: 16px;
}

/* ============================
   LOGIN / INSCRIPTION
============================ */
.login-main {
  padding: 150px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.login-main h1 {
  font-size: 28px;
  color: var(--bleu-fonce);
  margin-bottom: 26px;
}

.login-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  padding: 32px;
  border-radius: 22px;
  width: 340px;
  max-width: 100%;
  box-shadow: 0 16px 40px var(--shadow-strong);
  border: 1px solid rgba(0, 58, 128, 0.08);
}

.login-card label {
  font-weight: 600;
  margin-top: 12px;
  display: block;
  font-size: 14px;
  color: var(--text);
}

.login-card input {
  width: 100%;
  padding: 11px 12px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid #d7e2f2;
  font-size: 15px;
  font-family: inherit;
  background: #fbfdff;
}

.login-card input:focus {
  outline: none;
  border-color: var(--bleu-primaire);
  box-shadow: 0 0 0 3px var(--bleu-clair);
}

.login-card a {
  color: var(--bleu-primaire);
  font-weight: 600;
  text-decoration: none;
}

.login-card a:hover { text-decoration: underline; }

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 600px) {
  header { padding: 10px 16px; }
  .brand-text { font-size: 16px; }
  .logo img { height: 42px; }
  .menu-button { width: 40px; height: 40px; font-size: 18px; }
  main { padding: 110px 14px 30px; }
  h1 { font-size: 24px; }
  .cours { padding: 20px; }
}

/* ============================
   CONTENU IMPORTE (cours + exercices/QCM generateur)
   Classes utilisees par les leçons/QCM HTML fournis par l'enseignant
============================ */
.cours-importe {
  font-family: 'Inter', system-ui, sans-serif;
}

.cours-importe section {
  background: #fff;
  margin: 22px 0;
  padding: 22px 24px;
  border-radius: 16px;
  box-shadow: 0 8px 24px var(--shadow);
  border: 1px solid rgba(0, 58, 128, 0.06);
}

.cours-importe h2 {
  color: var(--bleu-fonce);
  font-size: 19px;
  margin-bottom: 14px;
}

.cours-importe h3 {
  color: var(--bleu-primaire);
  font-size: 16px;
  margin: 16px 0 8px;
}

.cours-importe .formule {
  background: var(--bleu-clair);
  padding: 14px 16px;
  border-left: 5px solid var(--bleu-primaire);
  font-weight: 600;
  margin: 16px 0;
  border-radius: 0 10px 10px 0;
  overflow-x: auto;
}

.cours-importe .example {
  background: #eef6ff;
  padding: 14px 16px;
  border-left: 5px solid var(--bleu-accent);
  margin: 16px 0;
  border-radius: 0 10px 10px 0;
  overflow-x: auto;
}

.cours-importe .proposition {
  padding: 12px 14px;
  background: #f0f7ff;
  border-left: 5px solid var(--bleu-primaire);
  margin: 10px 0;
  cursor: pointer;
  border-radius: 0 10px 10px 0;
  transition: background 0.15s ease, transform 0.1s ease;
}

.cours-importe .proposition:hover {
  background: var(--bleu-clair);
  transform: translateX(2px);
}

.cours-importe .correct { color: #16a34a; font-weight: 700; }
.cours-importe .wrong { color: #dc2626; font-weight: 700; }

.cours-importe button {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--bleu-primaire), var(--bleu-fonce));
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  margin: 6px 4px 6px 0;
  box-shadow: 0 6px 16px var(--shadow);
  transition: transform 0.15s ease;
}

.cours-importe button:hover {
  transform: translateY(-2px);
}

.cours-importe input[type="number"],
.cours-importe input[type="text"] {
  padding: 9px 12px;
  width: 130px;
  font-size: 15px;
  border-radius: 8px;
  border: 1px solid #d7e2f2;
  margin-right: 8px;
}

.cours-importe #gen-question,
.cours-importe #enonce {
  font-weight: 600;
  margin: 14px 0 10px;
  color: var(--text);
}

/* ============================
   QCM NOTE — mise en page enrichie
============================ */
.qcm-progress-bar {
  max-width: 700px;
  margin: 0 auto 6px;
  height: 10px;
  background: var(--bleu-clair);
  border-radius: 999px;
  overflow: hidden;
}

.qcm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--bleu-primaire), var(--bleu-accent));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.qcm-progress-label {
  max-width: 700px;
  margin: 0 auto 22px;
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
}

.qcm-form {
  max-width: 700px;
  margin: 0 auto;
}

.qcm-question-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.qcm-question-header .chap-num {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.qcm-choix-grid {
  display: grid;
  gap: 10px;
}

.qcm-choix {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid #e3ebf5;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.qcm-choix:hover {
  background: var(--bleu-clair);
  border-color: var(--bleu-accent);
}

.qcm-choix input[type="radio"] {
  accent-color: var(--bleu-primaire);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.qcm-choix input[type="radio"]:checked ~ .qcm-choix-lettre {
  background: var(--bleu-primaire);
  color: #fff;
}

.qcm-choix:has(input:checked) {
  border-color: var(--bleu-primaire);
  background: var(--bleu-clair);
}

.qcm-choix-lettre {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bleu-clair);
  color: var(--bleu-fonce);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s ease, color 0.15s ease;
}

.qcm-choix-texte {
  font-size: 15px;
}

/* ---- Page de resultat ---- */
.qcm-resultat-shell {
  max-width: 520px;
  margin: 0 auto 40px;
  text-align: center;
}

.qcm-score-cercle {
  --pct: 0;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: center;
  background: conic-gradient(var(--score-color, var(--bleu-primaire)) calc(var(--pct) * 1%), #e9eef7 0);
  position: relative;
}

.qcm-score-cercle::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fff;
}

.qcm-score-note, .qcm-score-sur {
  position: relative;
  z-index: 1;
  font-family: 'Lexend', sans-serif;
  font-weight: 800;
  color: var(--bleu-fonce);
}

.qcm-score-note { font-size: 40px; }
.qcm-score-sur { font-size: 16px; color: var(--text-muted); }

.qcm-score-excellent { --score-color: #16a34a; }
.qcm-score-bien { --score-color: var(--bleu-primaire); }
.qcm-score-a-revoir { --score-color: #dc2626; }

.qcm-score-detail {
  color: var(--text-muted);
  margin-top: 4px;
}

.qcm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

.btn-outline {
  background: #fff;
  color: var(--bleu-primaire);
  border: 1.5px solid var(--bleu-primaire);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--bleu-clair);
}

.qcm-correction {
  max-width: 700px;
  margin: 0 auto;
}

.qcm-correction h2 {
  color: var(--bleu-fonce);
  font-size: 20px;
  margin-bottom: 16px;
  text-align: center;
}

.qcm-correction-item {
  display: flex;
  gap: 14px;
  background: #fff;
  padding: 16px 18px;
  border-radius: 14px;
  box-shadow: 0 6px 18px var(--shadow);
  margin-bottom: 12px;
  border-left: 4px solid transparent;
}

.qcm-correction-item.ok { border-left-color: #16a34a; }
.qcm-correction-item.ko { border-left-color: #dc2626; }

.qcm-correction-num {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.qcm-correction-item.ok .qcm-correction-num { background: #dcfce7; color: #16a34a; }
.qcm-correction-item.ko .qcm-correction-num { background: #fee2e2; color: #dc2626; }

.qcm-correction-enonce { margin-bottom: 6px; }
.qcm-correction-rep { font-size: 14px; color: var(--text-muted); line-height: 1.5; }

@media (max-width: 600px) {
  .qcm-actions { flex-direction: column; }
  .qcm-actions .btn { width: 100%; }
}

/* ============================
   LISTE DES QCM D'UN CHAPITRE
============================ */
.qcm-liste-chapitre {
  display: grid;
  gap: 12px;
}

.qcm-carte-chapitre {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  box-shadow: 0 6px 18px var(--shadow);
  border: 1px solid rgba(0, 58, 128, 0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.qcm-carte-chapitre:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px var(--shadow-strong);
}

.qcm-carte-titre {
  font-weight: 700;
  color: var(--bleu-fonce);
}

.qcm-carte-meta {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================
   MINUTEUR QCM
============================ */
.qcm-minuteur {
  max-width: 700px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 18px var(--shadow);
  font-weight: 700;
  color: var(--bleu-fonce);
  font-family: 'Lexend', sans-serif;
  font-size: 18px;
}

.qcm-minuteur.alerte {
  color: #dc2626;
  animation: qcm-pulse 1s infinite;
}

@keyframes qcm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* ============================
   MINUTEUR QCM
============================ */
.qcm-timer-shell {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.qcm-timer {
  background: #fff;
  border: 2px solid var(--bleu-primaire);
  color: var(--bleu-fonce);
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  font-size: 18px;
  padding: 8px 20px;
  border-radius: 999px;
  box-shadow: 0 6px 16px var(--shadow);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.qcm-timer.qcm-timer-urgent {
  border-color: #dc2626;
  color: #dc2626;
  animation: qcm-pulse 1s infinite;
}

.qcm-timer.qcm-timer-expire {
  border-color: #dc2626;
  color: #dc2626;
  background: #fee2e2;
}

@keyframes qcm-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* ============================
   STATUT CHAPITRE (enseignant)
============================ */
.statut-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.statut-actif { background: #dcfce7; color: #16a34a; }
.statut-inactif { background: #fee2e2; color: #a00; }

/* ============================
   AUTOMATISMES EN DIRECT
============================ */
.automatismes-barre-controle {
  max-width: 700px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-weight: 600;
  color: var(--bleu-fonce);
}

.automatismes-question-projetee {
  max-width: 700px;
  margin: 0 auto 24px;
  background: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: 0 10px 28px var(--shadow);
  text-align: center;
}

.automatismes-question-projetee p#proj-enonce,
.automatismes-question-projetee p#eleve-enonce {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

.automatismes-live-barres {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.automatismes-barre-ligne {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}

.automatismes-barre-label {
  width: 160px;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 14px;
}

.automatismes-barre-fond {
  flex: 1;
  height: 22px;
  background: var(--bleu-clair);
  border-radius: 999px;
  overflow: hidden;
}

.automatismes-barre-remplie {
  height: 100%;
  background: linear-gradient(90deg, var(--bleu-primaire), var(--bleu-accent));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.automatismes-barre-pct {
  width: 90px;
  flex-shrink: 0;
  font-weight: 700;
  font-size: 14px;
  text-align: right;
}

.automatismes-nuage {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: center;
  align-items: center;
  min-height: 80px;
  padding: 10px;
}

.automatismes-mot {
  color: var(--bleu-primaire);
  font-weight: 700;
  font-family: 'Lexend', sans-serif;
  transition: font-size 0.3s ease;
}

.automatismes-mot:nth-child(3n+1) { color: var(--bleu-fonce); }
.automatismes-mot:nth-child(3n+2) { color: var(--bleu-accent); }

.automatismes-controles {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.automatismes-controles button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#zone-question .qcm-choix-grid {
  margin-top: 6px;
}
