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

/* Tuiles de choix */
.tn-tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(13em, 1fr)); gap: .8em; }
.tn-tuile { display: flex; flex-direction: column; gap: .2em; padding: .9em 1.1em; border: 2px solid #e5e5e5; border-radius: 1em; color: #777; line-height: 1.4; text-align: center; transition: border-color .2s, box-shadow .2s; }
.tn-tuile b { color: #16855a; font-size: 1.2em; font-weight: 600; }
.tn-tuile span { font-size: .9em; }
.tn-tuile:hover { border-color: #5cc79a; }
.tn-tuile.actif { border-color: #16855a; box-shadow: 0 0 0 3px #d4efe3; background: #f6fcf9; }
.tn-tuile.off { opacity: .45; }

/* Accueil */
.tn-accueil-haut { display: flex; gap: 1.2em; align-items: center; max-width: 60em; margin: .5em auto 1em; }
.tn-accueil-haut p { margin: 0; line-height: 1.6; }
.tn-logo { font-size: 4.5em; line-height: 1; animation: tn-flotte 3s ease-in-out infinite; }
@keyframes tn-flotte { 50% { transform: translateY(-.12em); } }
.tn-reprendre { text-align: center; margin: 0 0 1em; }
.tn-regles summary { cursor: pointer; color: #16855a; font-weight: 700; font-family: 'Fredoka', sans-serif; font-size: 1.1em; }
.tn-regles ul { margin: .8em 0 0; padding-left: 1.4em; line-height: 1.6; }
.tn-regles li { list-style: disc; margin-bottom: .4em; }

/* Barre du haut */
.tn-barre { display: flex; flex-wrap: wrap; align-items: center; gap: .5em 1.2em; padding: 0 0 .8em; margin-bottom: .8em; border-bottom: 2px solid #f0f0f0; font-weight: 700; color: #555; }
.tn-pv { color: #c0392b; }
.tn-serie { color: #e67e22; animation: tn-pop .4s ease; }
.tn-rels { display: flex; flex-wrap: wrap; gap: .3em; }
.tn-rel { font-size: 1.3em; line-height: 1; padding: .15em; border-radius: .4em; background: #fdf6e3; }
.tn-droite { margin-left: auto; display: flex; gap: .4em; }

/* Carte de la tour */
.tn-carte-zone { max-width: 34em; margin: 0 auto; }
.tn-consigne, .tn-legende { text-align: center; color: #888; margin: 0 0 .6em; font-size: .9em; }
.tn-legende { margin-top: .8em; }
.tn-plan { position: relative; margin: 0 1.5em; background: linear-gradient(#f6fcf9, #fff); border-radius: 1em; }
.tn-plan svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tn-plan line { stroke: #cfe3d9; stroke-width: 3; stroke-dasharray: 2 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tn-noeud { position: absolute; transform: translate(-50%, -50%); width: 2.6em; height: 2.6em; border-radius: 50%; background: #fff; border: 2px solid #ddd; display: flex; align-items: center; justify-content: center; font-size: 1.25em; opacity: .55; filter: grayscale(.6); }
.tn-noeud.passe { opacity: .35; }
.tn-noeud.ici { opacity: 1; filter: none; border-color: #16855a; box-shadow: 0 0 0 4px #d4efe3; }
.tn-noeud.ok { opacity: 1; filter: none; border-color: #16855a; animation: tn-pulse 1.2s ease-in-out infinite; cursor: pointer; }
.tn-noeud.ok:hover { background: #eaf7f1; transform: translate(-50%, -50%) scale(1.15); animation: none; }
.tn-noeud.boss { width: 3.6em; height: 3.6em; font-size: 1.6em; border-width: 3px; }
@keyframes tn-pulse { 50% { box-shadow: 0 0 0 7px rgba(92, 199, 154, .35); } }

/* Combat */
.tn-arene { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 1em; padding: .5em 0 1em; }
.tn-perso { position: relative; text-align: center; max-width: 18em; justify-self: center; width: 100%; }
.tn-avatar { font-size: 4.5em; line-height: 1.1; }
.tn-perso.e .tn-avatar { animation: tn-flotte 2.4s ease-in-out infinite; }
.tn-perso.j .tn-avatar { transform: scaleX(-1); }
.tn-qui { font-family: 'Fredoka', sans-serif; font-weight: 600; color: #555; margin: .2em 0 .3em; }
.tn-perso.aie .tn-avatar { animation: tn-aie .45s ease; }
.tn-perso.e.agit .tn-avatar { animation: tn-charge .45s ease; }
@keyframes tn-aie { 20%, 60% { transform: translateX(-.12em) rotate(-6deg); filter: brightness(1.6) saturate(2) hue-rotate(-30deg); } 40%, 80% { transform: translateX(.12em) rotate(6deg); } }
@keyframes tn-charge { 50% { transform: translateX(-.4em) scale(1.12); } }
.tn-vs { font: 700 1.6em 'Fredoka', sans-serif; color: #ccc; padding-bottom: 2em; }
.tn-jauge { position: relative; height: 1.5em; border-radius: 1em; background: #f2e3e1; overflow: hidden; }
.tn-jauge > div { height: 100%; background: linear-gradient(#e86b5f, #c0392b); border-radius: 1em; transition: width .4s ease; }
.tn-jauge span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .4em; font-weight: 800; font-size: .85em; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .45); }
.tn-bloc { background: #3d7fc4; color: #fff; padding: 0 .5em; border-radius: 1em; text-shadow: none; }
.tn-statuts { display: flex; flex-wrap: wrap; justify-content: center; gap: .3em; min-height: 1.8em; margin-top: .35em; }
.tn-statuts span { background: #f3f5f4; border-radius: 1em; padding: .1em .55em; font-size: .85em; font-weight: 700; }
.tn-intention { display: inline-flex; gap: .4em; padding: .3em .8em; border-radius: 1em; background: #fff7e6; border: 2px solid #f6d58e; font-weight: 800; margin-bottom: .2em; animation: tn-pop .4s ease; }
.i-atk { color: #c0392b; } .i-def { color: #3d7fc4; } .i-buff { color: #e67e22; } .i-debuff { color: #8e44ad; }
.tn-bulle { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font: 700 1.6em 'Fredoka', sans-serif; pointer-events: none; opacity: 0; animation: tn-bulle 1.3s ease forwards; white-space: nowrap; text-shadow: 0 2px 0 #fff, 0 0 6px #fff; }
.tn-bulle.deg { color: #c0392b; } .tn-bulle.bl { color: #3d7fc4; } .tn-bulle.soin { color: #16855a; }
@keyframes tn-bulle { 0% { opacity: 0; transform: translate(-50%, .5em) scale(.6); } 20% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -2.2em); } }
@keyframes tn-pop { from { transform: scale(.5); opacity: 0; } to { transform: none; opacity: 1; } }

.tn-table { display: grid; grid-template-columns: auto 1fr auto; gap: 1em; align-items: center; border-top: 2px solid #f0f0f0; padding-top: 1em; }
.tn-energie { width: 3.6em; height: 3.6em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe48a, #f2b01e 65%, #c98a00); color: #5a3d00; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 1.5em; font-weight: 700; line-height: 1; box-shadow: 0 0 0 4px #fff3cf; }
.tn-energie small { font-size: .38em; font-weight: 600; letter-spacing: .03em; }
.tn-main { display: flex; flex-wrap: wrap; justify-content: center; gap: .6em; min-height: 12em; align-items: center; }
.tn-vide { color: #aaa; }
.tn-tas { display: flex; flex-direction: column; gap: .5em; align-items: stretch; }
.tn-fin-tour { justify-content: center; }

/* Cartes */
.tn-carte { position: relative; width: 8.6em; min-height: 11.5em; padding: .55em .5em .5em; border-radius: .9em; background: #fff; border: 3px solid #ccc; display: flex; flex-direction: column; align-items: center; text-align: center; box-shadow: 0 .25em .5em rgba(0, 0, 0, .12); transition: transform .15s ease, box-shadow .15s ease; animation: tn-pop .3s ease backwards; }
.tn-main .tn-carte:hover { transform: translateY(-.5em) rotate(-1deg); box-shadow: 0 .6em 1em rgba(0, 0, 0, .18); }
.tn-carte.off { filter: grayscale(.8); opacity: .55; }
.tn-carte.off:hover { transform: none; }
.t-atk { border-color: #e07a5f; } .t-atk .tn-nom { background: #e07a5f; }
.t-def { border-color: #3d7fc4; } .t-def .tn-nom { background: #3d7fc4; }
.t-sort { border-color: #16855a; } .t-sort .tn-nom { background: #16855a; }
.t-pouvoir { border-color: #8e5bb5; } .t-pouvoir .tn-nom { background: #8e5bb5; }
.tn-carte.up { box-shadow: 0 0 0 3px #f6d58e, 0 .25em .5em rgba(0, 0, 0, .12); }
.tn-cout { position: absolute; top: -.6em; left: -.6em; width: 1.9em; height: 1.9em; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe48a, #f2b01e 70%); color: #5a3d00; font: 700 1em/1.9em 'Fredoka', sans-serif; box-shadow: 0 0 0 2px #fff; }
.tn-nom { display: block; width: 100%; color: #fff; border-radius: .5em; padding: .2em .3em; font-weight: 600; font-size: .9em; line-height: 1.2; }
.tn-ico { font-size: 2.2em; line-height: 1.3; }
.tn-type { font-size: .65em; text-transform: uppercase; letter-spacing: .08em; color: #999; }
.tn-txt { font-size: .78em; line-height: 1.35; color: #444; flex: 1; padding: .3em 0; }
.tn-txt b { color: #222; font-family: inherit; }
.tn-etoiles { color: #f2b01e; letter-spacing: .1em; font-size: .9em; }
.tn-choix { display: flex; flex-wrap: wrap; justify-content: center; gap: 1em; margin: .8em 0; }

/* Fenêtres (question, paquet) */
#tn-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; }
#tn-modale > div { margin: auto; }
.tn-question, .tn-paquet { 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 #16855a; animation: tn-pop .25s ease; }
.tn-paquet { max-width: 60em; }
.tn-question.t-atk { border-top-color: #e07a5f; } .tn-question.t-def { border-top-color: #3d7fc4; } .tn-question.t-pouvoir { border-top-color: #8e5bb5; }
.tn-q-haut { display: flex; flex-wrap: wrap; gap: .4em 1em; align-items: center; font-weight: 700; color: #555; }
.tn-th { margin-left: auto; padding: .1em .7em; border-radius: 1em; background: #eaf7f1; color: #16855a; font-size: .8em; }
.tn-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; }
.tn-enonce small { display: block; font: 400 .45em/1.4 'Nunito', sans-serif; color: #888; margin-top: .4em; }
.tn-saisie { min-height: 1.6em; margin: 0 auto .6em; max-width: 12em; padding: .2em .6em; border: 3px solid #16855a; border-radius: .7em; text-align: center; font-size: 1.8em; font-weight: 600; color: #222; }
.tn-saisie.vide { color: #bbb; font-size: 1.3em; line-height: 1.6em; font-weight: 400; }
.tn-pave { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45em; max-width: 19em; margin: 0 auto; }
.tn-touche { height: 2.6em; border-radius: .6em; background: #f3f5f4; display: flex; align-items: center; justify-content: center; font-size: 1.3em; font-weight: 600; color: #333; box-shadow: 0 .15em 0 #d5dad7; }
.tn-touche:active { transform: translateY(.1em); box-shadow: none; }
.tn-touche:hover { background: #eaf7f1; }
.tn-touche.ok { grid-column: span 2; background: #16855a; color: #fff; box-shadow: 0 .15em 0 #0e5c3d; }
.tn-verdict { text-align: center; font: 700 1.5em 'Fredoka', sans-serif; margin: .5em 0; animation: tn-pop .3s ease; }
.tn-verdict.ok { color: #16855a; } .tn-verdict.ko { color: #c0392b; font-size: 1.25em; }
.tn-verdict small { font-size: .6em; color: #e67e22; }
.tn-correction { background: #f6fcf9; border-left: 4px solid #5cc79a; border-radius: .5em; padding: .7em 1em; line-height: 1.6; color: #333; }
.tn-joker { text-align: center; color: #8e5bb5; font-weight: 700; }
.tn-f { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin: 0 .12em; line-height: 1.1; }
.tn-f > span { padding: 0 .2em; }
.tn-f > span:first-child { border-bottom: .08em solid currentColor; }
.tn-rac { border-top: .08em solid currentColor; padding: 0 .1em; }
.tn sup { font-size: .6em; vertical-align: super; line-height: 0; }

/* Lieux */
.tn-lieu, .tn-recompense, .tn-fin-boite { text-align: center; }
.tn-grand { font-size: 4em; line-height: 1.2; animation: tn-pop .5s ease; }
.tn-gains { font-weight: 800; font-size: 1.15em; color: #b8860b; }
.tn-relique-gagnee { display: inline-flex; gap: .8em; align-items: center; text-align: left; background: #fdf6e3; border: 2px solid #f6d58e; border-radius: 1em; padding: .6em 1em; margin: .4em auto; max-width: 30em; }
.tn-relique-gagnee > span { font-size: 2.4em; }
.tn-article { display: flex; flex-direction: column; align-items: center; gap: .3em; }
.tn-prix { font-weight: 800; color: #b8860b; }
.tn-vendu { width: 8.6em; min-height: 11.5em; border: 3px dashed #ddd; border-radius: .9em; display: flex; align-items: center; justify-content: center; color: #bbb; font-weight: 700; }
.tn-lieu .tn-tuiles { max-width: 40em; margin: 1em auto 0; }

/* Fin */
.tn-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(9em, 1fr)); gap: .8em; margin: 1em 0; }
.tn-chiffres div { background: #f6fcf9; border-radius: 1em; padding: .8em; color: #777; font-size: .9em; }
.tn-chiffres b { display: block; font-size: 1.8em; color: #16855a; }
.tn-bilan { display: grid; grid-template-columns: 1fr 1fr; gap: 1em; text-align: left; }
.tn-bilan ul { margin: 0; padding-left: 1.3em; line-height: 1.7; }
.tn-bilan li { list-style: disc; }

/* Message bref */
#tn-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; }
#tn-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Plein écran (projection, tablette) */
.tn-outil:fullscreen { background: #fff; max-width: none; padding: 1em; overflow: auto; }
.tn-outil:fullscreen .tn-rgpd { display: none; }
.tn-outil:fullscreen .tn-ecran { min-height: calc(100vh - 2.4em); border: 0; }
.tn-outil:fullscreen .tn { font-size: 1.1em; }

@media screen and (max-width: 840px) {
	.tn-table { grid-template-columns: 1fr; }
	.tn-energie { margin: 0 auto; }
	.tn-tas { flex-direction: row; justify-content: center; }
	.tn-avatar { font-size: 3.4em; }
	.tn-bilan { grid-template-columns: 1fr; }
	.tn-accueil-haut { flex-direction: column; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
	.tn *, .tn *::before { animation: none !important; transition: none !important; }
	.tn-bulle { opacity: 1; transform: translate(-50%, -1em); }
}
.tn-verdict b { color: inherit; }

/* Chrono et coup critique */
.tn-chrono { position: relative; height: 1.5em; max-width: 19em; margin: 0 auto .7em; border-radius: 1em; background: #eef1ef; overflow: hidden; }
.tn-chrono > div { height: 100%; width: 100%; background: #16855a; border-radius: 1em; transition: width .1s linear, background .3s; }
.tn-chrono.crit > div { background: linear-gradient(90deg, #f2b01e, #ffd95e); }
.tn-chrono.urgent > div { background: #e0524d; }
.tn-chrono span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .85em; color: #333; }
.tn-verdict.crit { color: #d48c00; font-size: 1.8em; animation: tn-crit .5s ease; }
@keyframes tn-crit { 0% { transform: scale(.4) rotate(-8deg); opacity: 0; } 60% { transform: scale(1.2) rotate(3deg); opacity: 1; } 100% { transform: none; } }
.tn-bulle.crit { color: #d48c00; font-size: 1.3em; top: 5%; }
.tn-moitie { text-align: center; color: #c0392b; font-weight: 700; margin: .6em 0 0; }
