/* ==========================================================
   BESTIARIO KAIJU — prefisso bst-
   Pagine: rulebook/bestiario.php, rulebook/bestiario_scheda.php
   ========================================================== */

.bst-wrap {
    --bst-cyan: #00c3ff;
    --bst-accent: #4deeea;
    --bst-orange: #ff9a3c;
    --bst-red: #ff7a7a;
    --bst-text: #c5dae0;
    --bst-muted: #8fa3b5;
    --bst-line: rgba(0, 195, 255, 0.25);
    --bst-panel: rgba(12, 22, 36, 0.9);

    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    color: var(--bst-text);
    background: linear-gradient(to right, rgba(5, 15, 30, 0.85), rgba(10, 25, 50, 0.75));
    border: 1px solid var(--bst-line);
    border-radius: 5px;
    line-height: 1.55;
}

/* Neutralizza gli stili globali di h2/h3 in main.css (sezione DOCUMENTAZIONE: fondo acquamarina,
   padding, testo centrato). :where() tiene la specificità al minimo: le classi bst- qui sotto vincono. */
.bst-wrap :where(h2, h3) {
    background: none;
    padding: 0;
    text-align: left;
}

/* main.css dà a TUTTI i link Orbitron, bianco, hover verde e :visited bianco (che batte una classe
   semplice). Qui dentro i link ereditano il font; i colori li danno le classi bst- con :visited esplicito. */
.bst-wrap a,
.bst-wrap a:visited { font-family: inherit; }

/* I filtri nascondono card e sezioni con l'attributo hidden: va rispettato anche dove la classe dà un display */
.bst-card[hidden],
.bst-sezione[hidden] { display: none; }

/* ---------- Header ---------- */
.bst-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--bst-line);
}

.bst-kicker {
    margin: 0 0 4px;
    font-size: 0.8em;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--bst-muted);
}

.bst-kicker-featured { color: var(--bst-orange); }

.bst-title {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 2em;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--bst-cyan);
    text-shadow: 0 0 10px rgba(0, 195, 255, 0.4);
}

.bst-title-scheda { color: var(--bst-accent); font-size: 2.4em; }

.bst-scientifico { margin: 2px 0 0; font-style: italic; color: var(--bst-muted); }

.bst-count {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8em;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bst-muted);
}

.bst-header-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------- Filtri ---------- */
.bst-filtri { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.bst-filtri-label {
    margin-right: 6px;
    font-size: 0.8em;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bst-muted);
}

.bst-chip {
    min-height: 40px;
    padding: 0 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bst-text);
    background: transparent;
    border: 1px solid rgba(0, 195, 255, 0.35);
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.bst-chip i { margin-right: 6px; }
.bst-chip:hover { border-color: var(--bst-cyan); }
.bst-chip.is-active { background: var(--bst-cyan); border-color: var(--bst-cyan); color: #050b12; }

/* ---------- Sezioni ---------- */
.bst-sezione { display: flex; flex-direction: column; gap: 12px; }

.bst-featured-title,
.bst-cat-title {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95em;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.bst-featured-title { color: var(--bst-orange); }
.bst-featured-title i { margin-right: 8px; }

.bst-cat-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding-bottom: 6px;
    color: var(--bst-cyan);
    border-bottom: 1px solid rgba(0, 195, 255, 0.15);
}

.bst-cat-n {
    font-family: inherit;
    font-size: 0.85em;
    letter-spacing: 1px;
    text-transform: none;
    color: var(--bst-muted);
}

.bst-scala { margin: -4px 0 0; font-size: 0.9em; color: var(--bst-muted); }

/* ---------- Griglie e card ---------- */
.bst-grid-featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bst-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

.bst-card,
.bst-card:visited {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    color: var(--bst-text);
    text-decoration: none;
    background: var(--bst-panel);
    border: 1px solid var(--bst-line);
    transition: border-color 0.2s, transform 0.2s;
}

.bst-card:hover { color: var(--bst-text); text-decoration: none; border-color: var(--bst-cyan); transform: translateY(-3px); }

.bst-card-featured { padding: 0; gap: 0; border-color: rgba(255, 154, 60, 0.6); }
.bst-card-featured.is-abbattuto { border-color: #5a6b7a; }

.bst-card-img {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c1624;
    border-bottom: 1px solid rgba(0, 195, 255, 0.2);
    color: #2a3d52;
    font-size: 2.5em;
    overflow: hidden;
}

.bst-card-img img { width: 100%; height: 100%; object-fit: cover; }

.bst-card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }

.bst-card-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bst-card-row-start { justify-content: flex-start; flex-wrap: wrap; }

.bst-nome {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.15em;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bst-accent);
}

.bst-nome-small { font-size: 0.9em; color: #e0e6ec; }

.bst-riga { margin: 0; font-size: 0.9em; color: var(--bst-muted); }

.bst-habitat { display: inline-flex; gap: 8px; color: var(--bst-muted); }

/* ---------- Badge ---------- */
.bst-cat {
    padding: 2px 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75em;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bst-cyan);
    border: 1px solid var(--bst-cyan);
    white-space: nowrap;
}

.bst-cat-big { padding: 6px 14px; font-size: 1.1em; }

.bst-stato {
    padding: 2px 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65em;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

.bst-stato-attivo      { color: var(--bst-red);  border: 1px solid var(--bst-red); }
.bst-stato-abbattuto   { color: #9aa8b5;         border: 1px solid #5a6b7a; }
.bst-stato-disperso    { color: #ffb46b;         border: 1px solid #ffb46b; }
.bst-stato-sconosciuto { color: var(--bst-muted); border: 1px dashed #5a6b7a; }

.bst-tag-tipologia,
.bst-tag-nascosto {
    padding: 1px 6px;
    font-size: 0.75em;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.bst-tag-tipologia { color: var(--bst-muted); border: 1px dashed #4a6178; }
.bst-tag-nascosto  { align-self: flex-start; color: var(--bst-orange); border: 1px dashed var(--bst-orange); }

/* ---------- Vuoto ---------- */
.bst-wrap .bst-empty a,
.bst-wrap .bst-empty a:visited { color: var(--bst-cyan); }
.bst-wrap .bst-empty a:hover { color: var(--bst-accent); }

.bst-empty { margin: 0; padding: 32px; text-align: center; color: var(--bst-muted); border: 1px solid var(--bst-line); }
.bst-empty i { display: block; margin-bottom: 10px; font-size: 2em; color: var(--bst-orange); }

/* ---------- Scheda ---------- */
.bst-back,
.bst-back:visited {
    align-self: flex-start;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bst-cyan);
    text-decoration: none;
}

.bst-back:hover { color: var(--bst-accent); text-decoration: none; }

.bst-scheda { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 28px; }

.bst-scheda-side { flex: 1 1 280px; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }

.bst-scheda-main { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.bst-scheda-main section { display: flex; flex-direction: column; gap: 8px; }
.bst-scheda-main p { margin: 0; }

.bst-scheda-img {
    position: relative;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0c1624;
    border: 1px solid var(--bst-line);
    color: #2a3d52;
    font-size: 3em;
    overflow: hidden;
}

.bst-scheda-img img { width: 100%; height: 100%; object-fit: cover; }

.bst-lente {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.4em;
    color: var(--bst-cyan);
    background: rgba(5, 11, 18, 0.85);
    border: 1px solid var(--bst-cyan);
    cursor: pointer;
}

.bst-lente:hover { color: #050b12; background: var(--bst-cyan); }

.bst-dati {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 16px;
    margin: 0;
    padding: 16px;
    background: var(--bst-panel);
    border: 1px solid var(--bst-line);
}

.bst-dati dt {
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bst-muted);
}

.bst-dati dd { margin: 0; }
.bst-dati dd small { display: block; font-size: 0.8em; color: var(--bst-muted); }

.bst-habitat-list { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.bst-habitat-list i { color: var(--bst-cyan); margin-right: 4px; }

.bst-nd { color: var(--bst-muted); font-style: italic; }

.bst-note-master {
    padding: 16px;
    background: rgba(255, 154, 60, 0.06);
    border: 1px dashed var(--bst-orange);
}

.bst-note-master h3 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85em;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--bst-orange);
}

.bst-note-master h3 i { margin-right: 8px; }

/* ---------- Lightbox ---------- */
.bst-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 6, 10, 0.92);
    cursor: zoom-out;
}

.bst-lightbox[hidden] { display: none; }

.bst-lightbox img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 1px solid var(--bst-cyan);
    cursor: default;
}

.bst-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 1.2em;
    color: var(--bst-cyan);
    background: rgba(5, 11, 18, 0.85);
    border: 1px solid var(--bst-cyan);
    cursor: pointer;
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
    .bst-wrap { padding: 16px; gap: 22px; }
    .bst-title { font-size: 1.5em; }
    .bst-title-scheda { font-size: 1.7em; }
    .bst-scheda-side { max-width: none; }
}

/* ==========================================================
   GESTIONE BESTIARIO (admin) — prefisso bst-adm-
   Pagina: admin/gestione_bestiario.php
   ========================================================== */

.bst-adm-btn,
.bst-adm-btn:visited {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bst-cyan);
    text-decoration: none;
    background: transparent;
    border: 1px solid rgba(0, 195, 255, 0.45);
    cursor: pointer;
}

.bst-adm-btn:hover { color: var(--bst-accent); border-color: var(--bst-cyan); text-decoration: none; }
.bst-adm-btn-primary,
.bst-adm-btn-primary:visited { color: #050b12; background: var(--bst-cyan); border-color: var(--bst-cyan); }
.bst-adm-btn-primary:hover { color: #050b12; background: var(--bst-accent); }
.bst-adm-btn:disabled { opacity: 0.5; cursor: wait; }

/* ---------- Tabella ---------- */
.bst-adm-table-wrap { overflow-x: auto; }

.bst-adm-table { width: 100%; border-collapse: collapse; }

.bst-adm-table th {
    padding: 8px 10px;
    font-size: 0.75em;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: left;
    color: var(--bst-muted);
    border-bottom: 1px solid var(--bst-line);
}

.bst-adm-table td {
    padding: 10px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 195, 255, 0.1);
}

.bst-adm-table td .bst-tag-tipologia { margin-left: 8px; }
.bst-adm-table tbody tr:hover { background: rgba(0, 195, 255, 0.04); }

.bst-adm-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 0.85em;
    color: var(--bst-muted);
    background: transparent;
    border: 1px dashed #4a6178;
    cursor: pointer;
}

.bst-adm-toggle.is-on { color: var(--bst-cyan); border: 1px solid var(--bst-cyan); }
.bst-adm-toggle-star.is-on { color: var(--bst-orange); border-color: var(--bst-orange); }
.bst-adm-toggle:disabled { opacity: 0.5; cursor: wait; }

.bst-adm-azioni { white-space: nowrap; text-align: right; }

.bst-adm-icon {
    width: 36px;
    height: 36px;
    color: var(--bst-cyan);
    background: transparent;
    border: 1px solid rgba(0, 195, 255, 0.3);
    cursor: pointer;
}

.bst-adm-icon:hover { color: #050b12; background: var(--bst-cyan); }
.bst-adm-icon-danger { color: var(--bst-red); border-color: rgba(255, 122, 122, 0.4); }
.bst-adm-icon-danger:hover { color: #050b12; background: var(--bst-red); }

/* ---------- Form ---------- */
.bst-adm-form { display: flex; flex-direction: column; gap: 20px; }

.bst-adm-form fieldset {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 16px;
    background: var(--bst-panel);
    border: 1px solid var(--bst-line);
}

.bst-adm-form legend {
    float: none;
    width: auto;
    margin: 0 0 4px;
    padding: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85em;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--bst-cyan);
}

.bst-adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }

.bst-adm-form label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0;
    font-size: 0.8em;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bst-muted);
}

.bst-adm-form input[type="text"],
.bst-adm-form input[type="number"],
.bst-adm-form select,
.bst-adm-form textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 1.15em;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: var(--bst-text);
    background: rgba(5, 11, 18, 0.8);
    border: 1px solid rgba(0, 195, 255, 0.3);
    border-radius: 0;
}

.bst-adm-form textarea { resize: vertical; line-height: 1.5; }
.bst-adm-form select option { background: #0c1624; }

.bst-adm-form input:focus,
.bst-adm-form select:focus,
.bst-adm-form textarea:focus { outline: none; border-color: var(--bst-cyan); }

.bst-adm-hint { min-height: 1em; font-size: 0.9em; letter-spacing: 0; text-transform: none; color: var(--bst-accent); }

.bst-adm-checks { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; color: var(--bst-muted); }

.bst-adm-form .bst-adm-checks label {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 0.95em;
    letter-spacing: 0;
    text-transform: none;
    color: var(--bst-text);
    cursor: pointer;
}

.bst-adm-checks i { color: var(--bst-cyan); }

.bst-adm-form .bst-adm-master { color: var(--bst-orange); }
.bst-adm-form .bst-adm-master textarea { border-color: rgba(255, 154, 60, 0.5); }
.bst-adm-master small { text-transform: none; letter-spacing: 0; font-weight: 400; }

.bst-adm-footer { display: flex; justify-content: flex-end; }

/* ---------- Stirpe (scheda) ---------- */
.bst-stirpe .bst-cat-title i { margin-right: 4px; }
.bst-stirpe-list { display: flex; flex-direction: column; gap: 8px; }

.bst-stirpe-item,
.bst-stirpe-item:visited {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
    color: var(--bst-text);
    text-decoration: none;
    background: var(--bst-panel);
    border: 1px solid var(--bst-line);
    transition: border-color 0.2s;
}

.bst-stirpe-item:hover { color: var(--bst-text); text-decoration: none; border-color: var(--bst-cyan); }
.bst-stirpe-item .bst-nome { margin-right: auto; }
