/* ════════════════════════════════════════
   FUNGI — mythes_legendes.css
   Le cercle des fées : clairière de nuit, champignons en rond,
   lueur verte du mycélium (« feu de renard »).
   Sert aussi à legende_fiche.php.
════════════════════════════════════════ */

.fm-body {
  --lueur: #a6e36f;
  --lueur-pale: #d9f0c4;
  --nuit: #0b100c;
  --mousse: #18241a;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(166, 227, 111, .08), transparent 70%),
    linear-gradient(#10140e, var(--nuit) 40%);
  min-height: 100vh;
}
.fm-body nav { background: rgba(11, 16, 12, .92); }
.fm-body .nav-links a:hover, .fm-body .nav-links a[aria-current] { color: var(--lueur); }
.fm-body footer { background: var(--nuit); }
@media (max-width: 768px) { .fm-body .nav-links { background: rgba(11, 16, 12, .98); } }

/* ── en-tête ── */
.fm-tete { max-width: 820px; margin: 0 auto; padding: clamp(2.6rem, 6vw, 4rem) 1.4rem 1.4rem; text-align: center; }
.fm-tete .hero-tag { color: var(--lueur); border-color: rgba(166, 227, 111, .3); }
.fm-tete h1 { font-family: var(--fd); font-weight: 400; font-size: clamp(2.6rem, 6.4vw, 4.4rem); line-height: 1.02; color: #eef5e4; text-shadow: 0 0 30px rgba(166, 227, 111, .22); }
.fm-tete h1 em { color: var(--lueur); font-style: normal; }
.fm-chapeau { max-width: 60ch; margin: 1.1rem auto 0; font-size: 1.1rem; line-height: 1.7; font-style: italic; color: #b9c7ad; }
.fm-compteurs { margin-top: 1.6rem; display: flex; justify-content: center; gap: 2.6rem; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: #8fa184; }
.fm-compteurs b { display: block; font-family: var(--fd); font-weight: 400; font-size: 2rem; letter-spacing: 0; color: var(--lueur); }

.fm-main { max-width: 1140px; margin: 0 auto; padding: 0 1.4rem 5rem; }
.fm-vide { text-align: center; font-style: italic; color: #8fa184; padding: 3rem 0; }

/* ══════════ LE CERCLE ══════════ */
.fm-clairiere { padding: 3.2rem 0 1rem; }
.fm-cercle {
  position: relative;
  width: min(100%, 820px); aspect-ratio: 1 / .92;
  margin: 0 auto;
}
/* l'herbe plus sombre et plus drue de l'anneau (le vrai « rond de sorcière ») */
.fm-herbe {
  position: absolute; inset: 9% 7%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse closest-side, transparent 72%, rgba(60, 110, 50, .35) 80%, rgba(40, 80, 34, .5) 88%, transparent 100%),
    radial-gradient(ellipse closest-side, rgba(166, 227, 111, .07), transparent 70%);
  box-shadow: 0 0 80px rgba(166, 227, 111, .06) inset;
}

.fee {
  position: absolute; left: var(--x); top: var(--y);
  width: calc(var(--t) * 1.5);
  transform: translate(-50%, -62%);
  display: flex; flex-direction: column; align-items: center;
  background: none; border: 0; padding: 0; cursor: pointer; color: inherit; font: inherit;
  z-index: 2;
  animation: fee-pousse .8s cubic-bezier(.3, 1.4, .5, 1) both;
  animation-delay: var(--d);
}
@keyframes fee-pousse { from { opacity: 0; transform: translate(-50%, -40%) scale(.3); } }
.fee-champi { width: var(--t); height: calc(var(--t) * 1.1); transition: transform .35s, filter .35s; transform-origin: 50% 100%; }
.champi-lettre { font-family: 'Young Serif', Georgia, serif; font-size: 26px; fill: #fff6e6; opacity: .92; }
.fee-nom { font-family: var(--fd); font-size: .95rem; line-height: 1.15; color: #e6eedc; text-align: center; margin-top: .25rem; }
.fee-nb { font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: #8fa184; }
.fee:hover:not(:disabled) .fee-champi { transform: rotate(-5deg) scale(1.06); }
.fee:focus-visible { outline: 2px solid var(--lueur); outline-offset: 4px; border-radius: 10px; }
.fee[aria-pressed="true"] .fee-champi { transform: scale(1.12); filter: drop-shadow(0 0 14px var(--lueur)) drop-shadow(0 0 4px var(--lueur)); }
.fee[aria-pressed="true"] .fee-nom { color: var(--lueur); }
.fee:disabled { cursor: default; opacity: .4; }
.fee:disabled .fee-champi { filter: grayscale(.8); }

/* ── le centre du cercle ── */
.fm-centre {
  position: absolute; left: 50%; top: 50%;
  width: 52%; max-height: 60%;
  transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  text-align: center; z-index: 1;
}
.fm-centre-vide p { font-style: italic; color: #8fa184; margin-top: 1rem; }
.fm-luciole { display: block; width: 14px; height: 14px; margin: 0 auto; border-radius: 50%; background: var(--lueur); box-shadow: 0 0 18px 6px rgba(166, 227, 111, .45); animation: fm-vole 5s ease-in-out infinite; }
@keyframes fm-vole { 0%, 100% { transform: translate(0, 0); opacity: .9; } 30% { transform: translate(18px, -10px); opacity: .5; } 60% { transform: translate(-14px, 8px); opacity: 1; } }
.fm-centre-plein { animation: fm-apparait .5s ease; }
@keyframes fm-apparait { from { opacity: 0; transform: scale(.92); } }
.fm-centre-sur { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: #8fa184; }
.fm-centre-plein h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.4rem, 3vw, 2rem); color: var(--civ, var(--lueur)); filter: brightness(1.4); margin: .2rem 0 1rem; }
.fm-themes { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; }
/* chaque thème : une spore lumineuse */
.fm-theme {
  position: relative; cursor: pointer; font: inherit;
  padding: .45rem 1rem .45rem 1.7rem; border-radius: 999px;
  background: rgba(166, 227, 111, .07); border: 1px solid rgba(166, 227, 111, .35);
  color: var(--lueur-pale); font-size: .95rem;
  transition: background .25s, box-shadow .25s, color .25s;
}
.fm-theme::before { content: ""; position: absolute; left: .7rem; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--lueur); box-shadow: 0 0 8px var(--lueur); }
.fm-theme small { color: #8fa184; margin-left: .3rem; }
.fm-theme:hover { background: rgba(166, 227, 111, .16); }
.fm-theme:focus-visible { outline: 2px solid var(--lueur); outline-offset: 2px; }
.fm-theme[aria-pressed="true"] { background: var(--lueur); color: #0b100c; box-shadow: 0 0 20px rgba(166, 227, 111, .5); }
.fm-theme[aria-pressed="true"]::before { background: #0b100c; box-shadow: none; }
.fm-theme[aria-pressed="true"] small { color: #24331f; }
.fm-attente { font-style: italic; color: #8fa184; }

/* ══════════ NIVEAU 3 : LES RÉCITS ══════════ */
.fm-recits { max-width: 820px; margin: 1.5rem auto 0; scroll-margin-top: 90px; }
.fm-recits:not([hidden]) { animation: fm-apparait .45s ease; }
.fm-recits-in {
  position: relative;
  background: linear-gradient(180deg, rgba(24, 36, 26, .9), rgba(16, 22, 17, .95));
  border: 1px solid rgba(166, 227, 111, .22);
  border-radius: 26px;
  padding: clamp(1.6rem, 4vw, 2.4rem) clamp(1.2rem, 4vw, 2.6rem);
  box-shadow: 0 0 60px rgba(166, 227, 111, .06), 0 20px 40px rgba(0, 0, 0, .4);
}
.fm-recits-tete { position: relative; padding-right: 2.6rem; margin-bottom: 1rem; }
.fm-recits-sur { font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; color: var(--lueur); }
.fm-recits-tete h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.5rem, 3.4vw, 2.1rem); color: #eef5e4; }
.fm-fermer { position: absolute; top: 0; right: 0; width: 36px; height: 36px; border-radius: 50%; background: none; border: 1px solid rgba(166, 227, 111, .3); color: var(--lueur); cursor: pointer; }
.fm-fermer:hover { background: rgba(166, 227, 111, .1); }
.fm-recit {
  position: relative; display: block; text-decoration: none; color: inherit;
  padding: 1rem 1rem 1rem 2.6rem; border-top: 1px solid rgba(166, 227, 111, .12);
  border-radius: 14px; transition: background .2s;
}
.fm-recit::before { /* un petit chapeau en guise de puce */
  content: ""; position: absolute; left: .8rem; top: 1.35rem; width: 18px; height: 10px;
  border-radius: 18px 18px 3px 3px; background: var(--civ, var(--accent));
  box-shadow: 0 6px 0 -3px #efe3c8;
}
.fm-recit:hover { background: rgba(166, 227, 111, .06); }
.fm-recit b { font-family: var(--fd); font-weight: 400; font-size: 1.22rem; color: #eef5e4; }
.fm-recit b small { font-family: 'EB Garamond', serif; font-size: .8rem; color: #8fa184; margin-left: .4rem; font-style: italic; }
.fm-recit span { display: block; color: #b9c7ad; line-height: 1.55; margin-top: .2rem; }
.fm-recit:hover b { color: var(--lueur); }

/* ══════════ DERNIERS RÉCITS ══════════ */
.fm-dernieres { margin-top: 4.5rem; }
.fm-h2 { font-family: var(--fd); font-weight: 400; font-size: clamp(1.6rem, 3.4vw, 2.3rem); text-align: center; color: #eef5e4; }
.fm-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.3rem; margin-top: 2rem; }
.fm-carte {
  display: block; text-decoration: none; color: inherit;
  background: var(--mousse); border: 1px solid rgba(166, 227, 111, .14);
  border-radius: 22px 22px 22px 6px; padding: 1.3rem 1.4rem;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.fm-carte:hover { transform: translateY(-4px); border-color: rgba(166, 227, 111, .45); box-shadow: 0 0 26px rgba(166, 227, 111, .12); }
.fm-carte-civ { display: flex; align-items: center; gap: .5rem; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #8fa184; }
.fm-carte-civ i { width: 16px; height: 9px; border-radius: 16px 16px 2px 2px; background: var(--c); }
.fm-carte b { display: block; font-family: var(--fd); font-weight: 400; font-size: 1.2rem; color: #eef5e4; margin: .5rem 0 .4rem; line-height: 1.25; }
.fm-carte-txt { color: #b9c7ad; font-size: .95rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.fm-avert { max-width: 70ch; margin: 4rem auto 0; text-align: center; font-size: .9rem; font-style: italic; color: #8fa184; line-height: 1.7; }
.fm-avert a { color: var(--lueur); }

/* ══════════ FICHE D'UNE LÉGENDE (legende_fiche.php) ══════════ */
.fm-ariane { max-width: 820px; margin: 0 auto; padding: 1rem 1.4rem 0; font-size: .86rem; font-style: italic; color: #8fa184; display: flex; flex-wrap: wrap; gap: .3rem .5rem; }
.fm-ariane a { color: var(--lueur); text-decoration: none; font-style: normal; }
.fm-ariane .sep { opacity: .5; }
.lf-wrap { max-width: 820px; margin: 1.6rem auto 4rem; padding: 0 1.4rem; }
.lf-carte {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(24, 36, 26, .92), rgba(14, 20, 15, .96));
  border: 1px solid rgba(166, 227, 111, .2); border-radius: 30px;
  padding: clamp(2rem, 5vw, 3.4rem) clamp(1.3rem, 5vw, 3.6rem);
}
.lf-carte::before { /* filaments de mycélium dans le coin */
  content: ""; position: absolute; right: -40px; bottom: -40px; width: 260px; height: 260px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 14px, rgba(166, 227, 111, .06) 14px 15px);
  pointer-events: none;
}
.lf-entete { text-align: center; position: relative; }
.lf-entete .fee-champi { width: 78px; height: 86px; display: block; margin: 0 auto .6rem; filter: drop-shadow(0 0 12px rgba(166, 227, 111, .35)); }
.lf-tag { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--lueur); }
.lf-entete h1 { font-family: var(--fd); font-weight: 400; font-size: clamp(2rem, 5vw, 2.9rem); line-height: 1.12; color: #eef5e4; margin: .5rem 0 .7rem; }
.lf-resume { font-style: italic; font-size: 1.12rem; line-height: 1.6; color: #b9c7ad; max-width: 52ch; margin: 0 auto; }
.lf-espece { margin-top: 1rem; color: #8fa184; }
.lf-espece a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(215, 109, 46, .4); }
.lf-espece a:hover { border-color: var(--accent); }
.lf-orn { display: flex; justify-content: center; gap: .7rem; margin: 1.6rem 0 1.4rem; }
.lf-orn i { width: 7px; height: 7px; border-radius: 50%; background: var(--lueur); box-shadow: 0 0 8px var(--lueur); opacity: .7; }
.lf-orn i:nth-child(2) { opacity: 1; transform: scale(1.3); }
.lf-texte { position: relative; }
.lf-texte p { font-size: 1.12rem; line-height: 1.85; color: #d6e0cb; margin-bottom: 1.2rem; }
.lf-texte p:first-child::first-letter { float: left; font-family: var(--fd); font-size: 3.4em; line-height: .9; margin: .05em .14em 0 0; color: var(--lueur); text-shadow: 0 0 16px rgba(166, 227, 111, .4); }
.lf-retour { display: inline-block; margin-top: 1.8rem; font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--lueur); text-decoration: none; border-bottom: 1px solid rgba(166, 227, 111, .35); }

/* ══════════ TÉLÉPHONE : le cercle devient une prairie ══════════ */
@media (max-width: 700px) {
  .fm-cercle { aspect-ratio: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem .4rem; --t: 64px !important; }
  .fm-herbe { display: none; }
  .fee { position: static; transform: none; width: auto; }
  @keyframes fee-pousse { from { opacity: 0; transform: scale(.4); } }
  .fm-centre { position: static; transform: none; width: auto; max-height: none; grid-column: 1 / -1; order: -1; padding: .4rem 0 .8rem; }
  .fm-centre-plein { padding: 1.2rem .8rem; border: 1px solid rgba(166, 227, 111, .2); border-radius: 22px; background: rgba(24, 36, 26, .7); }
  .fm-centre:has(.fm-centre-plein:not([hidden])) { order: 99; }
  .fm-recit { padding-left: 2.3rem; }
}
