/* Réinitialisation et style global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    max-height: 100vh; /* Limite la hauteur à la viewport */
    overflow: hidden; /* Supprime toute scrollbar */
}

body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; /* Centre verticalement */
    min-height: 100vh;
    background: #f8f9fa; /* Fond gris clair */
    font-family: 'Inter', sans-serif;
    color: #2d3436;
    text-align: center;
    padding: 0.2rem; /* Padding minimal */
}

/* Style de la zone d'entrée */
#input-zone {
    margin: 0.1rem 0;
    max-width: 90%; /* Même largeur que #alert-zone */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

#input-zone input {
    padding: 0.5rem;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    border: 1px solid #dfe6e9;
    border-radius: 8px;
    max-width: 100%;
    width: 100%;
    text-align: center;
}

#input-zone button {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    background: #0984e3;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    max-width: 100%;
    width: 100%;
}

#input-zone button:hover {
    background: #0652dd;
    transform: translateY(-2px);
}

#input-zone button:active {
    transform: translateY(0);
}

/* Style de la zone d'alerte */
#alert-zone {
    background: #ffffff;
    padding: 0.8rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin: 0.1rem 0; /* Marges minimales */
    max-width: 90%; /* Largeur compacte */
    width: 100%; /* Remplit la largeur maximale */
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#alert-zone:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Style du texte ASCII */
pre {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.2;
    white-space: pre;
    text-align: left;
    color: #2d3436;
    display: inline-block;
    margin: 0 auto;
    transition: color 0.3s ease;
}

#alert-zone:hover pre {
    color: #0984e3;
}

/* Style du titre */
h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.1rem 0; /* Marges minimales */
    color: #2d3436;
    letter-spacing: -0.02em;
}

/* Bouton son */
#sound-toggle {
    padding: 0.5rem 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    background: #0984e3;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
    margin: 0.1rem 0;
    max-width: 90%; /* Même largeur que #alert-zone */
    width: 100%;
    text-align: center;
}

#sound-toggle:hover {
    background: #0652dd;
    transform: translateY(-2px);
}

#sound-toggle:active {
    transform: translateY(0);
}

/* Animation d'apparition */
#alert-zone, h1, #sound-toggle, #input-zone, #input-zone button {
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive design pour tablettes */
@media (max-width: 768px) {
    body {
        padding: 0.1rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    #alert-zone {
        padding: 0.6rem;
        margin: 0.1rem 0;
    }

    #sound-toggle, #input-zone button {
        padding: 0.4rem 0;
        font-size: 0.8rem;
        max-width: 90%;
    }

    #input-zone input {
        padding: 0.4rem;
        font-size: 0.8rem;
    }

    pre {
        font-size: 0.8rem;
        line-height: 1.2;
    }
}

/* Responsive design pour mobiles */
@media (max-width: 480px) {
    body {
        padding: 0.1rem;
        min-height: 100vh;
        max-height: 100vh;
        justify-content: center;
    }

    h1 {
        font-size: 0.9rem;
        margin: 0.05rem 0;
    }

    #alert-zone {
        padding: 0.3rem;
        margin: 0.05rem 0;
        max-width: 80%;
    }

    #sound-toggle, #input-zone button {
        padding: 0.2rem 0;
        font-size: 0.6rem;
        margin: 0.05rem 0;
        max-width: 80%;
    }

    #input-zone input {
        padding: 0.2rem;
        font-size: 0.6rem;
    }

    pre {
        font-size: 0.4rem;
        line-height: 1.2;
    }
}
