* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 30px 15px;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f6f9;
    color: #263238;
    line-height: 1.6;
}

.cours {
    max-width: 900px;
    margin: auto;
    background: white;
    padding: 35px 45px;
    border-radius: 14px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

h1 {
    margin-top: 0;
    color: #244d70;
    border-bottom: 3px solid #244d70;
    padding-bottom: 12px;
}

h2 {
    color: #356b8c;
    margin-top: 30px;
}

.trace p {
    margin: 14px 0;
}

.trace li {
    margin: 8px 0;
}


/* -----------------------
   Banque de mots
----------------------- */

.banque {
    background: #eef5fa;
    border: 1px solid #c9dce9;
    padding: 18px 22px;
    border-radius: 10px;
    margin: 25px 0 30px;
}

.banque h2 {
    margin-top: 0;
    font-size: 1.1rem;
}

.mots {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.mot {
    border: 1px solid #7fa7c1;
    background: white;
    color: #244d70;
    padding: 7px 13px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.15s;
}

.mot:hover {
    background: #dcecf6;
}

.mot.selectionne {
    background: #244d70;
    color: white;
}

.mot.utilise {
    opacity: 0.35;
}


/* -----------------------
   Trous
----------------------- */

.trou {
    display: inline-block;
    min-width: 110px;
    height: 29px;
    padding: 1px 8px;
    margin: 0 3px;
    vertical-align: middle;

    border-bottom: 2px solid #55798f;

    text-align: center;
    font-weight: bold;
    color: #244d70;

    cursor: pointer;
}

.trou:hover {
    background: #f0f6f9;
}

.trou.correct {
    background: #e4f5e7;
    border-color: #459757;
    color: #28703a;
}

.trou.incorrect {
    background: #fde9e7;
    border-color: #c64b43;
    color: #a32d27;
}


/* -----------------------
   Exemples
----------------------- */

.exemple {
    width: fit-content;
    margin: 12px auto;
    padding: 8px 18px;

    font-family: Consolas, monospace;
    font-size: 1.1rem;

    background: #263238;
    color: white;

    border-radius: 6px;
}

code {
    background: #edf1f3;
    padding: 2px 6px;
    border-radius: 4px;
}


/* -----------------------
   DNS
----------------------- */

.correspondance {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;

    margin: 20px 0;
    padding: 14px;

    background: #f6f8fa;
    border-radius: 8px;

    font-family: Consolas, monospace;
    font-weight: bold;
}

.fleche {
    font-size: 1.5rem;
    color: #356b8c;
}


/* -----------------------
   Encart IP
----------------------- */

.encart-ip {
    margin-top: 35px;
    padding: 20px 25px;

    background: #fff8e7;
    border-left: 5px solid #e5ad3d;
    border-radius: 8px;
}

.encart-ip h2 {
    margin-top: 0;
    color: #8a651b;
}


/* -----------------------
   Boutons
----------------------- */

.actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 30px;
}

button {
    border: none;
    background: #244d70;
    color: white;

    padding: 10px 20px;
    border-radius: 7px;

    font-size: 1rem;
    cursor: pointer;
}

button:hover {
    background: #183b57;
}

button.secondaire {
    background: #777;
}

button.secondaire:hover {
    background: #555;
}

#resultat {
    text-align: center;
    font-weight: bold;
    min-height: 25px;
}


/* -----------------------
   Smartphone
----------------------- */

@media (max-width: 650px) {

    body {
        padding: 10px;
    }

    .cours {
        padding: 22px 18px;
    }

    h1 {
        font-size: 1.5rem;
    }

    .trou {
        min-width: 90px;
    }

    .correspondance {
        flex-direction: column;
        gap: 4px;
    }

    .fleche {
        transform: rotate(90deg);
    }
}


.champ-calcul {
    width: 75px;
    padding: 5px 8px;
    margin: 0 4px;

    border: 2px solid #55798f;
    border-radius: 6px;

    font-size: 1rem;
    font-weight: bold;
    text-align: center;
}

.champ-calcul.correct {
    background: #e4f5e7;
    border-color: #459757;
}

.champ-calcul.incorrect {
    background: #fde9e7;
    border-color: #c64b43;
}