/* Pi et le Labyrinthe des Nombres : même vert que le reste du site (#16855a, #5cc79a) */
#features.pm-section { padding-top: 1em; }
.pm-outil { max-width: 72em; width: 100%; box-sizing: border-box; margin: 0 auto; text-align: left; }
.pm { position: relative; font-family: 'Nunito', 'Segoe UI', Arial, sans-serif; color: #444; -webkit-user-select: none; user-select: none; }
.pm [hidden] { display: none !important; }
.pm h2 { margin: 0 0 .4em; color: #16855a; font-size: 1.6em; line-height: 1.2; }
.pm h3 { margin: 1.3em 0 .6em; color: #16855a; font-size: 1.05em; text-align: center; letter-spacing: .04em; }
.pm [role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pm [role="button"]:focus-visible { outline: 3px solid #f2b01e; outline-offset: 2px; }
.pm-rgpd { text-align: center; color: #999; font-size: .85em; margin: 1em 0 0; }
.pm-ecran { background: #fff; border: 2px solid #e5e5e5; border-radius: 1.2em; padding: 1em 1.2em 1.4em; }
.pm-info { color: #888; text-align: center; font-size: .95em; }
.pm-centre { text-align: center; margin-top: 1em; }
.pm-bts { display: flex; flex-wrap: wrap; gap: .8em; justify-content: center; margin-top: 1.2em; }
.pm-go { display: inline-flex; align-items: center; gap: .4em; padding: .7em 1.4em; border-radius: .8em; background: #16855a; color: #fff; font-weight: 600; font-size: 1.02em; box-shadow: 0 .2em 0 #0e5c3d; }
.pm-go:hover { background: #127048; }
.pm-go:active { transform: translateY(.15em); box-shadow: 0 .05em 0 #0e5c3d; }
.pm-go2 { background: #fff; color: #16855a; border: 2px solid #16855a; box-shadow: none; }
.pm-go2:hover { background: #eaf7f1; }
.pm-mini { display: inline-flex; align-items: center; justify-content: center; min-width: 2.4em; height: 2.4em; padding: 0 .7em; border-radius: 1.2em; background: #f3f5f4; color: #555; font-weight: 700; }
.pm-mini:hover { background: #eaf7f1; color: #16855a; }

/* Accueil */
.pm-intro { display: flex; align-items: center; gap: 1.2em; max-width: 52em; margin: 0 auto; }
.pm-intro p { line-height: 1.6; margin: 0; }
.pm-portrait { width: 160px; height: 120px; flex: none; animation: pm-hop 2.2s ease-in-out infinite; }
@keyframes pm-hop { 0%, 70%, 100% { transform: none; } 80% { transform: translateY(-.5em); } }
.pm-et { color: #f2b01e; letter-spacing: .1em; font-size: 1.05em !important; }
.pm-et i { color: #ddd; font-style: normal; }
.pm-tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(14em, 1fr)); gap: .8em; }
.pm-tuile { display: flex; flex-direction: column; gap: .2em; padding: .85em 1em; border: 2px solid #e5e5e5; border-radius: 1em; color: #777; line-height: 1.4; text-align: center; transition: border-color .2s, transform .15s; }
.pm-tuile b { color: #16855a; font-size: 1.12em; font-weight: 600; }
.pm-tuile span { font-size: .88em; }
.pm-tuile:hover { border-color: #5cc79a; transform: translateY(-2px); }
.pm-tuile.actif { border-color: #16855a; box-shadow: 0 0 0 3px #d4efe3; background: #f6fcf9; }
.pm-regles { max-width: 52em; margin: 0 auto; }
.pm-regles ul { margin: 0; padding-left: 1.2em; line-height: 1.6; }
.pm-regles li { margin-bottom: .35em; list-style: disc; }

/* Le jeu : toujours entièrement visible à l'écran */
.pm-jeu { max-width: calc((100vh - 13em) * 600 / 360); min-width: min(100%, 30em); margin: 0 auto; }
.pm-jeu.tactile { max-width: calc((100vh - 22em) * 600 / 360); }
.pm-hud { display: flex; flex-wrap: wrap; align-items: center; gap: .4em 1.1em; padding: .5em .8em; margin-bottom: .5em; background: #fff; border: 2px solid #e5e5e5; border-radius: 1em; font-weight: 700; color: #333; }
.pm-titre { color: #16855a; font-family: 'Fredoka', 'Nunito', sans-serif; }
.pm-droite { margin-left: auto; display: flex; gap: .4em; }
.pm-cadre { position: relative; border-radius: 1em; overflow: hidden; border: 2px solid #e5e5e5; background: #10261b; line-height: 0; }
.pm-toile { display: block; width: 100%; aspect-ratio: 600 / 360; touch-action: none; }
.pm-voile { position: absolute; inset: 0; background: rgba(30, 50, 40, .45); display: flex; align-items: center; justify-content: center; line-height: 1.4; }
.pm-voile > div { background: #fff; border-radius: 1em; padding: 1em 1.6em; display: flex; flex-direction: column; gap: .7em; align-items: center; font-size: 1.2em; }
.pm-aide { text-align: center; color: #999; font-size: .85em; margin: .5em 0 0; }
.tactile .pm-pad { display: flex; }
.tactile .pm-aide { display: none; }

/* Fin de niveau */
.pm-fin { text-align: center; padding: 2em 1em; }
.pm-grand-et { font-size: 2.6em; }
.pm-bilan { display: inline-block; text-align: left; margin: .5em 0; padding: 0; line-height: 1.9; font-size: 1.1em; }
.pm-bilan li { list-style: none; }

/* Fenêtre de question (comme les autres jeux du site) */
#pm-modale { position: fixed; inset: 0; z-index: 10000; background: rgba(30, 50, 40, .5); display: flex; align-items: center; justify-content: center; padding: 1em; overflow: auto; }
#pm-modale > div { margin: auto; }
.pm-question { background: #fff; border-radius: 1.2em; width: 100%; max-width: 34em; padding: 1em 1.3em 1.3em; box-shadow: 0 1em 3em rgba(0, 0, 0, .25); border-top: .5em solid #f2b01e; animation: pm-pop .25s ease; }
@keyframes pm-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.pm-q-haut { display: flex; flex-wrap: wrap; gap: .4em 1em; align-items: center; font-weight: 700; color: #555; }
.pm-etoiles { color: #f2b01e; letter-spacing: .1em; }
.pm-th { margin-left: auto; padding: .1em .7em; border-radius: 1em; background: #eaf7f1; color: #16855a; font-size: .8em; }
.pm-enonce { font: 600 clamp(1.4em, 3.6vw, 2.1em)/1.4 'Fredoka', 'Nunito', sans-serif; color: #222; text-align: center; margin: .7em 0 .5em; }
.pm-enonce small { display: block; font: 400 .45em/1.4 'Nunito', sans-serif; color: #888; margin-top: .4em; }
.pm-verdict { text-align: center; font: 700 1.5em 'Fredoka', sans-serif; margin: .5em 0; animation: pm-pop .3s ease; }
.pm-verdict.ok { color: #16855a; } .pm-verdict.ko { color: #c0392b; font-size: 1.25em; }
.pm-verdict.crit { color: #d48c00; font-size: 1.8em; }
.pm-verdict small { font-size: .6em; } .pm-verdict b { color: inherit; }
.pm-correction { background: #f6fcf9; border-left: 4px solid #5cc79a; border-radius: .5em; padding: .7em 1em; line-height: 1.6; color: #333; }
.pm-chrono { position: relative; height: 2em; max-width: 22em; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .06); margin: 0 auto .7em; border-radius: 1em; background: #eef1ef; overflow: hidden; }
.pm-chrono > div { height: 100%; width: 100%; background: #16855a; border-radius: 1em; transition: width .1s linear, background .3s; }
.pm-chrono.crit > div { background: linear-gradient(90deg, #f2b01e, #ffd95e); }
.pm-chrono.urgent > div { background: #e0524d; }
.pm-chrono span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1em; color: #222; }
.pm .tn-f { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .12em; line-height: 1.1; }
.pm .tn-f > span { padding: 0 .2em; }
.pm .tn-f > span:first-child { border-bottom: .08em solid currentColor; }
.pm .tn-rac { border-top: .08em solid currentColor; padding: 0 .1em; }
.pm sup { font-size: .6em; vertical-align: super; line-height: 0; }

#pm-toast { position: fixed; left: 50%; bottom: 1.5em; transform: translate(-50%, 1em); z-index: 10001; background: #333; color: #fff; padding: .6em 1.1em; border-radius: .8em; max-width: 90%; text-align: center; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
#pm-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Plein écran (tablette projetée) : le jeu prend toute la hauteur */
.pm-outil:fullscreen { background: #fff; max-width: none; padding: .8em; overflow: auto; display: flex; flex-direction: column; justify-content: center; }
.pm-outil:fullscreen .pm-rgpd { display: none; }
.pm-outil:fullscreen .pm-jeu { width: min(100%, calc((100vh - 10em) * 600 / 360)); max-width: none; margin: 0 auto; }
.pm-outil:fullscreen .tactile { width: min(100%, calc((100vh - 19em) * 600 / 360)); }
.pm-outil:fullscreen .pm-ecran { max-height: calc(100vh - 2em); overflow: auto; }

@media (max-width: 640px) {
	.pm-intro { flex-direction: column; text-align: center; }
}

/* Vies perdues */
.pm-vies { display: inline-block; }
.pm-vies.perdu { color: #e0524d; animation: pm-secoue .35s ease 3; }
@keyframes pm-secoue { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.pm-vie { text-align: center; color: #c0392b; font-weight: 800; margin: .1em 0 .6em; }

/* Classes et mondes */
.pm-classes { grid-template-columns: repeat(4, 1fr); }
.pm-classe b { font-size: 1.5em !important; }
.pm-themes { margin: -.2em 0 .7em; font-size: .85em; color: #777; line-height: 1.4; }
@media (max-width: 640px) { .pm-classes { grid-template-columns: repeat(2, 1fr); } }

.pm-choix { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6em; margin: .4em 0 .2em; }
.pm-choix > div { display: flex; flex-direction: column; align-items: center; gap: .1em; padding: .6em .4em; border: 3px solid #16855a; border-radius: .9em; background: #fff; font: 600 1.4em 'Fredoka', 'Nunito', sans-serif; color: #222; box-shadow: 0 .15em 0 #0e5c3d; }
.pm-choix > div small { font: 700 .55em 'Nunito', sans-serif; color: #16855a; }
.pm-choix > div:hover { background: #eaf7f1; }
.pm-choix > div.bon { background: #16855a; color: #fff; }
.pm-choix > div.bon small { color: #fff; }
.pm-choix > div.faux { background: #fbe3e1; border-color: #c0392b; }
.pm-croix [data-k="h"] { grid-column: 2; grid-row: 1; }
.pm-croix [data-k="g"] { grid-column: 1; grid-row: 2; }
.pm-croix [data-k="d"] { grid-column: 3; grid-row: 2; }
.pm-croix [data-k="b"] { grid-column: 2; grid-row: 3; }
.pm-niveaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(15em, 1fr)); gap: .8em; }
.pm-niveau { display: flex; flex-direction: column; gap: .25em; padding: .8em 1em; border: 2px solid #e5e5e5; border-left: .6em solid var(--c); border-radius: 1em; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 14%, #fff), #fff 70%); transition: border-color .2s, transform .15s; }
.pm-niveau b { color: #333; font-size: 1.1em; }
.pm-niveau .pm-lieu { color: #16855a; font-weight: 700; font-size: .9em; }
.pm-niveau .pm-themes { margin: 0; }
.pm-niveau:hover { transform: translateY(-2px); border-color: #5cc79a; }
.pm-niveau.off { opacity: .55; }
.pm-niveau.off:hover { transform: none; border-color: #e5e5e5; }
/* croix tactile : une seule zone, on glisse le doigt d'une direction à l'autre (diagonales comprises) */
.pm-croix { touch-action: none; padding: .3em; border-radius: 50%; background: radial-gradient(circle, #eef1ef 55%, transparent 56%); }
.pm-croix .pm-btn { pointer-events: none; transition: background .08s; }

/* Propre au Labyrinthe : joueurs, bandeau des fruits-réponses, croix tactiles */
.pm-joueurs { display: inline-flex; gap: .9em; }
.pm-j b { color: var(--c); text-shadow: 0 0 1px #888; }
.pm-vies { font-style: normal; color: var(--c); letter-spacing: .05em; text-shadow: 0 0 1px #999; }
.pm-vies s { text-decoration: none; color: #ddd; text-shadow: none; }
.pm-rage { color: #c0392b; }
.pm-rec { color: #888; font-size: .85em; font-weight: 700; }
.pm-bandeau { margin-bottom: .5em; min-height: 3.4em; }
.pm-bq { display: flex; align-items: center; gap: .4em 1em; flex-wrap: wrap; min-height: 3.2em; box-sizing: border-box; padding: .45em .9em; background: #fffaf0; border: 2px solid #f6d58e; border-radius: 1em; line-height: 1.35; }
.pm-bq-fruits { font-size: 1.5em; letter-spacing: .1em; }
.pm-bq-txt { flex: 1; min-width: 12em; display: flex; flex-direction: column; }
.pm-bq-txt small { color: #b07a00; font-weight: 700; font-size: .8em; }
.pm-bq-q { font: 600 clamp(1.05em, 2.4vw, 1.4em)/1.35 'Fredoka', 'Nunito', sans-serif; color: #222; }
.pm-bq-ok { background: #f6fcf9; border-color: #5cc79a; color: #16855a; font: 700 1.15em 'Fredoka', 'Nunito', sans-serif; justify-content: center; }
.pm-bq-ok small { font: 600 .75em 'Nunito', sans-serif; color: #555; }
.pm-bq-ko { background: #fdf0ef; border-color: #f0b4ad; color: #c0392b; font-weight: 700; flex-direction: column; align-items: flex-start; gap: .2em; }
.pm-bq-ko b { color: #222; }
.pm-bq-corr { color: #555; font-weight: 400; font-size: .92em; }
.pm-bq-repos { background: #f6f8f7; border-color: #e5e5e5; color: #888; font-size: .9em; justify-content: center; text-align: center; }
.pm-bq .pm-chrono { margin: 0; width: 12em; height: 1.6em; font-size: .8em; flex: none; }
.pm-bq .pm-th { margin-left: 0; }
.pm-pad { display: none; justify-content: center; gap: 2em; margin-top: .6em; touch-action: none; }
.tactile .pm-pad { display: flex; }
.tactile.pm-duo .pm-pad { justify-content: space-between; }
.tactile .pm-aide { display: none; }
.pm-croix { display: grid; grid-template-columns: repeat(3, 3.6em); grid-template-rows: repeat(3, 3.6em); gap: .2em; touch-action: none; padding: .3em; border-radius: 50%; background: radial-gradient(circle, #eef1ef 55%, transparent 56%); }
.pm-btn { width: 100%; height: 100%; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f3f5f4; border: 2px solid #d5dad7; color: #16855a; font-size: 1.3em; box-shadow: 0 .2em 0 #d5dad7; pointer-events: none; transition: background .08s; }
.pm-btn.on { background: #d4efe3; transform: scale(.94); box-shadow: none; }
.pm-duo .pm-croix[data-p="1"] .pm-btn { color: #2f8f55; }
.pm-croix[data-p="0"] { --c: #f6c915; }
.pm-croix [data-k="h"] { grid-column: 2; grid-row: 1; }
.pm-croix [data-k="g"] { grid-column: 1; grid-row: 2; }
.pm-croix [data-k="d"] { grid-column: 3; grid-row: 2; }
.pm-croix [data-k="b"] { grid-column: 2; grid-row: 3; }
.pm-niveau { text-align: left; }
@media (max-width: 640px) { .pm-croix { grid-template-columns: repeat(3, 3em); grid-template-rows: repeat(3, 3em); } }

/* Hauteurs fixes : les messages ne font plus bouger le labyrinthe ni les croix tactiles */
.pm-hud { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; height: 3.2em; box-sizing: border-box; }
.pm-hud > span { flex: none; }
.pm-hud > .pm-titre { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pm-bandeau { height: 5em; min-height: 0; }
.pm-bq { height: 100%; min-height: 0; flex-wrap: nowrap; overflow: hidden; }
.pm-bq-txt { min-width: 0; overflow: auto; max-height: 100%; }
.pm-bq-q { font-size: clamp(1em, 2.2vw, 1.3em); }
.pm-bq-ko { justify-content: center; overflow: auto; }
.pm-bq-ko > span { max-width: 100%; }
.pm-bq-repos { white-space: normal; }
@media (max-width: 640px) { .pm-hud { font-size: .85em; } .pm-bq-fruits { display: none; } }
.pm-long .pm-bq-txt small, .pm-long .pm-th { display: none; }
.pm-long .pm-bq-q { font-size: clamp(.85em, 1.6vw, 1em); line-height: 1.3; }

/* Question des fruits : en grand dans la bande, sur toute la largeur, chrono en fine barre en bas */
.pm-bandeau { height: 5.4em; }
.pm-bq-fruit { position: relative; justify-content: center; text-align: center; padding: .3em 4.2em .6em; border-width: 3px; border-color: #f2b01e; background: #fff8e6; }
.pm-bq-fruit .pm-bq-q { font: 700 clamp(1.3em, 3vw, 2em)/1.25 'Fredoka', 'Nunito', sans-serif; color: #222; overflow: auto; max-height: 100%; }
.pm-bq-fruit.pm-long .pm-bq-q { font-size: clamp(1.1em, 2.2vw, 1.45em); }
.pm-bq-fruit.pm-tres-long .pm-bq-q { font-size: clamp(.95em, 1.7vw, 1.15em); font-weight: 600; }
.pm-bq-s { position: absolute; right: .7em; top: 50%; transform: translateY(-50%); font: 800 1.1em 'Fredoka', sans-serif; color: #16855a; }
.pm-bq-barre { position: absolute; left: 0; right: 0; bottom: 0; height: .4em; background: #f1e6c8; }
.pm-bq-barre > div { height: 100%; background: #16855a; transition: width .1s linear; }
.pm-bq-barre.crit > div { background: #f2b01e; }
.pm-bq-barre.urgent > div { background: #e0524d; }
/* Temps de lecture : la question au milieu du labyrinthe */
.pm-lire { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .35); line-height: 1.35; pointer-events: none; }
.pm-lire > div { pointer-events: auto; max-width: 78%; padding: .8em 1.4em 1em; background: #fff; border: 4px solid #f2b01e; border-radius: 1.2em; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .5em; box-shadow: 0 .6em 2em rgba(0, 0, 0, .35); animation: pm-pop .25s ease; }
.pm-lire small { color: #b07a00; font-weight: 800; font-size: .95em; }
.pm-lire-q { font: 700 clamp(1.3em, 3.4vw, 2.3em)/1.3 'Fredoka', 'Nunito', sans-serif; color: #222; }
.pm-lire .pm-go { font-size: .95em; padding: .5em 1.1em; }
.pm-bq-fruit .tn-f { font-size: .8em; }
