/* ==========================================================================
   VARIABLES & DESIGN SYSTEM
   ========================================================================== */
:root {
    --bg-main: #e2e5e7;             
    --bg-card: #ffffff;             
    --text-main: #1a1d20;           
    --text-muted: #626970;          
    --primary-gb: #0e7a53;          
    --primary-hover: #095338;       
    --border-color: #d1d5db;        
    --radius: 12px;                 
    --radius-sm: 6px;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.05); 
}

/* ==========================================================================
   RESET & CONFIGURATION DE BASE
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background-color: #e2e5e7;
    background-image: linear-gradient(rgba(244, 246, 248, 0.8), rgba(244, 246, 248, 0.8)), url('fond.png'); 
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 80px;
}

a {
    color: var(--primary-gb);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--primary-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   HEADER FUSIONNÉ AUTOMATIQUE (Correction alignement Logo + Titre)
   ========================================================================== */
.game-details-header {
    background-color: var(--bg-card); 
    padding: 15px 0;
    border-bottom: 3px solid var(--primary-gb); 
    box-shadow: var(--shadow);
}

.game-details-header .container-gameboy {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 25px;
}

.screen {
    flex: 1;
    background-color: #22252a; 
    border: 6px solid #3a3f47; 
    border-radius: var(--radius-sm);
    padding: 2px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

.screen-content {
    background: radial-gradient(circle, #a3b5a9 0%, #7c8f82 100%);
    padding: 10px 20px; 
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.event-text {
    font-size: 1.25rem; 
    color: #0b140e;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.2);
    text-align: center;
}

/* ==========================================================================
   NAVBAR & CONFIGURATION DU MENU
   ========================================================================== */
nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1000;
}

nav .logo img {
    max-height: 50px;
    width: auto;
}

.toggle-btn, .overlay, .overlay-menu .menu-title {
    display: none !important;
}

.overlay-menu {
    display: flex !important;
    align-items: center;
    justify-content: flex-start; /* Changé de space-between à flex-start pour tout aligner à gauche */
    gap: 40px;                   /* Ajoute un bel espace de 40px entre la recherche et le début des menus */
    flex: 1;
    margin-left: 20px;
}
.search-bar {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.9);
    max-width: 240px;
    width: 100%;
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    padding: 6px;
    font-size: 0.9rem;
    width: 100%;
}

.search-button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.container-menu-item {
    display: flex;
    list-style: none;
    gap: 5px;
}

.menu-item {
    position: relative;
    outline: none;
}

.title-list {
    padding: 15px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    outline: none;
    user-select: none;
}

/* Contenu masqué par défaut */
.toggle-content {
    position: absolute;
    top: 100%;
    left: 0;                     
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    padding: 15px;
    display: none !important; 
    grid-template-columns: repeat(2, minmax(140px, 1fr)); 
    gap: 10px;
    list-style: none;
    min-width: 320px;
    
    /* LE CORRECTIF ICI : Force le menu à passer au premier plan absolu */
    z-index: 99999 !important; 
}
#fullset-list {
    grid-template-columns: repeat(4, minmax(70px, 1fr));
    min-width: 400px;
}

.fullsetList-part1, .fullsetList-part2, .fullsetList-part3, .fullsetList-part4,
.list-part1, .list-part2 {
    display: contents; 
}

.items__sub__list {
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-main);
}

.items__sub__list:hover {
    background-color: #f1f5f2;
    color: var(--primary-gb);
}

.container-nav-user {
    display: none !important; 
}

/* ==========================================================================
   LAYOUT PRINCIPAL ET GRILLES
   ========================================================================== */
main {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.container__twoBlocks {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

@media (min-width: 992px) {
    .container__twoBlocks {
        flex-direction: row; 
    }
    .left__block {
        flex: 2.3;
        min-width: 0;
    }
    .right__block {
        flex: 1;
        min-width: 310px;
    }
}

.game__presentation__container, .game__info__container, .other__photos, 
.ingame__compare, .screenshots, .magazine__test, .other-versions, .timeline {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.container-game-details-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 12px;
}

.pixel-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.special-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-gb); 
}

/* ==========================================================================
   CARROUSELS ET IMAGES
   ========================================================================== */
.game-images-container, .game-ohter-img-container, .container__screenshots, .container-magazine-test {
    position: relative;
    overflow: hidden !important;
    width: 100% !important;
    margin: 20px auto !important;
    display: block !important;
}

.game-images-container { max-width: 360px; }
.game-ohter-img-container, .container__screenshots, .container-magazine-test { max-width: 100%; }

.img-wrapper {
    display: flex !important;
    flex-direction: row !important;
    width: 100% !important;
    align-items: center !important;
    will-change: transform;
}

/* ==========================================================================
   CORRECTION FLEXIBLE ET CENTRÉE DES CARROUSELS
   ========================================================================== */
/* On s'assure que chaque slide prend bien 100% de la largeur du carrousel */
.game-images-container .swiper-slide,
.game-ohter-img-container .swiper-slide,
.container__screenshots .swiper-slide,
.container-magazine-test .swiper-slide {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Le conteneur blanc qui entoure chaque image reste bien centré */
.details-img-container {
    background-color: #f8fafc;
    border-radius: var(--radius-sm);
    padding: 15px;
    border: 1px solid var(--border-color);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 250px !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
}

/* L'image retrouve un comportement fluide standard (plus de position: absolute) 
   mais reste parfaitement centrée grâce au Flexbox du parent */
.game-images-container .game-img,
.game-ohter-img-container .game-img,
.container__screenshots .game-img,
.container-magazine-test .game-img {
    max-height: 220px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
    margin: 0 auto !important;
    display: block !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ==========================================================================
   BOUTONS CARROUSEL GEMINI
   ========================================================================== */
.swiper-navBtn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background-color: var(--primary-gb); 
    border: 2px solid white;
    border-radius: 50%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.swiper-navBtn::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid white;
    border-right: 2px solid white;
}

.swiper-button-next::before { transform: rotate(45deg); margin-right: 2px; }
.swiper-button-prev::before { transform: rotate(-135deg); margin-left: 2px; }
.swiper-button-prev { left: 10px; }
.swiper-button-next { right: 10px; }
.swiper-pagination { display: none !important; }

/* ==========================================================================
   TABLEAUX D'INFORMATIONS
   ========================================================================== */
.container__table {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

@media (min-width: 768px) {
    .container__table { grid-template-columns: 1fr 1fr; }
}

.infoTable { width: 100%; border-collapse: collapse; }
.infoTable td { padding: 11px 6px; border-bottom: 1px solid #edf2f7; font-size: 0.88rem; vertical-align: middle; }
.infoTable td:first-child { font-weight: 600; color: var(--text-muted); width: 38%; }
.contribution img, .multiple_info img, .infoTable img { vertical-align: middle; border-radius: 3px; display: inline-block; margin-right: 4px; }
details summary { cursor: pointer; font-weight: 600; color: var(--primary-gb); }

.container-scroll-other-versions { max-height: 280px; overflow-y: auto; }
.other-versions-container a { display: flex; align-items: center; gap: 15px; padding: 12px; border-radius: var(--radius-sm); background: #f8fafc; border: 1px solid var(--border-color); }
.panel-heading {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
    padding-right: 6px;
}
.textelist { font-size: 0.85rem; padding: 8px 0; color: var(--text-main); }

/* ==========================================================================
   TRUE RESPONSIVE MOBILE SÉCURISÉ
   ========================================================================== */
@media (max-width: 991px) {
    .game-details-header .container-gameboy {
        flex-direction: column !important;
        gap: 15px !important;
        text-align: center;
    }
    .screen { width: 100% !important; }

    nav {
        flex-direction: column !important;
        padding: 10px !important;
        background-color: var(--bg-card);
        box-shadow: var(--shadow);
    }
    .overlay-menu {
        flex-direction: column !important;
        width: 100% !important;
        margin-left: 0 !important;
        gap: 15px;
        padding-top: 10px;
    }
    .search-bar { max-width: 100% !important; }
    .container-menu-item {
        flex-direction: column !important;
        width: 100% !important;
        gap: 0 !important;
    }
    .title-list {
        padding: 12px 5px !important;
        border-bottom: 1px solid #f1f3f5;
        justify-content: space-between;
    }
    
    .toggle-content {
        position: static !important;
        box-shadow: none !important;
        border: none !important;
        padding: 10px !important;
        background: #f8fafc !important;
        grid-template-columns: repeat(2, 1fr) !important;
        width: 100% !important;
        min-width: 100% !important;
    }
    #fullset-list {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tas de consoles et Modales */
.tas-consoles-footer { position: fixed; bottom: 0; right: 0; width: 280px; z-index: 99; pointer-events: none; opacity: 0.95; }
@media (max-width: 768px) { .tas-consoles-footer { width: 120px; opacity: 0.5; } }

.modal { display: none; position: fixed; z-index: 999999; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.9); backdrop-filter: blur(8px); align-items: center; justify-content: center; flex-direction: column; }
.modal-zoom-container { max-width: 90%; max-height: 80%; display: flex; justify-content: center; align-items: center; }
.modal-content { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius-sm); box-shadow: 0 0 30px rgba(0,0,0,0.5); animation: zoomAnimation 0.25s ease-out; }
@keyframes zoomAnimation { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.close { position: absolute; top: 25px; right: 35px; color: #f1f3f5; font-size: 40px; font-weight: bold; cursor: pointer; }
#caption { margin-top: 15px; color: #cbd5e1; font-size: 0.95rem; text-align: center; padding: 0 20px; }


.panel-body,
.panel-body div {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
}
/* --- Mise en page du header de présentation (Drapeau + Texte) --- */
.header-presentation {
    display: flex;
    align-items: flex-start; /* Aligne le haut du drapeau avec le haut du texte */
    justify-content: center;
    gap: 30px;              /* Espace entre drapeau et texte */
    padding: 30px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.drapeau-agrandi {
    width: 150px !important; 
    flex-shrink: 0;         /* Empêche le drapeau de rétrécir */
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.zone-explanation {
    flex: 1;                /* Prend tout l'espace restant */
}

.game__description {
    text-align: justify;    /* Justification du texte */
    margin: 0;
    line-height: 1.6;
    padding-left: 20px;     /* Espace entre la bordure et le texte */
    border-left: 4px solid var(--primary-gb); 
}

/* --- Adaptation Mobile (pour repasser en vertical sur petit écran) --- */
@media (max-width: 768px) {
    .header-presentation {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .game__description {
        text-align: left;    /* Souvent plus lisible à gauche sur mobile */
        padding-left: 10px;
    }
}


/* ==========================================================================\
   STYLE RÉTRO GLOBAL (Ajouté pour le design Game Boy)
   ========================================================================== */

/* 1. Style des blocs de contenu (Cartouches) */
.block-container {
    background: var(--bg-card);
    border: 2px solid #333;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 4px 4px 0px #333; /* Effet "Hard Shadow" rétro */
}

/* 2. Style des titres de section (Vert Game Boy) */
.block-container h2 {
    color: #0f380f; /* Vert sombre pixel */
    border-bottom: 2px solid #9bbc0f; /* Vert olive clair */
    padding-bottom: 8px;
    margin-bottom: 15px;
    text-transform: uppercase;
    font-size: 1.2rem;
}

/* 3. Ascenseur propre pour les listes (pour toutes tes pages) */
.list-games {
    max-height: 500px;
    overflow-y: auto;
    padding-right: 10px;
    border: 1px solid var(--border-color);
    background: #fdfdfd;
}

/* 4. Personnalisation de la barre de défilement (Scrollbar) */
.list-games::-webkit-scrollbar {
    width: 8px;
}
.list-games::-webkit-scrollbar-track {
    background: #e0e0e0;
}
.list-games::-webkit-scrollbar-thumb {
    background: #9bbc0f; /* Vert Game Boy */
    border-radius: 4px;
}

/* 5. Alignement des items de liste */
.game-row {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px dashed #ccc;
}

.game-thumb {
    width: 45px;
    height: 45px;
    margin-right: 15px;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

.game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- Customisation du Bandeau (Header) --- */
.header-fusion {
    /* Un dégradé "Game Boy" : Olive foncé vers Vert clair */
    background: linear-gradient(135deg, #306230 0%, #9bbc0f 100%);
    border-bottom: 5px solid #0f380f;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: #fff;
    text-shadow: 2px 2px #000; /* Effet rétro */
    border-radius: 0 0 10px 10px;
}

/* On ajuste le titre pour qu'il ressorte bien sur le dégradé */
.header-fusion h1 {
    color: #fff;
    font-family: 'Courier New', Courier, monospace; /* Police plus "rétro" */
    font-weight: bold;
    margin: 0;
}