@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Russo+One&display=swap');

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

body {
    background: #0a0a0a;
    overflow: hidden;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    font-family: 'Russo One', 'Arial Black', sans-serif;
    height: 100vh;
    width: 100vw;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    display: block;
    background: #F5E6CC;
    max-width: 100vw;
    max-height: 100vh;
}

/* Overlays */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    background: radial-gradient(ellipse at center, rgba(20, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.95) 100%);
}

/* ===== MENU ===== */
.menu-content {
    text-align: center;
    color: white;
    padding: 24px;
    max-width: 400px;
}

.menu-content h1 {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: 3.2rem;
    color: #FF3333;
    text-shadow: 3px 3px 0 #000, 0 0 20px rgba(255, 50, 50, 0.6), 0 0 40px rgba(255, 50, 50, 0.3);
    margin-bottom: 0;
    letter-spacing: 4px;
    line-height: 1;
}

.menu-content .subtitle {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: 4rem;
    color: #FFD700;
    text-shadow: 3px 3px 0 #000, 0 0 20px rgba(255, 215, 0, 0.6), 0 0 40px rgba(255, 215, 0, 0.3);
    letter-spacing: 6px;
    display: block;
    margin-top: 4px;
}

.instruction {
    font-size: 1.3rem;
    color: #ddd;
    margin: 28px 0 20px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.character-select {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin: 16px 0 28px;
}

.char-btn {
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
    border: 3px solid #444;
    border-radius: 18px;
    padding: 22px 30px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: white;
    font-family: 'Russo One', 'Arial Black', sans-serif;
    font-size: 1.4rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.char-btn:hover, .char-btn:active {
    border-color: #FFD700;
    background: linear-gradient(135deg, rgba(255,215,0,0.2) 0%, rgba(255,215,0,0.05) 100%);
    transform: scale(1.08);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.3);
}

.char-preview {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 4px solid rgba(255,255,255,0.7);
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
}

.chris-preview {
    background: linear-gradient(135deg, #FDBCB4 0%, #E8A89E 100%);
}

.jabu-preview {
    background: linear-gradient(135deg, #C68642 0%, #A06830 100%);
}

.high-score-display {
    color: #FFD700;
    font-size: 1.2rem;
    margin-top: 16px;
    letter-spacing: 2px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ===== GAME OVER ===== */
.gameover-content {
    text-align: center;
    color: white;
    padding: 24px;
}

.gameover-title {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: 3.5rem;
    color: #FF3333;
    text-shadow: 3px 3px 0 #000, 0 0 30px rgba(255, 50, 50, 0.7);
    margin-bottom: 20px;
    letter-spacing: 4px;
    line-height: 1.1;
}

.final-score {
    font-family: 'Bebas Neue', 'Impact', sans-serif;
    font-size: 5rem;
    color: #4CAF50;
    font-weight: bold;
    text-shadow: 3px 3px 0 #000, 0 0 30px rgba(76, 175, 80, 0.5);
    margin: 10px 0;
    letter-spacing: 3px;
}

.new-highscore {
    color: #FFD700;
    font-size: 1.6rem;
    animation: bounce 0.5s ease infinite alternate;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    letter-spacing: 3px;
    text-transform: uppercase;
}

@keyframes bounce {
    from { transform: scale(1); }
    to { transform: scale(1.2); }
}

.time-survived {
    color: #bbb;
    font-size: 1.1rem;
    margin: 14px 0 24px;
    letter-spacing: 1px;
}

.play-again-btn {
    background: linear-gradient(135deg, #FF4444 0%, #CC0000 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.5rem;
    font-family: 'Russo One', 'Arial Black', sans-serif;
    font-weight: bold;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 3px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(255, 68, 68, 0.4);
}

.play-again-btn:hover, .play-again-btn:active {
    background: linear-gradient(135deg, #FF6666 0%, #DD2222 100%);
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(255, 68, 68, 0.6);
}

/* ===== VIRTUAL JOYSTICK ===== */
#joystick-container {
    position: absolute;
    bottom: 30px;
    left: 30px;
    z-index: 5;
    display: none;
}

#joystick-base {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 3px solid rgba(255, 255, 255, 0.25);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

#joystick-thumb {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: 3px solid rgba(255, 255, 255, 0.5);
    position: absolute;
    transition: none;
    box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

/* ===== MOBILE ===== */
@media (max-width: 500px) {
    .menu-content h1 {
        font-size: 2.2rem;
    }
    .menu-content .subtitle {
        font-size: 2.8rem;
    }
    .char-btn {
        padding: 16px 22px;
        font-size: 1.1rem;
    }
    .instruction {
        font-size: 1rem;
    }
    .gameover-title {
        font-size: 2.5rem;
    }
    .final-score {
        font-size: 3.5rem;
    }
    .play-again-btn {
        padding: 14px 36px;
        font-size: 1.2rem;
    }
}
