@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap');

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

body {
    background-image: url(assets/land.png);
    background-size: cover;
    font-family: 'Cairo', sans-serif;
    overflow: hidden;
}

.player {
    width: 80px;
    height: 100px;
    background-image: url(assets/player_front.png);
    background-size: 240px 100%;
    position: fixed;
    z-index: 1000;
}

.player.walk {
    animation: walk .2s step-end infinite;
}

@keyframes walk {

    0%,
    32% {
        background-position: 0 0;
    }

    33%,
    65% {
        background-position: -80px 0;
    }

    66%,
    100% {
        background-position: -160px 0;
    }
}

.grass {
    width: 50px;
    height: 50px;
    background-image: url(assets/grass.png);
    background-size: 100% 100%;
    position: fixed;
    z-index: 0;
}

.ball {
    width: 30px;
    height: 30px;
    background-image: url(assets/pokeball.png);
    background-size: 100% 100%;
    position: fixed;
    z-index: 1;
    transition: transform 0.3s;
}

.ball.collect {
    animation: collect 0.3s;
}

@keyframes collect {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5) rotate(180deg);
    }

    100% {
        transform: scale(0);
    }
}

.enemy {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #ff0000, #8b0000);
    border-radius: 50%;
    position: fixed;
    z-index: 500;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
}

.powerup {
    width: 40px;
    height: 40px;
    background: gold;
    border-radius: 50%;
    position: fixed;
    z-index: 1;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.hud {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 2000;
}

.score,
.timer,
.level,
.lives {
    padding: 10px 20px;
    border-radius: 25px;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-weight: bold;
    font-size: 16px;
    color: #2e7d32;
    border: 2px solid #2e7d32;
}

.timer {
    color: #d32f2f;
    border-color: #d32f2f;
}

.level {
    color: #1976d2;
    border-color: #1976d2;
}

.lives {
    color: #f57c00;
    border-color: #f57c00;
}

.menu,
.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 3000;
}

.menu h1,
.game-over h1 {
    color: #2e7d32;
    margin-bottom: 20px;
    font-size: 36px;
}

.menu p,
.game-over p {
    margin: 10px 0;
    font-size: 18px;
    color: #333;
}

.menu button,
.game-over button {
    margin-top: 20px;
    padding: 15px 40px;
    font-size: 20px;
    background: #2e7d32;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: 'Cairo', sans-serif;
    transition: all 0.3s;
}

.menu button:hover,
.game-over button:hover {
    background: #1b5e20;
    transform: scale(1.1);
}

.instructions {
    margin-top: 20px;
    padding: 15px;
    background: #f0f0f0;
    border-radius: 10px;
}

.instructions p {
    font-size: 14px;
    margin: 5px 0;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.player.hit {
    animation: shake 0.3s;
}