/* À LA DÉCOUVERTE DES COULEURS — feuille de style
   Même famille visuelle que « À la découverte des cellules » : titres en Bricolage Grotesque,
   texte en Atkinson Hyperlegible, chiffres en IBM Plex Mono.
   Mise en page : une barre en haut, puis un écran (accueil, activité ou quiz).
   Une activité = une scène animée à gauche (salle noire ou feuille blanche) et un panneau à droite. */
:root {
  --fond: #f4f4f9;
  --surface: #ffffff;
  --surface-2: #ebe9f3;
  --encre: #1c1a2c;
  --encre-2: #57546f;
  --ligne: #d8d5e5;
  --accent: #4f3fc2;
  --accent-encre: #ffffff;
  --accent-doux: #e6e2ff;
  --college: #2f7a3c; --college-doux: #e1f2e3;
  --seconde: #1f63b5; --seconde-doux: #e0ecfa;
  --premiere: #8a2f86; --premiere-doux: #f6e2f4;
  --bon: #1f7a3d;
  --bon-doux: #dff3e5;
  --faux: #b3261e;
  --faux-doux: #fbe2df;
  --verre: rgba(255, 255, 255, 0.82);
  --ombre: 0 1px 2px rgba(28, 26, 44, 0.08), 0 8px 24px rgba(28, 26, 44, 0.08);
  --spectre: linear-gradient(90deg, #6000ff, #0077ff 17%, #00deff 27%, #00ffa6 38%, #afff00 50%, #feff00 54%, #ff8e00 62%, #ff0023 75%, #d90031 90%, #8c0020);

  --nuit-1: #1d1b2e; --nuit-2: #07060c; --nuit-encre: #ecebf6; --nuit-encre-2: #aaa7c2; --nuit-ligne: rgba(255, 255, 255, 0.14);
  --jour-1: #ffffff; --jour-2: #e6e4ee;

  --f-titre: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --f-texte: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --t-xs: 0.78rem; --t-s: 0.875rem; --t-m: 1rem; --t-l: 1.2rem; --t-xl: 1.6rem; --t-xxl: clamp(2rem, 4.2vw, 3.1rem);
  --gouttiere: 16px;
}
/* Pas de thème sombre : le site ScolaTools n'en a pas, et ../commun/scolatools.css (chargé après cette feuille)
   garde le texte et les panneaux en clair. Garder ici des pastilles de niveau (collège, seconde, première) et une
   feuille de jour en couleurs sombres les faisait détonner au milieu des panneaux clairs quand l'ordinateur de
   l'élève était réglé en mode sombre. */

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--fond);
  color: var(--encre);
  font: var(--t-m)/1.55 var(--f-texte);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--f-titre); line-height: 1.12; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
a { color: var(--accent); text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.visuellement-cache { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100%; }

/* ---------- barre ---------- */
.barre {
  display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap;
  padding: 10px var(--gouttiere);
  background: var(--surface);
  border-bottom: 1px solid var(--ligne);
  position: relative; z-index: 5;
}
.barre::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--spectre); opacity: 0.85; }
.lien-portail {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 999px; margin-right: -16px;
  color: var(--encre-2); text-decoration: none; font-size: var(--t-l); border: 1px solid var(--ligne);
}
.lien-portail:hover { color: var(--accent); border-color: var(--accent); }
.marque {
  font-family: var(--f-titre); font-weight: 750; font-size: var(--t-l); color: var(--encre); text-decoration: none;
  letter-spacing: -0.02em; display: inline-flex; align-items: baseline; gap: 0.3em;
}
.marque span {
  font-family: var(--f-mono); font-weight: 500; font-size: var(--t-xs); color: #14131f; background: var(--spectre);
  padding: 2px 7px; border-radius: 4px; letter-spacing: 0.04em; transform: translateY(-2px);
}
.barre nav { display: flex; gap: 4px; flex-wrap: wrap; }
.barre nav a { color: var(--encre-2); text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: var(--t-s); }
.barre nav a:hover { color: var(--encre); background: var(--surface-2); }
.barre nav a[aria-current="page"] { color: var(--accent-encre); background: var(--accent); }

main { position: relative; min-height: 0; }
.ecran { position: absolute; inset: 0; }

/* ---------- accueil ---------- */
.accueil { overflow: auto; }
.accueil-mise { max-width: 1160px; margin: 0 auto; padding: 32px var(--gouttiere) 48px; display: grid; gap: 34px; }
.accueil-intro { display: grid; gap: 14px; max-width: 70ch; }
.surtitre { font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--premiere); margin: 0; }
.accueil-intro h1 { font-size: var(--t-xxl); font-weight: 780; }
.accueil-intro h1 em { font-style: normal; background: var(--spectre); -webkit-background-clip: text; background-clip: text; color: transparent; }
.accueil-intro > p { margin: 0; color: var(--encre-2); font-size: var(--t-l); line-height: 1.5; }
.filtre-niveau { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--t-s); }
.filtre-niveau > span { color: var(--encre-2); margin-right: 4px; }
.section-accueil { display: grid; gap: 14px; scroll-margin-top: 16px; }
.section-accueil > header { display: grid; gap: 4px; }
.section-accueil h2 { font-size: var(--t-xl); font-weight: 720; }
.section-accueil > header p { margin: 0; color: var(--encre-2); font-size: var(--t-s); max-width: 70ch; }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.carte {
  display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--encre);
  background: var(--surface); border: 1px solid var(--ligne); border-radius: 14px; overflow: hidden; box-shadow: var(--ombre);
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.carte:hover { transform: translateY(-3px); border-color: var(--accent); }
.carte img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--nuit-2); }
.carte-texte { padding: 12px 14px 14px; display: grid; gap: 6px; align-content: start; }
.carte h3 { font-size: var(--t-l); font-weight: 720; }
.carte p { margin: 0; color: var(--encre-2); font-size: var(--t-s); }
.carte-quiz-accueil { grid-column: 1 / -1; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); grid-template-rows: none; }
.carte-quiz-accueil img { height: 100%; }
.carte-quiz-accueil .carte-texte { align-content: center; padding: 18px 22px; }
.carte-quiz-accueil h3 { font-size: var(--t-xl); }
.credits { font-size: var(--t-s); color: var(--encre-2); max-width: 80ch; display: grid; gap: 8px; border-top: 1px solid var(--ligne); padding-top: 20px; }
.credits p { margin: 0; }

/* puces de niveau */
.niveaux { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0; padding: 0; }
.niveaux li { font-family: var(--f-mono); font-size: 0.72rem; padding: 1px 8px; border-radius: 999px; }
.niveaux [data-niveau="college"] { background: var(--college-doux); color: var(--college); }
.niveaux [data-niveau="seconde"] { background: var(--seconde-doux); color: var(--seconde); }
.niveaux [data-niveau="premiere"] { background: var(--premiere-doux); color: var(--premiere); }

/* ---------- boutons et réglages ---------- */
.choix { display: flex; flex-wrap: wrap; gap: 6px; }
.choix button, .bouton, .bascule > button {
  border: 1px solid var(--ligne); background: var(--surface); color: var(--encre); border-radius: 999px;
  padding: 6px 12px; font-size: var(--t-s); line-height: 1.2; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.choix button:hover, .bouton:hover, .bascule > button:hover { border-color: var(--accent); }
.choix button[aria-pressed="true"], .bascule > button[aria-pressed="true"] { background: var(--accent); color: var(--accent-encre); border-color: var(--accent); }
.bouton.principal { background: var(--accent); color: var(--accent-encre); border-color: var(--accent); font-weight: 700; }
.bouton.principal:hover { filter: brightness(1.08); }
.bouton:disabled { opacity: 0.5; cursor: default; }
.bascule { display: inline-flex; flex-wrap: wrap; gap: 0; }
.bascule > button { border-radius: 0; margin-left: -1px; }
.bascule > button:first-child { border-radius: 999px 0 0 999px; margin-left: 0; }
.bascule > button:last-child { border-radius: 0 999px 999px 0; }
.bascule > button[aria-pressed="true"] { position: relative; }
.pastille { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--p, #888); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }
.boutons { display: flex; flex-wrap: wrap; gap: 6px; }

.reglage { display: grid; gap: 6px; }
.reglage label, .reglage .etiquette { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: var(--t-s); }
.reglage output { font-family: var(--f-mono); font-weight: 500; color: var(--encre-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.curseur {
  -webkit-appearance: none; appearance: none; width: 100%; height: 14px; margin: 4px 0; border-radius: 999px;
  background: var(--piste, var(--surface-2)); border: 1px solid var(--ligne); cursor: pointer;
}
.curseur::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--pouce, #ffffff); border: 3px solid #ffffff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.curseur::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--pouce, #ffffff); border: 3px solid #ffffff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 2px 6px rgba(0, 0, 0, 0.3);
}
.curseur:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.lectures { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px; margin: 0; }
.lecture { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: grid; gap: 1px; align-content: start; min-width: 0; }
.lecture dt { font-size: var(--t-xs); color: var(--encre-2); }
.lecture dd { margin: 0; font-family: var(--f-mono); font-size: 1rem; font-weight: 500; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.lecture dd small { font-size: var(--t-xs); color: var(--encre-2); }
.lecture[data-niveau]::after { font-family: var(--f-mono); font-size: 0.66rem; justify-self: start; padding: 0 6px; border-radius: 999px; margin-top: 3px; }
.lecture[data-niveau="premiere"]::after { content: "1re · Tle"; background: var(--premiere-doux); color: var(--premiere); }
.lecture[data-niveau="seconde"]::after { content: "seconde"; background: var(--seconde-doux); color: var(--seconde); }

.couleur-vue { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.couleur-vue strong { display: block; font-family: var(--f-titre); font-size: var(--t-l); line-height: 1.15; }
.couleur-vue span { font-size: var(--t-s); color: var(--encre-2); }
.couleur-vue code { font-family: var(--f-mono); font-size: var(--t-s); }
.echantillon {
  width: 52px; height: 52px; border-radius: 12px; flex: none; background: var(--c, #000);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 18px -4px var(--c, transparent); transition: background-color 0.25s;
}
.echantillon.petit { width: 26px; height: 26px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18); }

/* ---------- écran d'activité ---------- */
.activite { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr); grid-template-rows: minmax(0, 1fr); }
.scene { position: relative; min-height: 0; overflow: hidden; }
.activite[data-fond="nuit"] .scene { background: radial-gradient(120% 95% at 50% 35%, var(--nuit-1), var(--nuit-2)); color: var(--nuit-encre); }
.activite[data-fond="jour"] .scene { background: radial-gradient(120% 95% at 50% 35%, var(--jour-1), var(--jour-2)); color: #1c1a2c; }
.scene .toile { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.scene .toile.prenable { cursor: grab; }
.scene .toile.prenable:active { cursor: grabbing; }
.scene-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.aide-scene {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; z-index: 2;
  font-size: var(--t-xs); color: var(--nuit-encre-2); background: rgba(10, 9, 18, 0.6); padding: 4px 12px; border-radius: 999px;
  white-space: nowrap; pointer-events: none; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis;
}
.activite[data-fond="jour"] .aide-scene { color: #57546f; background: rgba(255, 255, 255, 0.75); }
.bulle {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; max-width: 280px;
  background: #f1f0fa; color: #14131f; padding: 6px 10px; border-radius: 8px; font-size: var(--t-s); line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); display: flex; align-items: center; gap: 8px;
}
.bulle .echantillon { width: 18px; height: 18px; border-radius: 5px; }

.panneau {
  overflow: auto; background: var(--surface); border-left: 1px solid var(--ligne);
  padding: 20px clamp(18px, 2.2vw, 30px) 32px; display: grid; gap: 16px; align-content: start; min-width: 0;
}
.retour { font-size: var(--t-s); text-decoration: none; font-weight: 700; justify-self: start; }
.retour:hover { text-decoration: underline; }
.panneau h1 { font-size: clamp(1.7rem, 2.6vw, 2.3rem); font-weight: 780; }
.corps { display: grid; gap: 16px; min-width: 0; }
.corps > p, .corps .texte p { margin: 0; }
.corps h2 { font-size: var(--t-l); font-weight: 720; }
.intro { color: var(--encre-2); }
.texte { display: grid; gap: 10px; max-width: 68ch; }
.points { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.points li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; }
.points li::before { content: ""; width: 9px; height: 9px; margin-top: 0.5em; border-radius: 50%; background: var(--spectre); }
.formule {
  font-family: var(--f-mono); font-weight: 500; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}
.formule-bloc { font-family: var(--f-mono); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; text-align: center; font-size: 1.05rem; }
.note { margin: 0; font-size: var(--t-xs); color: var(--encre-2); }
.plus-loin { border: 1px solid var(--ligne); border-radius: 12px; background: var(--surface); }
.plus-loin > summary {
  cursor: pointer; padding: 10px 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; list-style: none;
}
.plus-loin > summary::-webkit-details-marker { display: none; }
.plus-loin > summary::before { content: "+"; font-family: var(--f-mono); width: 20px; height: 20px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent-doux); color: var(--accent); }
.plus-loin[open] > summary::before { content: "−"; }
.plus-loin > summary .niveaux { margin-left: auto; }
.plus-loin > div { padding: 0 14px 14px; display: grid; gap: 10px; }
.plus-loin p { margin: 0; }
.savais-tu { background: var(--accent-doux); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.savais-tu h2, .savais-tu h3 { font-size: var(--t-m); color: var(--accent); }
.savais-tu p { margin: 0; font-size: var(--t-s); }
.activite-nav { border-top: 1px solid var(--ligne); padding-top: 14px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: var(--t-s); }
.activite-nav a { text-decoration: none; font-weight: 700; }
.activite-nav a:hover { text-decoration: underline; }
.activite-nav a span { display: block; font-weight: 400; color: var(--encre-2); font-size: var(--t-xs); }
.activite-nav .suivante { text-align: right; margin-left: auto; }

/* défis (petits jeux dans les activités) */
.defi { border: 2px solid var(--accent); border-radius: 14px; padding: 14px; display: grid; gap: 10px; background: var(--surface); }
.defi-entete { display: flex; justify-content: space-between; gap: 8px; font-family: var(--f-mono); font-size: var(--t-xs); color: var(--encre-2); font-variant-numeric: tabular-nums; }
.defi h2 { font-size: var(--t-l); }
.defi .question { margin: 0; font-size: var(--t-l); line-height: 1.35; }
.retour-defi { margin: 0; min-height: 1.5em; font-size: var(--t-s); }
.retour-defi[data-ton="bon"] { color: var(--bon); font-weight: 700; }
.retour-defi[data-ton="faux"] { color: var(--faux); }
.etoiles { font-size: 1.6rem; letter-spacing: 0.1em; color: #e8a500; line-height: 1; }
.comparaison { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.comparaison figure { margin: 0; display: grid; gap: 4px; justify-items: center; font-size: var(--t-xs); color: var(--encre-2); }
.comparaison .echantillon { width: 100%; height: 70px; }
.choix-couleurs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.choix-couleurs button {
  display: grid; gap: 4px; justify-items: center; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--ligne);
  background: var(--surface); font-size: var(--t-xs);
}
.choix-couleurs button:hover:not(:disabled) { border-color: var(--accent); }
.choix-couleurs button .echantillon { width: 34px; height: 34px; border-radius: 50%; }
.choix-couleurs button[data-ton="bon"] { border-color: var(--bon); background: var(--bon-doux); color: var(--bon); font-weight: 700; }
.choix-couleurs button[data-ton="faux"] { border-color: var(--faux); background: var(--faux-doux); color: var(--faux); }

/* étiquettes posées sur une scène */
.puce-raie { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 5px; border-radius: 999px; background: var(--surface-2); font-family: var(--f-mono); font-size: var(--t-xs); }
.liste-puces { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }

/* bandes du spectre (activité « spectre ») */
.spectre-mise { position: absolute; inset: 0; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); padding: 18px 22px 40px; gap: 6px; }
.em-titre { margin: 0; font-family: var(--f-mono); font-size: var(--t-xs); letter-spacing: 0.08em; text-transform: uppercase; color: var(--nuit-encre-2); }
.em-bande { display: flex; height: 46px; border-radius: 10px; overflow: hidden; border: 1px solid var(--nuit-ligne); }
.em-bande button {
  border: 0; border-right: 1px solid rgba(0, 0, 0, 0.35); padding: 0 4px; min-width: 0; color: #ffffff; font-size: var(--t-xs); font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); overflow: hidden; white-space: nowrap; text-overflow: clip; position: relative;
}
.em-bande button:last-child { border-right: 0; }
.em-bande button:hover, .em-bande button[aria-pressed="true"] { filter: brightness(1.25); box-shadow: inset 0 0 0 2px #ffffff; }
.em-echelle { position: relative; height: 18px; font-family: var(--f-mono); font-size: 0.7rem; color: var(--nuit-encre-2); }
.em-echelle span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.em-echelle span::before { content: ""; position: absolute; left: 50%; top: -4px; width: 1px; height: 4px; background: var(--nuit-encre-2); }
.em-sens { display: flex; justify-content: space-between; font-size: var(--t-xs); color: var(--nuit-encre-2); }
.zoom-visible { width: 100%; height: 34px; display: block; }
.bande-visible { position: relative; height: 54px; border-radius: 10px; background: var(--spectre); box-shadow: 0 0 40px -10px rgba(255, 255, 255, 0.35); cursor: pointer; touch-action: none; }
.bande-visible .repere {
  position: absolute; top: -8px; bottom: -8px; width: 4px; margin-left: -2px; border-radius: 2px; background: #ffffff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.55), 0 0 14px #ffffff; pointer-events: none;
}
.echelle-visible { position: relative; height: 20px; font-family: var(--f-mono); font-size: 0.72rem; color: var(--nuit-encre-2); }
.echelle-visible span { position: absolute; top: 4px; transform: translateX(-50%); }
.echelle-visible span::before { content: ""; position: absolute; left: 50%; top: -6px; width: 1px; height: 5px; background: var(--nuit-encre-2); }
.cadre-onde { position: relative; min-height: 120px; }

.graphe { position: relative; height: 180px; max-width: 420px; }
.graphe .toile { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* cercle chromatique et vision */
.roue { transform-origin: 320px 300px; transform-box: view-box; animation: roue-entree 0.8s cubic-bezier(.2, .9, .3, 1.1); }
@keyframes roue-entree { from { transform: rotate(-120deg) scale(0.7); opacity: 0; } }
.secteur { cursor: pointer; transition: transform 0.35s cubic-bezier(.3, 1.4, .5, 1), opacity 0.3s; transform-box: view-box; }
.secteur:focus-visible { outline: none; }
.secteur:focus-visible path { stroke: #ffffff; stroke-width: 4; }
.secteur.pale { opacity: 0.22; }
.secteur text { pointer-events: none; font-family: var(--f-texte); font-weight: 700; }
.chevreul { display: grid; grid-template-columns: 1fr 1fr; border-radius: 12px; overflow: hidden; height: 110px; position: relative; }
.chevreul > div { display: grid; place-items: center; transition: background-color 0.6s; }
.chevreul > div span { width: 46px; height: 46px; background: #8a8a8a; display: block; }
.retine { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }

/* illusion (image rémanente) */
.illusion { position: absolute; inset: 0; display: grid; place-items: center; transition: background-color 0.2s; }
.drapeau { display: grid; grid-template-columns: repeat(3, 1fr); width: min(78%, 480px); aspect-ratio: 3 / 2; position: relative; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45); }
.drapeau > span { display: block; }
.croix { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); }
.croix::before, .croix::after { content: ""; position: absolute; background: var(--croix, #ffffff); }
.croix::before { left: 10px; top: 0; width: 2px; height: 22px; }
.croix::after { top: 10px; left: 0; height: 2px; width: 22px; }
.compte { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); font-family: var(--f-mono); font-size: var(--t-l); color: var(--nuit-encre); background: rgba(0, 0, 0, 0.5); padding: 4px 14px; border-radius: 999px; }

/* ---------- quiz ---------- */
.quiz { overflow: auto; }
.quiz-mise { max-width: 760px; margin: 0 auto; padding: 28px var(--gouttiere) 48px; display: grid; gap: 18px; }
.carte-quiz { background: var(--surface); border: 1px solid var(--ligne); border-radius: 18px; padding: clamp(16px, 3vw, 28px); box-shadow: var(--ombre); display: grid; gap: 14px; position: relative; overflow: hidden; }
.carte-quiz h1 { font-size: var(--t-xxl); font-weight: 780; }
.carte-quiz h2 { font-size: var(--t-xl); }
.choix-quiz { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.choix-quiz button {
  display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--ligne);
  background: var(--surface); color: var(--encre);
}
.choix-quiz button:hover { border-color: var(--accent); }
.choix-quiz strong { font-size: var(--t-m); font-family: var(--f-titre); }
.choix-quiz span { font-size: var(--t-s); color: var(--encre-2); }
.choix-quiz em { font-style: normal; font-size: var(--t-xs); color: var(--accent); font-family: var(--f-mono); }
.quiz-entete { display: flex; justify-content: space-between; gap: 8px; font-size: var(--t-xs); color: var(--encre-2); font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.quiz-progression { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.quiz-progression span { display: block; height: 100%; background: var(--spectre); background-size: 760px 100%; transition: width 0.3s; }
.quiz-question { margin: 0; font-size: var(--t-l); line-height: 1.4; font-weight: 700; }
.quiz-visuel { display: grid; justify-items: center; }
.quiz-visuel canvas { width: 100%; max-width: 560px; height: auto; border-radius: 10px; }
.quiz-visuel .echantillon { width: 120px; height: 70px; }
.quiz-choix { display: grid; gap: 8px; }
.quiz-choix.couleurs { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.quiz-choix button { text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--ligne); background: var(--surface); color: var(--encre); display: flex; align-items: center; gap: 10px; }
.quiz-choix button:hover:not(:disabled) { border-color: var(--accent); }
.quiz-choix button[data-ton="bon"] { background: var(--bon-doux); border-color: var(--bon); color: var(--bon); font-weight: 700; }
.quiz-choix button[data-ton="faux"] { background: var(--faux-doux); border-color: var(--faux); color: var(--faux); }
.quiz-choix .echantillon { width: 30px; height: 30px; border-radius: 8px; }
.quiz-retour { margin: 0; font-size: var(--t-s); color: var(--encre-2); min-height: 1.5em; }
.quiz-retour strong { display: block; font-size: var(--t-m); }
.quiz-retour[data-ton="bon"] strong { color: var(--bon); }
.quiz-retour[data-ton="faux"] strong { color: var(--faux); }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz-score { margin: 0; font-family: var(--f-titre); font-size: 3.2rem; line-height: 1; color: var(--accent); }
.quiz-score strong { font-weight: 800; }
.quiz-erreurs { margin: 0; padding-left: 1.2em; font-size: var(--t-s); display: grid; gap: 4px; }
.confettis { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }

/* ---------- petits écrans ---------- */
@media (max-width: 860px) {
  .barre nav { order: 3; width: 100%; }
  .activite { position: absolute; inset: 0; overflow: auto; display: block; }
  .activite .scene { height: min(60vh, 500px); min-height: 320px; }
  .panneau { border-left: 0; border-top: 1px solid var(--ligne); overflow: visible; padding-inline: var(--gouttiere); }
  .spectre-mise { padding: 12px 12px 34px; }
  .carte-quiz-accueil { grid-template-columns: minmax(0, 1fr); }
  .carte-quiz-accueil img { height: auto; }
}
@media (max-width: 520px) {
  .choix-couleurs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .em-bande button { font-size: 0.62rem; }
}
@media (prefers-reduced-motion: reduce) {
  .carte, .secteur, .quiz-progression span, .echantillon, .chevreul > div { transition: none; }
  .roue { animation: none; }
  .carte:hover { transform: none; }
}
