/* Qui est-ce ? mathématique : même vert que le reste du site */
#features.qe-section { padding-top: 1em; }
.qe-section [hidden], .qe-voile[hidden] { display: none !important; }
.qe-section *:focus-visible, .qe-voile *:focus-visible { outline: 3px solid #f2b01e; outline-offset: 2px; }
.qe-boite { padding: 1.3em 1.3em 1.1em 1.3em; background: #fff; border: 2px solid #e5e5e5; border-radius: 1.2em; text-align: left; }
.qe-boite h3 { margin: 0 0 .6em 0; color: #16855a; text-align: center; }
.qe-boite h3 .icon { margin-right: .3em; }
.qe-choix { display: grid; gap: 1.2em; max-width: 64em; margin: 0 auto; }
.qe-commandes { display: flex; flex-wrap: wrap; gap: .6em; justify-content: center; margin: .4em 0; }
.qe-info { margin: .9em 0 0 0; font-size: .85em; color: #666; }
.qe-centre { text-align: center; }
.qe-rgpd { margin: .8em 0 0 0; text-align: center; font-size: .78em; color: #999; }
.qe-lien { font: inherit; font-size: .85em; background: none !important; border: 0; padding: 0 !important; color: #16855a !important; text-decoration: underline; cursor: pointer; letter-spacing: 0; text-transform: none; text-shadow: none; box-shadow: none; width: auto !important; height: auto; line-height: 1.4; }
.qe-lancer { margin-top: 1.2em; }

/* Tuiles : plateaux et modes de jeu */
.qe-plateaux { display: grid; grid-template-columns: repeat(auto-fill, minmax(18em, 1fr)); gap: 1em; align-items: stretch; }
.qe-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(15em, 1fr)); gap: 1em; align-items: stretch; }
.qe-tuile { display: flex; flex-direction: column; margin: 0; padding: 0; border: 2px solid #e5e5e5; border-radius: 1em; background: #fff; overflow: hidden; text-align: left; cursor: pointer; font: inherit; line-height: 1.4; transition: border-color .2s, box-shadow .2s; -webkit-user-select: none; user-select: none; }
.qe-tuile:hover { border-color: #5cc79a; }
.qe-tuile.actif { border-color: #16855a; box-shadow: 0 0 0 3px #d4efe3; }
.qe-tuile-txt { display: block; flex: 1; padding: .8em 1em .9em 1em; color: #555; }
.qe-tuile-txt b { display: block; font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 1.2em; color: #16855a; margin-bottom: .2em; font-weight: 600; }
.qe-tuile-txt span { display: block; font-size: .9em; }
.qe-tuile-txt i { display: inline-block; margin-top: .5em; padding: .1em .7em; border-radius: 1em; background: #eaf7f1; color: #16855a; font-size: .78em; font-style: normal; font-weight: 700; }
.qe-apercu { display: flex; gap: .35em; justify-content: center; align-items: center; padding: .8em .6em; background: #f1faf6; height: 5.6em; box-sizing: border-box; overflow: hidden; }
.qe-mode { padding: 1em 1.1em; flex-direction: row; gap: .9em; align-items: center; }
.qe-mode .icon { flex: none; width: 2.2em; height: 2.2em; border-radius: 50%; background: #eaf7f1; color: #16855a; display: flex; align-items: center; justify-content: center; font-size: 1.15em; }
.qe-mode .icon:before { margin: 0; }
.qe-mode.actif .icon { background: #16855a; color: #fff; }
.qe-mode .qe-tuile-txt { padding: 0; }

/* Réglages */
.qe-champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9em 1.2em; }
.qe-large { grid-column: 1 / -1; }
@media screen and (max-width: 736px) { .qe-champs { grid-template-columns: minmax(0, 1fr); } }
.qe-champ { display: block; margin: 0; }
.qe-champ > span { display: block; margin: 0 0 .3em 0; font-size: .82em; color: #878787; }
.qe-champ input, .qe-champ select { font: inherit; width: 100%; padding: .5em .7em; border: 2px solid #e5e5e5; border-radius: .6em; background: #fff; color: #555; box-sizing: border-box; height: auto; }
.qe-champ input:focus, .qe-champ select:focus { outline: none; border-color: #16855a; }
.qe-code-ligne { display: flex !important; gap: 1em; align-items: center; }
.qe-code-ligne input { flex: 1; font-family: 'Fredoka', monospace; font-size: 1.2em; letter-spacing: .25em; text-transform: uppercase; }

/* ---------- La partie ---------- */
.qe-jeu { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 1.2em; align-items: start; }
@media screen and (max-width: 980px) { .qe-jeu { grid-template-columns: minmax(0, 1fr); } }
.qe-entete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3em 1em; margin: 0 0 .5em 0; }
.qe-entete h2 { margin: 0; font-size: 1.4em; color: #16855a; letter-spacing: 1px; }
.qe-stats { display: flex; gap: .5em; flex-wrap: wrap; }
.qe-stats span { padding: .15em .8em; border-radius: 1em; background: #eaf7f1; color: #16855a; font-size: .85em; font-weight: 700; }
.qe-message { min-height: 2.9em; margin: 0 0 .7em 0; padding: .55em .9em; border-radius: .8em; background: #f1faf6; border: 2px solid #d4efe3; color: #2f5d4a; font-size: .92em; line-height: 1.4; box-sizing: border-box; }
.qe-message.alerte { background: #fff6e5; border-color: #f2c26b; color: #7a4d00; }
.qe-message.erreur { background: #fdeceb; border-color: #eba6a2; color: #8a2a24; }
.qe-message b { color: inherit; }

/* Le plateau et ses cartes */
.qe-plateau { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: .55em; font-size: 14px; padding: .8em; background: #e3f3ea; border: 2px solid #c6e6d6; border-radius: 1.1em; }
.qe-c { position: relative; perspective: 800px; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.qe-c:before { content: ''; display: block; padding-top: 122%; }
.qe-c-in { position: absolute; top: 0; left: 0; right: 0; bottom: 0; transform-style: preserve-3d; transition: transform .55s cubic-bezier(.4, .1, .3, 1.15); }
.qe-c.bas .qe-c-in { transform: rotateX(180deg); }
.qe-recto, .qe-verso { position: absolute; top: 0; left: 0; right: 0; bottom: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: .75em; overflow: hidden; box-sizing: border-box; }
.qe-recto { display: flex; flex-direction: column; background: #fff; border: .16em solid #b9d8c8; box-shadow: 0 .1em .35em rgba(30, 80, 55, .22); transition: border-color .2s, box-shadow .2s; }
.qe-c:hover .qe-recto { border-color: #5cc79a; }
.qe-vis { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: .3em; }
.qe-vis svg { display: block; width: 100%; height: 100%; }
.qe-vis-html { font-family: 'Fredoka', 'Nunito', sans-serif; text-align: center; line-height: 1.1; color: #25473a; }
.qe-nom { flex: none; padding: .28em .25em .3em .25em; background: #16855a; color: #fff; text-align: center; font-family: 'Fredoka', 'Nunito', sans-serif; font-size: .82em; line-height: 1.15; font-weight: 500; min-height: 2.35em; display: flex; align-items: center; justify-content: center; }
.qe-verso { transform: rotateX(180deg); background: #16855a; border: .16em solid #0f6b47; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #d9f5e8; font-family: 'Fredoka', 'Nunito', sans-serif; box-shadow: 0 .1em .25em rgba(0, 0, 0, .2);
	background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .13) .12em, transparent .13em), radial-gradient(circle at 70% 60%, rgba(255, 255, 255, .1) .18em, transparent .19em); background-size: 1.6em 1.6em, 2.3em 2.3em; }
.qe-verso b { color: #d9f5e8; font-size: 2.6em; line-height: 1; font-weight: 600; }
.qe-verso small { font-size: .62em; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.qe-c.ma .qe-recto { border-color: #f2b01e; box-shadow: 0 0 0 .22em rgba(242, 176, 30, .5), 0 .1em .35em rgba(0, 0, 0, .25); }
.qe-c.ma:after { content: 'Ma carte'; position: absolute; top: -.55em; left: 50%; transform: translateX(-50%); background: #f2b01e; color: #4a3300; font-size: .7em; font-weight: 700; padding: .05em .7em; border-radius: 1em; z-index: 2; white-space: nowrap; }
.qe-c.faux .qe-recto { border-color: #d9534f; box-shadow: 0 0 0 .22em rgba(217, 83, 79, .35); }
.qe-c.pensee .qe-recto { border-color: #4a7fd9; box-shadow: 0 0 0 .22em rgba(74, 127, 217, .4); }
.qe-c.gardee .qe-recto { border-color: #16855a; box-shadow: 0 0 0 .22em rgba(22, 133, 90, .4); }
.qe-plateau.devine .qe-c:not(.bas):hover .qe-recto { border-color: #4a7fd9; box-shadow: 0 0 0 .22em rgba(74, 127, 217, .4); }
.qe-plateau.devine { border-color: #9cb8ea; background: #e9f0fc; }
.qe-plateau.fixe .qe-c { cursor: default; }
.qe-info-carte { position: absolute; right: .2em; top: .2em; width: 1.6em; height: 1.6em; border-radius: 50%; background: rgba(255, 255, 255, .92); border: .1em solid #16855a; color: #16855a; font: 700 .85em/1.4em 'Nunito', sans-serif; text-align: center; z-index: 3; cursor: help; }
.qe-info-carte:hover { background: #16855a; color: #fff; }

/* Panneau de droite */
.qe-droite { display: grid; gap: 1em; }
.qe-droite .qe-boite { padding: 1em 1.1em .9em 1.1em; }
.qe-droite h3 { font-size: 1.05em; margin-bottom: .5em; }
.qe-onglets { display: flex; flex-wrap: wrap; gap: .4em; justify-content: center; margin: 0 0 .7em 0; }
.qe-onglet { padding: .2em .9em; border-radius: 2em; border: 2px solid #e5e5e5; background: #fff; color: #878787; font-size: .85em; cursor: pointer; -webkit-user-select: none; user-select: none; transition: background-color .2s, border-color .2s, color .2s; }
.qe-onglet:hover { border-color: #5cc79a; color: #16855a; }
.qe-onglet.actif { background: #16855a; border-color: #16855a; color: #fff; }
.qe-questions { display: grid; gap: .45em; max-height: 21em; overflow-y: auto; padding: .15em; }
.qe-q { display: flex; align-items: center; justify-content: space-between; gap: .6em; padding: .5em .8em; border: 2px solid #e5e5e5; border-radius: .8em; background: #fff; color: #444; font-size: .92em; line-height: 1.3; cursor: pointer; -webkit-user-select: none; user-select: none; transition: border-color .2s, background-color .2s; }
.qe-q:hover { border-color: #5cc79a; background: #f6fcf9; }
.qe-q.posee { cursor: default; background: #f4f4f4; color: #888; border-color: #eee; }
.qe-q.posee:hover { background: #f4f4f4; border-color: #eee; }
.qe-q .qe-rep { flex: none; font-weight: 700; font-size: .85em; padding: .05em .6em; border-radius: 1em; white-space: nowrap; }
.qe-rep.oui { background: #d4efe3; color: #0f6b47; }
.qe-rep.non { background: #fbdcda; color: #9a2a24; }
.qe-journal { display: flex; flex-wrap: wrap; gap: .35em; }
.qe-puce { display: inline-block; padding: .1em .65em; border-radius: 1em; font-size: .82em; font-weight: 700; }
.qe-puce.oui { background: #d4efe3; color: #0f6b47; }
.qe-puce.non { background: #fbdcda; color: #9a2a24; }
.qe-vide { color: #999; font-size: .88em; text-align: center; margin: .2em 0; }
.qe-actions { display: grid; gap: .5em; }
.qe-act { display: flex; align-items: center; gap: .7em; padding: .55em .9em; border: 2px solid #e5e5e5; border-radius: .9em; background: #fff; color: #444; font-size: .92em; cursor: pointer; -webkit-user-select: none; user-select: none; transition: border-color .2s, background-color .2s; }
.qe-act .icon { flex: none; width: 1.9em; height: 1.9em; border-radius: 50%; background: #eaf7f1; color: #16855a; display: flex; align-items: center; justify-content: center; }
.qe-act .icon:before { margin: 0; }
.qe-act:hover { border-color: #5cc79a; background: #f6fcf9; }
.qe-act.fort { border-color: #16855a; background: #16855a; color: #fff; }
.qe-act.fort .icon { background: rgba(255, 255, 255, .22); color: #fff; }
.qe-act.fort:hover { background: #12714c; }
.qe-act.inactive { opacity: .45; pointer-events: none; }
.qe-act small { display: block; font-size: .8em; opacity: .85; }
.qe-grande-q { margin: 0 0 .7em 0; padding: .8em 1em; border-radius: .9em; background: #fffbea; border: 2px solid #f2d56b; text-align: center; font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 1.3em; line-height: 1.3; color: #5c4600; }
.qe-oui-non { display: grid; grid-template-columns: 1fr 1fr; gap: .7em; margin: 0 0 .5em 0; }
.qe-bouton-rep { padding: .8em .5em; border-radius: 1em; border: 3px solid #16855a; background: #fff; color: #16855a; text-align: center; font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 1.35em; cursor: pointer; -webkit-user-select: none; user-select: none; transition: background-color .2s, transform .15s; }
.qe-bouton-rep:hover { background: #eaf7f1; transform: translateY(-1px); }
.qe-bouton-rep.non { border-color: #c0504d; color: #b03a36; }
.qe-bouton-rep.non:hover { background: #fdeceb; }
.qe-bouton-rep.secoue { animation: qe-secoue .45s; }
@keyframes qe-secoue { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.qe-aide-expl { margin: .3em 0 0 0; padding: .6em .9em; border-radius: .8em; background: #fff6e5; border: 2px solid #f2c26b; color: #6b4300; font-size: .9em; line-height: 1.4; }
.qe-mini-carte { display: inline-block; width: 6em; vertical-align: middle; }

/* Fenêtre (confirmation, victoire…) */
.qe-voile { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 10000; background: rgba(15, 24, 48, .78); display: flex; align-items: flex-start; justify-content: center; overflow: auto; padding: 2em 1em; }
.qe-fenetre { position: relative; background: #fff; border-radius: 1.2em; padding: 1.6em 1.8em; max-width: 40em; width: 100%; box-sizing: border-box; color: #444; margin: auto 0; text-align: center; }
.qe-fenetre h2 { color: #16855a; margin: 0 0 .4em 0; }
.qe-fenetre p { margin: .5em 0; }
.qe-fenetre .qe-commandes { margin-top: 1em; }
.qe-fenetre .qe-act { justify-content: center; }
.qe-fenetre .qe-mini-carte { margin: .3em 0; }
.qe-etoiles { font-size: 2.2em; letter-spacing: .1em; color: #ddd; line-height: 1.1; }
.qe-etoiles .on { color: #f2b01e; }
.qe-fiche { margin: .8em 0; padding: .7em 1em; border-radius: .9em; background: #f1faf6; border: 2px solid #d4efe3; color: #2f5d4a; font-size: .92em; text-align: left; }
.qe-recap { margin: .6em 0 0 0; text-align: left; font-size: .88em; }
.qe-recap .qe-journal { justify-content: center; }
.qe-confetti { position: absolute; top: -1.5em; width: .55em; height: .9em; border-radius: .1em; pointer-events: none; z-index: 3; animation: qe-chute linear forwards; }
@keyframes qe-chute { to { transform: translateY(32em) rotate(540deg); opacity: .9; } }
.qe-voile:not([hidden]) .qe-fenetre { animation: qe-pop .3s ease-out; }
@keyframes qe-pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Plein écran (projection en classe) */
#vue-jeu:fullscreen { background: #fff; padding: 1.2vw 1.8vw; overflow: auto; font-size: clamp(16px, 1.15vw, 26px); display: flex; align-items: center; }
#vue-jeu:fullscreen .qe-jeu { width: 100%; }
#vue-jeu:-webkit-full-screen { background: #fff; padding: 1.2vw 1.8vw; overflow: auto; font-size: clamp(16px, 1.15vw, 26px); display: flex; align-items: center; }
#vue-jeu:-webkit-full-screen .qe-jeu { width: 100%; }

/* ---------- Version imprimée ---------- */
.qe-barre-impr { display: flex; gap: .8em; justify-content: center; flex-wrap: wrap; margin: 0 0 .4em 0; }
.qe-feuille { background: #fff; border: 2px solid #e5e5e5; border-radius: 1em; padding: 1.2em; margin: 1.2em auto 0 auto; max-width: 64em; box-sizing: border-box; }
.qe-feuille h2 { margin: 0 0 .15em 0; font-size: 1.25em; color: #16855a; text-align: center; letter-spacing: 1px; }
.qe-feuille .qe-sous-titre { margin: 0 0 .7em 0; text-align: center; color: #777; font-size: .85em; }
.qe-grille-papier { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: .5em; font-size: 14px; }
.qe-grille-papier .qe-c { perspective: none; cursor: default; height: var(--h, 36mm); }
.qe-grille-papier .qe-c:before { display: none; }
.qe-grille-papier .qe-c-in { transform: none !important; transition: none; }
.qe-grille-papier .qe-verso, .qe-grille-papier .qe-info-carte { display: none; }
.qe-grille-papier .qe-recto { box-shadow: none; border-color: #444; }
.qe-grille-papier.decoupe .qe-c { margin: 0; }
.qe-grille-papier.decoupe .qe-recto { border-style: dashed; border-width: .12em; }
.qe-memo { text-align: left; columns: 2; column-gap: 2em; font-size: .92em; line-height: 1.35; }
.qe-memo h4 { margin: .6em 0 .25em 0; color: #16855a; font-size: 1em; break-after: avoid; }
.qe-memo ul { margin: 0 0 .4em 0; padding: 0; list-style: none; }
.qe-memo li { margin: 0 0 .15em 0; padding: 0 0 0 1.4em; position: relative; break-inside: avoid; }
.qe-memo li:before { content: '☐'; position: absolute; left: 0; top: 0; color: #666; }
.qe-regle { margin: .8em 0 0 0; padding: .6em 1em; border: 2px dashed #bbb; border-radius: .8em; font-size: .88em; color: #555; }
@media screen and (max-width: 736px) { .qe-memo { columns: 1; } }
@page { size: A4 landscape; margin: 8mm; }
@media print {
	#header, #banner, #footer, .qe-pas-impr { display: none !important; }
	#features.qe-section { padding: 0 !important; }
	.container { width: 100% !important; max-width: none !important; padding: 0 !important; margin: 0 !important; }
	body, #page-wrapper { background: #fff !important; }
	.qe-feuille { border: 0; border-radius: 0; padding: 0; margin: 0; max-width: none; break-after: page; page-break-after: always; }
	.qe-feuille:last-child { break-after: auto; page-break-after: auto; }
	.qe-feuille h2 { font-size: 15pt; }
	.qe-grille-papier { font-size: 3.4mm; gap: 2.2mm; }
	.qe-regle { font-size: 3.1mm; margin-top: 3mm; padding: 2mm 3mm; }
	.qe-grille-papier .qe-c { break-inside: avoid; }
	* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Réglage « animations réduites » du système */
@media (prefers-reduced-motion: reduce) {
	.qe-section *, .qe-voile * { animation: none !important; transition: none !important; }
	.qe-confetti { display: none; }
}
body.qe-sans-anim .qe-c-in, body.qe-sans-anim .qe-section * { transition: none !important; }

/* pas de bouton « i » sur la carte reproduite dans une fenêtre */
.qe-fenetre .qe-info-carte { display: none; }
