/* Quizlite : des fiches bristol posées sur un tableau vert. */

@font-face { font-family: 'Atkinson'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/polices/atkinson-latin.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: 'Atkinson'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/polices/atkinson-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Atkinson'; font-style: italic; font-weight: 400; font-display: swap; src: url(/polices/atkinson-italique.woff2) format('woff2'); }
/* Les chiffres viennent de Lexend : le zéro barré d'Atkinson se lit mal dans les scores. Déclaré après, donc prioritaire. */
@font-face { font-family: 'Atkinson'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/polices/lexend-chiffres.woff2) format('woff2'); unicode-range: U+0030-0039; }
@font-face { font-family: 'Ecolier'; font-style: normal; font-weight: 400; font-display: swap; src: url(/polices/playwrite-fr.woff2) format('woff2'); }

:root {
  --ardoise: #1f4a3d;
  --ardoise-fonce: #15372d;
  --ardoise-pale: #dfe9e2;
  --sur-ardoise: #ffffff;
  --encre: #1c2433;
  --encre-douce: #576272;
  --encre-pale: #8a94a1;
  --papier: #e9eee8;
  --papier-2: #dde5de;
  --bristol: #ffffff;
  --bristol-2: #f6f8f6;
  --ligne: #d3e0ef;
  --marge: #e0464f;
  --surligneur: #f7e34f;
  --surligneur-texte: #4a3f00;
  --juste: #23804f;
  --juste-fond: #def2e5;
  --faux: #c23842;
  --faux-fond: #fbe5e6;
  --attention: #9a6a00;
  --attention-fond: #fbf0cf;
  --bord: #cfd8d1;
  --bord-fort: #a9b6ad;
  --focus: #2b6cd6;
  --ombre: 0 1px 2px rgb(28 36 51 / 0.08);
  --ombre-levee: 0 10px 30px -12px rgb(21 55 45 / 0.35);
  --pile: var(--bristol);
  --rayon: 6px;
  --rayon-btn: 8px;
  --police: 'Atkinson', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ecolier: 'Ecolier', 'Atkinson', cursive;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='clair']) {
    --ardoise: #8fd0ad; --ardoise-fonce: #a9debf; --ardoise-pale: #23392f; --sur-ardoise: #0f241b;
    --encre: #e6ece7; --encre-douce: #a9b6ae; --encre-pale: #7f8c85;
    --papier: #15221d; --papier-2: #1b2b25; --bristol: #20302a; --bristol-2: #1a2924;
    --ligne: rgb(150 180 215 / 0.16); --marge: #e8676e; --surligneur: #e9d54a; --surligneur-texte: #2c2600;
    --juste: #6fd29a; --juste-fond: #1d3a2a; --faux: #ff8a90; --faux-fond: #3f2224;
    --attention: #f1c75b; --attention-fond: #3a321a;
    --bord: #33473f; --bord-fort: #4d6559; --focus: #7fb0ff;
    --ombre: 0 1px 2px rgb(0 0 0 / 0.4); --ombre-levee: 0 12px 30px -12px rgb(0 0 0 / 0.7);
    color-scheme: dark;
  }
}
:root[data-theme='sombre'] {
  --ardoise: #8fd0ad; --ardoise-fonce: #a9debf; --ardoise-pale: #23392f; --sur-ardoise: #0f241b;
  --encre: #e6ece7; --encre-douce: #a9b6ae; --encre-pale: #7f8c85;
  --papier: #15221d; --papier-2: #1b2b25; --bristol: #20302a; --bristol-2: #1a2924;
  --ligne: rgb(150 180 215 / 0.16); --marge: #e8676e; --surligneur: #e9d54a; --surligneur-texte: #2c2600;
  --juste: #6fd29a; --juste-fond: #1d3a2a; --faux: #ff8a90; --faux-fond: #3f2224;
  --attention: #f1c75b; --attention-fond: #3a321a;
  --bord: #33473f; --bord-fort: #4d6559; --focus: #7fb0ff;
  --ombre: 0 1px 2px rgb(0 0 0 / 0.4); --ombre-levee: 0 12px 30px -12px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; font-family: var(--police); font-size: 1rem; line-height: 1.5;
  color: var(--encre); background: var(--papier);
}
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: 1.95rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.ic.plein { fill: currentColor; }
.visuellement-cache { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muet { color: var(--encre-douce); }
.petit { font-size: 0.875rem; }

/* ---------- barre du haut ---------- */
#barre { position: sticky; top: 0; z-index: 30; background: var(--ardoise); color: #fff; }
:root[data-theme='sombre'] #barre { background: #10201a; border-bottom: 1px solid var(--bord); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='clair']) #barre { background: #10201a; border-bottom: 1px solid var(--bord); } }
.barre-int { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; flex: none; }
.logo-marque { width: 30px; height: 24px; flex: none; }
.logo-texte { font-family: var(--ecolier); font-size: 1.35rem; line-height: 1; padding-top: 4px; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 8px; text-decoration: none; color: rgb(255 255 255 / 0.82); font-weight: 600; font-size: 0.95rem; }
.nav a:hover { background: rgb(255 255 255 / 0.1); color: #fff; }
.nav a[aria-current='page'] { color: #fff; background: rgb(255 255 255 / 0.14); }
.barre-recherche { flex: 1; max-width: 340px; margin-left: auto; position: relative; }
.barre-recherche input[type='search'] { width: 100%; height: 38px; border-radius: 19px; border: 1px solid transparent; padding: 0 14px 0 38px; background: rgb(255 255 255 / 0.14); color: #fff; }
.barre-recherche input[type='search']::placeholder { color: rgb(255 255 255 / 0.65); }
.barre-recherche input[type='search']:focus { background: var(--bristol); color: var(--encre); outline: none; border-color: var(--focus); }
.barre-recherche .ic { position: absolute; left: 13px; top: 11px; color: rgb(255 255 255 / 0.75); pointer-events: none; }
.barre-recherche input:focus + .ic { color: var(--encre-douce); }
.barre-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.barre-actions .btn-clair { background: #fff; color: #15372d; }
.barre-actions .btn-clair:hover { background: #e9f3ed; }
.btn-barre { background: transparent; border: 1px solid rgb(255 255 255 / 0.35); color: #fff; }
.btn-barre:hover { background: rgb(255 255 255 / 0.1); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; background: var(--surligneur); color: #3b3200; border: 0; cursor: pointer; flex: none; font-size: 1rem; }
.avatar.grand { width: 72px; height: 72px; font-size: 1.9rem; cursor: default; }
.btn-icone.bouton-menu-mobile { display: none; color: #fff; }
.btn-icone.bouton-menu-mobile:hover { background: rgb(255 255 255 / 0.1); }
.menu-deroulant { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--bristol); color: var(--encre); border: 1px solid var(--bord); border-radius: 10px; box-shadow: var(--ombre-levee); padding: 6px; z-index: 40; }
.menu-deroulant a, .menu-deroulant button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left; }
.menu-deroulant a:hover, .menu-deroulant button:hover { background: var(--papier); }
.menu-deroulant hr { border: 0; border-top: 1px solid var(--bord); margin: 6px 4px; }
.menu-deroulant .entete-menu { padding: 8px 10px 6px; }
.menu-deroulant .danger { color: var(--faux); }
.ancre-menu { position: relative; }

@media (max-width: 880px) {
  .nav { display: none; position: absolute; left: 0; right: 0; top: 60px; flex-direction: column; background: var(--ardoise); padding: 8px 12px 14px; margin: 0; box-shadow: var(--ombre-levee); }
  :root[data-theme='sombre'] .nav { background: #10201a; }
  .nav.ouverte { display: flex; }
  .nav a { padding: 12px; }
  .btn-icone.bouton-menu-mobile { display: inline-grid; }
  .barre-recherche { display: none; }
  .barre-actions { margin-left: auto; }
  .texte-optionnel { display: none; }
}
@media (prefers-color-scheme: dark) { @media (max-width: 880px) { :root:not([data-theme='clair']) .nav { background: #10201a; } } }

/* ---------- mise en page ---------- */
main { min-height: calc(100vh - 60px); }
.conteneur { max-width: 1180px; margin: 0 auto; padding: 28px 16px 64px; }
.conteneur.etroit { max-width: 820px; }
.conteneur.tres-etroit { max-width: 460px; }
.entete-page { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.entete-page p { margin-top: 6px; color: var(--encre-douce); max-width: 64ch; }
.section { margin-top: 36px; }
.section:first-child { margin-top: 0; }
.section-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-tete a { font-weight: 600; color: var(--ardoise); text-decoration: none; }
.section-tete a:hover { text-decoration: underline; }
.rangee { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pile-verticale > * + * { margin-top: 14px; }
.chargement { display: grid; place-items: center; min-height: 40vh; color: var(--encre-douce); }
.chargement::before { content: ''; width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--bord); border-top-color: var(--ardoise); animation: tourner 0.8s linear infinite; }
@keyframes tourner { to { transform: rotate(360deg); } }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; border-radius: var(--rayon-btn); border: 1px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; background: var(--ardoise); color: var(--sur-ardoise); transition: background-color 0.15s, transform 0.1s; }
.btn:hover { background: var(--ardoise-fonce); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.second { background: var(--bristol); color: var(--encre); border-color: var(--bord-fort); }
.btn.second:hover { background: var(--papier); }
.btn.fantome { background: transparent; color: var(--encre); }
.btn.fantome:hover { background: var(--papier-2); }
.btn.danger { background: var(--faux); color: #fff; }
.btn.danger:hover { filter: brightness(0.92); }
.btn.grand { min-height: 50px; padding: 12px 22px; font-size: 1.05rem; }
.btn.petit { min-height: 32px; padding: 4px 10px; font-size: 0.875rem; }
.btn.icone { width: 40px; padding: 0; }
.btn.icone.petit { width: 32px; }
.btn.plein-large { width: 100%; }
.btn-icone { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: inherit; flex: none; }
.btn-icone:hover { background: var(--papier-2); }
.btn-icone.actif { color: var(--attention); }
.btn-icone .ic { width: 20px; height: 20px; }
.lien-texte { background: none; border: 0; padding: 0; color: var(--ardoise); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- formulaires ---------- */
.champ { display: block; }
.champ > span, .etiquette { display: block; font-weight: 700; font-size: 0.92rem; margin-bottom: 6px; }
.champ small { display: block; color: var(--encre-douce); margin-top: 5px; font-size: 0.85rem; }
input[type='text'], input[type='password'], input[type='search'], input[type='number'], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid var(--bord-fort); border-radius: var(--rayon-btn); background: var(--bristol); color: var(--encre);
}
textarea { resize: vertical; min-height: 90px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgb(43 108 214 / 0.2); }
.case { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; padding: 6px 0; }
.case input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ardoise); flex: none; }
.case small { display: block; color: var(--encre-douce); }
.erreur-form { background: var(--faux-fond); color: var(--faux); padding: 10px 12px; border-radius: var(--rayon-btn); font-weight: 600; }
.segments { display: inline-flex; background: var(--papier-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segments button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-weight: 700; cursor: pointer; color: var(--encre-douce); }
.segments button[aria-pressed='true'] { background: var(--bristol); color: var(--encre); box-shadow: var(--ombre); }
.grille-form { display: grid; gap: 16px; }
@media (min-width: 640px) { .grille-form.deux { grid-template-columns: 1fr 1fr; } }

/* ---------- la fiche bristol (motif de base) ---------- */
.bristol {
  background-color: var(--bristol);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
}
.bristol.ligne {
  background-image: linear-gradient(var(--marge), var(--marge)), repeating-linear-gradient(to bottom, transparent 0 27px, var(--ligne) 27px 28px);
  background-size: 100% 2px, 100% 100%;
  background-position: 0 50px, 0 50px;
  background-repeat: no-repeat, no-repeat;
}

/* tuile d'une liste : une petite pile de fiches, plus épaisse quand la liste est longue */
.grille-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px 20px; }
.tuile { position: relative; display: flex; flex-direction: column; min-height: 178px; padding: 0; text-decoration: none; color: inherit; background: var(--bristol); border: 1px solid var(--bord); border-radius: var(--rayon); transition: transform 0.15s, box-shadow 0.15s; }
.tuile[data-pile='2'] { box-shadow: 4px 4px 0 -1px var(--pile), 4px 4px 0 0 var(--bord); }
.tuile[data-pile='3'] { box-shadow: 4px 4px 0 -1px var(--pile), 4px 4px 0 0 var(--bord), 8px 8px 0 -1px var(--pile), 8px 8px 0 0 var(--bord); }
.tuile:hover { transform: translateY(-2px); }
.tuile:hover .tuile-titre { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.tuile-haut { padding: 14px 16px 10px; border-bottom: 2px solid var(--marge); }
.tuile-titre { font-weight: 800; font-size: 1.05rem; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tuile-lignes { flex: 1; padding: 4px 16px 0; background-image: repeating-linear-gradient(to bottom, transparent 0 25px, var(--ligne) 25px 26px); background-position: 0 4px; }
.tuile-lignes div { height: 26px; line-height: 27px; font-size: 0.92rem; color: var(--encre-douce); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tuile-bas { display: flex; align-items: center; gap: 8px; padding: 10px 16px 12px; font-size: 0.85rem; color: var(--encre-douce); }
.tuile-bas .auteur { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 55%; }
.compteur-cartes { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; color: var(--encre); }
.jauge { height: 6px; border-radius: 3px; background: var(--papier-2); overflow: hidden; display: flex; }
.jauge > span { display: block; height: 100%; }
.jauge .j-maitrise { background: var(--juste); }
.jauge .j-encours { background: var(--attention); opacity: 0.7; }
.tuile .jauge { margin: 0 16px 12px; }

.tuile-simple { display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: inherit; background: var(--bristol); border: 1px solid var(--bord); border-radius: var(--rayon); }
.tuile-simple:hover { border-color: var(--bord-fort); }
.tuile-simple .ic-grande { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--ardoise-pale); color: var(--ardoise); flex: none; }
.tuile-simple .ic-grande .ic { width: 22px; height: 22px; }
.tuile-simple strong { display: block; }
.grille-simple { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }

.vide { border: 2px dashed var(--bord-fort); border-radius: 10px; padding: 32px 20px; text-align: center; color: var(--encre-douce); }
.vide h3 { color: var(--encre); margin-bottom: 6px; }
.vide .btn { margin-top: 16px; }

.pastille { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--papier-2); color: var(--encre-douce); white-space: nowrap; }
.pastille.ardoise { background: var(--ardoise-pale); color: var(--ardoise); }
.pastille.surligne { background: var(--surligneur); color: var(--surligneur-texte); }

/* ---------- accueil ---------- */
.bandeau-accueil { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; margin-bottom: 32px; }
.bandeau-accueil h1 { font-size: 1.7rem; }
.serie { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--bristol); border: 1px solid var(--bord); border-radius: 12px; }
.serie .ic { width: 28px; height: 28px; color: var(--marge); }
.serie.eteinte .ic { color: var(--encre-pale); }
.serie strong { font-size: 1.4rem; display: block; line-height: 1; }
@media (max-width: 600px) { .bandeau-accueil { grid-template-columns: 1fr; } }

.accueil-invite { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: center; padding: 32px 0 24px; }
.accueil-invite h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); line-height: 1.08; letter-spacing: -0.02em; }
.accueil-invite p { font-size: 1.15rem; color: var(--encre-douce); margin-top: 16px; max-width: 46ch; }
.accueil-invite .rangee { margin-top: 28px; }
@media (max-width: 820px) { .accueil-invite { grid-template-columns: 1fr; gap: 28px; } }

/* la fiche de démonstration qui se retourne toute seule une fois, au chargement */
.demo-fiches { position: relative; height: 300px; perspective: 1400px; }
.demo-fiches .fiche-demo { position: absolute; inset: 20px 30px 30px 10px; }
.demo-fiches .fiche-fond { position: absolute; inset: 40px 0 10px 50px; transform: rotate(5deg); background: var(--bristol); border: 1px solid var(--bord); border-radius: var(--rayon); }
.fiche-demo .fc-interieur { animation: demo-retourne 1s 0.9s cubic-bezier(0.4, 0.1, 0.2, 1) both; }
@keyframes demo-retourne { from { transform: rotateY(0); } to { transform: rotateY(180deg); } }
@media (prefers-reduced-motion: reduce) { .fiche-demo .fc-interieur { animation: none; transform: rotateY(180deg); } }
.liste-modes-demo { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; margin-top: 8px; }
.mode-demo { padding: 16px; background: var(--bristol); border: 1px solid var(--bord); border-radius: var(--rayon); }
.mode-demo .ic { width: 24px; height: 24px; color: var(--ardoise); }
.mode-demo strong { display: block; margin: 8px 0 4px; }
.mode-demo p { color: var(--encre-douce); font-size: 0.92rem; }

/* ---------- compte ---------- */
.carte-compte { margin-top: 24px; padding: 28px 24px 24px; }
.carte-compte h1 { font-family: var(--ecolier); font-weight: 400; font-size: 1.9rem; margin-bottom: 4px; }
.carte-compte form { margin-top: 22px; }
.carte-compte .bas { margin-top: 18px; text-align: center; color: var(--encre-douce); }

/* ---------- page d'une liste ---------- */
.liste-entete h1 { font-size: 2.1rem; overflow-wrap: anywhere; }
.liste-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; color: var(--encre-douce); }
.liste-meta a { color: var(--encre); font-weight: 700; text-decoration: none; }
.liste-meta a:hover { text-decoration: underline; }
.liste-description { margin-top: 12px; max-width: 70ch; white-space: pre-line; }
.modes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 24px; }
.mode-bouton { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--bristol); border: 1px solid var(--bord); border-radius: 10px; text-decoration: none; color: inherit; font-weight: 800; border-bottom: 3px solid var(--ardoise); }
.mode-bouton:hover { background: var(--ardoise-pale); }
.mode-bouton .ic { width: 26px; height: 26px; color: var(--ardoise); }
.mode-bouton small { font-weight: 400; color: var(--encre-douce); font-size: 0.82rem; line-height: 1.3; }
.liste-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.apercu-fiche { margin-top: 28px; }
.apercu-fiche .fc-zone { max-width: 760px; }

.bilan { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 28px; }
.bilan button { text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--bord); background: var(--bristol); cursor: pointer; }
.bilan button[aria-pressed='true'] { border-color: var(--ardoise); box-shadow: inset 0 0 0 1px var(--ardoise); }
.bilan strong { display: block; font-size: 1.5rem; line-height: 1.1; }
.bilan .b-nouveau strong { color: var(--encre-douce); }
.bilan .b-encours strong { color: var(--attention); }
.bilan .b-maitrise strong { color: var(--juste); }
@media (max-width: 560px) { .bilan { grid-template-columns: 1fr; } }

.liste-termes { margin-top: 18px; display: grid; gap: 10px; }
.ligne-terme { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 0; background: var(--bristol); border: 1px solid var(--bord); border-radius: var(--rayon); }
.ligne-terme > div { padding: 14px 16px; overflow-wrap: anywhere; white-space: pre-line; }
.ligne-terme .t-terme { font-weight: 700; border-right: 2px solid var(--marge); }
.ligne-terme .t-def { display: flex; gap: 14px; align-items: flex-start; }
.ligne-terme .t-def img { width: 84px; height: 64px; object-fit: cover; border-radius: 4px; flex: none; margin-left: auto; }
.ligne-terme .t-actions { display: flex; align-items: center; padding: 6px 8px; gap: 0; }
.ligne-terme.etoilee .t-terme { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--surligneur) 70%, transparent) 55%) no-repeat; background-size: 100% 100%; }
@media (max-width: 640px) {
  .ligne-terme { grid-template-columns: 1fr auto; }
  .ligne-terme .t-terme { border-right: 0; border-bottom: 2px solid var(--marge); grid-column: 1; }
  .ligne-terme .t-def { grid-column: 1; }
  .ligne-terme .t-actions { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; justify-content: center; }
}

/* ---------- éditeur ---------- */
.editeur-barre { position: sticky; top: 60px; z-index: 10; background: var(--papier); padding: 12px 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--bord); margin-bottom: 20px; }
.editeur-barre h1 { font-size: 1.3rem; margin-right: auto; }
.editeur-meta { display: grid; gap: 16px; padding: 20px; }
@media (min-width: 760px) { .editeur-meta { grid-template-columns: 1fr 1fr; } .editeur-meta .large { grid-column: 1 / -1; } }
.editeur-outils { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 14px; align-items: center; }
.editeur-outils .compteur { margin-left: auto; color: var(--encre-douce); font-weight: 700; }
.ed-carte { display: grid; grid-template-columns: 34px minmax(0, 1fr) minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 14px 14px 16px 10px; margin-bottom: 12px; }
.ed-carte.glisse { opacity: 0.4; }
.ed-carte.cible { box-shadow: 0 -3px 0 0 var(--focus); }
.ed-num { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--encre-pale); font-weight: 800; padding-top: 10px; }
.ed-num .poignee { cursor: grab; color: var(--encre-pale); background: none; border: 0; padding: 2px; }
.ed-champ textarea { min-height: 46px; height: 46px; resize: none; overflow: hidden; border-width: 0 0 2px; border-radius: 0; padding: 10px 2px 6px; background: transparent; }
.ed-champ textarea:focus { box-shadow: none; border-color: var(--ardoise); }
.ed-champ .ed-etiquette { display: block; font-size: 0.78rem; color: var(--encre-pale); font-weight: 700; margin-top: 6px; }
.ed-terme textarea { border-bottom-color: var(--marge); }
.ed-image { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.ed-image img { width: 72px; height: 54px; object-fit: cover; border-radius: 4px; border: 1px solid var(--bord); }
.ed-actions { display: flex; flex-direction: column; gap: 2px; }
.ajouter-carte { width: 100%; padding: 22px; border: 2px dashed var(--bord-fort); background: transparent; border-radius: var(--rayon); font-weight: 800; cursor: pointer; color: var(--encre-douce); display: flex; align-items: center; justify-content: center; gap: 8px; }
.ajouter-carte:hover { border-color: var(--ardoise); color: var(--ardoise); }
@media (max-width: 700px) {
  .ed-carte { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .ed-carte .ed-def { grid-column: 2; }
  .ed-carte .ed-actions { grid-column: 3; grid-row: 1 / span 2; }
}
.apercu-import { max-height: 260px; overflow: auto; border: 1px solid var(--bord); border-radius: 8px; }
.apercu-import table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.apercu-import td { padding: 6px 10px; border-bottom: 1px solid var(--bord); vertical-align: top; white-space: pre-line; }
.apercu-import td:first-child { font-weight: 700; width: 40%; border-right: 2px solid var(--marge); }

/* ---------- modale, toasts ---------- */
.modale-fond { position: fixed; inset: 0; z-index: 100; background: rgb(12 22 18 / 0.55); display: grid; place-items: center; padding: 16px; animation: apparaitre 0.15s ease-out; }
.modale { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bristol); border-radius: 12px; box-shadow: var(--ombre-levee); }
.modale.large { width: min(820px, 100%); }
.modale-tete { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.modale-tete h2 { font-size: 1.25rem; margin-right: auto; }
.modale-corps { padding: 16px 20px; }
.modale-pied { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; flex-wrap: wrap; }
@keyframes apparaitre { from { opacity: 0; } }
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { pointer-events: auto; background: #1d2a25; color: #fff; padding: 12px 16px; border-radius: 10px; box-shadow: var(--ombre-levee); display: flex; align-items: center; gap: 10px; animation: monter 0.2s ease-out; }
.toast.erreur { background: #8f2530; }
.toast.ok .ic { color: #8fe0b2; }
@keyframes monter { from { transform: translateY(10px); opacity: 0; } }

/* ---------- modes d'étude ---------- */
body.plein #barre { display: none; }
body.plein main { min-height: 100vh; }
.mode { min-height: 100vh; display: flex; flex-direction: column; }
.mode-barre { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bristol); border-bottom: 1px solid var(--bord); position: sticky; top: 0; z-index: 20; }
.mode-nom { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; padding: 6px 10px; border-radius: 8px; background: var(--ardoise-pale); color: var(--ardoise); }
.mode-titre { font-weight: 700; color: var(--encre-douce); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; text-align: center; }
.mode-corps { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 24px 16px 48px; }
.progression-mode { height: 6px; background: var(--papier-2); }
.progression-mode > span { display: block; height: 100%; background: var(--juste); transition: width 0.3s; }
.ecran-fin { text-align: center; padding: 40px 0; max-width: 620px; margin: 0 auto; }
.ecran-fin .grand-titre { font-family: var(--ecolier); font-size: 2.6rem; color: var(--ardoise); line-height: 1.3; }
.ecran-fin p { margin-top: 10px; color: var(--encre-douce); font-size: 1.1rem; }
.ecran-fin .rangee { justify-content: center; margin-top: 26px; }
.chiffres { display: flex; justify-content: center; gap: 14px; margin-top: 24px; flex-wrap: wrap; }
.chiffres > div { min-width: 140px; padding: 14px 18px; border-radius: 12px; background: var(--bristol); border: 1px solid var(--bord); }
.chiffres strong { display: block; font-size: 2rem; line-height: 1.1; }
.chiffres .vert strong { color: var(--juste); }
.chiffres .orange strong { color: var(--attention); }
.chiffres .rouge strong { color: var(--faux); }

/* la grande fiche qui se retourne */
.fc-zone { width: 100%; max-width: 820px; margin: 0 auto; perspective: 1600px; }
.fc-carte { position: relative; width: 100%; height: clamp(300px, 52vh, 480px); cursor: pointer; border: 0; padding: 0; background: none; display: block; text-align: inherit; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.fc-interieur { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.4, 0.1, 0.2, 1); }
.fc-carte.retournee .fc-interieur { transform: rotateY(180deg); }
.fc-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 64px 36px 36px;
  background-color: var(--bristol); border: 1px solid var(--bord); border-radius: 10px; box-shadow: var(--ombre-levee);
  background-image: linear-gradient(var(--marge), var(--marge)), repeating-linear-gradient(to bottom, transparent 0 35px, var(--ligne) 35px 36px);
  background-size: 100% 2px, 100% 100%; background-position: 0 48px, 0 48px; background-repeat: no-repeat;
}
.fc-arriere { transform: rotateY(180deg); }
.fc-cote { position: absolute; top: 14px; left: 20px; font-size: 0.85rem; font-weight: 700; color: var(--encre-pale); }
.fc-outils { position: absolute; top: 6px; right: 8px; display: flex; gap: 2px; }
.fc-texte { font-size: clamp(1.35rem, 3.4vw, 2.2rem); line-height: 1.35; text-align: center; overflow-wrap: anywhere; white-space: pre-line; max-height: 100%; overflow: auto; font-weight: 600; }
.fc-texte.long { font-size: clamp(1.05rem, 2.2vw, 1.35rem); text-align: left; font-weight: 400; }
.fc-face img { max-height: 46%; max-width: 80%; object-fit: contain; border-radius: 4px; }
.fc-carte.glisse-droite .fc-face { box-shadow: 0 0 0 4px var(--juste), var(--ombre-levee); }
.fc-carte.glisse-gauche .fc-face { box-shadow: 0 0 0 4px var(--attention), var(--ombre-levee); }
.fc-carte.sortie-droite { transition: transform 0.25s ease-in, opacity 0.25s; transform: translateX(60%) rotate(8deg); opacity: 0; }
.fc-carte.sortie-gauche { transition: transform 0.25s ease-in, opacity 0.25s; transform: translateX(-60%) rotate(-8deg); opacity: 0; }
.fc-commandes { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.fc-compteur { font-weight: 800; min-width: 80px; text-align: center; font-variant-numeric: tabular-nums; }
.fc-tri { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }
.fc-tri .btn { min-width: 160px; }
.btn.revoir { background: var(--attention-fond); color: var(--attention); border-color: color-mix(in srgb, var(--attention) 40%, transparent); }
.btn.sais { background: var(--juste-fond); color: var(--juste); border-color: color-mix(in srgb, var(--juste) 40%, transparent); }
.compteurs-tri { display: flex; justify-content: space-between; max-width: 820px; margin: 0 auto 12px; font-weight: 800; }
.compteurs-tri .c-revoir { color: var(--attention); }
.compteurs-tri .c-sais { color: var(--juste); }
.tactile-seul { display: none; }
@media (hover: none) and (pointer: coarse) { .raccourcis .clavier-seul { display: none; } .tactile-seul { display: inline; } }
.raccourcis { text-align: center; margin-top: 18px; color: var(--encre-pale); font-size: 0.85rem; }
kbd { font-family: inherit; font-size: 0.8rem; padding: 1px 6px; border: 1px solid var(--bord-fort); border-bottom-width: 2px; border-radius: 4px; background: var(--bristol); }

/* questions (Apprendre, Test, Dictée) */
.question { max-width: 820px; margin: 0 auto; padding: 22px 24px 24px; }
.question-tete { display: flex; align-items: center; gap: 8px; color: var(--encre-pale); font-weight: 700; font-size: 0.88rem; margin-bottom: 8px; }
.question-tete .btn-icone { margin-left: auto; }
.invite { font-size: clamp(1.25rem, 2.8vw, 1.7rem); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-line; padding-bottom: 18px; border-bottom: 2px solid var(--marge); margin-bottom: 18px; }
.invite img { max-height: 220px; margin-top: 12px; border-radius: 6px; }
.consigne { font-weight: 700; color: var(--encre-douce); margin-bottom: 12px; }
.options-qcm { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .options-qcm { grid-template-columns: 1fr; } }
.option { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; min-height: 64px; border: 2px solid var(--bord); background: var(--bristol); border-radius: 10px; cursor: pointer; font-size: 1.02rem; overflow-wrap: anywhere; white-space: pre-line; }
.option:hover:not(:disabled) { border-color: var(--ardoise); }
.option .touche { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--papier-2); font-weight: 800; font-size: 0.85rem; flex: none; }
.option.juste { border-color: var(--juste); background: var(--juste-fond); }
.option.faux { border-color: var(--faux); background: var(--faux-fond); }
.option:disabled { cursor: default; }
.option.estompee { opacity: 0.55; }
.reponse-ecrite { display: flex; gap: 10px; }
.reponse-ecrite input { font-size: 1.15rem; min-height: 52px; }
.retour { margin-top: 16px; padding: 14px 16px; border-radius: 10px; }
.retour.juste { background: var(--juste-fond); color: var(--juste); }
.retour.presque { background: var(--attention-fond); color: var(--attention); }
.retour.faux { background: var(--faux-fond); color: var(--faux); }
.retour strong { display: block; font-size: 1.05rem; }
.retour .attendu { color: var(--encre); margin-top: 6px; overflow-wrap: anywhere; white-space: pre-line; }
.retour .rangee { margin-top: 12px; }
.suite { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.suite .astuce { margin-right: auto; color: var(--encre-pale); font-size: 0.85rem; }
.reglages-mode { display: grid; gap: 18px; }
.reglages-mode fieldset { border: 0; padding: 0; margin: 0; }
.reglages-mode legend { font-weight: 800; margin-bottom: 8px; padding: 0; }

.paliers { display: flex; gap: 6px; max-width: 820px; margin: 0 auto 20px; align-items: center; }
.paliers .p-seg { flex: 1; height: 8px; border-radius: 4px; background: var(--papier-2); overflow: hidden; }
.paliers .p-seg > span { display: block; height: 100%; background: var(--juste); transition: width 0.3s; }
.paliers small { font-weight: 700; color: var(--encre-douce); white-space: nowrap; }
.recap-manche { max-width: 820px; margin: 0 auto; }
.recap-manche .liste-termes { margin-top: 12px; }

.diff { font-size: 1.3rem; letter-spacing: 0.04em; font-weight: 700; overflow-wrap: anywhere; }
.diff .d-ok { color: var(--juste); }
.diff .d-ko { color: var(--faux); text-decoration: underline wavy; text-underline-offset: 4px; }
.diff .d-manque { color: var(--faux); background: var(--faux-fond); border-radius: 3px; }

/* test */
.test-feuille { max-width: 860px; margin: 0 auto; }
.test-entete { padding: 22px 24px; margin-bottom: 18px; }
.test-entete h1 { font-size: 1.5rem; }
.test-q { padding: 20px 24px; margin-bottom: 16px; }
.test-q .q-num { font-weight: 800; color: var(--encre-pale); font-size: 0.88rem; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 10px; }
.vf-choix { display: flex; gap: 12px; }
.vf-choix .option { flex: 1; justify-content: center; font-weight: 800; }
.option.choisie { border-color: var(--ardoise); background: var(--ardoise-pale); }
.assoc { display: grid; gap: 10px; }
.assoc-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 180px; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 8px; }
.assoc-ligne.juste { border-color: var(--juste); background: var(--juste-fond); }
.assoc-ligne.faux { border-color: var(--faux); background: var(--faux-fond); }
.assoc-ligne .correction { grid-column: 1 / -1; font-size: 0.92rem; color: var(--faux); }
.assoc-options { margin-top: 12px; display: grid; gap: 6px; padding: 12px; background: var(--bristol-2); border-radius: 8px; }
.assoc-options div { white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 600px) { .assoc-ligne { grid-template-columns: 1fr; } }
.note-test { display: flex; align-items: center; gap: 24px; padding: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.note-test .note { font-family: var(--ecolier); font-size: 3.2rem; color: var(--marge); line-height: 1; transform: rotate(-6deg); padding: 6px 4px 0; }

/* associer */
.match-tete { display: flex; justify-content: center; align-items: center; gap: 18px; margin-bottom: 18px; font-weight: 800; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.match-grille { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; max-width: 980px; margin: 0 auto; }
@media (max-width: 760px) { .match-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .match-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tuile-match { min-height: 120px; padding: 12px; border-radius: 8px; border: 2px solid var(--bord); background: var(--bristol); cursor: pointer; font-size: 1rem; overflow-wrap: anywhere; display: grid; place-items: center; text-align: center; white-space: pre-line; transition: transform 0.12s, opacity 0.3s; box-shadow: var(--ombre); }
.tuile-match img { max-height: 70px; }
.tuile-match:hover { border-color: var(--bord-fort); }
.tuile-match.choisie { border-color: var(--ardoise); background: var(--ardoise-pale); }
.tuile-match.erreur { border-color: var(--faux); background: var(--faux-fond); animation: secouer 0.35s; }
.tuile-match.trouvee { border-color: var(--juste); background: var(--juste-fond); opacity: 0; transform: scale(0.9); pointer-events: none; }
.tuile-match.partie { visibility: hidden; }
@keyframes secouer { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.classement { max-width: 460px; margin: 26px auto 0; text-align: left; padding: 6px 0; }
.classement h3 { padding: 12px 18px 6px; }
.classement ol { margin: 0; padding: 0 18px 12px; list-style: none; counter-reset: rang; }
.classement li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--bord); counter-increment: rang; font-variant-numeric: tabular-nums; }
.classement li::before { content: counter(rang); width: 22px; font-weight: 800; color: var(--encre-pale); }
.classement li span:last-child { margin-left: auto; font-weight: 800; }
.classement li.moi { color: var(--ardoise); font-weight: 700; }

/* effaceur : les mots tombent sur le tableau, on les efface en tapant la réponse */
.tableau { position: relative; height: min(64vh, 560px); border-radius: 12px; overflow: hidden; background: #22463a; border: 10px solid #8a6a46; box-shadow: inset 0 0 60px rgb(0 0 0 / 0.35), var(--ombre-levee); max-width: 980px; margin: 0 auto; }
.tableau::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; background: #6f5436; box-shadow: 0 -2px 0 rgb(0 0 0 / 0.2); }
.mot-tombant { position: absolute; top: 0; max-width: 46%; padding: 6px 10px; color: #f3f4ee; font-size: 1.15rem; line-height: 1.3; text-shadow: 0 0 1px rgb(255 255 255 / 0.4); overflow-wrap: anywhere; white-space: pre-line; will-change: transform; font-weight: 600; }
.mot-tombant.vise { color: #fff7a8; }
.mot-tombant.efface { transition: opacity 0.4s, filter 0.4s; opacity: 0; filter: blur(6px); }
.mot-tombant.rate { color: #ff9c9c; }
.effaceur-hud { display: flex; justify-content: space-between; align-items: center; max-width: 980px; margin: 0 auto 12px; font-weight: 800; font-variant-numeric: tabular-nums; gap: 12px; flex-wrap: wrap; }
.effaceur-hud .vies { display: flex; gap: 4px; color: var(--marge); }
.effaceur-saisie { max-width: 980px; margin: 14px auto 0; display: flex; gap: 10px; }
.effaceur-saisie input { font-size: 1.2rem; min-height: 54px; }
.message-tableau { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #f3f4ee; padding: 20px; z-index: 2; }
.message-tableau h2 { font-family: var(--ecolier); font-weight: 400; font-size: 2.2rem; }
.message-tableau p { margin-top: 8px; opacity: 0.85; }
.message-tableau .attendu-craie { margin-top: 14px; font-size: 1.3rem; color: #fff7a8; white-space: pre-line; }
.message-tableau .btn { margin-top: 18px; background: #f3f4ee; color: #15372d; }

/* ---------- dossiers, classes, profil, admin ---------- */
.code-classe { font-family: var(--police); font-weight: 800; letter-spacing: 0.18em; font-size: 1.4rem; padding: 6px 14px; background: var(--surligneur); color: var(--surligneur-texte); border-radius: 8px; }
.membres { display: grid; gap: 6px; }
.membre { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--bristol); border: 1px solid var(--bord); border-radius: 8px; }
.membre .avatar { width: 32px; height: 32px; font-size: 0.85rem; cursor: default; }
.membre .droite { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.tableau-donnees { width: 100%; border-collapse: collapse; background: var(--bristol); border: 1px solid var(--bord); border-radius: 8px; overflow: hidden; font-size: 0.92rem; }
.tableau-donnees th, .tableau-donnees td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--bord); vertical-align: middle; }
.tableau-donnees th { background: var(--bristol-2); font-weight: 800; }
.tableau-donnees td.num, .tableau-donnees th.num { text-align: right; font-variant-numeric: tabular-nums; }
.defile-x { overflow-x: auto; }
.stats-admin { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stats-admin div { padding: 14px 16px; background: var(--bristol); border: 1px solid var(--bord); border-radius: 10px; }
.stats-admin strong { display: block; font-size: 1.6rem; }
.profil-tete { display: flex; align-items: center; gap: 18px; margin-bottom: 28px; flex-wrap: wrap; }
.profil-tete p { color: var(--encre-douce); margin-top: 4px; white-space: pre-line; }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--bord); margin-bottom: 20px; overflow-x: auto; }
.onglets button { padding: 10px 14px; border: 0; background: none; font-weight: 700; color: var(--encre-douce); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.onglets button[aria-selected='true'] { color: var(--encre); border-bottom-color: var(--ardoise); }
.carte-reglage { padding: 20px 22px; margin-bottom: 18px; }
.carte-reglage h2 { font-size: 1.15rem; margin-bottom: 14px; }
.carte-reglage.danger { border-color: color-mix(in srgb, var(--faux) 45%, var(--bord)); }

/* ---------- Live ---------- */
.live-code { font-size: clamp(3rem, 10vw, 6rem); font-weight: 800; letter-spacing: 0.08em; line-height: 1; font-variant-numeric: tabular-nums; }
.live-attente { text-align: center; padding: 30px 0; }
.live-attente .adresse { font-size: 1.2rem; margin-top: 10px; color: var(--encre-douce); }
.live-attente .adresse strong { color: var(--encre); }
.live-joueurs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 28px auto; max-width: 900px; }
.live-joueurs span { padding: 8px 14px; border-radius: 999px; background: var(--bristol); border: 1px solid var(--bord); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.live-joueurs span.hors-ligne { opacity: 0.5; }
.live-joueurs button { border: 0; background: none; cursor: pointer; padding: 0; color: var(--encre-pale); display: inline-grid; }
.live-q { max-width: 1000px; margin: 0 auto; }
.live-q .invite { text-align: center; font-size: clamp(1.4rem, 3.6vw, 2.4rem); }
.live-chrono { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; font-weight: 800; }
.live-chrono .barre-temps { flex: 1; height: 10px; border-radius: 5px; background: var(--papier-2); overflow: hidden; }
.live-chrono .barre-temps span { display: block; height: 100%; background: var(--ardoise); transition: width 0.25s linear; }
.live-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.live-option { display: flex; align-items: center; gap: 14px; padding: 18px; min-height: 90px; border-radius: 12px; border: 0; color: #fff; font-size: 1.15rem; font-weight: 700; text-align: left; cursor: pointer; overflow-wrap: anywhere; white-space: pre-line; }
.live-option .forme { width: 34px; height: 34px; flex: none; fill: rgb(255 255 255 / 0.95); }
.live-option.c0 { background: #b8323e; } .live-option.c1 { background: #2457a6; } .live-option.c2 { background: #a87400; } .live-option.c3 { background: #23764a; }
.live-option:disabled { cursor: default; }
.live-option.estompee { opacity: 0.35; }
.live-option.bonne { outline: 5px solid var(--encre); outline-offset: 2px; }
.live-option .compte { margin-left: auto; font-size: 1.4rem; }
@media (max-width: 640px) { .live-options { grid-template-columns: 1fr; } .live-option { min-height: 70px; } }
.live-resultat { text-align: center; padding: 34px 20px; border-radius: 14px; margin-top: 10px; }
.live-resultat.juste { background: var(--juste-fond); color: var(--juste); }
.live-resultat.faux { background: var(--faux-fond); color: var(--faux); }
.live-resultat h2 { font-size: 2rem; }
.live-resultat p { color: var(--encre); margin-top: 8px; font-size: 1.1rem; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; margin: 30px auto; max-width: 640px; }
.podium > div { flex: 1; text-align: center; }
.podium .marche { margin-top: 10px; border-radius: 8px 8px 0 0; background: var(--ardoise); color: var(--sur-ardoise); display: grid; place-items: center; font-size: 2rem; font-weight: 800; }
.podium .p1 .marche { height: 150px; } .podium .p2 .marche { height: 110px; } .podium .p3 .marche { height: 80px; }
.podium strong { display: block; overflow-wrap: anywhere; }
.rejoindre-live { max-width: 420px; margin: 40px auto; padding: 28px 24px; text-align: center; }
.rejoindre-live h1 { font-family: var(--ecolier); font-weight: 400; font-size: 2rem; }
.rejoindre-live input { text-align: center; font-size: 1.4rem; font-weight: 800; letter-spacing: 0.12em; margin-top: 18px; }
.rejoindre-live .btn { margin-top: 14px; width: 100%; }
.live-joueur-score { display: flex; justify-content: space-between; align-items: center; font-weight: 800; margin-bottom: 14px; }

/* ---------- impression ---------- */
.impression { display: none; }
@media print {
  body { background: #fff; color: #000; }
  #barre, .liste-actions, .modes, .apercu-fiche, .bilan, .liste-termes, .ne-pas-imprimer, #toasts { display: none !important; }
  .impression { display: block; }
  .impression table { width: 100%; border-collapse: collapse; }
  .impression td { border: 1px solid #999; padding: 8px 10px; vertical-align: top; white-space: pre-line; }
  .impression td:first-child { width: 38%; font-weight: 700; }
  .conteneur { padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
.fiche-demo .fc-carte { position: absolute; inset: 0; height: auto; cursor: default; }
.fiche-demo .fc-face { padding-top: 56px; }
.tuile-env { position: relative; display: flex; }
.tuile-env > .tuile { flex: 1; }
.tuile-env .tuile-haut { padding-right: 46px; }
.tuile-env .retirer { position: absolute; top: 6px; right: 6px; width: 34px; height: 34px; }
