/* Encyclopédie du menu (js/encyclo.js) : même langage que les pages Personnages et Terrains (fond à hexagones, panneaux
   bleu nuit bordés de cyan, Rowdies pour les titres, lime pour la sélection). Liste à gauche, fiche à droite ; téléphone :
   liste puis fiche, empilées. Plat, sans ombre portée. */
#p-encyclo:has(.ency) { padding: 0; }
.hs.ency { display: flex; flex-direction: column; gap: 12px; }

/* en-tête : retour, titre, onglets */
.ency-top { display: flex; align-items: center; gap: 18px; min-height: 0; }
.ency-back { display: flex; align-items: center; gap: 6px; flex: none; }
.ency-back img { width: 14px; }
.ency-title { line-height: 1; }
.ency-title .kicker { color: #e8ff5a; }
.ency-title h2 { margin: 3px 0 0; font-family: Rowdies, sans-serif; font-weight: 400; font-size: 34px; color: #fff; }
.ency-tabs { margin: 0 0 0 auto; width: 480px; }
.ency-tabs button { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; font-size: 15px; }
.ency-tabs button img { width: 20px; height: 20px; }
.ency-tabs button.on img { filter: brightness(.15); }

.ency-main { flex: 1; min-height: 0; display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 16px; }

/* liste */
.ency-l { display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.ency-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-radius: 12px; border: 2px solid rgba(120, 220, 240, .45); background: rgba(4, 26, 44, .8); }
.ency-search:focus-within { border-color: #fff; }
.ency-search img { width: 16px; opacity: .8; }
.ency-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: #fff; font: 600 14.5px Lexend, sans-serif; }
.ency-search input::placeholder { color: rgba(200, 246, 255, .5); }
.ency-sort { align-items: center; }
.ency-sort > img { width: 16px; margin-right: 2px; opacity: .8; }
.ency-sort[hidden] { display: none; }
.ency-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 4px 6px 0; }
.ency-empty { padding: 14px 4px; color: #8fdcef; }
.ency-list [hidden] { display: none !important; }   /* recherche : la liste est filtrée, pas refaite */
.ency-gh { display: flex; align-items: center; gap: 8px; margin: 10px 0 5px; color: #c8f6ff; }
.ency-gh:first-child { margin-top: 2px; }
.ency-gh b { font-size: 12.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; white-space: nowrap; }
.ency-gh em { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-style: normal; font-size: 11.5px; color: #8fdcef; }
.ency-gh i { margin-left: auto; padding: 0 7px; border-radius: 8px; background: rgba(4, 26, 44, .8); font: 700 11px/18px Lexend, sans-serif; font-style: normal; color: #8fdcef; }
.ency-gi { flex: none; display: grid; place-items: center; width: 28px; height: 28px; }
.ency-gi canvas, .ency-gi > img { width: 28px; height: 28px; object-fit: contain; }
.ency-gi .rb { width: 24px; height: 24px; }
.ency-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 9px; width: 100%; margin-bottom: 4px; padding: 3px 9px 3px 3px;
  border-radius: 11px; border: 2px solid transparent; background: rgba(4, 26, 44, .55); color: #fff; text-align: left; font: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.ency-row:hover { border-color: rgba(120, 220, 240, .55); }
.ency-row.sel { border-color: #fff; background: #1d6f8c; }
.ency-pt { position: relative; display: block; width: 44px; height: 44px; overflow: hidden; border-radius: 9px; border: 2px solid var(--rc); background: #0d3550; }
.ency-pt canvas, .ency-pt img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ency-pt.hero img { object-fit: cover; }
.ency-pt.item img { padding: 2px; }
.ency-pt.sm { flex: none; width: 38px; height: 38px; }
.ency-nm { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.ency-nm b, .ency-nm em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ency-nm b { font-size: 13.5px; }
.ency-nm em { display: flex; align-items: center; gap: 4px; font-style: normal; font-size: 11.5px; color: #8fdcef; }
.ency-nm em img.fi { width: 14px; height: 14px; flex: none; }
.ency-val { display: flex; align-items: center; gap: 3px; font: 700 12.5px Lexend, sans-serif; font-style: normal; color: #fff; }
.ency-val img { width: 16px; }
.ency-tags { display: flex; align-items: center; gap: 5px; }
.ency-tags > img { width: 18px; height: 18px; }
.ency-tags .rb { width: 18px; height: 18px; }
.ency-tags .rs-el { position: relative; display: inline-flex; width: 20px; height: 20px; }
.ency-tags .rs-el img { width: 20px; height: 20px; }
.ency-tags .rs-el b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 1px; color: #fff; font: 800 10.5px/1 Lexend, sans-serif; }
.ency-pod { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--rc); color: #10141c; font: 800 11px/1 Lexend, sans-serif; font-style: normal; }
.ency-gi .ency-pod { width: 24px; height: 24px; font-size: 13px; }

/* fiche : grand visuel à gauche (nom, sprite, sélecteur), panneau de détails à droite */
.ency-f { display: grid; grid-template-columns: minmax(0, 1fr) 480px; gap: 16px; min-width: 0; min-height: 0; }
.ency-stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; justify-items: center; gap: 8px; min-width: 0; min-height: 0; }
.ency-stage canvas { height: 100%; width: auto; max-width: 100%; min-height: 0; }
.ency-stage.hero canvas { cursor: pointer; }
.ency-plate { display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; line-height: 1; }
.ency-plate .kicker { color: #e8ff5a; }
.ency-plate h2 { margin: 0; font-family: Rowdies, sans-serif; font-weight: 400; font-size: 40px; color: #fff; }
.ency-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ency-chips .chip { height: 24px; font-size: 12px; }
.ency-els .rs-el { position: relative; display: inline-flex; width: 30px; height: 30px; }
.ency-els .rs-el img { width: 30px; height: 30px; }
.ency-els .rs-el b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 1px; color: #fff; font: 800 14px/1 Lexend, sans-serif; }
.ency-big { display: grid; place-items: center; min-height: 0; }
.ency-big img { width: 230px; height: 230px; object-fit: contain; padding: 22px; border-radius: 28px; border: 4px solid var(--rc); background: rgba(4, 26, 44, .7); }
.ency-pick { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 14px; background: rgba(4, 26, 44, .78); }
.ency-pick > span { display: flex; align-items: center; gap: 4px; margin-right: 4px; font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #8fdcef; }
.ency-pick > span img { width: 16px; }
.ency-pick button { min-width: 44px; height: 38px; padding: 0 10px; border-radius: 10px; border: 2px solid rgba(120, 220, 240, .4); background: #0d3550; color: #ffd84a; font: 700 15px Lexend, sans-serif; letter-spacing: 1px; }
.ency-pick button:hover { border-color: #fff; }
.ency-pick button.on { background: var(--lime); border-color: var(--lime); color: #1c2300; }
.ency-card .ency-pick { justify-content: flex-start; margin: 2px 0 4px; padding: 0; background: none; }   /* stage du Défi (artefact) */
.ency-card .ency-pick button { min-width: 36px; height: 30px; font-size: 13px; }
.ency-card .tt-sec .tt-sec { padding: 6px 0 0; border: 0; }   /* sort de l'invocateur dans la fiche d'une invocation */
.ency-card .tt-stat small { font-size: 10.5px; font-weight: 600; color: #8fdcef; }   /* part de l'invocateur ou de la puissance */

.ency-card { min-height: 0; overflow-y: auto; border-radius: 16px; background: rgba(5, 34, 58, .86); border: 2px solid rgba(110, 222, 240, .28); font-size: 13px; }
.ency-card .tt-sec { border-bottom-color: rgba(120, 220, 240, .14); padding: 9px 13px; }
.ency-card .tt-label { color: #e8ff5a; }
.ency-card .tt-head { padding: 10px 13px 8px; }
.ency-cs .tt-sec:last-child { border-bottom: 1px solid rgba(120, 220, 240, .14); }
.ency-card .tt-note { margin-top: 4px; color: #8fdcef; }
.ency-link { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 4px; padding: 4px 8px 4px 4px; border-radius: 10px; border: 2px solid transparent; background: rgba(0, 0, 0, .25); color: #fff; text-align: left; font: inherit; cursor: pointer; }
.ency-link:hover { border-color: rgba(120, 220, 240, .55); }
.ency-link > span { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.ency-link b { font-size: 13px; }
.ency-link em { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-style: normal; font-size: 11.5px; color: #c8f6ff; }
.ency-link em img { width: 14px; }
.ency-link > i { font-style: normal; font-size: 18px; color: #8fdcef; }
.ency-link .ar, .ency-rec .ar { color: #8fdcef; font-weight: 700; }
img.ency-li { width: 34px; height: 34px; flex: none; object-fit: contain; border-radius: 8px; background: rgba(4, 26, 44, .7); }
.ency-rec { display: flex; align-items: center; gap: 6px; }
.ency-rec .ency-link { flex: 1; min-width: 0; }

/* sort de classe et évolutions : base, puis A / B, puis leurs évolutions (comme la page Personnages) */
.ency-tree { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-areas: ". b b ." "a a c c" "d e f g"; gap: 6px; }
.ency-sp { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; padding: 5px 3px; border-radius: 10px; border: 2px solid rgba(120, 220, 240, .3); background: #0d3550; color: #fff; font: inherit; cursor: pointer; }
.ency-sp img { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; }
.ency-sp b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.ency-sp em { font-style: normal; font-size: 10px; color: #8fdcef; }
.ency-sp.base { grid-area: b; border-color: var(--lime); }
.ency-sp:nth-child(2) { grid-area: a; } .ency-sp:nth-child(3) { grid-area: c; }
.ency-sp:nth-child(4) { grid-area: d; } .ency-sp:nth-child(5) { grid-area: e; } .ency-sp:nth-child(6) { grid-area: f; } .ency-sp:nth-child(7) { grid-area: g; }
.ency-sp.A { border-color: #5ab4ff; } .ency-sp.B { border-color: #ff8fd8; }
.ency-sp:hover, .ency-sp.on { border-color: #fff; background: #1d6f8c; }

/* téléphone (Scott 2026-10-23 : « les menus ne sont pas faciles d'accès ni pratiques ») : tout tient dans l'écran, rien ne défile
   à part la liste et la fiche. Colonne de gauche : retour + onglets, recherche, tris (défilent de côté), liste ; à droite, la fiche :
   visuel collé en haut à gauche, détails qui défilent à côté. Règles sous #menu : elles passent devant celles de l'interface v2. */
body.mobile #menu .hs.ency { display: grid; grid-template-columns: 320px minmax(0, 1fr); grid-template-rows: 34px minmax(0, 1fr); grid-template-areas: "top fiche" "list fiche";
  gap: 6px 10px; padding: 6px 8px; overflow: hidden; }
body.mobile #menu .ency-main { display: contents; }
body.mobile #menu .ency-top { grid-area: top; gap: 6px; min-width: 0; }
body.mobile #menu .ency-title { display: none; }
body.mobile #menu .ency-top .ency-back { display: none; }   /* « Retour » = l'onglet Accueil du menu, déjà en haut */
body.mobile #menu .ency-tabs { flex: 1; width: auto; min-width: 0; margin: 0; }
body.mobile #menu .ency-tabs button { height: 34px; font-size: 13px; gap: 5px; padding: 0 4px; }
body.mobile #menu .ency-tabs button img { width: 15px; height: 15px; }
body.mobile #menu .ency-l { grid-area: list; min-height: 0; padding: 6px 6px 4px; gap: 6px; }
body.mobile #menu .ency-search { flex: none; height: 34px; }
body.mobile #menu .ency-search input { font-size: 14px; }
body.mobile #menu .ency-sort { flex: none; flex-wrap: nowrap; overflow-x: auto; touch-action: pan-x; scrollbar-width: none; }
body.mobile #menu .ency-sort button { flex: 0 0 auto; }
body.mobile #menu .ency-list { touch-action: pan-y; overscroll-behavior: contain; }
body.mobile #menu .ency-row { grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 8px; min-height: 44px; padding: 2px 7px 2px 2px; }
body.mobile #menu .ency-pt { width: 38px; height: 38px; }
body.mobile #menu .ency-f { grid-area: fiche; display: grid; grid-template-columns: 200px minmax(0, 1fr); grid-auto-rows: max-content; align-content: start; gap: 8px; min-height: 0;
  overflow-y: auto; touch-action: pan-y; overscroll-behavior: contain; scrollbar-width: none; }
body.mobile #menu .ency-f > :not(.ency-stage) { grid-column: 2; }
body.mobile #menu .ency-f > .ency-stage { grid-column: 1; grid-row: 1 / span 9; position: sticky; top: 0; align-self: start; grid-template-rows: auto 160px auto; gap: 6px; padding-top: 2px; }
body.mobile #menu .ency-f > .ency-stage.item:not(:has(canvas)) { grid-template-rows: auto auto; }
body.mobile #menu .ency-f > :only-child { grid-column: 1 / -1; }
body.mobile #menu .ency-plate { gap: 4px; }
body.mobile #menu .ency-plate .kicker { font-size: 11px; }
body.mobile #menu .ency-plate h2 { font-size: 22px; }
body.mobile #menu .ency-chips .chip { height: 22px; padding: 0 6px; font-size: 11.5px; }
body.mobile #menu .ency-big img { width: 120px; height: 120px; padding: 12px; }
body.mobile #menu .ency-pick { padding: 4px 6px; gap: 4px; }
body.mobile #menu .ency-pick button { min-width: 38px; height: 34px; font-size: 14px; }
body.mobile #menu .ency-card { overflow: visible; font-size: 13px; }
