/* Feuille commune aux deux pages qui précèdent la question : l'énigme et
   l'attente. Volontairement sobre — rien ici ne doit laisser deviner ce qui
   vient après. Police système, donc aucune requête vers l'extérieur. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px 16px;
    background-color: rgb(246, 211, 217);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
    font-size: large;
    color: #e94d58;
}

[hidden] {
    display: none !important;
}

.porte {
    width: min(100%, 420px);
    text-align: center;
}

.titre {
    font-size: 1.5em;
    line-height: 1.3;
}

.compte {
    margin: 22px 0 18px;
    font-size: 2em;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.note {
    font-size: 0.95em;
    line-height: 1.4;
    color: #b03a44;
}

/* --- l'énigme --- */

.enonce {
    margin-top: 18px;
    font-size: 0.95em;
    line-height: 1.35;
    color: #b03a44;
}

/* Compteur d'étape, discret */
.etape {
    margin-top: 6px;
    font-size: 0.8em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b03a44;
}

/* L'image du rébus : jamais plus large que l'écran, jamais si haute que le
   champ de saisie passerait sous la ligne de flottaison */
.rebus-image {
    display: block;
    width: 100%;
    max-height: 42vh;
    margin: 18px auto 0;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.5);
}

/* Repli lisible tant que l'image n'est pas déposée */
.rebus-secours {
    margin-top: 18px;
    padding: 18px 16px;
    font-size: 0.95em;
    line-height: 1.4;
    color: #b03a44;
    background: rgba(255, 255, 255, 0.5);
    border: 2px dashed #f0a8b2;
    border-radius: 14px;
}

.formulaire {
    display: flex;
    gap: 8px;
    margin-top: 22px;
}

.formulaire input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 1em;
    color: #b03a44;
    background: white;
    border: 2px solid #f0a8b2;
    border-radius: 26px;
    outline: none;
}

.formulaire input:focus {
    border-color: #e94d58;
}

.formulaire button,
.entrer {
    display: inline-block;
    min-height: 48px;
    padding: 12px 22px;
    font-family: inherit;
    font-size: 1em;
    color: white;
    background: #e94d58;
    border: 2px solid #e94d58;
    border-radius: 26px;
    cursor: pointer;
    text-decoration: none;
    touch-action: manipulation;
}

.entrer {
    margin-top: 22px;
}

.message {
    margin-top: 14px;
    min-height: 1.3em;
    font-size: 0.9em;
    color: #b03a44;
}

/* Secousse en cas de mauvaise réponse */
.secoue {
    animation: secoue 0.4s ease;
}

@keyframes secoue {
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
}

/* Bandeau tant que l'énigme n'est pas renseignée */
.alerte-reglage {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: #b03a44;
    color: white;
    text-align: center;
    font-size: 0.8em;
    line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
    .secoue {
        animation: none;
    }
}
