/* ===== Lumiflor : palette du site =====
   Turquoise : 85ECE4 · 55E0D6 · 30D5C9 · 0CC9BB · 00A094
   Bleu      : 91B0EE · 6590E4 · 4275DB · 205BD0 · 0C42AC
   Vert      : 95F68B · 6AF05C · 46EB35 · 22E50E · 14D200
   Les couleurs des matières (pétales, faces du dé) et des joueurs (métalliques) viennent de
   datas/lumiflor/matieres.json : elles ne sont pas dans cette feuille.
*/
:root {
    --tq1: #85ECE4; --tq2: #55E0D6; --tq3: #30D5C9; --tq4: #0CC9BB; --tq5: #00A094;
    --bl1: #91B0EE; --bl2: #6590E4; --bl3: #4275DB; --bl4: #205BD0; --bl5: #0C42AC;
    --vt1: #95F68B; --vt2: #6AF05C; --vt3: #46EB35; --vt4: #22E50E; --vt5: #14D200;
    --juste: #14A800; --faux: #D62828;
    /* couleurs du pied de page (legal.css) */
    --colorBackLogo: rgb(149, 246, 139);
    --colorTextP: rgb(12, 66, 172);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Roboto", Arial, sans-serif;
}
[hidden] { display: none !important; }

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bl1);
}

.jeuLF {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 20px 70px;   /* place en bas pour le lien « Accueil » des petits écrans */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.titreLF {
    font-size: clamp(1.5rem, 5vw, 2.2rem);
    font-weight: 900;
    letter-spacing: 2px;
    text-align: center;
    color: var(--bl5);
    text-shadow: 0 2px 0 var(--tq1);
}

/* ----- Écran de réglages ----- */
.carteLF {
    width: 100%;
    max-width: 720px;
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    color: var(--bl5);
    background-image:
        linear-gradient(160deg, var(--tq1), var(--tq2)),
        linear-gradient(135deg, var(--bl4), var(--vt3));
    background-origin: border-box;
    background-clip: padding-box, border-box;
    border: 4px solid transparent;
    border-radius: 28px;
    box-shadow: 0 10px 30px rgba(12, 66, 172, 0.35);
}
.consigneLF { font-size: 1.15rem; }
.reglageLF { width: 100%; border: none; }
.reglageLF legend {
    width: 100%;
    margin-bottom: 10px;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
}
.puces { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.puceLF { position: relative; cursor: pointer; }
.puceLF input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.puceLF > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 6px 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.75);
    border: 3px solid var(--bl3);
    border-radius: 22px;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.puceLF small { font-size: 0.78rem; font-weight: 400; }
.puceLF .pastilleLF { margin: 0 0 3px; }
.puceLF input:checked + span {
    color: #fff;
    background: linear-gradient(135deg, var(--bl4), var(--bl3));
    border-color: var(--bl5);
}
.puceLF input:disabled + span { opacity: 0.4; cursor: not-allowed; }
.puceLF input:focus-visible + span { outline: 4px solid var(--vt4); outline-offset: 2px; }

.listeJoueurs { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.joueurLF {
    padding: 10px 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)) padding-box, var(--metal) border-box;
    border: 4px solid transparent;
    border-radius: 22px;
}
.joueurLF legend {
    display: flex;
    align-items: center;
    padding: 2px 12px;
    font-size: 1.15rem;
    font-weight: 900;
    background-color: #fff;
    border-radius: 14px;
}
.groupeLF { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.etiquetteLF { font-size: 0.9rem; font-weight: 700; }
.prenomLF {
    width: 100%;
    max-width: 240px;
    min-height: 44px;
    padding: 8px 14px;
    font-size: 1rem;
    color: var(--bl5);
    text-align: center;
    background-color: #fff;
    border: 3px solid var(--bl3);
    border-radius: 22px;
}
.prenomLF:focus-visible { outline: 4px solid var(--vt4); outline-offset: 2px; }
.noteLF { font-size: 0.95rem; font-weight: 700; }

.pastilleLF {
    display: inline-block;
    flex: none;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    vertical-align: -3px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #2C2C2A;
}

/* ----- Boutons ----- */
.boutonsLF { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px; }
.boutonLF {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 12px 34px;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 1px;
    color: #fff;
    background: linear-gradient(135deg, var(--bl4), var(--bl3));
    border: none;
    border-radius: 34px;
    cursor: pointer;
    box-shadow: 0 5px 0 var(--bl5);
    transition: transform 0.15s, box-shadow 0.15s, background 0.3s;
}
.boutonLF.petit { padding: 9px 18px; font-size: 1rem; letter-spacing: 0; }
.boutonLF:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--vt5), var(--vt3));
    color: var(--bl5);
    box-shadow: 0 5px 0 var(--tq5);
}
.boutonLF:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--tq5); }
.boutonLF:disabled { opacity: 0.45; cursor: default; }
.boutonLF.secondaire { background: linear-gradient(135deg, var(--tq5), var(--tq4)); }
.boutonLF:focus-visible, .lienLF:focus-visible, .reponseLF:focus-visible {
    outline: 4px solid var(--vt4);
    outline-offset: 3px;
}
.lienLF {
    min-height: 44px;
    padding: 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--bl5);
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
}

/* Encadré des règles */
.reglesLF {
    width: 100%;
    max-width: 720px;
    padding: 12px 20px;
    text-align: left;
    color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.8);
    border: 3px solid var(--tq3);
    border-radius: 20px;
}
.reglesLF h2 { font-size: 1.1rem; margin: 8px 0 4px; }
.reglesLF ul { padding-left: 1.3em; }
.reglesLF li { margin: 5px 0; line-height: 1.45; }
.reglesLF p { margin-top: 8px; line-height: 1.45; }

/* ----- Écran de jeu ----- */
#ecranJeu { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.bandeauLF {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px 16px;
    padding: 8px 18px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bl5);
    background-color: rgba(255, 255, 255, 0.6);
    border: 3px solid var(--tq3);
    border-radius: 26px;
}
.tourLF { display: flex; align-items: center; }
.compteurLF { font-size: 1.15rem; font-weight: 900; }

/* Les fleurs des joueurs */
.fleursLF { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.carteFleur {
    flex: 1 1 0;
    max-width: 260px;
    min-width: 0;
    padding: 6px 8px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background-color: rgba(255, 255, 255, 0.55);
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    transition: transform 0.25s, box-shadow 0.25s, background-color 0.25s;
}
.fleursLF.n1 .carteFleur { max-width: 380px; }
.fleursLF.n3 .carteFleur, .fleursLF.n4 .carteFleur { max-width: 205px; }
.carteFleur.actif, .carteFleur.gagnant {
    background: linear-gradient(#fff, #fff) padding-box, var(--metal) border-box;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(12, 66, 172, 0.35);
    transform: translateY(-3px);
}
.fleursLF.n1 .carteFleur.actif { transform: none; }
.teteFleur {
    width: 100%;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 6px;
    font-weight: 700;
    color: var(--bl5);
}
.teteFleur .pastilleLF { margin-right: 0; }
.nomFleur { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.niveauFleur { font-size: 0.8rem; font-weight: 400; }
.compteFleur { font-size: 0.85rem; padding: 0 6px; color: #fff; background-color: var(--bl4); border-radius: 10px; }
.fleurSvg { display: block; width: 100%; height: auto; overflow: visible; }
/* Pétales : LED sous du plastique coloré translucide (dessin dans lumiflor.js, dessinerFleur) */
.plastique { stroke: rgba(255, 255, 255, 0.75); stroke-width: 2; stroke-linejoin: round; }
.couchelumiere, .couchereflets, .couchenoms { pointer-events: none; }
.lumiereLF { mix-blend-mode: screen; }               /* la lumière déborde un peu sur les voisins */
.refletLF { opacity: 0.8; }
/* Éléments éclairés (plastique allumé, halo et cœur de la LED) : invisibles quand le pétale est éteint */
.lfL { opacity: 0; transition: opacity 0.45s ease-out; }
.lfL.allume { opacity: 1; }
/* LED défectueuse : elle clignote de façon irrégulière tant qu'elle n'est pas réparée
   (moins de 3 éclats par seconde) */
.lfL.allume.defaut { animation: defautLED 2.2s linear infinite; }
/* Fin de partie : chenillard sur les fleurs du gagnant. Chaque pétale brille à son tour (décalage posé par
   lumiflor.js, PAS_CHENILLARD = 200 ms ; 6 pétales = 1,2 s, la durée du cycle), puis reste à demi allumé.
   Seuls les pétales du gagnant clignotent. Moins de 3 éclats par seconde. */
.lfL.chenille, .lfL.allume.defaut.chenille { animation: chenillardLF 1.2s linear infinite; }
@keyframes chenillardLF {
    0%        { opacity: 1; }
    17%       { opacity: 1; }
    32%, 92%  { opacity: 0.3; }
    100%      { opacity: 1; }
}
@keyframes defautLED {
    0%, 30%  { opacity: 1; }
    33%      { opacity: 0.12; }
    37%      { opacity: 0.9; }
    44%      { opacity: 0.2; }
    48%, 72% { opacity: 1; }
    76%, 88% { opacity: 0.08; }
    92%      { opacity: 0.85; }
    100%     { opacity: 1; }
}
.nomPetale {
    font-size: 11.5px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: middle;
    fill: #FFFFFF;
    fill-opacity: 0.72;
    stroke: rgba(0, 0, 0, 0.45);
    stroke-width: 2.5px;
    stroke-linejoin: round;
    paint-order: stroke;
    pointer-events: none;
    user-select: none;
    transition: fill-opacity 0.45s;
}
.nomPetale.allume { fill-opacity: 1; }
.fleursLF.n3 .nomPetale, .fleursLF.n4 .nomPetale { display: none; }   /* petites fleurs : couleurs seules */
.contourMetal { fill: none; stroke-width: 7; stroke-linejoin: round; }
.filet { fill: none; stroke: rgba(0, 0, 0, 0.45); stroke-width: 1; stroke-linejoin: round; }
.petale { transform-box: fill-box; transform-origin: center; }
.petale.sAllume { animation: allume 0.9s ease-out; }
.petale.sEteint { animation: eteint 0.9s ease-out; }
@keyframes allume {
    0%   { transform: scale(0.75); filter: brightness(1.6) drop-shadow(0 0 0 #fff); }
    45%  { transform: scale(1.12); filter: brightness(1.4) drop-shadow(0 0 10px #fff8c4); }
    100% { transform: scale(1); filter: none; }
}
@keyframes eteint {
    0%   { opacity: 1; }
    40%  { opacity: 0.25; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
}

/* ----- Jeu à distance : invitation, « Rejoindre », état de la connexion ----- */
.titreCarteLF { font-size: 1.4rem; font-weight: 900; }
.lienInvitation {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    color: var(--bl5);
    text-align: center;
    background-color: #fff;
    border: 2px solid var(--bl3);
    border-radius: 12px;
}
a.boutonLF { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
/* Reprise d'une partie à distance après rechargement : la partie est rejouée en accéléré, sans animations */
.rattrapageLF .jeuLF *, .rattrapageLF .jeuLF *::before, .rattrapageLF .jeuLF *::after { transition: none !important; animation: none !important; }
.formRejoindre { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.etatDistance {
    width: 100%;
    padding: 6px 14px;
    font-weight: 700;
    text-align: center;
    color: #7A2E00;
    background-color: #FFE7C2;
    border: 2px solid #F0A23C;
    border-radius: 14px;
}

/* ----- Règle 2 « Le grand pré » : réglages et plateau ----- */
.reglagesPre { width: 100%; display: flex; flex-direction: column; gap: 12px; }
.fleursLF.preLF { flex-direction: column; align-items: center; gap: 8px; }
.scoresPre { width: 100%; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.scorePre {
    flex: 1 1 0;
    min-width: 0;
    max-width: 210px;
    padding: 4px 8px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.55);
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    color: var(--bl5);
    transition: transform 0.25s, box-shadow 0.25s;
}
.scorePre.actif, .scorePre.gagnant {
    background: linear-gradient(#fff, #fff) padding-box, var(--metal) border-box;
    border-color: transparent;
    box-shadow: 0 6px 18px rgba(12, 66, 172, 0.35);
    transform: translateY(-2px);
}
.pointsPre { font-size: 1.25rem; font-weight: 900; }
.detailPre { font-size: 0.8rem; }
/* Légende à gauche, plateau à droite. Le plateau est limité en hauteur pour que le dé et la question
   restent visibles sous lui sans faire défiler la page (environ 470 px pour le bandeau, les scores et le dé). */
.plateauPre { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; }
.plateauSvg {
    display: block;
    flex: 0 1 auto;
    min-width: 0;
    /* hauteur maximale (--hmax) ; la largeur en découle, sans dépasser la place disponible */
    --hmax: clamp(240px, calc(100vh - 470px), 640px);
    --hmax: clamp(240px, calc(100dvh - 470px), 640px);
    width: min(100%, calc(var(--hmax) * var(--ratio, 1.3)));
    height: auto;
    aspect-ratio: var(--ratio, 1.3);
    padding: 6px;
    background-color: #F4F7FC;     /* fond clair : les cases grises et les pétales sombres s'y détachent */
    border-radius: 18px;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.7), 0 6px 18px rgba(12, 66, 172, 0.25);
}
/* Cases (chemins) : gris neutre, plus clair quand le pion peut y aller */
.caseLF { fill: #C9D2DF; stroke: #FFFFFF; stroke-width: 3; transition: fill 0.25s; }
.caseLF.accessible { fill: #E8EEF7; }
.caseLF.choisissable { fill: #FFF6C2; stroke: var(--bl4); stroke-width: 5; cursor: pointer; }
.caseLF.choisissable:hover, .caseLF.choisissable:focus { fill: #FFE76A; outline: none; }
/* Contour du joueur qui a allumé le pétale, et de celui qui a gagné la fleur */
.contourPetale, .contourFleur { fill: none; stroke-linejoin: round; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.contourPetale { stroke-width: 9; filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.9)); }
.contourFleur { stroke-width: 13; filter: drop-shadow(0 0 2.5px rgba(0, 0, 0, 0.9)); }
.contourPetale.visible, .contourFleur.visible { opacity: 1; }
/* Pétales que l'on peut toucher : un trait blanc qui tourne (rouge pour éteindre un pétale adverse) */
.ciblePetale { fill: transparent; stroke: none; pointer-events: none; }
.ciblePetale.active {
    stroke: #FFFFFF;
    stroke-width: 7;
    stroke-dasharray: 16 10;
    stroke-linejoin: round;
    pointer-events: all;
    cursor: pointer;
    filter: drop-shadow(0 0 4px rgba(12, 66, 172, 0.9));
    animation: cibleLF 1.2s linear infinite;
}
.ciblePetale.active.eteindre { stroke: #FF3B3B; filter: drop-shadow(0 0 4px rgba(80, 0, 0, 0.9)); }
.ciblePetale.active:hover, .ciblePetale.active:focus { fill: rgba(255, 255, 255, 0.3); stroke-width: 10; outline: none; }
@keyframes cibleLF { to { stroke-dashoffset: -52; } }
/* Pions : disque métallique de la couleur du joueur */
.pionLF { pointer-events: none; transition: transform 0.6s ease-in-out; }
.pionLF.enMarche { transition: transform 0.28s linear; }   /* de case en case : PAS_PION = 300 ms dans lumiflor.js */
.corpsPion { stroke: #1B1B1B; stroke-width: 4; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.45)); }
.refletPion { fill: rgba(255, 255, 255, 0.55); }
.pionLF.actif .corpsPion { stroke: #FFFFFF; stroke-width: 6; }
/* Légende des couleurs des matières */
.legendePre { flex: none; display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; font-weight: 700; color: var(--bl5); white-space: nowrap; }
.puceMatiere::before {
    content: "";
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 4px;
    vertical-align: -0.1em;
    background-color: var(--couleur);
    border-radius: 3px;
}

/* Grand pré sur grand écran : le plateau (et la légende) à gauche, le dé et la question dans une
   colonne à droite ; le plateau prend la hauteur de l'écran, sans faire défiler la page. */
@media (min-width: 901px) {
    .jeuLF.modePre { max-width: 1100px; }
    #ecranJeu.modePre {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 14px 16px;
        align-items: start;
    }
    #ecranJeu.modePre > * { grid-column: 1 / -1; }
    /* les scores et le plateau deviennent des cases de la grille : le dé se centre sur le plateau seul */
    #ecranJeu.modePre > .fleursLF { display: contents; }
    #ecranJeu.modePre .scoresPre, #ecranJeu.modePre .plateauPre { grid-column: 1; }
    /* le cadre du dé a exactement la hauteur du plateau (height: 0 + min-height: 100 % : la ligne de la grille
       ne dépend que du plateau) ; si la question est trop longue, elle défile dans le cadre */
    #ecranJeu.modePre > .tableLF {
        grid-column: 2;
        grid-template-columns: 1fr;
        align-content: start;
        align-self: stretch;
        height: 0;
        min-height: 100%;
        overflow-y: auto;
    }
    #ecranJeu.modePre .scene { width: 140px; height: 140px; }
    #ecranJeu.modePre .de { scale: 0.85; }
    /* pendant une question, le dé laisse sa place aux réponses (la matière est rappelée au-dessus) */
    #ecranJeu.modePre .tableLF:has(.questionLF) .zoneDe { display: none; }
    #ecranJeu.modePre .reponsesLF { flex-direction: column; align-items: stretch; gap: 8px; }
    /* tout est centré dans le cadre, comme le dé et le nom de sa face */
    #ecranJeu.modePre .panneauLF { align-items: center; text-align: center; }
    #ecranJeu.modePre .panneauLF > * { max-width: 100%; }
    #ecranJeu.modePre .reponsesLF { align-self: stretch; }
    #ecranJeu.modePre .bandeMatiere { align-self: center; }
    #ecranJeu.modePre .quiRepond { justify-content: center; }
    #ecranJeu.modePre .panneauLF { min-height: 0; }
    #ecranJeu.modePre .plateauSvg { --hmax: clamp(300px, calc(100vh - 240px), 820px); --hmax: clamp(300px, calc(100dvh - 240px), 820px); }
}

/* Le grand pré fait 1100 px de large au lieu de 900 : on refait ici, pour ce mode seulement, les calculs de
   logoJeu.php (logo réduit pour ne pas recouvrir le jeu, lien « Accueil » en bas quand il n'y a plus la place :
   1100 + 160 = 1260 px) et de pub.php (bandeaux masqués sous 1100 + 2 × 321 + 20 = 1762 px). */
body:has(.jeuLF.modePre) .logoJeu { --libre: calc(50% - 550px); }
@media (max-width: 1260px) {
    body:has(.jeuLF.modePre) .logoJeu { display: none; }
    body:has(.jeuLF.modePre) .lienAccueilJeu { display: inline-block; }
}
@media (max-width: 1762px) {
    body:has(.jeuLF.modePre) .pubLateral { display: none; }
}

/* Grand pré : après la réponse, les autres réponses s'effacent une à une (lumiflor.js, effacerAutresReponses) */
.reponseLF.efface { overflow: hidden; pointer-events: none; animation: effaceLF 0.5s ease-in forwards; }
@keyframes effaceLF {
    0%   { opacity: 1; max-height: 80px; transform: scale(1); }
    50%  { opacity: 0; max-height: 80px; transform: scale(0.92); }
    100% { opacity: 0; max-height: 0; min-height: 0; padding-top: 0; padding-bottom: 0; border-width: 0; transform: scale(0.92); }
}

/* Grand pré sur téléphone (700 px ou moins) : le dé et la question sont dans un bandeau fixé en bas de
   l'écran ; le plateau reste visible au-dessus. Quand il faut toucher un pétale ou une case, le bandeau
   se réduit à la consigne (classe « compact », lumiflor.js). La page garde en bas la hauteur du bandeau
   (--hautBandeau, mesurée par lumiflor.js) pour que rien ne reste caché dessous. */
@media (max-width: 700px) {
    .jeuLF.modePre { padding-bottom: calc(var(--hautBandeau, 0px) + 70px); }
    body:has(.jeuLF.modePre) .lienAccueilJeu { bottom: calc(var(--hautBandeau, 0px) + 10px); }
    #ecranJeu.modePre > .tableLF {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 20;
        max-height: 62vh;
        max-height: 62dvh;
        overflow-y: auto;
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px 12px 12px;
        border-width: 3px 0 0;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -6px 18px rgba(12, 66, 172, 0.35);
    }
    #ecranJeu.modePre .zoneDe { flex-direction: row; justify-content: center; gap: 10px; }
    #ecranJeu.modePre .scene { width: 96px; height: 96px; }
    #ecranJeu.modePre .de { scale: 0.6; }
    #ecranJeu.modePre .panneauLF { min-height: 0; gap: 6px; align-items: center; text-align: center; }
    #ecranJeu.modePre .panneauLF > * { max-width: 100%; }
    #ecranJeu.modePre .bandeMatiere { align-self: center; }
    #ecranJeu.modePre .quiRepond { justify-content: center; }
    #ecranJeu.modePre .messageLF { font-size: 1rem; }
    #ecranJeu.modePre .questionLF { font-size: 1.1rem; }
    #ecranJeu.modePre .reponsesLF { align-self: stretch; flex-direction: column; align-items: stretch; gap: 8px; }
    #ecranJeu.modePre .reponseLF { min-height: 44px; padding: 6px 12px; }
    /* pendant une question, le lien « Accueil » s'efface (il passerait sur le plateau) */
    body:has(#ecranJeu.modePre .questionLF) .lienAccueilJeu { display: none; }
    #ecranJeu.modePre .tableLF:has(.questionLF) .zoneDe { display: none; }
    #ecranJeu.modePre .tableLF.compact .zoneDe { display: none; }
}

/* La table : le dé et la question */
.tableLF {
    width: 100%;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 16px;
    align-items: start;
    padding: 14px;
    background-color: #fff;
    border: 4px solid var(--tq4);
    border-radius: 22px;
    box-shadow: 0 6px 16px rgba(12, 66, 172, 0.25);
}
.zoneDe { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scene {
    width: 190px;
    height: 190px;
    perspective: 700px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.de {
    position: relative;
    width: 0;
    height: 0;
    transform-style: preserve-3d;
    transition: transform 1.5s cubic-bezier(0.2, 0.75, 0.25, 1);
}
.faceDe {
    position: absolute;
    display: flex;
    justify-content: center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    font-weight: 900;
    text-align: center;
    line-height: 1.05;
}
/* dé à 10 faces : losanges (forme, place et hauteur du texte calculées dans lumiflor.js, construireDe) */
.faceDe.losange { font-size: 10.5px; }
.faceDe.losange .texteFace {
    position: absolute;
    left: 50%;
    width: 60px;
    max-width: none;
    transform: translate(-50%, -50%);
}
.faceDe.face-arcenciel { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75); }
.faceDe.carre {
    left: -54px;
    top: -54px;
    width: 108px;
    height: 108px;
    align-items: center;
    padding: 6px;
    font-size: 15px;
    border-radius: 14px;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.45);
}
.texteFace { max-width: 70%; overflow-wrap: anywhere; }
.carre .texteFace { max-width: 100%; }
.nomFace { padding: 3px 14px; font-size: 1.1rem; font-weight: 900; text-align: center; border-radius: 14px; }
.nomFace:empty { visibility: hidden; }

.panneauLF { min-height: 190px; display: flex; flex-direction: column; gap: 10px; color: var(--bl5); }
.messageLF { font-size: 1.15rem; font-weight: 700; }
.bandeMatiere {
    align-self: flex-start;
    padding: 4px 14px;
    font-size: 0.95rem;
    font-weight: 900;
    border-radius: 14px;
}
.bandeMatiere.luciole { color: #E9FF8A; background-color: #1E2A5A; }
.bandeMatiere.arcenciel {
    color: #FFFFFF;
    background: linear-gradient(135deg, #E53935, #FB8C00 22%, #FDD835 40%, #43A047 58%, #1E88E5 78%, #8E24AA);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
}
.quiRepond { display: flex; align-items: center; font-weight: 700; }
.questionLF { font-size: 1.25rem; font-weight: 700; line-height: 1.35; }
.reponsesLF { display: flex; flex-wrap: wrap; gap: 10px; }
.reponseLF {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 18px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bl5);
    background-color: #F3F7FF;
    border: 3px solid var(--bl3);
    border-radius: 22px;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}
@media (hover: hover) {
    .reponseLF:hover:not(:disabled) { background-color: #FFF6C9; border-color: var(--bl5); }
}
.reponseLF:disabled { cursor: default; }
.reponseLF.matiereLF { border-color: rgba(0, 0, 0, 0.25); }
.reponseLF.bonne { color: #fff; background-color: var(--juste); border-color: var(--juste); }
.reponseLF.fausse { color: #fff; background-color: var(--faux); border-color: var(--faux); }
.reponseLF:disabled:not(.bonne):not(.fausse) { opacity: 0.6; }
.retourLF { min-height: 1.4em; font-size: 1.1rem; font-weight: 700; }
.retourLF.juste { color: var(--juste); }
.retourLF.faux { color: var(--faux); }
.explicationLF { display: block; margin-top: 4px; font-size: 1rem; font-weight: 400; color: var(--bl5); }

/* Fin de partie */
.finLF {
    width: 100%;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    color: var(--bl5);
    background-color: #fff;
    border: 4px solid var(--vt4);
    border-radius: 22px;
}
.gagnantLF { font-size: 1.5rem; font-weight: 900; }
.recordLF { font-size: 1.1rem; font-weight: 700; }

/* ----- L'Éclair ----- */
.eclairLF {
    position: fixed;
    inset: 0;
    z-index: 20;
    padding: 12px;
    overflow-y: auto;
    background-color: rgba(12, 30, 80, 0.88);
}
.eclairGrille {
    min-height: 100%;
    display: grid;
    gap: 12px;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 1.25fr) minmax(0, 1fr);
}
.eclairGrille.n2 { grid-template-areas: "z0 centre z1"; }
.eclairGrille.n3 { grid-template-areas: "z0 centre z1" "z2 centre ."; }
.eclairGrille.n4 { grid-template-areas: "z0 centre z1" "z2 centre z3"; }
.eclairCentre {
    grid-area: centre;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
    color: var(--bl5);
    background-color: #fff;
    border: 4px solid #FFD60A;
    border-radius: 22px;
}
.titreEclair { padding: 6px 14px; font-size: 1.05rem; font-weight: 900; border-radius: 14px; }
.questionEclair { font-size: 1.35rem; font-weight: 900; line-height: 1.35; }
.resultatEclair { min-height: 1.4em; font-size: 1.15rem; font-weight: 900; }
.zoneEclair {
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    color: var(--bl5);
    background: linear-gradient(#fff, #fff) padding-box, var(--metal) border-box;
    border: 6px solid transparent;
    border-radius: 22px;
}
.zoneEclair.z0 { grid-area: z0; }
.zoneEclair.z1 { grid-area: z1; }
.zoneEclair.z2 { grid-area: z2; }
.zoneEclair.z3 { grid-area: z3; }
.zoneEclair .reponsesLF { flex-direction: column; align-items: stretch; width: 100%; }
.zoneEclair.gagne { background: linear-gradient(#E3FBDD, #E3FBDD) padding-box, var(--metal) border-box; }
.zoneEclair.bloque { background: linear-gradient(#F2F2F2, #F2F2F2) padding-box, var(--metal) border-box; }
.teteZone { display: flex; align-items: center; font-weight: 900; font-size: 1.1rem; }
.etatZone { min-height: 1.2em; font-weight: 700; }
.zoneEclair.gagne .etatZone { color: var(--juste); }
.zoneEclair.bloque .etatZone { color: var(--faux); }

/* ----- Tablette et téléphone ----- */
@media (max-width: 700px) {
    .tableLF { grid-template-columns: 1fr; justify-items: stretch; }
    .zoneDe { flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .scene { width: 160px; height: 160px; }
    .panneauLF { min-height: 0; }
    /* Éclair : 1er humain en bas, 2e humain en haut (retourné, face à face), ordinateurs au milieu */
    .eclairGrille { display: flex; flex-wrap: wrap; align-content: space-between; gap: 10px; }
    .eclairCentre { order: 1; width: 100%; }
    .zoneEclair { width: 100%; }
    .zoneEclair.haut { order: 0; transform: rotate(180deg); }
    .zoneEclair.ordi { order: 2; width: calc(50% - 5px); flex-grow: 1; padding: 6px; }
    .zoneEclair.bas { order: 3; }
}
@media (max-width: 560px) {
    .jeuLF { padding: 14px 6px 70px; gap: 12px; }
    .carteLF { padding: 18px 10px; }
    .listeJoueurs { grid-template-columns: 1fr; }
    .bandeauLF { padding: 6px 12px; font-size: 0.95rem; }
    .boutonLF { padding: 10px 24px; font-size: 1.15rem; }
    .boutonLF.petit { padding: 8px 14px; font-size: 0.95rem; }
    .fleursLF { gap: 6px; }
    .fleursLF.n1 .carteFleur { max-width: 100%; }
    .fleursLF.n2 .carteFleur, .fleursLF.n3 .carteFleur, .fleursLF.n4 .carteFleur { flex: 1 1 40%; max-width: 50%; }
    .fleursLF.n2 .nomPetale { display: none; }
    .scorePre { flex: 1 1 40%; max-width: 50%; }
    /* téléphone : la légende passe au-dessus du plateau, qui prend toute la largeur */
    .plateauPre { flex-direction: column; gap: 6px; }
    .legendePre { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
    .plateauSvg { width: 100%; padding: 2px; border-radius: 12px; }
    .tableLF { padding: 10px; border-width: 3px; }
    .reponsesLF { flex-direction: column; align-items: stretch; }   /* boutons empilés */
    .questionLF { font-size: 1.15rem; }
    .questionEclair { font-size: 1.15rem; }
}

/* 4 réponses à une question : 2 en haut, 2 en bas, toutes de la même largeur (demande de Franck, 19/11/2026).
   Placé après les règles « boutons empilés » (téléphone, grand pré), qu'il remplace pour ce cas. */
#ecranJeu .panneauLF .reponsesLF.n4 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 10px;
}
#ecranJeu .panneauLF .reponsesLF.n4 .reponseLF { width: 100%; min-width: 0; overflow-wrap: break-word; }

@media (prefers-reduced-motion: reduce) {
    .de { transition: none; }
    .petale.sAllume, .petale.sEteint { animation: none; }
    .boutonLF, .carteFleur, .lfL, .nomPetale { transition: none; }
    .pionLF, .scorePre, .caseLF, .contourPetale, .contourFleur { transition: none; }
    .ciblePetale.active { animation: none; }
    /* sans animation, la LED défectueuse reste à demi allumée */
    .lfL.allume.defaut { animation: none; opacity: 0.4; }
    /* sans animation, pas de chenillard : les pétales du gagnant restent allumés */
    .lfL.chenille, .lfL.allume.defaut.chenille { animation: none; opacity: 1; }
}
