@font-face {
    font-family: 'retro';
    src: url(font/RetroGaming.ttf);
}

body {
    font-family: 'retro';
    background-image: url(img/bg2.jpg);
    background-position: center center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    margin: 0;
    padding: 0;
}

#console {
    background-color: #f1ecec;
    box-shadow: 8px 8px rgb(151, 150, 150);
    display: flex;
    flex-direction: column;
    gap: 1em;
    height: 440px;
    width: 380px;
    align-items: center;
    justify-content: center;
    border: 1px solid black;
    border-radius: 20px;
}

#screen {
    border-radius: 20px;
    /*same as console*/
    background-image: url(img/background.png);
    background-position: center center;
    background-size: cover;
    height: 300px;
    width: 350px;
    position: relative;
    border: 1px solid black;
}

/* left character styles */
#player {
    display: block;
    background-image: url(sprites/ken.png);
    background-position: 0px -80px;
    height: 80px;
    width: 70px;
    position: absolute;
    top: 210px;
    left: 15px;
    /* border: 1px solid green; */
}

/* left character animations  */
@keyframes player-standing {
    from {
        background-position: 0px -80px;
    }

    to {
        background-position: -210px -80px;
    }
}

@keyframes player-take-damage {
    from {
        background-position: -280px -560px;
    }

    to {
        background-position: -280px -560px;
    }
}

.animatePlayerHit {
    animation: player-take-damage .15s steps(1);
}

.animatePlayerStanding {
    animation: player-standing .5s steps(3) infinite;
}

/* right character styles  */
#computer {
    display: block;
    background-image: url(sprites/computersprite.png);
    background-position: 10px 0px;
    height: 120px;
    width: 90px;
    position: absolute;
    top: 180px;
    left: 250px;
    transform: scaleX(-1);
    /* border: 3px solid black; */
}

@keyframes computer-standing {
    from {
        background-position-x: 10px;
    }

    to {
        background-position-x: -153px;
    }
}

@keyframes computer-take-damage {
    from {
        background-position: 0px -630px;
    }

    to {
        background-position: 0px -630px;
    }
}

.animateComputerStanding {
    animation: computer-standing .8s steps(2) infinite;
}

.animateComputerHit {
    animation: computer-take-damage .1s steps(2);
}

/* weapon styles*/
#player-weapon,
#computer-weapon {
    position: absolute;
    top: 210px;
}

#player-weapon {
    left: 85px;
    /* border: 5px solid blue; */
}

#computer-weapon {
    transform: scale(2) rotateY(180deg);
    left: 230px;
    /* border: 5px solid red; */
}

/* Fighting + weapons animations  */
@keyframes player-attack {
    from {
        background-position: 0px 0px;
    }

    to {
        background-position: -210px 0px;
    }
}

@keyframes player-weapon-move {
    0% {
        left: 85px;
    }

    100% {
        left: var(--final-playerweapon-position);
    }
}

@keyframes computer-attack {
    from {
        background-position: 20px -510px;
    }

    to {
        background-position: -290px -510px;
    }
}

@keyframes computer-weapon-move {
    0% {
        left: 270px;
    }

    100% {
        left: var(--final-computerweapon-position);
    }
}

.animatePlayerWeapon {
    animation: player-weapon-move .8s;
}

.animatePlayerAttack {
    animation: player-attack .3s steps(3);
}

.animateComputerWeapon {
    animation: computer-weapon-move .8s;
}

.animateComputerAttack {
    animation: computer-attack .3s steps(3);
}

/* weapons  */
.rock-background,
.paper-background,
.scissors-background {
    height: 15px;
    width: 15px;
    transform: scale(2);
}

.rock-background {
    background-image: url(weapons/rock.png);
    background-position: -16px 0;
}

.paper-background {
    background-image: url(weapons/book.png);
    background-position: center center;
    background-size: cover;
}

.scissors-background {
    background-image: url(weapons/scissors.png);
    background-position: center center;
    background-size: cover;
}

/* Life bars */
/* player life bar  */
.player-healthbar {
    height: 20px;
    width: 300px;
    display: block;
    /* border: 1px solid black; */
}

.player-healthbar_fill {
    width: 100%;
    fill: var(--player-bar-fill);
    transition: width 0.5s ease-in, fill 0.4s linear;
}

.player-healthbar_fill-top {
    fill: var(--player-bar-top);
}

/* computer health bar */
.computer-healthbar {
    height: 20px;
    width: 300px;
    display: block;
    /* border: 1px solid black; */
}

.computer-healthbar_fill {
    width: 100%;
    fill: var(--computer-bar-fill);
    transition: width 0.5s ease-in, fill 0.4s linear;
}

.computer-healthbar_fill-top {
    fill: var(--computer-bar-top);
}

/* health containers */
#player-health,
#computer-health {
    display: flex;
    background-color: white;
    flex-direction: column;
    align-items: center;
    justify-content: space-around;
    font-size: 12px;
    height: 40px;
    width: 120px;
    position: absolute;
    border: 3px solid black;
    border-radius: 10px;
    top: 50px;
}

#player-health img,
#computer-health img {
    padding: 2px;
    height: 20px;
    width: 20px;
    ;
}

.container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    /* border: 3px solid blue; */
}

#player-health {
    left: 10px;
}

#computer-health {
    left: 210px;
}

/* Game pad styles*/
#gamepad {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100px;
    width: 350px;
    background-color: #d5d2d2;
    border-radius: 20px;
    border: 1px solid black;
    /* border-top: 5px solid black; */
}

/* button styles */
.button {
    height: 60px;
    width: 60px;
    border-radius: 50%;
    color: black;
    box-shadow: 0 5px #999;
    border: 1px solid black;
    background-repeat: no-repeat;
    background-position: center center;
    background-size: 50%;
}

.button:active {
    box-shadow: 0 6px #666;
    transform: translateY(2px);
}

.button:nth-child(1) {
    background-image: url(img/rock.png);
    background-color: rgb(241, 105, 105);
}

.button:nth-child(2) {
    background-image: url(img/paper.png);
    background-color: rgb(146, 146, 254);
}

.button:nth-child(3) {
    background-image: url(img/scissors.png);
    background-color: rgb(104, 241, 104);
}