body {
    text-align: center;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: rgb(236, 213, 183);
}
html {
  touch-action: pan-y; 
}

.conteneur {
    margin-top: 100px;
}

h1 {
    font-size: 40px;
}

button {
    padding: 10px 20px;
    font-size: 18px;
}

#input-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    margin-bottom: 20px;
}

button {
    border-radius: 16px;
}

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

.plateau {
    flex-shrink: 0;
    position: relative;
}

.jeton {
    position: absolute;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.5);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    transform: translate(-50%, -50%);
    transition: left 0.35s ease, top 0.35s ease;
    pointer-events: none;
}

.plateau img {
    width: min(1279px, 95vw);
    height: auto;
    display: block;
}

.case {
    width: 60px;
    height: 60px;
    border: 1px solid black;
    text-align: center;
    line-height: 60px;
}

#start-button {
    display: inline-block;
    margin-top: 50px;
    align-items: center;
    justify-content: center;
}

ul {
    border: 2px solid rgb(0, 0, 0);
    padding: .5em;
    color: rgb(0, 0, 0);
}

#panneau-jeu {
    min-width: 160px;
    text-align: left;
    padding-top: 10px;
}

#de-image {
    display: none;
}

.cache {
    display: none;
}
button{
    background-color: rgb(0, 0, 0);
    color: rgb(255, 255, 255);
    transition: 0.5s;
}
button:hover {
    /*grossir bouton*/
    transform: scale(1.1);
    transition: 0.5s;
     background-color: rgb(226, 198, 161);
    color: rgb(0, 0, 0);
    border: 2px solid rgb(0, 0, 0);
}
#container-choix{
     background-color: rgb(226, 198, 161);
     width: min(400px, 90vw);
     display: flex;
     flex-direction: column;
     align-items: center;
     justify-content: center;
     border: 10px solid rgb(201, 170, 131);
     margin: 20px auto;
     border-radius: 30px;
     padding: 24px 16px;
}
input{
    padding: 10px;
    font-size: 16px;
    border-radius: 16px;
    border: 3px solid rgb(0, 0, 0);
    background-color: rgb(255, 255, 255);
}
select {
    padding: 10px;
    font-size: 16px;
    border-radius: 16px;
    border: 3px solid rgb(0, 0, 0);
    background-color: rgb(255, 255, 255);
}
#panneau-jeu {
    background-color: rgb(226, 198, 161);
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border: 10px solid rgb(201, 170, 131);
    margin: 0 auto;
    border-radius: 30px;
    margin-top: 200px;
    transform: scale(1.5);
}
#plateau {
    border: 10px solid rgb(201, 170, 131);
    border-radius: 30px;
    margin-left: 5%;

}
#statistique{
    width: 150px;
    height: 90px;
    border: 10px solid rgb(201, 170, 131);
    background-color: rgb(201, 170, 131) ;
    border-radius: 30px;
}

#de-image{
    border: 10px solid rgb(201, 170, 131);
    border-radius: 45px;
}
#bouton-de{
    color: rgb(255, 1, 1);
    border: 4px solid rgb(255, 0, 0);
         background-color: rgb(226, 198, 161);

}
#bouton-de :active {
    /*grossir bouton*/
    border: 2px solid rgb(47, 235, 9);
    color: rgb(126, 224, 14);
    transform: scale(1.1);
     
    transition: 0.5s;
     background-color: rgb(226, 198, 161);
}

audio{
    display: none;
}

/* Dialog de victoire */
#dialog-victoire {
    border: none;
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
    background: transparent;
    max-width: 420px;
    width: 90%;
}

#dialog-victoire::backdrop {
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(3px);
}

.dialog-contenu {
    background: rgb(236, 213, 183);
    border-radius: 20px;
    padding: 40px 32px 32px;
    text-align: center;
}

.dialog-trophee {
    font-size: 72px;
    color: #f1c40f;
    line-height: 1;
    margin-bottom: 12px;
    animation: bounce 0.6s ease infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to   { transform: translateY(-12px); }
}

.dialog-contenu h2 {
    font-size: 28px;
    margin: 0 0 8px;
}

.dialog-contenu p {
    font-size: 16px;
    color: #555;
    margin: 0 0 28px;
}

.dialog-boutons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.dialog-boutons button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 16px;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
}

.dialog-boutons button i {
    font-size: 18px;
}

#btn-rejouer {
    background: #2ecc71;
    color: white;
}

#btn-rejouer:hover {
    background: #27ae60;
    transform: scale(1.05);
}

#btn-nouveau-jeu {
    background: #3498db;
    color: white;
}

#btn-nouveau-jeu:hover {
    background: #2980b9;
    transform: scale(1.05);
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 900px) {
    /* Stack the board above the game panel */
    .conteneur-jeu {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    /* Board fills the screen width */
    .plateau img {
        width: min(1279px, 98vw);
        height: auto;
    }

    /* Undo the desktop scale trick – lay the panel out normally */
    #panneau-jeu {
        width: min(500px, 90vw);
        margin-top: 0;
        transform: none;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        padding: 16px;
        height: auto;
    }

    /* Keep dice button and image side by side */
    #bouton-de { flex-shrink: 0; }
    #de-image  { width: 80px; }

    #statistique {
        width: auto;
        height: auto;
        padding: 8px 12px;
    }
}

@media (max-width: 500px) {
    h1 { font-size: 24px; }

    button { font-size: 15px; padding: 8px 14px; }

    #panneau-jeu {
        flex-direction: column;
        align-items: center;
    }

    .dialog-contenu {
        padding: 24px 16px 20px;
    }

    .dialog-trophee { font-size: 52px; }
    .dialog-contenu h2 { font-size: 22px; }
}