/* Étude Facile — « magazine néo-brutaliste » : papier crème, encre bleutée, cobalt assumé,
   contours francs et ombres décalées. Titres : Bricolage Grotesque. Texte : Hanken Grotesk. */
/* Polices hébergées sur le site (pas d'appel à Google Fonts : aucune adresse IP transmise à un tiers). Licence SIL OFL. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("fonts/bricolage-grotesque-latin-ext-opsz-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,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: "Bricolage Grotesque"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("fonts/bricolage-grotesque-latin-opsz-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("fonts/hanken-grotesk-latin-ext-wght-normal.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,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: "Hanken Grotesk"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Hanken Grotesk"; font-style: italic; font-display: swap; font-weight: 100 900; src: url("fonts/hanken-grotesk-latin-ext-wght-italic.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,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: "Hanken Grotesk"; font-style: italic; font-display: swap; font-weight: 100 900; src: url("fonts/hanken-grotesk-latin-wght-italic.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  /* Neutres teintés */
  --papier: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #ebe4d4;
  --encre: #16182b;
  --discret: #555a70;
  --filet: #d6cdb8;
  /* Interface : dominante cobalt + accent safran */
  --cobalt: #2b3fe0;
  --cobalt-fonce: #1f2fb0;
  --safran: #ffd23f;
  --safran-clair: #fff0b8;
  --sur-cobalt: #ffffff;
  /* États */
  --ok: #1b6b4a;  --ok-clair: #d6efe1;
  --ko: #a3202a;  --ko-clair: #fbdad6;

  /* Matières : principale / fond léger / texte sur fond clair / texte posé sur la principale */
  --matiere-algo: #2fb381;     --matiere-algo-clair: #d5f0e6;     --matiere-algo-fonce: #1f534c;     --matiere-algo-sur: #16182b;
  --matiere-slam: #3b9ff0;     --matiere-slam-clair: #d8ecfc;     --matiere-slam-fonce: #254e7a;     --matiere-slam-sur: #16182b;
  --matiere-sisr: #1e6b55;     --matiere-sisr-clair: #d2e1dd;     --matiere-sisr-fonce: #1b4d46;     --matiere-sisr-sur: #ffffff;
  --matiere-bloc1: #8c3fa8;    --matiere-bloc1-clair: #e8d9ee;    --matiere-bloc1-fonce: #5f3078;    --matiere-bloc1-sur: #ffffff;
  --matiere-bloc3: #c4262e;    --matiere-bloc3-clair: #f3d4d5;    --matiere-bloc3-fonce: #7e202d;    --matiere-bloc3-sur: #ffffff;
  --matiere-maths: #f0643c;    --matiere-maths-clair: #fce0d8;    --matiere-maths-fonce: #723832;    --matiere-maths-sur: #16182b;
  --matiere-culture: #e0a11a;  --matiere-culture-clair: #f9ecd1;  --matiere-culture-fonce: #5f4925;  --matiere-culture-sur: #16182b;
  --matiere-cejm: #0f7c86;     --matiere-cejm-clair: #cfe5e7;     --matiere-cejm-fonce: #124e5c;     --matiere-cejm-sur: #ffffff;
  --matiere-anglais: #e65fa6;  --matiere-anglais-clair: #fadfed;  --matiere-anglais-fonce: #6d365f;  --matiere-anglais-sur: #16182b;

  /* Alias utilisés par le JS en ligne */
  --text: var(--encre);
  --emerald: var(--ok);

  /* Grille de 8 */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
  /* Contours, rayons, ombres : 2 niveaux */
  --trait: 2px solid var(--encre);
  --r1: 6px; --r2: 14px;
  --ombre-1: 3px 3px 0 var(--encre);
  --ombre-2: 6px 6px 0 var(--encre);
  /* Typo */
  --titre: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --corps: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --t-1: .8125rem; --t0: 1rem; --t1: 1.25rem; --t2: 1.5625rem; --t3: 1.953rem; --t4: 2.441rem; --t5: 3.052rem; --t6: 3.815rem;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --vite: 150ms; --normal: 260ms; --lent: 420ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--corps); font-size: var(--t0); background: var(--papier); color: var(--encre); line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--titre); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; font-variation-settings: "opsz" 48; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }

/* Couleurs de matière : les classes c-* viennent des données */
.c-lime    { --m: var(--matiere-algo);    --m-clair: var(--matiere-algo-clair);    --m-fonce: var(--matiere-algo-fonce);    --m-sur: var(--matiere-algo-sur); }
.c-indigo  { --m: var(--matiere-slam);    --m-clair: var(--matiere-slam-clair);    --m-fonce: var(--matiere-slam-fonce);    --m-sur: var(--matiere-slam-sur); }
.c-emerald { --m: var(--matiere-sisr);    --m-clair: var(--matiere-sisr-clair);    --m-fonce: var(--matiere-sisr-fonce);    --m-sur: var(--matiere-sisr-sur); }
.c-violet  { --m: var(--matiere-bloc1);   --m-clair: var(--matiere-bloc1-clair);   --m-fonce: var(--matiere-bloc1-fonce);   --m-sur: var(--matiere-bloc1-sur); }
.c-rose    { --m: var(--matiere-bloc3);   --m-clair: var(--matiere-bloc3-clair);   --m-fonce: var(--matiere-bloc3-fonce);   --m-sur: var(--matiere-bloc3-sur); }
.c-pink    { --m: var(--matiere-maths);   --m-clair: var(--matiere-maths-clair);   --m-fonce: var(--matiere-maths-fonce);   --m-sur: var(--matiere-maths-sur); }
.c-amber   { --m: var(--matiere-culture); --m-clair: var(--matiere-culture-clair); --m-fonce: var(--matiere-culture-fonce); --m-sur: var(--matiere-culture-sur); }
.c-cyan    { --m: var(--matiere-cejm);    --m-clair: var(--matiere-cejm-clair);    --m-fonce: var(--matiere-cejm-fonce);    --m-sur: var(--matiere-cejm-sur); }
.c-sky     { --m: var(--matiere-anglais); --m-clair: var(--matiere-anglais-clair); --m-fonce: var(--matiere-anglais-fonce); --m-sur: var(--matiere-anglais-sur); }

/* ---------- En-tête : barre cobalt ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--cobalt); color: var(--sur-cobalt); border-bottom: var(--trait); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: 12px; font-family: var(--titre); font-weight: 800; font-size: 1.2rem; letter-spacing: -.03em; }
.logo-mark { display: inline-grid; place-items: center; height: 28px; padding: 0 10px; background: var(--safran); color: var(--encre); border: var(--trait); border-radius: var(--r1); box-shadow: 2px 2px 0 var(--encre); font-family: var(--mono); font-size: .75rem; font-weight: 700; transition: transform var(--normal) var(--ease); }
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.06); }
.top-stat { font-size: var(--t-1); font-weight: 500; }
.top-stat b { font-family: var(--titre); font-size: 1.1rem; margin-right: 4px; background: var(--safran); color: var(--encre); padding: 0 8px; border-radius: 99px; }

/* ---------- Accueil : hero XXL asymétrique ---------- */
.hero { position: relative; padding: var(--s5) 0 var(--s4); display: grid; gap: var(--s3); }
.hero::before { content: ""; position: absolute; right: 0; top: var(--s2); width: clamp(64px, 20vw, 240px); aspect-ratio: 1; border-radius: 50%; background: var(--safran); border: var(--trait); box-shadow: var(--ombre-2); z-index: 0; animation: tourne 1.2s var(--ease) both; }
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: clamp(3.052rem, 12.5vw, 8.5rem); line-height: .92; letter-spacing: -.055em; max-width: 9ch; animation: monte var(--lent) var(--ease) both; }
.hero h1 span { display: inline-block; background: var(--cobalt); color: var(--sur-cobalt); padding: 0 .1em .04em; border: var(--trait); box-shadow: var(--ombre-2); transform: rotate(-2deg); margin: .05em .04em; }
.hero > p { max-width: 38ch; font-size: var(--t1); line-height: 1.45; font-weight: 500; animation: monte var(--lent) var(--ease) 120ms both; }

.modes { display: grid; gap: var(--s3); margin-top: var(--s2); }
.mode { padding: var(--s3); border: var(--trait); border-radius: var(--r2); box-shadow: var(--ombre-2); background: var(--surface); transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease); animation: monte var(--lent) var(--ease) 240ms both; }
.mode:nth-child(1) { background: var(--cobalt); color: var(--sur-cobalt); }
.mode:nth-child(2) { background: var(--safran); }
.mode:hover { transform: translate(-3px, -3px); box-shadow: 9px 9px 0 var(--encre); }
.mode b { display: block; font-family: var(--titre); font-weight: 800; font-size: var(--t2); letter-spacing: -.03em; margin-bottom: 4px; }
.mode span { font-size: 1rem; }

/* Bilan */
.global { margin-top: var(--s5); display: grid; gap: var(--s3); grid-template-columns: 1fr; }
.panel { padding: var(--s3); border: var(--trait); border-radius: var(--r2); background: var(--surface); }
.panel:first-child { background: var(--encre); color: var(--papier); box-shadow: 6px 6px 0 var(--cobalt); }
.panel h2 { font-family: var(--corps); font-size: var(--t-1); text-transform: uppercase; letter-spacing: .12em; color: var(--discret); font-weight: 700; line-height: 1.3; }
.panel:first-child h2, .panel:first-child .sub { color: #c9c5b8; }
.big { font-family: var(--titre); font-weight: 800; font-size: var(--t5); letter-spacing: -.05em; line-height: 1; margin-top: var(--s1); font-variant-numeric: lining-nums; }
.panel:first-child .big { font-size: clamp(3.815rem, 12vw, 6.5rem); color: var(--safran); }
.sub { font-size: var(--t-1); color: var(--discret); }
.bar { height: 14px; background: var(--surface); border: var(--trait); border-radius: 99px; overflow: hidden; margin-top: var(--s2); }
.bar > i { display: block; height: 100%; width: 0; background: var(--m, var(--cobalt)); border-right: var(--trait); transition: width var(--lent) var(--ease); }
.bar > i[style*="width:0%"], .bar > i[style*="width: 0%"] { border-right: 0; }
.panel:first-child .bar { background: transparent; border-color: var(--papier); }
.panel:first-child .bar > i { background: var(--safran); border-color: var(--papier); }
.badges { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s1); min-height: 32px; }
.badge { font-size: var(--t-1); font-weight: 600; padding: 3px 12px; border-radius: 99px; border: 1.5px solid var(--encre); background: var(--safran); }
.badge.off { background: transparent; color: var(--discret); border: 1.5px dashed var(--filet); }
.empty-note { color: var(--discret); font-size: .9rem; }

/* ---------- Filtres ---------- */
.tools { margin: var(--s6) 0 var(--s3); display: grid; gap: var(--s2); }
.search { width: 100%; padding: 12px var(--s3); border-radius: 99px; border: var(--trait); background: var(--surface); color: var(--encre); font: inherit; font-weight: 500; outline: none; transition: box-shadow var(--vite); }
.search::placeholder { color: var(--discret); }
.search:focus { box-shadow: var(--ombre-1); }
.chips { display: flex; gap: var(--s1); flex-wrap: wrap; }
.chip { padding: 6px var(--s2); border-radius: 99px; border: var(--trait); background: var(--surface); font-size: .9rem; font-weight: 700; transition: transform var(--vite), box-shadow var(--vite), background var(--vite); }
.chip:hover { transform: translate(-1px, -1px); box-shadow: 2px 2px 0 var(--encre); }
.chip[aria-pressed="true"] { background: var(--cobalt); color: var(--sur-cobalt); box-shadow: 2px 2px 0 var(--encre); }

/* ---------- Matières : tuiles de tailles variées, numérotées ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: var(--s4); padding: var(--s2) 0 var(--s7); counter-reset: mat; }
.card { position: relative; display: grid; grid-template-columns: 56px 1fr; column-gap: var(--s2); row-gap: 4px; align-content: start; padding: var(--s3); background: var(--m-clair, var(--surface)); border: var(--trait); border-radius: var(--r2); box-shadow: var(--ombre-2); overflow: hidden; counter-increment: mat; transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease); animation: monte var(--lent) var(--ease) both; }
.card:nth-child(1) { animation-delay: 60ms; } .card:nth-child(2) { animation-delay: 120ms; } .card:nth-child(3) { animation-delay: 180ms; }
.card:nth-child(4) { animation-delay: 240ms; } .card:nth-child(5) { animation-delay: 300ms; } .card:nth-child(n+6) { animation-delay: 360ms; }
.card::after { content: counter(mat, decimal-leading-zero); position: absolute; right: var(--s2); bottom: -20px; font-family: var(--titre); font-weight: 800; font-size: clamp(4rem, 14vw, 7rem); line-height: 1; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 2px var(--m, var(--encre)); opacity: .55; pointer-events: none; }
.card-head { display: contents; }
.card .ico { grid-row: 1 / span 2; align-self: start; }
a.card:hover { transform: translate(-4px, -4px); box-shadow: 10px 10px 0 var(--m, var(--encre)), 10px 10px 0 2px var(--encre); }
.card.soon { background: var(--surface-2); box-shadow: 4px 4px 0 var(--filet); border-style: dashed; }
.card.soon h3, .card.soon .desc { opacity: .65; }
.ico { width: 56px; height: 56px; display: grid; place-items: center; font-family: var(--mono); font-weight: 700; font-size: 1.25rem; background: var(--m, var(--cobalt)); border: var(--trait); border-radius: var(--r1); flex: none; color: var(--m-sur, #fff); transition: transform var(--normal) var(--ease); }
a.card:hover .ico { transform: rotate(-8deg) scale(1.08); }
.card h3 { font-size: var(--t4); line-height: .98; position: relative; z-index: 1; }
.card .sub, .page-head .sub { color: var(--m-fonce, var(--discret)); font-weight: 600; font-size: .875rem; position: relative; z-index: 1; }
.desc { grid-column: 1 / -1; color: var(--encre); font-size: 1rem; max-width: 52ch; margin-top: var(--s2); position: relative; z-index: 1; }
.card .bar { position: relative; z-index: 1; grid-column: 1 / -1; margin-top: var(--s2); background: var(--surface); }
.meta { position: relative; z-index: 1; grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: var(--s2); font-size: var(--t-1); font-weight: 600; margin-top: var(--s1); }
.tag { padding: 2px 10px; border: 1.5px solid var(--encre); border-radius: 99px; background: var(--surface); font-size: .6875rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--m-fonce, var(--encre)); }
.none { grid-column: 1 / -1; color: var(--discret); padding: var(--s4) 0; }

footer { border-top: var(--trait); background: var(--encre); color: var(--papier); padding: var(--s3) 0 var(--s4); font-size: .85rem; }
footer .wrap { display: flex; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.link-btn { background: none; border: none; color: var(--papier); font-size: .85rem; background-image: linear-gradient(var(--safran), var(--safran)); background-size: 100% 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size var(--normal) var(--ease), color var(--vite); padding-bottom: 2px; }
.link-btn:hover { background-size: 100% 100%; color: var(--encre); }

/* ---------- Pages module / chapitre ---------- */
.page { padding: var(--s3) 0 var(--s7); }
.crumbs { font-size: var(--t-1); font-weight: 600; margin-bottom: var(--s3); display: flex; gap: var(--s1); flex-wrap: wrap; color: var(--discret); }
.crumbs a { color: var(--encre); background-image: linear-gradient(var(--safran), var(--safran)); background-size: 100% 2px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size var(--normal) var(--ease); }
.crumbs a:hover { background-size: 100% 100%; }
.page h1 { font-size: clamp(3.052rem, 10vw, 6rem); line-height: .95; letter-spacing: -.05em; max-width: 14ch; animation: monte var(--lent) var(--ease) both; }
.lead { margin-top: var(--s3); max-width: 56ch; font-size: var(--t1); line-height: 1.45; font-weight: 500; }
.page-head { display: flex; gap: var(--s2); align-items: center; margin: 0 calc(var(--s2) * -1) var(--s2); padding: var(--s3) var(--s2); background: var(--m-clair, var(--surface)); border: var(--trait); border-radius: var(--r2); box-shadow: var(--ombre-2); }
.page-head .ico { width: 72px; height: 72px; font-size: 1.6rem; }
.page-head h1 { font-size: clamp(2.441rem, 9vw, 5rem); }

/* Niveaux : repérables sans la couleur (●○○ / ●●○ / ●●●) */
.lvl { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; }
.lvl::before { font-size: .6rem; letter-spacing: 2px; }
.lvl.facile::before { content: "●○○" / ""; }
.lvl.moyen::before { content: "●●○" / ""; }
.lvl.difficile::before { content: "●●●" / ""; }

.chap-list { display: grid; gap: var(--s3); margin-top: var(--s4); counter-reset: chap; }
.chap { position: relative; display: grid; gap: var(--s2); padding: var(--s3); background: var(--surface); border: var(--trait); border-radius: var(--r2); box-shadow: var(--ombre-1); overflow: hidden; transition: transform var(--normal) var(--ease), box-shadow var(--normal) var(--ease); animation: monte var(--lent) var(--ease) both; }
.chap:nth-child(1) { animation-delay: 60ms; } .chap:nth-child(2) { animation-delay: 110ms; } .chap:nth-child(3) { animation-delay: 160ms; } .chap:nth-child(n+4) { animation-delay: 210ms; }
.chap::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 10px; background: var(--m, var(--cobalt)); border-right: var(--trait); }
.chap:hover { transform: translate(-3px, -3px); box-shadow: 7px 7px 0 var(--m, var(--encre)), 7px 7px 0 2px var(--encre); }
.chap-top { display: flex; gap: var(--s2); align-items: flex-start; padding-left: var(--s1); }
.chap-num { min-width: 56px; font-family: var(--titre); font-weight: 800; font-size: var(--t6); line-height: .85; letter-spacing: -.06em; color: transparent; -webkit-text-stroke: 2px var(--m-fonce, var(--encre)); font-variant-numeric: lining-nums; }
.chap.done .chap-num { color: var(--m, var(--encre)); -webkit-text-stroke: 2px var(--encre); }
.chap h3 { font-size: var(--t2); line-height: 1.05; }
.chap-meta { display: flex; gap: var(--s1); align-items: center; flex-wrap: wrap; font-size: var(--t-1); font-weight: 600; color: var(--discret); margin-top: var(--s1); }
.chap-meta .lvl { color: var(--encre); background: var(--m-clair, var(--surface-2)); padding: 1px 10px; border: 1.5px solid var(--encre); border-radius: 99px; }
.btns { display: flex; gap: var(--s2); flex-wrap: wrap; padding-left: var(--s1); }

/* Boutons : plats, franchs, ils se pressent au clic */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 6px; padding: 10px var(--s3); border: var(--trait); border-radius: var(--r1); background: var(--surface); color: var(--encre); font-weight: 700; font-size: .95rem; box-shadow: var(--ombre-1); transition: transform var(--vite) var(--ease), box-shadow var(--vite) var(--ease), background var(--vite); text-align: center; min-height: 44px; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--encre); background: var(--safran-clair); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--encre); }
.btn.primary, .btn.green { background: var(--cobalt); color: var(--sur-cobalt); }
.btn.primary:hover, .btn.green:hover { background: var(--cobalt-fonce); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }

/* Onglets */
.tabs { display: flex; gap: var(--s1); margin: var(--s4) 0; position: sticky; top: 56px; z-index: 5; padding: var(--s1) 0; background: var(--papier); }
.tab { flex: 1; max-width: 240px; padding: 10px var(--s2); border: var(--trait); border-radius: var(--r1); background: var(--surface); font-weight: 700; box-shadow: var(--ombre-1); transition: transform var(--vite) var(--ease), box-shadow var(--vite) var(--ease), background var(--vite); }
.tab:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--encre); }
.tab[aria-selected="true"] { background: var(--cobalt); color: var(--sur-cobalt); transform: translate(3px, 3px); box-shadow: 0 0 0 var(--encre); }

/* ---------- Cours ---------- */
#cours { max-width: 68ch; }
#cours h2 { font-size: var(--t4); margin: var(--s6) 0 var(--s2); line-height: 1; display: inline; background: linear-gradient(transparent 62%, var(--safran) 62%); padding: 0 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
#cours h2 { display: block; background: none; padding: 0; border-left: 10px solid var(--safran); padding-left: var(--s2); }
#cours > h2:first-child, #cours > :first-child { margin-top: 0; }
#cours h3 { font-size: var(--t2); margin: var(--s4) 0 var(--s1); color: var(--cobalt); }
#cours p { margin: var(--s2) 0; font-size: 1.0625rem; }
#cours ul, #cours ol { margin: var(--s2) 0 var(--s2) var(--s3); font-size: 1.0625rem; }
#cours li { margin: 8px 0; padding-left: 4px; }
#cours li::marker { color: var(--cobalt); font-weight: 800; }
#cours code { font-family: var(--mono); font-size: .88em; background: var(--safran-clair); border: 1px solid var(--encre); border-radius: 4px; padding: 0 5px; }
#cours table { width: 100%; border-collapse: separate; border-spacing: 0; margin: var(--s3) 0; font-size: .95rem; display: table; border: var(--trait); border-radius: var(--r1); background: var(--surface); }
#cours th, #cours td { text-align: left; padding: 10px var(--s2); border-bottom: 1px solid var(--filet); }
#cours td { white-space: normal; min-width: 8ch; }
#cours tr:last-child td { border-bottom: 0; }
#cours th { background: var(--encre); color: var(--papier); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; border-bottom: 0; }
.box { margin: var(--s3) 0; padding: var(--s2) var(--s3); border: var(--trait); border-radius: var(--r1); background: var(--surface); box-shadow: var(--ombre-1); }
.box.retenir { background: var(--ok-clair); }
.box.attention { background: var(--safran-clair); }
.box > b:first-child { display: block; margin-bottom: 4px; font-family: var(--titre); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.box p, .box ul { margin: 4px 0; }
#cours details { margin: var(--s2) 0; border: var(--trait); border-radius: var(--r1); background: var(--surface); }
#cours summary { padding: var(--s2); cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: var(--s2); }
#cours summary::-webkit-details-marker { display: none; }
#cours summary::after { content: "+"; font-family: var(--titre); font-weight: 800; font-size: 1.5rem; line-height: 1; color: var(--cobalt); }
#cours details[open] summary { background: var(--safran-clair); border-bottom: var(--trait); }
#cours details[open] summary::after { content: "–"; }
#cours details > :not(summary) { margin-left: var(--s2); margin-right: var(--s2); }
#cours details > :last-child { margin-bottom: var(--s2); }

/* Code : bloc sombre, contraste fort */
.codebox { position: relative; margin: var(--s3) 0; }
.codebox pre, #cours pre { background: var(--encre); color: #e8e4d8; border: var(--trait); border-radius: var(--r1); padding: var(--s2); overflow-x: auto; font-family: var(--mono); font-size: .86rem; line-height: 1.65; }
.codebox .copy { position: absolute; top: var(--s1); right: var(--s1); padding: 2px 10px; font-size: .75rem; font-weight: 700; border-radius: var(--r1); border: 1.5px solid var(--encre); background: var(--safran); color: var(--encre); transition: transform var(--vite); }
.codebox .copy:hover { transform: translate(-1px, -1px); }
.codebox .pr { color: var(--safran); font-weight: 700; }
.codebox .out { color: #8fe0b9; }
pre .cm { color: #9aa0b8; font-style: italic; }

.tip { background-image: linear-gradient(var(--safran), var(--safran)); background-size: 100% 3px; background-position: 0 100%; background-repeat: no-repeat; cursor: help; position: relative; font-weight: 600; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + var(--s1)); width: max-content; max-width: min(260px, 70vw); white-space: normal; background: var(--encre); color: var(--papier); padding: var(--s1) 12px; border-radius: var(--r1); font-size: .8rem; z-index: 20; box-shadow: 3px 3px 0 var(--safran); line-height: 1.45; font-weight: 500; }

/* ---------- Entraînement ---------- */
.game { max-width: 700px; }
.game-card { background: var(--surface); border: var(--trait); border-radius: var(--r2); padding: var(--s3); box-shadow: 8px 8px 0 var(--cobalt), 8px 8px 0 2px var(--encre); }
.game h2 { font-size: var(--t4); }
.muted { color: var(--discret); font-size: .95rem; }
.hud { display: flex; justify-content: space-between; align-items: center; gap: var(--s1); margin-bottom: var(--s1); font-size: .88rem; font-weight: 600; }
.hud b { font-family: var(--titre); font-size: 1.15rem; }
.xp { background: var(--safran); border: 1.5px solid var(--encre); border-radius: 99px; padding: 1px 10px; font-weight: 800; }
.streak { font-weight: 800; color: var(--matiere-maths-fonce); }
.qnum { margin: var(--s3) 0 var(--s1); display: flex; gap: var(--s1); align-items: center; }
.qtext { font-family: var(--titre); font-size: var(--t3); font-weight: 700; line-height: 1.12; letter-spacing: -.03em; margin-bottom: var(--s3); font-variation-settings: "opsz" 36; }
.qtext code, .opt code, .fb code { font-family: var(--mono); background: var(--safran-clair); border: 1px solid var(--encre); border-radius: 4px; padding: 0 5px; font-size: .82em; font-weight: 500; }
.qcode { margin: 0 0 var(--s3); background: var(--encre); color: #e8e4d8; border-radius: var(--r1); padding: var(--s2); font-family: var(--mono); font-size: .88rem; line-height: 1.6; overflow-x: auto; white-space: pre; }
.opts { display: grid; gap: 12px; }
.opt { text-align: left; padding: 12px var(--s2); border: var(--trait); border-radius: var(--r1); background: var(--surface); font-size: 1rem; font-weight: 500; box-shadow: var(--ombre-1); transition: transform var(--vite) var(--ease), box-shadow var(--vite) var(--ease), background var(--vite); display: flex; gap: var(--s2); align-items: center; min-height: 52px; }
.opt:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--encre); background: var(--safran-clair); }
.opt:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }
.opt:disabled { cursor: default; box-shadow: none; }
.opt.ok { background: var(--ok-clair); color: var(--ok); font-weight: 700; box-shadow: 3px 3px 0 var(--ok); }
.opt.ko { background: var(--ko-clair); color: var(--ko); box-shadow: 3px 3px 0 var(--ko); }
.opt.ok::after { content: "✓"; margin-left: auto; font-weight: 800; font-size: 1.2rem; }
.opt.ko::after { content: "✗"; margin-left: auto; font-weight: 800; font-size: 1.2rem; }
.opt .k { width: 28px; height: 28px; border-radius: 4px; display: grid; place-items: center; background: var(--encre); color: var(--papier); font-size: .8rem; font-weight: 800; flex: none; }
.vf { grid-template-columns: 1fr 1fr; }
.vf .opt { justify-content: center; font-weight: 800; font-size: 1.1rem; }
.answer-row { display: flex; gap: var(--s1); }
.answer-row input, .pair select { flex: 1; min-width: 0; padding: 12px var(--s2); border-radius: var(--r1); border: var(--trait); background: var(--surface); color: var(--encre); font-family: var(--mono); font-size: 1rem; outline: none; transition: box-shadow var(--vite); }
.answer-row input:focus, .pair select:focus { box-shadow: var(--ombre-1); }
.answer-row input.ok, .pair select.ok { background: var(--ok-clair); border-color: var(--ok); }
.answer-row input.ko, .pair select.ko { background: var(--ko-clair); border-color: var(--ko); }
.pairs { display: grid; gap: var(--s1); margin-bottom: var(--s2); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); align-items: center; }
.pair .l { font-family: var(--mono); font-size: .95rem; word-break: break-word; font-weight: 600; }
.fb { margin-top: var(--s3); padding: var(--s2); border: var(--trait); border-radius: var(--r1); background: var(--surface); font-size: .95rem; animation: monte var(--normal) var(--ease); }
.fb.good { background: var(--ok-clair); }
.fb.bad { background: var(--ko-clair); }
.fb b { display: block; margin-bottom: 4px; font-family: var(--titre); font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.fb.good b { color: var(--ok); } .fb.bad b { color: var(--ko); }
.next-row { margin-top: var(--s2); display: flex; justify-content: flex-end; }

.lvl-pick { display: flex; gap: var(--s1); flex-wrap: wrap; margin: var(--s2) 0 var(--s3); }
.result-big { font-family: var(--titre); font-size: clamp(5rem, 22vw, 9rem); font-weight: 800; line-height: .9; margin: var(--s1) 0; color: var(--cobalt); letter-spacing: -.06em; }
.stars { font-size: 1.8rem; letter-spacing: 4px; color: var(--safran); -webkit-text-stroke: 1.5px var(--encre); }
.res-row { display: flex; gap: var(--s1); flex-wrap: wrap; margin: var(--s2) 0; }
.res-row .badge { font-size: .9rem; padding: 6px var(--s2); }
.wrong-list { margin: var(--s2) 0 0 var(--s3); font-size: .95rem; color: var(--discret); }
.wrong-list li { margin: var(--s1) 0; }
.game .btn-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.game .btn-row .btn { flex: 1; min-width: 140px; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-top: var(--s6); padding-top: var(--s4); border-top: var(--trait); }
.pager .btn { justify-content: flex-start; text-align: left; }
.pager .btn.next { justify-content: flex-end; text-align: right; grid-column: 2; }

/* ---------- Terminal simulé ---------- */
.term { background: var(--encre); border: var(--trait); border-radius: var(--r2); overflow: hidden; font-family: var(--mono); font-size: .86rem; margin: var(--s3) 0; box-shadow: var(--ombre-2); }
.term.done { box-shadow: 6px 6px 0 var(--ok); }
.term-bar { display: flex; align-items: center; gap: 6px; padding: var(--s1) 12px; background: var(--safran); color: var(--encre); font-weight: 700; font-size: .75rem; border-bottom: var(--trait); }
.term-bar i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--encre); display: inline-block; }
.term-bar span { margin-left: var(--s1); }
.term-out { max-height: 280px; min-height: 96px; overflow-y: auto; padding: 12px 12px 0; color: #e8e4d8; }
.term-row { white-space: pre-wrap; word-break: break-word; line-height: 1.55; }
.term-row.cmd { color: #8fe0b9; }
.term-line { display: flex; align-items: center; gap: 6px; padding: 6px 12px 12px; }
.term-ps { color: var(--safran); white-space: nowrap; }
.term-in { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; font: inherit; caret-color: var(--safran); padding: 4px 0; }
.term-in:disabled { opacity: .6; }

/* ---------- Animations ---------- */
@keyframes monte { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tourne { from { transform: scale(.4) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Tablette et plus ---------- */
@media (min-width: 640px) {
  .hero { grid-template-columns: repeat(12, 1fr); column-gap: var(--s3); padding-top: var(--s6); }
  .hero h1 { grid-column: 1 / span 10; }
  .hero > p { grid-column: 6 / span 6; }
  .modes { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .mode:nth-child(2) { margin-top: var(--s4); }
  .global { grid-column: 1 / -1; grid-template-columns: 1.3fr 1fr 1.4fr; align-items: start; }
  .panel:nth-child(2) { margin-top: var(--s3); }
  .tools { grid-template-columns: 1fr auto; align-items: center; }
  .search { max-width: 320px; }
  .game-card { padding: var(--s4); }
  .page-head { margin-inline: 0; padding: var(--s4); }
  .grid { grid-template-columns: repeat(12, 1fr); }
  .card { grid-column: span 6; }
  .card:nth-child(4n+1) { grid-column: span 7; }
  .card:nth-child(4n+2) { grid-column: span 5; margin-top: var(--s5); }
  .card:nth-child(4n+3) { grid-column: span 5; }
  .card:nth-child(4n+4) { grid-column: span 7; margin-top: var(--s5); }
  .chap { grid-template-columns: 1fr auto; align-items: center; }
  .btns { padding-left: 0; }
}
@media (min-width: 1024px) {
  .hero > p { grid-column: 7 / span 5; }
  .page-head .ico { width: 88px; height: 88px; font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- Icônes en traits (jeu Lucide, ISC) ---------- */
.i { width: 1.1em; height: 1.1em; vertical-align: -.18em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn .i, .tab .i { margin-right: 2px; }
.box > b:first-child::before { content: ""; display: inline-block; width: 1.1em; height: 1.1em; margin-right: 8px; vertical-align: -.2em; background: currentColor; -webkit-mask: var(--pictogramme) center / contain no-repeat; mask: var(--pictogramme) center / contain no-repeat; }
.box { --pictogramme: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' %3E %3Ccircle cx='12' cy='12' r='10' /%3E %3Cpath d='M12 16v-4' /%3E %3Cpath d='M12 8h.01' /%3E %3C/svg%3E"); }
.box.retenir { --pictogramme: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' %3E %3Ccircle cx='12' cy='12' r='10' /%3E %3Cpath d='m16 9-5.5 5.5L8 12' /%3E %3C/svg%3E"); }
.box.attention { --pictogramme: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' %3E %3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3' /%3E %3Cpath d='M12 9v4' /%3E %3Cpath d='M12 17h.01' /%3E %3C/svg%3E"); }

/* ===================== Labo terminal / testeur de code ===================== */
.labo.wrap { width: min(1320px, 100% - 32px); }
.labo-mode { margin: var(--s3) 0 var(--s2); align-items: center; }
.labo-score { margin-left: auto; font-weight: 800; font-family: var(--titre); }
.labo-lecons { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s1); margin-bottom: var(--s3); }
.labo-lecon { border: var(--trait); border-radius: var(--r1); background: var(--surface); padding: 10px 12px; }
.labo-lecon.on { background: var(--m-clair); box-shadow: var(--ombre-1); }
.labo-lecon.fini .ll-n { background: var(--ok); color: #fff; }
.ll-t { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .92rem; }
.ll-n { width: 24px; height: 24px; border-radius: 50%; border: var(--trait); display: grid; place-items: center; font-size: .75rem; flex: none; background: var(--papier); }
.ll-c { margin-left: auto; font-size: .78rem; color: var(--discret); }
.ll-dots { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.ll-dots a { width: 26px; height: 26px; border-radius: 6px; border: 1.5px solid var(--encre); display: grid; place-items: center; font-size: .75rem; font-weight: 700; color: var(--encre); background: var(--papier); }
.ll-dots a.ok { background: var(--ok); color: #fff; }
.ll-dots a.cur { outline: 3px solid var(--safran); outline-offset: 1px; }
.labo-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s3); align-items: start; }
.labo-brief { border: var(--trait); border-radius: var(--r2); background: var(--surface); padding: var(--s3); box-shadow: var(--ombre-2); }
.labo-brief h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 4px 0 var(--s2); }
.labo-brief h3 { margin: var(--s3) 0 var(--s1); font-size: 1.1rem; }
.lb-kicker { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--m-fonce); }
.lb-texte p, .lb-texte ul { margin: 6px 0; line-height: 1.55; }
.lb-texte ul { padding-left: 1.2em; }
.lb-syntaxe { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: var(--s2); }
.lb-syntaxe span { font-size: .75rem; font-weight: 800; text-transform: uppercase; color: var(--discret); margin-right: 4px; }
.lb-syntaxe code { background: var(--encre); color: #e8e4d8; padding: 3px 8px; border-radius: 5px; font-size: .82rem; }
.labo-goals { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.labo-goals li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1.5px solid var(--encre); border-radius: var(--r1); background: var(--papier); line-height: 1.4; transition: background var(--vite); }
.labo-goals li.ok { background: var(--ok-clair); }
.labo-goals .ck { width: 20px; height: 20px; flex: none; border: 2px solid var(--encre); border-radius: 5px; display: grid; place-items: center; font-weight: 900; font-size: .8rem; background: var(--surface); }
.labo-goals li.ok .ck { background: var(--ok); color: #fff; border-color: var(--ok); animation: monte .3s var(--ease); }
.lb-actions { display: flex; flex-wrap: wrap; gap: var(--s1); margin-top: var(--s3); }
.lb-win { animation: monte .35s var(--ease); }
.lb-win .btn { margin-top: 6px; }
.lb-nav { display: flex; justify-content: space-between; gap: var(--s2); margin-top: var(--s3); font-size: .85rem; font-weight: 700; }
.lb-nav a { color: var(--m-fonce); }
.lb-cmd { display: block; font-family: var(--mono); font-size: .85rem; background: var(--encre); color: #8fe0b9; border: 0; border-radius: 5px; padding: 5px 9px; margin: 4px 0; text-align: left; cursor: pointer; }
.lb-cmd:hover { color: var(--safran); }
.lb-small { font-size: .85rem; color: var(--discret); margin: 0 0 var(--s1); }
.lb-aide { margin-top: var(--s2); }
.lb-aide dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; margin: 4px 0 0; }
.lb-aide dt .lb-cmd { margin: 0; }
.lb-aide dd { margin: 0; font-size: .85rem; }
.labo-work .term { margin-top: 0; }
.labo-work .term-out { max-height: 360px; min-height: 220px; }
.labo-explo { border: var(--trait); border-radius: var(--r2); background: var(--surface); overflow: hidden; box-shadow: var(--ombre-1); }
.labo-explo-head { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; padding: 8px 12px; border-bottom: var(--trait); background: var(--m-clair); font-size: .85rem; }
.labo-explo-head label { display: flex; gap: 5px; align-items: center; font-weight: 600; }
.labo-explo-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 200px; }
.labo-tree { list-style: none; margin: 0; padding: 10px 8px; font-family: var(--mono); font-size: .8rem; max-height: 320px; overflow: auto; border-right: 1.5px solid var(--encre); }
.labo-tree ul { list-style: none; margin: 0; padding-left: 16px; border-left: 1px dashed #b9b2a2; margin-left: 6px; }
.labo-tree button { display: flex; gap: 8px; align-items: center; width: 100%; background: none; border: 0; padding: 2px 4px; border-radius: 4px; font: inherit; text-align: left; cursor: pointer; color: var(--encre); }
.labo-tree button:hover { background: var(--safran-clair); }
.labo-tree li.d > button .nm { font-weight: 800; color: var(--cobalt); }
.labo-tree li.open > button { background: var(--safran); }
.labo-tree li.here > button { background: var(--m-clair); outline: 1.5px solid var(--m-fonce); }
.labo-tree .pm { margin-left: auto; color: var(--discret); font-size: .7rem; }
.labo-tree .ici { font-family: var(--texte, inherit); font-size: .65rem; font-weight: 800; background: var(--encre); color: var(--safran); padding: 1px 6px; border-radius: 99px; white-space: nowrap; }
.labo-preview { margin: 0; padding: 10px 12px; font-family: var(--mono); font-size: .8rem; white-space: pre-wrap; word-break: break-word; background: var(--papier); max-height: 320px; overflow: auto; }
.labo-promo { display: flex; gap: var(--s3); align-items: center; margin-top: var(--s3); padding: var(--s3); border: var(--trait); border-radius: var(--r2); background: var(--encre); color: #fff; box-shadow: var(--ombre-2); }
.labo-promo .lp-ico { font-family: var(--mono); font-size: 1.6rem; font-weight: 800; color: var(--safran); width: 64px; height: 64px; display: grid; place-items: center; border: 2px solid var(--safran); border-radius: var(--r1); flex: none; }
.labo-promo h3 { color: #fff; margin: 0 0 4px; font-size: 1.35rem; }
.labo-promo p { margin: 0; color: #d9d4c7; }
.labo-promo .btn { margin-left: auto; flex: none; }
@media (max-width: 900px) {
  .labo-grid { grid-template-columns: 1fr; }
  .labo-explo-body { grid-template-columns: 1fr; }
  .labo-tree { border-right: 0; border-bottom: 1.5px solid var(--encre); }
  .labo-promo { flex-wrap: wrap; }
  .labo-promo .btn { margin-left: 0; }
}
.labo-goals .gt { flex: 1; min-width: 0; }
.labo-work .labo-explo { margin-top: var(--s3); }
/* éditeur de code */
.code-ed { border: var(--trait); border-radius: var(--r2); overflow: hidden; background: #1b1d33; box-shadow: var(--ombre-2); }
.code-bar { display: flex; align-items: center; gap: var(--s2); padding: 6px 8px 6px 12px; background: var(--safran); border-bottom: var(--trait); }
.code-file { font-family: var(--mono); font-weight: 800; font-size: .85rem; display: flex; align-items: center; gap: 6px; }
.code-status { font-size: .75rem; font-weight: 700; margin-left: auto; }
.code-status.wait { color: #6b5600; }
.code-status.ko { color: var(--ko); }
.code-bar .btn { min-height: 36px; padding: 6px 14px; }
.code-area { display: flex; height: 320px; }
.code-gut { margin: 0; padding: 12px 8px 12px 12px; min-width: 42px; text-align: right; color: #6f7394; font: .86rem/1.6 var(--mono); overflow: hidden; user-select: none; border-right: 1px solid #34375a; background: #17192d; }
.code-area textarea { flex: 1; min-width: 0; margin: 0; padding: 12px; border: 0; outline: 0; resize: none; background: transparent; color: #f1ede2; font: .86rem/1.6 var(--mono); tab-size: 2; white-space: pre; overflow: auto; caret-color: var(--safran); }
.code-area textarea::selection { background: #3d4380; }
.code-hint { padding: 5px 12px; font-size: .72rem; color: #9ea2c3; border-top: 1px solid #34375a; }
.code-erreur { margin-top: var(--s2); border: var(--trait); border-radius: var(--r1); background: var(--ko-clair); padding: 10px 12px; display: grid; gap: 4px; font-size: .88rem; }
.code-erreur b { color: var(--ko); }
.code-erreur > code { font-family: var(--mono); white-space: pre-wrap; word-break: break-word; }
.code-out { margin-top: var(--s3); border: var(--trait); border-radius: var(--r2); overflow: hidden; background: #fff; box-shadow: var(--ombre-1); }
.code-url { display: flex; align-items: center; gap: 6px; padding: 7px 12px; background: var(--m-clair); border-bottom: var(--trait); }
.code-url i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--encre); }
.code-url span { margin-left: 8px; flex: 1; min-width: 0; background: var(--surface); border: 1.5px solid var(--encre); border-radius: 99px; padding: 2px 12px; font: .78rem var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-tabs { display: flex; border-bottom: 1.5px solid var(--encre); background: var(--papier); }
.code-tabs button { border: 0; background: none; padding: 6px 14px; font-weight: 700; font-size: .82rem; border-right: 1.5px solid var(--encre); cursor: pointer; }
.code-tabs button[aria-pressed="true"] { background: var(--surface); box-shadow: inset 0 -3px 0 var(--cobalt); }
#lc-frame { display: block; width: 100%; height: 300px; border: 0; background: #fff; }
.code-raw { margin: 0; height: 300px; overflow: auto; padding: 12px; font: .8rem/1.5 var(--mono); white-space: pre-wrap; background: var(--papier); }
.code-notice { border-top: 1.5px solid var(--encre); background: var(--safran-clair); padding: 8px 12px; font-size: .85rem; }
.code-data { margin-top: 6px; border-collapse: collapse; font-size: .82rem; }
.code-data td { border: 1px solid var(--encre); padding: 2px 8px; background: var(--surface); }
.labo-goals li.ko { background: var(--ko-clair); }
.labo-goals li.ko .ck { color: var(--ko); border-color: var(--ko); }
.code-sol { background: #1b1d33; color: #f1ede2; padding: 10px 12px; border-radius: var(--r1); font: .8rem/1.5 var(--mono); overflow: auto; white-space: pre; max-height: 320px; }
/* console Python */
.py-in { display: grid; gap: 4px; padding: 8px 12px; border-bottom: 1.5px solid var(--encre); background: var(--papier); font-size: .78rem; font-weight: 700; }
.py-in textarea { font: .85rem/1.5 var(--mono); border: 1.5px solid var(--encre); border-radius: var(--r1); padding: 6px 8px; resize: vertical; background: var(--surface); }
.py-console { margin: 0; min-height: 220px; max-height: 340px; overflow: auto; padding: 12px; background: var(--encre); color: #e8e4d8; font: .85rem/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; }
/* ===================== Compte (Firebase) ===================== */
.topbar .wrap { gap: var(--s2); }
.top-stat { margin-left: auto; }
.top-serie { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 2px 10px 2px 8px; border: 1.5px solid rgba(255,255,255,.55); border-radius: 99px; color: #fff; text-decoration: none; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.top-serie svg { width: 17px; height: 17px; opacity: .7; }
.top-serie b { font-family: var(--titre); font-size: 1.05rem; }
.top-serie.attente { border-color: var(--safran); }
.top-serie.attente svg { color: var(--safran); opacity: 1; }
.top-serie.ok { background: #ff7a1a; border-color: var(--encre); box-shadow: 2px 2px 0 var(--encre); }
.top-serie.ok svg { opacity: 1; fill: #ffd23f; }
.top-serie:hover { transform: translate(-1px, -1px); }
.top-serie + .top-stat { margin-left: 0; }
.cl-serie { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; color: #e05a00; }
.cl-serie svg { width: 16px; height: 16px; fill: #ffb020; }
.cl-serie.zero { color: var(--discret); font-weight: 600; }
.cl-serie.zero svg { fill: none; opacity: .5; }
.cl-moi-serie { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border: var(--trait); border-radius: var(--r1); background: var(--surface); font-weight: 600; }
.cl-moi-serie .cl-serie { font-size: 1.2rem; }
@media (max-width: 560px) { .top-serie .ts-txt { display: none; } .top-serie { padding: 2px 8px; } }
.compte { position: relative; }
.compte-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 14px; border: var(--trait); border-radius: 99px; background: var(--safran); color: var(--encre); font-weight: 800; font-size: .88rem; box-shadow: 2px 2px 0 var(--encre); cursor: pointer; transition: transform var(--vite) var(--ease); }
.compte-btn:hover { transform: translate(-1px, -1px); }
.compte-btn.moi { background: var(--surface); padding: 3px 12px 3px 3px; }
.compte-btn .avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--cobalt); color: #fff; font-family: var(--titre); font-size: .9rem; border: 1.5px solid var(--encre); }
.compte-btn .nom { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compte-menu { position: absolute; right: 0; top: calc(100% + 8px); width: 260px; background: var(--surface); color: var(--encre); border: var(--trait); border-radius: var(--r2); box-shadow: var(--ombre-2); padding: 8px; z-index: 30; display: grid; gap: 4px; }
.compte-menu[hidden] { display: none; }
.cm-tete { display: grid; padding: 6px 8px 8px; border-bottom: 1.5px dashed #b9b2a2; }
.cm-tete span { font-size: .78rem; color: var(--discret); overflow: hidden; text-overflow: ellipsis; }
.cm-etat { font-size: .78rem; font-weight: 700; color: var(--ok); padding: 4px 8px; }
.cm-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 2px 8px 6px; font-size: .78rem; }
.compte-menu button { text-align: left; background: none; border: 0; padding: 8px; border-radius: var(--r1); font-weight: 700; cursor: pointer; color: var(--encre); }
.compte-menu button:hover { background: var(--safran-clair); }
.compte-voile { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(22, 24, 43, .55); overflow-y: auto; }
.compte-voile[hidden] { display: none; }
html.compte-ouvert { overflow: hidden; }
.compte-dlg { border: var(--trait); border-radius: var(--r2); width: min(420px, 100%); box-shadow: var(--ombre-2); background: var(--surface); color: var(--encre); animation: monte .25s var(--ease); }
.cd-form > label { margin-bottom: -6px; }
.cd-form small { font-weight: 500; color: var(--discret); }
.cd-mdp { position: relative; display: grid; }
.cd-mdp input { padding-right: 76px; }
.cd-oeil { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 1.5px solid var(--encre); border-radius: 99px; background: var(--surface); font-size: .75rem; font-weight: 800; padding: 3px 10px; cursor: pointer; }
.cd-form { display: grid; gap: 12px; padding: var(--s3); position: relative; }
.cd-form h2 { font-size: 1.8rem; margin: 0; }
.cd-sub { margin: 0; font-size: .9rem; color: var(--discret); }
.cd-form label { display: grid; gap: 4px; font-weight: 700; font-size: .88rem; }
.cd-form input { font: inherit; font-weight: 500; padding: 10px 12px; border: var(--trait); border-radius: var(--r1); background: var(--papier); }
.cd-form input:focus { outline: 3px solid var(--safran); outline-offset: 1px; }
.cd-google { width: 100%; }
.cd-ou { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--discret); font-weight: 700; }
.cd-ou::before, .cd-ou::after { content: ""; flex: 1; border-top: 1.5px solid #c9c2b2; }
.cd-lien { background: none; border: 0; padding: 0; color: var(--cobalt); font-weight: 700; text-decoration: underline; cursor: pointer; justify-self: start; font-size: .85rem; }
.cd-err { margin: 0; min-height: 1.2em; color: var(--ko); font-weight: 700; font-size: .85rem; }
.cd-err.ok { color: var(--ok); }
.cd-bas { margin: 0; font-size: .85rem; text-align: center; }
.cd-x { position: absolute; top: 10px; right: 12px; width: 32px; height: 32px; border: var(--trait); border-radius: 50%; background: var(--papier); font-size: 1.1rem; font-weight: 800; line-height: 1; cursor: pointer; }
@media (max-width: 560px) { .top-stat { display: none; } .compte-btn .nom { display: none; } .compte-btn.moi { padding: 3px; } }
/* navigation de la barre du haut */
.top-nav { display: flex; gap: 4px; margin-left: var(--s2); }
.top-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .9rem; color: var(--sur-cobalt); border: 2px solid transparent; }
.top-nav a:hover, .top-nav a[aria-current="page"] { border-color: var(--safran); background: rgba(255, 255, 255, .1); }
.cm-lien { display: block; padding: 8px; border-radius: var(--r1); font-weight: 700; color: var(--cobalt); }
.cm-lien:hover { background: var(--safran-clair); }
@media (max-width: 720px) { .top-nav span { display: none; } .top-nav { margin-left: 0; } }

/* ===================== Évaluations ===================== */
.page-head > .ico .i { width: 1.4em; height: 1.4em; }
.ev-types { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--s2); margin: var(--s3) 0; }
.ev-type { display: grid; gap: 6px; padding: var(--s2) var(--s3); border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-1); }
.ev-type b { font-family: var(--titre); font-size: 1.3rem; }
.ev-type span { font-size: .9rem; line-height: 1.45; }
.ev-meta { font-weight: 700; color: var(--cobalt); display: flex; align-items: center; gap: 6px; }
.ev-h2 { margin: var(--s4, 32px) 0 var(--s2); font-size: 1.6rem; }
.ev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s2); }
.ev-mod { border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-1); overflow: hidden; }
.ev-mod-t { display: flex; gap: 12px; align-items: center; padding: 12px 14px; background: var(--m-clair); border-bottom: var(--trait); }
.ev-mod-t .ico { width: 44px; height: 44px; font-size: 1rem; flex: none; }
.ev-mod-t b { display: block; font-family: var(--titre); font-size: 1.2rem; }
.ev-mod-t span { font-size: .8rem; color: var(--discret); }
.ev-btns { display: grid; padding: 8px; gap: 6px; }
.ev-go { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1.5px solid var(--encre); border-radius: var(--r1); background: var(--papier); font-weight: 800; cursor: pointer; text-align: left; transition: transform var(--vite) var(--ease), box-shadow var(--vite); }
.ev-go:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--encre); background: var(--safran-clair); }
.ev-go small { font-weight: 600; color: var(--discret); font-size: .75rem; }
.ev-consignes { border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-2); padding: var(--s3); max-width: 760px; }
.ev-consignes h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 4px 0 0; }
.ev-regles { list-style: none; padding: 0; margin: var(--s3) 0; display: grid; gap: 8px; }
.ev-regles li { padding: 10px 12px; border: 1.5px solid var(--encre); border-radius: var(--r1); background: var(--papier); line-height: 1.45; }
.ev-bar { position: sticky; top: 56px; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 var(--s3); padding: 10px 14px; border: var(--trait); border-radius: var(--r2); background: var(--m-clair, var(--safran-clair)); box-shadow: var(--ombre-1); }
.exam-bar { background: var(--safran-clair); }
.ev-chrono { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border: var(--trait); border-radius: 99px; background: var(--surface); font-family: var(--mono); overflow: hidden; min-width: 120px; }
.ev-chrono b { font-size: 1.15rem; position: relative; z-index: 1; }
.ev-chrono .i { position: relative; z-index: 1; }
.ev-chrono i { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--cobalt); transition: width .25s linear; }
.ev-chrono.urgent { background: var(--ko-clair); color: var(--ko); animation: pulse 1s infinite; }
.ev-chrono.urgent i { background: var(--ko); }
@keyframes pulse { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .ev-chrono.urgent { animation: none; } }
.ev-dots { display: flex; gap: 6px; margin-bottom: var(--s2); flex-wrap: wrap; }
.ev-dots i, .ev-dots button { width: 26px; height: 8px; border-radius: 99px; border: 1.5px solid var(--encre); background: var(--surface); padding: 0; }
.ev-dots button { height: 14px; cursor: pointer; }
.ev-dots .fait { background: var(--cobalt); }
.ev-dots .cur { background: var(--safran); }
.ev-q { border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-2); padding: var(--s3); }
.ev-q h2 { font-size: clamp(1.25rem, 2.6vw, 1.7rem); line-height: 1.25; margin: 4px 0 var(--s2); letter-spacing: -.02em; }
.ev-q textarea { width: 100%; font: 1rem/1.55 var(--texte, inherit); padding: 12px; border: var(--trait); border-radius: var(--r1); background: var(--papier); resize: vertical; }
.ev-q textarea:focus { outline: 3px solid var(--safran); outline-offset: 1px; }
.ev-compte { font-size: .8rem; color: var(--discret); text-align: right; margin-top: 4px; }
.opt.choisi { background: var(--cobalt); color: var(--sur-cobalt); box-shadow: 3px 3px 0 var(--encre); }
.opt.choisi .k { background: var(--safran); color: var(--encre); }
.ev-nav { margin-top: var(--s3); justify-content: flex-end; }
.ev-res { border: var(--trait); border-radius: var(--r2); background: var(--m-clair, var(--surface)); box-shadow: var(--ombre-2); padding: var(--s3); }
.ev-score { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); margin: var(--s2) 0; }
.ev-score > b { font-family: var(--titre); font-size: clamp(4rem, 12vw, 7rem); line-height: .9; letter-spacing: -.05em; }
.ev-score > b small { font-size: .4em; }
.ev-score > div { display: grid; gap: 6px; font-weight: 700; }
.ev-pts { font-family: var(--titre); font-size: 1.8rem; }
.ev-record { display: inline-block; background: var(--safran); border: var(--trait); border-radius: 99px; padding: 2px 12px; width: max-content; animation: monte .4s var(--ease); }
.ev-login { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px dashed var(--encre); border-radius: var(--r1); background: var(--surface); font-weight: 600; }
.ev-detail { display: grid; gap: 8px; }
.ev-corr { border: var(--trait); border-radius: var(--r1); background: var(--surface); padding: 0 14px; }
.ev-corr summary { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; cursor: pointer; font-weight: 700; line-height: 1.4; }
.ev-corr .ck { flex: none; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 6px; display: grid; place-items: center; font-weight: 900; font-size: .8rem; border: 1.5px solid var(--encre); }
.ev-corr.ok .ck { background: var(--ok); color: #fff; border-color: var(--ok); }
.ev-corr.ko .ck { background: var(--ko); color: #fff; border-color: var(--ko); }
.ev-corr.moy .ck { background: var(--safran); }
.ev-corr > p, .ev-corr > pre, .ev-corr > div, .ev-corr > ul { margin: 0 0 12px; }
.ev-expl { font-size: .9rem; color: var(--discret); }
.ev-copie, .ev-corrige { padding: 10px 12px; border-radius: var(--r1); background: var(--papier); border: 1.5px solid #c9c2b2; }
.ev-corrige { background: var(--ok-clair); }
.ev-copie p, .ev-corrige p { margin: 4px 0 0; line-height: 1.5; }
.ev-notions { list-style: none; padding: 0; display: grid; gap: 4px; }
.ev-notions li { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.ev-notions .ck { min-width: 20px; height: 20px; font-size: .7rem; }
.ev-notions li.ok .ck { background: var(--ok); color: #fff; border-color: var(--ok); }
.ev-notions li.ko .ck { background: var(--ko-clair); color: var(--ko); border-color: var(--ko); }
.en-examen .labo-mode, .en-examen .labo-lecons { display: none !important; }
.labo-resultat { display: block; }

/* ===================== Classement ===================== */
.cl-onglets { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s3) 0 0; }
.cl-onglets a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: var(--trait); border-radius: var(--r1); background: var(--surface); color: var(--encre); font-weight: 800; text-decoration: none; box-shadow: var(--ombre-1); }
.cl-onglets a svg { width: 18px; height: 18px; }
.cl-onglets a[aria-selected="true"] { background: var(--cobalt); color: #fff; }
.cl-onglets a:hover { transform: translate(-1px, -1px); }
.cl-outils { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; justify-content: space-between; margin: var(--s3) 0 var(--s2); }
.cl-outils label { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; max-width: 100%; }
.cl-outils select { min-width: 0; max-width: 100%; font: inherit; font-weight: 600; padding: 8px 12px; border: var(--trait); border-radius: var(--r1); background: var(--surface); }
.cl-table { border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-2); overflow-x: auto; }
.cl-table table { width: 100%; border-collapse: collapse; display: table; margin: 0; }
.cl-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; padding: 10px 14px; background: var(--encre); color: #fff; }
.cl-table td { padding: 10px 14px; border-top: 1.5px solid #e2dccd; }
.cl-table tr.moi td { background: var(--safran-clair); }
.cl-table .rang span { display: inline-grid; place-items: center; min-width: 32px; height: 32px; border-radius: 50%; font-weight: 900; font-family: var(--titre); border: 1.5px solid var(--encre); background: var(--papier); }
.cl-table .p1 .rang span { background: #ffd23f; box-shadow: 2px 2px 0 var(--encre); }
.cl-table .p2 .rang span { background: #d9dde6; box-shadow: 2px 2px 0 var(--encre); }
.cl-table .p3 .rang span { background: #e6a86b; box-shadow: 2px 2px 0 var(--encre); }
.cl-table .ps { font-weight: 800; }
.cl-table .ps small { font-weight: 600; color: var(--discret); }
.cl-regle { margin-top: var(--s2); }
.ev-login { margin: 12px 0; }
/* évaluations sur la page d'une matière */
.mod-evals { margin-top: var(--s4); border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-1); overflow: hidden; }
.mod-evals-t { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: 12px 16px; background: var(--m-clair); border-bottom: var(--trait); }
.mod-evals-t h2 { margin: 0; font-size: 1.4rem; display: flex; align-items: center; gap: 8px; }
.mod-evals-t a { font-weight: 800; display: inline-flex; gap: 6px; align-items: center; }
.mod-evals-l { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; padding: 12px; }
.mod-eval { display: grid; gap: 2px; padding: 12px 14px; border: 1.5px solid var(--encre); border-radius: var(--r1); background: var(--papier); color: var(--encre); transition: transform var(--vite) var(--ease), box-shadow var(--vite); }
.mod-eval:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--encre); background: var(--safran-clair); }
.mod-eval.examen { background: var(--encre); color: #fff; }
.mod-eval.examen small { color: #c9c4b8; }
.mod-eval.examen:hover { background: var(--cobalt); }
.mod-eval b { font-family: var(--titre); font-size: 1.15rem; }
.mod-eval span { font-size: .85rem; }
.mod-eval small { font-size: .75rem; color: var(--discret); font-weight: 600; }
.chap-eval small { font-weight: 600; opacity: .75; }
.ev-go.examen { background: var(--encre); color: #fff; }
.ev-go.examen small { color: #c9c4b8; }
.ev-modlien { display: block; padding: 0 14px 12px; font-size: .85rem; font-weight: 700; color: var(--cobalt); }
.ev-partie { display: flex; justify-content: space-between; align-items: center; margin: var(--s3) 0 var(--s1); font-size: 1.2rem; }
.ev-partie span { font-family: var(--mono); background: var(--safran); border: 1.5px solid var(--encre); border-radius: 99px; padding: 0 10px; font-size: .9rem; }
.ev-parts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--s2); }
.ev-parts span { padding: 4px 12px; border: 1.5px solid var(--encre); border-radius: 99px; background: var(--surface); font-size: .85rem; }

/* ===================== Forum ===================== */
.forum .page-head { flex-wrap: wrap; }
.fo-poser { margin-left: auto; }
.fo-outils { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); margin: var(--s3) 0 var(--s2); align-items: center; }
.fo-tri { display: flex; gap: 8px; }
.fo-tri input, .fo-tri select { font: inherit; font-weight: 600; padding: 8px 12px; border: var(--trait); border-radius: var(--r1); background: var(--surface); min-width: 0; }
.fo-tri input { width: 200px; }
.fo-posts { display: grid; gap: 10px; }
.fo-post { display: flex; gap: 0; border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-1); overflow: hidden; transition: transform var(--vite) var(--ease), box-shadow var(--vite); }
.fo-post:hover { transform: translate(-2px, -2px); box-shadow: var(--ombre-2); }
.fo-post .fo-vote { border-right: 1.5px solid var(--encre); background: var(--m-clair, var(--papier)); }
.fo-post-c { flex: 1; min-width: 0; padding: 12px 16px; color: var(--encre); display: grid; gap: 4px; }
.fo-post-c h2 { font-size: 1.25rem; margin: 2px 0 0; letter-spacing: -.02em; line-height: 1.2; }
.fo-post-c p { margin: 0; font-size: .9rem; color: var(--discret); line-height: 1.45; overflow-wrap: anywhere; }
.fo-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .8rem; color: var(--discret); }
.fo-meta b { color: var(--encre); }
.fo-tag { font-weight: 800; color: var(--encre); background: var(--m-clair, var(--safran-clair)); border: 1.5px solid var(--encre); border-radius: 99px; padding: 1px 10px; }
.fo-resolu { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: #fff; background: var(--ok); border-radius: 99px; padding: 1px 10px; }
.fo-nb { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--discret); }
.fo-vote { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 8px; min-width: 52px; }
.fo-vote b { font-family: var(--titre); font-size: 1.05rem; }
.fo-vote button { width: 32px; height: 32px; display: grid; place-items: center; border: 1.5px solid transparent; border-radius: 8px; background: none; cursor: pointer; color: var(--discret); }
.fo-vote button:hover { border-color: var(--encre); background: var(--surface); color: var(--encre); }
.fo-vote .up.on { background: var(--cobalt); color: #fff; border-color: var(--encre); }
.fo-vote .down.on { background: var(--ko); color: #fff; border-color: var(--encre); }
.fo-vote.petit { padding: 2px 0; min-width: 40px; }
.fo-vote.petit button { width: 26px; height: 26px; }
.fo-vote.petit b { font-size: .9rem; }
.fo-question { display: flex; border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-2); overflow: hidden; }
.fo-question > .fo-vote { border-right: 1.5px solid var(--encre); background: var(--m-clair, var(--papier)); padding-top: 18px; }
.fo-q-c { flex: 1; min-width: 0; padding: var(--s3); }
.fo-q-c h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 6px 0 var(--s2); line-height: 1.1; }
.fo-texte { line-height: 1.6; overflow-wrap: anywhere; }
.fo-texte pre { margin: 10px 0; }
.fo-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.fo-actions button, .fo-actions a { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 4px 8px; border-radius: 6px; font: inherit; font-size: .8rem; font-weight: 700; color: var(--discret); cursor: pointer; }
.fo-actions button:hover, .fo-actions a:hover { background: var(--safran-clair); color: var(--encre); }
.fo-reponses { margin-top: var(--s4); }
.fo-reponses > h2 { font-size: 1.5rem; margin-bottom: var(--s2); }
.fo-rep { display: flex; gap: 6px; margin-top: 12px; }
.fo-reponses > .fo-rep { border: var(--trait); border-radius: var(--r2); background: var(--surface); padding: 10px 12px 12px 6px; box-shadow: var(--ombre-1); }
.fo-rep .fo-rep { border-left: 2px solid #d6cfbe; padding-left: 8px; margin-left: 4px; }
.fo-rep.best { box-shadow: 4px 4px 0 var(--ok) !important; border-color: var(--ok) !important; }
.fo-rep.nouveau > .fo-rep-c { animation: surligne 1.6s ease; }
@keyframes surligne { 0% { background: var(--safran-clair); } 100% { background: transparent; } }
.fo-rep-c { flex: 1; min-width: 0; border-radius: 6px; }
.fo-op { font-size: .7rem; font-weight: 800; color: var(--cobalt); border: 1.5px solid var(--cobalt); border-radius: 99px; padding: 0 6px; }
.fo-rform { display: grid; gap: 8px; margin-top: 8px; }
.fo-rform textarea, .fo-form textarea, .fo-form input, .fo-form select { font: inherit; padding: 10px 12px; border: var(--trait); border-radius: var(--r1); background: var(--papier); width: 100%; resize: vertical; }
.fo-rform textarea:focus, .fo-form textarea:focus, .fo-form input:focus { outline: 3px solid var(--safran); outline-offset: 1px; }
.fo-repondre { margin-bottom: var(--s2); }
.fo-co { padding: 12px; border: 1.5px dashed var(--encre); border-radius: var(--r1); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-weight: 600; background: var(--surface); }
.fo-form { display: grid; gap: 10px; max-width: 820px; border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-2); padding: var(--s3); }
.fo-form h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: 0 0 4px; }
.fo-form label { font-weight: 800; font-size: .9rem; margin-bottom: -4px; }
.fo-form label small { font-weight: 500; color: var(--discret); }
.fo-aide { font-size: .8rem; color: var(--discret); }
.fo-apercu summary { cursor: pointer; font-weight: 700; }
.fo-apercu div { padding: 10px 12px; margin-top: 6px; border: 1.5px dashed #c9c2b2; border-radius: var(--r1); }
.fo-vide { text-align: center; padding: var(--s4) var(--s3); }
.fo-vide .btn { margin-top: 10px; }
.fo-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 2000; background: var(--encre); color: #fff; padding: 10px 18px; border-radius: 99px; font-weight: 700; box-shadow: var(--ombre-2); transition: opacity .4s; max-width: calc(100% - 32px); }
.fo-toast.parti { opacity: 0; }
@media (max-width: 640px) { .fo-tri { width: 100%; } .fo-tri input { flex: 1; width: auto; } .fo-poser { margin-left: 0; } }
.fo-texte pre, .fo-apercu pre { background: #1b1d33; color: #f1ede2; padding: 10px 14px; border-radius: var(--r1); font: .85rem/1.5 var(--mono); overflow-x: auto; white-space: pre; }
.fo-texte code, .fo-apercu code { font-family: var(--mono); font-size: .88em; background: var(--papier); border: 1px solid #d6cfbe; border-radius: 4px; padding: 0 4px; }
.fo-texte pre code { background: none; border: 0; padding: 0; }
.fo-epingle, .fo-verrou { font-weight: 800; border-radius: 99px; padding: 1px 10px; border: 1.5px solid var(--encre); }
.fo-epingle { background: var(--safran); color: var(--encre); }
.fo-verrou { background: var(--encre); color: #fff; }
.fo-modo { align-self: center; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--ko); border: var(--trait); border-radius: 99px; padding: 3px 12px; margin-left: auto; }
.fo-modo + .fo-poser { margin-left: 12px; }
.fo-actions .fo-amodo { color: var(--ko); }
.fo-actions .fo-amodo:hover { background: var(--ko-clair); color: var(--ko); }

/* ===================== Pied de page, bandeau d'information, pages légales ===================== */
.pied { margin-top: var(--s6); border-top: var(--trait); background: var(--encre); color: #d9d4c7; font-size: .85rem; }
.pied .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center; padding: 18px 0; }
.pied nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pied a { color: #fff; font-weight: 700; }
.pied a:hover { color: var(--safran); }
.bandeau-info { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 900; max-width: 760px; margin: 0 auto; display: flex; gap: 14px; align-items: center; padding: 12px 14px 12px 18px; border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-2); animation: monte .35s var(--ease); }
.bandeau-info p { margin: 0; font-size: .88rem; line-height: 1.45; }
.bandeau-info a { color: var(--cobalt); font-weight: 700; text-decoration: underline; }
.bandeau-info .btn { flex: none; min-height: 38px; }
@media (max-width: 560px) { .bandeau-info { flex-direction: column; align-items: stretch; } }
.legal { max-width: 820px; }
.legal h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin-bottom: 4px; }
.legal .maj { color: var(--discret); font-size: .85rem; margin-bottom: var(--s3); }
.legal h2 { font-size: 1.45rem; margin: var(--s4) 0 var(--s1); }
.legal h3 { font-size: 1.1rem; margin: var(--s3) 0 4px; }
.legal p, .legal li { line-height: 1.65; }
.legal ul { padding-left: 1.3em; }
.legal table { width: 100%; border-collapse: collapse; display: table; margin: 10px 0; font-size: .9rem; }
.legal th, .legal td { border: 1.5px solid var(--encre); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--encre); color: #fff; }
.legal td code { font-size: .85em; }
.legal .resume { border: var(--trait); border-radius: var(--r2); background: var(--ok-clair); padding: var(--s2) var(--s3); box-shadow: var(--ombre-1); }
.legal .resume ul { margin: 6px 0 0; }
.cd-accept { display: flex !important; gap: 8px; align-items: flex-start; font-weight: 500 !important; font-size: .85rem !important; line-height: 1.4; margin-bottom: 0 !important; }
.cd-accept input { width: 18px; height: 18px; margin-top: 2px; flex: none; padding: 0; }
.cd-mention { margin: -4px 0 0; font-size: .75rem; color: var(--discret); text-align: center; }
.cd-mention a, .cd-accept a { color: var(--cobalt); font-weight: 700; text-decoration: underline; }
.cd-danger { border-top: 1.5px dashed var(--ko); padding-top: 12px; }
.btn.danger { background: var(--ko); color: #fff; }
.btn.danger:hover { background: #7f1820; }

/* ===================== Téléphone ===================== */
.labo-grid > * { min-width: 0; }
.tab-defil { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; margin: 10px 0; }
.tab-defil > table { margin: 0; }
.term-touches, .code-touches { display: none; }
.compte-btn .i { width: 1.05em; height: 1.05em; }
.compte-btn:not(.moi) .i { display: none; }
@media (hover: none) and (pointer: coarse) {
  /* touches que le clavier d'un téléphone n'a pas */
  .term-touches { display: flex; gap: 6px; overflow-x: auto; padding: 8px 10px; border-top: 1px solid #34375a; background: #1b1d33; scrollbar-width: none; }
  .code-touches { display: flex; gap: 6px; overflow-x: auto; padding: 6px 8px; border-top: 1px solid #34375a; background: #17192d; scrollbar-width: none; }
  .term-touches::-webkit-scrollbar, .code-touches::-webkit-scrollbar { display: none; }
  .term-touches button, .code-touches button { flex: none; min-width: 40px; height: 36px; padding: 0 10px; border: 1px solid #4a4e7a; border-radius: 8px; background: #2a2d4d; color: #f1ede2; font: 600 .9rem var(--mono); }
  .term-touches button:active, .code-touches button:active { background: var(--safran); color: var(--encre); }
  .code-touches .run { background: var(--safran); color: var(--encre); margin-left: auto; }
  .code-hint { display: none; }
}
@media (max-width: 700px) {
  /* évite le zoom automatique d'iOS quand on touche un champ */
  input, select, textarea, .term-in { font-size: 16px !important; }
  .code-area textarea, .code-gut { font-size: 15px !important; line-height: 1.5 !important; }
  .code-area { height: 260px; }
  #lc-frame, .code-raw { height: 260px; }
  /* rangées de pastilles : défilement horizontal plutôt que 5 lignes */
  #chips, #fo-mat, .labo-mode { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 4px 16px 8px; }
  #chips::-webkit-scrollbar, #fo-mat::-webkit-scrollbar, .labo-mode::-webkit-scrollbar { display: none; }
  #chips .chip, #fo-mat .chip, .labo-mode .chip { flex: none; }
  .labo-score { flex: none; padding-left: 8px; }
  .labo-lecons { display: flex; overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 4px 16px 10px; scroll-snap-type: x proximity; }
  .labo-lecons::-webkit-scrollbar { display: none; }
  .labo-lecon { flex: none; width: 220px; scroll-snap-align: start; }
  .labo-brief, .fo-q-c, .ev-q, .ev-consignes, .ev-res, .fo-form { padding: 16px; }
  .labo-explo-body { min-height: 0; }
  .labo-tree, .labo-preview { max-height: 220px; }
  .ev-bar { top: 56px; padding: 8px 10px; font-size: .85rem; }
  .ev-score > b { font-size: 4rem; }
  .fo-vote { min-width: 44px; padding: 8px 4px; }
  .fo-rep .fo-rep { margin-left: 0; padding-left: 6px; }
  .pied .wrap { padding: 16px 0 24px; }
}
@media (max-width: 560px) {
  .topbar .wrap { gap: 8px; }
  .compte-btn:not(.moi) { padding: 0; width: 38px; justify-content: center; }
  .compte-btn:not(.moi) .i { display: block; }
  .compte-btn .txt { display: none; }
  .top-nav a { padding: 6px 9px; }
  .bandeau-info { left: 8px; right: 8px; bottom: 8px; flex-direction: row; gap: 10px; padding: 10px 10px 10px 12px; }
  .bandeau-info p { font-size: .78rem; }
  .bandeau-info .btn { min-height: 34px; padding: 4px 12px; font-size: .85rem; }
}
@media (max-width: 420px) {
  .wrap { width: calc(100% - 24px); }
  .logo { font-size: 1rem; gap: 8px; white-space: nowrap; }
  .logo-mark { padding: 0 7px; }
  .top-nav { gap: 0; }
  .top-nav a { padding: 6px 7px; }
  #chips, #fo-mat, .labo-mode, .labo-lecons { margin-left: -12px; margin-right: -12px; padding-left: 12px; padding-right: 12px; }
  .page-head { margin-left: -12px; margin-right: -12px; }
}
@media (max-width: 340px) { .logo-txt { display: none; } }
.bandeau-info .btn { white-space: nowrap; }
@media (max-width: 560px) { .bandeau-info .bi-long { display: none; } }

/* ===================== Labo SQL ===================== */
.sql-res { min-height: 220px; max-height: 420px; overflow: auto; padding: 12px; background: var(--papier); }
.sql-vide { margin: 0; color: var(--discret); font-weight: 600; }
.sql-table { overflow-x: auto; border: 1.5px solid var(--encre); border-radius: var(--r1); background: var(--surface); }
.sql-table table { border-collapse: collapse; width: 100%; font: .82rem/1.4 var(--mono); }
.sql-table th { position: sticky; top: 0; background: var(--m-clair, var(--safran-clair)); text-align: left; font-weight: 800; }
.sql-table th, .sql-table td { padding: 5px 10px; border-bottom: 1px solid var(--filet); border-right: 1px solid var(--filet); white-space: nowrap; }
.sql-table td.nul { color: var(--discret); font-style: italic; }
.sql-n { margin: 6px 0 12px; font-size: .8rem; font-weight: 700; color: var(--discret); }
.sql-schema { max-height: 420px; overflow: auto; padding: 12px; background: var(--papier); }
.sql-tbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.sql-tb { border: 1.5px solid var(--encre); border-radius: var(--r1); background: var(--surface); padding: 8px 10px; }
.sql-tb b { font-family: var(--mono); }
.sql-tb small { color: var(--discret); font-weight: 700; margin-left: 4px; }
.sql-tb ul { list-style: none; margin: 6px 0 0; padding: 0; font-size: .8rem; }
.sql-tb li { padding: 2px 0; border-top: 1px dashed var(--filet); }
.sql-tb li span { color: var(--discret); }
.lb-texte pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100%; }

/* ===================== Cours bonus ===================== */
.bandeau-bonus { display: flex; align-items: center; gap: 14px; margin: 18px 0 0; padding: 12px 16px; border: var(--trait); border-radius: var(--r2); background: var(--encre); color: #fff; text-decoration: none; box-shadow: var(--ombre-1); transition: transform var(--vite), box-shadow var(--vite); }
.bandeau-bonus:hover { transform: translate(-2px, -2px); box-shadow: var(--ombre-2); }
.bb-tag { flex: none; padding: 4px 10px; border: 2px solid #fff; border-radius: var(--r1); background: var(--safran); color: var(--encre); font-weight: 800; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; }
.bb-txt { display: flex; flex-direction: column; min-width: 0; }
.bb-txt b { font-family: var(--titre); font-size: 1.05rem; }
.bb-txt span { font-size: .85rem; opacity: .85; }
.bb-go { margin-left: auto; font-size: 1.4rem; font-weight: 800; }
@media (max-width: 560px) { .bb-txt span { display: none; } }
.top-nav .nav-bonus { color: var(--safran); }
.bonus-note { max-width: 760px; }
.c-cpp  { --m: #00599c; --m-clair: #d3e4f2; --m-fonce: #003e6d; --m-sur: #ffffff; }
.c-java { --m: #e76f00; --m-clair: #fbe2cc; --m-fonce: #7a3d05; --m-sur: #16182b; }
.c-lua  { --m: #2c2d72; --m-clair: #dcdcf0; --m-fonce: #1c1d4d; --m-sur: #ffffff; }
.c-cs     { --m: #68217a; --m-clair: #e8d8ee; --m-fonce: #46155a; --m-sur: #ffffff; }
.c-git    { --m: #f05033; --m-clair: #fcdcd5; --m-fonce: #8a2613; --m-sur: #16182b; }
.c-bash   { --m: #2e3440; --m-clair: #dfe3ea; --m-fonce: #1f232b; --m-sur: #ffffff; }
.c-ps     { --m: #0b7285; --m-clair: #d0ebef; --m-fonce: #07505e; --m-sur: #ffffff; }
.c-docker { --m: #1d63ed; --m-clair: #d6e2fb; --m-fonce: #123d94; --m-sur: #ffffff; }
.c-secu   { --m: #7a1f3d; --m-clair: #f0d7e0; --m-fonce: #561229; --m-sur: #ffffff; }
.c-js   { --m: #f7df1e; --m-clair: #fdf7c6; --m-fonce: #6b5f00; --m-sur: #16182b; }

/* zone de jeu des labos */
.jeu-zone { padding: 10px; background: #0d0e1a; border-bottom: 2px solid var(--encre); }
.jeu-zone canvas { display: block; width: 100%; max-width: 480px; aspect-ratio: 3 / 2; margin: 0 auto; background: #16182b; border: 2px solid #fff; border-radius: 6px; image-rendering: pixelated; outline: none; touch-action: none; }
.jeu-zone canvas:focus { border-color: var(--safran); box-shadow: 0 0 0 3px rgba(255, 210, 63, .35); }
.jeu-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 480px; margin: 8px auto 0; color: #c9cbe0; font-size: .8rem; }
.jeu-bar .btn { min-height: 34px; padding: 4px 12px; font-size: .85rem; }
.jeu-pad { display: none; gap: 8px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.jeu-pad button { min-width: 52px; min-height: 48px; font: 800 1.1rem var(--corps); border: 2px solid #fff; border-radius: 8px; background: #2a2c48; color: #fff; touch-action: none; user-select: none; -webkit-user-select: none; }
.jeu-pad button.large { min-width: 110px; font-size: .9rem; }
.jeu-pad button:active { background: var(--safran); color: var(--encre); }
@media (hover: none) and (pointer: coarse) { .jeu-pad { display: flex; } }
.py-out [hidden], .jeu-zone[hidden] { display: none !important; }

/* ---------- Cours : blocs « Essaie ce code », tutoriels pas à pas, défis ---------- */
.essai { margin: var(--s3) 0; border: var(--trait); border-radius: var(--r2); overflow: hidden; background: #1b1d33; box-shadow: var(--ombre-1); }
.essai > pre { margin: 0; border: 0 !important; border-radius: 0 !important; }
.essai-bar { display: flex; align-items: center; gap: var(--s1); padding: 6px 8px 6px 12px; background: var(--safran); border-bottom: var(--trait); }
.essai-f { font-family: var(--mono); font-weight: 800; font-size: .82rem; display: flex; align-items: center; gap: 6px; margin-right: auto; min-width: 0; white-space: nowrap; }
.essai-f small { font-family: var(--texte, inherit); font-weight: 600; opacity: .7; overflow: hidden; text-overflow: ellipsis; }
.essai-bar .btn { min-height: 36px; padding: 6px 14px; box-shadow: 2px 2px 0 var(--encre); }
.essai-reset { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: var(--trait); border-radius: var(--r1); background: var(--surface); }
.essai-reset:hover { background: var(--safran-clair); }
.essai-src, .essai-stdin { display: block; width: 100%; margin: 0; padding: 12px 14px; border: 0; outline: 0; resize: vertical; background: transparent; color: #f1ede2; font: .86rem/1.6 var(--mono); tab-size: 2; white-space: pre; overflow: auto; caret-color: var(--safran); }
.essai-src:focus, .essai-stdin:focus { background: #20233d; }
.essai-in { display: block; border-top: 1px solid #34375a; }
.essai-in span { display: block; padding: 6px 14px 0; font-size: .72rem; font-weight: 700; color: #9ea2c3; text-transform: uppercase; letter-spacing: .04em; }
.essai-out { padding: 10px 14px; border-top: var(--trait); background: #fffdf8; color: var(--encre); font: .86rem/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 320px; overflow: auto; }
.essai-out.attente { color: var(--discret); font-style: italic; }
.essai-out.ko { background: var(--ko-clair); }
.essai-out b { color: var(--ko); font-weight: 700; }
.essai-out i { color: var(--discret); }
@media (hover: none) and (pointer: coarse) { .essai-src, .essai-stdin { font-size: 16px; } }
@media (max-width: 560px) { .essai-f small { display: none; } }

.tuto { margin: var(--s4) 0; padding: var(--s3); border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-2); }
.tuto > h3 { margin: 0 0 var(--s1); font-family: var(--titre); font-size: 1.35rem; letter-spacing: -.02em; }
.tuto > h3 small { display: inline-block; margin-right: 10px; padding: 2px 10px; border: var(--trait); border-radius: 999px; background: var(--cobalt); color: var(--sur-cobalt); font-family: var(--texte, inherit); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; vertical-align: .2em; }
.tuto .etape { position: relative; margin-top: var(--s3); padding-left: 44px; counter-increment: etape; }
.tuto { counter-reset: etape; }
.tuto .etape::before { content: counter(etape); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; display: grid; place-items: center; border: var(--trait); border-radius: 50%; background: var(--safran); font-family: var(--titre); font-weight: 800; }
.tuto .etape > h4 { margin: 0 0 4px; font-size: 1.05rem; }
.tuto .etape > :last-child { margin-bottom: 0; }
@media (max-width: 560px) { .tuto { padding: var(--s2); } .tuto .etape { padding-left: 0; padding-top: 38px; } .tuto .etape::before { top: 0; } }

.box.defi { background: var(--m-clair, var(--safran-clair)); }
.box.defi { --pictogramme: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528'/%3E%3C/svg%3E"); }
.box.defi .defi-go { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 6px 14px; border: var(--trait); border-radius: var(--r1); background: var(--surface); font-weight: 700; font-size: .9rem; box-shadow: 2px 2px 0 var(--encre); text-decoration: none; color: var(--encre); }
.box.defi .defi-go:hover { background: var(--safran); transform: translate(-1px, -1px); }
.sommaire { margin: var(--s3) 0; padding: var(--s2) var(--s3); border: var(--trait); border-radius: var(--r1); background: var(--surface-2); }
.sommaire b { font-family: var(--titre); }
.sommaire ol { margin: 6px 0 0; padding-left: 1.3em; columns: 2; column-gap: var(--s4); }
@media (max-width: 560px) { .sommaire ol { columns: 1; } }

/* ============ Duel attaque / défense (module Cybersécurité) ============ */
.duel { --rouge: var(--ko); --rouge-clair: var(--ko-clair); --bleu: var(--cobalt); --bleu-clair: #dfe3fb; }
.duel-h { font-size: clamp(1.953rem, 7vw, 3.052rem); line-height: 1; margin: var(--s2) 0; outline: none; }
.duel .lead { margin-top: var(--s2); max-width: 62ch; }
.duel-modes { display: grid; grid-template-columns: 1fr; gap: var(--s3); margin: var(--s4) 0 var(--s3); }
.duel-mode { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s1); padding: var(--s3); border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-2); }
.duel-mode.bleu { background: var(--bleu-clair); }
.duel-mode.rouge { background: var(--rouge-clair); }
.duel-mode h2 { font-size: var(--t2); line-height: 1.05; }
.duel-mode p { margin: 0; max-width: 46ch; }
.duel-mode .btn { margin-top: auto; }
.duel-mode .chips { margin: 4px 0 var(--s1); }
.duel-stats { margin: var(--s2) 0; font-size: .95rem; color: var(--discret); }
.duel-stats b { color: var(--encre); }
.duel-regles { margin: var(--s3) 0 var(--s6); padding: var(--s2) var(--s3); border: 1.5px dashed var(--encre); border-radius: var(--r1); }
.duel-regles summary { cursor: pointer; font-weight: 700; }
.duel-regles ul { margin: var(--s1) 0 0; padding-left: 1.2em; }
.duel-barre { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s1) var(--s2); margin: var(--s3) 0; padding: var(--s1) var(--s2); border: var(--trait); border-radius: var(--r1); background: var(--safran); box-shadow: var(--ombre-1); }
.duel-barre b { font-family: var(--titre); font-size: 1.25rem; }
.duel-trop { color: var(--ko); font-weight: 800; }
.duel-cartes { display: grid; grid-template-columns: 1fr; gap: var(--s2); margin-bottom: var(--s6); }
.duel-carte { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: var(--s2); text-align: left; font: inherit; color: inherit; border: var(--trait); border-radius: var(--r1); background: var(--surface); box-shadow: var(--ombre-1); cursor: pointer; transition: transform var(--vite, .12s), box-shadow var(--vite, .12s), background var(--vite, .12s); }
.duel-carte:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--encre); }
.duel-carte:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; }
.duel-carte[aria-pressed="true"] { background: var(--m-clair); box-shadow: inset 0 0 0 2px var(--m), var(--ombre-1); }
.duel-carte:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.dc-haut { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s1); width: 100%; padding-right: 30px; }
.dc-haut b { font-family: var(--titre); font-size: 1.2rem; line-height: 1.1; letter-spacing: -.01em; }
.dc-cout { flex: none; font-family: var(--mono); font-size: .8rem; font-weight: 700; padding: 2px 8px; border: 1.5px solid var(--encre); border-radius: 99px; background: var(--safran); }
.dc-texte { font-size: .95rem; line-height: 1.4; }
.dc-rang { position: absolute; top: -10px; right: -8px; display: grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border: var(--trait); border-radius: 99px; background: var(--m); color: var(--m-sur); font-family: var(--titre); font-weight: 800; }
.dc-rang:empty { display: none; }
.duel-lien { margin: var(--s2) 0; }
.duel-lien input, .duel-nom input { width: 100%; padding: 10px 12px; font: inherit; border: var(--trait); border-radius: var(--r1); background: var(--surface); }
.duel-lien input { font-family: var(--mono); font-size: .8rem; margin-bottom: var(--s2); }
.duel-nom { display: block; max-width: 340px; margin: var(--s3) 0 var(--s2); font-weight: 700; }
.duel-nom input { display: block; margin-top: 6px; font-weight: 400; }
.duel-passe { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s2); margin: var(--s5) 0 var(--s7); padding: var(--s4) var(--s3); border: var(--trait); border-radius: var(--r2); background: var(--m-clair); box-shadow: var(--ombre-2); }
.duel-passe .ico, .duel .page-head .ico { font-family: var(--titre); font-weight: 800; }
.duel-passe .ico { display: grid; place-items: center; width: 72px; height: 72px; border: var(--trait); border-radius: var(--r1); background: var(--m); color: var(--m-sur); font-size: 1.6rem; }
.duel-score, .duel-final { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s2); margin: var(--s2) 0 var(--s3); }
.duel-score > span, .duel-final > span { display: flex; flex-direction: column; padding: 6px var(--s2); border: var(--trait); border-radius: var(--r1); box-shadow: var(--ombre-1); }
.duel-score small, .duel-final small { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; overflow-wrap: anywhere; }
.duel-score b, .duel-final b { font-family: var(--titre); font-size: 1.8rem; line-height: 1; }
.duel-final b { font-size: clamp(2.441rem, 12vw, 4rem); }
.duel-score .bleu, .duel-final .bleu { background: var(--bleu-clair); }
.duel-score .rouge, .duel-final .rouge { background: var(--rouge-clair); text-align: right; align-items: flex-end; }
.duel-score .duel-etape, .duel-final .duel-vs { border: 0; box-shadow: none; padding: 0; font-family: var(--titre); font-weight: 800; font-size: .95rem; text-align: center; }
.duel-final .duel-vs { font-size: 1.5rem; }
.duel-journal { margin: var(--s2) 0; padding: var(--s2); border: var(--trait); border-radius: var(--r1); background: var(--encre); color: #f6f1e7; font-family: var(--mono); font-size: .85rem; line-height: 1.5; box-shadow: var(--ombre-1); }
.duel-journal div { white-space: pre-wrap; padding: 4px 0 4px 14px; border-left: 3px solid var(--safran); overflow-wrap: anywhere; }
.duel-journal div + div { margin-top: 8px; }
.duel-chrono { height: 12px; border: var(--trait); border-radius: 99px; background: var(--surface); overflow: hidden; }
.duel-chrono i { display: block; height: 100%; width: 100%; background: var(--m); transition: width .25s linear; }
.duel-q { font-size: var(--t1); margin: var(--s2) 0 var(--s1); }
.duel-choix { display: grid; gap: var(--s1); }
.duel-choix .btn { justify-content: flex-start; text-align: left; white-space: normal; line-height: 1.3; }
.duel-choix .btn.ok { background: var(--ok-clair); opacity: 1; }
.duel-choix .btn.ko { background: var(--ko-clair); opacity: 1; }
.duel-choix .btn.ok::after { content: "bonne réponse"; margin-left: auto; padding-left: 12px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); }
.duel-rep { margin: var(--s2) 0; font-weight: 600; }
.duel-rep.ok { color: var(--ok); } .duel-rep.ko { color: var(--ko); }
.duel-verdict { margin: var(--s2) 0; padding: var(--s2) var(--s3); border: var(--trait); border-radius: var(--r1); box-shadow: var(--ombre-1); background: var(--surface); }
.duel-verdict.ok { background: var(--ok-clair); } .duel-verdict.moyen { background: var(--safran-clair); } .duel-verdict.ko { background: var(--ko-clair); }
.duel-verdict p { margin: 6px 0; }
.duel-incident { margin-bottom: var(--s6); }
.duel .btns { margin: var(--s3) 0 var(--s6); padding-left: 0; }
.duel-lignes { display: grid; gap: var(--s1); margin: var(--s3) 0; }
.duel-ligne { display: grid; grid-template-columns: auto 1fr auto; gap: var(--s2); align-items: start; padding: var(--s1) var(--s2); border: var(--trait); border-radius: var(--r1); background: var(--surface); }
.duel-ligne.ok { border-left: 10px solid var(--ok); } .duel-ligne.moyen { border-left: 10px solid var(--safran); } .duel-ligne.ko { border-left: 10px solid var(--ko); }
.duel-ligne p { margin: 4px 0 0; font-size: .9rem; color: var(--discret); }
.dl-n, .dl-p { font-family: var(--titre); font-weight: 800; }
.dl-p { white-space: nowrap; }
@media (min-width: 720px) {
  .duel-modes { grid-template-columns: 1fr 1fr; }
  .duel-cartes { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .duel-choix { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) { .duel-carte, .duel-chrono i { transition: none; } }
.duel h1:focus, .duel h2:focus { outline: none; }
.duel-choix .btn { flex-wrap: wrap; }
.duel-choix .btn.ok::after { flex-basis: 100%; margin-left: 0; padding-left: 0; }
.duel-verdict a, .duel-ligne a, .duel .lb-small a { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* ============ Atelier de code : attaque / défense (module Cybersécurité) ============ */
.atelier { --rouge: var(--ko); --rouge-clair: var(--ko-clair); --bleu: var(--cobalt); --bleu-clair: #dfe3fb; }
.at-h { font-size: clamp(1.953rem, 7vw, 3.052rem); line-height: 1; margin: var(--s2) 0; outline: none; }
.atelier .page-head .ico { font-family: var(--mono); font-weight: 700; font-size: 1.5rem; }
.at-manches { display: grid; grid-template-columns: 1fr; gap: var(--s3); margin: var(--s4) 0 var(--s3); }
.at-manche { padding: var(--s3); border: var(--trait); border-radius: var(--r2); background: var(--surface); box-shadow: var(--ombre-2); }
.at-manche.faite { background: var(--ok-clair); }
.at-mtete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s1); }
.at-mtete h2 { font-size: var(--t2); line-height: 1.05; }
.at-manche p { margin: var(--s1) 0 var(--s2); max-width: 60ch; }
.at-manche .btns { padding-left: 0; }
.at-ok-petit { margin: var(--s1) 0 0; font-size: .85rem; font-weight: 700; color: var(--ok); }
.at-bandeau { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s2); margin: var(--s2) 0 var(--s3); padding: var(--s2) var(--s3); border: var(--trait); border-radius: var(--r1); box-shadow: var(--ombre-1); }
.at-bandeau p { margin: 0; max-width: 64ch; }
.at-bandeau.rouge { background: var(--rouge-clair); }
.at-bandeau.bleu { background: var(--bleu-clair); }
.at-label { margin: var(--s3) 0 6px; font-weight: 700; font-size: .95rem; }
.at-cible { margin: 0 0 var(--s2); padding: var(--s2); border: var(--trait); border-radius: var(--r1); background: var(--encre); color: #f1ede2; font: .82rem/1.55 var(--mono); overflow-x: auto; box-shadow: var(--ombre-1); white-space: pre; }
.at-cible.rouge { background: #3a1420; color: #ffd9e0; }
.at-cible code { font: inherit; color: inherit; background: none; padding: 0; }
.at-ed { margin: 0 0 var(--s2); }
.at-code { display: block; width: 100%; min-height: 230px; padding: 12px 14px; border: var(--trait); border-radius: var(--r1); resize: vertical; background: #16182b; color: #f1ede2; font: .85rem/1.6 var(--mono); tab-size: 2; box-shadow: var(--ombre-1); }
.at-code:focus { outline: 3px solid var(--safran); outline-offset: 1px; }
.at-code::selection { background: #3d4380; }
.at-rapport { margin: var(--s2) 0; }
.at-verdict { margin: var(--s2) 0 var(--s6); }
.at-note { padding: var(--s2) var(--s3); border: var(--trait); border-radius: var(--r1); box-shadow: var(--ombre-1); font-weight: 500; }
.at-note .btns { margin-top: var(--s2); padding-left: 0; }
.at-note.ok { background: var(--ok-clair); }
.at-note.ko { background: var(--ko-clair); }
.at-note.attente { background: var(--surface-2); }
.atelier .btns { padding-left: 0; }
@media (min-width: 720px) { .at-manches { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .at-cible { font-size: 12px; } .at-code { font-size: 15px; } }
