/* ===========================
   Conteneur grille + clavier
=========================== */
#sudoku-container{
    display: flex;
    justify-content: center; /* centre le conteneur horizontalement */
    align-items: flex-start; /* clavier aligné avec le haut de la grille */
    gap: 20px;               /* espace entre grille et clavier */
    margin: 30px auto;       /* centrage vertical + horizontal */
    width: fit-content;      /* la largeur s’adapte à la grille + clavier */
}

/* ===========================
   Grille Sudoku
=========================== */
#sudoku-grid{
    display: grid;
    grid-template-columns: repeat(9, 45px);
    grid-template-rows: repeat(9, 45px);
    gap: 0;
    border: 3px solid #000;
    background: #000;   /* fond noir uniquement autour de la grille */
}

/* cellules */
#sudoku-grid input{
    width: 45px;
    height: 45px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    border: 1px solid #999;
    outline: none;
    background: #fff;
    cursor: pointer;
}

/* chiffres fixes */
#sudoku-grid input:disabled{
    background: #eaeaea;
    color: #000;
}

/* séparateurs verticaux */
#sudoku-grid input:nth-child(3n){
    border-right: 3px solid #000;
}

/* séparateurs horizontaux */
#sudoku-grid input:nth-child(n+28):nth-child(-n+36),
#sudoku-grid input:nth-child(n+55):nth-child(-n+63){
    border-top: 3px solid #000;
}

/* focus */
#sudoku-grid input:focus{
    background: #dbeafe;
}

/* ===========================
   Clavier numérique
=========================== */
#numeric-keyboard{
    display: grid;
    grid-template-columns: repeat(3, 50px);
    grid-template-rows: repeat(3, 50px);
    gap: 5px;
}

#numeric-keyboard button{
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

/* ===========================
   Messages
=========================== */
.sudoku-result-ok, .sudoku-result-no {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    display: none;
    font-weight: bold;
}
.sudoku-result-ok { border: dashed lightgreen; color: white; max-width: 600px; margin: 0 auto; }
.sudoku-result-no { border: dashed lightcoral; color: white; max-width: 600px; margin: 0 auto; }

.formulaire-input-cat-roulette {
    display: inline-flex;
    position: relative;
    width: fit-content;
	vertical-align: middle;
}

.formulaire-input-cat-roulette label {
    font-size: 1rem;
    line-height: 1.5rem;
    font-weight: bold;
    color: rgb(169, 169, 173);
    margin-top: 6px;
    background: none;
}

.formulaire-input-cat-roulette span {
    margin: 8px 0px 0px 10px;
}

.form-input-form-mbr-cat-roulette {
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgb(255, 255, 255);
    font-size: 12px;
    padding: 10px 10px 10px 40px;
    width: fit-content;
    outline: none;
    background: rgb(26, 26, 26);
    border-radius: 8px;
    height: 38px;
	display: inline-block;
}

.sudoku-timer {
	font-size: 18px;
	margin-bottom: 10px;
}

.sudoku-level-info {
    margin: 8px 0 8px 0;	
}

#sudoku-grid-wrapper{
    position: relative;
    width: fit-content;
}

/* message d'attente */
#sudoku-waiting{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    z-index: 10;
    padding: 20px;
}

#sudoku-waiting div{
    display: block;
}

/* caché quand la partie commence */
#sudoku-waiting.hidden{
    display: none;
}

.sudoku-info-box{
    max-width: 1000px;
    margin: 30px auto;
    background: #1F1F1F;
    border-radius: 10px;
    border: 1px solid #2c2c2c;
    overflow: hidden;
}

.sudoku-info-header{
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: #111;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

.sudoku-info-header img{
    width: 28px;
}

.sudoku-info-content{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 20px;
}

.sudoku-rules h3,
.sudoku-gains-box h3{
    margin-bottom: 10px;
    color: #1E90FF;
}

.sudoku-rules ul{
    padding-left: 20px;
}

.sudoku-rules li{
    margin-bottom: 8px;
    color: #ddd;
}

/* ===== Cartes gains ===== */
.sudoku-gain-card{
    background: #111;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: grid;
    gap: 4px;
    font-size: 14px;
}

.sudoku-gain-card .level{
    font-weight: bold;
    font-size: 15px;
}

.sudoku-gain-card .desc{
    color: #aaa;
    font-size: 13px;
}

/* couleurs par niveau */
.sudoku-gain-card.easy{ border-left: 4px solid #2ecc71; }
.sudoku-gain-card.medium{ border-left: 4px solid #f39c12; }
.sudoku-gain-card.hard{ border-left: 4px solid #e74c3c; }
.sudoku-gain-card.expert{ border-left: 4px solid #999; }

.sudoku-info-footer{
    padding: 10px 20px;
    background: #111;
    text-align: center;
    font-size: 13px;
    color: #ccc;
}

.info-session {
    margin-bottom: 15px;
    color: #ddd;
    font-weight: bold;
}

@media(max-width:1024px){
.sudoku-info-box { width: 95%; }
}

/* responsive */
@media(max-width:800px){
    .sudoku-info-content{
        grid-template-columns: 1fr;
    }
}

/* ===========================
   Mobile
=========================== */
@media(max-width:600px){
    #sudoku-container{
        flex-direction: column;
        align-items: center; /* clavier sous la grille centré */
    }

    #numeric-keyboard{
        margin-top: 10px;
    }

    #sudoku-grid{
        transform: scale(0.85);
        transform-origin: top left;
    }
}
