/* =====================================================================
   Fairy Conundrum — styles partagés (liste, fiche, admin)
   Palette de marque : bleu logo #00B5EC / rose #FEA6BC
   Réutilise les conventions déjà présentes dans style260201.css
   (couleur de texte #5B5D72, fond de panneau #F7F7F7, ombre douce)
   ===================================================================== */

:root {
    --fc-blue: #00B5EC;
    --fc-blue-dark: #0089B3;
    --fc-blue-light: #E3F7FD;
    --fc-pink: #FEA6BC;
    --fc-pink-dark: #E8748F;
    --fc-pink-light: #FFEEF3;
    --fc-ink: #5B5D72;
    --fc-bg-panel: #F7F7F7;
    --fc-border: #E2E2EA;

    /* Radiance : identité propre au jeu, distincte de la marque */
    --fc-radiance-lumiere: #F0B429;
    --fc-radiance-neutre: #9C9EB5;
    --fc-radiance-tenebre: #2E2C4A;
}

/* ---------- Signature : fine barre dégradée bleu -> rose ---------- */
.fc-signature-bar {
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--fc-blue), var(--fc-pink));
    margin: 4px 0 16px 0;
}

/* ---------- Boutons ---------- */
.form-filtre-cartes button[type="submit"],
.fiche-carte button[type="submit"],
.bloc-edition button[type="submit"],
.btn-edit-capacite,
#capacite-form button[type="submit"],
.form-edition-defaut button,
.form-image button {
    background: var(--fc-blue);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background 0.2s;
}
.form-filtre-cartes button[type="submit"]:hover,
.fiche-carte button[type="submit"]:hover,
.bloc-edition button[type="submit"]:hover,
.btn-edit-capacite:hover,
#capacite-form button[type="submit"]:hover,
.form-edition-defaut button:hover,
.form-image button:hover {
    background: var(--fc-blue-dark);
}
.btn-danger {
    background: #fff !important;
    color: #d33 !important;
    border: 1px solid #d33 !important;
}
.btn-danger:hover { background: #d33 !important; color: #fff !important; }

.need-form button, .collec-form button { margin-right: 6px; margin-bottom: 4px; }
.btn-need.actif { background: var(--fc-pink-dark) !important; }

/* ---------- Formulaire de filtre ---------- */
.form-filtre-cartes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.panneau-filtres {
    display: block !important;
    float: none !important;
    clear: both;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
    border: 1px solid var(--fc-border);
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: #fff;
}
.panneau-filtres summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--fc-blue-dark);
    padding: 4px 0;
}
.panneau-filtres .form-filtre-cartes {
    margin-top: 12px;
    margin-bottom: 0;
}
.form-filtre-cartes fieldset {
    flex: 1 1 200px;
    border: 1px solid var(--fc-border);
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff;
    box-sizing: border-box;
}
.form-filtre-cartes legend {
    color: var(--fc-blue-dark);
    font-weight: bold;
    font-size: 0.85em;
    padding: 0 6px;
}
.form-filtre-cartes label { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; font-size: 0.9em; }
.form-filtre-cartes input[type="text"],
.form-filtre-cartes input[type="number"] {
    border: 1px solid var(--fc-border);
    border-radius: 4px;
    padding: 3px 6px;
}
.form-filtre-cartes a { color: var(--fc-blue-dark); align-self: center; }
.nombre-resultats { color: var(--fc-blue-dark); font-weight: bold; margin: 4px 0 0 0; text-indent: 0; }
.bandeau-partage { background: var(--fc-pink-light); border-radius: 8px; padding: 10px 16px; margin-bottom: 12px; text-indent: 0; }
.badge-partage-carte { font-size: 0.8em; color: var(--fc-blue-dark); text-indent: 0; margin: 2px 0; }
.info-aucun-filtre { background: var(--fc-blue-light); border-radius: 8px; padding: 10px 14px; text-indent: 0; color: var(--fc-ink); }

/* ---------- Grille de cartes (liste_cartes.tpl) ---------- */
.grille-cartes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.mini-carte {
    position: relative;
    text-align: center;
    border: 1px solid var(--fc-border);
    border-top: 4px solid var(--fc-blue);
    border-radius: 10px;
    padding: 8px;
    transition: box-shadow 0.2s;
}
.mini-carte.radiance-lumiere { border-top-color: var(--fc-radiance-lumiere); }
.mini-carte.radiance-neutre { border-top-color: var(--fc-radiance-neutre); }
.mini-carte.radiance-tenebre { border-top-color: var(--fc-radiance-tenebre); }
.mini-carte:hover { box-shadow: 0 2px 8px rgba(0,181,236,0.25); }
.mini-carte img { max-width: 100%; height: auto; border-radius: 6px; }
.mini-carte .nom-carte { font-weight: bold; margin: 4px 0; color: var(--fc-ink); text-indent: 0; text-align: center; }
.article h2 { text-align: left; }
.actions-rapides { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 4px 0; flex-wrap: wrap; }
.actions-rapides .action-form { margin: 0; }
.icone-action {
    background: none; border: none; cursor: pointer; font-size: 1.2em; padding: 2px 4px;
    -webkit-appearance: none; appearance: none;
    color: inherit; line-height: normal;
}
.icone-action.actif { color: var(--fc-pink-dark); }
.qte-collection, .qte-etat { display: inline; color: inherit; font-size: 1rem; }
/* L'échange utilise une couleur distincte (orange) du bleu habituel de la
   collection, pour bien différencier les deux compteurs au premier coup d'œil. */
.icone-echange { color: #d97706; }
.icone-echange.actif { color: #b45309; font-weight: bold; }
.qte-echange { color: #d97706; font-weight: bold; }
.action-form[data-role="shiny"] .icone-action.actif { text-shadow: 0 0 6px #ffd700; }
.badge-shiny { margin-left: 4px; text-shadow: 0 0 6px #ffd700; }
.deck-actif-affichage { font-size: 0.9em; color: var(--fc-blue-dark); background: var(--fc-blue-light); border-radius: 6px; padding: 4px 10px; display: inline-block; text-indent: 0; margin: 6px 0; }
.statut-verrouillage { font-size: 0.9em; background: var(--fc-bg-panel); border-radius: 6px; padding: 4px 10px; display: inline-flex; align-items: center; gap: 8px; text-indent: 0; margin: 6px 0; }
.statut-verrouillage.verrouille { background: #ffe3e3; color: #a33; }
.badge-verrouille-inline { font-size: 0.85em; margin-left: 6px; }
.picto-mystere { width: 22px; height: 22px; vertical-align: middle; }
.bloc-mythe, .bloc-commentaire, .bloc-errata {
    border: 1px solid var(--fc-border);
    border-radius: 8px;
    padding: 6px 10px;
    margin: 10px 0;
    background: #fff;
}
.bloc-mythe { background: #f3e9ff; }
.bloc-commentaire { background: var(--fc-bg-panel); }
.bloc-errata { background: #fff0f0; }
.mythe-carte { text-indent: 0; }
.form-recherche-rapide { display: inline-flex; gap: 6px; margin-left: 12px; }
.form-recherche-rapide input[type="text"] { border: 1px solid var(--fc-border); border-radius: 14px; padding: 4px 12px; font-size: 0.9em; }
.form-recherche-rapide button { border-radius: 14px; border: 1px solid var(--fc-blue); background: #fff; color: var(--fc-blue-dark); padding: 4px 12px; cursor: pointer; font-size: 0.9em; }
.form-recherche-rapide button:hover { background: var(--fc-blue); color: #fff; }
.label-picto { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; }
.label-picto img { width: 24px; height: 24px; vertical-align: middle; }
.label-picto img.astralae-picto { width: 36px; height: 36px; }
@media (max-width: 700px) {
    .grille-cartes { grid-template-columns: repeat(1, 1fr); }
}

/* ---------- Fiche carte ---------- */
.fiche-carte {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    border-top: 5px solid var(--fc-blue);
    padding-top: 16px;
}
.fiche-carte.radiance-lumiere { border-top-color: var(--fc-radiance-lumiere); }
.fiche-carte.radiance-neutre { border-top-color: var(--fc-radiance-neutre); }
.fiche-carte.radiance-tenebre { border-top-color: var(--fc-radiance-tenebre); }

.fiche-carte-visuel { flex: 0 0 320px; text-align: center; position: sticky; top: 16px; align-self: flex-start; }
.fiche-carte-visuel img.image-carte { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 2px 0px 4px 0px #656565; }
.fiche-carte-infos { flex: 1 1 auto; min-width: 0; }
@media (max-width: 800px) {
    .fiche-carte { flex-direction: column; }
    .fiche-carte-visuel { flex-basis: auto; width: 100%; }
}

.fav-form-inline { display: inline-block; margin: 0 0 0 10px; vertical-align: middle; }
.btn-favori-inline {
    background: none;
    border: none;
    font-size: 1.3em;
    line-height: 1;
    cursor: pointer;
    vertical-align: middle;
}
.btn-favori-inline.actif { color: var(--fc-pink-dark); }
.pastilles-etat {
    position: absolute; top: 8px; right: 8px; z-index: 2;
    display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
}
.pastille-collection {
    background: var(--fc-blue); color: #fff; border-radius: 50%;
    padding: 4px 9px; font-size: 0.9em;
}
.pastille-etat {
    border-radius: 50%;
    width: 26px; height: 26px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.pastille-need { background: #4caf50; }
.pastille-echange { background: var(--fc-blue-dark); }
.pastille-shiny { background: #ffd700; }
.pastille-dedicace { background: var(--fc-pink-dark); }

.quantite-possedee { color: var(--fc-ink); font-style: italic; }

.box-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    border: 1px solid var(--fc-border);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    background: var(--fc-bg-panel);
    font-size: 0.95em;
}
.box-meta span { white-space: nowrap; text-indent: 0; }
.picto-radiance-meta { width: 1em; height: 1em; vertical-align: middle; margin-left: 4px; }
.derniere-modif-admin { font-size: 0.85em; color: var(--fc-ink); background: var(--fc-pink-light); border-radius: 6px; padding: 4px 10px; display: inline-block; text-indent: 0; }
.modifs-precedentes-admin { font-size: 0.8em; color: var(--fc-ink); opacity: 0.75; margin-left: 8px; white-space: nowrap; }
.date-impression { font-size: 0.85em; color: var(--fc-ink); font-style: italic; text-indent: 0; }
.fil-retour { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; text-indent: 0; }
.nav-carte a { color: var(--fc-blue-dark); }

.nav-cartes-liees {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
}
.fleche-carte-liee {
    background: var(--fc-bg-panel);
    border: 1px solid var(--fc-border);
    color: var(--fc-blue-dark);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6em;
    text-decoration: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.fleche-carte-liee:hover { background: var(--fc-blue); color: #fff; }
.expe-entre-fleches { font-size: 0.85em; color: var(--fc-ink); font-weight: bold; }
.info-cartes-liees { text-align: center; font-size: 0.8em; color: var(--fc-ink); text-indent: 0; margin: 4px 0; }

.stats-carte { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; }
.bloc-autres { order: 1; }
.bloc-combat { order: 2; }
.bloc-cueillette-reve { order: 3; }
.ligne-morpheme-astralae { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; }
.bloc-stat { border: 1px solid var(--fc-border); border-radius: 8px; padding: 6px 10px; min-width: 120px; background: #fff; }
.bloc-stat h3 { margin: 0 0 6px 0; font-size: 0.85em; text-transform: uppercase; color: var(--fc-blue-dark); }
.bloc-stat .picto-stat, .bloc-stat .picto-morpheme { display: inline-flex; align-items: center; gap: 4px; margin: 2px 6px 2px 0; }
.bloc-stat img { width: 22px; height: 22px; vertical-align: middle; }
.bloc-stat img.astralae-picto { width: 33px; height: 33px; }
.bloc-stat b { color: inherit; }

.bloc-capacite h2 { display: flex; align-items: center; gap: 10px; }
.btn-edit-capacite { font-size: 0.7em; }
.btn-enregistrer { background: #ff99cc !important; color: #000 !important; }
.btn-enregistrer:hover { background: #ff7bb8 !important; }
.btn-edit-capacite:disabled { opacity: 0.5; cursor: not-allowed; background: #999 !important; }
.btn-couleur-capacite { background: #1b5e20 !important; color: #fff !important; }
.btn-couleur-capacite:hover { background: #164a1a !important; }
.btn-couleur-errata { background: #ffb3b3 !important; color: #000 !important; }
.btn-couleur-errata:hover { background: #ff9999 !important; }
.alias-carte { font-size: 0.5em; font-weight: normal; color: var(--fc-ink); font-style: italic; }
.capacite-texte { line-height: 1.5; }
#capacite-textarea { width: 100%; min-height: 220px; box-sizing: border-box; font-size: 1em; resize: vertical; }
#errata-textarea { width: 100%; min-height: 220px; box-sizing: border-box; font-size: 1em; resize: vertical; }
#commentaire-textarea { width: 100%; min-height: 220px; box-sizing: border-box; font-size: 1em; resize: vertical; }
.palette-icones { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; padding: 8px; background: var(--fc-bg-panel); border-radius: 6px; }
.picto-cliquable { background: #fff; border: 1px solid var(--fc-border); border-radius: 4px; padding: 3px; cursor: pointer; }
.picto-cliquable:hover { border-color: var(--fc-blue); }
.picto-cliquable img { width: 22px; height: 22px; display: block; }
.palette-glossaire { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; padding: 8px; background: var(--fc-bg-panel); border-radius: 6px; }
.panneau-mots-cles { margin: 8px 0; }
.panneau-mots-cles summary { cursor: pointer; color: var(--fc-blue-dark); font-weight: bold; font-size: 0.9em; }
.panneau-mots-cles .palette-glossaire { margin-top: 8px; }
.palette-speciaux { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; padding: 8px; background: var(--fc-bg-panel); border-radius: 6px; }
.palette-speciaux .picto-cliquable { min-width: 28px; font-weight: bold; color: var(--fc-blue-dark); }
.terme-cliquable { background: #fff; border: 1px solid var(--fc-blue); color: var(--fc-blue-dark); border-radius: 14px; padding: 3px 12px; font-size: 0.85em; cursor: pointer; }
.terme-cliquable:hover { background: var(--fc-blue-light); }
.icone-txt { width: 20px; height: 20px; vertical-align: middle; }
.mot-cle { color: var(--fc-blue-dark); cursor: pointer; }
.mot-cle:hover { color: var(--fc-blue); }
.mot-cle-fixe { color: var(--fc-ink); font-style: italic; }

.tenues a { margin-right: 10px; color: var(--fc-blue-dark); }
.illustrateur a { color: var(--fc-blue-dark); }
.mythologie-carte a { color: var(--fc-blue-dark); }

.bloc-refuge { background: var(--fc-bg-panel); border-radius: 8px; padding: 10px 16px; margin-top: 10px; }
.bloc-refuge ul { text-indent: 0; }

.bloc-edition { margin-top: 16px; }
.bloc-edition summary { cursor: pointer; color: var(--fc-blue-dark); font-weight: bold; }
.bloc-edition label { display: block; margin: 6px 0; font-size: 0.9em; }
.bloc-edition input[type="text"], .bloc-edition input[type="number"],
.bloc-edition input[type="date"], .bloc-edition select, .bloc-edition textarea {
    border: 1px solid var(--fc-border); border-radius: 4px; padding: 4px 6px; width: 100%; max-width: 400px;
}
.label-checkbox { display: flex !important; align-items: center; gap: 6px; }
.label-checkbox input { width: auto !important; }

.msg-succes { background: var(--fc-blue-light); color: var(--fc-blue-dark); border-radius: 6px; padding: 8px 14px; margin-bottom: 10px; text-indent: 0; }
.msg-erreur { background: var(--fc-pink-light); color: #b3324a; border-radius: 6px; padding: 8px 14px; margin-bottom: 10px; text-indent: 0; }

/* ---------- Modale glossaire ---------- */
.fc-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 100; align-items: center; justify-content: center; }
.fc-modal-contenu { background: #fff; border-radius: 10px; padding: 20px 24px; max-width: 420px; position: relative; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.fc-modal-contenu button { position: absolute; top: 8px; right: 10px; background: none; border: none; font-size: 1.1em; cursor: pointer; color: var(--fc-ink); }
.fc-modal-contenu h3 { color: var(--fc-blue-dark); margin-top: 0; }
.fc-modal-contenu p { text-align: left; }

.fc-zoom-modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.9);
    display: flex; align-items: center; justify-content: center;
    overflow: auto;
    cursor: zoom-out;
}
.fc-zoom-image {
    max-width: 90vw; max-height: 90vh;
    transition: transform 0.15s ease-out;
    cursor: zoom-in;
    touch-action: pinch-zoom;
}
.fc-zoom-fermer {
    position: fixed; top: 16px; right: 20px; z-index: 201;
    background: rgba(255,255,255,0.9); border: none; border-radius: 50%;
    width: 40px; height: 40px; font-size: 1.3em; cursor: pointer;
    color: var(--fc-blue-dark);
}
.image-carte { cursor: zoom-in; }

/* ---------- Admin historique ---------- */
.table-historique { width: 100%; border-collapse: collapse; margin: 10px 0; table-layout: fixed; }
.table-historique th, .table-historique td { border: 1px solid var(--fc-border); padding: 6px 8px; text-align: left; font-size: 0.9em; vertical-align: top; word-wrap: break-word; overflow-wrap: break-word; }
.table-historique th { background: var(--fc-blue); color: #fff; }
.table-historique .ligne-modification td { background: var(--fc-bg-panel); font-style: italic; border-top: none; }
.table-historique .ligne-entete td { border-bottom: none; }
.pagination { display: flex; justify-content: space-between; margin: 10px 0; }
.pagination a { color: var(--fc-blue-dark); }
.barre-tri { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 12px 0; font-size: 0.9em; color: var(--fc-ink); }
.titre-barre-tri { font-weight: bold; }
.groupe-tri { display: inline-flex; align-items: center; gap: 4px; background: var(--fc-bg-panel); border-radius: 12px; padding: 3px 10px; }
.picto-tri { width: 22px; height: 22px; vertical-align: middle; }
.btn-tri { text-decoration: none; color: var(--fc-ink); padding: 1px 4px; border-radius: 4px; }
.btn-tri:hover { background: var(--fc-blue-light); }
.btn-tri.actif { background: var(--fc-blue); color: #fff; }
.btn-tri-reset { color: var(--fc-pink-dark); text-decoration: none; font-size: 0.9em; }
.form_right { text-align: center; }
.form_right h3 { color: var(--fc-blue-dark); }
.classement-pseudo { padding-left: 0; list-style: none; }
.classement-pseudo li { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 4px 0; }
.classement-pseudo .nb { font-weight: bold; color: var(--fc-pink-dark); background: var(--fc-pink-light); border-radius: 10px; padding: 0 8px; }
.date-affichage-classement { font-size: 0.8em; color: var(--fc-ink); font-style: italic; text-indent: 0; text-align: center; }
