/* --- Base et Arrière-plan --- */
body {
    background: linear-gradient(180deg, #5973a6 0%, #0D0053 56%);
    background-attachment: fixed;
    margin: 0;
}

main {
    background: linear-gradient(180deg, #5973a6 0%, #0D0053 56%);
}

/* --- Entête de section --- */
.titre {
    display: flex;
    justify-content: center;
    background-color: #2ecc71;
    margin-bottom: 20px;
}

.titre h1 {
    color: #34495e;
    text-align: center;
}

/* --- Ligne de séparation entre les personnages --- */
.space {
    border-top: 1px solid var(--bleu);
    margin: 30px 40px; /* espace au dessus et en dessous + retrait sur les côtés */
    opacity: 0.5; /* légèrement transparent pour un effet doux */
}

/* --- Grille Principale (PC) --- */
.character-card {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr; /* Central plus large */
    grid-template-areas: "perso info stats";
    gap: 20px;
    align-items: center;
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
}

/* --- Bloc Central (B) - Grille Imbriquée --- */
.character-info {
    grid-area: info;
    display: grid;
    grid-template-columns: 1fr 1fr; /* Deux colonnes internes */
    grid-template-areas: "details desc";
    gap: 30px;
    background-color: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--bleu, #3498db);
    border-radius: 15px;
    padding: 25px;
    color: white;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.4);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.character-info:hover {
    transform: translateY(-5px);
    border-color: #ffffff;
    box-shadow: 0 0 15px var(--bleu, #3498db);
}

/* Colonne Gauche Interne : Sorts */
.info-details {
    grid-area: details;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sorts-wrapper {
    display: grid;
    /* On crée les 4 lignes pour tes sorts */
    grid-template-rows: repeat(4, auto); 
    /* MODIFIE CE GAP POUR RÉGLER L'ESPACE ENTRE LES SORTS */
    gap: 15px; 
}

.sort-item {
    background: rgba(255, 255, 255, 0.08); /* Effet carte de sort */
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9em;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Colonne Droite Interne : Description */
.description-details {
    grid-area: desc;
    border-left: 1px solid rgba(52, 152, 219, 0.3);
    padding-left: 20px;
}

/* --- Images (A et C) --- */
.character-image {
    grid-area: perso;
    display: flex;
    justify-content: center;
}

.character-image img {
    width: 100%;
    max-width: 450px; /* Agrandissement de l'image A */
    height: auto;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
}

.character-stats {
    grid-area: stats;
    display: flex;
    justify-content: center;
}

.character-stats img {
    width: 100%;
    max-width: 400px;
    height: auto;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
}



/* --- Format Mobile (Smartphone) --- */
@media (max-width: 800px) {
    .character-card {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "info"    /* Le texte en premier */
            "perso"   /* Image au milieu */
            "stats";  /* Stats en bas */
        gap: 30px;
        width: 95%;
    }

    .character-info {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "details"
            "desc";
        padding: 15px;
        text-align: center;
    }

    .sorts-wrapper {
        display: grid;
        grid-template-columns: 1fr; /* Une seule colonne de sorts */
        gap: 12px; /* Un gap légèrement plus petit pour les petits écrans */
        margin-top: 10px;
    }

    .description-details {
        border-left: none;
        border-top: 1px solid rgba(52, 152, 219, 0.3);
        padding-left: 0;
        padding-top: 15px;
        margin-top: 10px;
    }

    .character-image img, 
    .character-stats img {
        max-width: 80%; /* Evite les images trop géantes */
        margin: 0 auto;
    }
}