* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@keyframes gradient-shift {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradient-shift 15s ease infinite;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

/* Menu principal */
.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    padding: 40px;
    text-align: center;
}

.main-title {
    font-size: 3.5em;
    color: #fff;
    text-shadow: 
        0 0 15px rgba(255, 107, 107, 1),
        0 0 30px rgba(255, 107, 107, 0.8),
        0 0 45px rgba(255, 107, 107, 0.6),
        4px 4px 0 #333;
    animation: bounce 1s ease-in-out infinite alternate, glow 2s ease-in-out infinite;
    letter-spacing: 5px;
    margin: 0;
}

.subtitle {
    font-size: 1.3em;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin: -20px 0 0 0;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 300px;
}

.menu-btn {
    padding: 15px 30px;
    font-size: 1.3em;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.start-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8787);
    color: white;
    font-size: 1.5em;
}

.start-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.5);
}

.menu-btn {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    color: white;
}

.menu-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.5);
}

.back-btn {
    background: linear-gradient(135deg, #666, #888);
}

.how-to {
    background: rgba(255, 255, 255, 0.95);
    padding: 25px;
    border-radius: 20px;
    max-width: 500px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.how-to h3 {
    color: #ff6b6b;
    margin-top: 15px;
    margin-bottom: 10px;
}

.how-to p {
    color: #333;
    margin: 5px 0;
    font-size: 0.95em;
}

.best-score-menu {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.4em;
    font-weight: bold;
    color: #333;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.5);
    border: 3px solid #ff6b6b;
}

/* Container de jeu */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* UI du jeu */
.game-ui {
    display: flex;
    justify-content: space-between;
    width: 360px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ui-left, .ui-right {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.score-display, .coins-display, .combo-display, .lives-display, .level-display {
    font-weight: bold;
    font-size: 0.95em;
    color: #333;
}

.combo-display {
    color: #ff6b6b;
}

.lives-display {
    font-size: 1.1em;
}

.level-display {
    color: #4CAF50;
}

.game-title {
    font-size: 2.8em;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(255, 107, 107, 0.8),
        0 0 20px rgba(255, 107, 107, 0.6),
        0 0 30px rgba(255, 107, 107, 0.4),
        3px 3px 0 #333;
    animation: bounce 1s ease-in-out infinite alternate, glow 2s ease-in-out infinite;
    letter-spacing: 3px;
}

@keyframes bounce {
    from { transform: translateY(0) scale(1); }
    to { transform: translateY(-10px) scale(1.05); }
}

@keyframes glow {
    0%, 100% { text-shadow: 
        0 0 10px rgba(255, 107, 107, 0.8),
        0 0 20px rgba(255, 107, 107, 0.6),
        0 0 30px rgba(255, 107, 107, 0.4),
        3px 3px 0 #333; }
    50% { text-shadow: 
        0 0 20px rgba(255, 215, 0, 0.8),
        0 0 30px rgba(255, 215, 0, 0.6),
        0 0 40px rgba(255, 215, 0, 0.4),
        3px 3px 0 #333; }
}

.controls-info {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.legend {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.85);
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 0.85em;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.platform-type {
    font-weight: bold;
    color: #333;
}

canvas {
    border: 5px solid #333;
    border-radius: 20px;
    box-shadow: 
        0 0 40px rgba(0, 0, 0, 0.5),
        0 0 80px rgba(102, 126, 234, 0.4),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    background: linear-gradient(to bottom, #b3e5fc 0%, #e1f5fe 100%);
    transition: transform 0.3s ease;
    max-width: 100%;
    height: auto;
}

canvas:hover {
    transform: scale(1.02);
}

/* Responsive pour mobile */
@media (max-width: 768px) {
    canvas {
        width: 90vw;
        max-width: 360px;
        height: auto;
    }
    
    .game-ui {
        width: 90vw;
        max-width: 360px;
    }
    
    .main-title {
        font-size: 2.5em;
    }
    
    .menu-buttons {
        width: 90vw;
        max-width: 300px;
    }
}

.high-score {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.5);
    border: 3px solid #ff6b6b;
}

#highScore {
    color: #ff6b6b;
    font-size: 1.2em;
}

