* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh; /* Prend toute la hauteur de la fenêtre */
    background: linear-gradient(135deg, #ff7eb3 0%, #f55095 50%, #b22e66 100%);
    font-family: 'Courier New', monospace;
    overflow: hidden; /* Emp^che le déilement */
}

/* Conteneur principal du jeu */
#game-container {
    display: none; /* Masqué par défaut, affiché via JavaScript */
    width: 90vw; /* Largeur responsive qui ne fait pas la largeur entière */
    max-width: 1200px; 
    height: auto;
    margin: 0 auto; /* Centrer horizontalement */
    overflow: hidden; 
}

/* Canvas du jeu (généré par Phaser) */
#game-container canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain; /* L'image s'adapte sans déformation */
}

/* Écran d'accueil */
#homepage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 90%; /* Largeur relative pour le responsive */
    max-width: 800px; /* Largeur maximale */
    padding: 20px;
}

/* Logo avec image de fond SVG */
.logo {
    display: flex;
    flex-direction: row;
    background-image: url(assets/logo-titre.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain; /* L'image s'ajuste sans être coupée */
    height: 30vw; /* Hauteur responsive basée sur la largeur de la fenêtre */
    max-height: 300px; 
    min-height: 150px; 
    width: 100%;
    max-width: 600px;
    justify-content: center;
    align-items: center;
}

/* Bouton de démarrage du jeu */
.start-btn {
    background: linear-gradient(135deg, #ff7eb3 0%, #f55095 50%, #b22e66 100%);
    color: white;
    border: none;
    padding: clamp(12px, 3vw, 15px) clamp(30px, 8vw, 40px); 
    font-size: clamp(1.2rem, 4vw, 1.5rem); 
    border-radius: 30px; 
    cursor: pointer;
    font-family: 'Courier New', Courier, monospace;
    box-shadow: 0 5px 0 #d46a94, 0 10px 20px rgba(0, 0, 0, 0.2); /* Ombre portée */
    margin-bottom: clamp(1rem, 3vw, 2rem); 
    width: auto; 
    min-width: 200px; 
}

.start-btn:hover {
    box-shadow: 0 3px 0 #d46a94, 0 8px 15px rgba(0, 0, 0, 0.2); 
    background: linear-gradient(135deg, #b22e66 0%, #f55095 50%, #ff7eb3 100%); 
}

/* Boîte d'informations sur le jeu */
.game-info {
    color: #fff;
    max-width: 500px; 
    margin-top: clamp(1rem, 3vw, 2rem); 
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3); 
    line-height: 1.5;
    font-size: clamp(0.9rem, 2.5vw, 1rem); 
    padding: 0 20px; 
    display: flex;
    justify-content: center;
    flex-direction: column; 
}


/* Élément individuel de contrôle (touche + description) */
.control-item {
   
    gap: clamp(15px, 4vw, 30px); /* Espacement responsive entre les éléments */
    margin-top: 20px;
    flex-wrap: wrap; /* Les éléments passent à la ligne si nécessaire */
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

/* Représentation visuelle d'une touche du clavier */
.key {
    background: rgba(255, 255, 255, 0.2); 
    padding: clamp(6px, 2vw, 8px) clamp(8px, 3vw, 12px); 
    border-radius: 5px; 
    margin-bottom: 5px; 
    font-weight: bold;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem); 
}

/* Animation de particules en arrière-plan */
.particles {
    position: fixed; /* Fixe par rapport à la fenêtre */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Ne bloque pas les interactions avec les éléments sous-jacents */
    z-index: -1; 
}

/* Particule individuelle */
.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 255, 0.5); 
    border-radius: 50%; 
    animation: float 10s infinite linear; 
}

/* Animation de flottement */
@keyframes float {
    0% {
        transform: translateY(100vh); /* Commence en bas de l'écran */
        opacity: 1; /* Complètement visible */
    }

    100% {
        transform: translateY(-100px); /* Monte et se déplacent sur la droite légèrement */
        opacity: 0; /* Complètement transparent */
    }
}

/* Écran de réussite*/
#success-screen {
    display: none; /* Masqué par défaut, affiché via JavaScript */
    position: fixed; /* Couvre toute la fenêtre */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8); 
    color: white;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10; /* Au-dessus de tous les autres éléments */
    text-align: center;
    padding: 20px;
}

/* Titre de l'écran de réussite */
#success-screen h1 {
    font-size: clamp(2rem, 8vw, 3em); 
    margin-bottom: 20px;
    color: #f57aab; 
}

/* Paragraphes de l'écran de réussite */
#success-screen p {
    font-size: clamp(1rem, 5vw, 1.5em); 
    margin-bottom: 10px;
}

