/* Bestiaire (page/bestiaire.php, js/bestiaire.js) : liste filtrable à gauche, fiche du monstre à droite. */
.bst-chiffres { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.bst-chiffres span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.bst-chiffres b { color: var(--text); }
.bst-chiffres svg { width: 16px; height: 16px; color: var(--gold); }

.bst { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.bst-nav { position: sticky; top: calc(var(--header-h) + 14px); display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); max-height: calc(100vh - var(--header-h) - 28px); min-height: 0; }
.bst-nav .search-bar input { width: 100%; min-width: 0; }
.bst-filtres { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bst-filtres select { width: 100%; min-width: 0; }
.bst-compte { margin: 0; color: var(--muted); font-size: .82rem; }
.bst-liste { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; min-height: 0; padding-right: 4px; scrollbar-width: thin; }
.bst-ligne { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; border: 1px solid transparent; background: none; color: var(--text); text-align: left; cursor: pointer; font: inherit; transition: background .15s, border-color .15s; }
.bst-ligne:hover { background: var(--surface-2, rgba(255, 236, 220, .07)); }
.bst-ligne:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.bst-ligne.on { background: var(--grad-soft); border-color: rgba(255, 138, 61, .45); }
.bst-mini { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 70%, rgba(255, 181, 71, .14), rgba(0, 0, 0, .35)); }
.bst-mini img { max-width: 40px; max-height: 40px; object-fit: contain; }
.bst-ln { min-width: 0; display: flex; flex-direction: column; }
.bst-ln b { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bst-ln small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bst-rien { margin: 14px 4px; color: var(--muted); font-size: .9rem; }

.bst-fiche { min-width: 0; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.bst-vide { display: grid; place-items: center; gap: 10px; min-height: 360px; color: var(--muted); text-align: center; }
.bst-vide svg { width: 42px; height: 42px; color: var(--gold); opacity: .6; }

.bst-hero { --aura: 255, 106, 43; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 22px; align-items: center; padding: 18px; border-radius: var(--radius); background: radial-gradient(120% 140% at 15% 50%, rgba(var(--aura), .28), transparent 60%), rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.aura-terre { --aura: 182, 128, 64; }
.aura-feu { --aura: 255, 93, 54; }
.aura-eau { --aura: 70, 150, 230; }
.aura-air { --aura: 92, 196, 110; }
.aura-neutre { --aura: 210, 196, 165; }
.bst-art { position: relative; height: 200px; display: flex; align-items: flex-end; justify-content: center; }
.bst-art::after { content: ""; position: absolute; left: 15%; right: 15%; bottom: 0; height: 26px; border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .55), transparent 70%); }
.bst-art img { position: relative; z-index: 1; max-width: 100%; max-height: 190px; object-fit: contain; margin-bottom: 10px; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .5)); animation: bst-flotte 3.4s ease-in-out infinite; }
@keyframes bst-flotte { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .bst-art img { animation: none; } }
.bst-titre { min-width: 0; }
.bst-titre h2 { margin: 0 0 10px; font: 700 clamp(1.4rem, 3vw, 2rem)/1.15 var(--font-display); text-wrap: balance; }
.bst-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.bst-tag { padding: 4px 10px; border-radius: 999px; font-size: .78rem; color: var(--muted); background: rgba(0, 0, 0, .3); border: 1px solid var(--line); }
.bst-tag.fam { color: var(--gold); border-color: rgba(255, 181, 71, .35); }
.bst-tag.ok { color: var(--ok); border-color: rgba(74, 222, 128, .35); }
.bst-grades { display: flex; flex-wrap: wrap; gap: 6px; }
.bst-grades button { min-width: 62px; padding: 7px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--text); cursor: pointer; font: inherit; line-height: 1.15; }
.bst-grades button b { display: block; font: 700 1.05rem/1.1 var(--font-display); }
.bst-grades button small { color: var(--muted); font-size: .72rem; }
.bst-grades button[aria-selected="true"] { background: var(--grad); border-color: transparent; color: #1a0b03; }
.bst-grades button[aria-selected="true"] small { color: #3a1a06; }
.bst-grades button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.bst-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 16px 0 12px; }
.bst-stats div { padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.bst-stats small { display: block; color: var(--muted); font-size: .76rem; }
.bst-stats b { font: 700 1.25rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.bst-stats .pv b { color: #ff8a7a; }
.bst-stats .pa b { color: #6cb6ff; }
.bst-stats .pm b { color: #7fd38a; }
.bst-stats .xp b, .bst-stats .km b { color: var(--gold); }

.bst-res { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.bst-res div { --el: 210, 196, 165; position: relative; padding: 9px 10px 12px; border-radius: 12px; text-align: center; background: linear-gradient(rgba(var(--el), .22), rgba(0, 0, 0, .25)); border: 1px solid var(--line); border-top: 3px solid rgb(var(--el)); overflow: hidden; }
.bst-res .terre { --el: 182, 128, 64; }
.bst-res .feu { --el: 255, 93, 54; }
.bst-res .eau { --el: 70, 150, 230; }
.bst-res .air { --el: 92, 196, 110; }
.bst-res small { display: block; color: rgb(var(--el)); font-weight: 700; font-size: .76rem; }
.bst-res b { font: 700 1.1rem/1.3 var(--font-display); color: var(--text); }
.bst-res b.neg { color: var(--err); }
.bst-res i { position: absolute; left: 0; bottom: 0; height: 3px; background: rgb(var(--el)); }
.bst-res i.neg { background: var(--err); }
.bst-esq { margin: 8px 0 16px; color: var(--muted); font-size: .82rem; }

.bst-onglets { margin-bottom: 12px; }
.bst-aide { margin: 0 0 12px; color: var(--muted); font-size: .85rem; max-width: 70ch; }
.bst-pp { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 8px; padding: 10px 14px; border-radius: 14px; background: var(--grad-soft); border: 1px solid rgba(255, 138, 61, .3); }
.bst-pp label { font-weight: 600; font-size: .9rem; }
.bst-pp input[type=range] { flex: 1 1 180px; accent-color: var(--ember); }
.bst-pp output { min-width: 64px; font: 700 1rem/1 var(--font-display); color: var(--gold); text-align: right; font-variant-numeric: tabular-nums; }
.bst-butins, .bst-sorts, .bst-zones { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bst-butins li { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); }
.bst-butins .ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(255, 181, 71, .14), rgba(0, 0, 0, .35)); }
.bst-butins .ico img { max-width: 38px; max-height: 38px; }
.bst-butins .nom { min-width: 0; display: flex; flex-direction: column; }
.bst-butins .nom b { font-weight: 600; font-size: .92rem; }
.bst-butins .nom small, .bst-butins .ch small { color: var(--muted); font-size: .75rem; }
.bst-butins .ch { text-align: right; }
.bst-butins .ch b { font: 700 1rem/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.bst-butins .ch i { display: block; height: 5px; margin: 4px 0 2px; border-radius: 3px; background: rgba(0, 0, 0, .4); overflow: hidden; }
.bst-butins .ch em { display: block; height: 100%; background: var(--grad); }
.bst-sorts li { padding: 10px 14px; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); }
.bst-sorts b { font-weight: 600; }
.bst-sorts .lv { margin-left: 8px; color: var(--gold); font-size: .8rem; }
.bst-sorts p { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
.bst-zones li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); }
.bst-zones li span { min-width: 0; display: flex; flex-direction: column; }
.bst-zones small { color: var(--muted); font-size: .78rem; }
.bst-zones code { color: var(--gold); font-size: .85rem; }

@media (max-width: 980px) {
    .bst { grid-template-columns: minmax(0, 1fr); }
    .bst-nav { position: static; max-height: 460px; }
}
@media (max-width: 640px) {
    .bst-fiche { padding: 14px; }
    .bst-hero { grid-template-columns: minmax(0, 1fr); text-align: center; }
    .bst-art { height: 160px; }
    .bst-tags, .bst-grades { justify-content: center; }
    .bst-res { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bst-butins li { grid-template-columns: 40px minmax(0, 1fr); }
    .bst-butins .ch { grid-column: 2; text-align: left; }
    .bst-filtres { grid-template-columns: minmax(0, 1fr); }
}
