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

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #2c3e50;
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    height: 100vh;
    max-height: 600px;
    background-color: #34495e;
    border: 4px solid #2c3e50;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    aspect-ratio: 4/3;
    margin: auto;
}

#gameCanvas {
    display: block;
    background-color: #34495e;
    width: 100%;
    height: 100%;
    touch-action: none;
    object-fit: contain;
}

/* Styles pour les boutons */
.start-button, .restart-button {
    position: absolute;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 24px;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s, background-color 0.2s;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Position spécifique pour le bouton Commencer */
.start-button {
    top: 80%; /* Ajusté pour être positionné sous le texte d'instructions */
}

/* Position spécifique pour le bouton Rejouer */
.restart-button {
    top: 60%;
    display: none;
    background-color: #2196F3;
}

.start-button:active, .restart-button:active {
    transform: translate(-50%, -50%) scale(0.95);
    background-color: #45a049;
}

.restart-button:active {
    background-color: #1976D2;
}

/* Media query pour les appareils mobiles */
@media (max-width: 768px) {
    .game-container {
        width: 100vw;
        height: 75vw; /* Ratio 4:3 */
        max-height: 100vh;
        max-width: calc(100vh * 4/3);
    }

    .start-button, .restart-button {
        padding: 30px 60px;
        font-size: 28px;
        min-width: 200px;
        text-align: center;
    }
}

/* Styles pour l'écran de game over */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99;
    padding: 20px;
    text-align: center;
}

.game-over-screen.active {
    display: flex;
}

.game-over-text {
    color: white;
    font-size: 48px;
    margin-bottom: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    padding: 10px;
    margin-top: -20%;
}

.score-text {
    color: white;
    font-size: 32px;
    margin-bottom: 20px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    background-color: rgba(0, 0, 0, 0.3);
    padding: 15px 30px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Animation pour l'écran de game over */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-screen {
    animation: fadeIn 0.5s ease-in-out;
}

/* Style pour la victoire */
.game-over-screen.victory .game-over-text {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Style pour la défaite */
.game-over-screen.defeat .game-over-text {
    color: #f44336;
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
} 