body {
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
}

/* Background iframe */
#bgFrame {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    z-index: 0;
}

/* Keep content above background */
body > *:not(#bgFrame) {
    position: relative;
    z-index: 1;
}

h2 {
    margin-top: 20px;
    color: #000;
}

/* Display box */
.display {
    width: 230px;
    height: 40px;
    margin: 10px auto 20px auto;
    border: 2px solid #333;
    font-size: 24px;
    text-align: center;
    line-height: 40px;
    background: rgba(255,255,255,0.85);
    border-radius: 6px;
}

/* Keypad grid */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 70px);
    gap: 10px;
    justify-content: center;
}

button {
    width: 70px;
    height: 70px;
    font-size: 20px;
    border-radius: 8px;
    border: none;
    background: rgba(255,255,255,0.9);
    cursor: pointer;
    color: #000;
    font-weight: bold;
}

button:active {
    transform: scale(0.95);
}

.zero {
    grid-column: span 3;
    width: 100%;
}

.error {
    color: rgba(190,220,230,1);
    font-weight: bold;
}

/* Language selector */
.lang-box {
    width: 230px;
    margin: 20px auto 40px auto;
    text-align: center;
    font-size: 14px;
    background: rgb(200, 200, 200);
    border-radius: 6px;
    padding-bottom: 5px;
}

.lang-box label {
    display: block;
    margin: 0;
    padding: 8px 0 4px 0;
    background: rgba(200,200,200,1);
    font-weight: bold;
    border-radius: 4px 4px 0 0;
}

.lang-box select {
    display: block;
    width: 90%;
    margin: 4px auto 8px auto;
    padding: 6px 10px;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ccc;

}

/* Responsive */
@media (max-width: 600px) {
    html, body {
        width: 100%;
        height: 100%;
        overflow-x: hidden;
        background-color: #0f4c5c; /* bleu pétrole */
    }

    .grid {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        gap: 12px;
    }

    button {
        width: 100%;
        height: 85px;
        font-size: 26px;
        background: rgba(220,220,220,0.9);
        color: #000;
        font-weight: bold;
    }

    .display {
        width: 100%;
        max-width: 400px;
        height: 55px;
        font-size: 26px;
        margin: 10px auto 20px auto;
    }

    h2 {
        color: #fff; /* texte blanc sur fond bleu pétrole */
    }

    .lang-box {
        width: 100%;
        max-width: 400px;
        margin: 20px auto 30px auto;
    }

    body {
        padding: 10px;
    }

    #bgFrame {
        display: none !important;
    }
}

/* Desktop: move language box to top-right */
@media (min-width: 601px) {
    .lang-box {
        position: fixed !important;
        top: 20px !important;
        right: 20px !important;
        left: unset !important;
        bottom: unset !important;
        margin: 0 !important;
        width: 230px;
        z-index: 999 !important;
    }
}