/* Le padding et la bordure sont inclus dans la largeur des éléments */
* {
    box-sizing: border-box;
}

body {
    margin: 0 auto;          /* centre la page */
    max-width: 1200px;       /* largeur maximale du contenu */
    padding: 0 20px 70px;    /* 70px en bas pour ne pas passer sous le footer fixe */
    font-family: Arial, sans-serif;
    color: #484444;
    background-color: #ffffffe6;
}

h1, h2, h3, h5 {
    margin: 12px 0;
}

h5 {
    font-weight: normal;
    color: #777;
}

hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 0;
}

/*Header */

.entete {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;

    position: sticky;      /* reste collé en haut quand on scrolle */
    top: 0;                /* à 0px du haut de l'écran */
    background-color: white;   /* sans fond, les cartes passeraient derrière en transparence */
    z-index: 10;           /* reste au-dessus des cartes */
}

.gauche, .droite {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gauche img {
    height: 40px;
}


/* Boutons */

button {
    padding: 6px 14px;
    cursor: pointer;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);   /* ombre légère */

}

.G, .D {
    background-color: white;
    border: 1px solid white;
    border-radius: 4px;
}

.DO {
    background-color: #F97316;
    border: 1px solid #F97316;
    border-radius: 4px;
    color: white;
}

.bordure {
    border: 1px solid #ccc;
}


/*  Barre de recherche et fil d'Ariane  */

.recherche {
    margin: 10px 0;
    border-radius: 15px;
}

.recherche input[type="search"] {
    padding: 6px 10px;
    min-width: 220px;
    border-radius: 10px;
}

.recherche input[type="submit"] {
    padding: 6px 14px;
    cursor: pointer;
    background-color: #F97316;
    border: 1px solid #F97316;
    border-radius: 4px;
    color: white;
}


/*  Liste de cartes  */

/* Autant de colonnes de 190px que la place le permet (5 sur grand écran, moins sur petit) */
.listecartes {
    display: grid;
    grid-template-columns: repeat(auto-fill, 190px);
    justify-content: center;
    gap: 20px;
}

/* Une carte */
.carte {
    width: 100px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);   /* ombre légère */
    border: 1px solid #ffffff;
    border-radius: 15px;
    padding: 15px;
    background-color: whitesmoke;
}

/* Dans la liste, la carte remplit sa colonne */
.listecartes .carte {
    width: 100%;
}

/* Le cadre de l'image : toutes les cartes ont la même taille de cadre */
.cadreimage {
    width: 100%;
    height: 150px;
    background-color: #f7f8fa;
    border-radius: 12px;
    margin-bottom: 10px;
}

/* Dans la liste, le cadre est plus haut (comme une vraie carte Pokémon) */
.listecartes .cadreimage {
    height: 220px;
}

/* Le lien et l'image remplissent tout le cadre */
.cadreimage a {
    display: block;
    width: 100%;
    height: 100%;
}

/* L'image s'adapte au cadre, sans être déformée */
.cadreimage img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nom {
    font-weight: bold;
    margin-bottom: 4px;
}

.serie {
    color: #777;
    font-size: 14px;
}

/* Boutons J'ai et Je cherche */
.actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.boutoncarte {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 10px;
}

.boutoncarte.actif {
    background-color: #F97316;
    border-color: #F97316;
    color: white;
}


/*Badges de statut */

.badge {
    display: inline-block;
    margin-top: 10px;
    padding: 2px 8px;
    border: 1px solid;
    border-radius: 3px;
    font-size: 12px;
    text-transform: uppercase;
}

.possede      { color: #0f7a4a; }
.recherchee   { color: #b45f06; }
.nonpossedee { color: #666; }


/*Filtres et pagination*/

.filtres {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 15px 0 20px;
}

.filtre {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 20px;
}

.filtre.actif {
    border-color: #F97316;
    color: #F97316;
}

.pagination {
    display: flex;
    gap: 8px;
    margin: 25px 0;
}

.page {
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.page.actif {
    background-color: #F97316;
    border-color: #F97316;
    color: white;
}


/*  Fiches (Pokémon et carte)  */

.fiche {
    display: flex;
    gap: 25px;
    margin: 20px 0;
}

.infos {
    flex: 1;
}

.grandeimage {
    width: 160px;
    height: 220px;
}

.grande {
    width: 220px;
    height: 300px;
}

.titrefiche {
    display: flex;
    align-items: center;
    gap: 12px;
}

.numero {
    border: 1px solid #313030;
    border-radius: 3px;
    padding: 2px 8px;
    font-size: 13px;
}

.details {
    color: #777;
}

.boutonsfiche {
    display: flex;
    gap: 6px;
    margin: 15px 0;
}

.encadre {
    border: 1px solid #ddd;
    border-left: 4px solid #F97316;
    padding: 12px 15px;
    color: #555;
}


/* Pastilles de type (Feu = pastille de base)  */

.pastille {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #d9541e;
}

.pastille.electrique { background-color: #e0b400; }
.pastille.eau        { background-color: #3b82c4; }
.pastille.plante     { background-color: #3a9b47; }
.pastille.psy        { background-color: #9b51b0; }
.pastille.combat     { background-color: #b5651d; }
.pastille.obscurite  { background-color: #333; }
.pastille.metal      { background-color: #8a99a8; }
.pastille.dragon     { background-color: #c9a227; }
.pastille.incolore   { background-color: #bdbdbd; }


/* Onglets  */

.onglets {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.onglet {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #777;
}

.onglet.actif {
    border-bottom-color: #F97316;
    color: #313030;
}


/* Tableau des infos de la carte */

.tableaucarte {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

.tableaucarte th {
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    color: #777;
    font-weight: normal;
}

.tableaucarte th, .tableaucarte td {
    padding: 10px 8px;
    border-bottom: 1px solid #ddd;
}

.gris {
    color: #777;
}


/*Commentaires  */

.commentaires {
    border-top: 1px solid #ddd;
}

.commentaire {
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
}

.commentaire p {
    margin: 4px 0 0;
}

.auteur {
    font-weight: bold;
}

.date {
    margin-left: 8px;
    font-size: 12px;
    color: #777;
}

.formcommentaire {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.formcommentaire input[type="text"] {
    flex: 1;
    padding: 8px 10px;
}


/*Footer (fixe en bas de l'écran)  */

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: white;
    border-top: 1px solid #ddd;
}

.piedpage {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 6px 15px;
}

.lienpied {
    padding: 4px 12px;
    border-radius: 4px;
    color: #313030;
    text-decoration: none;
    font-size: 13px;
}

.lienpied:hover {
    background-color: #e0e0e0;
}


/* Petits écrans (mobile) */

@media (max-width: 700px) {
    .entete { flex-direction: column; gap: 10px; }
    .fiche { flex-direction: column; }
    .grandeimage, .grande { width: 100%; }
    .boutonsfiche { flex-wrap: wrap; }
    .carte { width: 100%; }
    
}

/* les liens du haut ressemblent aux anciens boutons */
.lienhaut {
    display: inline-block;
    padding: 6px 14px;
    text-decoration: none;
    color: #15171C;
}

.DO.lienhaut {
    color: white;
}

/* la liste des noms sous la barre de recherche */
.recherche {
    position: relative;
}

#propositions {
    position: absolute;
    width: 100%;
    background-color: white;
}

#propositions a {
    display: block;
    padding: 6px 10px;
    border-bottom: 1px solid #ccc;
    color: #15171C;
    text-decoration: none;
}

/* texte au milieu */
.centre {
    text-align: center;
}

/* le nom sous la carte est un lien */
.nom a {
    color: inherit;
    text-decoration: none;
}

.info {
    border: 1px solid #F97316;
    padding: 8px 12px;
}

#surprise {
    position: fixed;
    right: 20px;
    bottom: 60px;
    width: 200px;
}

/* thème sombre choisi dans le profil */
body.sombre {
    background-color: #15171C;
    color: #eee;
}

body.sombre .entete,
body.sombre footer,
body.sombre #propositions {
    background-color: #15171C;
}

body.sombre .carte {
    background-color: #22252C;
    border-color: #22252C;
}

body.sombre .lienhaut,
body.sombre .lienpied,
body.sombre #propositions a {
    color: #eee;
}

body.sombre .lienpied:hover {
    background-color: #333;
}

/* thème sombre : les boutons du haut et le logo restent lisibles */
body.sombre .G,
body.sombre .D {
    background-color: #22252C;
    border-color: #444;
    color: #eee;
}

body.sombre .gauche img {
    background-color: white;
    padding: 4px;
}

/* téléphone : les boutons du haut passent à la ligne */
@media (max-width: 700px) {
    .droite {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* grande taille de texte choisie dans le profil */
body.grande p,
body.grande a,
body.grande td,
body.grande th,
body.grande label,
body.grande input,
body.grande select,
body.grande textarea,
body.grande button {
    font-size: 19px;
}
