/* Pi et l'Académie des Sortilèges : même style que les autres jeux (vert du site #16855a, #5cc79a), décor violet nuit */
#features.ac-section { padding-top: 1em; }
.ac-outil { max-width: 72em; width: 100%; box-sizing: border-box; margin: 0 auto; text-align: left; }
.ac { position: relative; font-family: 'Nunito', 'Segoe UI', Arial, sans-serif; color: #444; -webkit-user-select: none; user-select: none; }
.ac h2, .ac h3, .ac b, .ac-go, .ac-opt, .ac-anneau, .ac-titre, .ac-mini { font-family: 'Fredoka', 'Nunito', sans-serif; }
.ac h2 { margin: 0 0 .4em; color: #16855a; font-size: 1.6em; line-height: 1.2; }
.ac h3 { margin: 1.1em 0 .6em; color: #16855a; font-size: 1.05em; text-align: center; letter-spacing: .04em; }
.ac p { margin: 0 0 .6em; line-height: 1.55; }
.ac [role="button"] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ac [role="button"]:focus-visible { outline: 3px solid #f2b01e; outline-offset: 2px; }
.ac-rgpd { text-align: center; color: #999; font-size: .85em; margin: 1em 0 0; }
.ac-ecran { background: #fff; border: 2px solid #e5e5e5; border-radius: 1.2em; padding: 1em 1.2em 1.4em; }
.ac-info { color: #888; text-align: center; font-size: .95em; }
.ac-centre { text-align: center; }
.ac-bts { display: flex; flex-wrap: wrap; gap: .8em; justify-content: center; margin-top: 1.2em; }
.ac-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; }
.ac-go:hover { background: #127048; }
.ac-go:active { transform: translateY(.15em); box-shadow: 0 .05em 0 #0e5c3d; }
.ac-go2 { background: #fff; color: #16855a; border: 2px solid #16855a; box-shadow: none; }
.ac-go2:hover { background: #eaf7f1; }
.ac-go small { font-weight: 400; opacity: .9; }
.ac-mini { display: inline-flex; align-items: center; height: 2.4em; padding: 0 .9em; border-radius: 1.2em; background: #f3f5f4; color: #555; font-weight: 600; white-space: nowrap; }
.ac-mini:hover { background: #eaf7f1; color: #16855a; }
.ac-ok { color: #16855a; font-weight: 700; }
.ac-ko { color: #c0392b; font-weight: 700; }
.ac-et { letter-spacing: .08em; font-size: 1.15em; line-height: 1; }
.ac-et .on { color: #f2b01e; }
.ac-et .off { color: #ddd; }
.ac-pi { display: block; width: 100%; height: 100%; }

/* Accueil */
.ac-intro { display: flex; align-items: center; gap: 1.2em; max-width: 54em; margin: 0 auto; }
.ac-portrait { width: 120px; height: 140px; flex: none; border-radius: 1em; padding: 6px; box-sizing: border-box; background: linear-gradient(#1c1a44, #6b4fb0); }
.ac-tuiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8em; }
.ac-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; }
.ac-tuile b { color: #16855a; font-size: 1.12em; font-weight: 600; }
.ac-tuile span { font-size: .88em; }
.ac-tuile:hover { border-color: #5cc79a; transform: translateY(-2px); }
.ac-tuile.actif { border-color: #16855a; box-shadow: 0 0 0 3px #d4efe3; background: #f6fcf9; }
.ac-regles { max-width: 54em; margin: 1.6em auto 0; border-top: 2px dashed #e5e5e5; }
.ac-regles ul { margin: 0; padding-left: 1.2em; line-height: 1.6; }
.ac-regles li { margin-bottom: .3em; }

/* Maisons */
.ac-maisons, .ac-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(12em, 1fr)); gap: .8em; }
.ac-carte { display: flex; flex-direction: column; align-items: center; gap: .15em; padding: .8em .6em; border: 2px solid #e5e5e5; border-radius: 1em; background: #fff; text-align: center; line-height: 1.35; transition: border-color .2s, transform .15s; }
.ac-carte:hover { border-color: #5cc79a; transform: translateY(-2px); }
.ac-carte b { color: #16855a; font-size: 1.12em; }
.ac-carte span { font-size: .9em; color: #666; }
.ac-carte .ac-ico { font-size: 2em; line-height: 1.2; }
.ac-blason { display: inline-flex; align-items: center; justify-content: center; width: 1.9em; height: 1.9em; border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%; font-size: 1em; flex: none; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.ac-maison .ac-blason { font-size: 2.2em !important; margin-bottom: .15em; }
.ac-maison .ac-devise { font-style: italic; color: #999; }
.ac-maison .jeu-pill { font-size: .85rem !important; }

/* Barre du haut (château et épreuves) */
.ac-barre { display: flex; align-items: center; gap: .8em; margin-bottom: .8em; }
.ac-titre { flex: 1; text-align: center; color: #16855a; font-size: 1.25em; font-weight: 600; }
.ac-pts { padding: .25em .9em; border: 2px solid #16855a; border-radius: 1.2em; background: #fff; white-space: nowrap; }
.ac-pts.ac-pop { animation: ac-pop .5s; }
.ac-pts.ac-moins { animation: ac-moins .5s; }
@keyframes ac-pop { 40% { transform: scale(1.18); background: #d4efe3; } }
@keyframes ac-moins { 40% { transform: scale(.9); background: #fbdcd8; } }

/* Le plan du château */
.ac-plan { position: relative; aspect-ratio: 16 / 9; border-radius: 1em; overflow: hidden; background: #1c1a44; }
.ac-chateau { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.ac-lieu { position: absolute; width: 27%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; gap: .1em; padding: .55em .5em .6em; border: 2px solid #fff; border-radius: 1em; background: rgba(255,255,255,.95); text-align: center; line-height: 1.3; box-shadow: 0 .25em .8em rgba(0,0,0,.35); transition: transform .15s, border-color .2s; }
.ac-lieu:hover { transform: translateY(-3px); border-color: #f2b01e; }
.ac-lieu b { color: #16855a; font-size: 1.08em; }
.ac-lieu > span { font-size: .85em; color: #666; }
.ac-lieu .ac-ico { font-size: 1.9em; line-height: 1.15; }
.ac-lieu .ac-et { font-size: 1.15em; }
.ac-lieu .ac-fait { color: #16855a; font-weight: 700; }
.ac-lieu.off { background: rgba(235,235,240,.92); cursor: default; }
.ac-lieu.off b { color: #777; }
.ac-l-vol { left: 2%; top: 4%; }
.ac-l-defense { right: 2%; top: 4%; }
.ac-l-duel { left: 2%; bottom: 4%; }
.ac-l-potion { right: 2%; bottom: 4%; }
.ac-l-exam { left: 36.5%; bottom: 4%; }
.ac-coupe h3 { margin-top: .9em; }
.ac-coupe ol, .ac-podium { list-style: none; margin: 0 0 .6em; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .6em; }
.ac-coupe li, .ac-podium li { display: flex; align-items: center; gap: .45em; padding: .4em .6em; border: 2px solid #e5e5e5; border-radius: .8em; }
.ac-coupe li.moi, .ac-podium li.moi { border-color: #16855a; background: #f6fcf9; }
.ac-rang { font-family: 'Fredoka', sans-serif; font-weight: 700; color: #999; }
.ac-nomm { flex: 1; min-width: 0; }
.ac-nomm small { color: #999; }
.ac-podium { max-width: 46em; margin: 1em auto; text-align: left; }

/* Questions */
.ac-msg { min-height: 1.6em; margin: .7em 0 .2em; text-align: center; font-size: 1.05em; }
.ac-zone { min-height: 9.5em; }
.ac-q { position: relative; max-width: 46em; margin: 0 auto; padding: .7em .8em 1.2em; border: 3px solid #f2b01e; border-radius: 1em; background: #fffaeb; box-shadow: 0 0 0 5px rgba(242,176,30,.18), 0 .3em .9em rgba(0,0,0,.1); }
/* étiquette « Question » au-dessus de chaque énoncé : on voit tout de suite où lire */
.ac-enonce::before { content: '❓ Question'; display: block; width: -moz-fit-content; width: fit-content; margin: 0 auto .35em; padding: .15em .9em; border-radius: 1em; background: #f2b01e; color: #fff; font: 600 .5em 'Fredoka', 'Nunito', sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.ac-enonce { text-align: center; font-size: 1.5em; line-height: 1.5; color: #333; margin-bottom: .5em; }
.ac-enonce small { display: block; font-size: .58em; color: #888; line-height: 1.3; }
.ac-corr { margin-top: .8em; padding-top: .7em; border-top: 2px dashed #e5e5e5; text-align: center; }
.ac-corr p { margin-bottom: .6em; }
.ac-diff { color: #f2b01e; font-size: .65em; vertical-align: middle; }
.ac-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7em; }
.ac-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .5em .3em; border: 2px solid #16855a; border-radius: .8em; background: #fff; color: #16855a; font-weight: 600; font-size: 1.35em; line-height: 1.2; }
.ac-opt:hover { background: #eaf7f1; }
.ac kbd { font-family: 'Nunito', sans-serif; font-size: .5em; font-weight: 400; color: #999; }
.ac-q .bon { background: #16855a !important; border-color: #16855a !important; color: #fff !important; }
.ac-q .faux { background: #c0392b !important; border-color: #c0392b !important; color: #fff !important; }
.ac-q .off { opacity: .4; }
.ac .bon kbd, .ac .faux kbd { color: #fff; }
.ac-temps { position: absolute; left: .8em; right: .8em; bottom: .45em; height: .4em; border-radius: .2em; background: #eee; overflow: hidden; }
.ac-temps i { display: block; height: 100%; width: 100%; background: #5cc79a; }
.ac-temps i.crit { background: #3aa0e0; }
.ac-temps i.urgent { background: #c0392b; }
.ac .tn-f { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .12em; line-height: 1.1; }
.ac .tn-f > span { padding: 0 .2em; }
.ac .tn-f > span:first-child { border-bottom: .08em solid currentColor; }

/* Potions */
.ac-labo { display: flex; align-items: center; justify-content: center; gap: 2.5em; padding: 1em; border-radius: 1em; background: linear-gradient(#3b3a4a, #23222e); color: #eee; }
.ac-chaudron { width: 300px; max-width: 100%; flex: none; }
.ac-recette b { color: #ffd35c; font-size: 1.15em; }
.ac-recette ol { margin: .3em 0 .5em; padding-left: 1.4em; line-height: 1.55; }
.ac-recette small { color: #f2b01e; }
.ac-recette li.ici { color: #ffd35c; font-weight: 700; }
.ac-recette li.ok { color: #7fe0b3; }
.ac-recette li.ok::after { content: ' ✔'; }
.ac-recette li.ko { color: #f08a80; }
.ac-recette li.ko::after { content: ' ✘'; }
.ac-recette p { margin: 0; }

/* Jeux d'action (vol, duel, défense) : la toile, le voile, le bandeau de question */
.ac-jeu { position: relative; width: 100%; margin: 0 auto; }
.ac-toile { display: block; width: 100%; height: auto; border-radius: 1em; touch-action: none; -webkit-user-select: none; user-select: none; cursor: pointer; }
.ac-voile { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; justify-content: center; padding: 1em; box-sizing: border-box; border-radius: 1em; background: rgba(22,16,56,.8); color: #fff; text-align: center; cursor: pointer; overflow: auto; }
.ac-voile > div { max-width: 36em; }
.ac-voile p { line-height: 1.5; margin: 0 0 .6em; }
.ac-voile b { color: #ffd35c; }
.ac-voile .ac-voile-t { font-family: 'Fredoka', 'Nunito', sans-serif; font-size: 1.45em; color: #ffd35c; margin-bottom: .4em; }
.ac-voile .ac-go { margin-top: .3em; font-size: 1.15em; }
.ac-voile .tn-f { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.1; }
.ac-voile .tn-f > span:first-child { border-bottom: .08em solid currentColor; }
.ac-bandeau { max-width: 52em; min-height: 6.4em; margin: 0 auto .6em; padding: .45em .9em; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; border: 2px solid #e5e5e5; border-radius: 1em; background: #fbfbfb; }
.ac-bandeau.q { border: 3px solid #f2b01e; background: #fffaeb; box-shadow: 0 0 0 5px rgba(242,176,30,.18), 0 .3em .9em rgba(0,0,0,.1); }
.ac-bandeau .ac-enonce { margin: 0 0 .25em; font-size: 1.35em; line-height: 1.35; }
.ac-ban-bas { display: flex; align-items: center; gap: .8em; min-height: 2.4em; }
.ac-ban-bas .ac-temps { position: static; flex: 1; }
/* la règle du jeu, en haut de chaque épreuve : sur fond violet, bien visible */
.ac .ac-ban-info, .ac .ac-regle { margin: .3em auto 0; padding: .4em .9em; border: 2px solid #c9b8f5; border-radius: .8em; background: #efe9ff; color: #3b2a78; text-align: center; font-size: .95em; font-weight: 600; line-height: 1.4; }
.ac .ac-ban-info b, .ac .ac-regle b { color: #6a2fc2; }
.ac .ac-regle { max-width: 52em; margin: 0 auto .6em; box-sizing: border-box; }
.ac-vol .ac-zone, .ac-defense .ac-zone { display: none; }
.ac-vol .ac-msg, .ac-defense .ac-msg { min-height: 1.4em; margin-top: .4em; }
.ac-duel .ac-msg { margin: .3em 0; min-height: 1.4em; }
.ac-duel .ac-zone { display: none; }
/* duel : la question de recharge, posée sur l'arène pendant le ralenti */
.ac-recharge { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: .5em; box-sizing: border-box; border-radius: 1em; background: rgba(22,16,56,.35); overflow: auto; }
.ac-recharge[hidden] { display: none; }
.ac-recharge .ac-q { width: 100%; max-width: 36em; padding: .5em .7em 1em; }
.ac-recharge .ac-enonce { font-size: 1.3em; margin-bottom: .35em; }
.ac-recharge .ac-opt { font-size: 1.2em; padding: .35em .3em; }
/* duel : boutons à l'écran (tablettes) ; avec souris et clavier, on les cache et on montre les touches */
.ac-pad { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em; margin: .6em auto 0; touch-action: none; }
.ac-pad [data-t] { justify-content: center; min-width: 3.4em; height: 3.2em; font-size: 1.15em; border: 2px solid #ddd; touch-action: none; }
.ac-pad .ac-pad-bouc, .ac-pad .ac-pad-sort { min-width: 7.5em; }
.ac-pad .ac-pad-sort { background: #16855a; border-color: #16855a; color: #fff; }
.ac-pad .appui { background: #d4efe3; color: #16855a; transform: translateY(2px); }
@media (hover: hover) and (pointer: fine) { .ac-pad { display: none; } }


/* Potions : bocaux et saupoudrage */
.ac-petit { font-size: .85em; color: #bbb; margin: .2em 0 .3em !important; }
.ac-recette li span { display: inline-block; min-width: 1.4em; }
.ac-fiole { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05em; padding: .45em .3em .55em; border: 3px solid #b9a6e8; border-radius: 1.3em 1.3em .8em .8em; background: linear-gradient(#ffffff, #efe9fb); color: #4a3a7a; font-weight: 600; font-size: 1.3em; line-height: 1.15; transition: transform .6s ease-in, opacity .6s; }
.ac-fiole:hover { background: #f6f1ff; transform: translateY(-3px); }
.ac-fiole .ac-fico { font-size: 1.6em; line-height: 1.15; }
.ac-fiole small { font-size: .55em; color: #888; font-weight: 400; }
.ac-fiole.verse { transform: translateY(-180px) rotate(-130deg) scale(.5); opacity: 0; }
.ac-fiole.casse { animation: ac-secoue .45s; }
.ac-saup { max-width: 40em; margin: 0 auto; text-align: center; }
.ac-tj { position: relative; height: 2.8em; margin: .5em 0 1em; border-radius: 1.4em; background: #ece8f6; box-shadow: inset 0 0 0 2px #cfc6ea; overflow: hidden; cursor: pointer; touch-action: none; }
.ac-tj-v { position: absolute; top: 0; bottom: 0; background: #bfe9d3; }
.ac-tj-o { position: absolute; top: 0; bottom: 0; background: #f2b01e; }
.ac-tj-c { position: absolute; top: 0; bottom: 0; width: 6px; margin-left: -3px; border-radius: 3px; background: #4a3a7a; }
.ac-tj-c.parfait { background: #fff; box-shadow: 0 0 0 3px #f2b01e, 0 0 16px #f2b01e; }
.ac-tj-c.bien { background: #16855a; }
.ac-tj-c.rate { background: #c0392b; }
.ac-saup-bt { font-size: 1.3em; }

/* Bilan */
.ac-bilan { text-align: center; padding: 2em 1.2em; }
.ac-big { font-size: 4.5em; line-height: 1.1; }
.ac-etoiles { font-size: 2em; margin: .2em 0 .4em; }

@media (max-width: 900px) {
	.ac-plan { aspect-ratio: auto; display: grid; grid-template-columns: 1fr 1fr; gap: .6em; padding: 150px .6em .6em; }
	.ac-chateau { height: 150px; }
	.ac-lieu { position: static; width: auto; }
	.ac-l-exam { grid-column: 1 / -1; order: 5; }
	.ac-coupe ol, .ac-podium, .ac-tuiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
	.ac-bandeau .ac-enonce { font-size: 1.1em; }
	.ac-bandeau { min-height: 5.6em; }
	.ac-fiole { font-size: 1.05em; }
	.ac-ecran { padding: .8em .6em 1em; }
	.ac-intro, .ac-labo { flex-direction: column; text-align: center; gap: .8em; }
	.ac-barre { flex-wrap: wrap; justify-content: space-between; }
	.ac-titre { order: 3; flex-basis: 100%; }
	.ac-enonce { font-size: 1.25em; }
	.ac-opt { font-size: 1.15em; }
}
