.conteneur-global {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px auto;
    max-width: 800px;
}

.conteneur-jeu {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
}

#grille {
    display: grid;
    grid-template-columns: repeat(10, 40px);
    grid-template-rows: repeat(10, 40px);
    gap: 2px;
    position: relative;
}

.pixel {
    width: 40px;
    height: 40px;
    background-color: #eee;
    border: 1px solid #ccc;
    cursor: pointer;
    position: relative;
    z-index: 0;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7em;
    color: #333;
}

/* États adjacents */
.pixel.adjacent-joueur1:not(.possede-joueur2) {
    background-color: rgba(76, 175, 80, 0.1);
}
.pixel.adjacent-joueur2:not(.possede-joueur1) {
    background-color: rgba(255, 50, 50, 0.1);
}

/* États possédé */
.pixel.possede-joueur1 {
    background-color: rgba(76, 175, 80, 0.5) !important;
    position: relative;
    z-index: 1;
}
.pixel.possede-joueur2 {
    background-color: rgba(255, 50, 50, 0.7) !important;
    position: relative;
    z-index: 1;
}

/* États possédé + adjacent */
.pixel.possede-joueur1.adjacent-joueur2:not(.possede-generateur-joueur1):not(.possede-conquerant-joueur1) {
    background-color: rgba(76, 175, 80, 0.3) !important;
    border: 2px dashed #f44336 !important;
}
.pixel.possede-joueur2.adjacent-joueur1:not(.possede-generateur-joueur2):not(.possede-conquerant-joueur2) {
    background-color: rgba(255, 50, 50, 0.3) !important;
    border: 2px dashed #4CAF50 !important;
}

/* Générateurs */
.pixel.possede-generateur-joueur1 {
    border: 2px solid #4CAF50 !important;
    background-color: rgba(76, 175, 80, 0.8) !important;
    position: relative;
    z-index: 2;
    outline: 2px solid #4CAF50 !important;
    box-shadow: 0 0 0 1px #4CAF50 inset !important;
}
.pixel.possede-generateur-joueur2 {
    border: 2px solid #f44336 !important;
    background-color: rgba(255, 50, 50, 0.9) !important;
    position: relative;
    z-index: 2;
    outline: 2px solid #f44336 !important;
    box-shadow: 0 0 0 1px #f44336 inset !important;
}

/* Conquérants */
.pixel.possede-conquerant-joueur1 {
    background-color: #4CAF50 !important;
    position: relative;
    z-index: 1;
}
.pixel.possede-conquerant-joueur2 {
    background-color: #f44336 !important;
    position: relative;
    z-index: 1;
}

/* Défense */
.defence {
    position: absolute;
    bottom: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.6em;
}
.defence:empty {
    display: none;
}

/* États spéciaux */
.pixel.imprenable {
    outline: 2px solid #FFD700;
    cursor: not-allowed;
}
.pixel.non-cliquable {
    cursor: not-allowed;
    background-color: #f0f0f0;
    pointer-events: none;
}

/* Infos et timers */
#infos, #infos-partie {
    font-size: 1.2em;
    margin: 10px auto;
}
#infos-partie {
    font-weight: bold;
}
#temps-restant-joueur1, #temps-restant-joueur2 {
    font-size: 1em;
    color: #666;
}
.timer-conquete {
    margin: 5px 0;
    padding: 5px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Boutons */
#bouton-demarrer {
    padding: 10px 20px;
    font-size: 1em;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 10px;
}
#bouton-demarrer:hover {
    background-color: #45a049;
}

.boutons-speciaux {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.boutons-speciaux button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    background-color: #2196F3;
    color: white;
}
.boutons-speciaux button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Interrupteurs joueurs */
.conteneur-interrupteur {
    margin: 20px auto;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.bouton-joueur {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    pointer-events: none;
    opacity: 0.7;
}

.bouton-joueur.actif {
    background-color: #4CAF50;
    color: white;
}

.bouton-joueur.tour-adversaire {
    background-color: #f44336; /* Rouge pour l'adversaire */
    color: white;
    opacity: 1;
}

.bouton-joueur.inactive {
    background-color: #eee;
    color: #666;
}

/* Couleurs joueurs */
.joueur1 { color: #4CAF50; }
.joueur2 { color: #f44336; }
.joueur-info {
    margin-bottom: 10px;
    font-weight: bold;
}
