/****************************************************
 * DAMIER PRINCIPAL – THÈME BOIS FMJD
 ****************************************************/

.damier {
    width: 380px;
    height: 380px;
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    border: 6px solid #3a2f1f;
    background: #3a2f1f;
    box-shadow: 0 0 12px rgba(0,0,0,0.5);
}

/****************************************************
 * MINIATURES – pour diagramme_liste.php
 ****************************************************/

.damier-mini {
    width: 120px;
    height: 120px;
    display: block;
    overflow: hidden;
    border: 2px solid #3a2f1f;
    box-shadow: none;
}

.damier-mini .damier {
    width: 120px !important;
    height: 120px !important;
    border-width: 2px;
    box-shadow: none;
}

.damier-mini .square {
    width: 100%;
    height: 100%;
}

.damier-mini .case-numero {
    font-size: 6px;
    top: 1px;
    left: 2px;
}

.damier-mini .jeton {
    width: 70% !important;
    height: 70% !important;
    border-width: 1px;
    box-shadow: none;
}

/****************************************************
 * CASES
 ****************************************************/

.square {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Bois clair symétrique */
.light {
    background:
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.20), rgba(0,0,0,0.05)),
        repeating-linear-gradient(
            0deg,
            #e8d3a0 0px,
            #e8d3a0 12px,
            #e0c894 12px,
            #e0c894 24px
        );
    background-size: cover;
}

/* Bois foncé symétrique */
.dark {
    background:
        radial-gradient(circle at 50% 50%, rgba(0,0,0,0.25), rgba(0,0,0,0.05)),
        repeating-linear-gradient(
            0deg,
            #8b6a3e 0px,
            #8b6a3e 12px,
            #7a5c34 12px,
            #7a5c34 24px
        );
    background-size: cover;
}



/****************************************************
 * NUMÉROTATION FMJD
 ****************************************************/

.case-numero {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 11px;
    font-family: Arial, sans-serif;
    color: rgba(255,255,255,0.75);
    pointer-events: none;
    z-index: 1;
}

/****************************************************
 * PIONS (PNG)
 ****************************************************/

.jeton {
    width: 120%;
    height: 120%;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* Pion blanc */
.jeton-blanc {
    background: url("../images/pieces/pion_blanc.png") center/contain no-repeat;
    border: none;
    box-shadow: none;
}

/* Pion noir */
.jeton-noir {
    background: url("../images/pieces/pion_noir.png") center/contain no-repeat;
    border: none;
    box-shadow: none;
}

/****************************************************
 * DAMES (PNG)
 ****************************************************/

.jeton-dame-blanc {
    background: url("../images/pieces/dame_blanc.png") center/contain no-repeat;
    border: none;
    box-shadow: none;
}

.jeton-dame-noir {
    background: url("../images/pieces/dame_noir.png") center/contain no-repeat;
    border: none;
    box-shadow: none;
}

/****************************************************
 * NUMÉROS MINI
 ****************************************************/

.case-num {
    position: absolute;
    top: 2px;
    right: 3px;
    font-size: 11px;
    font-family: Arial, sans-serif;
    color: rgba(255,255,255,0.75);
    pointer-events: none;
    z-index: 1;
}

/****************************************************
 * Barre de navigation FIXE
 ****************************************************/

.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #e8f5e9;
    padding: 10px;
    text-align: center;
    z-index: 2000;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

body {
    padding-top: 50px;
}

/****************************************************
 * Agrandir le damier uniquement dans la page de saisie
 ****************************************************/

.damier-mini .piece,
.outils .piece {
    width: 120% !important;
    height: 120% !important;
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    object-fit: contain;
    z-index: 2;
}

/* Correction spécifique pour partie_saisie_graphique.php */
.outils .piece {
    width: 80% !important;
    height: 80% !important;
    position: absolute;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    object-fit: contain;
    z-index: 2;
}


.rotate-board .case-numero {
    transform: rotate(180deg);
    transform-origin: center center;
}

#damier {
    display: inline-block;
    overflow: visible !important;
}
/****************************************************
 * Boutons actifs : Couleurs, Miroir, Rotation
 ****************************************************/

.btn-colors-active {
    background-color: #89cff0; /* bleu clair */
    color: black;
}

.btn-mirror-active {
    background-color: #ffb347; /* orange doux */
    color: black;
}

.btn-rotate-active {
    background-color: #90ee90; /* vert clair */
    color: black;
}
/****************************************************
 * PIONS PLATS – uniquement dans diagramme_afficher
 * et uniquement quand le damier est tourné
 ****************************************************/

.diagramme-afficher #damier.rotate-board .jeton-blanc {
    background: url("../images/pieces_flat/pion_blanc_flat.png") center/contain no-repeat;
}

.diagramme-afficher #damier.rotate-board .jeton-noir {
    background: url("../images/pieces_flat/pion_noir_flat.png") center/contain no-repeat;
}

.diagramme-afficher #damier.rotate-board .jeton-dame-blanc {
    background: url("../images/pieces_flat/dame_blanc_flat.png") center/contain no-repeat;
}

.diagramme-afficher #damier.rotate-board .jeton-dame-noir {
    background: url("../images/pieces_flat/dame_noir_flat.png") center/contain no-repeat;
}
.diagramme-afficher #damier.rotate-board .jeton {
    width: 97% !important;
    height: 97% !important;
}
/* Pions réels uniquement pour les pages avec .real-pieces */

.real-pieces .jeton-blanc {
    background-image: url("../images/pieces/reel/pion_blanc_r.png");
    background-size: cover;
    background-position: center;
}

.real-pieces .jeton-noir {
    background-image: url("../images/pieces/reel/pion_noir_r.png");
    background-size: cover;
    background-position: center;
}

.real-pieces .jeton-dame-blanc {
    background-image: url("../images/pieces/reel/dame_blanc_r.png");
    background-size: cover;
    background-position: center;
}

.real-pieces .jeton-dame-noir {
    background-image: url("../images/pieces/reel/dame_noir_r.png");
    background-size: cover;
    background-position: center;
}
/* Réduction de taille uniquement pour les pièces réelles */
.real-pieces .jeton {
    width: 110%;
    height: 110%;
}

