/* --- Réinitialisation & Body --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-image:
        linear-gradient(to bottom, rgba(18, 2, 18, 0.85) 0%, rgba(53, 9, 53, 0.85) 100%),
        url('assets/images/boss.png');

    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;

    background-color: #000; /* fallback si l'image ne charge pas */
    color: #fff;
    font-family: 'Permanent Marker', cursive;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* --- En-tête (Header) --- */
header {
    width: 100%;
    text-align: center;
    padding: 20px 0; /* Hauteur ajustée */
    position: relative;
    background: transparent;
    z-index: 100;
}

/* --- Conteneur du Logo Image --- */
.logo-container {
    display: inline-block;      /* ← FIX PRINCIPAL */
    margin-bottom: 20px;
    text-align: center;
}

.logo-image {
    width: 500px;
    max-width: 80%;
    height: auto;
    display: block;
    margin: 0 auto;
    transform: rotate(-2deg);
    filter: drop-shadow(0 0 3px rgba(255, 105, 180, 0.7));
    transition: filter 0.3s ease, transform 0.3s ease;
}


/* --- Icônes Réseaux Sociaux --- */
.social-media-icons {
    position: absolute;
    top: 25px;
    left: 20px; 
    z-index: 10;
}

.social-icon-round {
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #e0b0ff;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.social-icon-round img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.social-icon-round:hover {
    border-color: #ff69b4;
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 0 15px #ff69b4;
}

/* =================================================================
   NOUVEAU : MENU UTILISATEUR DESKTOP (Haut Droite)
   ================================================================= */
.user-menu-container {
    position: absolute;
    top: 25px;
    right: 25px; /* Positionné tout à droite */
    z-index: 1000;
    font-family: 'Permanent Marker', cursive;
}

/* Le Rond (Avatar ou Lettre) */
.user-icon-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #ff69b4;
    overflow: hidden;
    background-color: #3e1a47;
    display: flex;       /* Pour centrer la lettre */
    align-items: center; /* Centrer verticalement */
    justify-content: center; /* Centrer horizontalement */
    color: #e0b0ff;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.user-icon-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-icon-btn:hover {
    box-shadow: 0 0 15px #ff69b4;
    transform: scale(1.1);
}

/* Le Menu Déroulant (Caché par défaut) */
.dropdown-content {
    display: none; /* Caché */
    position: absolute;
    right: 0;
    top: 55px; /* Juste en dessous du rond */
    background-color: #1a051a;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.8);
    border: 2px solid #ff69b4;
    border-radius: 8px;
    z-index: 1001;
    overflow: hidden;
    text-align: left;
}

/* Afficher au survol */
.user-menu-container:hover .dropdown-content {
    display: block;
}

.dropdown-content a {
    color: #fff;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 105, 180, 0.2);
    transition: background 0.2s;
}

.dropdown-content a:hover {
    background-color: #ff69b4;
    color: #000;
}

/* Nom affiché DANS le menu (pas à côté du rond) */
.user-name-display {
    padding: 10px;
    text-align: center;
    color: #e0b0ff;
    font-size: 0.9rem;
    background: #000;
    border-bottom: 1px solid #ff69b4;
    white-space: nowrap;
}

/* --- Menu de Navigation Principal --- */
.main-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.main-nav a {
    color: #e0b0ff;
    text-decoration: none;
    font-size: 1.8rem;
    text-transform: uppercase;
    font-family: 'Permanent Marker', cursive;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

.main-nav a:hover {
    color: #fff;
    text-shadow: 0 0 10px #e0b0ff;
}

/* --- Conteneur Principal --- */
main {
    width: 90%;
    max-width: 1200px;
    margin-bottom: 50px;
}

.content-box {
    background-color: #000;
    border: 4px solid #333;
    padding: 40px;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.2);
}

/* --- Titre du Chapitre --- */
.chapter-header {
    text-align: center;
    margin-bottom: 40px;
    font-family: 'Uncial Antiqua', cursive;
}

.chapter-header h2 {
    font-size: 2.5rem;
    color: #fff;
    margin-bottom: 5px;
}

.chapter-header h3 {
    font-size: 3rem;
    color: #fff;
    font-weight: normal;
}

/* --- Grille Galerie --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 30px;
    justify-items: center;
}

.page-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 200px;
}

.img-wrapper {
    width: 100%;
    border: 2px solid #333;
    transition: transform 0.2s ease;
    cursor: pointer;
    background-color: #000;
}

.img-wrapper:hover {
    transform: scale(1.05);
    border-color: #ff69b4;
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.5);
}

.img-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.page-label {
    margin-top: 10px;
    color: #fff;
    font-family: 'Permanent Marker', cursive;
    font-size: 1.2rem;
    text-transform: uppercase;
}

/* --- Barre d'outils Admin --- */
.admin-toolbar {
    width: 100%;
    max-width: 600px;
    margin: 40px 0;
    padding: 20px;
    background-color: #000;
    border: 2px dashed #333;
    border-radius: 10px;
    text-align: center;
}

.admin-toolbar h3 {
    color: #888;
    font-family: 'Bangers', cursive;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-admin {
    padding: 10px 20px;
    font-family: 'Permanent Marker', cursive;
    font-size: 1.2rem;
    border: none;
    cursor: pointer;
    color: #fff;
    transform: rotate(-2deg);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-admin:hover {
    transform: rotate(0deg) scale(1.1);
    z-index: 5;
}

.btn-admin:active {
    box-shadow: 2px 2px 0 #fff;
    transform: translate(2px, 2px);
}

.btn-chap {
    background-color: #5dcefa;
    color: #000;
    box-shadow: 4px 4px 0 #fff;
}

.btn-page {
    background-color: #ff69b4;
    color: #000;
    box-shadow: 4px 4px 0 #fff;
}

/* --- LECTURE BD --- */
.comic-container {
    width: 100%;
    max-width: 1100px; 
    margin: 0 auto;
    padding: 10px;
    text-align: center;
}

.comic-page-image {
    width: 100%;
    max-width: 800px; 
    height: auto;
    display: block;
    margin: 20px auto;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
    border: 1px solid #333;
}

.reader-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap; 
}

.nav-btn {
    background: #ff69b4;
    color: #000;
    padding: 10px 25px;
    text-decoration: none;
    font-family: 'Permanent Marker', cursive;
    font-size: 1.2rem;
    border: 2px solid #fff;
    transform: rotate(-2deg);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-block;
}

.nav-btn:hover {
    transform: rotate(0deg) scale(1.1);
    box-shadow: 0 0 15px #ff69b4;
    color: #fff;
}

.nav-btn.disabled {
    background: #444;
    color: #888;
    border-color: #666;
    pointer-events: none;
    opacity: 0.6;
}

.chapter-select {
    padding: 10px;
    background: #000;
    color: #e0b0ff;
    border: 2px solid #e0b0ff;
    font-family: 'Permanent Marker', cursive;
    font-size: 1rem;
    max-width: 100%;
}

.burger-menu {
    display: none; 
    cursor: pointer;
}

.character-card {
    display: flex;
    align-items: flex-start;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #ff69b4;
    border-radius: 10px;
    padding: 20px;
    margin: 20px auto; 
    max-width: 800px; 
    gap: 20px;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.2);
}

.character-img img {
    width: 150px;
    height: 200px;
    object-fit: cover;
    border: 2px solid #5dcefa;
    border-radius: 5px;
    display: block;
}

.character-info {
    flex: 1;
    color: white;
    text-align: left;
}

.character-info h3 {
    color: #ff69b4;
    margin-top: 0;
    text-transform: uppercase;
    font-family: 'Bangers', cursive; 
    font-size: 1.8rem;
    letter-spacing: 1px;
}

.comments-list [style*="flex-grow: 1"] {
    min-width: 0 !important;
}

.comments-list div, 
.replies-container div {
    overflow-wrap: break-word !important;
    word-break: break-word !important; /* Coupe proprement si possible */
    word-break: break-all;             /* Force la coupure si le mot est trop grand */
    white-space: normal !important;
}

/* 3. Amélioration visuelle des champs de texte (Formulaires) */
.content-box textarea {
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    border: 1px solid #ff69b4 !important;
    font-family: sans-serif;
    resize: vertical; /* Permet de l'agrandir uniquement vers le bas */
    transition: box-shadow 0.3s ease;
}

/* Effet lumineux quand on tape un commentaire */
.content-box textarea:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 105, 180, 0.6);
}

/* 4. Préparation pour les mentions (@Pseudo) */
.mention {
    color: #ff69b4;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(255, 105, 180, 0.5);
}

/* =================================================================
   GESTION AFFICHAGE MOBILE / DESKTOP (IMPORTANT)
   ================================================================= */

/* Par défaut (PC) : On cache les éléments spécifiques au mobile */
.mobile-only {
    display: none !important;
}

/* =================================================================
   PARTIE RESPONSIVE (Téléphones < 768px)
   ================================================================= */

@media screen and (max-width: 800px) {
    
    /* 0. NOUVEAU : Zoom global du texte et des éléments en "rem" */
    html {
        font-size: 18px; /* Tu peux tester 18px ou 20px pour voir ce qui rend le mieux */
    }

    /* 1. On CACHE les éléments PC (Rond en haut + Réseaux sociaux) */
    .desktop-only, .social-media-icons {
        display: none !important;
    }

    /* 3. Burger Menu Style */
    .burger-menu {
        display: block !important;
        position: absolute;
        top: 25px;       
        left: 20px;
        z-index: 2000;
        width: 35px;     
        height: 30px;
    }

    .burger-menu span {
        display: block;
        width: 100%;
        height: 4px;
        background-color: #ff69b4; 
        margin: 6px 0;
        border-radius: 2px;
        transition: 0.4s;
        box-shadow: 0 0 5px #ff69b4;
    }
    
    .burger-menu.toggle span:nth-child(1) { transform: rotate(-45deg) translate(-8px, 6px); }
    .burger-menu.toggle span:nth-child(2) { opacity: 0; }
    .burger-menu.toggle span:nth-child(3) { transform: rotate(45deg) translate(-8px, -6px); }

    /* 4. Navigation Mobile (Panneau qui s'ouvre) */
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        height: 100vh;
        background-color: rgba(18, 2, 18, 0.98); /* Fond sombre opaque */
        flex-direction: column;
        justify-content: flex-start; /* Aligner en haut */
        align-items: center;
        gap: 20px;
        z-index: 1500;
        transform: translateX(-100%);
        transition: transform 0.4s ease-in-out;
        margin: 0;
        padding-top: 60px; /* Espace pour ne pas coller au plafond */
        overflow-y: auto;
        border-right: 2px solid #ff69b4;
    }

    .main-nav.active {
        transform: translateX(0%);
    }

    /* 5. Style du PANNEAU UTILISATEUR (Dans le Burger) */
    .mobile-user-panel {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-bottom: 20px;
        padding-bottom: 20px;
        border-bottom: 2px solid #ff69b4;
    }

    .mobile-user-avatar {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        border: 3px solid #ff69b4;
        overflow: hidden;
        background-color: #3e1a47;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #e0b0ff;
        font-size: 3rem;
        margin-bottom: 10px;
        box-shadow: 0 0 15px rgba(255, 105, 180, 0.5);
    }

    .mobile-user-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .mobile-user-details {
        text-align: center;
    }

    .m-name {
        display: block;
        font-family: 'Permanent Marker', cursive;
        font-size: 1.5rem;
        color: #fff;
        margin-bottom: 5px;
    }

    .m-email {
        display: block;
        font-family: sans-serif;
        font-size: 0.9rem;
        color: #aaa;
        word-break: break-all;
    }

    /* Liens normaux plus gros */
    .main-nav a {
        font-size: 1.8rem;
    }

    /* 6. Style des LIENS BAS (Logout/Settings) */
    .mobile-user-links {
        display: flex !important;
        flex-direction: column;
        gap: 15px;
        width: 80%;
        text-align: center;
        margin-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 20px;
    }

    .mobile-user-links a {
        font-size: 1.4rem !important;
        color: #e0b0ff;
    }

    /* Ajustements généraux mobile */
    .logo-image { width: 60%; margin-top: 0; }
    main { width: 100% !important; margin: 0 !important; }
    .comic-container { width: 100%; padding: 0 !important; }
    .comic-page-image { width: 100% !important; border: none; border-radius: 0; }
}

/* ===== FOOTER FULL WIDTH ===== */

.site-footer {
    width: 100%;
    margin-top: auto;
    padding: 25px 0;
    background-color: #0b0b0b;
    border-top: 1px solid rgba(255, 105, 180, 0.3);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-title {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.footer-links {
    font-size: 0.85rem;
}

.footer-links a {
    color: #ff69b4;
    text-decoration: none;
    margin: 0 6px;
}

.footer-links span {
    color: #666;
}

.footer-links a:hover {
    text-decoration: underline;
}

.user-menu-container::after {
    content: "";
    display: block;
    position: absolute;
    top: 40px;      /* Commence un peu avant la fin du bouton */
    left: 0;
    width: 100%;
    height: 30px;   /* Assez grand pour toucher le menu */
    background: transparent; /* Invisible */
    z-index: 999;
}