/* Le Cabinet des mots : la table de jeu.
   Direction : un cabinet de curiosités le soir, éclairé par une lampe. Tapis de feutre vert bordé d'une cordelette
   dorée (comme les pastilles d'univers du jeu), plaques et poignées en laiton, cartes sur parchemin.
   Les couleurs d'univers sont des tons patinés (émeraude, vieux rose, ocre, prune, bleu ardoise) :
   chaque surface colorée passe d'un reflet clair en haut à une ombre profonde en bas. */
:root {
  --feutre: #13392d;
  --feutre-clair: #1f4c3c;
  --feutre-nuit: #0b231b;
  --lampe: rgba(255, 226, 160, .13);
  --laiton: #c9a14e;
  --laiton-clair: #ead19a;
  --laiton-fonce: #7d6128;
  --parchemin: #f6ecd4;
  --parchemin-2: #e9dab5;
  --encre: #2a1d12;
  --encre-douce: #6b5a45;
  --creme: #efe4c8;
  --bordeaux: #7d2e3c;
  --juste: #3a7d52;
  --faux: #b0473a;
  --alerte: #d9362b;

  --u-litteraire: #3d6e58;
  --u-expressions: #93505a;
  --u-monde: #b07d4e;
  --u-contemporains: #625488;
  --u-sciences: #4b7392;

  --titre: "IM Fell English SC", Georgia, serif;
  --texte: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --serif: "Alegreya", Georgia, serif;
  --bois: #5a3a22;
  --bois-fonce: #3a2414;
  --main: "Caveat", "Segoe Print", cursive;
  --rayon: 14px;
  --ombre: 0 2px 4px rgba(0, 0, 0, .25), 0 10px 24px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--texte);
  font-size: 17px;
  line-height: 1.45;
  color: var(--creme);
  background-color: var(--feutre);
  background-image:
    radial-gradient(ellipse 70% 55% at 50% -5%, var(--lampe), transparent 70%),
    radial-gradient(ellipse 120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .55) 100%),
    repeating-linear-gradient(35deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 5px),
    repeating-linear-gradient(-35deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 6px);
  background-attachment: fixed;
}
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--titre); font-weight: 400; line-height: 1.12; margin: 0 0 .4em; color: var(--laiton-clair); text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4.6vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3.4vw, 1.7rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
.petit { font-size: .88rem; opacity: .85; }
.main { font-family: var(--main); font-size: 1.6rem; line-height: 1; }
[hidden] { display: none !important; }

.ecran {
  max-width: 1200px; margin: 0 auto;
  padding-block: 10px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- parchemin (tout ce qui se lit longuement) ---------- */
.parchemin {
  background: var(--parchemin);
  background-image: radial-gradient(ellipse at 30% 0%, rgba(255, 255, 255, .6), transparent 60%), radial-gradient(ellipse at 100% 100%, rgba(160, 120, 50, .14), transparent 60%);
  color: var(--encre);
  border-radius: var(--rayon);
  border: 1px solid var(--laiton);
  box-shadow: var(--ombre);
  padding: 18px 20px;
}
.parchemin h1, .parchemin h2, .parchemin h3 { color: var(--feutre); }
.parchemin .petit { color: var(--encre-douce); opacity: 1; }

/* ---------- en-tête : la plaque du cabinet ---------- */
.entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; flex-wrap: wrap; }
.plaque {
  position: relative; display: inline-block; cursor: pointer;
  background: linear-gradient(180deg, #fbf3dd, #ead9ae);
  border: 2px solid var(--laiton-fonce); border-radius: 10px;
  padding: 6px 22px; box-shadow: 0 2px 0 var(--laiton), var(--ombre);
}
.plaque::before, .plaque::after {
  content: ""; position: absolute; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--laiton-clair), var(--laiton-fonce));
}
.plaque::before { left: 7px; }
.plaque::after { right: 7px; }
.plaque img { height: 40px; width: auto; }
.entete nav { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- pendant une partie : barre du bas (logo au centre, Son et Règles à droite) ---------- */
.ecran.en-jeu { padding-bottom: 12px; }
.pied-jeu {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
  padding: 6px max(12px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) 12px;
  background: linear-gradient(180deg, rgba(10, 36, 27, .82), rgba(8, 28, 21, .97));
  border-top: 1px solid rgba(234, 209, 154, .35); box-shadow: 0 -6px 18px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.logo-pied { grid-column: 2; height: 66px; width: auto; cursor: pointer; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.pied-boutons { grid-column: 3; justify-self: end; display: flex; gap: 8px; }
.accueil-pied { grid-column: 1; grid-row: 1; justify-self: start; }
@media (max-width: 600px) {
  .logo-pied { height: 58px; }
  .pied-boutons { flex-direction: column; gap: 5px; }
  .pied-boutons .btn.petit-btn, .accueil-pied.btn.petit-btn { min-height: 28px; padding: 3px 10px; font-size: .8rem; }
}
/* sur téléphone, la barre d'action collée en bas reste au-dessus de la barre du logo */
@media (max-width: 900px) and (min-height: 600px) {
  .en-jeu .barre { bottom: calc(54px + env(safe-area-inset-bottom, 0px)); }
}
/* les règles, ouvertes pendant une partie */
.fermer-croix { float: right; margin: -4px -4px 0 8px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--laiton); background: #fffaf0; color: var(--encre); font-size: 1.1rem; cursor: pointer; }
.regles-fenetre h2:first-child { margin-top: 0; }

/* ---------- boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 9px 20px; border-radius: 999px; cursor: pointer; text-decoration: none;
  font-weight: 700; letter-spacing: .01em; color: var(--encre);
  background: linear-gradient(180deg, var(--laiton-clair), var(--laiton));
  border: 1px solid var(--laiton-fonce);
  box-shadow: 0 2px 0 var(--laiton-fonce), 0 4px 10px rgba(0, 0, 0, .25);
  transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: translateY(2px); box-shadow: 0 0 0 var(--laiton-fonce), 0 2px 6px rgba(0, 0, 0, .25); }
.btn:focus-visible, .option:focus-visible, .pile:focus-visible, .tiroir:focus-visible, .epreuve-btn:focus-visible, .plaque:focus-visible, .tiroir-adv:focus-visible {
  outline: 3px solid var(--laiton-clair); outline-offset: 3px;
}
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.sec { background: transparent; color: var(--laiton-clair); border-color: var(--laiton); box-shadow: none; }
.btn.sec:hover { background: rgba(212, 166, 65, .12); }
.parchemin .btn.sec { color: var(--feutre); border-color: var(--feutre); }
.parchemin .btn.sec:hover { background: rgba(15, 58, 44, .08); }
.btn.rouge { background: linear-gradient(180deg, #a3505d, var(--bordeaux) 55%, #5c1f2a); color: #fff8e8; border-color: #4a1720; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 2px 0 #4a1720, 0 4px 10px rgba(0, 0, 0, .25); }
/* flèche « continuer » : petit élan vers la droite pour inviter à cliquer */
.btn.suivant::after { content: "➜"; font-size: 1.05em; line-height: 1; display: inline-block; animation: elan 1.3s ease-in-out infinite; }
@keyframes elan { 0%, 60%, 100% { transform: translateX(0); } 30% { transform: translateX(5px); } }
.btn.petit-btn { min-height: 36px; padding: 5px 14px; font-size: .92rem; }
.rang-boutons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- accueil ---------- */
.accueil { text-align: center; }
.accueil .plaque { padding: 14px 40px; margin: 10px auto 14px; cursor: default; }
.accueil .plaque img { height: auto; width: min(380px, 70vw); }
.accroche { font-size: 1.15rem; max-width: 36em; margin: 0 auto 18px; color: var(--creme); }
.ruban-univers { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 26px; }
.pastille { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; font-size: .82rem; font-weight: 700; color: var(--creme); }
.pastille .rond {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--parchemin); border: 4px solid var(--u); box-shadow: 0 0 0 2px var(--laiton), var(--ombre);
}
.pastille .rond img { width: 36px; height: 36px; object-fit: contain; }

.tiroirs { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; text-align: left; }
.tiroir {
  --t: var(--u-monde);
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 30px 20px 20px; border-radius: 12px; color: #fff; cursor: pointer; text-align: left;
  /* lumière de la lampe en haut à gauche, ombre en bas */
  background:
    radial-gradient(ellipse 80% 70% at 20% 0%, rgba(255, 240, 210, .30), transparent 60%),
    radial-gradient(ellipse 90% 60% at 80% 110%, rgba(0, 0, 0, .45), transparent 70%),
    linear-gradient(170deg, color-mix(in srgb, var(--t) 80%, #fff 20%), var(--t) 45%, color-mix(in srgb, var(--t) 55%, #000));
  border: 1px solid color-mix(in srgb, var(--t) 45%, #000);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .25), inset 0 0 0 6px rgba(255, 255, 255, .05), var(--ombre);
  transition: transform .15s ease, box-shadow .2s ease;
}
.tiroir:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), inset 0 -3px 0 rgba(0, 0, 0, .25), 0 0 26px rgba(234, 209, 154, .25), var(--ombre); }
.tiroir::before { /* poignée en laiton */
  content: ""; position: absolute; top: 10px; left: 50%; width: 70px; height: 10px; margin-left: -35px; border-radius: 6px;
  background: linear-gradient(180deg, var(--laiton-clair), var(--laiton-fonce)); box-shadow: 0 2px 3px rgba(0, 0, 0, .4);
}
.tiroir:hover { transform: translateY(-3px); }
.tiroir h2 { color: #fff8e8; margin: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.tiroir .appel { margin-top: 8px; align-self: flex-start; }
.tiroir .etiquette { align-self: flex-start; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 800; background: rgba(0, 0, 0, .25); padding: 2px 10px; border-radius: 999px; }
.tiroir[aria-disabled="true"] { cursor: default; filter: saturate(.55); }
.tiroir[aria-disabled="true"]:hover { transform: none; }
.niveaux { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.bandeau-boite {
  margin-top: 28px; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; text-align: left;
}
.bandeau-boite h3 { color: var(--bordeaux); margin-bottom: .15em; }
.bandeau-boite p { margin: 0; }
@media (max-width: 620px) { .bandeau-boite { grid-template-columns: 1fr; } }

/* ---------- cartes de mots ---------- */
.carte {
  --u: var(--u-litteraire);
  position: relative; display: flex; flex-direction: column; width: 100%;
  background: var(--parchemin); border-radius: 9px; overflow: hidden;
  border: 2px solid var(--parchemin); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .35);
}
.carte[data-u="litteraire"] { --u: var(--u-litteraire); }
.carte[data-u="expressions"] { --u: var(--u-expressions); }
.carte[data-u="monde"] { --u: var(--u-monde); }
.carte[data-u="contemporains"] { --u: var(--u-contemporains); }
.carte[data-u="sciences"] { --u: var(--u-sciences); }
.carte .illu { aspect-ratio: 459 / 540; object-fit: cover; object-position: top; width: 100%; max-width: 100%; background: var(--parchemin-2); }
.carte .legende {
  padding: 5px 8px 7px; color: #fff8e8; text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
  background: linear-gradient(180deg, color-mix(in srgb, var(--u) 85%, #fff 15%), var(--u) 50%, color-mix(in srgb, var(--u) 70%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25);
}
.carte .mot { font-family: var(--titre); font-size: 1.02rem; line-height: 1.08; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: anywhere; }
.carte .meta { font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; opacity: .9; margin-top: 2px; }
.sceau {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; line-height: 1;
  /* cachet de cire : reflet en haut à gauche, bord plus sombre */
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--u) 60%, #fff 40%) 0%, var(--u) 45%, color-mix(in srgb, var(--u) 55%, #000) 100%);
  border: 1.5px solid rgba(234, 209, 154, .85);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .45), inset 0 -2px 3px rgba(0, 0, 0, .3), inset 0 2px 2px rgba(255, 255, 255, .25);
  color: #fff8e8; font-family: var(--titre); text-align: center; text-shadow: 0 1px 1px rgba(0, 0, 0, .35);
}
.sceau b { font-size: 1.05rem; display: block; }
.sceau small { font-size: .5rem; letter-spacing: .05em; display: block; margin-top: -1px; font-family: var(--texte); font-weight: 800; }
.carte.grande .mot { font-size: 1.55rem; }
.carte.grande .sceau { width: 46px; height: 46px; }
.carte.grande .sceau b { font-size: 1.4rem; }
.carte.grande .sceau small { font-size: .6rem; }
.carte.mini .legende { padding: 3px 5px 4px; }
.carte.mini .mot { font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.carte.mini .meta { display: none; }
.carte.mini .sceau { width: 24px; height: 24px; top: 4px; right: 4px; border-width: 1.5px; }
.carte.mini .sceau b { font-size: .8rem; }
.carte.mini .sceau small { display: none; }
.carte.vide-carte { aspect-ratio: 3 / 4; align-items: center; justify-content: center; background: color-mix(in srgb, var(--u) 35%, var(--feutre-nuit)); border: 2px dashed rgba(255, 255, 255, .3); box-shadow: none; color: var(--creme); font-size: .8rem; }

/* ---------- table de jeu ---------- */
.jeu { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .jeu { grid-template-columns: minmax(0, 1fr); gap: 12px; } }
.table {
  position: relative; border-radius: 18px; padding: 16px;
  background: radial-gradient(ellipse at 50% 30%, var(--feutre-clair), var(--feutre) 70%);
  border: 2px solid var(--laiton);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .45), var(--ombre);
}
.piles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.pile { position: relative; display: flex; flex-direction: column; gap: 6px; background: none; border: 0; padding: 0; text-align: left; border-radius: 10px; }
.pile .socle {
  position: relative; padding: 6px; border-radius: 12px; border: 1.5px solid var(--laiton);
  background: radial-gradient(ellipse at 30% 0%, rgba(255, 240, 210, .28), transparent 60%), linear-gradient(170deg, color-mix(in srgb, var(--u) 80%, #fff 20%), color-mix(in srgb, var(--u) 60%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 3px 8px rgba(0, 0, 0, .3);
}
.pile .socle::after { /* épaisseur du paquet */
  content: ""; position: absolute; inset: 10px 4px -5px 10px; border-radius: 10px; background: var(--parchemin-2); z-index: -1;
  box-shadow: 0 3px 0 #d8c69a, 0 6px 0 #c9b483;
}
.pile[data-u="litteraire"] { --u: var(--u-litteraire); }
.pile[data-u="expressions"] { --u: var(--u-expressions); }
.pile[data-u="monde"] { --u: var(--u-monde); }
.pile[data-u="contemporains"] { --u: var(--u-contemporains); }
.pile[data-u="sciences"] { --u: var(--u-sciences); }
.pile .nom-univers { text-align: center; font-size: .8rem; font-weight: 700; color: var(--creme); line-height: 1.15; }
.pile .nom-univers span { display: block; font-weight: 400; opacity: .75; font-size: .74rem; }
.pile.selectionnable { cursor: pointer; }
.pile.selectionnable .socle { animation: appel 1.4s ease-in-out infinite; }
.pile.selectionnable:hover .socle { transform: translateY(-4px); }
.pile .socle { transition: transform .15s ease; }
.pile[disabled] { cursor: default; }
@keyframes appel { 0%, 100% { box-shadow: 0 0 0 2px var(--feutre-nuit); } 50% { box-shadow: 0 0 0 2px var(--feutre-nuit), 0 0 0 7px rgba(242, 214, 143, .55); } }

@media (max-width: 900px) {
  .piles { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; padding: 4px 2px 10px; margin: -4px -2px 0; }
  .pile { flex: 0 0 118px; scroll-snap-align: start; }
}

/* barre d'action : toujours visible sur téléphone */
.barre {
  margin-top: 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--parchemin); color: var(--encre); border: 1px solid var(--laiton); border-radius: 14px;
  padding: 10px 14px; box-shadow: var(--ombre);
}
.barre .consigne { flex: 1 1 220px; min-width: 0; }
.barre .consigne strong.main { color: var(--bordeaux); margin-right: 6px; }
@media (max-width: 900px) {
  .barre { gap: 10px; padding: 8px 10px; margin-top: 10px; }
  .barre .de { width: 54px; height: 54px; border-radius: 12px; }
  .barre .consigne { flex: 1 1 150px; margin: 0; font-size: .95rem; line-height: 1.3; }
  .barre .btn { flex: 1 1 100%; }
  .table { padding: 10px; }
}
/* barre fixée en bas seulement sur un écran de téléphone en hauteur : sur un écran bas, elle cacherait les piles */
@media (max-width: 900px) and (min-height: 600px) {
  .barre { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); z-index: 20; }
}
/* « Lancer le dé ➜ 🎲 » : posé directement sur le tapis, sans encart */
.barre:has(> .lancer-de) { background: none; border: 0; box-shadow: none; padding: 0; margin-top: -4px; justify-content: center; position: static; }
/* pendant le tour du Conservateur : plus d'encart, la place reste (même hauteur que « Lancer le dé ») pour que rien ne bouge */
.barre:has(> .barre-vide) { background: none; border: 0; box-shadow: none; padding: 0; margin-top: -4px; position: static; min-height: 80px; }
/* à notre tour, le dé arrive en douceur au lieu de remplacer l'encart d'un coup */
.lancer-de { animation: lancer-apparait .7s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes lancer-apparait { from { opacity: 0; translate: 0 12px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .lancer-de { animation: none; } }
.lancer-de {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px; margin: 0 auto;
  background: none; border: 0; padding: 2px 8px; cursor: pointer; color: var(--laiton-clair); -webkit-tap-highlight-color: transparent;
}
.lancer-texte { font-family: var(--main); font-size: 2.1rem; font-weight: 700; line-height: 1; text-shadow: 0 2px 4px rgba(0, 0, 0, .45); }
.lancer-fleche { font-size: 1.9rem; line-height: 1; text-shadow: 0 2px 4px rgba(0, 0, 0, .45); animation: pousse 1.1s ease-in-out infinite; }
.lancer-icone { width: 78px; height: auto; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .45)); transition: transform .15s ease; animation: invite-de 2.4s ease-in-out infinite; }
.lancer-de:hover .lancer-icone { transform: rotate(-8deg) scale(1.06); }
.lancer-de:active .lancer-icone { transform: scale(.94); }
.lancer-de:focus-visible { outline: 2px solid var(--laiton-clair); outline-offset: 4px; border-radius: 12px; }
.lancer-de.en-cours { cursor: default; }
/* le dé en 3D (WebGL) : il a de la place au-dessus de lui pour rebondir */
.de3d-place { display: inline-flex; align-items: flex-end; }
.de3d { position: relative; display: block; width: 104px; height: 104px; margin: -24px -8px -12px; }
.scene-tete .de3d { margin: -16px -10px -12px; }
/* dans la barre, le dé remonte presque contre les cartes (le texte, lui, reste sous le nom de la pile) */
.barre .de3d { margin-top: -30px; z-index: 2; }
.de3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.de3d-ombre { position: absolute; left: 50%; bottom: 12px; width: 62%; height: 14%; border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 70%); transform: translateX(-50%); }
.lancer-de:not(.en-cours) .de3d { animation: invite-de 2.4s ease-in-out infinite; }
.lancer-de:not(.en-cours):hover .de3d { transform: rotate(-8deg) scale(1.06); }
@media (max-width: 900px) { .de3d { width: 96px; height: 96px; } }
@media (prefers-reduced-motion: reduce) { .lancer-de .de3d { animation: none; } }
.lancer-de.en-cours .de { width: 70px; height: 70px; }
@keyframes pousse { 50% { transform: translateX(6px); } }
@keyframes invite-de { 0%, 80%, 100% { rotate: 0deg; } 86% { rotate: -9deg; } 92% { rotate: 7deg; } }
@media (max-width: 900px) { .lancer-texte { font-size: 1.85rem; } .lancer-icone { width: 68px; } }
@media (prefers-reduced-motion: reduce) { .lancer-fleche, .lancer-icone { animation: none; } }
.de {
  width: 74px; height: 74px; flex: none; border-radius: 16px; display: grid; place-items: center;
  background: linear-gradient(145deg, #fffdf6, #eadcb8); border: 2px solid var(--encre);
  box-shadow: 0 4px 0 #b9a77c, 0 8px 14px rgba(0, 0, 0, .3);
}
.de img { width: 70%; height: 70%; object-fit: contain; }
.de.roule { animation: secoue .16s linear infinite; }
.de.pose { animation: pose .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes secoue { 0% { transform: rotate(-10deg) translateY(-2px); } 50% { transform: rotate(10deg) translateY(2px); } 100% { transform: rotate(-10deg) translateY(-2px); } }
@keyframes pose { 0% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
.epreuves-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; width: 100%; }
.epreuve-btn {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; cursor: pointer; text-align: left;
  border: 2px solid var(--laiton); background: #fffaf0; color: var(--encre); font-weight: 700; min-height: 52px;
}
.epreuve-btn:hover { background: #fff2cf; }
.epreuve-btn img { width: 34px; height: 34px; object-fit: contain; }

/* colonne de côté : les cabinets */
.cote { display: grid; gap: 14px; }
.cabinet-zone { padding: 12px 14px; }
.cabinet-zone .tete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cabinet-zone h3 { margin: 0; }
.score { font-family: var(--titre); font-size: 1.15rem; color: var(--bordeaux); white-space: nowrap; }
.cabinet { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cabinet .slot { min-width: 0; }
.slot-vide {
  aspect-ratio: 3 / 4.3; border-radius: 9px; border: 2px dashed rgba(107, 90, 69, .45);
  display: grid; place-items: center; text-align: center; font-size: .72rem; color: var(--encre-douce); padding: 4px;
}
.mission-mini { margin-top: 10px; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.mission-mini img { border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
.mission-mini .etat { display: block; font-size: .85rem; margin-top: 4px; color: var(--encre-douce); text-align: left; }
.mission-mini .etat.ok { color: var(--juste); font-weight: 700; }
@media (max-width: 900px) { .mission-mini img { display: block; width: min(100%, 340px); margin: 0 auto; } .mission-mini .etat { text-align: center; } }
/* la mission secrète sous les Cabinets : un bandeau avec une flèche, la carte repliée par défaut */
.mission-tete { width: 100%; display: flex; align-items: baseline; gap: 8px; padding: 2px 0; border: 0; background: none; cursor: pointer;
  font: inherit; color: inherit; text-align: left; }
.mission-tete .mission-titre { font-weight: 700; color: var(--feutre); white-space: nowrap; }
.mission-tete .mission-titre small { font-weight: 400; color: var(--encre-douce); }
.mission-tete .etat { flex: 1; min-width: 0; font-size: .85rem; color: var(--encre-douce); }
.mission-tete .etat.ok { color: var(--juste); font-weight: 700; }
.mission-tete .fleche { align-self: center; font-size: 1.1rem; line-height: 1; color: var(--feutre); transition: transform .2s ease; }
.mission-tete[aria-expanded="true"] .fleche { transform: rotate(180deg); }
.mission-zone .mission-contenu .mission-mini { margin-top: 8px; }

.tiroir-adv {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer;
  background: radial-gradient(ellipse at 20% 0%, rgba(255, 240, 210, .22), transparent 60%), linear-gradient(170deg, color-mix(in srgb, var(--u-contemporains) 80%, #fff 20%), color-mix(in srgb, var(--u-contemporains) 60%, #000)); color: #fff8e8;
  border: 2px solid var(--laiton); border-radius: 12px; padding: 10px 14px; text-align: left; box-shadow: var(--ombre);
}
.tiroir-adv .fleche { transition: transform .2s ease; font-size: 1.1rem; }
.tiroir-adv[aria-expanded="true"] .fleche { transform: rotate(180deg); }
.tiroir-adv .score { color: var(--laiton-clair); }
.adv-contenu { margin-top: 8px; }

details.journal-zone { padding: 10px 14px; }
details summary { cursor: pointer; font-weight: 700; color: var(--feutre); }
.journal { max-height: 160px; overflow: auto; font-size: .88rem; color: var(--encre-douce); margin: 6px 0 0; padding-left: 18px; }

/* ---------- scène (question, tour du Conservateur, début et fin) ---------- */
.scene {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
  background: rgba(6, 22, 16, .72); backdrop-filter: blur(3px);
  animation: fondu .25s ease;
}
.scene-boite { width: min(920px, 100%); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow: auto; }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
.scene-tete { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.scene-tete h2 { margin: 0; }
.question { display: grid; grid-template-columns: minmax(0, 230px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 640px) {
  .question { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .question > .carte { max-width: 150px; margin: 0 auto; }
}
.intitule { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.intitule img { width: 40px; height: 40px; object-fit: contain; }
.intitule h3 { margin: 0; color: var(--bordeaux); }
.enonce { font-size: 1.15rem; margin-bottom: 12px; font-weight: 700; }
.affirmation { font-style: italic; font-size: 1.12rem; background: #fffaf0; border-left: 5px solid var(--laiton); padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
.options { display: grid; gap: 8px; }
.options.deux { grid-template-columns: 1fr 1fr; }
.option {
  text-align: left; padding: 12px 14px; border-radius: 10px; cursor: pointer; min-height: 48px; line-height: 1.35;
  border: 2px solid #d9c79c; background: #fffaf0; color: var(--encre);
  transition: border-color .12s ease, background .12s ease, transform .08s ease;
}
.option:hover:not([disabled]) { border-color: var(--laiton); background: #fff2cf; transform: translateX(3px); }
.option[disabled] { cursor: default; }
.option.juste { background: #dff0e3; border-color: var(--juste); box-shadow: inset 5px 0 0 var(--juste); }
.option.faux { background: #f8ddd8; border-color: var(--faux); box-shadow: inset 5px 0 0 var(--faux); }
.option.estompe { opacity: .5; }
/* duel : la réponse touchée, en attendant le verdict du site */
.option.choisi { border-color: var(--laiton); background: #fff2cf; box-shadow: inset 5px 0 0 var(--laiton); animation: choisi-pulse 1s ease-in-out infinite; }
@keyframes choisi-pulse { 50% { background: #ffe9b0; } }
.epreuve-btn.choisi { outline: 3px solid var(--laiton); }
.verification { margin: 10px 0 0; font-style: italic; color: var(--encre-douce); }
.barre .verification { margin: 0; color: inherit; }
.points-attente::after { content: ''; display: inline-block; width: 1.2em; text-align: left; animation: points-attente 1.2s steps(4, end) infinite; }
@keyframes points-attente { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
/* mission secrète accomplie grâce à la carte qu'on vient de gagner */
.annonce-mission { display: block; margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #f6e7b8; border: 2px solid var(--laiton);
  font-weight: 800; color: #5a4210; animation: annonce-mission .6s cubic-bezier(.3, 1.6, .5, 1) 1s both; }
@keyframes annonce-mission { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .option.choisi, .annonce-mission, .points-attente::after { animation: none; } }
.verdict { margin-top: 14px; padding: 12px 14px; border-radius: 10px; }
.verdict.ok { background: #dff0e3; }
.verdict.ko { background: #f8ddd8; }
.verdict strong { font-family: var(--main); font-size: 1.7rem; font-weight: 700; margin-right: 6px; }
.savoir { margin: 8px 0 0; font-size: .95rem; }
.savoir dt { font-weight: 800; color: var(--feutre); margin-top: 6px; }
.savoir dd { margin: 0; }
.lignes { margin: 0 0 10px; padding-left: 20px; }
.lignes li { margin-bottom: 3px; }
.rarete-txt { font-size: .9rem; color: var(--encre-douce); margin: -4px 0 8px; }

/* ---------- compte à rebours (9 s par carte) ---------- */
.question-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chrono {
  --p: 1; --c: var(--feutre-clair);
  flex: none; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--p) * 360deg), rgba(42, 29, 18, .12) 0);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
}
.chrono::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--parchemin); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2); }
.chrono span { position: relative; font-family: var(--titre); font-size: 1.6rem; color: var(--encre); font-variant-numeric: tabular-nums; }
.chrono.alerte { --c: var(--alerte); animation: tremble var(--vitesse, .5s) linear infinite; }
.chrono.alerte span { color: var(--alerte); }
.chrono.fini { --c: var(--alerte); animation: none; }
.chrono.fini span { color: var(--alerte); }
/* la fenêtre de question tremble et rougit de plus en plus vite à l'approche de la fin */
.scene-boite.alerte {
  animation: tremble-doux var(--vitesse, .5s) linear infinite;
  box-shadow: 0 0 calc(var(--rouge, .2) * 46px) calc(var(--rouge, .2) * 10px) rgba(217, 54, 43, calc(var(--rouge, .2) * .85)),
    inset 0 0 0 calc(2px + var(--rouge, .2) * 4px) rgba(217, 54, 43, calc(.25 + var(--rouge, .2) * .6));
}
@keyframes tremble { 0%, 100% { transform: translate(0, 0) rotate(0); } 25% { transform: translate(-2px, 1px) rotate(-4deg); } 50% { transform: translate(2px, -1px) rotate(3deg); } 75% { transform: translate(-1px, -1px) rotate(-2deg); } }
@keyframes tremble-doux { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-2px, 1px); } 50% { transform: translate(2px, 0); } 75% { transform: translate(-1px, -1px); } }

/* ---------- mot du jour ---------- */
.mdj { display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr); gap: 22px; align-items: start; }
@media (max-width: 700px) { .mdj { grid-template-columns: minmax(0, 1fr); } .mdj > .carte { max-width: 190px; margin: 0 auto; } }
.progression { display: flex; gap: 6px; margin: 4px 0 14px; }
.progression span { width: 34px; height: 9px; border-radius: 5px; background: rgba(255, 255, 255, .18); }
.progression span.ok { background: #4fbf74; }
.progression span.ko { background: #e2584a; }
.progression span.encours { background: var(--laiton); }
.partage { white-space: pre-line; background: #fffaf0; border: 2px dashed var(--laiton); border-radius: 10px; padding: 12px; font-family: ui-monospace, Consolas, monospace; font-size: .9rem; margin: 10px 0; overflow-wrap: anywhere; }
.serie { display: inline-block; background: var(--bordeaux); color: #fff; border-radius: 999px; padding: 2px 12px; font-size: .9rem; font-weight: 700; }
.date-jour { font-family: var(--main); font-size: 1.6rem; color: var(--laiton-clair); margin: -6px 0 2px; }

/* ---------- fin de partie ---------- */
.resultats { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .resultats { grid-template-columns: 1fr; } }
.resultats .mission-img { border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); margin: 10px 0; max-width: 360px; width: 100%; }
.ligne-score { display: flex; justify-content: space-between; border-bottom: 1px dotted #cdb98a; padding: 3px 0; font-variant-numeric: tabular-nums; }
.ligne-score.total { font-weight: 800; font-size: 1.12rem; border-bottom: 0; color: var(--bordeaux); }
.gagnant { text-align: center; margin: 4px 0 16px; }

/* ---------- règles ---------- */
.regles { max-width: 52em; margin: 0 auto; }
.regles li { margin-bottom: .4em; }
.faces { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; margin: 10px 0 18px; }
.face { display: flex; gap: 10px; align-items: flex-start; background: #fffaf0; border-radius: 10px; padding: 10px; border: 1px solid #e0cd9f; }
.face img { width: 44px; height: 44px; object-fit: contain; flex: none; }

/* ---------- modale & toast ---------- */
.modale { position: fixed; inset: 0; background: rgba(6, 22, 16, .7); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modale-boite { max-width: 560px; width: 100%; max-height: 90vh; overflow: auto; }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60;
  background: linear-gradient(180deg, #34597a, #24425e); color: #fff; border: 1.5px solid rgba(234, 209, 154, .7);
  padding: 10px 16px; border-radius: 8px; font-size: .95rem; font-weight: 700; box-shadow: var(--ombre); max-width: calc(100% - 32px); text-align: center;
}

/* ---------- effets de fin de partie (confettis, écran brisé) ---------- */
.effet-toile { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }
body.secousse .ecran { animation: secousse-ecran .45s cubic-bezier(.36, .07, .19, .97); }
@keyframes secousse-ecran {
  0%, 100% { transform: translate(0, 0); }
  15% { transform: translate(-9px, 4px) rotate(-.4deg); }
  30% { transform: translate(8px, -5px) rotate(.4deg); }
  45% { transform: translate(-6px, 3px); }
  60% { transform: translate(5px, -2px); }
  80% { transform: translate(-2px, 1px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.accueil-outils { display: flex; justify-content: flex-end; margin-bottom: -6px; }

/* ================= accueil : d'après la maquette « accueil.jpeg » =================
   Un cadre de bois sombre avec des coins en laiton, le tapis de feutre à l'intérieur,
   le logo sur un parchemin déchiré serti dans un cadre doré, puis 4 boîtes en grille. */
.accueil-page { max-width: 980px; margin: 0 auto; padding-block: 12px 28px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.cadre-bois {
  position: relative; border-radius: 12px; padding: 14px;
  background: linear-gradient(135deg, #6b4528, var(--bois) 30%, var(--bois-fonce) 70%, #4d311c);
  box-shadow: inset 0 1px 0 rgba(255, 220, 170, .25), inset 0 -2px 0 rgba(0, 0, 0, .4), 0 12px 30px rgba(0, 0, 0, .45);
}
.cadre-bois .coin { position: absolute; width: 30px; height: 30px; z-index: 2;
  background: linear-gradient(135deg, var(--laiton-clair), var(--laiton) 45%, var(--laiton-fonce)); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.cadre-bois .coin::after { content: ""; position: absolute; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4cf, var(--laiton-fonce)); }
.coin.hg { top: 0; left: 0; border-radius: 12px 0 14px 0; } .coin.hg::after { top: 7px; left: 7px; }
.coin.hd { top: 0; right: 0; border-radius: 0 12px 0 14px; } .coin.hd::after { top: 7px; right: 7px; }
.coin.bg { bottom: 0; left: 0; border-radius: 0 14px 0 12px; } .coin.bg::after { bottom: 7px; left: 7px; }
.coin.bd { bottom: 0; right: 0; border-radius: 14px 0 12px 0; } .coin.bd::after { bottom: 7px; right: 7px; }
.cadre-feutre {
  position: relative; border-radius: 6px; padding: 26px clamp(14px, 4vw, 34px) 28px; text-align: center;
  background-color: var(--feutre);
  background-image: radial-gradient(ellipse 70% 45% at 50% 0%, var(--lampe), transparent 70%), radial-gradient(ellipse 110% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .5) 100%),
    repeating-linear-gradient(35deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 5px);
  box-shadow: inset 0 0 0 1px rgba(234, 209, 154, .55), inset 0 0 30px rgba(0, 0, 0, .5);
}
.accueil-outils { position: absolute; top: 10px; right: 12px; margin: 0; }
.cadre-logo {
  position: relative; margin: 8px auto 22px; max-width: 560px; padding: 10px; border-radius: 6px;
  background: linear-gradient(135deg, var(--laiton-clair), var(--laiton) 40%, var(--laiton-fonce) 75%, var(--laiton));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 8px 18px rgba(0, 0, 0, .5);
}
.cadre-logo::before, .cadre-logo::after { /* rivets */
  content: ""; position: absolute; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff4cf, var(--laiton-fonce));
}
.cadre-logo::before { left: 2px; } .cadre-logo::after { right: 2px; }
.parchemin-dechire {
  padding: 18px 26px; background: #efdcb3;
  background-image: radial-gradient(ellipse at 30% 20%, rgba(255, 250, 235, .8), transparent 55%), radial-gradient(ellipse at 80% 90%, rgba(150, 105, 50, .35), transparent 60%), radial-gradient(circle at 10% 80%, rgba(150, 105, 50, .25), transparent 30%);
  clip-path: polygon(0% 4%, 6% 0%, 14% 3%, 23% 0%, 33% 2%, 44% 0%, 55% 3%, 66% 0%, 77% 2%, 88% 0%, 96% 3%, 100% 1%, 99% 14%, 100% 30%, 98% 47%, 100% 63%, 99% 80%, 100% 96%, 93% 100%, 82% 97%, 71% 100%, 60% 97%, 49% 100%, 38% 97%, 27% 100%, 16% 97%, 6% 100%, 0% 96%, 1% 79%, 0% 62%, 2% 45%, 0% 28%, 1% 12%);
}
.parchemin-dechire img { width: min(400px, 74vw); margin: 0 auto; }
.accroche-grande { font-family: var(--serif); font-weight: 700; font-size: clamp(1.25rem, 3.4vw, 1.75rem); line-height: 1.3; color: var(--laiton-clair); max-width: 24em; margin: 0 auto 6px; text-shadow: 0 2px 4px rgba(0, 0, 0, .45); }
.ornement { color: var(--laiton); font-size: 1.1rem; letter-spacing: .3em; margin: 0 auto 26px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.ornement::before, .ornement::after { content: ""; height: 1px; width: min(140px, 22vw); background: linear-gradient(90deg, transparent, var(--laiton)); }
.ornement::after { transform: scaleX(-1); }
.grille-accueil { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; text-align: left; }
@media (max-width: 560px) { .grille-accueil { gap: 12px; } }
@media (max-width: 420px) { .grille-accueil { grid-template-columns: minmax(0, 1fr); } }
.grille-accueil .tiroir { padding: 30px 18px 18px; }
.grille-accueil .tiroir h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.15rem, 3vw, 1.45rem); }
.tiroir.pince::before { /* pince de porte-documents au lieu de la poignée */
  width: 54px; height: 16px; margin-left: -27px; top: -6px; border-radius: 4px 4px 8px 8px;
}
.tiroir.pince::after {
  content: ""; position: absolute; top: -14px; left: 50%; width: 16px; height: 12px; margin-left: -8px; border-radius: 8px 8px 0 0;
  border: 3px solid var(--laiton); border-bottom: 0;
}
.carte-plateau {
  display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 10px; color: var(--encre);
  background: var(--parchemin); border: 2px solid var(--bordeaux); box-shadow: var(--ombre);
}
.carte-plateau h3 { margin: 0; color: var(--bordeaux); }
.carte-plateau p { margin: 0; font-size: .95rem; }
.carte-plateau .btn { align-self: flex-start; margin-top: auto; }
.btn.vert { background: linear-gradient(180deg, #2a6450, var(--feutre-clair) 50%, #133d30); color: var(--laiton-clair); border: 2px solid var(--laiton); box-shadow: 0 3px 8px rgba(0, 0, 0, .35); }
.comment-jouer { margin-top: 24px; }

/* ================= en-tête du jeu : petit logo plume blanche, Son et Règles ================= */
.entete .logo-plume { height: 54px; width: auto; cursor: pointer; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.cadre-feutre .accueil-outils { position: static; display: flex; justify-content: flex-end; margin: -12px -6px 4px 0; }
.grille-accueil .btn { font-size: .95rem; line-height: 1.15; padding: 8px 16px; text-align: left; }

/* Cabinet du Conservateur : même boîte que « Votre Cabinet », repliable ; replié, seuls les points restent visibles */
.tete-adv { width: 100%; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; color: inherit; }
.tete-adv[aria-expanded="false"] { margin-bottom: 0; }
.tete-adv .fleche { display: inline-block; margin-left: 4px; transition: transform .2s ease; color: var(--encre-douce); }
.tete-adv[aria-expanded="true"] .fleche { transform: rotate(180deg); }
.tete-adv:hover h3 { text-decoration: underline; text-decoration-color: var(--laiton); }
.tete-adv:focus-visible { outline: 3px solid var(--laiton); outline-offset: 4px; border-radius: 6px; }

/* ================= carrousel des 5 piles ================= */
.carrousel {
  --l: 200px;
  position: relative; perspective: 1100px; touch-action: pan-y; user-select: none; -webkit-user-select: none;
  overflow: hidden; margin: 2px -6px 0; border-radius: 12px; cursor: grab;
}
.carrousel:active { cursor: grabbing; }
.carrousel:focus-visible { outline: 2px solid var(--laiton-clair); outline-offset: 2px; }
.carrousel .pile {
  position: absolute; top: 10px; left: 50%; width: var(--l); transform-origin: 50% 55%;
  will-change: transform, opacity; -webkit-tap-highlight-color: transparent;
}
.carrousel .pile img { -webkit-user-drag: none; pointer-events: none; }
.carrousel .pile .carte .mot { font-size: calc(var(--l) * 0.085); }
.carrousel .pile:not(.au-centre) .socle { box-shadow: 0 6px 14px rgba(0, 0, 0, .45); }
.carrousel .pile.au-centre .socle { box-shadow: 0 10px 26px rgba(0, 0, 0, .55), 0 0 0 1px rgba(234, 209, 154, .35); }
.carrousel .pile.selectionnable { cursor: pointer; }
.carrousel .pile:hover .socle { transform: none; }
.carrousel .pile.selectionnable:hover .socle { transform: translateY(-4px); }
.carrousel-cadre { position: relative; }
.carrousel-nom { margin: 0 0 -4px; text-align: center; font-family: var(--serif); font-weight: 700; font-size: 1.1rem; color: var(--laiton-clair); text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
/* petites flèches discrètes, posées sur les bords du carrousel */
.fleche-carrousel {
  position: absolute; top: 50%; z-index: 20; transform: translateY(-50%);
  width: 28px; height: 52px; padding: 0 0 4px; border: 0; border-radius: 14px; cursor: pointer;
  background: rgba(10, 36, 27, .5); color: var(--creme); opacity: .8;
  font-size: 1.9rem; line-height: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  transition: opacity .15s ease, background .15s ease;
}
.fleche-carrousel.gauche { left: 2px; }
.fleche-carrousel.droite { right: 2px; }
.fleche-carrousel:hover { opacity: 1; background: rgba(10, 36, 27, .7); }
.fleche-carrousel:active { opacity: 1; }
.fleche-carrousel:focus-visible { outline: 2px solid var(--laiton-clair); outline-offset: 2px; opacity: 1; }

/* ================= classement des érudits ================= */
.classement { margin-top: 24px; text-align: left; padding: 18px clamp(14px, 3vw, 24px); }
.classement h2 { text-align: center; color: var(--bordeaux); font-family: var(--serif); font-weight: 700; margin-bottom: 14px; }
.classement-vide { text-align: center; color: var(--encre-douce); margin: 6px 0; }
.classement-note { text-align: center; margin: 10px 0 0; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 8px; max-width: 520px; margin: 0 auto 4px; }
.marche { display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
/* médaillons de cire : les points de l'érudit, comme le sceau du Cabinet en partie */
.sceau-cire { flex: none; width: 62px; height: 62px; display: grid; place-items: center; align-content: center; line-height: 1; margin-bottom: 6px;
  background: url('../medias/medaillon-or.png') center / contain no-repeat; color: #5a3d0c; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
  font-family: var(--chiffres); }
.sceau-cire b { font-size: 1.3rem; font-weight: 800; text-shadow: 0 1px 0 rgba(255, 240, 200, .65); }
.sceau-cire small { font-size: .46rem; font-weight: 800; letter-spacing: .06em; margin-top: 1px; }
.sceau-cire.argent { background-image: url('../medias/medaillon-argent.png'); color: #353a42; }
.sceau-cire.argent b { text-shadow: 0 1px 0 rgba(255, 255, 255, .75); }
.sceau-cire.bronze { background-image: url('../medias/medaillon-bronze.png'); color: #4a230d; }
.sceau-cire.bronze b { text-shadow: 0 1px 0 rgba(255, 220, 185, .6); }
.sceau-cire.long b { font-size: 1rem; }
.m1 .sceau-cire { width: 76px; height: 76px; }
.m1 .sceau-cire b { font-size: 1.6rem; }
.m1 .sceau-cire.long b { font-size: 1.2rem; }
.m1 .sceau-cire small { font-size: .52rem; }
.podium-nom { font-family: var(--serif); font-weight: 700; font-size: 1.02rem; line-height: 1.15; overflow-wrap: anywhere; max-width: 100%; }
.podium-parties { font-size: .78rem; color: var(--encre-douce); margin: 2px 0 6px; }
/* les colonnes du podium : or, argent et bronze polis, le rang gravé dans le métal */
.estrade { position: relative; display: grid; place-items: center; width: 100%; border-radius: 7px 7px 0 0;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .6), inset 0 -12px 16px rgba(0, 0, 0, .16), 0 3px 6px rgba(40, 25, 5, .3); }
.estrade::before { content: ""; position: absolute; inset: 0 0 auto; height: 7px; border-radius: 7px 7px 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); }
.estrade-rang { font: 800 2rem/1 var(--chiffres); color: rgba(0, 0, 0, .3); text-shadow: 0 1px 0 rgba(255, 255, 255, .55); }
.m1 .estrade { height: 92px; background: linear-gradient(90deg, #8a6014 0%, #d6a534 17%, #fbe6a0 36%, #ecc35a 52%, #c0902e 74%, #7a540e 100%); }
.m2 .estrade { height: 68px; background: linear-gradient(90deg, #666c75 0%, #aeb4bc 17%, #f6f8fa 36%, #d0d4da 52%, #9aa0a9 74%, #5c626b 100%); }
.m3 .estrade { height: 50px; background: linear-gradient(90deg, #5a2c12 0%, #ab6435 17%, #f2bd8e 36%, #d18c56 52%, #9b5a2c 74%, #552a10 100%); }
.m1 .estrade-rang { font-size: 2.6rem; }
.marche.libre { opacity: .45; }
.marche.libre .sceau-cire { filter: grayscale(.6); }
.marche.moi .podium-nom, .classement-liste li.moi .nom { color: var(--feutre-clair); text-decoration: underline; text-decoration-color: var(--laiton); }
/* places 4 et 5 : une simple liste, sans zone de défilement (elle bloquait le défilement de la page sur téléphone) */
.classement-liste { list-style: none; margin: 14px 0 0; padding: 0; border-top: 1px solid #dccaa0; }
.classement-liste li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 4px; border-bottom: 1px dotted #d8c59a; }
.classement-liste .rang { font-family: var(--titre); font-size: 1.05rem; color: var(--encre-douce); text-align: right; font-variant-numeric: tabular-nums; }
.classement-liste .nom { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.classement-liste .nom small { display: block; font-weight: 400; font-size: .78rem; color: var(--encre-douce); }
.classement-liste .pts { font-weight: 800; color: var(--bordeaux); white-space: nowrap; font-variant-numeric: tabular-nums; }
.classement-tout { display: block; margin: 14px auto 0; }
/* le tableau des 50 premiers (fenêtre) */
.classement-fenetre { padding-top: 0; } /* sinon l'en-tête collé du tableau s'arrête sous la marge du haut */
.classement-fenetre h2 { color: var(--bordeaux); text-align: center; margin: 18px 0 4px; }
.classement-fenetre > .classement-complet > .petit { text-align: center; margin: 0 0 10px; }
.classement-complet .btn { display: block; margin: 14px auto 0; }
.classement-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.classement-table th { position: sticky; top: 0; z-index: 1; background: #efe0bd; box-shadow: 0 3px 4px -2px rgba(60, 40, 10, .25); color: var(--encre-douce); font-size: .78rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; text-align: left; padding: 7px 8px; border-bottom: 2px solid var(--laiton); }
.classement-table td { padding: 6px 8px; border-bottom: 1px dotted #d8c59a; vertical-align: middle; }
.classement-table .num { text-align: right; white-space: nowrap; }
.classement-table td.rang { width: 52px; text-align: center; font: 800 1rem var(--chiffres); color: var(--encre-douce); }
.classement-table td.nom { font-weight: 700; overflow-wrap: anywhere; }
.classement-table td.pts { font-family: var(--chiffres); font-weight: 800; color: var(--bordeaux); }
.classement-table tr.or td { background: linear-gradient(90deg, rgba(236, 195, 90, .32), rgba(236, 195, 90, .08)); }
.classement-table tr.argent td { background: linear-gradient(90deg, rgba(174, 180, 188, .36), rgba(174, 180, 188, .08)); }
.classement-table tr.bronze td { background: linear-gradient(90deg, rgba(209, 140, 86, .3), rgba(209, 140, 86, .07)); }
.sceau-cire.mini { width: 36px; height: 36px; margin: 0 auto; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.sceau-cire.mini b { font-size: .95rem; }

/* fin de partie : inscription au classement */
.inscription { margin-top: 16px; }
.inscription h2 { color: var(--bordeaux); }
.inscription label { display: block; font-weight: 700; margin-bottom: 6px; }
.champ-pseudo { display: flex; flex-wrap: wrap; gap: 10px; }
.champ-pseudo input {
  flex: 1 1 220px; min-width: 0; min-height: 46px; padding: 8px 14px; border-radius: 10px; font: inherit; font-size: 1.05rem;
  border: 1.5px solid #cdb27a; background: #fffaf0; color: var(--encre);
}
.champ-pseudo input:focus { outline: 3px solid var(--laiton); outline-offset: 1px; }
.erreur-pseudo { color: var(--faux); font-weight: 700; margin: 8px 0 0; }
.inscription-bravo { font-size: 1.1rem; }

/* ================= duel entre amis ================= */
.duels-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
@media (max-width: 820px) { .duels-grille { grid-template-columns: minmax(0, 1fr); } }
.form-duel { display: grid; gap: 10px; }
.form-duel label { font-weight: 700; }
.champ-texte {
  min-height: 46px; padding: 8px 14px; border-radius: 10px; font: inherit; font-size: 1.05rem; width: 100%;
  border: 1.5px solid #cdb27a; background: #fffaf0; color: var(--encre);
}
.champ-texte:focus { outline: 3px solid var(--laiton); outline-offset: 1px; }
.choix-impose { border: 0; margin: 4px 0 0; padding: 0; min-width: 0; }
.choix-impose legend { font-weight: 700; padding: 0; }
.choix-impose .petit { margin: 2px 0 8px; }
.impose-grille { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.impose { position: relative; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; cursor: pointer;
  border: 2px solid #e0cd9f; background: #fffaf0; font-weight: 700; font-size: .95rem; }
.impose input { position: absolute; opacity: 0; pointer-events: none; }
.impose img { width: 30px; height: 30px; object-fit: contain; flex: none; }
.impose:has(input:checked) { border-color: var(--bordeaux); background: #f8e7d7; box-shadow: inset 0 0 0 1px var(--bordeaux); }
.impose:has(input:focus-visible) { outline: 3px solid var(--laiton); outline-offset: 2px; }
.liste-duels { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.liste-duels li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 10px; background: #fffaf0; border: 1px solid #e0cd9f; }
.liste-duels li.a-moi { border-color: var(--bordeaux); box-shadow: inset 4px 0 0 var(--bordeaux); }
.liste-duels li.fini { opacity: .8; }
.liste-duels strong { display: block; }
.badge-duel { font-size: .88rem; color: var(--encre-douce); }
.a-moi .badge-duel { color: var(--bordeaux); font-weight: 800; }
.lien-discret { background: none; border: 0; padding: 4px; color: var(--encre-douce); text-decoration: underline; cursor: pointer; font-size: .85rem; }
.invitation { max-width: 640px; margin: 0 auto; }
.invitation h1 { color: var(--bordeaux); }

/* notifications et installation */
.carte-alertes { margin: 0 0 16px; }
.carte-alertes p { margin: 0 0 10px; }
.alerte-ok { color: var(--juste); font-weight: 700; }
.cote .carte-alertes { margin: 0; }


/* ---------- le Décideur applaudit (écran de victoire) ---------- */
.decideur-bravo { margin: 4px auto 18px; max-width: 420px; text-align: center; animation: decideur-entree .7s cubic-bezier(.2, 1.3, .4, 1) both .2s; }
.decideur-bravo .ecran-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--bois-fonce);
  border: 3px solid var(--laiton); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 10px 26px rgba(0, 0, 0, .45); }
.decideur-bravo video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.decideur-bravo .histoire.finie { visibility: hidden; }
.decideur-bravo figcaption { font-family: var(--main); font-size: 1.5rem; font-weight: 700; color: var(--laiton-clair); margin-top: 6px; text-shadow: 0 2px 3px rgba(0, 0, 0, .45); }
@keyframes decideur-entree { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .decideur-bravo { animation: none; } }

/* ---------- niveaux (au-dessus du carrousel, partie contre le Conservateur) ---------- */
.niveaux { display: flex; justify-content: center; gap: 6px; margin: 0 auto 8px; padding: 4px; width: fit-content; max-width: 100%;
  border-radius: 999px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35); }
.niveau { font: 700 .9rem var(--texte); color: var(--creme); background: none; border: 1.5px solid transparent; border-radius: 999px;
  padding: 6px 14px; cursor: pointer; white-space: nowrap; transition: background .15s ease, color .15s ease; }
.niveau:hover { background: rgba(255, 255, 255, .08); }
.niveau.actif { background: linear-gradient(180deg, #e6c678, var(--laiton)); color: var(--encre); border-color: #f1dca2; box-shadow: 0 2px 5px rgba(0, 0, 0, .35); }
.niveau.verrouille { opacity: .45; cursor: not-allowed; filter: grayscale(1); }
.niveau.verrouille:hover { background: none; }
.niveau-debloque { text-align: center; font-family: var(--main); font-size: 1.7rem; font-weight: 700; color: var(--laiton-clair); margin: 0 0 14px;
  text-shadow: 0 2px 3px rgba(0, 0, 0, .45); animation: decideur-entree .7s cubic-bezier(.2, 1.3, .4, 1) both .9s; }
@media (max-width: 420px) { .niveau { padding: 6px 11px; font-size: .85rem; } }

/* ---------- choix du niveau en début de partie ---------- */
.niveaux-depart { display: grid; gap: 8px; margin-top: 10px; }
.niveau-depart { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: 10px; border: 1.5px solid #c9b483; background: #fffaf0; color: var(--encre); font: inherit; }
.niveau-depart strong { font-family: var(--titre); font-size: 1.2rem; font-weight: 400; }
.niveau-depart span { font-size: .9rem; color: var(--encre-douce); }
.niveau-depart:hover:not(:disabled) { border-color: var(--laiton); background: #fff6e0; }
.niveau-depart.actif { border-color: var(--laiton); box-shadow: 0 0 0 2px var(--laiton) inset; }
.niveau-depart:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(1); }

/* ---------- le mot à gratter : la carte flotte devant le cabinet flouté ---------- */
.gratter-page { position: relative; min-height: 100vh; min-height: calc(100dvh - 46px); overflow: hidden; isolation: isolate; display: flex; flex-direction: column; }
.gratter-fond { position: fixed; inset: -20px; z-index: -1; background: var(--fond) 58% center / cover no-repeat #24170c;
  filter: blur(2.5px) saturate(1.05) brightness(.72); }
/* écran en hauteur (téléphone) : le cabinet entier en bas, sous la carte, plutôt qu'un gros plan sur le visage */
@media (max-aspect-ratio: 4/5) {
  .gratter-fond { background: linear-gradient(180deg, #24170c 0%, #24170c 44%, rgba(36, 23, 12, 0) 62%), var(--fond) 58% 100% / auto 52% no-repeat, #24170c; }
  .gratter-scene { place-items: start center; padding-top: 6vh; }
}
.gratter-fond::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, rgba(255, 226, 160, .12), rgba(6, 22, 16, .55) 75%); }
.gratter-titre { text-align: center; margin: 4px 0 0; color: var(--laiton-clair); text-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.gratter-scene { flex: 1; display: grid; place-items: center; padding: 20px 8px 10px; perspective: 1100px; touch-action: pan-y; }
.carte-mystere { --rx: 0deg; --ry: 0deg; width: min(520px, 74vw); aspect-ratio: 800 / 600; perspective: 1400px; cursor: pointer;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s ease-out; touch-action: none;
  animation: carte-flotte 5s ease-in-out infinite; outline: none; }
.carte-mystere.au-verso { animation: none; transform: none; }
.carte-mystere .faces { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.4s cubic-bezier(.35, 1.2, .4, 1); }
.carte-mystere .faces.retournee { transform: rotateY(180deg); }
.face-carte { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  box-shadow: 0 2px 0 rgba(255, 255, 255, .5) inset, 0 24px 48px rgba(0, 0, 0, .55), 0 6px 14px rgba(0, 0, 0, .35); background: #f3f1ec; }
.face-carte.verso { transform: rotateY(180deg); }
.face-carte img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-select: none; pointer-events: none; }
.couche-gratter { position: absolute; transition: opacity .9s ease; }
.couche-gratter.effacee { opacity: 0; }
.carte-mystere:focus-visible .face-carte { box-shadow: 0 0 0 3px var(--laiton-clair), 0 24px 48px rgba(0, 0, 0, .55); }
@keyframes carte-flotte {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}
.gratter-aide { text-align: center; max-width: 30em; margin: 6px auto 14vh; padding: 0 16px; color: var(--creme); font-family: var(--serif); font-style: italic; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
@media (prefers-reduced-motion: reduce) { .carte-mystere { animation: none; } }

/* ================= accueil (maquette « accueil v2 ») ================= */
.acc-page { position: relative; isolation: isolate; min-height: 100vh; min-height: calc(100dvh - 46px);
  padding: 54px max(12px, env(safe-area-inset-right, 0px)) 18px max(12px, env(safe-area-inset-left, 0px)); }
.acc-fond { position: fixed; inset: 0; z-index: -1; background: var(--fond) center / cover no-repeat #1c4a44; }
.acc-fond::after { content: ""; position: absolute; inset: 0; background: rgba(12, 44, 40, var(--voile-fond)); }
/* au chargement de l'accueil, AVANT que le script dessine la page : déjà la carte ancienne, au même rendu que .acc-fond
   (sinon on voit d'abord le feutre vert et sa lueur de lampe en haut, puis la carte arrive : un saut à chaque rechargement).
   La classe est posée par un petit script dans <head> et retirée dès qu'on quitte l'accueil. */
/* (24/11) le fond de l'accueil sur TOUS les écrans, jeu compris : il s'y glissait parfois, il y reste désormais. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(12, 44, 40, var(--voile-fond)), rgba(12, 44, 40, var(--voile-fond))), url('../medias/accueil/fond.jpg') center / cover no-repeat #1c4a44; }
.acc-cadre { position: relative; max-width: 760px; margin: 0 auto; border-radius: 22px; background: linear-gradient(180deg, #245545, #1b4234);
  box-shadow: 0 0 0 1px rgba(234, 209, 154, .35), 0 18px 44px rgba(0, 0, 0, .45); }
.acc-tete { position: relative; text-align: center; padding: 112px 18px 34px; color: var(--encre);
  background: #f8efdb; border-radius: 22px 22px 50% 50% / 22px 22px 36px 36px; }
.acc-plaque { position: absolute; left: 50%; top: -40px; transform: translateX(-50%); width: min(190px, 46%); height: auto; border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .4), 0 1px 0 rgba(255, 255, 255, .4) inset; }
.acc-accroche { font-family: var(--serif); font-weight: 500; font-size: clamp(1.15rem, 4.2vw, 1.6rem); line-height: 1.25; margin: 0 auto; max-width: 22em; text-wrap: balance; }
.acc-corps { display: grid; gap: 14px; padding: 16px 14px 18px; }

.acc-tuile { font: inherit; text-align: left; cursor: pointer; color: #fdf6e3; border-radius: 14px; border: 1px solid rgba(234, 209, 154, .55);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .12); transition: transform .12s ease; padding: 0; overflow: hidden; }
.acc-tuile:active { transform: scale(.985); }
.acc-titre { display: block; font-family: var(--serif); font-weight: 700; font-size: clamp(1.25rem, 4.6vw, 1.75rem); line-height: 1.12; color: #fff8e8; }
.acc-desc { display: block; font-size: clamp(.92rem, 3.2vw, 1.05rem); line-height: 1.3; margin-top: 5px; color: #efe4c8; }
.acc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 8px 18px; border-radius: 999px; text-decoration: none; cursor: pointer;
  font-family: var(--serif); font-weight: 700; font-size: 1.12rem; color: #2a1d12;
  background: linear-gradient(180deg, #f0d07c, #dcb65a); box-shadow: 0 3px 0 #a5843a, 0 6px 12px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .5); }
.acc-grande { display: grid; grid-template-columns: minmax(0, 41%) minmax(0, 1fr); align-items: stretch; background: linear-gradient(160deg, #2a614e, #174032); }
.acc-bureau { width: 100%; height: 100%; min-height: 150px; object-fit: cover; object-position: 30% 60%; display: block; }
.acc-grande .acc-texte { display: flex; flex-direction: column; justify-content: center; gap: 4px; padding: 16px 16px 18px 14px; }
.acc-grande .acc-btn { margin-top: 12px; }
.acc-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.acc-petite { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; padding: 14px; }
.acc-duel { background: linear-gradient(160deg, #2b436e, #1c2c4d); }
.acc-gratter { background: linear-gradient(160deg, #8a5f2e, #654420); }
.acc-chapeau { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: start; }
.acc-chapeau img { width: 56px; height: auto; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.acc-petite .acc-titre { font-size: clamp(1.05rem, 3.9vw, 1.4rem); }
.acc-petite .acc-desc { font-size: clamp(.85rem, 3vw, 1rem); }
@media (max-width: 480px) {
  .acc-chapeau { grid-template-columns: 1fr; }
  .acc-chapeau img { width: 46px; }
  .acc-petite { padding: 12px 10px; }
  .acc-btn { font-size: 1rem; padding: 8px 10px; }
}
.acc-plateau { border-radius: 14px; overflow: hidden; background: #f8efdb; color: var(--encre); border: 1px solid rgba(234, 209, 154, .55); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); }
.acc-plateau > img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 7; object-fit: cover; object-position: center 55%; }
.acc-plateau-texte { padding: 14px 16px 16px; }
.acc-plateau h3 { font-family: var(--serif); font-weight: 700; font-size: 1.45rem; color: var(--encre); margin: 0 0 4px; }
.acc-plateau p { margin: 0 0 12px; font-size: 1.05rem; }
.acc-classement { border-radius: 14px; margin: 0; }

/* barre de navigation du bas : discrète, basse, présente sur toutes les pages */
.acc-barre { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 2px max(8px, env(safe-area-inset-right, 0px)) calc(2px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: rgba(13, 38, 30, .82); border-top: 1px solid rgba(234, 209, 154, .22);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.acc-onglet { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 4px 2px 3px; border: 0; background: none; cursor: pointer;
  font: 600 .66rem var(--texte); letter-spacing: .02em; color: rgba(239, 228, 200, .62); text-decoration: none; }
.acc-onglet svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.acc-onglet .barre-coupe { display: none; }
.acc-onglet.coupe .ondes { display: none; }
.acc-onglet.coupe .barre-coupe { display: inline; }
.acc-onglet.actif { color: var(--laiton-clair); }
.acc-onglet:hover { color: var(--creme); }
#app { padding-bottom: calc(46px + env(safe-area-inset-bottom, 0px)); }
.toast { bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }

/* ================= la carte en main (question) et ses envols ================= */
.scene:has(.scene-boite.nue) { display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; }
.scene-boite.nue { width: min(430px, 100%); max-height: none; overflow: visible; margin: auto; }
.scene.s-efface { opacity: 0; pointer-events: none; transition: opacity .45s ease; }
.main-carte { perspective: 1400px; animation: carte-flotte 6s ease-in-out infinite; }
.main-faces { display: grid; transform-style: preserve-3d; transition: transform 1s cubic-bezier(.35, 1.15, .4, 1); }
.main-carte.vif .main-faces { transition-duration: .8s; }
.main-carte.sans-anim .main-faces { transition: none; }
.main-faces.retournee { transform: rotateY(180deg); }
.main-face { grid-area: 1 / 1; min-width: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.main-recto { align-self: center; justify-self: center; width: min(290px, 76%); }
.main-recto .carte { box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 26px 50px rgba(0, 0, 0, .6), 0 8px 16px rgba(0, 0, 0, .4); }
.main-faces.retournee .main-recto { pointer-events: none; }
.main-verso { position: relative; transform: rotateY(180deg); pointer-events: none; overflow: hidden; border-radius: 14px;
  background: #efe2c0 center / 100% 100% no-repeat; color: #1d140b; padding: 12px 14px 16px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 26px 50px rgba(0, 0, 0, .6), 0 8px 16px rgba(0, 0, 0, .4); }
.main-faces.retournee .main-verso { pointer-events: auto; }
.verso-rarete { position: absolute; top: 0; right: 0; width: 15.5%; padding: 2.2% 0 0 3.5%; text-align: center; color: #fff;
  font: italic 500 clamp(1.9rem, 8.5vw, 2.7rem) / 1 var(--serif); }
.verso-titre { text-align: center; padding: 0 15% 0; min-height: 62px; }
.verso-titre strong { display: block; font: 700 clamp(1.45rem, 6.4vw, 2rem) / 1.05 var(--serif); text-shadow: 0 2px 3px rgba(0, 0, 0, .22); overflow-wrap: anywhere; }
.verso-titre em { display: block; font: 600 1.3rem / 1.05 var(--main); font-style: normal; margin-top: 2px; }
.verso-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 8px; }
.verso-epreuve { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font: 700 1.1rem / 1.1 var(--serif); }
.verso-epreuve img { width: 46px; height: 46px; object-fit: contain; margin-left: 8px; }
.main-verso .chrono::before { background: #f1e5c6; }
.main-verso .option { background: rgba(255, 251, 240, .8); border-color: rgba(70, 48, 22, .4); }
.main-verso .option.juste { background: #dff0e3; border-color: var(--juste); }
.main-verso .option.faux { background: #f8ddd8; border-color: var(--faux); }
.main-verso .affirmation { margin: 0 0 10px; }
.main-verso .verdict { margin-top: 10px; padding: 8px 12px; }
.main-verso .verification { color: #4a3a22; }
.scene-boite.nue.alerte { animation: tremble-doux var(--vitesse, .5s) linear infinite; box-shadow: none; }
.scene-boite.nue.alerte .main-verso { box-shadow: 0 0 calc(var(--rouge, .2) * 46px) calc(var(--rouge, .2) * 10px) rgba(217, 54, 43, calc(var(--rouge, .2) * .85)), 0 26px 50px rgba(0, 0, 0, .6); }

.carte-volante { position: fixed; z-index: 80; margin: 0; pointer-events: none; transition: filter .8s ease, box-shadow .8s ease; }
.carte-volante.doree { filter: brightness(1.12) saturate(1.12);
  box-shadow: 0 0 0 3px #f3d680, 0 0 38px 14px rgba(255, 205, 96, .8), 0 18px 40px rgba(0, 0, 0, .5); animation: dore-pulse 1s ease; }
.carte-volante.sombre { filter: brightness(.36) grayscale(.6); box-shadow: 0 10px 22px rgba(0, 0, 0, .6); }
@keyframes dore-pulse { 0% { scale: 1; } 45% { scale: 1.08; } 100% { scale: 1; } }
.carte.mini.arrive { animation: carte-arrive .8s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes carte-arrive { 0% { transform: scale(1.28); box-shadow: 0 0 0 2px #f3d680, 0 0 18px 6px rgba(255, 205, 96, .7); } 100% { transform: none; } }
/* carrousel : des piles plus épaisses */
/* carrousel : plus de cadre de couleur autour de la carte ; dessous, de vraies cartes empilées, un peu décalées */
.carrousel .pile .socle { padding: 0; border: 0; border-radius: 9px; background: none; isolation: isolate; }
.carrousel .pile .socle::before, .carrousel .pile .socle::after {
  content: ""; position: absolute; inset: 0; border-radius: 9px; z-index: -1;
  background: linear-gradient(160deg, #fbf3df, #e9d9b1); border: 1.5px solid #fbf3df;
  box-shadow: 0 0 0 1px rgba(42, 29, 18, .45), 0 4px 10px rgba(0, 0, 0, .35); }
.carrousel .pile .socle::before { transform: translate(7px, 9px) rotate(3deg); }
.carrousel .pile .socle::after { transform: translate(-5px, 6px) rotate(-2.5deg); }
.carrousel .pile.vide .socle::before, .carrousel .pile.vide .socle::after { display: none; }
@media (prefers-reduced-motion: reduce) { .main-carte { animation: none; } }

/* le verso garde exactement les dimensions du recto : la carte ne change pas de taille en se retournant */
.scene-boite.nue { width: min(300px, 80vw); }
.main-recto { width: 100%; align-self: stretch; }
.main-verso { align-self: stretch; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 8px 9px 10px; border-radius: 9px; }
.main-verso .verso-rarete { font-size: 1.7rem; }
.main-verso .verso-titre { min-height: 0; padding: 0 17% 0 6%; }
.main-verso .verso-titre strong { font-size: 1.2rem; }
.main-verso .verso-titre em { font-size: 1.02rem; }
.main-verso .verso-ligne { margin: 2px 0 5px; }
.main-verso .verso-epreuve { font-size: .9rem; }
.main-verso .verso-epreuve img { width: 30px; height: 30px; margin-left: 4px; }
.main-verso .chrono { width: 44px; height: 44px; }
.main-verso .chrono span { font-size: 1.1rem; }
.main-verso .options { gap: 5px; }
.main-verso .option { padding: 6px 8px; font-size: .82rem; line-height: 1.22; }
.main-verso .affirmation { font-size: .9rem; margin: 0 0 6px; }
.main-verso .verdict { margin-top: 6px; padding: 6px 8px; font-size: .85rem; }
.main-verso .verdict strong { font-size: 1.25rem; }
.main-verso .suite { margin-top: 8px !important; gap: 6px; flex-wrap: wrap; }
.main-verso .suite .btn { padding: 6px 12px; font-size: .9rem; min-height: 36px; }

/* téléphone : le bandeau crème de l'accueil plus discret */
@media (max-width: 600px) {
  .acc-tete { padding: 86px 16px 18px; border-radius: 22px 22px 50% 50% / 22px 22px 18px 18px; }
  .acc-plaque { width: min(150px, 42%); top: -34px; }
  .acc-accroche { font-size: 1.05rem; }
}
.acc-details { display: block; margin-top: 6px; font-size: clamp(.78rem, 2.8vw, .9rem); line-height: 1.3; color: var(--laiton-clair); font-style: italic; }

/* ---------- tour de l'adversaire : une bulle en haut, la carte en main dessous ---------- */
.bulle-tour { position: relative; display: flex; align-items: center; gap: 10px; margin: 0 auto 24px; padding: 6px 14px 6px 6px; width: fit-content; max-width: 100%;
  border-radius: 999px; background: #f8efdb; color: var(--encre); border: 1.5px solid var(--laiton); box-shadow: 0 6px 16px rgba(0, 0, 0, .45); z-index: 2; animation: bulle-arrive .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.bulle-tour::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg);
  background: #f8efdb; border-right: 1.5px solid var(--laiton); border-bottom: 1.5px solid var(--laiton); }
.bulle-de { flex: none; width: 46px; height: 46px; display: grid; place-items: center; }
.bulle-de .de { width: 42px; height: 42px; }
.bulle-de .de3d { width: 58px; height: 58px; margin: -6px; }
.bulle-texte { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.bulle-texte strong { font-family: var(--serif); font-size: 1.05rem; color: var(--bordeaux); }
.bulle-texte span { font-size: .88rem; color: var(--encre-douce); }
@keyframes bulle-arrive { from { opacity: 0; transform: translateY(-10px) scale(.92); } to { opacity: 1; transform: none; } }
/* fin de partie (solo et duel) : plus de logo en haut à gauche, le titre ouvre la page */
.ecran-fin { padding-top: 22px; }
/* la bulle, en plus grand et posée sur le haut de la carte : sa pointe mord sur le cadre, l'ensemble fait bloc ;
   l'état (« Il réfléchit… ») écrit à la main, comme une pensée ; une ombre plus marquée pour la détacher du fond flouté */
.bulle-tour { gap: 12px; margin: 0 auto 2px; padding: 8px 24px 8px 8px; min-width: min(100%, 250px); z-index: 5;
  box-shadow: 0 14px 30px rgba(0, 0, 0, .6), 0 3px 8px rgba(0, 0, 0, .4), 0 0 0 4px rgba(248, 239, 219, .14); }
.bulle-tour::after { bottom: -9px; width: 18px; height: 18px; margin-left: -9px; }
.bulle-de { width: 58px; height: 58px; }
.bulle-de .de { width: 52px; height: 52px; }
.bulle-de .de3d { width: 72px; height: 72px; margin: -7px; }
.bulle-texte { gap: 3px; }
.bulle-texte strong { font-size: 1.25rem; line-height: 1.1; }
.bulle-texte span { font-family: var(--main); font-weight: 700; font-size: 1.35rem; line-height: 1; color: var(--encre); }
.bulle-choix { margin: 0 auto 14px; padding: 10px 12px; border-radius: 12px; background: #f8efdb; color: var(--encre); box-shadow: 0 6px 16px rgba(0, 0, 0, .45); text-align: center; }
.bulle-choix p { margin: 0 0 8px; font-family: var(--serif); font-weight: 700; color: var(--bordeaux); }

/* le lancer : le dé glisse de sa place (un peu à gauche) vers le centre et grossit légèrement */
.lancer-de.en-cours > .de3d-place, .lancer-de.en-cours > .de { animation: de-au-centre .45s cubic-bezier(.2, 1.2, .4, 1) both; }
.lancer-de.en-cours > .de3d-place { scale: 1.22; }
.lancer-de.en-cours > .de { scale: 1.15; }
/* le dé part de sa place, à droite de la phrase, pour venir au centre */
@keyframes de-au-centre { from { translate: 88px 0; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .lancer-de.en-cours > .de3d-place, .lancer-de.en-cours > .de { animation: none; } }

/* lancer le dé à la main */
.lancer-de:not(.en-cours) { touch-action: none; }
.lancer-de .de3d-place { will-change: transform; }
.lancer-de:not(.en-cours) .de3d-place { cursor: grab; }
.lancer-de.en-main .de3d-place { cursor: grabbing; transition: none; filter: drop-shadow(0 14px 12px rgba(0, 0, 0, .45)); }
.lancer-de.en-main .lancer-texte, .lancer-de.en-main .lancer-fleche { opacity: 0; transition: opacity .2s ease; }
.lancer-de.en-main .de3d { animation: none; }
.lancer-de.en-cours.lance-main > .de3d-place { animation: none; }
.barre:has(> .lancer-de) { overflow: visible; }

/* ---------- les deux Cabinets côte à côte, et la fenêtre qui zoome dessus ---------- */
.cabinets-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cab-mini { display: block; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; padding: 9px 9px 10px; transition: transform .2s ease, box-shadow .2s ease; }
.cab-mini:hover { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--laiton-clair), 0 10px 22px rgba(0, 0, 0, .35); }
.cab-mini:active { transform: scale(.98); }
.cab-mini .tete { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; margin-bottom: 7px; }
.cab-mini h3 { margin: 0; padding-right: 30px; font-size: 1.15rem; line-height: 1.1; }
.cab-mini .cabinet { gap: 4px; }
.cab-mini .slot-vide { font-size: .6rem; min-height: 46px; padding: 2px; }
.cab-mini .carte.mini .legende { display: none; }
.cab-mini .carte.mini .sceau { width: 18px; height: 18px; top: 2px; right: 2px; }
.cab-mini .carte.mini .sceau b { font-size: .62rem; }
.cab-adv { background: linear-gradient(180deg, #f1e3c4, #e6d3a8); }
.cab-mini { position: relative; }
.cab-sceau { flex: none; width: 46px; height: 46px; display: grid; place-items: center; align-content: center; line-height: 1;
  background: url('../medias/medaillon-or.png') center / contain no-repeat; color: #5a3d0c; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35));
  font-family: "Alegreya Sans", system-ui, sans-serif; }
/* le médaillon des points, posé à cheval sur le coin de l'encart */
.cab-mini .cab-sceau { position: absolute; top: -12px; right: -10px; }
.cab-sceau b { font-size: 1.15rem; font-weight: 800; text-shadow: 0 1px 0 rgba(255, 240, 200, .6); }
.cab-sceau small { font-size: .42rem; font-weight: 800; letter-spacing: .06em; margin-top: 1px; }
.cab-sceau.grand { width: 60px; height: 60px; }
.cab-sceau.grand b { font-size: 1.55rem; }
.cab-sceau.grand small { font-size: .52rem; }
.mission-zone { padding: 10px 12px; }
.mission-zone .mission-mini { margin-top: 0; }
@media (max-width: 420px) { .cab-mini h3 { font-size: 1.05rem; } .cab-mini .cab-sceau { width: 42px; height: 42px; } }

.modale-boite.cab-fenetre { position: relative; max-width: 520px; animation: cab-zoom-entree .45s cubic-bezier(.2, 1.15, .4, 1) both; }
.cab-zoom-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 34px 12px 0; }
.cab-zoom-tete h2 { margin: 0; }
.cab-zoom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cab-zoom-place { min-width: 0; animation: cab-carte-entree .5s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc(.08s + var(--i) * .07s); }
.cab-zoom-place .slot-vide { aspect-ratio: 459 / 615; display: grid; place-items: center; }
.cab-zoom-place .carte { box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 8px 18px rgba(0, 0, 0, .35); }
@keyframes cab-zoom-entree { from { opacity: 0; transform: scale(.82) translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes cab-carte-entree { from { opacity: 0; transform: scale(.7) translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .modale-boite.cab-fenetre, .cab-zoom-place { animation: none; } }

/* les chiffres : une police lisible (le « 1 » de la police d'apparat ressemblait à un « I ») */
:root { --chiffres: "Alegreya Sans", system-ui, sans-serif; }
.sceau b, .chrono span, .score, .classement-liste .rang, .ligne-score span:last-child, .verso-rarete { font-family: var(--chiffres); font-weight: 800; font-style: normal; }
.sceau small { font-family: var(--texte); }
/* une petite icône « agrandir » apparaît au survol d'un Cabinet, à la place de la loupe */
.cab-mini::after { content: ""; position: absolute; left: 8px; bottom: 8px; width: 22px; height: 22px; border-radius: 6px; opacity: 0; transform: scale(.8);
  transition: opacity .2s ease, transform .2s ease; background: rgba(31, 76, 60, .9) center / 14px no-repeat
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8efdb' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7'/%3E%3C/svg%3E"); }
.cab-mini:hover::after, .cab-mini:focus-visible::after { opacity: 1; transform: none; }

/* sur la carte en main : « Continuer » / « À vous ! » prend toute la largeur disponible (le bouton audio reste à côté) */
.main-verso .suite { display: flex; flex-wrap: wrap; align-items: stretch; }
.main-verso .suite .btn.suivant { flex: 1 1 120px; justify-content: center; text-align: center; }

/* ---- tuile « Défier le Conservateur » : le portrait du Conservateur, et un dé qui dépasse du bouton « Jouer » ---- */
.acc-grande { overflow: visible; }
.acc-portrait { position: relative; display: block; min-height: 170px; overflow: hidden; border-radius: 13px 0 0 13px; }
.acc-portrait img, .acc-portrait video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 72% 30%; display: block; }
/* fondu du portrait vers le vert de la tuile */
.acc-portrait::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 62%, rgba(23, 64, 50, .85)); }
.acc-btn-de { position: relative; padding-right: 54px; }
.acc-de { position: absolute; right: -8px; top: 50%; width: 62px; height: auto; transform: translateY(-58%) rotate(-12deg);
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .45)); transition: transform .25s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; }
.acc-grande:hover .acc-de { transform: translateY(-64%) rotate(-24deg) scale(1.06); }
.acc-grande:active .acc-de { transform: translateY(-58%) rotate(8deg) scale(.96); }
/* téléphone : le portrait en bandeau au-dessus du texte, le visage bien visible */
@media (max-width: 600px) {
  .acc-grande { grid-template-columns: minmax(0, 1fr); }
  .acc-portrait { height: 230px; min-height: 0; border-radius: 13px 13px 0 0; }
  .acc-portrait img, .acc-portrait video { object-position: 78% 28%; }
  .acc-portrait::after { background: linear-gradient(180deg, transparent 55%, rgba(23, 64, 50, .95)); }
  .acc-grande .acc-texte { padding: 4px 16px 20px; margin-top: -26px; position: relative; text-align: center; align-items: center; }
  .acc-grande .acc-titre { font-size: 1.8rem; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
  .acc-grande .acc-desc { font-size: 1.12rem; line-height: 1.32; }
  .acc-grande .acc-btn { width: 100%; margin-top: 14px; }
  .acc-de { width: 66px; right: 2px; }
}
@media (min-width: 601px) { .acc-grande .acc-desc { font-size: 1.12rem; } .acc-portrait { min-height: 200px; } }

/* revoir une carte gagnée : on la touche pour la retourner sur son QCM, la bonne réponse en vert */
.cab-zoom-carte { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 9px; transition: transform .2s ease; }
.cab-zoom-carte:hover { transform: translateY(-3px) rotate(-1deg); }
.modale-boite.revue-fenetre { width: min(310px, 84vw); max-width: none; background: none; border: 0; box-shadow: none; padding: 0; overflow: visible; text-align: center;
  animation: cab-zoom-entree .45s cubic-bezier(.2, 1.15, .4, 1) both; }
.revue-fenetre .fermer-croix { position: absolute; top: -14px; right: -10px; z-index: 3; }
/* « Votre érudition » : une simple croix dans le coin, qui ne pousse pas la liste des niveaux */
.modale-boite:has(> .fermer-croix.coin) { position: relative; }
.modale-boite:has(> .fermer-croix.coin) > h2 { padding-right: 44px; }
.fermer-croix.coin { position: absolute; top: 12px; right: 12px; z-index: 3; float: none; margin: 0; display: grid; place-items: center; padding: 0; }
.revue { cursor: pointer; text-align: left; }
.revue .main-verso { pointer-events: auto; }
.revue-aide { margin: 12px 0 8px; color: var(--creme); font-style: italic; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.revue-retour { margin: 0 auto; }
.revue .option { pointer-events: none; } /* toucher n'importe où sur la carte la retourne */

/* ---------- 5 niveaux : des pastilles plus compactes au-dessus du carrousel ---------- */
.niveaux { gap: 2px; padding: 3px; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
.niveaux::-webkit-scrollbar { display: none; }
.niveau { padding: 5px 10px; font-size: .8rem; flex: none; }
@media (max-width: 420px) { .niveau { padding: 5px 7px; font-size: .74rem; } }
.niveau.verrouille span { font-size: .7em; }

/* ---------- le code de réduction (niveau Conservateur battu) ---------- */
.code-promo { max-width: 460px; margin: 0 auto 16px; text-align: center; border: 2px solid var(--laiton); box-shadow: 0 0 0 4px rgba(234, 209, 154, .25), var(--ombre);
  animation: decideur-entree .7s cubic-bezier(.2, 1.3, .4, 1) both 1s; }
.code-titre { font-family: var(--main); font-size: 1.7rem; font-weight: 700; color: var(--bordeaux); margin: 0 0 4px; }
.code-ligne { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 10px 0 12px; }
.code-ligne code { font: 800 1.35rem var(--texte); letter-spacing: .08em; padding: 6px 14px; border: 2px dashed var(--laiton); border-radius: 8px; background: #fffaf0; color: var(--encre); }
/* code unique, envoyé par e-mail : le formulaire (adresse + case facultative des nouvelles), puis « c'est envoyé » */
.code-email { margin-top: 12px; text-align: left; }
.code-email > label:first-child { display: block; font-weight: 700; color: var(--encre); }
.code-email .code-adresse { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--laiton); border-radius: 10px;
  background: #fffaf0; color: var(--encre); font: 400 1rem var(--texte); }
.code-email .code-adresse:focus { outline: 3px solid var(--laiton); outline-offset: 1px; }
.code-email .code-actions { margin-top: 10px; }
.code-nouvelles { display: flex; align-items: flex-start; gap: 9px; margin-top: 10px; font-size: .88rem; line-height: 1.35; color: var(--encre); cursor: pointer; }
.code-nouvelles input { flex: none; width: 19px; height: 19px; margin: 1px 0 0; accent-color: var(--bordeaux); cursor: pointer; }
.code-email .petit { margin: 8px 0 0; }
.code-email-msg { margin: 8px 0 0; font-size: .92rem; font-weight: 700; color: var(--bordeaux); }
.code-envoye { margin: 12px 0; padding: 10px 12px; border-radius: 10px; background: rgba(46, 125, 50, .1); border: 1px solid rgba(46, 125, 50, .35); color: var(--encre); line-height: 1.4; }
.code-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
/* « Votre érudition » : le code sous la liste des niveaux */
.niv-code { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--laiton); border-radius: 10px; background: rgba(255, 250, 238, .8); color: var(--encre); font-size: .92rem; }
.niv-code-titre { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; color: var(--bordeaux); }
.niv-code-titre .cadeau { width: 20px; height: 20px; flex: none; }
.niv-code .code-envoye { margin: 8px 0; font-size: .88rem; }
.niv-code .code-actions { justify-content: flex-start; }

/* ---------- la jauge d'érudition (au-dessus du carrousel) ---------- */
.niv-jauge { display: flex; align-items: center; gap: 8px; margin: 0 auto 6px; padding: 5px 12px 5px 10px; width: fit-content; cursor: pointer;
  border-radius: 999px; border: 1px solid rgba(234, 209, 154, .35); background: rgba(0, 0, 0, .22); color: var(--creme); font: 700 .86rem var(--texte);
  transition: background .2s ease, border-color .2s ease; }
.niv-jauge:hover { background: rgba(0, 0, 0, .32); border-color: rgba(234, 209, 154, .6); }
.jauge { display: inline-flex; align-items: flex-end; gap: 3px; height: 18px; }
.barre-niv { width: 5px; height: var(--h); border-radius: 2px; background: rgba(239, 228, 200, .28); }
.barre-niv.pleine { background: linear-gradient(180deg, #f3d680, #c9a14e); box-shadow: 0 0 4px rgba(243, 214, 128, .45); }
.barre-niv.fermee { background: rgba(239, 228, 200, .12); }
.niv-nom { letter-spacing: .02em; }
.cadeau { width: 18px; height: 18px; flex: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.niv-jauge .cadeau { animation: cadeau-appel 3.2s ease-in-out infinite; }
@keyframes cadeau-appel { 0%, 82%, 100% { transform: none; } 88% { transform: rotate(-12deg) scale(1.12); } 94% { transform: rotate(10deg) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .niv-jauge .cadeau { animation: none; } }

/* la liste des niveaux */
.niveau-depart { flex-direction: row; align-items: center; gap: 12px; }
.niveau-depart .jauge { height: 22px; flex: none; }
.niveau-depart .barre-niv { width: 5px; background: rgba(42, 29, 18, .15); }
.niveau-depart .barre-niv.pleine { background: linear-gradient(180deg, #e6c678, #a5843a); box-shadow: none; }
.niveau-depart .barre-niv.fermee { background: rgba(42, 29, 18, .08); }
.niv-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.niv-recompense { display: inline-flex; align-items: center; gap: 5px; margin-top: 3px; font-size: .82rem; font-weight: 700; color: var(--bordeaux); }
.niv-recompense .cadeau { width: 16px; height: 16px; }
/* un niveau verrouillé reste estompé, mais la récompense du dernier niveau reste bien visible (pour donner envie) */
.niveau-depart:disabled { opacity: 1; filter: none; }
.niveau-depart:disabled .jauge, .niveau-depart:disabled .niv-texte > strong, .niveau-depart:disabled .niv-texte > span:not(.niv-recompense) { opacity: .45; }
.niveau-depart:disabled .niv-recompense .cadeau { animation: cadeau-appel 3.2s ease-in-out infinite; }
/* le bouton d'érudition : plus bas et plus allongé */
.niv-jauge { gap: 10px; padding: 3px 22px; font-size: .78rem; min-width: 150px; justify-content: center; }
.niv-jauge .jauge { height: 13px; gap: 3px; }
.niv-jauge .barre-niv { width: 4px; }

/* le bouton pour refermer une fenêtre : centré, en bas (plus de croix) */
.fenetre-pied { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.revue-fenetre .fenetre-pied { margin-top: 4px; }
.revue-fenetre .fenetre-pied .btn.sec { background: rgba(248, 239, 219, .92); }

/* ---- accueil : bouton « Jouer » resserré, dé qui oscille, et le texte de la tuile qui monte en fondu ---- */
/* le dé se pose à côté du bouton, avec un peu d'air, au lieu de mordre sur son arrondi */
.acc-grande .acc-btn.acc-btn-de { --de: 62px; --ecart: 18px; width: fit-content; min-width: 168px; align-self: flex-start; padding: 6px 30px; min-height: 42px;
  margin-right: calc(var(--de) + var(--ecart)); }
.acc-grande .acc-btn-de .acc-de { width: var(--de); right: calc(-1 * (var(--de) + var(--ecart))); }
.acc-de { animation: invite-de 2.4s ease-in-out infinite; }
@media (max-width: 600px) {
  /* la marge à droite garde l'ensemble bouton + dé centré */
  .acc-grande .acc-btn.acc-btn-de { --de: 60px; width: fit-content; align-self: center; min-width: 150px; }
}
.acc-grande .acc-titre, .acc-grande .acc-desc, .acc-grande .acc-btn-de { animation: acc-monte .91s cubic-bezier(.2, .9, .3, 1) both; }
.acc-grande .acc-titre { animation-delay: .2s; }
.acc-grande .acc-desc { animation-delay: .42s; }
.acc-grande .acc-btn-de { animation-delay: .65s; }
.acc-grande .acc-de { animation: acc-de-arrive .78s cubic-bezier(.2, 1.4, .4, 1) 1.1s both, invite-de 2.4s ease-in-out 2.1s infinite; }
@keyframes acc-monte { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
@keyframes acc-de-arrive { from { opacity: 0; translate: 0 34px; scale: .6; } to { opacity: 1; translate: 0 0; scale: 1; } }
@media (prefers-reduced-motion: reduce) { .acc-grande .acc-titre, .acc-grande .acc-desc, .acc-grande .acc-btn-de, .acc-grande .acc-de { animation: none; } }

/* ---- accueil : halo doré derrière le dé (image medias/halo-de.webp, tirée de « halo dé.png », fond noir rendu transparent),
   un peu aplati pour ne pas trop déborder sur le texte ---- */
.acc-halo { --hl: calc(var(--de, 62px) * 4.2); --hh: calc(var(--de, 62px) * 2.7);
  position: absolute; width: var(--hl); height: var(--hh); pointer-events: none;
  left: calc(100% + var(--ecart, 18px) + var(--de, 62px) / 2 - var(--hl) / 2);
  top: calc(50% - var(--de, 62px) * .08 - var(--hh) / 2);
  animation: halo-arrive 1s ease-out 1.15s both; transition: transform .3s ease; }
.acc-halo::before { content: ""; position: absolute; inset: 0;
  background: url('../medias/halo-de-clair.webp') center / 100% 100% no-repeat;
  animation: halo-pulse 3.2s ease-in-out infinite; }
.acc-grande:hover .acc-halo { transform: translateY(-4%) scale(1.08); }
/* sur grand écran, le dé est plus près du texte : un halo un peu plus plat */
@media (min-width: 601px) { .acc-halo { --hl: calc(var(--de, 62px) * 3.6); --hh: calc(var(--de, 62px) * 2.2); } }
/* le halo s'arrête au bord de la tuile : pas de défilement de côté sur téléphone (clip : la tuile ne devient pas défilable) */
.acc-grande { overflow: hidden; overflow: clip; }
/* le dé, éclairé par-derrière : une ombre chaude plutôt qu'une ombre noire */
.acc-grande .acc-de { filter: drop-shadow(0 0 8px rgba(255, 250, 195, .6)) drop-shadow(0 4px 4px rgba(0, 0, 0, .35)); }
@keyframes halo-arrive { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
@keyframes halo-pulse { 0%, 100% { opacity: .85; scale: .95; } 50% { opacity: 1; scale: 1.04; } }
@media (prefers-reduced-motion: reduce) { .acc-halo, .acc-halo::before { animation: none; } }

/* ---- verso des cartes : écritures plus grandes pour mieux lire ---- */
.main-verso .verso-titre strong { font-size: 1.38rem; }
.main-verso .verso-titre em { font-size: 1.15rem; }
.main-verso .verso-epreuve { font-size: 1.02rem; }
.main-verso .intitule { font-size: 1.02rem; line-height: 1.25; }
.main-verso .option { padding: 7px 9px; font-size: .97rem; line-height: 1.24; }
.main-verso .affirmation { font-size: 1.04rem; line-height: 1.3; }
.main-verso .verdict { font-size: .98rem; line-height: 1.3; }
.main-verso .verdict strong { font-size: 1.35rem; }
.main-verso .savoir, .main-verso .verification { font-size: .95rem; line-height: 1.3; }
.main-verso .suite .btn { font-size: 1rem; }

/* ---- accueil : l'accroche écrite à la plume, en écriture calligraphique ---- */
.acc-tete .acc-accroche { font-family: "Satisfy", "Dancing Script", cursive; font-weight: 400; font-size: clamp(1.45rem, 5.2vw, 2.1rem); line-height: 1.2; color: #3a2812; }
.acc-accroche .mot { display: inline-block; white-space: nowrap; }
.acc-accroche.a-ecrire .l { opacity: 0; }
.acc-accroche.a-ecrire .l.vue { opacity: 1; animation: acc-encre .46s ease-out both; }
@keyframes acc-encre { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
.acc-plume { position: absolute; left: 0; top: 0; width: 118px; height: 92px; pointer-events: none; opacity: 0; z-index: 2;
  transform-origin: 0 100%; filter: drop-shadow(2px 4px 3px rgba(42, 29, 18, .35)); transition: opacity .25s ease; }
.acc-plume.active { opacity: 1; }
.acc-plume.envol { animation: acc-plume-envol 1.22s cubic-bezier(.4, 0, .6, 1) forwards; }
@keyframes acc-plume-envol { to { opacity: 0; transform: translate(60px, -70px) rotate(25deg); } }
@media (max-width: 600px) { .acc-tete .acc-accroche { font-size: 1.45rem; } .acc-plume { width: 96px; height: 75px; } }

/* ---- les règles en bref (première partie) ---- */
.regles-bref h2 { text-align: center; margin: 0 0 12px; }
.regles-bref ol { list-style: none; counter-reset: etape; margin: 0; padding: 0; display: grid; gap: 10px; }
.regles-bref li { counter-increment: etape; position: relative; padding-left: 40px; line-height: 1.35; }
.regles-bref li::before { content: counter(etape); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font: 800 1rem var(--chiffres); color: #fff8e8; background: radial-gradient(circle at 32% 28%, #b35a68, var(--bordeaux) 55%, #4f1b25); box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }

/* l'explication d'un Vrai ou Faux, une fois la réponse donnée */
.vf-explication { margin: 8px 0 0; padding: 8px 10px; border-left: 3px solid var(--laiton); background: rgba(255, 250, 238, .7); border-radius: 0 8px 8px 0; font-size: .95rem; line-height: 1.32; color: #3a2a14; }
/* après une épreuve d'étymologie, de vrai ou faux ou de mots voisins : le sens du mot, en une phrase */
.def-courte { margin: 8px 0 0; padding: 7px 10px; border-radius: 8px; background: rgba(255, 250, 238, .78); border: 1px dashed rgba(165, 132, 58, .7);
  font-size: .92rem; line-height: 1.3; color: #3a2a14; }
.def-courte span { display: block; margin-bottom: 1px; font-family: var(--titre); font-size: .8rem; letter-spacing: .04em; color: var(--bordeaux); }

/* pendant l'épreuve : retourner la carte pour voir l'illustration, puis revenir */
.verso-retourner { position: absolute; top: 7px; left: 7px; z-index: 3; width: 32px; height: 32px; padding: 6px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(120, 88, 30, .45); background: rgba(255, 250, 235, .9); color: var(--bordeaux); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.verso-retourner svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; display: block; }
.verso-retourner:hover { background: #fffaf0; }
.main-verso .verso-titre { padding-left: 13%; }
.main-recto { position: relative; }
/* dans la carte, en haut à gauche, au même endroit que le bouton ↻ du verso (en dessous de la carte, l'effet 3D le coupait) */
.recto-revenir { position: absolute; top: 7px; left: 7px; z-index: 3; display: flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer;
  padding: 5px 12px 5px 6px; border-radius: 999px; border: 1px solid rgba(120, 88, 30, .45); background: rgba(255, 250, 235, .93); color: var(--bordeaux);
  font: 700 .82rem var(--texte); box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.recto-revenir svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.recto-revenir span { color: var(--encre); }
.main-faces:not(.apercu) .recto-revenir { display: none; }
.main-faces.apercu .main-recto { cursor: pointer; }

/* journal du duel : le jour et l'heure de chaque action */
.journal-heure { display: inline-block; min-width: 3.2em; margin-right: 4px; font: 700 .82em var(--chiffres); color: var(--encre-douce); white-space: nowrap; }

/* ================= Mon Cabinet : la collection des cartes gagnées ================= */
.mon-cabinet h1 { text-align: center; margin-bottom: 2px; }
.mc-total { text-align: center; margin: 0 0 8px; font-size: 1.05rem; color: var(--creme); font-variant-numeric: tabular-nums; }
.mc-total strong { font-family: var(--titre); font-size: 1.6rem; color: var(--laiton-clair); }
.mc-jauge { display: block; height: 6px; border-radius: 999px; background: rgba(0, 0, 0, .3); overflow: hidden; }
.mc-jauge > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c9a24f, var(--laiton-clair)); }
.mc-jauge-totale { max-width: 420px; margin: 0 auto 12px; height: 9px; }
.mc-aide { text-align: center; margin: 0 auto 14px; max-width: 46ch; font-size: .92rem; opacity: .85; }
.mc-vide { max-width: 520px; margin: 0 auto 16px; text-align: center; }
.mc-vide p { margin: 0 0 12px; }
.mc-filtres { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 16px; }
.mc-univers { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; padding: 7px 10px 8px; border-radius: 10px; cursor: pointer; text-align: left;
  border: 1px solid rgba(234, 209, 154, .3); background: rgba(0, 0, 0, .22); color: var(--creme); font: 600 .85rem var(--texte); }
.mc-univers .mc-jauge { grid-column: 1 / -1; height: 5px; }
.mc-univers-compte { font-variant-numeric: tabular-nums; opacity: .85; }
.mc-univers.actif { border-color: var(--laiton-clair); background: rgba(234, 209, 154, .16); color: var(--laiton-clair); }
.mc-univers:focus-visible { outline: 2px solid var(--laiton-clair); outline-offset: 2px; }
.mc-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.mc-carte { display: block; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; min-width: 0; transition: transform .15s ease; }
.mc-carte:hover { transform: translateY(-3px); }
.mc-carte:focus-visible { outline: 2px solid var(--laiton-clair); outline-offset: 3px; border-radius: 10px; }
.mc-carte .carte .mot { font-size: .9rem; }
.mc-voile { position: relative; display: grid; place-items: center; align-content: center; gap: 4px; aspect-ratio: 459 / 640; border-radius: 9px;
  background: color-mix(in srgb, var(--u, #3a5a4c) 30%, #0c231b); border: 1.5px dashed rgba(234, 209, 154, .28); color: rgba(239, 228, 200, .55); }
.mc-voile[data-u="litteraire"] { --u: var(--u-litteraire); }
.mc-voile[data-u="expressions"] { --u: var(--u-expressions); }
.mc-voile[data-u="monde"] { --u: var(--u-monde); }
.mc-voile[data-u="contemporains"] { --u: var(--u-contemporains); }
.mc-voile[data-u="sciences"] { --u: var(--u-sciences); }
.mc-voile-q { font: 400 2.4rem var(--titre); line-height: 1; }
.mc-voile-u { font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; text-align: center; padding: 0 6px; }
.mc-voile-r { position: absolute; top: 6px; right: 7px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(234, 209, 154, .35); font: 800 .75rem var(--chiffres); }
.nouvelle-carte { display: block; margin-top: 4px; font-weight: 800; color: var(--laiton); }
.mc-carte .carte .meta { display: none; } /* la couleur de la carte dit déjà l'univers : toutes les cartes à la même hauteur */

/* ---------- classement : cette semaine / depuis toujours ---------- */
.classement-onglets { display: flex; justify-content: center; gap: 6px; margin: 0 0 12px; }
.classement-onglet { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--laiton); background: transparent; color: var(--encre); font: 700 .85rem var(--texte); cursor: pointer; }
.classement-onglet.actif { background: var(--laiton); color: #2a1d12; }
/* ---------- anecdote après une carte rare réussie ---------- */
.anecdote { margin: 8px 0 0; padding: 7px 10px; border-radius: 8px; background: rgba(243, 210, 122, .22); border: 1px solid rgba(201, 162, 79, .6); font-size: .9rem; line-height: 1.3; color: #3a2a14; }
.anecdote span { display: block; font-family: var(--titre); font-size: .8rem; letter-spacing: .04em; color: var(--bordeaux); }
/* ---------- défis de la semaine (accueil) ---------- */
.acc-defis h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.acc-defis h2 small { font: 700 .9rem var(--texte); color: var(--encre-douce); }
.defis { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 10px; }
.defis li { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: baseline; color: var(--encre); }
.defis li .mc-jauge { grid-column: 1 / -1; background: rgba(107, 90, 69, .2); }
.defis li.fait .defi-texte { color: var(--juste); font-weight: 700; }
.defi-compte { font-variant-numeric: tabular-nums; font-size: .88rem; color: var(--encre-douce); }
.acc-defis .petit { margin: 0; }
/* ---------- la carte légendaire ---------- */
.carte.legendaire { box-shadow: 0 0 0 2px #f3d27a, 0 0 16px 4px rgba(243, 210, 122, .65); }
.carte.legendaire::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 244, 200, .55) 45%, transparent 60%) -150% 0 / 250% 100% no-repeat;
  animation: legendaire-eclat 3.2s ease-in-out infinite; }
@keyframes legendaire-eclat { to { background-position: 150% 0; } }
.badge-legendaire { position: absolute; top: 6px; left: 6px; z-index: 2; padding: 2px 7px; border-radius: 999px; font: 800 .6rem var(--texte);
  letter-spacing: .06em; text-transform: uppercase; color: #3a2606; background: linear-gradient(180deg, #fbe3a0, #e0b14a); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
@media (prefers-reduced-motion: reduce) { .carte.legendaire::after { animation: none; } }
.mc-carte .badge-legendaire, .cabinet .badge-legendaire { top: 4px; left: 4px; padding: 1px 5px; font-size: .48rem; letter-spacing: .03em; }

/* ---- les pouvoirs (gagnés avec la carte légendaire) */
.pouvoir-lien { flex: 0 0 auto; order: 2; margin: 2px auto 0; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: #f6e7b8; color: #5a4210; border: 2px solid var(--laiton); font: inherit; font-weight: 800; font-size: .95rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25); animation: annonce-mission .6s cubic-bezier(.3, 1.6, .5, 1) .6s both; }
.barre:has(> .pouvoir-lien) { flex-direction: column; gap: 6px; }
.pouvoir-lien:hover, .pouvoir-lien:focus-visible { background: #fbefc8; }
.annonce-pouvoir { display: block; margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #f6e7b8; border: 2px solid var(--laiton);
  font-weight: 800; color: #5a4210; animation: annonce-mission .6s cubic-bezier(.3, 1.6, .5, 1) 1.2s both; }
.pouvoirs-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 10px 0; }
.pouvoirs-liste .pouvoir-choix p { font-size: .92rem; line-height: 1.3; }
.pouvoir-choix { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pouvoir-choix img { width: 100%; border-radius: 4%/6%; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.pouvoir-choix p { margin: 0; }
.pouvoir-non { font-style: italic; }
.pouvoirs-fenetre { max-width: 720px; }
.maraude-choix { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 10px 0; }
.maraude-carte { padding: 0; border: 0; background: none; cursor: pointer; width: 130px; border-radius: 10px; transition: transform .15s; }
.maraude-carte:hover, .maraude-carte:focus-visible { transform: translateY(-4px); }
.mc-pouvoirs { margin: 14px 0; }
.mc-pouvoirs h2 { margin-top: 0; }
.mc-pouvoirs .pouvoirs-liste { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
@media (prefers-reduced-motion: reduce) { .pouvoir-lien, .annonce-pouvoir { animation: none; } }

/* ---- cartes animées : la vidéo joue une fois par-dessus l'illustration, en fondu */
.carte .illu-anim { position: absolute; z-index: 1; margin: 0; object-fit: cover; object-position: top; opacity: 0;
  transition: opacity .4s ease; pointer-events: none; aspect-ratio: auto; }
.carte .illu-anim.visible { opacity: 1; }
.carte .sceau, .carte .badge-legendaire { z-index: 2; }

/* ---- les plumes dorées animées de la tuile « Duel entre amis » : fond noir fondu dans la tuile (mode éclaircir),
   bords adoucis ; un peu plus grandes que l'icône, sans changer la mise en page */
.acc-plumes-cadre { position: relative; display: block; width: 62px; height: 62px; margin: -3px; pointer-events: none; }
.acc-chapeau .acc-plumes-anim { width: 100%; height: 100%; display: block; mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 72%); mask-image: radial-gradient(circle, #000 55%, transparent 72%); }
/* une fois la vidéo finie (classe .fini posée à la fin, 10 s), le firmament continue : l'anneau de paillettes, incliné comme dans la vidéo,
   avec sa tête lumineuse et sa traîne, tourne autour des plumes ; des paillettes scintillent le long de l'anneau */
.acc-firmament { position: absolute; left: 50%; top: 59%; width: 70%; height: 70%; opacity: 0; mix-blend-mode: screen;
  transform: translate(-50%, -50%) rotate(-8deg) rotateX(44deg); }
.acc-plumes-cadre.fini .acc-firmament { animation: etoiles-arrivent 1.2s ease-out forwards; }
.firm-anneau { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 45%, rgba(255, 215, 130, .25) 65%, rgba(255, 238, 180, .9) 96%, #fffbe0 100%);
  -webkit-mask-image: radial-gradient(circle, transparent 63%, #000 66%, #000 70%, transparent 73%);
  mask-image: radial-gradient(circle, transparent 63%, #000 66%, #000 70%, transparent 73%); animation: etoiles-orbite 6s linear infinite; }
.firm-poussiere { position: absolute; inset: 0; animation: etoiles-orbite 14s linear infinite; }
.firm-poussiere i { position: absolute; inset: 0; transform: rotate(var(--a)); }
.firm-poussiere i::before { content: ""; position: absolute; left: 50%; top: var(--p); width: var(--t); height: var(--t); margin-left: calc(var(--t) / -2);
  border-radius: 50%; background: #fff6cf; box-shadow: 0 0 3px 1px rgba(255, 230, 160, .8);
  animation: etoile-scintille 2.4s ease-in-out var(--d) infinite; }
@keyframes etoiles-arrivent { to { opacity: 1; } }
@keyframes etoiles-orbite { to { rotate: 360deg; } }
@keyframes etoile-scintille { 0%, 100% { opacity: .25; scale: .6; } 50% { opacity: 1; scale: 1.1; } }
@media (max-width: 480px) {
  .acc-plumes-cadre { width: 52px; height: 52px; margin: -3px; }
}

/* ---- démo locale des gains (?demo=gains, localhost seulement) ---- */
.demo-depart { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 9999; padding: 16px 26px; border: 0; border-radius: 10px;
  background: linear-gradient(#f3d27a, #c99a3a); color: #3a2510; font: 600 1.1rem var(--chiffres, sans-serif); box-shadow: 0 6px 20px rgba(0, 0, 0, .45); cursor: pointer; }
.demo-gains { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; align-items: center; gap: 6px;
  padding: 5px 8px; border-radius: 22px; background: rgba(20, 30, 22, .85); color: #f6ecd2; font: 600 .9rem var(--chiffres, sans-serif); box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
.demo-gains button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: inherit; font-size: 1rem; cursor: pointer; }
.demo-gains .demo-nom { min-width: 150px; text-align: center; white-space: nowrap; }
.en-demo-gains [data-action="fin-tour"] { pointer-events: none; }

/* ---- la sphère armillaire (au Joker) : le bouton sous les épreuves, puis la fenêtre où elle tourne ---- */
.epreuve-btn.sphere-btn { grid-column: 1 / -1; justify-content: center; background: linear-gradient(180deg, #f6e7c4, #e9d29d); }
.epreuve-btn.sphere-btn img { width: 44px; height: 44px; }
.epreuve-btn.sphere-btn span { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.epreuve-btn.sphere-btn small { font-weight: 400; font-size: .78rem; opacity: .75; }
.epreuve-btn.sphere-btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.6); }
.sphere-voile { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 16px; background: radial-gradient(circle at 50% 42%, rgba(11, 35, 27, .9), rgba(5, 16, 12, .96) 70%); cursor: pointer;
  animation: sphere-arrive .45s ease-out both; }
.sphere-voile.part { animation: sphere-part .45s ease-in forwards; }
.sphere-medaillon { width: min(72vw, 360px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #0b231b url('../medias/sphere/sphere.png') center / 78% no-repeat;
  box-shadow: 0 0 0 3px rgba(201, 162, 74, .55), 0 0 40px rgba(242, 214, 143, .25), 0 18px 40px rgba(0, 0, 0, .55); }
.sphere-medaillon canvas { width: 100%; height: 100%; display: block; touch-action: none;
  -webkit-mask-image: radial-gradient(circle, #000 62%, transparent 72%); mask-image: radial-gradient(circle, #000 62%, transparent 72%); }
.sphere-titre, .sphere-texte { margin: 0; text-align: center; color: var(--creme, #f6ecd2); font-family: 'IM Fell English SC', serif; font-size: clamp(1.2rem, 4.6vw, 1.7rem); text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.sphere-titre { opacity: .85; font-style: italic; }
.sphere-voile.a-la-main:not(.lancee) .sphere-medaillon { cursor: grab; animation: sphere-invite 2.2s ease-in-out infinite; }
.sphere-voile.a-la-main:not(.lancee) .sphere-medaillon:active { cursor: grabbing; }
.sphere-voile.lancee { cursor: default; }
@keyframes sphere-invite { 0%, 100% { box-shadow: 0 0 0 3px rgba(201, 162, 74, .55), 0 0 40px rgba(242, 214, 143, .25), 0 18px 40px rgba(0, 0, 0, .55); }
  50% { box-shadow: 0 0 0 3px rgba(242, 214, 143, .9), 0 0 60px rgba(242, 214, 143, .45), 0 18px 40px rgba(0, 0, 0, .55); } }
.sphere-texte strong { color: #f2d68f; }
.sphere-texte .petit { font-size: .8rem; opacity: .8; font-family: 'Alegreya Sans', sans-serif; }
.sphere-voile.revele .sphere-texte { animation: sphere-annonce .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes sphere-arrive { from { opacity: 0; } to { opacity: 1; } }
@keyframes sphere-part { to { opacity: 0; } }
@keyframes sphere-annonce { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }

/* ================= le Défi du jour (façon Motus) ================= */
.defi-page { max-width: 640px; margin: 0 auto; padding: 0 12px 110px; }
.defi-titre { text-align: center; color: var(--creme); font-family: var(--titre); margin: 4px 0 10px; font-size: clamp(1.5rem, 6vw, 2rem); }
.defi-titre span { font-family: var(--chiffres, var(--texte)); font-weight: 700; font-size: .7em; color: var(--laiton-clair); }
.defi-haut { display: grid; grid-template-columns: minmax(0, 42%) 1fr; gap: 12px; align-items: start; }
.defi-image { width: 100%; height: auto; border-radius: 10px; box-shadow: var(--ombre); display: block; }
.defi-indices { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; font-size: .95rem; color: var(--encre); }
.defi-indices strong { color: var(--feutre); }
.defi-indices .indice-bloque { opacity: .55; font-style: italic; font-size: .85rem; }
.defi-indices .nouvel-indice { animation: sphere-annonce .5s ease-out both; }
@media (max-width: 480px) { .defi-haut { grid-template-columns: minmax(0, 38%) 1fr; gap: 9px; } .defi-indices { font-size: .85rem; padding: 9px 10px; gap: 5px; } }
.defi-legende { text-align: center; color: var(--creme); font-size: .82rem; margin: 12px 0 6px; opacity: .9; }
.defi-legende span { display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 4px; margin: 0 2px 0 8px; color: #fff; font-weight: 700; }
.defi-legende .bien, .defi-case.bien { background: #3f8a46; }
.defi-legende .mal, .defi-case.mal { background: #d9822b; }
.defi-legende .absente, .defi-case.absente { background: #6e6a62; }
.defi-grille { --case: 40px; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 8px 0; }
.defi-rangee { display: flex; flex-wrap: nowrap; justify-content: center; gap: 14px; }
.defi-grille.par-mot .defi-rangee { flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; border-bottom: 1px dashed rgba(234, 209, 154, .25); }
.defi-mot { display: inline-flex; gap: 4px; }
.defi-case { position: relative; width: var(--case); height: var(--case); display: grid; place-items: center; border-radius: 6px; padding: 0;
  font: 700 calc(var(--case) * .52) / 1 var(--texte); text-transform: uppercase; color: #fff; border: 2px solid transparent; box-sizing: border-box; }
.defi-case i { position: absolute; right: 2px; bottom: 1px; font-style: normal; font-size: max(9px, calc(var(--case) * .26)); line-height: 1; opacity: .95; }
.defi-case.vide { background: rgba(255, 255, 255, .92); color: var(--encre); border-color: var(--laiton); cursor: pointer; }
.defi-case.vide.curseur { border-color: var(--bordeaux); box-shadow: 0 0 0 3px rgba(242, 214, 143, .7); }
.defi-case.donnee { background: var(--laiton-clair); color: var(--encre); border-color: var(--laiton-fonce); }
.defi-case.signe { width: calc(var(--case) * .45); color: var(--laiton-clair); font-size: calc(var(--case) * .6); }
.defi-rangee.secoue { animation: defi-secoue .35s; }
@keyframes defi-secoue { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.defi-message { min-height: 1.2em; text-align: center; color: #ffd9a8; margin: 4px 0; font-size: .9rem; }
.defi-clavier { display: flex; flex-direction: column; gap: 6px; margin: 6px auto 8px; max-width: 520px; }
.defi-clavier-ligne { display: flex; gap: 5px; justify-content: center; }
.defi-touche { flex: 1 1 0; min-width: 0; max-width: 46px; height: 50px; border: 0; border-radius: 7px; background: #e9dfc7; color: var(--encre);
  font: 700 1.05rem var(--texte); cursor: pointer; box-shadow: 0 2px 0 rgba(0, 0, 0, .3); touch-action: manipulation; }
.defi-touche.large { flex: 1.6 1 0; max-width: 84px; font-size: .9rem; }
.defi-touche.valider { background: var(--laiton); }
.defi-touche.bien { background: #3f8a46; color: #fff; }
.defi-touche.mal { background: #d9822b; color: #fff; }
.defi-touche.absente { background: #6e6a62; color: #ddd; }
.defi-aide { color: var(--creme); opacity: .8; }
.defi-fin { margin-top: 14px; text-align: center; }
.defi-fin h2 { margin-top: 0; }
.defi-carte { width: min(300px, 80%); margin: 6px auto 10px; }
.defi-carte .carte { width: 100%; }
.defi-savoir { text-align: left; }
.defi-serie { font-size: 1.05rem; }
.defi-boutons { justify-content: center; margin: 8px 0; }
/* la tuile de l'accueil */
.acc-defi { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; padding: 12px 14px; margin-top: 14px; width: 100%;
  background: linear-gradient(160deg, #6e2f3f, #4a1f2b); text-align: left; }
.acc-defi-image { width: 96px; height: 128px; object-fit: cover; border-radius: 8px; box-shadow: 0 3px 8px rgba(0, 0, 0, .4); }
.acc-defi .acc-texte { display: flex; flex-direction: column; gap: 4px; }
.acc-defi .acc-titre small { font-family: var(--chiffres, var(--texte)); font-size: .7em; color: var(--laiton-clair); }
.acc-defi-etat { font-size: .85rem; color: var(--laiton-clair); }
.acc-defi .acc-btn { align-self: flex-start; margin-top: 4px; }
@media (max-width: 480px) { .acc-defi { grid-template-columns: 76px 1fr; gap: 10px; } .acc-defi-image { width: 76px; height: 102px; } }
.defi-page .centre { text-align: center; }
.defi-case.vide.acquise { background: #3f8a46; color: #fff; border-color: #2d6b33; }
.entete-vide { height: 10px; }

/* ---- Défi du jour : design d'après la maquette de l'utilisateur (2026-11-19) ----
   parchemin déchiré et jetons en relief fournis par l'utilisateur (JEU EN LIGNE/parchemin.jpeg, « touches défi du jour.jpeg »),
   détourés dans medias/defi/ ; posés en « 9 parts » (border-image) pour garder le relief à toutes les tailles. */
.defi-page { max-width: 780px; }
.defi-titre { font-size: clamp(1.9rem, 7.5vw, 3rem); color: #f0d999; margin: 14px 0 18px;
  text-shadow: 0 0 22px rgba(242, 214, 143, .35), 0 2px 3px rgba(0, 0, 0, .55); }
.defi-titre span { font-family: var(--titre); font-weight: 400; font-size: .78em; color: inherit; }
.defi-haut { grid-template-columns: minmax(0, 44%) 1fr; gap: 20px; }
.defi-image { border-radius: 14px; border: 2px solid var(--laiton); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 8px 22px rgba(0, 0, 0, .45); }
.defi-indices.parchemin { position: relative; background: none; box-shadow: none; border-radius: 0;
  border: 26px solid transparent; border-image: url('../medias/defi/parchemin.webp') 70 fill stretch;
  padding: 6px 10px; gap: 12px; font-size: 1.12rem; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.defi-indices.parchemin::before { content: ""; position: absolute; inset: -12px; border: 3px double rgba(150, 110, 45, .55); pointer-events: none; }
.defi-indices strong { font-family: var(--serif); font-style: italic; font-weight: 700; color: var(--encre); }
.defi-indices .indice-bloque { color: var(--encre-douce); }
@media (max-width: 600px) {
  .defi-haut { grid-template-columns: minmax(0, 42%) 1fr; gap: 10px; }
  .defi-indices.parchemin { border-width: 16px; padding: 2px 4px; gap: 6px; font-size: .86rem; }
  .defi-indices.parchemin::before { inset: -8px; border-width: 2px; }
}
/* les jetons */
.defi-case, .defi-legende span, .defi-touche { border-style: solid; border-color: transparent; background: none; box-shadow: none;
  border-image: url('../medias/defi/jeton-donnee.png') 34 fill stretch; border-radius: 0; }
.defi-case { border-width: calc(var(--case) * .16); font-family: var(--serif); font-weight: 700; font-size: calc(var(--case) * .56); color: var(--encre);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.defi-case.absente, .defi-legende .absente, .defi-touche.absente { border-image-source: url('../medias/defi/jeton-absente.png'); color: #f1e6cf; background: none; }
.defi-case.mal, .defi-legende .mal, .defi-touche.mal { border-image-source: url('../medias/defi/jeton-mal.png'); color: #fff; background: none; }
.defi-case.bien, .defi-legende .bien, .defi-touche.bien, .defi-case.vide.acquise { border-image-source: url('../medias/defi/jeton-bien.png'); color: #fff; background: none; }
.defi-case.mal, .defi-case.bien, .defi-case.vide.acquise { text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.defi-case.donnee { background: none; border-color: transparent; }
.defi-case.vide { background: none; border-color: transparent; opacity: .82; }
.defi-case.vide.acquise { opacity: 1; }
.defi-case.vide.curseur { opacity: 1; box-shadow: none; filter: drop-shadow(0 0 5px rgba(255, 220, 140, .95)) drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }
.defi-case i { right: calc(var(--case) * -.08); bottom: calc(var(--case) * -.1); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); font-family: var(--texte); }
.defi-legende span { border-width: 5px; width: 1.7em; height: 1.7em; font-size: .8rem; }
.defi-touche { border-width: 7px; padding: 0; height: 52px; font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--encre); }
.defi-touche.large { font-family: var(--texte); font-size: .9rem; }
.defi-touche.valider { border-image-source: url('../medias/defi/jeton-mal.png'); color: #fff; }
.defi-touche:active { transform: translateY(1px); filter: brightness(.95); }
.defi-case i { right: 0; bottom: 0; }
.defi-indices .indice-bloque { font-size: .95rem; }
@media (max-width: 600px) { .defi-indices .indice-bloque { font-size: .78rem; } }
@media (max-width: 499px) {
  .defi-mot { gap: 2px; }
  .defi-rangee { gap: 8px; }
  .defi-grille { gap: 4px; }
  .defi-case { border-width: calc(var(--case) * .13); font-size: calc(var(--case) * .54); }
  .defi-case i { font-size: 8px; }
  .defi-touche { height: 46px; border-width: 6px; font-size: 1.05rem; }
  .defi-clavier-ligne { gap: 4px; }
}
/* l'illustration du défi, en grand au toucher */
.defi-image-btn { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; }
.defi-zoom { position: fixed; inset: 0; z-index: 950; display: grid; place-items: center; padding: 16px; background: rgba(5, 16, 12, .9);
  cursor: zoom-out; animation: sphere-arrive .25s ease-out both; }
.defi-zoom.part { animation: sphere-part .25s ease-in forwards; }
.defi-zoom img { max-width: min(92vw, 640px); max-height: 88vh; width: auto; height: auto; border-radius: 14px; border: 2px solid var(--laiton);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .6); }
.defi-zoom-fermer { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .15); color: #fff; font-size: 1.2rem; cursor: pointer; }
/* le verso qui déborde : on le fait défiler au doigt (jeu.js) ; tant que le bas n'est pas visible, un repère en bas de la carte */
.main-verso { touch-action: none; }
.main-verso.a-suivre::after { content: "⌄ glissez vers le haut pour la suite"; position: sticky; bottom: -10px; display: block; margin: -34px -9px -10px;
  padding: 22px 0 6px; text-align: center; font: 700 .76rem var(--texte); color: #5a4630; pointer-events: none;
  background: linear-gradient(rgba(239, 226, 192, 0), rgba(239, 226, 192, .96) 55%); animation: suite-respire 1.8s ease-in-out infinite; }
@keyframes suite-respire { 50% { color: #8a6a3a; } }
/* le verso ne doit pas agrandir la carte : il prend la hauteur du recto (sa propre hauteur ne compte pas dans la grille)
   et fait défiler son contenu à l'intérieur */
.main-verso { height: 0; min-height: 100%; }

/* pas de « tirer pour actualiser » (Chrome Android) : un geste vers le bas en haut de page rechargeait le jeu */
html, body { overscroll-behavior-y: none; }
/* l'accueil propose de reprendre une partie gardée sur l'appareil */
.acc-reprise { display: block; width: 100%; margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--laiton);
  background: rgba(242, 214, 143, .14); color: var(--creme); font: inherit; text-align: center; cursor: pointer; }
.acc-reprise strong { color: var(--laiton-clair); }
/* l'univers du mot, au-dessus de l'illustration du défi */
.defi-univers { margin: 0 0 6px; padding: 4px 10px; border-radius: 8px; text-align: center; background: var(--u, var(--feutre-clair));
  color: #fdf6e3; font: 700 .9rem var(--texte); letter-spacing: .02em; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); }
@media (max-width: 600px) { .defi-univers { font-size: .78rem; padding: 3px 6px; } }
/* le clavier du défi reste collé en bas de l'écran (au-dessus de la barre de navigation) : avec une longue expression,
   on voit toujours le clavier en faisant défiler la grille */
.defi-clavier { position: sticky; bottom: calc(46px + env(safe-area-inset-bottom, 0px)); z-index: 5; margin-left: -12px; margin-right: -12px;
  padding: 8px 12px; background: linear-gradient(rgba(19, 57, 45, .85), var(--feutre) 30%); box-shadow: 0 -6px 12px rgba(0, 0, 0, .25); }

/* ---------- fenêtre d'accueil des nouveaux visiteurs (Bienvenue dans jeu.js) ---------- */
html.bv-ouverte, html.bv-ouverte body { overflow: hidden; }
.bienvenue { position: fixed; inset: 0; z-index: 55; overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(ellipse at 50% 20%, #1f4c3c, var(--feutre-nuit) 75%);
  padding: max(14px, env(safe-area-inset-top, 0px)) 16px max(20px, env(safe-area-inset-bottom, 0px)); animation: bv-arrivee .35s ease-out; }
@keyframes bv-arrivee { from { opacity: 0; } to { opacity: 1; } }
.bienvenue-boite { position: relative; width: min(430px, 100%); margin: 0 auto; text-align: center; color: var(--creme); }
.bv-croix { position: absolute; top: 0; right: 0; float: none; margin: 0; z-index: 3; }
.bv-accroche { font: 700 clamp(1.25rem, 5.4vw, 1.55rem) / 1.2 var(--serif); color: var(--laiton-clair); margin: 6px 44px 16px; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.bv-carte { animation: none; }
/* recto et verso : la même carte, de la même taille (le verso prend la hauteur du recto) */
.bv-carte .main-face { width: min(250px, 68vw); justify-self: center; }
.bv-carte .main-verso { text-align: left; display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 14px 16px; border-radius: 9px; }
.bv-carte .verso-titre { min-height: 0; padding: 0; }
.bv-carte .verso-titre strong { font-size: 1.5rem; }
.bv-carte .verso-rarete { font-size: 1.9rem; }
.bv-message { margin: 0; text-align: center; font: 700 1.5rem / 1 var(--main); }
.bv-message.ok { color: var(--juste); }
.bv-message.ko { color: var(--bordeaux); }
.bv-definition, .bv-anecdote { margin: 0; font: 500 .98rem / 1.3 var(--serif); }
.bv-anecdote { font-size: .86rem; font-style: italic; }
.bv-definition span, .bv-anecdote span { display: block; font: 800 .68rem / 1.2 var(--texte); letter-spacing: .05em; text-transform: uppercase; color: #6b5a45; margin-bottom: 2px; font-style: normal; }
.bv-question { margin-top: 18px; }
.bv-intitule { font: 700 1.15rem / 1.2 var(--serif); margin: 0 0 10px; color: var(--creme); }
.bv-question .options { text-align: left; }
.bienvenue.repondu .bv-question { display: none; }
.bv-suite { margin-top: 18px; animation: bv-arrivee .5s ease-out; }
.bv-texte { margin: 0 0 16px; font-size: 1.02rem; line-height: 1.45; }
.bv-principal { width: 100%; min-height: 54px; font-size: 1.1rem; }
.bv-defi { display: block; margin: 12px auto 0; color: var(--laiton-clair); font-size: .92rem; }

/* ---------- bulles du tutoriel de la première partie (Tuto dans jeu.js) ---------- */
/* une bulle verte comme le sceau des missions à 3 points, bordée d'or, qui luit doucement : on a envie de la toucher ;
   « Compris ➜ » comme les boutons du jeu */
.aide-bulle { position: fixed; z-index: 45; max-width: min(290px, calc(100vw - 16px)); padding: 12px 15px 11px; border-radius: 16px;
  background: linear-gradient(180deg, #44a872, #258851 55%, #1b6a3d); color: #fff8e8;
  border: 2px solid var(--laiton-clair); text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  font: 700 1rem / 1.32 var(--texte); text-align: center; cursor: pointer;
  animation: aide-flotte 2.4s ease-in-out infinite, aide-lueur 2.4s ease-in-out infinite; }
.aide-bulle::after { content: ""; position: absolute; left: var(--fleche, 50%); bottom: -9px; width: 16px; height: 16px; margin-left: -8px;
  background: #1b6a3d; border: 2px solid var(--laiton-clair); border-top: 0; border-left: 0; transform: rotate(45deg); }
.aide-bulle.dessous::after { bottom: auto; top: -9px; background: #44a872; transform: rotate(-135deg); }
.aide-bulle .aide-ok { display: flex; width: fit-content; align-items: center; gap: 7px; margin: 9px auto 0; padding: 5px 16px; border-radius: 999px;
  background: linear-gradient(180deg, var(--laiton-clair), var(--laiton)); color: var(--encre); text-shadow: none;
  border: 1px solid var(--laiton-fonce); box-shadow: 0 2px 0 var(--laiton-fonce), 0 3px 8px rgba(0, 0, 0, .3); font-size: .92rem; }
.aide-bulle .aide-ok::after { content: "➜"; display: inline-block; animation: elan 1.3s ease-in-out infinite; }
.aide-bulle:hover .aide-ok { filter: brightness(1.08); }
.aide-bulle:active .aide-ok { transform: translateY(2px); box-shadow: 0 0 0 var(--laiton-fonce), 0 2px 5px rgba(0, 0, 0, .25); }
@keyframes aide-flotte { 50% { translate: 0 -4px; } }
@keyframes aide-lueur { 0%, 100% { box-shadow: 0 6px 18px rgba(0, 0, 0, .5), 0 0 0 0 rgba(234, 209, 154, .55); }
  50% { box-shadow: 0 6px 18px rgba(0, 0, 0, .5), 0 0 0 7px rgba(234, 209, 154, 0); } }
@media (prefers-reduced-motion: reduce) { .aide-bulle, .bienvenue, .bv-suite, .aide-bulle .aide-ok::after { animation: none; } }

/* ================= Collection : plis cachetés, sceaux, éclat et relief des cartes (novembre 2026) ================= */
/* ---- le relief : la carte penche vers le doigt ou la souris, un reflet glisse dessus */
.relief { position: relative; transform: perspective(700px) translateY(var(--ty, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform .5s cubic-bezier(.2, .9, .3, 1.25); -webkit-tap-highlight-color: transparent; }
.relief.penche { transition: transform .09s linear; }
.relief .reflet { position: absolute; inset: 0; z-index: 4; border-radius: 9px; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .55), rgba(255, 255, 255, .12) 32%, transparent 58%);
  mix-blend-mode: soft-light; }
.relief.penche .reflet { opacity: 1; }
/* argent : un voile froid qui suit la lumière ; or : un reflet doré irisé, comme une dorure à la feuille */
.relief.eclat-argent .reflet { mix-blend-mode: overlay;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .7), transparent 45%),
    linear-gradient(115deg, transparent 30%, rgba(214, 226, 240, .5) calc(var(--mx, 50%) - 8%), rgba(255, 255, 255, .65) var(--mx, 50%), rgba(190, 204, 222, .45) calc(var(--mx, 50%) + 8%), transparent 70%); }
.relief.eclat-or .reflet { mix-blend-mode: color-dodge; opacity: .35;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 236, 170, .75), transparent 42%),
    linear-gradient(115deg, transparent 22%, rgba(255, 196, 80, .45) calc(var(--mx, 50%) - 12%), rgba(255, 246, 200, .7) var(--mx, 50%), rgba(240, 170, 60, .4) calc(var(--mx, 50%) + 12%), transparent 78%); }
.relief.eclat-or.penche .reflet { opacity: .85; }
.revue.relief .reflet { border-radius: 14px; }
.revue.relief:has(.main-faces.retournee) .reflet { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .relief { transform: none !important; transition: none; } .relief .reflet { display: none; } }

/* ---- l'éclat des cartes gagnées plusieurs fois */
.eclat-argent .carte, .revue.eclat-argent .main-recto .carte { border-color: #e9edf2;
  box-shadow: 0 0 0 1.5px #9ea8b4, 0 0 0 3px rgba(233, 237, 242, .55), 0 0 14px 2px rgba(214, 224, 236, .35), 0 6px 14px rgba(0, 0, 0, .35); }
.eclat-or .carte, .revue.eclat-or .main-recto .carte { border-color: #f6dc8c;
  box-shadow: 0 0 0 1.5px #a47a22, 0 0 0 3.5px rgba(246, 214, 128, .7), 0 0 18px 4px rgba(243, 200, 96, .45), 0 6px 14px rgba(0, 0, 0, .35); }
.eclat-or .carte .legende { background: linear-gradient(180deg, color-mix(in srgb, var(--u) 70%, #f6dc8c 30%), var(--u) 45%, color-mix(in srgb, var(--u) 65%, #3a2606)); }
.mc-case { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
/* (passe devant l'ancien « .mc-carte:hover { translateY } » qui effaçait l'inclinaison) */
.mc-carte.relief, .mc-carte.relief:hover { transform: perspective(700px) translateY(var(--ty, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.mc-carte.relief:not(.penche) { transition: transform .5s cubic-bezier(.2, .9, .3, 1.25); }
.mc-carte.relief:hover { --ty: -4px; }

/* ---- Mon Cabinet : les plis */
.mc-plis { max-width: 560px; margin: 0 auto 12px; padding: 12px 16px; }
.mc-univers.complet { border-color: #f3d27a; box-shadow: 0 0 0 1px rgba(243, 210, 122, .4), 0 0 14px rgba(243, 210, 122, .25); }

/* ---- le petit pli (décor) */
.pli-mini { position: relative; display: inline-block; width: 58px; height: 44px; flex: none; border-radius: 4px;
  background: url("../medias/pli/papier.jpg") center / cover; box-shadow: 0 3px 8px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(120, 88, 30, .35); }
.pli-mini.pile::before, .pli-mini.pile::after { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 4px;
  background: url("../medias/pli/papier.jpg") center / cover; box-shadow: 0 2px 5px rgba(0, 0, 0, .4); filter: brightness(.88); }
.pli-mini.pile::before { transform: rotate(-9deg) translate(-4px, 2px); }
.pli-mini.pile::after { transform: rotate(7deg) translate(4px, 1px); }
.pli-mini-rabat { position: absolute; inset: 0 0 auto; height: 62%; background: linear-gradient(180deg, #efe0bb, #dcc794);
  clip-path: polygon(0 0, 100% 0, 50% 100%); }
.pli-mini-sceau { position: absolute; left: 50%; top: 62%; width: 18px; height: 18px; margin: -9px 0 0 -9px; background: url("../medias/medaillon-or.png") center / cover;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.zone-plis { display: flex; align-items: center; gap: 16px; text-align: left; }
.zone-plis p { margin: 0; }
.zone-plis.vide { gap: 14px; }
.zone-plis.vide p { font-size: .92rem; color: var(--encre-douce); }
.zone-plis.vide .pli-mini { opacity: .6; filter: saturate(.5); }
.zone-plis-pile { position: relative; isolation: isolate; flex: none; padding: 8px 10px; border: 0; background: none; cursor: pointer; animation: pli-appel 2.8s ease-in-out infinite; }
.zone-plis-pile .pli-mini { width: 70px; height: 52px; }
.zone-plis-pile .pli-mini-sceau { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
.zone-plis-n { position: absolute; top: -2px; right: -4px; min-width: 22px; height: 22px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px;
  font: 800 .8rem/1 var(--chiffres); color: #fff6e0; background: radial-gradient(circle at 35% 30%, #c4544a, #8e2a24 70%); border: 1px solid #f3d27a; box-shadow: 0 2px 4px rgba(0, 0, 0, .4); }
.zone-plis-titre { font: 400 1.18rem/1.15 var(--titre); color: var(--bordeaux); }
.zone-plis-texte .petit { margin: 3px 0 9px; }
@keyframes pli-appel { 0%, 78%, 100% { transform: none; } 84% { transform: rotate(-6deg) scale(1.06); } 90% { transform: rotate(5deg) scale(1.06); } 95% { transform: rotate(-2deg); } }
@media (max-width: 420px) { .zone-plis { gap: 10px; } .zone-plis-pile { padding: 6px 4px; } }

/* ---- le cachet de l'onglet « Mon Cabinet » : les plis à ouvrir */
.onglet-badge { position: absolute; top: 1px; left: calc(50% + 5px); min-width: 17px; height: 17px; padding: 0 4px; display: grid; place-items: center; border-radius: 999px;
  font: 800 .66rem/1 var(--chiffres); color: #fff6e0; background: radial-gradient(circle at 35% 30%, #c4544a, #8e2a24 70%);
  border: 1px solid rgba(243, 210, 122, .85); box-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.onglet-badge.arrive { animation: badge-arrive .7s cubic-bezier(.3, 1.8, .5, 1); }
.acc-onglet.recoit svg { animation: onglet-recoit .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes badge-arrive { from { transform: scale(0); } }
@keyframes onglet-recoit { 40% { transform: scale(1.35) translateY(-2px); color: var(--laiton-clair); } }

/* ---- le bilan de la partie (fins de partie) */
.bilan-cabinet { max-width: 620px; margin: 0 auto 18px; text-align: center; }
.bilan-cabinet h2 { margin-bottom: 2px; }
.bilan-compte { margin: 0 0 6px; font-variant-numeric: tabular-nums; color: var(--encre-douce); }
.bilan-compte strong { font: 700 1.7rem var(--chiffres); color: var(--feutre); }
.bilan-plus { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; font: 800 .85rem var(--chiffres); color: #fff8e8; background: var(--juste);
  animation: annonce-mission .6s cubic-bezier(.3, 1.6, .5, 1) 1.6s both; }
.bilan-jauge { height: 9px; max-width: 420px; margin: 0 auto 12px; background: rgba(107, 90, 69, .2); }
.bilan-jauge > span { transition: width 1.3s cubic-bezier(.3, .8, .3, 1); }
.bilan-nouvelles { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 4px 0 16px; }
.bilan-carte { position: relative; width: 82px; padding: 0; border: 0; background: none; cursor: pointer; animation: cab-carte-entree .5s cubic-bezier(.3, 1.5, .5, 1) backwards;
  animation-delay: calc(.9s + var(--i) * .18s); }
.ruban-nouvelle { position: absolute; left: 50%; bottom: -7px; z-index: 5; translate: -50% 0; padding: 1px 8px; border-radius: 4px; white-space: nowrap;
  font: 800 .58rem var(--texte); letter-spacing: .06em; text-transform: uppercase; color: #3a2606; background: linear-gradient(180deg, #fbe3a0, #e0b14a); box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.bilan-cabinet .zone-plis { justify-content: center; margin-top: 4px; padding-top: 12px; border-top: 1px dashed rgba(160, 120, 50, .45); }
@media (prefers-reduced-motion: reduce) { .bilan-carte, .bilan-plus, .zone-plis-pile { animation: none; } .bilan-jauge > span { transition: none; } }

/* ---- l'ouverture d'un pli : la scène */
body.pli-ouvert { overflow: hidden; }
.pli-scene { --w: min(270px, 68vw, 38vh); position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 56px 16px calc(24px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; -webkit-tap-highlight-color: transparent; }
.pli-scene.part { pointer-events: none; }
.pli-lueur { position: fixed; inset: 0; z-index: -1; transition: opacity .45s ease;
  background: radial-gradient(ellipse 60% 45% at 50% 40%, rgba(255, 226, 160, .2), transparent 70%), radial-gradient(ellipse 120% 90% at 50% 45%, rgba(8, 26, 19, .93), rgba(3, 10, 7, .985));
  animation: fondu .35s ease both; }
.pli-scene.part .pli-lueur, .pli-scene.part .pli-texte, .pli-scene.part .pli-actions, .pli-scene.part .pli-fermer, .pli-scene.part .pli-rayons { opacity: 0; transition: opacity .3s ease; }
.pli-scene.part:not([data-etat="range"]) .pli-poste { opacity: 0; transition: opacity .25s ease; }
.pli-poste { position: relative; flex: none; width: var(--w); min-height: calc(var(--w) * 1.3 + 40px); }
.pli-fermer { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 8; float: none; margin: 0; display: grid; place-items: center; padding: 0; }

/* l'enveloppe : le fond (intérieur), la carte, la poche (devant, avec ses plis), le rabat, le sceau */
.pli-enveloppe { position: absolute; left: 0; right: 0; top: calc(var(--w) * .2); height: calc(var(--w) * 1.16); cursor: pointer;
  filter: drop-shadow(0 22px 26px rgba(0, 0, 0, .6));
  animation: pli-arrive .8s cubic-bezier(.2, 1.3, .4, 1) both, pli-flotte 5s ease-in-out .8s infinite; }
@keyframes pli-arrive { from { opacity: 0; transform: perspective(900px) translateY(-60px) rotateX(30deg) rotateZ(-10deg) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes pli-flotte { 0%, 100% { transform: perspective(900px) translateY(0) rotateX(3deg) rotateY(-7deg) rotateZ(-1deg); }
  50% { transform: perspective(900px) translateY(-9px) rotateX(-3deg) rotateY(7deg) rotateZ(1deg); } }
.pli-fond { position: absolute; inset: 0; z-index: 1; border-radius: 7px; background: url("../medias/pli/papier.jpg") center / cover; filter: brightness(.62) sepia(.2); }
.pli-carte { position: absolute; left: 0; right: 0; top: 3%; z-index: 2; perspective: 1200px; transform: scale(.74); transform-origin: 50% 0;
  transition: transform .85s cubic-bezier(.2, .85, .3, 1); }
.pli-scene.carte-sort .pli-enveloppe .pli-carte { transform: translateY(-60%) scale(.74); }
.pli-carte.libre { position: relative; inset: auto; z-index: 6; width: 100%; transform: none; transition: none; cursor: pointer; }
.pli-poche { position: absolute; inset: 0; z-index: 3; border-radius: 7px; background: url("../medias/pli/papier.jpg") center 70% / cover;
  clip-path: polygon(0 0, 50% 46%, 100% 0, 100% 100%, 0 100%); }
.pli-poche::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(60, 36, 8, .2), transparent 28%, transparent 72%, rgba(60, 36, 8, .2)),
  linear-gradient(180deg, transparent 55%, rgba(255, 248, 225, .22) 80%, rgba(60, 36, 8, .12)); }
.pli-pan { position: absolute; top: 58%; width: 50%; height: 42%; }
.pli-pan.g { left: 0; background: linear-gradient(to bottom right, transparent calc(50% - 1.2px), rgba(96, 62, 20, .5) 50%, rgba(255, 250, 230, .35) calc(50% + 1.2px), transparent calc(50% + 3px)); }
.pli-pan.d { right: 0; background: linear-gradient(to bottom left, transparent calc(50% - 1.2px), rgba(96, 62, 20, .5) 50%, rgba(255, 250, 230, .35) calc(50% + 1.2px), transparent calc(50% + 3px)); }
.pli-rabat { position: absolute; left: 0; right: 0; top: 0; height: 50%; z-index: 4; transform-origin: 50% 0; transform: perspective(800px) rotateX(0deg);
  filter: drop-shadow(0 3px 3px rgba(40, 24, 6, .45)); transition: transform .65s cubic-bezier(.45, 0, .25, 1), z-index 0s linear .3s; }
.pli-rabat::before { content: ""; position: absolute; inset: 0; border-radius: 7px 7px 0 0; background: url("../medias/pli/papier.jpg") center 20% / cover;
  clip-path: polygon(0 0, 100% 0, 50% 92%); transition: filter .65s; }
.pli-scene.rabat-ouvert .pli-rabat { transform: perspective(800px) rotateX(180deg); z-index: 1; }
.pli-scene.rabat-ouvert .pli-rabat::before { filter: brightness(.78); }
.pli-sceau { position: absolute; left: 50%; top: 46%; z-index: 5; width: 31%; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer;
  transform: translate(-50%, -50%); filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .55)); animation: sceau-appel 2.6s ease-in-out 1s infinite; }
.pli-sceau img { width: 100%; height: 100%; }
.pli-plume { position: absolute; inset: 24% 20% 26%; background: url("../medias/pli/plume-sceau.png") center / contain no-repeat; opacity: .72; mix-blend-mode: multiply; transition: opacity .12s; }
.pli-scene.sceau-brise .pli-plume { opacity: 0; }
.pli-sceau:focus-visible { outline: 2px solid var(--laiton-clair); outline-offset: 4px; border-radius: 50%; }
@keyframes sceau-appel { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.07); filter: drop-shadow(0 4px 5px rgba(0, 0, 0, .55)) drop-shadow(0 0 12px rgba(255, 214, 120, .7)); } }
.pli-scene.sceau-brise .pli-sceau { animation: sceau-saute .55s cubic-bezier(.5, -.5, .8, .6) forwards; pointer-events: none; }
@keyframes sceau-saute { 0% { transform: translate(-50%, -50%) scale(1); }
  30% { transform: translate(-50%, -50%) scale(1.22) rotate(-10deg); filter: drop-shadow(0 0 16px rgba(255, 220, 140, .95)); }
  100% { transform: translate(40%, -330%) scale(.45) rotate(170deg); opacity: 0; } }
.pli-scene.enveloppe-part .pli-enveloppe { animation: pli-part .6s cubic-bezier(.5, 0, .9, .5) forwards; pointer-events: none; }
@keyframes pli-part { to { opacity: 0; transform: perspective(900px) translateY(55%) rotateX(-25deg) rotateZ(6deg) scale(.9); } }

/* la carte : face cachée (le dos), puis le recto */
.pli-faces { display: grid; transform-style: preserve-3d; transform: rotateY(180deg); transition: transform 1s cubic-bezier(.35, 1.25, .4, 1); }
.pli-scene.revele .pli-faces { transform: rotateY(0deg); }
.pli-scene.revele.def .pli-faces { transform: rotateY(180deg); }
.pli-face { grid-area: 1 / 1; min-width: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.pli-recto .carte { box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 26px 50px rgba(0, 0, 0, .6), 0 8px 16px rgba(0, 0, 0, .4); }
.pli-dos { position: relative; transform: rotateY(180deg); display: grid; place-items: center; aspect-ratio: 459 / 610; border-radius: 9px; overflow: hidden;
  background: url("../medias/verso.jpg") center / 100% 100%; border: 2px solid var(--parchemin); box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 12px 26px rgba(0, 0, 0, .5); }
.pli-recto:not(:empty) + .pli-dos { aspect-ratio: auto; }
.pli-dos-logo { width: 78%; mix-blend-mode: multiply; opacity: .82; }
.pli-dos-r { position: absolute; top: 1.2%; right: 2.5%; width: 15%; text-align: center; font: 400 1.9rem/1.3 var(--titre); color: var(--laiton-clair); }
.pli-dos.def { place-items: stretch; height: 0; min-height: 100%; overflow-y: auto; background: url("../medias/pli/papier.jpg") center / cover; }
.pli-def { display: flex; flex-direction: column; justify-content: center; min-height: 100%; padding: 20px 20px 18px; color: var(--encre); text-align: left; font-size: 1.08rem; line-height: 1.42; }
.pli-def p { margin: 0 0 .7em; }
.pli-def-mot { font: 400 1.5rem/1.1 var(--titre); color: var(--feutre); margin-bottom: 0 !important; }
.pli-def-u { font: 800 .72rem var(--texte); letter-spacing: .05em; text-transform: uppercase; color: var(--encre-douce); }
.pli-def-origine { font-size: .9rem; color: var(--encre-douce); }
/* l'éclat du retournement, plus fort selon la rareté ; l'éclat d'une carte qu'on avait déjà */
.pli-scene.revele .pli-recto .carte { animation: pli-lueur-carte 1.6s ease-out .25s both; }
@keyframes pli-lueur-carte { 0% { box-shadow: 0 0 0 2px #fff4cf, 0 0 70px 26px var(--lueur, rgba(255, 236, 190, .8)); } 100% { box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 26px 50px rgba(0, 0, 0, .6), 0 8px 16px rgba(0, 0, 0, .4); } }
.pli-scene[data-r="3"] { --lueur: rgba(214, 228, 246, .95); }
.pli-scene[data-r="4"] { --lueur: rgba(255, 206, 96, 1); }
.pli-carte.eclat-argent .pli-recto .carte { animation: none; box-shadow: 0 0 0 2px #9ea8b4, 0 0 0 4px rgba(233, 237, 242, .6), 0 0 26px 6px rgba(214, 224, 236, .45), 0 26px 50px rgba(0, 0, 0, .6); }
.pli-carte.eclat-or .pli-recto .carte { animation: none; box-shadow: 0 0 0 2px #a47a22, 0 0 0 4.5px rgba(246, 214, 128, .75), 0 0 30px 8px rgba(243, 200, 96, .5), 0 26px 50px rgba(0, 0, 0, .6); }
.pli-rayons { position: absolute; left: 50%; top: 42%; z-index: 0; width: 280%; aspect-ratio: 1; margin: -140% 0 0 -140%; border-radius: 50%; pointer-events: none; opacity: 0;
  transform: scale(.2); transition: opacity .7s ease, transform 1.1s cubic-bezier(.2, 1, .3, 1);
  background: repeating-conic-gradient(from 0deg, transparent 0 8deg, var(--rayon-c, rgba(255, 238, 196, .16)) 8deg 12deg);
  -webkit-mask: radial-gradient(circle, #000 12%, transparent 66%); mask: radial-gradient(circle, #000 12%, transparent 66%); }
.pli-scene.revele .pli-rayons { opacity: .75; transform: scale(1); animation: rayons-tournent 40s linear infinite; }
.pli-scene[data-r="3"] .pli-rayons { --rayon-c: rgba(214, 228, 246, .26); }
.pli-scene[data-r="4"] .pli-rayons { --rayon-c: rgba(255, 210, 110, .34); }
.pli-scene[data-r="4"].revele .pli-rayons { opacity: 1; }
@keyframes rayons-tournent { to { rotate: 360deg; } }
.pli-paillette { position: absolute; left: 50%; top: 42%; z-index: 1; width: 9px; height: 9px; margin: -4.5px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, #fffbe8 0 25%, #f3d27a 45%, transparent 70%); animation: paillette-part var(--t) cubic-bezier(.1, .75, .3, 1) forwards; }
.pli-scene[data-r="3"] .pli-paillette { background: radial-gradient(circle, #fff 0 25%, #c9d6e6 45%, transparent 70%); }
@keyframes paillette-part { 0% { transform: translate(0, 0) scale(var(--s)); opacity: 1; } 100% { transform: translate(var(--x), var(--y)) scale(0); opacity: 0; } }

/* les textes et les boutons */
.pli-texte { position: relative; z-index: 7; max-width: 36ch; min-height: 3em; text-align: center; transition: opacity .3s ease; }
.pli-texte.cache { opacity: 0; }
.pli-texte.montre { animation: pli-texte-entre .55s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes pli-texte-entre { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.pli-titre { margin: 0; font: 400 1.45rem/1.15 var(--titre); color: var(--laiton-clair); text-shadow: 0 2px 6px rgba(0, 0, 0, .7); }
.pli-aide { margin: 5px 0 0; color: var(--creme); font-size: .98rem; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
.pli-actions { position: relative; z-index: 7; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 46px; opacity: 0; }
.pli-actions.montre { opacity: 1; transition: opacity .4s ease .1s; }
.pli-actions .btn.sec { background: rgba(10, 30, 22, .6); }
.pli-suivant { display: inline-flex; align-items: center; gap: 10px; }
.pli-suivant .pli-mini { width: 34px; height: 25px; }
.pli-suivant .pli-mini-sceau { width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; }
@media (max-height: 640px) { .pli-scene { justify-content: flex-start; padding-top: 50px; } .pli-titre { font-size: 1.25rem; } }
@media (prefers-reduced-motion: reduce) {
  .pli-enveloppe, .pli-sceau, .pli-lueur, .pli-texte.montre, .pli-scene.revele .pli-recto .carte { animation: none; }
  .pli-faces, .pli-carte, .pli-rabat { transition: none; }
  .pli-scene.revele .pli-rayons { animation: none; }
}

/* ---- la jauge des 4 épreuves d'une carte (icônes du dé), et le dos de la carte pour réviser */
.jauge-epreuves { display: flex; justify-content: center; gap: 4px; height: 20px; }
.jauge-epreuves img { width: 19px; height: 19px; border-radius: 50%; padding: 1.5px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(234, 209, 154, .22);
  filter: grayscale(1) brightness(.75); opacity: .38; transition: opacity .3s, filter .3s; }
.jauge-epreuves img.faite { filter: none; opacity: 1; background: #f6ecd4; border-color: #f3d27a; box-shadow: 0 0 6px rgba(243, 210, 122, .65); }
.jauge-epreuves.vide { visibility: hidden; }
.revue-jauge { gap: 10px; height: 36px; margin: 16px auto 0; }
.revue-jauge img { width: 34px; height: 34px; padding: 3px; }
.revue-jauge + .revue-aide { margin-top: 6px; }
.verso-revision { padding-bottom: 14px; }
.revision { display: grid; gap: 9px; margin-top: 6px; text-align: left; }
.rev-epreuve { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: start; padding: 7px 9px; border-radius: 9px;
  background: rgba(255, 251, 240, .55); border: 1px solid rgba(70, 48, 22, .18); color: var(--encre); }
.rev-epreuve img { width: 30px; height: 30px; filter: grayscale(1); opacity: .4; }
.rev-epreuve.faite { background: rgba(255, 251, 240, .85); border-color: rgba(160, 120, 50, .5); }
.rev-epreuve.faite img { filter: none; opacity: 1; }
.rev-epreuve strong { display: block; font: 700 .86rem var(--texte); letter-spacing: .02em; color: var(--bordeaux); }
.rev-epreuve p { margin: 1px 0 0; font-size: .92rem; line-height: 1.32; }
.rev-epreuve .vrai { color: var(--juste); } .rev-epreuve .faux { color: var(--faux); }
.rev-expl { display: block; margin-top: 2px; font-size: .85rem; color: var(--encre-douce); }
.rev-a-gagner { font-style: italic; color: var(--encre-douce); }

/* ---- les cartes pas encore gagnées : l'illustration grisée et floutée, le mot caché */
.carte.inconnue { box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 4px 10px rgba(0, 0, 0, .3); }
.carte.inconnue .illu { filter: grayscale(1) blur(3px) brightness(.85) contrast(.9); transform: scale(1.08); }
.carte.inconnue .legende { filter: grayscale(.75) brightness(.8); }
.carte.inconnue .mot { font-size: 1.1rem; text-align: center; opacity: .8; }
.carte.inconnue .sceau { filter: grayscale(.6); }

/* ---- classement ELO et duels en un geste */
.elo-fin { max-width: 620px; margin: 0 auto 18px; text-align: center; }
.elo-fin .champ-pseudo { justify-content: center; }
.elo-fin .erreur-pseudo { margin: 8px 0 0; }
.elo-gain { margin: 4px auto 10px; text-align: center; font: 700 1.05rem var(--texte); color: var(--laiton-clair); }
.elo-gain b { display: inline-block; padding: 2px 14px; margin-right: 4px; border-radius: 999px; font: 800 1.6rem/1.2 var(--chiffres); color: #fff8e8;
  background: linear-gradient(180deg, #4f9a6b, var(--juste) 60%, #2a5f3d); box-shadow: 0 3px 10px rgba(0, 0, 0, .35); animation: annonce-mission .6s cubic-bezier(.3, 1.6, .5, 1) .4s both; }
.elo-gain.moins b { background: linear-gradient(180deg, #c5675b, var(--faux) 60%, #7d2e26); }
.elo-gain span { color: var(--creme); font-weight: 600; }
.elo-fin .elo-gain { color: var(--feutre); }
.elo-fin .elo-gain span { color: var(--encre-douce); }
.elo-bilan { margin: 0 0 10px; }
.elo-appel { margin: 16px 0 8px; padding-top: 12px; border-top: 1px dashed rgba(160, 120, 50, .45); font-weight: 700; color: var(--bordeaux); }
.classement-moi { margin: 0 0 10px; text-align: center; color: var(--encre-douce); }
.classement-moi b { font: 800 1.25rem var(--chiffres); color: var(--feutre); }
.classement-defier { margin: 14px 0 0; text-align: center; }
.mes-duels .defier-zone { max-width: 560px; margin: 0 auto 16px; text-align: center; }
.mes-duels .defier-zone .petit { margin: 10px 0 0; }
.mes-duels > .parchemin { max-width: 760px; margin-left: auto; margin-right: auto; margin-bottom: 16px; }
.btn-defier { font-size: 1.15rem; padding: 12px 26px; }
.envoi-duel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 420px; margin: 14px auto 12px; }
.envoi-duel .btn { justify-content: center; text-align: center; text-decoration: none; }
.envoi-wa { background: linear-gradient(180deg, #4fd07c, #25a85a); border-color: #1b7a41; color: #fff; box-shadow: 0 2px 0 #1b7a41, 0 4px 10px rgba(0, 0, 0, .25); }
.envoi-sms { background: linear-gradient(180deg, #6d93c4, #3f6aa0); border-color: #2c4c75; color: #fff; box-shadow: 0 2px 0 #2c4c75, 0 4px 10px rgba(0, 0, 0, .25); }
.form-nom { display: grid; gap: 10px; }
.form-nom .petit { margin: 0; }
@media (prefers-reduced-motion: reduce) { .elo-gain b { animation: none; } }
.elo-fin .rang-boutons { justify-content: center; }

/* la tuile du défi du jour, à côté du duel (2026-11-23) */
.acc-defi-petite { background: linear-gradient(160deg, #8a5f2e, #654420); }
.acc-chapeau img.acc-defi-vignette { width: 56px; aspect-ratio: 459 / 615; object-fit: cover; border-radius: 5px; border: 2px solid rgba(243, 230, 200, .7); }
.acc-defi-petite .acc-defi-etat { display: block; margin-top: 4px; font-weight: 700; font-size: clamp(.78rem, 2.8vw, .92rem); color: #f6dc9a; }
@media (max-width: 520px) { .acc-chapeau img.acc-defi-vignette { width: 46px; } }
.defi-fin .defi-elo { margin: 4px 0 10px; text-align: center; font-size: 1rem; }
/* l'érudit de cet appareil, en surbrillance dans le classement (2026-11-23) */
.classement-table tr.moi td { background: linear-gradient(90deg, rgba(46, 140, 88, .34), rgba(46, 140, 88, .12)) !important; }
.classement-table tr.moi td:first-child { box-shadow: inset 4px 0 0 #2e8c58; }
.classement-table tr.moi td.nom::after { content: " (vous)"; font-weight: 600; font-size: .8em; color: #1f6b41; }
.classement-liste li.moi { background: linear-gradient(90deg, rgba(46, 140, 88, .3), rgba(46, 140, 88, .08)); border-radius: 6px; box-shadow: inset 4px 0 0 #2e8c58; }
.classement-moi-loin { margin: 8px 0 0; padding: 6px 10px; border-radius: 6px; background: rgba(46, 140, 88, .2); text-align: center; }
.marche.moi .podium-nom { background: rgba(46, 140, 88, .35); border-radius: 999px; padding: 0 8px; }

/* ================= Ambiance de bibliothèque ancienne (accueil et parties) : lumière, poussière dorée — voir Ambiance dans jeu.js ================= */
:root { --amb-lumiere: .8;
  /* réglages du fond (opacités de 0 à 1) ; on les ajuste en direct avec le panneau local : http://127.0.0.1:8768/?reglages */
  --voile-fond: 0;        /* voile vert sur la carte ancienne (tous les écrans) */
  --voile-sombre: .5;     /* voile plus sombre : fin de partie, Mon Cabinet et Mes duels */
  --coin-hg: .2; --coin-hd: .3; --coin-bg: .2; --coin-bd: .4; /* accueil : les 4 coins sombres */
  --pourtour: .1;         /* accueil : la pénombre tout autour */
  --lampe: .5;            /* accueil : la lampe en haut à gauche */
  --rayons: .5;           /* accueil : les rayons de la fenêtre */
}
/* au-dessus de la page, sous la barre du bas (30), les fenêtres et les cartes qui volent ; aucun clic n'est capté */
.amb-couche { position: fixed; inset: 0; pointer-events: none; z-index: 12; opacity: 0; transition: opacity 1.2s ease; }
html.amb-actif .amb-couche { opacity: 1; }
html.amb-actif .amb-lampe { opacity: var(--amb-lumiere); }
.amb-poussiere { width: 100vw; height: 100vh; }
/* la pénombre des bords */
/* accueil : pénombre marquée, coins bien sombres (24/11 : renforcée) */
.amb-ombre { background:
  radial-gradient(circle at 0 0, rgba(8, 5, 2, var(--coin-hg)), transparent 38%),
  radial-gradient(circle at 100% 0, rgba(8, 5, 2, var(--coin-hd)), transparent 34%),
  radial-gradient(circle at 0 100%, rgba(8, 5, 2, var(--coin-bg)), transparent 40%),
  radial-gradient(circle at 100% 100%, rgba(8, 5, 2, var(--coin-bd)), transparent 40%),
  radial-gradient(ellipse 80% 70% at 50% 42%, transparent 38%, rgba(8, 5, 2, var(--pourtour)) 100%); }
html.amb-mode-accueil .amb-lampe { opacity: var(--lampe); }
/* la lampe : une flaque de lumière chaude qui vacille à peine (flamme) */
.amb-lampe { mix-blend-mode: soft-light;
  background: radial-gradient(circle at 18% 12%, rgba(255, 196, 110, .85), rgba(255, 170, 80, .35) 26%, transparent 55%); }
.amb-lampe::after { content: ""; position: absolute; inset: 0; mix-blend-mode: screen;
  background: radial-gradient(circle at 18% 12%, rgba(255, 210, 140, .4), rgba(255, 190, 110, .12) 30%, transparent 48%); animation: amb-flamme 3.1s ease-in-out infinite; }
@keyframes amb-flamme { 0%, 100% { opacity: .85; } 17% { opacity: 1; } 31% { opacity: .78; } 46% { opacity: .95; } 63% { opacity: .82; } 78% { opacity: 1; } 89% { opacity: .88; } }
/* les rayons d'une fenêtre haute (accueil) : des faisceaux obliques qui respirent lentement */
html.amb-actif .amb-rayons { opacity: var(--rayons); }
.amb-rayons { mix-blend-mode: screen; overflow: hidden; }
.amb-rayons i { position: absolute; top: -20%; height: 150%; transform-origin: top center; transform: rotate(28deg);
  background: linear-gradient(180deg, rgba(255, 224, 160, .34), rgba(255, 214, 140, .13) 55%, transparent 85%);
  filter: blur(6px); animation: amb-respire var(--d) ease-in-out infinite alternate; }
.amb-rayons i:nth-child(1) { left: 58%; width: 9%; --d: 9s; }
.amb-rayons i:nth-child(2) { left: 70%; width: 4%; --d: 12s; animation-delay: -4s; }
.amb-rayons i:nth-child(3) { left: 79%; width: 7%; --d: 10s; animation-delay: -7s; }
@keyframes amb-respire { from { opacity: .45; } to { opacity: 1; } }
/* en partie : la lampe pend au-dessus de la table, pas de fenêtre */
html.amb-mode-partie .amb-rayons { opacity: 0; }
html.amb-mode-partie .amb-lampe { background: radial-gradient(ellipse 70% 45% at 50% 0%, rgba(255, 200, 120, .8), rgba(255, 175, 90, .3) 45%, transparent 75%); }
html.amb-mode-partie .amb-lampe::after { background: radial-gradient(ellipse 55% 30% at 50% 0%, rgba(255, 214, 150, .32), transparent 70%); }
html.amb-mode-partie .amb-ombre { background: radial-gradient(ellipse 95% 85% at 50% 40%, transparent 50%, rgba(8, 5, 2, calc(.55 * var(--amb-lumiere))) 100%); }
/* une question est posée : la pénombre se resserre autour de la carte (concentration) */
.amb-ombre::after { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease;
  background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 55%, rgba(6, 4, 2, calc(.5 * var(--amb-lumiere))) 100%); }
html.amb-concentration .amb-ombre::after { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .amb-lampe::after, .amb-rayons i { animation: none; } }
/* les autres applis d'envoi d'un duel : petits boutons aux couleurs de chaque appli */
.envoi-autres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 420px; margin: 0 auto 6px; }
.envoi-appli { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 4px; border-radius: 999px; cursor: pointer;
  font: 700 .82rem var(--texte); text-decoration: none; color: #fff; border: 1px solid rgba(0, 0, 0, .25); box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.envoi-messenger { background: linear-gradient(135deg, #4f8cff, #8a4dff); }
.envoi-telegram { background: linear-gradient(180deg, #37aee2, #1e96c8); }
.envoi-instagram { background: linear-gradient(45deg, #f9a13a, #e1306c 50%, #833ab4); }
.envoi-snapchat { background: #fffc00; color: #1a1a1a; }
.envoi-signal { background: #3a76f0; }
.envoi-discord { background: #5865f2; }
.envoi-autre, .envoi-copier { background: transparent; color: var(--encre); border-color: var(--laiton); box-shadow: none; }
.envoi-aide { margin: 6px auto 10px; max-width: 40ch; }

/* duel : le « ? » à côté du dé de l'adversaire (règle du Décideur et choix de l'épreuve imposée) */
.bulle-de { position: relative; }
/* (25/11) le choix de l'épreuve imposée à l'adversaire : une vignette verte ✎ collée au dé, qui luit comme un bouton */
.aide-decideur { position: absolute; right: -10px; bottom: -8px; z-index: 2; width: 28px; height: 28px; padding: 0; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font: 700 .95rem/1 var(--texte); color: #fff; background: radial-gradient(circle at 35% 30%, #5fbf86, #2e8c58 60%, #1d6640);
  border: 2px solid #fff7e2; box-shadow: 0 2px 5px rgba(0, 0, 0, .4); animation: aide-decideur-luit 1.8s ease-in-out infinite; }
.aide-decideur:hover, .aide-decideur:focus-visible { transform: scale(1.12); filter: brightness(1.1); animation-play-state: paused; }
@keyframes aide-decideur-luit { 0%, 100% { box-shadow: 0 2px 5px rgba(0, 0, 0, .4), 0 0 0 0 rgba(95, 191, 134, .7); }
  50% { box-shadow: 0 2px 5px rgba(0, 0, 0, .4), 0 0 0 6px rgba(95, 191, 134, 0), 0 0 12px 2px rgba(120, 220, 160, .75); } }
@media (prefers-reduced-motion: reduce) { .aide-decideur { animation: none; } }
.decideur-choix .impose { cursor: pointer; font: inherit; }
.decideur-choix .impose.choisie { outline: 3px solid var(--laiton); background: #fff2cf; }

/* ---- les options débloquées avec l'érudition (« Votre érudition ») et la sphère cadenassée */
.niv-rarete { margin: 2px 0 4px; font-size: .88rem; color: var(--encre-douce); font-style: italic; }
.niv-option { color: #6b4f1d; }
.niv-option img { width: 18px; height: 18px; object-fit: contain; flex: none; }
.niveau-depart:disabled .niv-option img { filter: grayscale(1); opacity: .6; }
.sphere-btn.verrou img { filter: grayscale(1); opacity: .45; }
.niveau-debloque small { font-size: .85em; font-weight: 400; }
.niveau-depart .niv-rarete { font-size: .8rem; font-style: italic; color: #7a6338; }
.a-debloquer { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; margin-left: 6px; padding: 2px 8px 2px 5px;
  border: 1px solid #c9a85a; border-radius: 999px; background: #fbf1d8; font-family: var(--texte, inherit); font-size: .72rem;
  font-weight: 700; letter-spacing: 0; text-transform: none; color: #6b4f1d; white-space: nowrap; }
.cadenas { width: 14px; height: 14px; flex: none; }
.regles-niveaux li { margin-bottom: 4px; }
.regles-option { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 1px 7px; border-radius: 999px;
  background: #fbf1d8; border: 1px solid #e2cc94; font-size: .85em; color: #6b4f1d; }
.regles-option img { width: 15px; height: 15px; object-fit: contain; }
.zone-plis.verrou .pli-mini, .zone-plis.verrou > :first-child { filter: grayscale(1); opacity: .55; }
.zone-plis.verrou .a-debloquer { margin: 0 0 4px; }

/* ---- smartphone : au retournement, les chiffres du sceau (et la vidéo, le badge) traversaient la carte, à l'envers.
   Sur certains navigateurs mobiles, un élément qui a son propre calque (z-index, vidéo, animation) ignore le
   backface-visibility de sa face : on le lui donne aussi, et chaque face est légèrement décollée (translateZ). */
.main-faces, .pli-faces, .carte-mystere .faces { -webkit-transform-style: preserve-3d; }
.main-recto { -webkit-transform: rotateY(0deg) translateZ(1px); transform: rotateY(0deg) translateZ(1px); }
.main-verso { -webkit-transform: rotateY(180deg) translateZ(1px); transform: rotateY(180deg) translateZ(1px); }
.main-face *, .pli-face *, .face-carte * { -webkit-backface-visibility: hidden; backface-visibility: hidden; }

/* ---- smartphone : la fenêtre « Votre érudition » sautait à l'ouverture. Centrée verticalement, elle bougeait dès que sa
   hauteur changeait (polices qui arrivent, barre d'adresse qui se replie et change 90vh). Elle part donc du haut, et sa
   hauteur suit l'écran réellement visible (dvh). */
.modale-boite { max-height: 90vh; max-height: 90dvh; overscroll-behavior: contain; }
.modale:has(.niveaux-depart) { place-items: start center; padding-top: max(16px, env(safe-area-inset-top)); }
.niveaux-depart .jauge, .niv-option img, .niv-recompense .cadeau { flex: none; }

/* ---- fin de partie (solo et duel) et Mon Cabinet : la carte ancienne du fond un peu plus sombre, pour lire boutons et textes */
body:has(.ecran-fin, .ecran.mon-cabinet, .ecran.mes-duels)::before {
  background: linear-gradient(rgba(8, 26, 22, var(--voile-sombre)), rgba(8, 26, 22, var(--voile-sombre))), url('../medias/accueil/fond.jpg') center / cover no-repeat #1c4a44; }

/* l'encart « Votre mission secrète » (début de partie, et en grand) : tout centré */
.mission-encart { text-align: center; }
.mission-encart img { display: block; margin-left: auto; margin-right: auto; }
/* un texte lu par les lecteurs d'écran, invisible à l'écran */
.lecteur-seul { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ================= les cartes duo : une image sans texte, deux mots contraires ================= */
.carte.duo { border-color: #e9d9b1; }
.carte.duo .illu { aspect-ratio: 459 / 615; object-position: center; }
.carte.duo .illu.miroir, .duo-image img.miroir { transform: scaleX(-1); }
.badge-duo { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); padding: 2px 12px; border-radius: 999px; white-space: nowrap;
  background: rgba(42, 29, 18, .82); color: #f3e6c8; border: 1px solid #d9b45a; font: 700 .72rem var(--texte); letter-spacing: .06em; text-transform: uppercase; }
.carte.duo.grande .badge-duo { font-size: .85rem; bottom: 12px; }
.barre:has(> .duo-lien) { flex-direction: column; gap: 6px; }
.duo-verso .verso-titre { min-height: 0; margin-bottom: 6px; }
.duo-consigne { margin: 4px 0 10px; text-align: center; font-weight: 600; }
.duo-choix { display: grid; gap: 10px; }
.duo-choix .btn { width: 100%; justify-content: center; }
.duo-etape { display: block; font-size: .75rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--bordeaux); }
.duo-palier { margin: 10px 0; font-size: .92rem; line-height: 1.35; }
.duo-verso .verdict { margin-top: 10px; padding: 8px 12px; }
.duo-ligne { margin: 0 0 6px; }
.duo-ligne .duo-consigne { margin: 0; text-align: left; flex: 1; }
.duo-image { position: relative; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .3); }
.duo-image img { display: block; width: 100%; aspect-ratio: 459 / 615; object-fit: cover; }
.duo-zone { position: absolute; top: 0; bottom: 0; width: 50%; border: 0; background: transparent; cursor: pointer; padding: 0; transition: background .25s ease, box-shadow .25s ease; }
.duo-zone.gauche { left: 0; } .duo-zone.droite { right: 0; }
.duo-zone:hover:not([disabled]) { background: rgba(255, 236, 180, .18); }
.duo-zone[disabled] { cursor: default; }
.duo-zone.juste { box-shadow: inset 0 0 0 4px var(--juste); background: rgba(70, 160, 90, .16); }
.duo-zone.faux { box-shadow: inset 0 0 0 4px var(--faux); background: rgba(200, 60, 50, .2); }
.duo-savoir { font-size: .88rem; }
.bulle-duo { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; box-shadow: 0 0 0 2px #d9b45a; }
/* la carte duo, au palier : « Êtes-vous joueur ? » */
.duo-joueur { margin: 10px 0 0; padding: 10px 12px; border-radius: 10px; background: rgba(255, 246, 220, .75); border: 1.5px dashed var(--laiton); text-align: center; }
.duo-joueur p { margin: 0 0 8px; font-size: .92rem; line-height: 1.35; }
.duo-joueur .duo-joueur-titre { font: 700 1.6rem / 1.1 var(--main); color: var(--bordeaux); margin-bottom: 6px; }
.duo-joueur .duo-choix { margin-top: 4px; }
.duo-image.reduite img { aspect-ratio: auto; height: 96px; object-position: center 35%; }
.duo-verso .duo-joueur + .verdict, .duo-verso .duo-image.reduite + .verdict { margin-top: 8px; }
.main-verso .duo-choix.suite { flex-direction: column; align-items: stretch; }
.main-verso .duo-choix.suite .btn { flex: 0 0 auto; }
.main-verso .duo-choix .btn.sec { color: var(--bordeaux); border-color: var(--bordeaux); background: rgba(255, 251, 240, .7); }
/* la démo des cartes duo (demo-duos.html) : un bandeau en haut pour choisir la carte et qui la joue */
.demo-duos { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px;
  max-width: calc(100vw - 16px); padding: 5px 8px; border-radius: 22px; background: rgba(20, 30, 22, .88); color: #f6ecd2; font: 600 .9rem var(--chiffres, sans-serif); box-shadow: 0 3px 10px rgba(0, 0, 0, .4); }
.demo-duos button { height: 32px; min-width: 32px; padding: 0 10px; border: 0; border-radius: 16px; background: rgba(255, 255, 255, .12); color: inherit; font: inherit; cursor: pointer; }
.demo-duos button:hover { background: rgba(255, 255, 255, .22); }
.demo-duos .demo-jouer { background: #c99a3a; color: #2a1a08; }
.demo-duos .demo-nom { min-width: 190px; text-align: center; white-space: nowrap; }
.en-demo-duos .app, .en-demo-duos #app { padding-top: 46px; }
/* (25/11) « Prévenir » en duel : un vrai bouton plein, bien lisible (avant : texte doré sur fond doré) */
.btn.btn-prevenir { background: linear-gradient(180deg, #2f6b55, #1d4a3a); color: #fff7e2; border-color: #143528; box-shadow: 0 2px 0 #143528, 0 4px 10px rgba(0, 0, 0, .25); }
.btn.btn-prevenir:hover { filter: brightness(1.1); }
/* reprendre sa place dans un duel depuis un autre navigateur */
.reprise-choix { display: grid; gap: 10px; max-width: 360px; margin: 14px auto; }
.prevenir { text-align: center; }
.prevenir .partage { text-align: left; font-family: inherit; }
/* (25/11) la carte duo en main : plus grande, pour que tout tienne sans défiler (image, question, « Quitte ou triple ? ») ;
   bornée par la hauteur de l'écran (la carte fait ~1,34 fois sa largeur en hauteur) */
.scene-boite.nue:has(.duo-verso) { width: min(380px, 94vw, calc((100dvh - 120px) / 1.34)); }
/* le verso de la carte duo en colonne : l'image prend la place qui reste (recadrée en hauteur, les deux personnages restent
   à gauche et à droite), si bien que tout tient dans la carte sans défiler */
.main-verso.duo-verso { display: flex; flex-direction: column; }
.main-verso.duo-verso > * { flex: none; }
.main-verso.duo-verso > .duo-image:not(.reduite) { flex: 1 1 auto; min-height: 120px; }
.duo-verso .duo-image:not(.reduite) img { height: 100%; aspect-ratio: auto; object-fit: cover; }
/* seconde question répondue : on retire la ligne épreuve/chrono et on resserre les réponses, pour que le bilan tienne aussi */
.duo-verso:has(.verdict) .verso-ligne:not(.duo-ligne) { display: none; }
.duo-verso:has(.verdict) .verso-titre { margin-bottom: 4px; }
.duo-verso:has(.verdict) .options .option { padding: 5px 8px; min-height: 0; }
.duo-verso:has(.verdict) .duo-savoir { margin-top: 6px; font-size: .84rem; line-height: 1.25; }
/* carte duo avec 5 propositions (une fois sur deux) : réponses resserrées, pour la même hauteur qu'avec 4 */
.duo-verso .options:has(> .option:nth-child(5)) { gap: 5px; }
.duo-verso .options:has(> .option:nth-child(5)) .option { padding: 5px 8px; font-size: .88rem; line-height: 1.18; min-height: 0; }
.duo-verso:has(.verdict) .options:has(> .option:nth-child(5)) .option { padding: 3px 7px; font-size: .82rem; line-height: 1.15; }
/* (25/11) la carte DUO bonus gagnée : une 5e place dans le Cabinet, bordée d'or, avec ses points dans le sceau */
.cabinet.avec-bonus { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cabinet .slot.bonus .carte { box-shadow: 0 0 0 2px #d9b45a, 0 2px 6px rgba(0, 0, 0, .3); }
.carte.duo { position: relative; }
.carte.duo.mini .badge-duo { display: none; }
.cab-zoom-place.bonus { text-align: center; }
.cab-zoom-place.bonus.seul { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
.cab-zoom-place.bonus .carte { box-shadow: 0 0 0 2px #d9b45a, 0 8px 18px rgba(0, 0, 0, .35); }
.bonus-legende { display: block; margin-top: 6px; font-weight: 700; font-size: .85rem; color: var(--bordeaux); }
/* (25/11) la carte DUO bonus à gagner : « 1/3 » dans le sceau (1 point, ou 3 au quitte ou triple) */
.carte.duo .sceau.sceau-duo b { font-size: .82rem; letter-spacing: -.03em; white-space: nowrap; }
.carte.duo.grande .sceau.sceau-duo b { font-size: 1.1rem; }
.carte.duo.mini .sceau.sceau-duo b { font-size: .55rem; }
/* (25/11) plusieurs cartes DUO bonus : empilées dans la place bonus, un peu décalées, avec « ×2 », « ×3 » */
.cabinet .slot.bonus { position: relative; display: grid; }
.cabinet .slot.bonus .bonus-carte { grid-area: 1 / 1; min-width: 0; transform: translate(calc(var(--k) * 3px), calc(var(--k) * -3px)); }
.bonus-nombre { position: absolute; left: -4px; bottom: -4px; z-index: 3; padding: 1px 5px; border-radius: 999px; background: #7a1f2b; color: #fff6e0;
  font: 800 .62rem/1.2 var(--texte); box-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
/* (25/11) les pastilles de points des cartes, un peu plus grandes (+15 % environ) */
.sceau { width: 39px; height: 39px; }
.sceau b { font-size: 1.2rem; }
.sceau small { font-size: .56rem; }
.carte.grande .sceau { width: 53px; height: 53px; }
.carte.grande .sceau b { font-size: 1.6rem; }
.carte.grande .sceau small { font-size: .66rem; }
.carte.mini .sceau { width: 27px; height: 27px; }
.carte.mini .sceau b { font-size: .9rem; }
.cab-mini .carte.mini .sceau { width: 21px; height: 21px; }
.cab-mini .carte.mini .sceau b { font-size: .7rem; }
.carte.duo .sceau.sceau-duo b { font-size: .92rem; }
.carte.duo.grande .sceau.sceau-duo b { font-size: 1.25rem; }
.carte.duo.mini .sceau.sceau-duo b { font-size: .62rem; }
