/* --- Styles Généraux --- */
body {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    background-image: url('images/grenier.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #f5f5dc; /* Blanc cassé / Beige */
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hidden {
    display: none !important;
}

/* --- Écran d'accueil --- */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
}

.start-content h1 {
    font-size: 3rem;
    border-bottom: 2px solid #f5f5dc;
    padding-bottom: 10px;
}

#start-button {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.2rem;
    padding: 15px 30px;
    background-color: #333;
    border: 2px solid #f5f5dc;
    color: #f5f5dc;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

#start-button:hover {
    background-color: #f5f5dc;
    color: #333;
}

/* --- Écran d'introduction --- */
#intro-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

#closed-carnet {
    width: 300px;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.7);
}

.intro-text-container {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 30px;
    border: 1px solid #444;
    max-width: 600px;
}

.intro-text-container h1 {
    font-size: 1.5rem;
    color: #ffc; /* Jaune pâle */
}

/* --- Effet Machine à écrire --- */
#typewriter-text {
    line-height: 1.6;
    height: 200px; /* Hauteur fixe pour éviter les sauts de page */
    overflow: auto;
}

#typewriter-text::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* --- Formulaire --- */
#password-form {
    margin-top: 20px;
}

#password-form label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

#password-input {
    width: 100%;
    padding: 10px;
    font-family: 'Courier New', Courier, monospace;
    background-color: #222;
    border: 1px solid #555;
    color: #f5f5dc;
    font-size: 1.1rem;
}

#password-form button {
    margin-top: 15px;
    padding: 10px 20px;
    background-color: #4a2d1e; /* Marron foncé */
    border: 1px solid #8c6a58;
    color: #f5f5dc;
    font-size: 1rem;
    cursor: pointer;
}

#error-message {
    color: #ff6b6b; /* Rouge erreur */
    margin-top: 10px;
}

/* Animation d'erreur */
.shake {
    animation: shake 0.5s;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* --- Écran de Succès --- */
#success-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

#open-carnet {
    width: 600px;
    box-shadow: 0px 0px 40px rgba(255, 255, 220, 0.5);
}

#typewriter-text.typing-done::after {
    content: none;
}