body {
    background-image: url("forest.gif") ;
    background-size: 100%;
    display: flex;
    flex-direction: center;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    margin-top:0;
    font-size: x-large;
}

#grid {
    position: relative;
    border-radius: 20px;
    border: 3px solid #000000;
    display: grid;
    grid-template-columns: repeat(40, 30px);
    grid-template-rows: repeat(20,30px);
}

#grid div {
    width: 30px;
    height: 30px;
    border: 0px solid #5c2323;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
}

#titlewrapper {
    position: absolute;
    top: 0;
    font-size: xxx-large;
    z-index: 10;
    background: #32a5cf;
    padding: 10px;
    border: 4px solid #000000;
    border-radius: 15%;
    display: none;
}

.floor {
    background-image: url("classicfloor.jpg");
    background-size: 100%;
    border: 5px solid #000000
}

.runningman {
    background-image: url("runninggirl.gif");
    background-size: 100%;
}

#character {
    position: absolute;
    width: 120px;
    height: 163px;
    background-image: url("runninggirl.gif");
    background-size: cover;
    top: 380px;
    left: 300px;
    z-index: 10;
    transition: top 0.5s ease;
}

#border {
    position: relative;
    display: inline-block; 
}

.characterback {
    background-size: 100%;
}

.robot1 {
    background-image: url("00.png");
    background-size: cover;
}
.robot2 {
    background-image: url("01.png");
    background-size: cover;
}
.robot3 {
    background-image: url("02.png");
    background-size: cover;
}
.robot4 {
    background-image: url("10.png");
    background-size: cover;
}
.robot5 {
    background-image: url("11.png");
    background-size: cover;
}
.robot6 {
    background-image: url("12.png");
    background-size: cover;
}
.robot7 {
    background-image: url("20.png");
    background-size: cover;
}
.robot8 {
    background-image: url("21.png");
    background-size: cover;
}
.robot9 {
    background-image: url("22.png");
    background-size: cover;
}

#lives {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 5px;
    z-index: 20;
  }
  
.heart {
    width: 70px;
    height: 70px;
    background-image: url("heart.png");
    background-size: cover;
}

.heart.lost {
    opacity: 0;
    transition: opacity 0.5s ease;
}
  

#gamestart {
    position: absolute;
    width: 1200px;
    height: 550px;
    background-size: 100%;
    border: 5px solid #ffffff;
    background-size: cover;
    border-radius: 30px;
    top: 20;
    left: 0px;
    z-index: 40;
    display: block;
}

.gem {
    background-image: url("key.png");
    background-size: 100%;
}

#score {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ffffff;
    z-index: 40;
    height: 30px;
    width: 120px;
    text-align: center;
    line-height: 30px;
    border: 2px solid #000;
    border-radius: 8px;
    font-weight: bold;
}

#gameover {
    position: absolute;
    width: 600px;
    height: 500px;
    background-image: url("gameover.png");
    background-size: cover;
    top: 90;
    left: 265px;
    z-index: 40;
    display: none;
}

@keyframes shake {
    0%,100% { transform: translate(0,0); }
    25% { transform: translate(5px,-5px); }
    50% { transform: translate(-5px,5px); }
    75% { transform: translate(5px,5px); }
}

.portal {
    background-color: aqua;
}

#restart {
    position: absolute;
    width: 130px;
    height: 130px;
    background-image: url("restart.png");
    background-size: cover;
    top: 450px;
    right: 10px;
    z-index: 40;
    display: none;
}

#next {
    position: absolute;
    width: 200px;
    height: 110px;
    background-image: url("next.png");
    background-size: cover;
    top: 450px;
    right: 20px;
    z-index: 40;
    display: none;
}

#menu {
    position: absolute;
    width: 150px;
    height: 150px;
    background-image: url("menu.png");
    background-size: cover;
    top: 460px;
    left: 30px;
    z-index: 40;
    display: none;
}

#healthwrapper {
    display: flex;
    align-items: flex-end;
    width: 20px;
    height: 200px;
    background: #333;
    border-radius: 10px;
    overflow: hidden;
    position: absolute;
    top: 150px;
    left: 10px;
  }
  
#healthbar {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #0f0, #ff0);
    transition: height 0.3s linear;
}

.bullet {
    background-image: url("bullet.webp");
    background-size: 100%;
}

#loadingscreen {
    position: absolute;
    display: flex;
    width: 1200px;
    height: 550px;
    justify-content: center;
    align-items: center;
    background-color: black;
    background-size: 10%;
    border: 5px solid #ffffff;
    background-size: cover;
    border-radius: 30px;
    top: 20;
    left: 0px;
    z-index: 30;
    display: block;
}

#endscreen {
    position: absolute;
    display: flex;
    width: 800px;
    height: 400px;
    justify-content: center;
    align-items: center;
    background-color: black;
    background-size: 100%;
    border: 5px solid #ffffff;
    background-size: cover;
    border-radius: 30px;
    top: 20px;
    left: 200px;
    z-index: 30;
    display: none;
}