body {
    margin: 0;
    overflow: hidden;
    background: #f5f0ff;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    user-select: none;
    color: #333;
}

/* --- Écran d'accueil --- */
#welcomeScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(to bottom, #e0c3fc, #8ec5fc);
}

#welcomeScreen h1 {
    font-size: 4em;
    color: white;
    text-shadow: 4px 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 20px;
}

#welcomeScreen h2 {
    font-size: 2em;
    color: #f0f0f0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    margin-bottom: 40px;
}

#playerList {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
}

.player-avatar {
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
}

.player-avatar:hover {
    transform: scale(1.1);
}

.player-avatar .blob-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.player-avatar .player-name {
    font-size: 1.2em;
    color: white;
    font-weight: bold;
}

#createPlayerForm {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.8);
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- Interface du jeu --- */
#info {
    position: absolute;
    top: 10px;
    width: 100%;
    text-align: center;
    color: #ff6b9d;
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    z-index: 100;
}

#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    display: none;
    z-index: 200;
    width: 400px;
}

#highScores {
    margin-top: 20px;
}

#highScoresList {
    list-style: none;
    padding: 0;
    max-height: 150px;
    overflow-y: auto;
}

#highScoresList li {
    display: flex;
    justify-content: space-between;
    padding: 5px 10px;
    border-radius: 5px;
}

#highScoresList li.current-player {
    background-color: #ffd700;
    font-weight: bold;
}

#levelUp {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    display: none;
    z-index: 200;
}

button {
    background: linear-gradient(to bottom, #a1e6ff, #80d8ff);
    border: none;
    padding: 12px 25px;
    border-radius: 15px;
    font-size: 18px;
    cursor: pointer;
    margin-top: 15px;
    color: #5a5a5a;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: all 0.3s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* --- Écran des meilleurs scores --- */
#highScoresScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(to bottom, #6a85b6, #bac8e0);
    color: white;
}

#highScoresScreen h1 {
    font-size: 3em;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.3);
}

#globalHighScoresList {
    list-style: none;
    padding: 0;
    width: 80%;
    max-width: 600px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    margin-bottom: 30px;
    max-height: 60vh;
    overflow-y: auto;
}

#globalHighScoresList li {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2em;
}

#globalHighScoresList li:last-child {
    border-bottom: none;
}

#globalHighScoresList .score-player-name {
    font-weight: bold;
}

#globalHighScoresList .score-value {
    font-style: italic;
}

#instructions {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(255,255,255,0.7);
    padding: 10px 15px;
    border-radius: 10px;
    font-size: 14px;
    color: #666;
}

#difficulty {
    position: absolute;
    top: 60px;
    width: 100%;
    text-align: center;
    color: #ff6b9d;
    font-size: 20px;
    text-shadow: 1px 1px 2px white;
    z-index: 100;
}

@keyframes score-pulse-animation {
    0% {
        transform: scale(1);
        color: #ff6b9d;
    }
    50% {
        transform: scale(1.5);
        color: #88ff88;
    }
    100% {
        transform: scale(1);
        color: #ff6b9d;
    }
}

.life-lost {
    animation: life-lost-animation 0.3s ease-in-out;
}

#powerUpTimer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 150, 255, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 150, 255, 0.5);
    z-index: 200;
}



@keyframes life-lost-animation {
    0% {
        transform: scale(1);
        color: #ff6b9d;
    }
    50% {
        transform: scale(1.3);
        color: #ff0000;
    }
    100% {
        transform: scale(1);
        color: #ff6b9d;
    }
}

.score-pulse {
    animation: score-pulse-animation 0.3s ease-in-out;
}

#speedBoostTimer {
    position: fixed;
    bottom: 60px; /* Positioned above the jump timer */
    right: 20px;
    background: rgba(255, 215, 0, 0.8); /* Gold color */
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    z-index: 200;
}

#invincibilityTimer {
    position: fixed;
    bottom: 20px; 
    left: 20px; /* Positioned on the left */
    background: rgba(138, 43, 226, 0.8); /* BlueViolet color */
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
    z-index: 200;
}
