/* FAB-07 — Interface commune de Rise of Academies : « L'Académie de lumière » (pierre, or, bleu nuit).
   Composants préfixés `fi-`. Aucune bibliothèque, aucune police distante. Présentation seulement : aucune règle du jeu ici.
   États forcés pour la planche : .est-survol, .est-presse, .est-focus (mêmes rendus que :hover, :active, :focus-visible). */

/* ───────────── 1. Jetons de conception ───────────── */
.fi, .ui-fable {
  --fi-nuit: #0a1030;          /* fond : bleu nuit profond */
  --fi-nuit-2: #131c46;        /* surface des panneaux */
  --fi-nuit-3: #1e2a5c;        /* surface haute, rainures */
  --fi-ardoise: #2b3668;       /* pierre sombre gravée */
  --fi-pierre: #e4d9c0;        /* pierre claire */
  --fi-pierre-2: #b9ab8d;      /* pierre à l'ombre */
  --fi-or: #e3b84f;
  --fi-or-clair: #fbe9a8;
  --fi-or-profond: #a8791f;
  --fi-or-nuit: #5d4410;
  --fi-rouge: #d8323a;         /* rouge des bannières */
  --fi-rouge-profond: #8f1a22;
  --fi-texte: #f4ecd8;         /* texte courant sur nuit */
  --fi-texte-doux: #bcc3de;    /* texte secondaire sur nuit */
  --fi-encre: #241a06;         /* texte sur or et sur pierre claire */
  --fi-ok: #6fdba6;
  --fi-alerte: #f6bd6a;
  --fi-erreur: #ff9aa0;
  --fi-focus: #9fd4ff;
  --fi-titre: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --fi-corps: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fi-grain: url("/interface/grain.svg");
  --fi-barre-h: 58px;
  --fi-nav-h: 78px;
  --fi-vite: .16s;
  --fi-pose: .28s;
  --fi-courbe: cubic-bezier(.2, .8, .2, 1);
}
.fi { color: var(--fi-texte); font: 16px/1.5 var(--fi-corps); }
.fi *, .fi *::before, .fi *::after { box-sizing: border-box; }
body.fi {
  margin: 0; min-height: 100vh;
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(246, 201, 106, .22), transparent 70%),
    radial-gradient(1200px 700px at 50% 0, #1c2a63 0%, var(--fi-nuit) 62%) fixed;
  background-color: var(--fi-nuit);
}
.fi :where(button) { font: inherit; color: inherit; }
.fi :focus { outline: none; }
.fi :focus-visible, .fi .est-focus { outline: 3px solid var(--fi-focus); outline-offset: 3px; }
.fi [hidden] { display: none !important; }
.fi-ico { width: 1.5em; height: 1.5em; flex: none; display: block; --i2: rgba(8, 12, 40, .55); }
.fi-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Titres : capitales gravées or à empattements (bible §3). */
.fi-titre, .ui-fable h1, .ui-fable h2 {
  font-family: var(--fi-titre); font-weight: 700; text-transform: uppercase; letter-spacing: .09em; line-height: 1.15;
  color: var(--fi-or-clair); margin: 0;
  text-shadow: 0 1px 0 #fff3, 0 -1px 0 #3d2c08, 0 2px 6px rgba(0, 0, 0, .55);
}
.fi h1.fi-titre { font-size: clamp(1.45rem, 4.6vw, 2.2rem); }
.fi h2.fi-titre { font-size: clamp(1.12rem, 3.4vw, 1.45rem); }
.fi-filet { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; color: var(--fi-or); }
.fi-filet::before, .fi-filet::after { content: ""; height: 2px; flex: 1; background: linear-gradient(90deg, transparent, var(--fi-or-profond)); }
.fi-filet::after { transform: scaleX(-1); }
.fi-filet .fi-ico { width: 14px; height: 14px; }
.fi-doux { color: var(--fi-texte-doux); }
.fi-petit { font-size: .875rem; }

/* ───────────── 2. Boutons : principal doré en relief, secondaire gravé, tertiaire texte ───────────── */
.fi-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; min-width: 44px; padding: 9px 18px;
  font: 600 1rem/1.2 var(--fi-corps); letter-spacing: .01em; text-decoration: none; text-align: center;
}
.fi-btn, .ui-fable .btn {
  position: relative; border-radius: 10px; cursor: pointer;
  color: var(--fi-or-clair);
  background: var(--fi-grain), linear-gradient(180deg, #34407a 0%, #232d60 100%);
  border: 1px solid #6672ac;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .55), inset 0 -1px 0 rgba(255, 255, 255, .14), 0 1px 0 rgba(255, 255, 255, .07);
  text-shadow: 0 -1px 0 rgba(0, 0, 0, .7);
  transition: transform var(--fi-vite) var(--fi-courbe), box-shadow var(--fi-vite), border-color var(--fi-vite), filter var(--fi-vite);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none;
}
.fi-btn:hover:not(:disabled), .fi-btn.est-survol, .ui-fable .btn:hover:not(:disabled) { border-color: var(--fi-or); filter: brightness(1.12); }
.fi-btn:active:not(:disabled), .fi-btn.est-presse, .ui-fable .btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 4px 7px rgba(0, 0, 0, .7); filter: brightness(.94); }

.fi-btn--principal, .ui-fable .btn.primary {
  color: var(--fi-encre); font-weight: 800; text-shadow: 0 1px 0 rgba(255, 255, 255, .55); overflow: hidden;
  background: linear-gradient(180deg, #fff3c4 0%, #f6d572 26%, #e3b84f 55%, #c08d2b 100%);
  border: 1px solid #7c5914;
  box-shadow: 0 4px 0 #6d4d10, 0 7px 12px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 -3px 0 rgba(125, 84, 12, .35), inset 0 0 0 2px rgba(255, 240, 180, .35);
  margin-bottom: 4px;
}
/* Reflet : une lame de lumière posée sur l'or, qui glisse au survol. */
.fi-btn--principal::after, .ui-fable .btn.primary::after {
  content: ""; position: absolute; inset: 0 auto 0 -60%; width: 45%; transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .6), transparent); opacity: .55; pointer-events: none;
  transition: left .55s var(--fi-courbe);
}
.fi-btn--principal:hover:not(:disabled)::after, .fi-btn--principal.est-survol::after, .ui-fable .btn.primary:hover:not(:disabled)::after { left: 115%; }
.fi-btn--principal:hover:not(:disabled), .fi-btn--principal.est-survol, .ui-fable .btn.primary:hover:not(:disabled) { border-color: #7c5914; filter: brightness(1.06) saturate(1.08); }
.fi-btn--principal:active:not(:disabled), .fi-btn--principal.est-presse, .ui-fable .btn.primary:active:not(:disabled) {
  transform: translateY(4px); filter: brightness(.96);
  box-shadow: 0 0 0 #6d4d10, 0 2px 4px rgba(0, 0, 0, .5), inset 0 2px 4px rgba(125, 84, 12, .55), inset 0 0 0 2px rgba(255, 240, 180, .25);
}

.fi-btn--texte, .ui-fable .btn.ghost {
  background: none; border-color: transparent; box-shadow: none; padding-inline: 10px; color: var(--fi-or-clair); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--fi-or-profond); text-decoration-thickness: 2px; text-underline-offset: 5px; text-shadow: none;
}
.fi-btn--texte:hover:not(:disabled), .fi-btn--texte.est-survol, .ui-fable .btn.ghost:hover:not(:disabled) { border-color: transparent; text-decoration-color: var(--fi-or-clair); background: rgba(227, 184, 79, .1); }
.fi-btn--texte:active:not(:disabled), .fi-btn--texte.est-presse { box-shadow: none; transform: translateY(1px); background: rgba(227, 184, 79, .18); }

.fi-btn--petit, .ui-fable .btn.small, .ui-fable .btn.tiny { min-height: 44px; padding: 6px 14px; font-size: .9375rem; }
.fi-btn--large { width: 100%; }
.fi-btn:disabled, .fi-btn[aria-disabled="true"], .ui-fable .btn:disabled {
  cursor: not-allowed; color: #b4bbd6; text-shadow: none; filter: none;
  background: repeating-linear-gradient(135deg, #262d52 0 7px, #20274a 7px 14px); border: 1px dashed #5b6390; box-shadow: none; margin-bottom: 0;
}
.fi-btn:disabled::after, .ui-fable .btn:disabled::after { display: none; }
.fi-btn--danger, .ui-fable .btn.danger { color: var(--fi-erreur); border-color: #b9545c; }
.fi-btn .fi-ico { width: 1.2em; height: 1.2em; }
.fi-btn--principal .fi-ico { --i2: rgba(93, 68, 16, .6); }
/* Bouton rond gravé (fermer, aide). */
.fi-rond {
  width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; cursor: pointer; padding: 0; color: var(--fi-or-clair);
  background: radial-gradient(circle at 35% 28%, #3d4a8a, #1c2553 72%); border: 2px solid var(--fi-or-profond);
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .12); transition: transform var(--fi-vite), border-color var(--fi-vite);
}
.fi-rond:hover, .fi-rond.est-survol { border-color: var(--fi-or-clair); }
.fi-rond:active, .fi-rond.est-presse { transform: scale(.92); }
.fi-rond .fi-ico { width: 18px; height: 18px; }

/* ───────────── 3. Panneaux « pierre et or », fenêtre, tiroir ───────────── */
.fi-panneau, .ui-fable .card:not(button):not(.card .card) {
  position: relative; border: 12px solid transparent; border-image: url("cadre.svg") 24 / 12px stretch;
  background: var(--fi-grain), linear-gradient(180deg, #1c2757 0%, var(--fi-nuit-2) 46%, #0e1638 100%); background-clip: padding-box;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); border-radius: 0; padding: 0;
}
.ui-fable .card:not(button):not(.card .card) { padding: 6px 8px 10px; }
.ui-fable button.card, .ui-fable .card .card { border-radius: 8px; border: 1px solid var(--fi-or-profond); background: linear-gradient(180deg, #2b3668, #171f4a); }
.fi-panneau-titre {
  margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 6px 12px;
  font: 700 1rem/1.2 var(--fi-titre); letter-spacing: .07em; text-transform: uppercase; color: var(--fi-encre);
  background: var(--fi-grain), linear-gradient(180deg, #f3ead4 0%, #d9ccae 55%, #b3a585 100%);
  box-shadow: inset 0 1px 0 #fff9, inset 0 -2px 0 rgba(60, 46, 16, .35), 0 2px 0 var(--fi-or-profond), 0 3px 6px rgba(0, 0, 0, .4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.fi-panneau-titre > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.fi-panneau-titre > span:first-child::before { content: ""; width: 0; height: 0; border: 6px solid transparent; border-bottom: 10px solid var(--fi-rouge-profond); border-top: 0; flex: none; }
.fi-panneau-note { font: 700 .875rem/1 var(--fi-corps); letter-spacing: 0; text-transform: none; padding: 5px 9px; border-radius: 99px; background: rgba(36, 26, 6, .88); color: var(--fi-or-clair); text-shadow: none; white-space: nowrap; }
.fi-panneau-corps { padding: 12px 12px 14px; }
.fi-panneau-corps > :first-child { margin-top: 0; }
.fi-panneau-corps > :last-child { margin-bottom: 0; }
.fi-panneau p { margin: .35em 0 .7em; }
.fi-panneau--verrou { filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)) saturate(.55); }
@media (min-width: 700px) {
  .fi-panneau, .ui-fable .card:not(button):not(.card .card) { border-width: 16px; border-image-width: 16px; }
  .fi-panneau-corps { padding: 14px 16px 16px; }
}

.fi-voile { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; overflow-y: auto; background: rgba(4, 7, 22, .78); animation: fi-fondu var(--fi-pose) both; }
.fi-voile--bas { place-items: end center; padding: 0; overflow: hidden; }
.fi-modale { width: min(560px, 100%); animation: fi-pose var(--fi-pose) var(--fi-courbe) both; }
.fi-modale .fi-panneau-titre { padding-right: 6px; }
.fi-modale .fi-rond { width: 44px; height: 44px; margin: -4px 0; background: radial-gradient(circle at 35% 28%, #4a3a12, #241a06 72%); }
.fi-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 14px; }
.fi-tiroir {
  width: min(600px, 100%); max-height: min(86vh, 720px); display: flex; flex-direction: column;
  /* Cadre complet sur ses quatre côtés (propriétaire, 01/12) : le bas du cadre reste visible, posé un peu au-dessus du bord. */
  margin-bottom: max(10px, env(safe-area-inset-bottom, 0px));
  animation: fi-monte .34s var(--fi-courbe) both;
}
.fi-tiroir .fi-panneau-corps { overflow-y: auto; overscroll-behavior: contain; }
.fi-tiroir-poignee { display: grid; place-items: center; height: 18px; background: linear-gradient(180deg, #f3ead4, #cfc2a3); }
.fi-tiroir-poignee::before { content: ""; width: 52px; height: 5px; border-radius: 3px; background: linear-gradient(180deg, var(--fi-or-profond), var(--fi-or)); box-shadow: inset 0 1px 1px rgba(0, 0, 0, .5), 0 1px 0 #fff8; }
@keyframes fi-fondu { from { opacity: 0; } }
@keyframes fi-pose { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes fi-monte { from { transform: translateY(100%); } }

/* ───────────── 4. Barre de ressources compacte ───────────── */
.fi-barre {
  position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top, 0px);
  background: var(--fi-grain), linear-gradient(180deg, #2c3870 0%, #1a2452 70%, #131b43 100%);
  box-shadow: 0 2px 0 var(--fi-or-profond), 0 3px 0 #000a, 0 10px 18px rgba(0, 0, 0, .45);
}
/* Denticules : la frise du linteau, sous la barre. */
.fi-barre::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 5px; margin-top: 3px; background: repeating-linear-gradient(90deg, #cdbf9f 0 7px, transparent 7px 13px); opacity: .5; pointer-events: none; }
.fi-barre-rang { max-width: 1280px; margin: 0 auto; min-height: var(--fi-barre-h); padding: 6px 8px; display: flex; align-items: center; gap: 8px; }
.fi-avatar { position: relative; flex: none; width: 46px; height: 46px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.fi-avatar-rond {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  font: 700 1.25rem/1 var(--fi-titre); color: var(--fi-or-clair);
  background: radial-gradient(circle at 35% 25%, #46549a, #171f4b 75%);
  border: 2px solid var(--fi-or); box-shadow: 0 0 0 2px #5d4410, inset 0 2px 5px rgba(0, 0, 0, .6), 0 3px 6px rgba(0, 0, 0, .5);
  transition: transform var(--fi-vite) var(--fi-courbe), border-color var(--fi-vite);
}
.fi-avatar:hover .fi-avatar-rond, .fi-avatar.est-survol .fi-avatar-rond { border-color: var(--fi-or-clair); }
.fi-avatar:active .fi-avatar-rond, .fi-avatar.est-presse .fi-avatar-rond { transform: scale(.93); }
.fi-avatar[aria-expanded="true"] .fi-avatar-rond { border-color: #fff; box-shadow: 0 0 0 2px var(--fi-or), 0 0 14px rgba(246, 201, 106, .7); }
.fi-avatar-niveau { position: absolute; right: -5px; bottom: -4px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; display: grid; place-items: center; font: 800 .8125rem/1 var(--fi-corps); color: var(--fi-encre); background: linear-gradient(180deg, var(--fi-or-clair), var(--fi-or)); border: 1px solid var(--fi-or-nuit); }
.fi-avatar-plus { position: absolute; left: -3px; bottom: -3px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--fi-nuit); border: 1px solid var(--fi-or-profond); color: var(--fi-or-clair); }
.fi-avatar-plus .fi-ico { width: 10px; height: 10px; }
.fi-ressources { flex: 1; min-width: 0; display: flex; gap: 6px; justify-content: flex-end; }
.fi-res {
  position: relative; flex: 1 1 0; min-width: 0; max-width: 190px; min-height: 44px; display: flex; align-items: center; gap: 4px; padding: 0 8px 0 0; cursor: pointer;
  border: 1px solid #55619a; border-left: 0; border-radius: 22px 8px 8px 22px;
  background: linear-gradient(180deg, #0c1233 0%, #162050 100%); box-shadow: inset 0 2px 5px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .1);
  transition: border-color var(--fi-vite), transform var(--fi-vite);
}
.fi-res:hover, .fi-res.est-survol { border-color: var(--fi-or); }
.fi-res:active, .fi-res.est-presse { transform: translateY(1px); }
.fi-res-ico { flex: none; width: 34px; height: 34px; margin: 0 2px 0 -1px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 25%, #54629f, #1a2350 78%); border: 2px solid var(--fi-or-profond); box-shadow: 0 2px 4px rgba(0, 0, 0, .5); }
.fi-res-ico .fi-ico { width: 21px; height: 21px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
[data-res="credits"] .fi-ico { color: #f6cf66; --i2: #7c5914; }
[data-res="crystals"] .fi-ico { color: #7fe3f4; --i2: #1c6f8f; }
[data-res="energy"] .fi-ico { color: #ffd65a; --i2: #c2571a; }
[data-res="merit"] .fi-ico { color: #f1c76a; --i2: #7c5914; }
[data-res="level"] .fi-ico { color: #fbe9a8; }
[data-res="territories"] .fi-ico { color: #d9cfb6; --i2: #4c4636; }
[data-res="shield"] .fi-ico { color: #a9c8ff; --i2: #2d4a8a; }
[data-res="rules"] .fi-ico { color: #e4d9c0; --i2: #6f6552; }
.fi-res-val { flex: 1; min-width: 0; text-align: right; font: 700 1rem/1 var(--fi-corps); font-variant-numeric: tabular-nums; color: #fff6dc; white-space: nowrap; }
.fi-res-taux { display: none; font: 600 .8125rem/1 var(--fi-corps); color: var(--fi-ok); white-space: nowrap; }
.fi-res--plus { display: none; }
@media (min-width: 1000px) {
  .fi-barre-rang { padding: 8px 16px; gap: 14px; }
  .fi-ressources { justify-content: flex-start; flex-wrap: nowrap; }
  .fi-res { flex: 0 1 auto; padding-right: 12px; gap: 8px; }
  .fi-res-val { text-align: left; }
  .fi-res-taux, .fi-res--plus { display: flex; }
  .fi-res-taux { display: inline; }
}
/* Compteur qui roule : une colonne de chiffres par position. */
/* Case plus haute que le chiffre (1.3em) : sur certains téléphones, le haut du chiffre voisin dépassait au-dessus (propriétaire, 02/12). */
.fi-compteur { --fi-cpt-h: 1.3em; display: inline-flex; overflow: hidden; height: var(--fi-cpt-h); line-height: var(--fi-cpt-h); vertical-align: -.3em; }
.fi-compteur-col { display: inline-flex; flex-direction: column; transition: transform .7s var(--fi-courbe); will-change: transform; }
.fi-compteur-col > span, .fi-compteur-fixe { height: var(--fi-cpt-h); line-height: var(--fi-cpt-h); display: block; text-align: center; }
.fi-compteur.gagne { animation: fi-eclat .9s ease-out; }
@keyframes fi-eclat { 30% { color: var(--fi-or-clair); text-shadow: 0 0 10px rgba(251, 233, 168, .9); } }
/* Fiche du compte (derrière l'avatar). */
.fi-fiche { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.fi-fiche li { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 10px; min-height: 48px; padding: 4px 10px 4px 4px; border-radius: 24px 8px 8px 24px; background: linear-gradient(180deg, #0c1233, #162050); border: 1px solid #45508a; }
.fi-fiche .fi-res-ico { margin: 0; }
.fi-fiche b { font-variant-numeric: tabular-nums; color: #fff6dc; text-align: right; }
.fi-fiche small { display: block; color: var(--fi-texte-doux); font-size: .8125rem; line-height: 1.25; }
.fi-fiche li > button { grid-column: 1 / -1; }

/* ───────────── 5. Navigation principale : cinq frontons gravés ───────────── */
.fi-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--fi-nav-h) + env(safe-area-inset-bottom, 0px)); padding: 0 6px env(safe-area-inset-bottom, 0px);
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; align-items: end;
  padding-right: 66px; /* niche réservée au rond de SUMA : il ne recouvre plus le contenu (E9) */
  background: var(--fi-grain), linear-gradient(180deg, transparent 0 18px, #2c3870 18px, #151d48 60%, #0b1030 100%);
}
/* Le socle : filet d'or et marche de pierre sur lesquels reposent les frontons. */
.fi-nav::before { content: ""; position: absolute; left: 0; right: 0; top: 16px; height: 4px; background: linear-gradient(180deg, var(--fi-or-clair), var(--fi-or-profond)); box-shadow: 0 1px 0 #000a, 0 -6px 12px rgba(0, 0, 0, .5); }
.fi-nav.fi-nav--pose { position: relative; z-index: 1; left: auto; right: auto; bottom: auto; padding-right: 6px; gap: 4px; }
.fi-onglet {
  position: relative; z-index: 1; height: 68px; min-width: 44px; margin-bottom: 4px; padding: 0; border: 0; background: none; cursor: pointer;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .55)); transition: transform var(--fi-pose) var(--fi-courbe), filter var(--fi-pose);
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.fi-onglet-plaque {
  --fronton: polygon(50% 0, 100% 15px, 100% 100%, 0 100%, 0 15px);
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 1px; padding: 0 2px 7px;
  clip-path: var(--fronton); background: linear-gradient(180deg, #a69a7c 0%, #6d654f 100%); color: #e9dfc6;
}
.fi-onglet-plaque::before { content: ""; position: absolute; inset: 2px; clip-path: var(--fronton); background: var(--fi-grain), linear-gradient(180deg, #37437e 0%, #222c5e 55%, #171f4a 100%); }
/* Tympan gravé : le triangle du fronton, en creux. */
.fi-onglet-plaque::after { content: ""; position: absolute; left: 50%; top: 5px; width: 0; height: 0; margin-left: -9px; border: 9px solid transparent; border-top: 0; border-bottom: 6px solid rgba(8, 12, 40, .55); }
.fi-onglet .fi-ico { position: relative; width: 28px; height: 28px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .7)); transition: transform var(--fi-pose) var(--fi-courbe); }
.fi-onglet-nom { position: relative; font: 600 .75rem/1.15 var(--fi-corps); letter-spacing: -.01em; white-space: nowrap; }
.fi-onglet:hover .fi-onglet-plaque, .fi-onglet.est-survol .fi-onglet-plaque { background: linear-gradient(180deg, var(--fi-or-clair), var(--fi-or-profond)); color: #fff6dc; }
.fi-onglet:hover, .fi-onglet.est-survol { transform: translateY(-3px); }
.fi-onglet:active, .fi-onglet.est-presse { transform: translateY(2px); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .6)); }
/* Onglet actif : surélevé, lumineux, clé de fronton rouge. */
.fi-onglet[aria-current="page"] { transform: translateY(-10px); filter: drop-shadow(0 0 9px rgba(246, 201, 106, .75)) drop-shadow(0 6px 4px rgba(0, 0, 0, .55)); }
.fi-onglet[aria-current="page"] .fi-onglet-plaque { background: linear-gradient(180deg, #fff6cf 0%, var(--fi-or) 45%, #8f6417 100%); color: var(--fi-or-clair); }
.fi-onglet[aria-current="page"] .fi-onglet-plaque::before { background: radial-gradient(90px 46px at 50% 0, rgba(255, 228, 140, .8), transparent 70%), var(--fi-grain), linear-gradient(180deg, #5a4a2a 0%, #2b2f5c 48%, #1a2250 100%); }
.fi-onglet[aria-current="page"] .fi-onglet-plaque::after { border-bottom-color: var(--fi-rouge); filter: drop-shadow(0 0 3px rgba(255, 120, 120, .8)); }
.fi-onglet[aria-current="page"] .fi-ico { color: #fff1b8; --i2: rgba(60, 40, 6, .7); transform: scale(1.12); filter: drop-shadow(0 0 5px rgba(255, 220, 120, .8)) drop-shadow(0 1px 0 rgba(0, 0, 0, .7)); }
.fi-onglet[aria-current="page"] .fi-onglet-nom { font-weight: 800; }
/* Rayon de lumière posé sur le socle, sous l'onglet actif. */
.fi-onglet[aria-current="page"]::after { content: ""; position: absolute; left: 12%; right: 12%; bottom: -13px; height: 4px; border-radius: 2px; background: radial-gradient(closest-side, #fff3c4, rgba(246, 201, 106, 0)); }
.fi-onglet:disabled { cursor: not-allowed; filter: grayscale(.8) brightness(.75); transform: none; }
.fi-onglet:focus-visible, .fi-onglet.est-focus { outline-offset: 1px; border-radius: 4px; }
.fi-pastille { position: absolute; top: 6px; right: 4px; z-index: 2; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; display: grid; place-items: center; font: 800 .75rem/1 var(--fi-corps); color: #fff; background: radial-gradient(circle at 35% 30%, var(--fi-rouge), var(--fi-rouge-profond)); border: 2px solid var(--fi-or-clair); box-shadow: 0 2px 4px rgba(0, 0, 0, .6); }
.fi-pastille:empty { min-width: 14px; width: 14px; height: 14px; padding: 0; top: 9px; right: 8px; }
@media (min-width: 1000px) {
  .fi-nav:not(.fi-nav--pose) { position: relative; height: 74px; max-width: 760px; margin: 0 auto; padding: 0 16px; gap: 10px; background: none; }
  .fi-nav:not(.fi-nav--pose)::before { display: none; }
  .fi-nav:not(.fi-nav--pose) .fi-onglet { margin-bottom: 3px; height: 64px; }
  .fi-onglet-nom { font-size: .875rem; }
  .fi-onglet[aria-current="page"] { transform: translateY(-6px); }
  .fi-onglet[aria-current="page"]::after { bottom: -9px; }
}

/* ───────────── 6. Sous-onglets (plaques sur rail gravé) et filtres (jetons) ───────────── */
.fi-bannieres {
  position: relative; display: flex; gap: 2px; padding: 4px; width: fit-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; isolation: isolate;
  border-radius: 8px; background: linear-gradient(180deg, #080d2a, #131b45); border: 1px solid #4a558f;
  box-shadow: inset 0 3px 6px rgba(0, 0, 0, .75), 0 1px 0 rgba(255, 255, 255, .12);
}
.fi-bannieres::-webkit-scrollbar { display: none; }
.fi-banniere {
  --plaque: polygon(11px 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 11px 100%, 0 50%);
  position: relative; z-index: 1; flex: 1 0 auto; min-height: 44px; padding: 6px 18px; border: 0; background: none; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: 600 .9375rem/1.1 var(--fi-corps); color: #dcd3bc; text-shadow: 0 -1px 0 rgba(0, 0, 0, .8);
  transition: color var(--fi-pose); -webkit-tap-highlight-color: transparent;
}
.fi-banniere::before { content: ""; position: absolute; inset: 0; z-index: -1; clip-path: var(--plaque); background: transparent; transition: background var(--fi-vite); }
.fi-banniere:hover::before, .fi-banniere.est-survol::before { background: rgba(227, 184, 79, .16); }
.fi-banniere:active, .fi-banniere.est-presse { transform: translateY(1px); }
.fi-banniere[aria-selected="true"], .fi-banniere[aria-pressed="true"] { color: var(--fi-encre); font-weight: 800; text-shadow: 0 1px 0 rgba(255, 255, 255, .55); }
.fi-banniere[aria-selected="true"]::before, .fi-banniere[aria-pressed="true"]::before, .fi-glissiere {
  background: linear-gradient(180deg, #fff3c4 0%, #f2cc63 30%, var(--fi-or) 58%, #b9862a 100%);
}
.fi-banniere:disabled { color: #9aa1bf; cursor: not-allowed; text-decoration: line-through; }
.fi-banniere .fi-ico { width: 18px; height: 18px; }
.fi-banniere[aria-selected="true"] .fi-ico, .fi-banniere[aria-pressed="true"] .fi-ico { --i2: rgba(93, 68, 16, .6); }
.fi-compte { min-width: 24px; padding: 3px 6px; border-radius: 99px; font: 700 .8125rem/1 var(--fi-corps); background: rgba(0, 0, 0, .45); color: var(--fi-or-clair); text-shadow: none; }
[aria-selected="true"] > .fi-compte, [aria-pressed="true"] > .fi-compte { background: rgba(36, 26, 6, .85); }
/* Plaque d'or qui glisse d'un sous-onglet à l'autre (posée par le script ; sans script, la plaque est sur le bouton). */
.fi-glissiere { position: absolute; top: 4px; left: 0; height: calc(100% - 8px); width: 0; z-index: 0; pointer-events: none; clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 11px 100%, 0 50%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); transition: transform .32s var(--fi-courbe), width .32s var(--fi-courbe); }
.fi-bannieres--glisse .fi-banniere[aria-selected="true"]::before, .fi-bannieres--glisse .fi-banniere[aria-pressed="true"]::before { background: transparent; }

.fi-jetons { display: flex; flex-wrap: wrap; gap: 8px 10px; }
.fi-jeton {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px 0 0; border: 0; background: none; cursor: pointer;
  font: 600 .9375rem/1 var(--fi-corps); color: #dcd3bc; -webkit-tap-highlight-color: transparent; transition: transform var(--fi-vite);
}
.fi-jeton-nom { display: inline-flex; align-items: center; min-height: 34px; margin-left: -14px; padding: 0 16px 0 22px; background: linear-gradient(180deg, #34407a, #222c5e); border: 1px solid #6672ac; border-left: 0; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); box-shadow: inset 0 2px 3px rgba(0, 0, 0, .5); transition: background var(--fi-pose), color var(--fi-pose); }
.fi-jeton-rond { position: relative; z-index: 1; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #d9cfb6; background: radial-gradient(circle at 35% 25%, #4a5896, #1a2350 75%); border: 2px solid #8d8469; box-shadow: 0 2px 4px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .2); transition: border-color var(--fi-pose), background var(--fi-pose), transform var(--fi-pose) var(--fi-courbe); }
.fi-jeton-rond .fi-ico { width: 20px; height: 20px; }
.fi-jeton:hover .fi-jeton-rond, .fi-jeton.est-survol .fi-jeton-rond { border-color: var(--fi-or); }
.fi-jeton:active, .fi-jeton.est-presse { transform: translateY(2px); }
.fi-jeton[aria-pressed="true"] { color: var(--fi-encre); font-weight: 800; }
.fi-jeton[aria-pressed="true"] .fi-jeton-rond { color: var(--fi-encre); --i2: rgba(255, 246, 207, .55); background: radial-gradient(circle at 35% 25%, #fff6cf, var(--fi-or) 55%, #a8791f); border-color: #fff3c4; transform: scale(1.08); box-shadow: 0 0 10px rgba(246, 201, 106, .7), 0 2px 4px rgba(0, 0, 0, .55); }
.fi-jeton[aria-pressed="true"] .fi-jeton-nom { background: linear-gradient(180deg, #fff3c4, var(--fi-or) 60%, #c08d2b); border-color: #7c5914; }
.fi-jeton:disabled { cursor: not-allowed; color: #9aa1bf; filter: grayscale(1) brightness(.8); }
.fi-jeton:focus-visible, .fi-jeton.est-focus { border-radius: 22px; }

@media (max-width: 699px) {
  .fi-bannieres { width: 100%; }
  .fi-banniere { padding: 6px 13px; font-size: .875rem; gap: 6px; }
  .fi-bannieres:not(.fi-bannieres--icones) .fi-banniere .fi-ico { display: none; }
  .fi-rang.fi-defile { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; padding: 2px 12px 6px; }
  .fi-rang.fi-defile > * { flex: none; }
}

/* ───────────── 7. Petits éléments : jauge, étiquettes, listes, champ, tableau ───────────── */
.fi-jauge, .ui-fable .progress { position: relative; height: 12px; border-radius: 6px; overflow: hidden; background: #070b25; border: 1px solid #4a558f; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .8); }
.fi-jauge > span, .ui-fable .progress > div { position: relative; display: block; height: 100%; border-radius: 5px; overflow: hidden; background: linear-gradient(180deg, #fff3c4, var(--fi-or) 50%, #b9862a); transition: width .6s var(--fi-courbe); }
.fi-jauge > span::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent); animation: fi-brille 2.8s ease-in-out infinite; }
@keyframes fi-brille { from { transform: translateX(-120%); } 60%, to { transform: translateX(300%); } }
.fi-etiquette, .ui-fable .badge { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 10px; border-radius: 4px; font: 700 .8125rem/1.2 var(--fi-corps); white-space: nowrap; color: var(--fi-or-clair); background: rgba(8, 12, 40, .7); border: 1px solid var(--fi-or-profond); }
.fi-etiquette--ok { color: var(--fi-ok); border-color: #3f9a72; }
.fi-etiquette--alerte { color: var(--fi-alerte); border-color: #a9772c; }
.fi-etiquette .fi-ico { width: 13px; height: 13px; }
.fi-etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.fi-etapes li { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: center; min-height: 34px; }
.fi-etapes li::before { content: ""; width: 20px; height: 20px; transform: rotate(45deg) scale(.72); border: 2px solid #7f88b8; background: #0c1233; justify-self: center; }
.fi-etapes li.fait { color: var(--fi-texte-doux); }
.fi-etapes li.fait::before { border-color: var(--fi-or-clair); background: linear-gradient(135deg, var(--fi-or-clair), var(--fi-or-profond)); box-shadow: 0 0 6px rgba(246, 201, 106, .6); }
.fi-champ { position: relative; display: flex; align-items: center; }
.fi-champ .fi-ico { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--fi-or); pointer-events: none; }
.fi-champ input { width: 100%; min-height: 46px; padding: 8px 12px 8px 40px; font: 1rem var(--fi-corps); color: var(--fi-texte); background: linear-gradient(180deg, #070b25, #111a40); border: 1px solid #55619a; border-radius: 8px; box-shadow: inset 0 2px 5px rgba(0, 0, 0, .7); }
.fi-champ input::placeholder { color: var(--fi-texte-doux); opacity: 1; }
.fi-champ input:focus-visible { border-color: var(--fi-or); }
.fi-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fi-table th, .fi-table td { padding: 7px 6px; text-align: right; border-bottom: 1px solid rgba(120, 132, 190, .35); }
.fi-table th:first-child, .fi-table td:first-child { text-align: left; }
.fi-table thead th { font: 700 .8125rem var(--fi-corps); color: var(--fi-or-clair); border-bottom: 2px solid var(--fi-or-profond); }
.fi-table tfoot th { color: var(--fi-or-clair); border-bottom: 0; border-top: 2px solid var(--fi-or-profond); }
.fi-table .fi-ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; }
.fi-cout { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fi-cout .fi-ico { width: 16px; height: 16px; }
.fi-cout--credits .fi-ico { color: #f6cf66; --i2: #7c5914; }
.fi-cout--cristaux .fi-ico { color: #7fe3f4; --i2: #1c6f8f; }

/* ───────────── 8. États vides, chargement, erreur, toast ───────────── */
.fi-vide { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; padding: 6px 2px; }
.fi-vide-image { grid-row: span 2; width: 112px; height: 77px; }
.fi-vide-titre { margin: 0; font-weight: 700; color: var(--fi-texte); align-self: end; }
.fi-vide-texte { margin: 0 !important; color: var(--fi-texte-doux); font-size: .9375rem; align-self: start; }
.fi-vide .fi-btn { grid-column: 1 / -1; justify-self: start; margin-top: 8px; }
.fi-chargement { display: grid; justify-items: center; gap: 10px; padding: 18px 8px; text-align: center; color: var(--fi-texte-doux); }
.fi-sceau { width: 64px; height: 64px; overflow: visible; }
.fi-sceau .trace { fill: none; stroke: var(--fi-or); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 150; animation: fi-trace 2.2s var(--fi-courbe) infinite; }
.fi-sceau .coeur { fill: var(--fi-or-clair); transform-origin: 32px 40px; animation: fi-coeur 2.2s ease-in-out infinite; }
@keyframes fi-trace { from { stroke-dashoffset: 150; } 55%, to { stroke-dashoffset: 0; } }
@keyframes fi-coeur { 0%, 45% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.1); } 100% { opacity: 1; transform: scale(1); } }
.fi-squelette { display: grid; gap: 8px; width: 100%; }
.fi-squelette span { height: 14px; border-radius: 3px; background: linear-gradient(90deg, #1c2757 0%, #34407a 45%, #1c2757 90%) 0 0 / 220% 100%; animation: fi-vague 1.6s linear infinite; }
.fi-squelette span:nth-child(2) { width: 78%; } .fi-squelette span:nth-child(3) { width: 54%; }
@keyframes fi-vague { to { background-position: -220% 0; } }
.fi-erreur { display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; align-items: start; padding: 12px 14px; border-radius: 6px; background: linear-gradient(180deg, #2a1a2e, #1b1430); border: 1px solid #8a4a55; border-left: 5px solid var(--fi-rouge); }
.fi-erreur .fi-ico { width: 28px; height: 28px; color: var(--fi-erreur); --i2: #2a0c10; grid-row: span 2; margin-top: 2px; }
.fi-erreur b { color: #ffe1e3; }
.fi-erreur p { margin: 0 !important; color: #f0d6da; font-size: .9375rem; }
.fi-erreur .fi-btn { grid-column: 2; justify-self: start; margin-top: 8px; }
.fi-toast { position: fixed; left: 50%; bottom: calc(var(--fi-nav-h) + 18px + env(safe-area-inset-bottom, 0px)); z-index: 90; transform: translate(-50%, 20px); opacity: 0; max-width: min(520px, calc(100vw - 96px)); padding: 10px 16px; border-radius: 6px; font-weight: 600; color: var(--fi-encre); background: linear-gradient(180deg, #f3ead4, #cfc2a3); border: 1px solid var(--fi-or-profond); box-shadow: 0 6px 16px rgba(0, 0, 0, .6); pointer-events: none; transition: opacity var(--fi-pose), transform var(--fi-pose) var(--fi-courbe); }
.fi-toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ───────────── 9. SUMA : rond existant conservé, place réservée, bulle de conseil reliée ───────────── */
.fi-suma { position: fixed; right: 7px; bottom: calc(7px + env(safe-area-inset-bottom, 0px)); z-index: 46; width: 52px; height: 52px; padding: 0; border-radius: 50%; overflow: visible; border: 0; background: none; cursor: pointer; }
.fi-suma-rond { display: block; width: 100%; height: 100%; border-radius: 50%; overflow: hidden; border: 2px solid #c9a227; background: #1c2540; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); }
.fi-suma-rond img { width: 100%; height: 180%; object-fit: cover; object-position: 50% 4%; display: block; }
.fi-suma-rond b { display: grid; place-items: center; width: 100%; height: 100%; font: 700 20px var(--fi-titre); color: #c9a227; }
.fi-suma .fi-pastille { top: -2px; right: -2px; }
.fi-suma.fi-suma--pose { position: relative; inset: auto; flex: none; }
.fi-conseil { position: fixed; right: 8px; bottom: calc(var(--fi-nav-h) + 12px + env(safe-area-inset-bottom, 0px)); z-index: 47; width: min(340px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 10px 10px 2px 10px; color: var(--fi-encre); background: var(--fi-grain), linear-gradient(180deg, #f6eeda, #d9ccae); border: 1px solid var(--fi-or-profond); box-shadow: 0 0 0 2px rgba(255, 246, 207, .35), 0 10px 22px rgba(0, 0, 0, .6); animation: fi-pose var(--fi-pose) var(--fi-courbe) both; }
/* La queue de la bulle descend vers le rond de SUMA. */
.fi-conseil::after { content: ""; position: absolute; right: 16px; top: 100%; width: 20px; height: 13px; background: #d9ccae; clip-path: polygon(0 0, 100% 0, 62% 100%); filter: drop-shadow(0 1px 0 var(--fi-or-profond)); }
.fi-conseil.fi-conseil--pose { position: relative; inset: auto; z-index: 0; border-radius: 10px 10px 2px 10px; }
.fi-conseil.fi-conseil--pose::after { top: 100%; bottom: auto; clip-path: polygon(0 0, 100% 0, 62% 100%); }
.fi-conseil-qui { margin: 0 0 3px; font: 700 .8125rem/1.2 var(--fi-titre); letter-spacing: .08em; text-transform: uppercase; color: #6d4d10; }
.fi-conseil p { margin: 0 0 8px; font-size: .9375rem; line-height: 1.45; }
.fi-conseil .fi-actions { margin-top: 4px; }
.fi-conseil .fi-btn--texte { color: #4a3508; text-decoration-color: #a8791f; }
.fi-conseil .fi-btn:not(.fi-btn--principal):not(.fi-btn--texte) { color: var(--fi-or-clair); }

/* GUIDE-01 : la bulle est ancrée au rond de SUMA, avec un seul conseil à la fois. */
.guide-heading { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; }
.guide-heading > h2 { margin: 0; }
.guide-heading .guide-help { flex: none; min-width: 44px; min-height: 44px; margin: 0; }
.guide-objective {
  display: flex; align-items: center; gap: 8px; width: fit-content; max-width: 100%;
  margin: 0 0 10px; padding: 6px 10px; border: 1px solid var(--fi-or-profond);
  border-radius: 8px; color: var(--fi-or-clair); background: var(--fi-nuit-2); font-size: .875rem;
}
.guide-objective .fi-ico { flex: none; }
.section-guide {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
  box-sizing: border-box; overflow: hidden; padding: 0; margin: 0; border: 0; background: transparent;
}
.section-guide::backdrop { background: transparent; }
.section-guide--interactive { width: 100dvw; height: 100dvh; z-index: 99; pointer-events: none; }
.section-guide--interactive .guide-bubble { pointer-events: auto; }
@media (max-width: 480px) {
  #app:has(.initiation-screen) .nav-initiation { min-width: 0; overflow-x: auto; }
  .initiation-screen .camps-lignes .grid.g3 { grid-template-columns: minmax(0, 1fr); }
}
.guide-shade { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.guide-dim { fill: #050817; opacity: .8; }
.guide-connector, .guide-outlines { fill: none; stroke: var(--fi-or-clair); stroke-width: 2; }
.guide-connector { stroke-linecap: round; }
.section-guide .guide-bubble {
  position: absolute; inset: auto; width: min(330px, calc(100% - 24px));
  max-height: calc(100% - 32px); overflow: auto;
  border-radius: 12px; animation: none; box-sizing: border-box;
}
.guide-bubble::after { display: none; }
.guide-bubble p:focus { outline: none; }
.guide-label, .guide-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.guide-progress { color: #634b25; font-size: .8125rem; font-variant-numeric: tabular-nums; }
.guide-actions { flex-wrap: wrap; }
.guide-actions button { min-height: 44px; }
.section-guide button:focus-visible { outline: 3px solid #29366d; outline-offset: 3px; }
.guide-actions button[hidden] { display: none; }
@media (max-height: 430px) {
  .section-guide--interactive .guide-bubble { padding: 6px 10px; }
  .section-guide--interactive .guide-bubble p { line-height: 1.25; margin-bottom: 4px; }
}
#overlay:has(> .battle-suma) { width: 100dvw; height: 100dvh; }
#overlay:has(> .battle-suma):not(.arene3d-on:has(> .arene3d-hote:not([data-mode="repli"]))) {
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
}
#overlay > .battle-suma {
  width: min(390px, calc(100% - 16px)); box-sizing: border-box;
  display: flex; flex-wrap: nowrap; gap: 8px; padding: 5px 8px;
  font-size: .875rem; line-height: 1.25;
}
#overlay > .battle-suma:has(p:empty) { visibility: hidden; }
#overlay > .battle-suma p { margin: 0; flex: auto; }
#overlay.arene3d-on:has(> .arene3d-hote:not([data-mode="repli"])) > .battle-suma {
  position: absolute; bottom: max(8px, env(safe-area-inset-bottom)); left: max(8px, env(safe-area-inset-left));
  width: fit-content; max-width: min(520px, 60%); margin: 0; z-index: 4; pointer-events: none;
  /* Pilote (04/12) : la phrase de SUMA doit se lire sans effort pendant le combat. */
  font-size: clamp(.95rem, 1.5vw, 1.2rem); padding: 8px 14px; border-width: 2px; box-shadow: 0 4px 18px rgba(0, 0, 0, .45);
}
.guide-arena { display: grid; place-items: center; min-height: 190px; padding: 16px 8px; margin-bottom: 10px; }
.guide-arena-target { display: grid; justify-items: center; max-width: 100%; color: var(--fi-texte); }
.guide-arena-target .at-main { max-width: 100%; }
.guide-arena-target:has(.at-main) { padding-inline: 26px; }
.guide-arena-target .at-presentoir { justify-content: center; }
.guide-arena-target .at-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.guide-arena-target :is(button, .at-carte) { animation: none; transition: none; }
.guide-arena-target .fcard { max-width: 145px; }
@media (max-width: 420px) {
  .guide-arena-target .at-main .at-carte { width: 65px; }
}

/* ───────────── 10. Mise en page des écrans (démonstration) ───────────── */
.fi-page { max-width: 1280px; margin: 0 auto; padding: 18px 12px calc(var(--fi-nav-h) + 84px + env(safe-area-inset-bottom, 0px)); }
.fi-pile { display: grid; gap: 16px; }
.fi-grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); align-items: start; }
.fi-rang { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.fi-rang--entre { justify-content: space-between; }
.fi-scene { position: relative; height: min(120vw, 62vh); min-height: 300px; overflow: hidden; border: 12px solid transparent; border-image: url("cadre.svg") 24 / 12px stretch; background: linear-gradient(180deg, #f3c979 0%, #e79d5a 26%, #51608f 58%, #1d2a55 100%) padding-box; }
.fi-scene > div { position: absolute; inset: 0; }
.fi-scene-repli { display: grid; place-items: end center; padding: 14px; text-align: center; color: #fff6dc; font-weight: 600; text-shadow: 0 1px 3px #000; background: linear-gradient(180deg, transparent 55%, rgba(8, 12, 40, .7)); }
.fi-cartes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.fi-carte { position: relative; margin: 0; padding: 5px 5px 8px; border-radius: 10px; background: linear-gradient(180deg, #37437e, #171f4a); border: 1px solid var(--fi-or-profond); box-shadow: inset 0 0 0 1px rgba(255, 246, 207, .18), 0 6px 10px rgba(0, 0, 0, .45); }
.fi-carte img, .fi-carte-vide { display: block; width: 100%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 6px; background: #0c1233; }
.fi-carte-vide { display: grid; place-items: center; color: #55619a; }
.fi-carte-vide .fi-ico { width: 46%; height: auto; aspect-ratio: 1; }
.fi-carte figcaption { padding: 7px 3px 0; font-weight: 700; line-height: 1.2; }
.fi-carte figcaption small { display: block; font-weight: 400; color: var(--fi-texte-doux); font-size: .8125rem; }
.fi-carte .fi-etiquette { margin-top: 5px; }
.fi-effet { display: grid; grid-template-columns: 86px 1fr; gap: 12px; align-items: start; }
.fi-effet img, .fi-effet .fi-carte-vide { width: 86px; border-radius: 6px; border: 1px solid var(--fi-or-profond); aspect-ratio: 5 / 7; object-fit: cover; }
.fi-effet ul { margin: 6px 0 0; padding-left: 1.1em; color: var(--fi-texte-doux); font-size: .875rem; }
@media (min-width: 1000px) {
  .fi-page { padding: 26px 20px 110px; }
  .fi-colonnes { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .fi-scene { height: clamp(340px, 40vw, 560px); border-width: 16px; border-image-width: 16px; }
  .fi-suma { top: 5px; bottom: auto; right: 16px; width: 50px; height: 50px; }
  .fi-barre-rang { padding-right: 84px; }
  .fi-conseil { top: 74px; bottom: auto; right: 14px; border-radius: 10px 2px 10px 10px; }
  .fi-conseil::after { top: auto; bottom: 100%; clip-path: polygon(62% 0, 0 100%, 100% 100%); background: #f6eeda; }
  .fi-toast { bottom: 28px; }
  .fi-cartes { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
}

/* ───────────── 11. Planche de composants ───────────── */
.fi-planche-tete { text-align: center; padding: 26px 12px 4px; }
.fi-planche-tete p { max-width: 62ch; margin: 10px auto 0; color: var(--fi-texte-doux); }
.fi-vitrine { position: relative; margin: 26px 0 0; padding: 26px 0 0; }
.fi-bloc { margin-top: 34px; }
.fi-bloc > p { max-width: 70ch; color: var(--fi-texte-doux); margin: 0 0 14px; }
.fi-etats { display: grid; gap: 18px 16px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); align-items: end; }
.fi-etat { display: grid; gap: 8px; justify-items: start; align-content: end; }
.fi-etat > small { color: var(--fi-texte-doux); font-size: .8125rem; }
.fi-etats--onglets { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); padding-top: 14px; }
.fi-etats--onglets .fi-onglet { width: 78px; }
.fi-cadre-tel { width: min(390px, 100%); margin: 0 auto; border-radius: 14px; overflow: hidden; border: 1px solid #55619a; background: var(--fi-nuit); }

/* ───────────── 12. Matières et typographie des écrans du jeu ───────────── */
.ui-fable body { background: radial-gradient(900px 420px at 50% -120px, rgba(246, 201, 106, .2), transparent 70%), radial-gradient(1200px 700px at 50% 0, #1c2a63 0%, #0a1030 62%) fixed; }
.ui-fable h2 { font-size: 1.2rem; }
.ui-fable h3 { font-family: var(--fi-titre); letter-spacing: .05em; color: var(--fi-or-clair); }
/* ───────────── 13. Mouvement réduit : mêmes informations, sans animation ni déplacement ───────────── */
@media (prefers-reduced-motion: reduce) {
  .fi *, .fi *::before, .fi *::after, .ui-fable *, .ui-fable *::before, .ui-fable *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .fi-sceau .trace { stroke-dashoffset: 0; }
  .fi-jauge > span::after, .fi-btn--principal::after, .ui-fable .btn.primary::after { display: none; }
}

/* Captures pleine page : les éléments fixes sont masqués pour ne pas couper la page en son milieu. */
.fi-capture-page .fi-nav:not(.fi-nav--pose), .fi-capture-page .fi-suma:not(.fi-suma--pose) { display: none; }

/* Propriétaire (04/12) : cartes du joueur (bleu) et de l’adversaire (rouge) bien distinctes. */
.camp-joueur > h3 { color: #8cc4ff; }
.camp-adverse > h3, h3:has(+ .camp-adverse) { color: #ff9a8f; }
.camps-lignes { display: grid; gap: 14px; }
.camps-lignes .grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ui-fable .camps-lignes .camp-joueur .card.fcard, .camp-joueur .card.fcard { border-image-source: url("cadre-bleu.svg"); box-shadow: 0 0 16px rgba(79, 157, 255, .4); }
.ui-fable .camps-lignes .camp-adverse .card.fcard, .ui-fable .grid.camp-adverse .card.fcard, .camp-adverse .card.fcard { border-image-source: url("cadre-rouge.svg"); box-shadow: 0 0 16px rgba(224, 69, 58, .4); }
