/* ═══════════════════════════════════════════════════════════════════════════
   TRÈFLÉO — jeu « Mon champ » (templates/trefleo/mon_champ.html, encarts de
   Mes bons et de l'accueil, dessin de trefleo/champ.py).
   Complète trefleo.css (variables --tf-*). Préfixes tf- (page) et tfc-
   (dessin). Chargée sur toutes les pages : chaque règle vise au moins une
   classe propre au jeu (tests/test_affichage.py).
   Fluidité : les animations en boucle n'animent que transform et opacity, et
   jamais dans le SVG du champ (une seule image à dessiner) ; base.html les
   met en pause hors de l'écran (.tf-pause).
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Scène : le dessin du champ ──────────────────────────────────────────── */
.tf-scene { position: relative; overflow: hidden; aspect-ratio: 800 / 360; background: #DCE9D4; isolation: isolate; }
/* Le plateau garde les proportions du dessin ; dans un cadre plus haut, il
   déborde à gauche et à droite et le cadre le recadre sur son milieu. */
.tf-scene__plateau { position: absolute; top: 0; left: 50%; height: 100%; aspect-ratio: 800 / 360; transform: translateX(-50%); container-type: inline-size; }
.tf-scene__fond { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* Dessin d'avant le redémarrage (un SVG seul, sans plateau). */
.tf-scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tf-scene__vie { position: absolute; inset: 0; pointer-events: none; }
.tf-vie { position: absolute; display: block; }
/* Durée et retard de chaque élément : dans son style (champ.py). */
.tf-vie__mvt { display: block; will-change: transform; }
.tf-vie svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (max-width: 620px) { .tf-scene { aspect-ratio: 4 / 3; } }

/* Fleurs couleur miel : un toucher les récolte (bouton du formulaire). */
.tf-scene__fleur { position: absolute; aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tf-scene__fleur:hover { box-shadow: 0 0 0 3px rgba(255, 246, 214, .75); }

/* La vie du champ (repère : 1cqw = 8 unités du dessin). */
.tf-vie--nuage .tf-vie__mvt { animation: tfc-nuage 60s ease-in-out infinite alternate both; }
@keyframes tfc-nuage { from { transform: translateX(-2.5cqw); } to { transform: translateX(3.5cqw); } }
.tf-vie--papillon .tf-vie__mvt { animation: tfc-papillon 16s ease-in-out infinite both; }
@keyframes tfc-papillon {
  0%, 100% { transform: translate(0, 0) rotate(-6deg); }
  25% { transform: translate(11cqw, -3.2cqw) rotate(8deg); }
  50% { transform: translate(21cqw, 1.2cqw) rotate(-4deg); }
  75% { transform: translate(9cqw, 4.4cqw) rotate(6deg); }
}
.tf-vie__ailes { transform-box: fill-box; transform-origin: 50% 50%; animation: tfc-battement .3s ease-in-out infinite alternate; }
@keyframes tfc-battement { from { transform: scaleX(1); } to { transform: scaleX(.35); } }
.tf-vie--vol1 .tf-vie__mvt { animation: tfc-abeille-1 9s ease-in-out infinite both; }
.tf-vie--vol2 .tf-vie__mvt { animation: tfc-abeille-2 11s ease-in-out infinite both; }
.tf-vie--vol3 .tf-vie__mvt { animation: tfc-abeille-1 12s ease-in-out infinite reverse both; }
@keyframes tfc-abeille-1 {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7.5cqw, 2.2cqw); }
  45% { transform: translate(-13.5cqw, -1cqw); }
  70% { transform: translate(-5cqw, -3cqw); }
}
@keyframes tfc-abeille-2 {
  0%, 100% { transform: translate(0, 0); }
  30% { transform: translate(8.5cqw, -2.5cqw); }
  60% { transform: translate(16cqw, 1.8cqw); }
  80% { transform: translate(6cqw, 2.8cqw); }
}
.tf-vie--chute .tf-vie__mvt { animation: tfc-chute 14s linear infinite both; }
@keyframes tfc-chute {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  8% { opacity: .95; }
  50% { transform: translate(4cqw, 24cqw) rotate(170deg); }
  88% { opacity: .85; }
  100% { transform: translate(-1cqw, 50cqw) rotate(340deg); opacity: 0; }
}
.tf-vie--pollen .tf-vie__mvt { animation: tfc-pollen 13s ease-in-out infinite both; }
@keyframes tfc-pollen {
  0% { transform: translate(0, 0); opacity: 0; }
  20% { opacity: .9; }
  100% { transform: translate(5cqw, -22cqw); opacity: 0; }
}
.tf-vie--luciole .tf-vie__mvt { animation: tfc-luciole 8s ease-in-out infinite both; }
@keyframes tfc-luciole {
  0%, 100% { transform: translate(0, 0); opacity: .15; }
  20% { opacity: 1; }
  35% { transform: translate(3cqw, -2cqw); opacity: .3; }
  55% { opacity: 1; }
  70% { transform: translate(-2cqw, -3.5cqw); opacity: .5; }
  85% { opacity: .9; }
}
.tf-vie__lueur, .tf-vie__halo { display: block; width: 100%; aspect-ratio: 1; border-radius: 50%; }
.tf-vie__lueur { background: radial-gradient(circle, #FFFCD6 0 16%, rgba(214, 240, 120, .55) 30%, rgba(214, 240, 120, 0) 68%); }
.tf-vie__halo { background: radial-gradient(circle, rgba(255, 244, 204, .7) 0 12%, rgba(246, 215, 122, .4) 40%, rgba(246, 215, 122, 0) 70%); }
.tf-vie--lueur .tf-vie__mvt { animation: tfc-lueur 2.6s ease-in-out infinite both; }
@keyframes tfc-lueur { 0%, 100% { transform: scale(.8); opacity: .55; } 50% { transform: scale(1.12); opacity: 1; } }
.tf-vie--etincelle .tf-vie__mvt, .tf-vie--etoile .tf-vie__mvt { animation: tfc-scintille 2.4s ease-in-out infinite both; }
@keyframes tfc-scintille { 0%, 100% { transform: scale(.4) rotate(0deg); opacity: .15; } 50% { transform: scale(1.1) rotate(45deg); opacity: 1; } }

/* Puces posées sur la scène (saison, exemple) et nouvelles de la visite. */
.tf-scene__puces { position: absolute; left: 14px; right: 14px; top: 12px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.tf-scene__puce { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--tf-foret); background: rgba(255, 253, 248, .9); padding: 6px 11px; border-radius: 999px; box-shadow: 0 2px 10px rgba(30, 58, 42, .12); }
.tf-scene__puce svg { width: 15px; height: 15px; color: var(--tf-miel-encre); }
.tf-scene--nuit-page .tf-scene__puce { color: #EAF2E1; background: rgba(21, 35, 58, .78); }
.tf-scene--nuit-page .tf-scene__puce svg { color: #F6D77A; }
.tf-scene__nouvelles { position: absolute; left: 50%; bottom: 14px; margin: 0; transform: translate(-50%, 12px); opacity: 0; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 700; font-size: .9rem; color: var(--tf-foret); background: var(--tf-papier); padding: 8px 14px; border-radius: 999px; box-shadow: 0 8px 24px rgba(30, 58, 42, .22); transition: opacity .4s, transform .4s cubic-bezier(.2, 1.3, .4, 1); pointer-events: none; }
.tf-scene__nouvelles svg { width: 17px; height: 17px; color: var(--tf-feuille); }
.tf-scene__nouvelles.est-visible { opacity: 1; transform: translate(-50%, 0); }
.tf-scene--nuit-page .tf-vie--chute { opacity: .5; }

/* ── Lien de l'en-tête (icône seule sur un téléphone) ──────────────────── */
.tf-nav a.tf-nav__champ { display: inline-flex; align-items: center; gap: 6px; }
.tf-nav__champ svg { width: 18px; height: 18px; color: var(--tf-feuille); flex: none; }
@media (max-width: 760px) {
  .tf-nav__champ span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tf-nav__champ svg { width: 22px; height: 22px; }
}

/* Ancres de ces pages : sous l'en-tête collant. */
#jeu, #recolte, #defis, #paliers { scroll-margin-top: 78px; }

/* ── Médaillons des paliers (_jeu.html) ──────────────────────────────────── */
.tf-medaillon { display: block; width: 100%; height: auto; }

/* ── La carte du champ ───────────────────────────────────────────────────── */
.tf-jeu { padding-bottom: 10px; }
.tf-champ-carte { margin: 24px 0 0; background: var(--tf-papier); border-radius: 28px; box-shadow: var(--tf-ombre-forte); overflow: hidden; border: 1px solid rgba(226, 217, 197, .8); }
.tf-champ-carte__tete { display: flex; align-items: center; gap: 18px; padding: 22px 26px 20px; }
.tf-champ-carte__medaillon { width: 76px; flex: none; filter: drop-shadow(0 6px 12px rgba(30, 58, 42, .16)); }
.tf-champ-carte__titre { flex: 1; min-width: 0; }
.tf-champ-carte__titre h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); margin: 6px 0 .15em; }
.tf-champ-carte__titre h1 em { font-style: italic; color: var(--tf-feuille); font-variation-settings: "SOFT" 100, "WONK" 1; }
.tf-champ-carte__titre p { color: var(--tf-gris); margin: 0; max-width: 42em; }
.tf-champ-carte__action { flex: none; }
.tf-champ-carte__sur { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--tf-feuille); background: var(--tf-tendre); padding: 5px 11px; border-radius: 999px; }
.tf-champ-carte__sur svg { width: 15px; height: 15px; }
.tf-compteur { flex: none; display: grid; justify-items: end; text-align: right; color: var(--tf-gris); font-weight: 600; line-height: 1.2; }
.tf-compteur strong { font: 650 clamp(2.6rem, 6vw, 3.6rem)/1 var(--tf-titre); color: var(--tf-foret); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tf-compteur small { font-size: .8rem; font-weight: 600; color: var(--tf-gris-clair); margin-top: 3px; }
.tf-compteur.est-anime strong { color: var(--tf-feuille); }

/* Récolte : bandeau miel collé sous la scène. */
.tf-recolte { display: grid; grid-template-columns: auto 1fr auto; gap: 14px 18px; align-items: center; padding: 16px 26px; background: linear-gradient(135deg, #FBEFC8, #FDF6E1 60%, #FBEFC8); border-top: 1px solid rgba(226, 179, 63, .45); border-bottom: 1px solid rgba(226, 179, 63, .3); }
.tf-recolte__icone { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--tf-miel); color: #3E2C02; box-shadow: 0 6px 16px rgba(226, 179, 63, .4); }
.tf-recolte__icone svg { width: 26px; height: 26px; }
.tf-recolte h2 { font-size: 1.22rem; color: var(--tf-miel-encre); margin: 0 0 6px; }
.tf-recolte__liste { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tf-recolte__liste li { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 253, 248, .85); border: 1px solid rgba(226, 179, 63, .45); border-radius: 999px; padding: 4px 10px; font-size: .86rem; font-weight: 600; color: #4A3608; }
.tf-recolte__liste small { color: var(--tf-gris); font-weight: 500; }
.tf-recolte__liste strong { color: var(--tf-feuille); }
.tf-recolte__plus { background: transparent !important; border-style: dashed !important; }
.tf-recolte .tf-bouton { white-space: nowrap; }
.tf-recolte.est-recoltee .tf-recolte__icone { animation: tfc-saut .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes tfc-saut { 40% { transform: translateY(-6px) scale(1.08); } }

/* Progression vers le palier suivant. */
.tf-progres { display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center; padding: 18px 26px 22px; }
.tf-progres__etape { display: grid; justify-items: center; gap: 4px; width: 66px; font-size: .74rem; font-weight: 700; color: var(--tf-foret); text-align: center; line-height: 1.15; }
.tf-progres__etape .tf-medaillon { width: 44px; }
.tf-progres__etape--suivante .tf-medaillon { filter: grayscale(.85); opacity: .55; }
.tf-progres__etape--suivante { color: var(--tf-gris); }
.tf-progres__piste { display: grid; gap: 8px; }
.tf-progres__piste p { margin: 0; color: var(--tf-gris); line-height: 2; }
.tf-progres__piste p .tf-points { margin-left: 6px; vertical-align: middle; }
.tf-progres__piste strong { color: var(--tf-foret); }

/* Jauges */
.tf-jauge { height: 10px; border-radius: 999px; background: var(--tf-sable); overflow: hidden; }
.tf-jauge span { display: block; height: 100%; min-width: 6px; border-radius: inherit; background: linear-gradient(90deg, var(--tf-pousse), var(--tf-feuille)); transition: width .6s cubic-bezier(.2, .8, .3, 1); }
.tf-jauge--grande { height: 14px; box-shadow: inset 0 1px 2px rgba(30, 58, 42, .12); }
.tf-jauge--grande span { background: linear-gradient(90deg, #A6D27A, var(--tf-pousse) 35%, var(--tf-feuille)); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08); }
.tf-jauge--or span { background: linear-gradient(90deg, #F6D77A, var(--tf-miel), #C9962F); }

/* Visiteur : les trois temps du jeu sous la scène. */
.tf-etapes-jeu { list-style: none; margin: 0; padding: 18px 26px 22px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 22px; }
.tf-etapes-jeu li { display: flex; gap: 12px; align-items: flex-start; }
.tf-etapes-jeu li > svg { width: 42px; height: 42px; flex: none; padding: 9px; border-radius: 14px; background: var(--tf-tendre); color: var(--tf-feuille); }
.tf-etapes-jeu li:nth-child(3) > svg { background: var(--tf-miel-pale); color: var(--tf-miel-encre); }
.tf-etapes-jeu strong { display: block; color: var(--tf-foret); font-weight: 700; line-height: 1.3; }
.tf-etapes-jeu span { display: block; color: var(--tf-gris); font-size: .9rem; margin-top: 2px; }

/* ── Le prochain pas ─────────────────────────────────────────────────────── */
.tf-conseil { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; margin-top: 18px; padding: 16px 20px; background: linear-gradient(120deg, var(--tf-tendre), #EEF5E4); border: 1px solid #C8DFAE; border-radius: 22px; }
.tf-conseil__icone { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--tf-feuille); color: #fff; box-shadow: 0 6px 14px rgba(47, 107, 69, .25); }
.tf-conseil__icone svg { width: 26px; height: 26px; }
.tf-conseil__sur { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tf-feuille); }
.tf-conseil strong { display: block; font: 650 1.14rem/1.25 var(--tf-titre); color: var(--tf-foret); margin-top: 2px; }
.tf-conseil p { margin: 3px 0 0; color: var(--tf-foret-2); }

/* ── Blocs côte à côte ───────────────────────────────────────────────────── */
.tf-jeu__duo { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; align-items: stretch; margin-top: 18px; }
.tf-jeu__duo > :only-child { grid-column: 1 / -1; }
.tf-jeu__duo--haut { align-items: start; }
.tf-jeu__duo > .tf-panneau + .tf-panneau { margin-top: 0; }
.tf-jeu__titre { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; margin: 0 0 14px; }
.tf-jeu__titre svg { width: 22px; height: 22px; color: var(--tf-feuille); flex: none; }
@media (max-width: 860px) { .tf-jeu__duo { grid-template-columns: 1fr; } }

/* ── Ma série ────────────────────────────────────────────────────────────── */
.tf-serie__chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.tf-serie__chiffre { background: var(--tf-creme); border-radius: 16px; padding: 12px 14px; color: var(--tf-gris); font-size: .84rem; line-height: 1.3; }
.tf-serie__chiffre strong { display: block; font: 650 1.8rem/1.05 var(--tf-titre); color: var(--tf-foret); font-variant-numeric: tabular-nums; }
.tf-serie__chiffre--vif { background: linear-gradient(140deg, #FBEFC8, #FDF6E1); color: var(--tf-miel-encre); }
.tf-serie__chiffre--vif strong { color: #8A5A0B; }
.tf-jours { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.tf-jour { display: grid; justify-items: center; gap: 6px; }
.tf-jour__rond { width: 100%; max-width: 46px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: var(--tf-sable); color: #fff; }
.tf-jour__rond svg { width: 60%; height: 60%; }
.tf-jour__rond i { width: 18%; aspect-ratio: 1; border-radius: 50%; background: #D6C9AC; }
.tf-jour--valide .tf-jour__rond { background: radial-gradient(circle at 35% 30%, #5FA36A, var(--tf-feuille) 60%, var(--tf-feuille-fonce)); box-shadow: 0 4px 10px rgba(47, 107, 69, .28); }
.tf-jour--attente .tf-jour__rond { background: var(--tf-papier); border: 2px dashed var(--tf-miel); color: var(--tf-miel-encre); }
.tf-jour--aujourdhui .tf-jour__rond { box-shadow: 0 0 0 3px var(--tf-papier), 0 0 0 5px var(--tf-pousse); }
.tf-jour__lettre { font-size: .76rem; font-weight: 700; color: var(--tf-gris-clair); }
.tf-jour--aujourdhui .tf-jour__lettre { color: var(--tf-foret); }
.tf-serie__conseil { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: .92rem; color: var(--tf-gris); }
.tf-serie__conseil svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--tf-feuille); }
@media (max-width: 420px) { .tf-serie__chiffres { gap: 7px; } .tf-serie__chiffre { padding: 10px; font-size: .78rem; } .tf-serie__chiffre strong { font-size: 1.5rem; } }

/* ── Anneau de progression (défis) ───────────────────────────────────────── */
.tf-anneau { --p: 0; --plein: var(--tf-feuille); flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--plein) calc(var(--p) * 1%), var(--tf-sable) 0); }
.tf-anneau__coeur { width: calc(100% - 10px); height: calc(100% - 10px); border-radius: 50%; display: grid; place-items: center; background: var(--tf-papier); color: var(--tf-gris-clair); }
.tf-anneau__coeur svg { width: 52%; height: 52%; }
.tf-anneau--en-cours .tf-anneau__coeur { color: var(--tf-feuille); background: var(--tf-tendre); }
.tf-anneau--fait { --plein: var(--tf-feuille); }
.tf-anneau--fait .tf-anneau__coeur { background: var(--tf-feuille); color: #fff; }
.tf-anneau--pret, .tf-anneau--miel { --plein: var(--tf-miel); }
.tf-anneau--pret .tf-anneau__coeur { background: var(--tf-miel); color: #3E2C02; }
.tf-anneau--miel .tf-anneau__coeur { background: var(--tf-miel-pale); color: var(--tf-miel-encre); }

/* ── Défi de la semaine ──────────────────────────────────────────────────── */
.tf-hebdo { display: flex; flex-direction: column; gap: 10px; border: 1.5px solid rgba(226, 179, 63, .55); background: linear-gradient(180deg, #FFF8E6, var(--tf-papier) 70%); }
.tf-hebdo--reussi { border-color: #C8DFAE; background: linear-gradient(180deg, #F1F7E8, var(--tf-papier) 70%); }
.tf-hebdo--pret { box-shadow: 0 10px 28px rgba(226, 179, 63, .22); }
.tf-hebdo__tete { display: flex; gap: 14px; align-items: center; }
.tf-hebdo__tete h2 { margin: 2px 0 0; font-size: 1.3rem; }
.tf-hebdo__sur { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--tf-miel-encre); }
.tf-hebdo p { margin: 0; color: var(--tf-gris); }
.tf-hebdo .tf-etiquette svg { width: 13px; height: 13px; }
.tf-hebdo__suivant { font-size: .86rem; border-top: 1px dashed var(--tf-ligne); padding-top: 10px; margin-top: auto !important; }

/* ── Le chemin des paliers ───────────────────────────────────────────────── */
.tf-chemin-bloc { padding-bottom: 18px; }
.tf-chemin { --avance: 0; position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
/* Le sentier : de la première à la dernière étape, vert jusqu'où l'habitant en est. */
.tf-chemin::before, .tf-chemin::after { content: ""; position: absolute; top: 33px; left: 6.25%; height: 6px; border-radius: 999px; }
.tf-chemin::before { right: 6.25%; background: repeating-linear-gradient(90deg, #DCCFB2 0 10px, transparent 10px 18px); }
.tf-chemin::after { width: calc(87.5% * var(--avance) / 100); background: linear-gradient(90deg, var(--tf-pousse), var(--tf-feuille)); }
.tf-chemin__etape { position: relative; z-index: 1; display: grid; justify-items: center; text-align: center; gap: 10px; }
.tf-chemin__medaillon { position: relative; width: 72px; display: block; border-radius: 50%; background: var(--tf-creme); box-shadow: 0 0 0 5px var(--tf-creme); }
.tf-chemin__etape:not(.tf-chemin__etape--atteinte) .tf-chemin__medaillon .tf-medaillon { filter: grayscale(.9); opacity: .5; }
/* Visiteur : le chemin et les défis en couleurs, comme une vitrine. */
.tf-chemin--vitrine .tf-chemin__etape .tf-chemin__medaillon .tf-medaillon { filter: none; opacity: 1; }
.tf-defis--vitrine .tf-anneau__coeur { background: var(--tf-tendre); color: var(--tf-feuille); }
.tf-chemin__etape--actuelle .tf-chemin__medaillon { box-shadow: 0 0 0 5px var(--tf-creme), 0 0 0 8px var(--tf-pousse), 0 10px 24px rgba(47, 107, 69, .25); transform: scale(1.1); }
.tf-chemin__coche { position: absolute; right: -2px; bottom: -2px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--tf-feuille); color: #fff; border: 2px solid var(--tf-creme); }
.tf-chemin__coche svg { width: 14px; height: 14px; }
.tf-chemin__texte { display: grid; justify-items: center; gap: 3px; }
.tf-chemin__texte strong { font: 650 1rem/1.15 var(--tf-titre); color: var(--tf-foret); }
.tf-chemin__seuil { font-size: .8rem; font-weight: 650; color: var(--tf-gris); }
.tf-chemin__decor { font-size: .78rem; color: var(--tf-gris-clair); line-height: 1.3; }
.tf-chemin__texte .tf-points { margin-top: 3px; font-size: .78rem; padding: 4px 8px; }
.tf-chemin__depart { margin-top: 3px; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tf-gris-clair); }
.tf-chemin__ici { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: var(--tf-feuille); padding: 3px 8px; border-radius: 999px; }
.tf-chemin__etape--atteinte:not(.tf-chemin__etape--actuelle) .tf-points { background: var(--tf-tendre); border-color: #C8DFAE; color: var(--tf-feuille); }
@media (max-width: 900px) {
  /* Écran étroit : le chemin défile de côté (jeu.js amène l'étape actuelle en vue). */
  .tf-chemin-defile { overflow-x: auto; margin: 0 -20px; padding: 16px 20px 12px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .tf-chemin-defile::-webkit-scrollbar { display: none; }
  .tf-chemin { width: max-content; grid-template-columns: repeat(8, 112px); gap: 4px; }
  .tf-chemin__etape { scroll-snap-align: center; }
  .tf-chemin__medaillon { width: 64px; }
  .tf-chemin::before, .tf-chemin::after { top: 29px; }
}

/* ── Défis ───────────────────────────────────────────────────────────────── */
.tf-defis__bilan { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: .9rem; color: var(--tf-foret); background: var(--tf-papier); border: 1px solid var(--tf-ligne); padding: 7px 13px; border-radius: 999px; }
.tf-defis__bilan svg { width: 18px; height: 18px; color: var(--tf-miel-encre); }
.tf-defis { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tf-defi { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; background: var(--tf-papier); border: 1px solid var(--tf-ligne); border-radius: 22px; padding: 18px; box-shadow: var(--tf-ombre); }
.tf-defi__corps { display: flex; flex-direction: column; gap: 7px; flex: 1; width: 100%; }
.tf-defi__tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tf-defi h3 { margin: 0; font-size: 1.1rem; }
.tf-defi p { margin: 0; color: var(--tf-gris); font-size: .9rem; flex: 1; }
.tf-defi__avance { font-size: .8rem; font-weight: 650; color: var(--tf-gris); font-variant-numeric: tabular-nums; }
.tf-defi__gain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 2px; }
.tf-defi__trefles { display: inline-flex; align-items: center; gap: 5px; font-size: .84rem; font-weight: 650; color: var(--tf-feuille); }
.tf-defi__trefles svg { width: 16px; height: 16px; }
.tf-defi .tf-etiquette { flex: none; }
.tf-defi .tf-etiquette svg { width: 13px; height: 13px; }
.tf-defi--fait { border-color: #C8DFAE; background: linear-gradient(180deg, #F4F9EC, var(--tf-papier) 55%); }
.tf-defi--pret { border-color: rgba(226, 179, 63, .75); background: linear-gradient(180deg, #FFF6DC, var(--tf-papier) 60%); box-shadow: 0 10px 26px rgba(226, 179, 63, .24); }
.tf-etiquette--miel { background: var(--tf-miel); color: #3E2C02; }
.tf-acquis { margin-top: 18px; }
.tf-acquis h3 { font: 700 .76rem var(--tf-texte); letter-spacing: .1em; text-transform: uppercase; color: var(--tf-gris); margin: 0 0 10px; }
.tf-acquis ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tf-acquis li { display: inline-flex; align-items: center; gap: 9px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--tf-papier); border: 1px solid #C8DFAE; font-weight: 650; font-size: .9rem; color: var(--tf-foret); }
.tf-acquis li > span:first-child { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--tf-feuille); color: #fff; }
.tf-acquis li > span:first-child svg { width: 17px; height: 17px; }
.tf-acquis small { color: var(--tf-gris); font-weight: 600; }
@media (max-width: 620px) {
  /* Téléphone : une ligne par défi, l'anneau à gauche. */
  .tf-defis { grid-template-columns: 1fr; gap: 10px; }
  .tf-defi { flex-direction: row; gap: 12px; padding: 13px 14px; border-radius: 18px; }
  .tf-defi__corps { gap: 5px; }
  .tf-anneau { width: 48px; height: 48px; }
  .tf-anneau__coeur { width: calc(100% - 8px); height: calc(100% - 8px); }
  .tf-defi h3 { font-size: 1rem; }
  .tf-defi p { font-size: .84rem; line-height: 1.45; }
  .tf-defi__gain .tf-points { font-size: .8rem; padding: 4px 8px 4px 7px; }
  .tf-defi__gain { gap: 6px 8px; }
}

/* Visiteur : la liste des défis de la semaine. */
.tf-hebdo-liste { margin-top: 18px; }
.tf-hebdo-liste__puces { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tf-hebdo-liste__puces li { display: inline-flex; align-items: center; gap: 7px; background: var(--tf-creme); border-radius: 999px; padding: 6px 8px 6px 12px; font-weight: 600; font-size: .92rem; }
.tf-hebdo-liste__puces li > svg { width: 17px; height: 17px; color: var(--tf-feuille); }
.tf-hebdo-liste__puces .tf-points { padding: 3px 8px; font-size: .8rem; }

/* ── Champ collectif ─────────────────────────────────────────────────────── */
.tf-collectif { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 12px; padding: 26px; border-radius: var(--tf-rayon); color: #D7E8C7; background: radial-gradient(420px 220px at 100% 0%, rgba(140, 193, 90, .28), transparent 70%), linear-gradient(150deg, var(--tf-foret), #234A33 70%, var(--tf-feuille-fonce)); box-shadow: var(--tf-ombre-forte); }
.tf-collectif .tf-jeu__titre { color: #fff; margin-bottom: 2px; }
.tf-collectif .tf-jeu__titre svg { color: var(--tf-pousse); }
.tf-collectif__chiffre { margin: 0; }
.tf-collectif__chiffre strong { display: block; font: 650 2.6rem/1.05 var(--tf-titre); color: #fff; font-variant-numeric: tabular-nums; }
.tf-collectif__parcelle { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; padding: 12px; border-radius: 16px; background: rgba(255, 255, 255, .07); }
.tf-collectif__parcelle span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 10px; background: rgba(255, 255, 255, .06); color: rgba(215, 232, 199, .28); }
.tf-collectif__parcelle span svg { width: 70%; height: 70%; }
.tf-collectif__parcelle span.est-plante { background: rgba(140, 193, 90, .22); color: #B9E08F; }
.tf-collectif__objectif { margin: 0; font-size: .9rem; color: #C9DABB; }

/* ── Mes récoltes ────────────────────────────────────────────────────────── */
.tf-recoltes__total { margin: 0 0 4px; color: var(--tf-gris); }
.tf-recoltes__total strong { color: var(--tf-feuille); }
.tf-recoltes__liste li { justify-content: flex-start; }
.tf-recoltes__liste .tf-historique__libelle { flex: 1; }
.tf-recoltes__icone { width: 34px; height: 34px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--tf-tendre); color: var(--tf-feuille); }
.tf-recoltes__icone svg { width: 19px; height: 19px; }
.tf-recoltes__icone--hebdo, .tf-recoltes__icone--palier { background: var(--tf-miel-pale); color: var(--tf-miel-encre); }
.tf-recoltes__lien { margin-top: 14px; }
.tf-gris { color: var(--tf-gris); }

/* ── Mon année de tri ────────────────────────────────────────────────────── */
.tf-annee { margin-top: 18px; }
.tf-annee__tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin-bottom: 12px; }
.tf-annee__tete .tf-jeu__titre { margin: 0; }
.tf-annee__resume { margin: 0; color: var(--tf-gris); }
.tf-annee__resume strong { color: var(--tf-feuille); }
.tf-annee__defile { overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.tf-annee__dessin { display: block; width: 100%; height: auto; min-width: 620px; max-width: 1060px; }
.tf-annee__legende { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; font-size: .82rem; color: var(--tf-gris); }
.tf-annee__legende span { display: inline-flex; align-items: center; gap: 6px; }
.tf-annee__case { display: inline-block; width: 11px; height: 11px; border-radius: 3px; background: #EFE7D5; }
.tf-annee__case--valide { background: #3A7A4C; }
.tf-annee__case--attente { background: var(--tf-miel-pale); box-shadow: inset 0 0 0 1.5px var(--tf-miel); }

/* ── Règles (repliables) ─────────────────────────────────────────────────── */
.tf-regles { margin-top: 22px; background: var(--tf-papier); border: 1px solid var(--tf-ligne); border-radius: var(--tf-rayon); box-shadow: var(--tf-ombre); }
.tf-regles summary { display: flex; align-items: center; gap: 10px; padding: 18px 22px; cursor: pointer; list-style: none; font: 650 1.12rem var(--tf-titre); color: var(--tf-foret); }
.tf-regles summary::-webkit-details-marker { display: none; }
.tf-regles summary svg { width: 22px; height: 22px; color: var(--tf-feuille); flex: none; }
.tf-regles summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--tf-gris); border-bottom: 2px solid var(--tf-gris); transform: rotate(45deg) translateY(-3px); transition: transform .2s; }
.tf-regles[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
.tf-regles ul { margin: 0; padding: 0 26px 22px 44px; display: grid; gap: 8px; color: var(--tf-gris); }
.tf-regles strong { color: var(--tf-foret); }

/* ── Fête de la récolte ──────────────────────────────────────────────────── */
.tf-fete__carte { position: relative; overflow: hidden; max-width: 400px; }
.tf-fete__medaillon { width: 120px; margin: 0 auto 14px; filter: drop-shadow(0 10px 18px rgba(30, 58, 42, .22)); }
.tf-fete.est-visible .tf-fete__medaillon, .tf-fete.est-visible .tf-celebration__rond--miel svg { animation: tfc-tourne 1s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes tfc-tourne { from { transform: rotate(-90deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.tf-fete__points strong { color: var(--tf-feuille); font-size: 1.1rem; }
.tf-celebration__palier { background: var(--tf-tendre); color: var(--tf-foret); border-radius: 14px; padding: 10px 14px; }
.tf-celebration__rond--miel { background: var(--tf-miel-pale); color: var(--tf-miel-encre); }
.tf-celebration__actions { display: grid; gap: 10px; margin-top: 18px; }
.tf-fete__confettis { position: absolute; inset: 0; pointer-events: none; }
.tf-fete__confettis i { position: absolute; top: 34%; left: 50%; width: 12px; height: 12px; border-radius: 12px 0; background: var(--tf-pousse); opacity: 0; }
.tf-fete__confettis i:nth-child(3n) { background: var(--tf-miel); border-radius: 50%; width: 9px; height: 9px; }
.tf-fete__confettis i:nth-child(3n + 1) { background: var(--tf-feuille); }
.tf-fete.est-visible .tf-fete__confettis i { animation: tfc-confetti 1.4s cubic-bezier(.15, .8, .35, 1) .15s both; }
.tf-fete__confettis i:nth-child(1) { --x: -150px; --y: -90px; --r: 200deg; }
.tf-fete__confettis i:nth-child(2) { --x: 140px; --y: -110px; --r: -160deg; }
.tf-fete__confettis i:nth-child(3) { --x: -110px; --y: 40px; --r: 120deg; }
.tf-fete__confettis i:nth-child(4) { --x: 160px; --y: 30px; --r: 240deg; }
.tf-fete__confettis i:nth-child(5) { --x: -40px; --y: -140px; --r: -90deg; }
.tf-fete__confettis i:nth-child(6) { --x: 60px; --y: -150px; --r: 150deg; }
.tf-fete__confettis i:nth-child(7) { --x: -170px; --y: -20px; --r: 300deg; }
.tf-fete__confettis i:nth-child(8) { --x: 120px; --y: 110px; --r: -220deg; }
.tf-fete__confettis i:nth-child(9) { --x: -90px; --y: 120px; --r: 80deg; }
.tf-fete__confettis i:nth-child(10) { --x: 20px; --y: 150px; --r: -120deg; }
.tf-fete__confettis i:nth-child(11) { --x: 175px; --y: -60px; --r: 260deg; }
.tf-fete__confettis i:nth-child(12) { --x: -130px; --y: -150px; --r: -200deg; }
.tf-fete__confettis i:nth-child(13) { --x: 90px; --y: -40px; --r: 180deg; }
.tf-fete__confettis i:nth-child(14) { --x: -60px; --y: 70px; --r: -60deg; }
@keyframes tfc-confetti {
  0% { transform: translate(-50%, -50%) scale(.3); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r)) scale(1); opacity: 0; }
}

/* ── Récolte en cours (jeu.js) : les fleurs s'envolent vers la cagnotte ── */
.tf-envol { position: fixed; z-index: 60; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; pointer-events: none; background: radial-gradient(circle, #FFF6D6 0 25%, #F2CD6A 45%, rgba(226, 179, 63, 0) 72%); will-change: transform, opacity; }
.tf-solde.est-nourri { animation: tfc-saut .45s cubic-bezier(.2, 1.4, .4, 1); }

/* Trèfle apparu depuis la dernière visite (jeu.js). */
.tf-neuf { transform-box: fill-box; transform-origin: 50% 100%; animation: tfc-pousse .7s cubic-bezier(.2, 1.5, .4, 1) both; }
@keyframes tfc-pousse { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── Encart « Mon champ » (Mes bons) ─────────────────────────────────────── */
.tf-champ-encart { display: grid; grid-template-columns: auto 1fr auto; gap: 14px 18px; align-items: center; margin: 18px 0 0; padding: 16px 20px; background: var(--tf-papier); border: 1px solid var(--tf-ligne); border-radius: 22px; box-shadow: var(--tf-ombre); text-decoration: none; color: var(--tf-encre); transition: border-color .15s, transform .15s; }
.tf-champ-encart:hover { color: var(--tf-encre); border-color: var(--tf-pousse); transform: translateY(-1px); }
.tf-champ-encart__medaillon { width: 58px; }
.tf-champ-encart__icone { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--tf-tendre); color: var(--tf-feuille); }
.tf-champ-encart__icone svg { width: 30px; height: 30px; }
.tf-champ-encart__texte strong { display: block; font: 650 1.1rem/1.25 var(--tf-titre); color: var(--tf-foret); }
.tf-champ-encart__texte p { margin: 3px 0 0; color: var(--tf-gris); font-size: .92rem; }
.tf-champ-encart__texte .tf-jauge { height: 7px; margin-top: 9px; max-width: 360px; }
.tf-champ-encart--pret { background: linear-gradient(135deg, var(--tf-miel-pale), #FCF4DC); border-color: rgba(226, 179, 63, .6); }
.tf-champ-encart--pret .tf-champ-encart__icone { background: var(--tf-miel); color: #3E2C02; }
@media (max-width: 620px) { .tf-champ-encart { grid-template-columns: auto 1fr; } .tf-champ-encart .tf-bouton { grid-column: 1 / -1; } }

/* ── Accueil : le jeu présenté ───────────────────────────────────────────── */
.tf-jeu-accueil { display: grid; grid-template-columns: .9fr 1.1fr; gap: 34px; align-items: center; }
.tf-jeu-accueil__dessin { border-radius: 24px; overflow: hidden; border: 1px solid var(--tf-ligne); box-shadow: var(--tf-ombre-forte); }
.tf-jeu-accueil ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; color: var(--tf-gris); }
.tf-jeu-accueil li { display: flex; gap: 12px; align-items: flex-start; }
.tf-jeu-accueil li svg { width: 36px; height: 36px; flex: none; padding: 8px; border-radius: 12px; background: var(--tf-tendre); color: var(--tf-feuille); }
.tf-jeu-accueil li strong { color: var(--tf-foret); }
.tf-jeu-accueil__paliers { display: flex; gap: 6px; margin: 0 0 22px; }
.tf-jeu-accueil__paliers .tf-medaillon { width: 38px; }
@media (max-width: 860px) { .tf-jeu-accueil { grid-template-columns: 1fr; } .tf-jeu-accueil__dessin { order: -1; } }

/* ── Téléphone ───────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .tf-champ-carte { margin-top: 16px; border-radius: 24px; }
  .tf-champ-carte__tete { flex-wrap: wrap; gap: 12px 14px; padding: 18px 18px 16px; }
  .tf-champ-carte__medaillon { width: 56px; }
  .tf-champ-carte__titre h1 { font-size: 1.85rem; }
  .tf-champ-carte__titre p { font-size: .94rem; }
  .tf-compteur { width: 100%; grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 8px; text-align: left; }
  .tf-compteur strong { font-size: 2.3rem; }
  .tf-champ-carte__action { width: 100%; }
  .tf-recolte { grid-template-columns: auto 1fr; gap: 12px 12px; padding: 16px 18px; }
  .tf-recolte__texte { display: contents; }
  .tf-recolte__icone { width: 40px; height: 40px; border-radius: 13px; }
  .tf-recolte__icone svg { width: 22px; height: 22px; }
  .tf-recolte h2 { margin: 0; font-size: 1.15rem; }
  .tf-recolte__liste { grid-column: 1 / -1; display: grid; gap: 6px; }
  .tf-recolte__liste li { border-radius: 12px; padding: 7px 11px; }
  .tf-recolte__liste strong { margin-left: auto; }
  .tf-recolte form { grid-column: 1 / -1; }
  .tf-recolte .tf-bouton { width: 100%; }
  .tf-progres { grid-template-columns: 1fr auto; padding: 16px 18px 18px; gap: 12px; }
  .tf-progres__etape:first-child { display: none; }
  .tf-etapes-jeu { grid-template-columns: 1fr; padding: 16px 18px 20px; }
  .tf-scene__puces { left: 10px; right: 10px; top: 10px; }
  .tf-scene__puce { font-size: .72rem; padding: 5px 9px; }
}
