/* Prevent double-tap to zoom */
html, body {
    touch-action: manipulation;

}

body {
    margin: 0;
    height:100%;
    width: 100%;
    overflow: hidden;
    font-family: Poppins, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
}

h1 {
    font-family: Poppins, Arial, sans-serif;;
    font-size: 24px;
    margin: 0;
    top: 0;
    left: 0;
}

a {
    text-decoration: none;
    color: #181817;
}

a:hover{
    color: darkslategrey;
}

h2 {
    font-family: Poppins, Arial, sans-serif;
    font-size: 18px;
    margin: 0;
    padding: 10px;
    padding-bottom: 20px;
    top: 0;
    left: 0;
    color: #181817;
}

h3 {
    font-family: Poppins, Arial, sans-serif;
    font-size: 14px;
    margin: 0;
    padding-bottom: 20px;
    top: 0;
    left: 0;
    color: darkslategrey;
}

.game-container {
    text-align: center;
    width: 100%;
    height: 540px;
}

.score {
    font-size: 16px;
    text-align: left;
    margin: 10px;
}

.score div {
    margin-bottom: 5px;
    text-transform: lowercase;
}

.game-area {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #87ceeb;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.sprite {
    position: absolute;
    bottom: 30px;
    left: 75px;
    width: 64px;
    height: 64px;
    background-size: cover;
    /*transition: background-image 0.1s linear;*/
}

.npc {
    position: absolute;
    bottom: 30px;
    left: 150%;
    width: 64px;
    height: 64px;
    background-size: cover;
    background-image: url('sprites/sprite_idle.png');
}

.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 30px;
    background: repeating-linear-gradient(
        90deg,
        #654321,
        #654321 10px,
        #4b2e0a 10px,
        #4b2e0a 20px
    );
}

@keyframes runAnimation {
    0% { background-position: 0 0; }
    100% { background-position: 512px 0; } /* Adjust based on sprite sheet */
}

.running {
    animation: runAnimation 0.5s steps(4) infinite; /* Adjust speed and steps based on sprite sheet */
    background-image: url('sprites/sprite_run.png'); /* replace with your run sprite sheet */
}

@keyframes mewAnimation {
    0% { background-position: 0 0; }
    100% { background-position: 256px 0; } /* Adjust based on sprite sheet */
}

.mewing {
    animation: mewAnimation 0.5s steps(4) infinite; /* Adjust speed and steps based on sprite sheet */
    background-image: url('sprites/sprite_mew.png'); /* replace with your mew sprite sheet */
}

@keyframes deathAnimation {
    0% { background-position: 0 0; }
    100% { background-position: 256px 0; } /* Adjust based on sprite sheet */
}

.dead {
    animation: deathAnimation 1s steps(4) 1; /* Adjust speed and steps based on sprite sheet */
    background-image: url('sprites/sprite_death.png'); /* replace with your death sprite sheet */
}

@keyframes moveGround {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.moving-ground {
    animation: moveGround 1s linear infinite;
}

@keyframes npcMove {
    0% { left: 150%; }
    100% { left: -10%; }
}

.npc-moving {
    animation: npcMove 5s linear infinite;
}

#breatheButton, #runButton, #mewButton {
    padding: 10px 20px;
    width: 25%;
    font-size: 14px;
    cursor: pointer;
    border: none;
    background-color: #007BFF;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

#breatheButton:hover, #runButton:hover, #mewButton:hover {
    background-color: #0056b3;
}

#breatheButton:active, #runButton:active, #mewButton:active {
    animation: buttonClick 0.1s ease;
}

@keyframes buttonClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

.hidden {
    display: none;
}

#gameOverScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 80%;
}

#playAgainButton {
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border: none;
    background-color: #28a745;
    color: white;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

#playAgainButton:hover {
    background-color: #218838;
}

.red {
    color: red;
    background-color: #ffcccc;
}
