/* Inventaire & Codex : styles communs (le reste vient d'app.css). */

/* ---------- En-tête ---------- */
.chiffre-lien { text-decoration: none; transition: border-color .2s; }
.chiffre-lien:hover { border-color: var(--trait-fort); }
.chiffre-lien small { color: var(--legendaire); font-weight: 600; }
.progression { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 20px; margin-top: 10px; padding: 16px 18px; }
.prog-rarete { display: grid; gap: 7px; font-size: 13.5px; }
.prog-rarete .tete { display: flex; justify-content: space-between; gap: 8px; }
.prog-rarete .tete b { color: var(--c); font-weight: 700; }
.prog-rarete .tete span { color: var(--encre-2); }
.prog-rarete .jauge-niv { height: 7px; }
.repartition { display: grid; gap: 3px; margin-top: 6px; font-size: 13px; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.repartition span { display: flex; align-items: baseline; gap: 6px; }
.repartition span::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; align-self: center; }
.chiffre .repartition b { font: inherit; color: var(--c); font-weight: 700; min-width: 1.4ch; text-align: right; }
.plafonds { margin-top: 14px; font-size: 14px; color: var(--encre-2); }
.plafonds span { color: var(--c); font-weight: 700; white-space: nowrap; }

/* ---------- Barre d'outils ---------- */
.outils-objets { display: grid; gap: 12px; margin-bottom: 22px; }
.outils-objets > * { min-width: 0; }
.rangee { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.rangee.entre { justify-content: space-between; }
.onglets-b .n { margin-left: 6px; color: var(--encre-3); font-weight: 600; font-size: 13px; }
.onglets-b [aria-pressed="true"] .n { color: var(--encre-2); }
.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puces .etiquette { padding: 7px 12px 7px 10px; font-size: 13.5px; }
.champ.recherche { flex: 1 1 220px; max-width: 360px; }
.champ.tri span { font-size: 13px; color: var(--encre-3); white-space: nowrap; }
.champ.tri select { width: auto; }
.bascule { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--encre-2); }
.bascule label { cursor: pointer; }
.compte-resultats { margin-left: auto; font-size: 13px; color: var(--encre-3); }

/* Filtres secondaires, repliés par défaut (Codex) */
.plus-filtres summary { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; color: var(--encre-2); border-radius: 8px; }
.plus-filtres summary::-webkit-details-marker { display: none; }
.plus-filtres summary:hover { color: var(--encre); }
.plus-filtres summary svg { width: 16px; height: 16px; transform: rotate(90deg); transition: transform .2s var(--ease); }
.plus-filtres[open] summary svg { transform: rotate(-90deg); }
.plus-filtres .n-filtres { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--legendaire); color: #16120a; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.plus-filtres .n-filtres:empty { display: none; }
.plus-filtres .puces { margin-top: 10px; }

/* ---------- Équipement (Inventaire) : même module que le profil, en plus compact ---------- */
.inv-equip { margin-bottom: 26px; }
.inv-equip .pf-slots { grid-template-columns: repeat(4, minmax(0, 168px)); }
.inv-puissance { font-size: 14px; color: var(--encre-2); font-weight: 600; }
.inv-puissance b { font-family: var(--titre); font-weight: 800; font-size: 26px; color: var(--encre); }
.inv-puissance .montant { margin-left: 4px; }
.inv-puissance .montant > svg { width: 24px; height: 24px; }
.table-objets thead th svg { width: 15px; height: 15px; display: block; }
@media (max-width: 640px) { .inv-equip .pf-slots { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; } .inv-equip .pf-slot-vide { font-size: 12px; text-align: center; } .inv-equip .pf-slot-niv { font-size: 11.5px; } }

/* ---------- Cartes ---------- */
.pl-objet { color: var(--encre-2); font-weight: 700; }
.case-carte .jauge-niv i { background: var(--c); }
.meta-carte { min-height: 1.5em; }
.meta-carte .est-max { color: var(--c); font-weight: 700; }
.meta-carte .trop { color: var(--legendaire); font-weight: 700; }
.possede { display: inline-flex; align-items: center; gap: 5px; color: var(--encre-2); font-weight: 600; font-size: 12.5px; }
.possede svg { width: 14px; height: 14px; color: var(--normal); flex: none; }

/* ---------- États ---------- */
.vide-large { grid-column: 1 / -1; padding: 40px 24px; }
.vide-large .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.coffre-vide { display: block; width: 84px; height: 70px; margin: 0 auto 14px; }

/* ---------- Tiroir ---------- */
/* app.css ne donne pas d'espacement à .fiche (voir rapport) */
.tiroir .fiche { display: grid; gap: 22px; }
.apercu-puissance { flex-basis: 100%; font-size: 14px; color: var(--encre-2); }
.apercu-puissance b { font-family: var(--titre); font-weight: 700; color: var(--encre); }
.apercu-puissance .hausse { color: var(--normal); font-weight: 700; }
.apercu-puissance .baisse { color: #ff8a8a; font-weight: 700; }
.apercu-puissance small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--encre-3); }
.ligne b.eteint { color: var(--encre-3); font-weight: 600; }
.ligne.note { grid-template-columns: 1fr; font-size: 13px; }
.chargement-ligne { color: var(--encre-3); }

/* ---------- Tableau comparatif ---------- */
.table-defile { overflow-x: auto; border: 1px solid var(--trait); border-radius: 14px; background: var(--sol-2); overscroll-behavior-x: contain; }
.table-objets { width: 100%; min-width: 900px; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table-objets th, .table-objets td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--trait); }
.table-objets tbody tr:last-child > * { border-bottom: 0; }
.table-objets thead th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--encre-3); background: var(--sol-3); white-space: nowrap; }
.table-objets tbody th { font-weight: 400; }
.table-objets tr > :first-child { position: sticky; left: 0; z-index: 1; width: 240px; background: var(--sol-2); box-shadow: inset -1px 0 0 var(--trait); }
.table-objets thead tr > :first-child { background: var(--sol-3); z-index: 2; }
.table-objets tbody tr { cursor: pointer; }
.table-objets tbody tr:hover > * { background: var(--sol-3); }
.table-objets tbody th { box-shadow: inset 3px 0 0 var(--c), inset -1px 0 0 var(--trait); }
.table-objets tbody th > * + * { margin-top: 6px; }
.nom-objet { display: grid; gap: 1px; text-align: left; font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.num-objet { font-size: 12px; font-weight: 600; color: var(--encre-3); }
.table-objets td { color: var(--encre-2); }
.table-objets td b { color: var(--encre); }
.table-objets .negatif b { color: #ff8a8a; }
.table-objets .effets { min-width: 180px; }
.table-objets .nowrap { white-space: nowrap; }
.table-objets .scal b { font-family: var(--titre); color: var(--legendaire); }
.table-objets .pilule, .table-objets .possede { display: flex; width: max-content; }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .puces, .onglets-b.defile { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .puces::-webkit-scrollbar, .onglets-b.defile::-webkit-scrollbar { display: none; }
  .onglets-b.defile { display: flex; }
  .puces .etiquette, .onglets-b button { flex: none; min-height: 44px; white-space: nowrap; }
  .champ { height: 44px; }
  .champ.recherche { flex-basis: 100%; max-width: none; }
  .champ.tri { flex: 1; }
  .bascule { min-height: 44px; }
  .compte-resultats { margin-left: 0; }
  .progression { grid-template-columns: 1fr 1fr; padding: 14px; }
  .grille-chiffres { grid-template-columns: 1fr 1fr; }
  .table-objets { min-width: 760px; font-size: 13.5px; }
  .table-objets tr > :first-child { width: 150px; min-width: 150px; max-width: 150px; }
  .table-objets th, .table-objets td { padding: 10px 11px; }
  .tiroir-pied > .btn-principal, .tiroir-pied > .btn-second { flex: 1 1 auto; min-height: 44px; }
}

/* ---------- Mobile : cartes d'abord (audit 30/09) ---------- */
/* Résumé en une ligne qui déplie les chiffres, filtres repliés derrière « Filtres ». Desktop inchangé. */
.resume-objets, .btn-filtres { display: none; }
.lien-aide { position: relative; display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--trait-fort); color: var(--encre-2); font: 700 12px/1 var(--texte); text-decoration: none; vertical-align: 1px; }
.lien-aide::before { content: ""; position: absolute; inset: -12px; }
.lien-aide:hover { color: var(--encre); border-color: var(--encre-3); }
@media (max-width: 900px) {
  .entete-page.entete-objets { flex-wrap: nowrap; align-items: center; margin-bottom: 12px; }
  .entete-objets h1 { font-size: 26px; }
  .entete-objets p { display: none; }
  .entete-objets .actions .btn-second { min-height: 44px; padding: 8px 12px; }
  .resume-objets { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; background: var(--sol-2); border: 1px solid var(--trait); font-size: 14px; color: var(--encre-2); text-align: left; }
  .resume-objets b { color: var(--encre); font-weight: 700; }
  .resume-objets > span { flex: 1; min-width: 0; }
  .resume-objets svg { width: 16px; height: 16px; flex: none; transform: rotate(90deg); transition: transform .2s; }
  .resume-objets[aria-expanded="true"] svg { transform: rotate(-90deg); }
  .stats-objets:not(.ouvert) { display: none; }
  .stats-objets { margin-top: 10px; }
  .section-objets { margin-top: 14px; }
  .outils-objets { gap: 10px; margin-bottom: 16px; }
  .outils-objets > .rangee-recherche { order: -1; }
  .outils-objets:not(.filtres-ouverts) > .repliable { display: none; }
  .btn-filtres { display: inline-flex; min-height: 44px; }
  .btn-filtres[aria-expanded="true"] { border-color: var(--legendaire); }
  .btn-filtres .n-filtres { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--legendaire); color: #16120a; font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
  .btn-filtres .n-filtres:empty { display: none; }
  .rangee-recherche .champ.tri { flex: 1 1 auto; }
}
.outils-objets [hidden] { display: none !important; }

/* Inventaire : choix du build réglé (combat ou défense de ligue) */
.inv-builds { margin: 2px 0 8px; }
.inv-builds button { min-height: 40px; }
.inv-equip .pf-entete .btn-second.petit { margin-top: 8px; }

/* ---------- Inventaire : objets uniques, éclats, recyclage ---------- */
.inv-uniques[hidden] { display: none; }
.inv-eclats { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.inv-unique-carte { width: min(230px, 64%); margin: 0 auto; }
.inv-recycle { list-style: none; display: grid; gap: 2px; }
.inv-recycle li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.inv-recycle li:last-child { border-bottom: 0; }
.inv-recycle-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.inv-recycle-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inv-recycle-champ { width: 84px; flex: none; }
.inv-recycle-champ input { text-align: right; font-variant-numeric: tabular-nums; }
.inv-recycle-total { margin-right: auto; }
