/**
 * Cartes-nombres Montessori — styles des cartes
 * (styles communs dans public/css/materiel-commun.css)
 * Couleurs Montessori : unités vertes, dizaines bleues, centaines rouges, milliers verts.
 * Largeurs en escalier (1 chiffre = 56 px) pour que la superposition compose le nombre.
 */

.mn-piece.cn-card {
    height: 76px;
    background: #fffdf5;
    border: 2px solid;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 2.4rem;
}

.cn-card .cn-digit {
    display: inline-block;
    width: 56px;
    text-align: center;
}

/* Unités sur le dessus de la pile, milliers en dessous */
.cn-u {
    width: 66px;
    border-color: #2e7d32;
    color: #2e7d32;
    z-index: 24;
}
.cn-d {
    width: 122px;
    border-color: #1565c0;
    color: #1565c0;
    z-index: 23;
}
.cn-c {
    width: 178px;
    border-color: #c62828;
    color: #c62828;
    z-index: 22;
}
.cn-m {
    width: 234px;
    border-color: #2e7d32;
    color: #2e7d32;
    z-index: 21;
}

.mn-piece.cn-card.dragging {
    z-index: 100;
}

/* Palette compacte : 9 boutons par famille */
.cn-palette {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.cn-palette .mn-add-btn {
    padding: 8px 4px;
    font-weight: 700;
    font-size: 0.9rem;
}

.cn-fam {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 8px 0 4px;
}

.cn-fam-u {
    color: #2e7d32;
}
.cn-fam-d {
    color: #1565c0;
}
.cn-fam-c {
    color: #c62828;
}
.cn-fam-m {
    color: #2e7d32;
}

.cn-fam[hidden] {
    display: none;
}

.cn-palette[hidden] {
    display: none;
}
