.board {
    display: grid;
    gap: 0;
    margin: 2rem auto;
    max-width: 600px;
    width: 100%;
    transition: box-shadow 0.3s;
}

.cell {
    aspect-ratio: 1;
    background-color: #fff;
    border: 1px solid #999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border 0.3s;
    padding: 0;
}

html.dark-mode .cell {
    background-color: #23272b;
    border: 1px solid #444;
    color: #f1f1f1;
}

.cell.dark-square {
    background-color: #000000; /* Gris pour les cases foncées en mode clair */
}

html.dark-mode .cell.dark-square {
    background-color: #666666; /* Gris plus foncé pour les cases foncées en mode sombre */
}


.cell.visited {
    background-color: #4CAF50 !important;
    color: white;
}

html.dark-mode .cell.visited {
    background-color: #388e3c !important;
    color: #fff;
}

.cell.possible-move {
    background-color: #ffe066;
    cursor: pointer;
}

html.dark-mode .cell.possible-move {
    background-color: #bfa700;
    color: #23272b;
}

.cell.dominated {
    background-color: #e3f2fd !important; /* Bleu très clair */
}

html.dark-mode .cell.dominated {
    background-color: #2a3a4a !important; /* Bleu très sombre */
}

.cell.attacked {
    position: relative; /* Nécessaire pour le positionnement du pseudo-élément */
}

.cell.attacked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(239, 83, 80, 0.6) !important; /* Rouge semi-transparent pour le mode clair */
    box-shadow: 0 0 5px rgba(239, 83, 80, 0.5);
}
    

html.dark-mode .cell.attacked::before {
    background-color: rgba(255, 138, 128, 0.7) !important; /* Rouge plus clair et visible pour le mode sombre */
    box-shadow: 0 0 6px rgba(255, 138, 128, 0.5);
}

.cell.has-queen {
    background-color: #5219ba !important; /* Violet clair */
}

html.dark-mode .cell.has-queen {
    background-color: #512da8 !important; /* Violet sombre */
}

.cell.has-piece {
    background-color: #d1c4e9 !important; /* Violet clair, comme pour la dame */
}

html.dark-mode .cell.has-piece {
    background-color: #512da8 !important; /* Violet sombre */
}


.cell.last-move {
    background-color: #ff9800 !important;
    color: #fff;
    border: 2px solid #e65100;
    font-weight: bold;
    box-shadow: 0 0 6px #e65100;
    z-index: 2;
}

html.dark-mode .cell.last-move {
    background-color: #ffb74d !important;
    border: 2px solid #ff9800;
    color: #23272b;
}