* {
    margin: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: #fff;
    font-weight: 600;
}

body {
    background-image: url('../images/fundo.jpg');
    background-size: repeat;
    font-family: Arial, Helvetica, sans-serif;
}

.popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -100%);
    z-index: 50;
    background-color: #ffffffa9;
    width: 300px;
    padding: 40px 20px;
    text-align: center;
    border-radius: 20px;
}

.popup p {
    font-weight: bold;
    color: rgb(65, 45, 5);
    letter-spacing: 1px;
}

.btn-reinicio {
    margin: auto;
    padding-top: 20px;
    width: 80%;
    display: flex;
    justify-content: space-between;
    font-size: 1.8em;
}

#reiniciar-sim:hover {
    font-weight: bold;
    cursor: pointer;
}

#reiniciar-sim:active {
    color: rgb(167, 73, 73);
}

#reiniciar-nao:hover {
    font-weight: bold;
    cursor: pointer;
}

#reiniciar-nao:active {
    color: rgb(167, 73, 73);
}

.cenario {
    position: relative;
    background-image: url('../images/cenario.jpg');
    background-size: cover;
    background-position: 80%;
    width: 1200px;
    height: 600px;
    margin: auto;
    margin-top: 30px;
    margin-bottom: 0px;
    border-radius: 20px;
}

/* BARRA COM INFORMAÇÕES DOS PERSONAGENS */
.barra-status {
    display: flex;
    justify-content: space-between;
    max-width: 100%;
}

/* PLAYER 1 */
.status-p1 {
    display: grid;
    grid-template-columns: 40% 60%;
    grid-template-rows: 60% 40%;
    padding: 10px;
}

.ficha-p1 {
    grid-column: 1;
    grid-row-start: 1;
    grid-row-end: 3;
    margin: auto;
}

.ficha-p1 img {
    max-width: 140px;
}

/* BARRA DE VIDA NOME E PLACAR PLAYER 1 */
.medidor-vidaP1 {
    grid-column: 2;
    text-align: center;
}

.medidor-vidaP1>img {
    padding: 10px;
    max-width: 90%;
}

.placar-p1 {
    font-weight: bold;
    color: rgb(212, 211, 209);
    letter-spacing: 1px;
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding-top: 30px;
    gap: 20px;
    font-size: 1.1em;
    color: white;
}

#numero-vitoria-p1,
#numero-vitoria-p2 {
    font-size: 1.1em;
    color: #6ac562;
}

/* MEIO */
.status-meio {
    position: relative;
    margin: auto;
    margin-top: 0;
}

.tela {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
}

#console {
    background-color: rgba(139, 69, 19, 0.471);
    width: 60%;
    text-align: center;
    color: white;
    font-size: 1.2em;
    padding: 5px;
    border-radius: 5px;
    border: 2px solid rgba(46, 29, 16, 0.714);
}

.meio-texto {
    position: absolute;
    top: 57px;
    left: 29px;
    font-weight: bold;
    color: rgb(212, 211, 209);
    font-size: 1.2em;
}

/* PLAYER 2 */
.status-p2 {
    display: grid;
    grid-template-columns: 60% 40%;
    grid-template-rows: 60% 40%;
    padding: 10px;
}

.ficha-p2 {
    grid-column: 2;
    grid-row-start: 1;
    grid-row-end: 3;
    margin: auto;
}

.ficha-p2 img {
    max-width: 140px;
}

/* BARRA DE VIDA NOME E PLACAR PLAYER 2 */
.medidor-vidaP2 {
    grid-column: 1;
    text-align: center;
}

.medidor-vidaP2>img {
    padding: 10px;
    max-width: 90%;
}

.placar-p2 {
    font-weight: bold;
    color: rgb(212, 211, 209);
    letter-spacing: 1px;
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex-direction: row;
    justify-content: center;
    padding-top: 30px;
    gap: 20px;
    font-size: 1.1em;
    color: white;
}

/* BONECOS */
.lutadores {
    margin: auto;
    max-width: 90%;
    height: 60%;
    display: flex;
    flex-direction: row;
    align-items: end;
}

.lutadores div {
    display: flex;
    justify-content: space-around;
    margin: auto;
    margin-bottom: 0;
    min-width: 33%;
    padding-bottom: 10px;
}

/* BOTOES DE AÇÃO */
.botoes {
    position: absolute;
    top: calc(50%, -50%);
    width: 100%;
    margin: auto;
    padding: 10px 0px;
    border-radius: 20px;
    display: grid;
    grid-template-columns: 35% 30% 35%;
}

.botoes-p1 {
    grid-column: 1;
    display: flex;
    flex-direction: row-reverse;
    justify-content: space-around;
    visibility: visible;
    transform: scale(0.80);
}

#botao-atacar-p1:hover,
#botao-pocao-p1:hover,
#botao-veneno-p1:hover {
    transform: scale(1.1);
}

.botoes-p1 img:active {
    opacity: 50%;
}

.console {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vez-p1 {
    visibility: visible;
}

.vez-p2 {
    visibility: visible;
}

.botoes-p2 {
    grid-column: 3;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    visibility: visible;
    transform: scale(0.80);
}

#botao-atacar-p2:hover,
#botao-pocao-p2:hover,
#botao-veneno-p2:hover {
    transform: scale(1.1);
}

.botoes-p2 img:active {
    transform: scale(1.0, 1.0);
    opacity: 50%;
}

footer {
    text-align: center;
    color: #fff;
    font-size: .7em;
    padding: 2px;
}

@media(max-width: 1200px) {

    .popup {
        transform: translate(-50%, -100%);
    }

    .cenario {
        position: relative;
        background-size: 130% 100%;
        background-repeat: no-repeat;
        background-position: 53% center;
        width: 100%;
        max-height: 550px;
        overflow: hidden;
        margin: auto;
        margin-top: 10px;
        border-radius: 20px;
        display: flex;
        flex-direction: column;
    }

    .status-p1,
    .status-p2 {
        display: flex;
        flex-direction: column;
    }

    .ficha-p1,
    .ficha-p2 {
        width: 140px;
        margin: auto;
    }

    .medidor-vidaP1,
    .medidor-vidaP2 {
        width: 180px;
        margin: auto;
    }

    .medidor-vidaP2>img:last-child,
    .medidor-vidaP1>img:last-child {
        padding: 0;
        margin: 0;
    }

    .placar-p1,
    .placar-p2 {
        font-size: 1em;
        color: white;
    }

    #console {
        width: 50%;
    }

    .meio-texto {
        font-size: 1em;
    }

    .lutadores {
        width: 100%;
        max-height: calc(95vh - 200px);
        position: relative;
        overflow: hidden;
    }

    .lutadores {
        max-height: calc(95vh - 200px);
        position: relative;
        overflow: hidden;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .lutador-p1,
    .lutador-p2 {
        max-height: 100%;
        width: auto;
    }

    .lutador-p1 img,
    .lutador-p2 img {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

    .botoes {
        max-height: calc(95vh - 140px);
        position: absolute;
        bottom: 0;
        width: 100vw;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: space-between;
    }

    .botoes-p1 {
        display: flex;
        flex-direction: column;
        z-index: 10;
    }

    .console {
        align-items: baseline;
        width: 70%;
    }

    .console img {
        width: 40px;
    }

    .botoes-p2 {
        display: flex;
        flex-direction: column;
        align-items: end;
        z-index: 10;
    }

    .btn {
        height: 60px;
    }

}

/* Para telas ainda menores (como smartphones) */
@media (max-height: 570px) {

    .popup {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        background-color: #ffffff93;
        width: 250px;
        padding: 20px 20px;
    }

    .cenario {
        position: relative;
        background-position: calc(50%, -50%);
        width: 100vw;
        height: 100vh;
        margin: 0;
        border-radius: 0px;
    }

    .status-p1,
    .status-p2 {
        padding: 0px;
        height: 45vh;
    }

    .ficha-p1 img {
        height: 80px;
    }

    .ficha-p1,
    .ficha-p2 {
        display: flex;
        justify-content: center;
        padding: 0;
    }

    .ficha-p2 img {
        height: 80px;
    }

    .medidor-vidaP1,
    .medidor-vidaP2 {
        width: 180px;
    }

    .medidor-vidaP1>img {
        width: 100px;
        padding: 0;
        margin: 0;
    }

    .medidor-vidaP2>img {
        width: 100px;
        padding: 0;
        margin: 0;
    }

    .status-meio img {
        width: 100px;
    }

    .meio-texto {
        position: absolute;
        width: 100%;
        text-align: center;
        top: 40px;
        left: 50%;
        transform: translateX(-50%);
        font-size: .8em;
    }

    .placar-p1,
    .placar-p2 {
        padding-top: 10px;
    }

    .tela {
        position: absolute;
        top: calc(40%);
        left: 50%;
        transform: translate(-50%, -50%);
        width: 60%;
    }

    #console {
        font-size: .7em;
    }

    .botoes {
        max-height: calc(95vh - 140px);
        position: absolute;
        bottom: 0;
        width: 100vw;
        margin: 0;
        padding: 0;
    }

    .botoes-p1,
    .botoes-p2 {
        padding: 5px;
    }

    .btn {
        min-height: 40px;
        max-height: 40px;
    }

    .console {
        align-items: center;
    }

    .console img {
        width: 30px;
    }

    .lutadores {
        max-height: calc(95vh - 150px);
        min-width: 100vw;
        position: absolute;
        bottom: 0;
        margin: 0;
        padding: 0 100px;
    }

    .lutador-p1,
    .lutador-p2 {
        max-height: 100%;
        width: auto;
    }

    .lutador-p1 img,
    .lutador-p2 img {
        max-height: 90%;
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
}