/* ================================= */
/* CONFIGURAÇÕES GERAIS              */
/* ================================= */

* {

    margin: 0;

    padding: 0;

    box-sizing: border-box;

}


body {

    min-height: 100vh;

    display: flex;

    justify-content: center;

    align-items: center;

    font-family: Arial, sans-serif;

    background-color: #f2f2f2;

    padding: 20px;

}


/* ================================= */
/* JOGO                              */
/* ================================= */

.jogo {

    width: 100%;

    max-width: 600px;

    text-align: center;

}


/* ================================= */
/* TÍTULO                            */
/* ================================= */

h1 {

    margin-bottom: 10px;

    font-size: 36px;

    color: #222;

}


/* ================================= */
/* MENSAGEM                          */
/* ================================= */

#mensagem {

    margin-bottom: 20px;

    font-size: 20px;

    font-weight: bold;

    color: #333;

}


/* ================================= */
/* PLACAR                            */
/* ================================= */

.placar {

    width: 100%;

    display: grid;

    grid-template-columns:
        1fr 0.8fr 1fr;

    gap: 10px;

    margin-bottom: 25px;

}


.placar-jogador,
.placar-empate {

    padding: 15px;

    border-radius: 10px;

    background-color: white;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.1);

}


.placar-jogador h2,
.placar-empate h2 {

    margin-bottom: 8px;

    font-size: 18px;

}


.jogador-x h2 {

    color: #1565c0;

}


.jogador-o h2 {

    color: #c62828;

}


.placar-jogador span,
.placar-empate span {

    display: block;

    font-size: 32px;

    font-weight: bold;

    color: #222;

}


.placar-jogador small {

    display: block;

    margin-top: 3px;

    color: #666;

    font-size: 12px;

}


/* ================================= */
/* TABULEIRO                         */
/* ================================= */

.tabuleiro {

    width: 360px;

    height: 360px;

    margin: 0 auto 25px;

    display: grid;

    grid-template-columns:
        repeat(3, 120px);

    grid-template-rows:
        repeat(3, 120px);

}


/* ================================= */
/* CASAS                             */
/* ================================= */

.casa {

    width: 120px;

    height: 120px;

    padding: 0;

    margin: 0;

    border: 2px solid #000;

    background-color: white;

    display: flex;

    justify-content: center;

    align-items: center;

    font-family: Arial, sans-serif;

    font-size: 60px;

    font-weight: bold;

    cursor: pointer;

}


.casa:hover {

    background-color: #eeeeee;

}


/* ================================= */
/* X                                 */
/* ================================= */

.casa.x {

    color: #1565c0;

}


/* ================================= */
/* O                                 */
/* ================================= */

.casa.o {

    color: #c62828;

}


/* ================================= */
/* VENCEDOR                          */
/* ================================= */

.casa.vencedora {

    background-color: #90ee90;

    animation:
        destaque 0.7s infinite alternate;

}


@keyframes destaque {

    from {

        transform: scale(1);

    }

    to {

        transform: scale(1.04);

    }

}


/* ================================= */
/* BOTÕES                            */
/* ================================= */

.botoes {

    display: flex;

    justify-content: center;

    gap: 10px;

}


#reiniciar,
#limparPlacar {

    padding: 12px 20px;

    border: none;

    border-radius: 6px;

    color: white;

    font-size: 15px;

    font-weight: bold;

    cursor: pointer;

}


#reiniciar {

    background-color: #222;

}


#reiniciar:hover {

    background-color: #444;

}


#limparPlacar {

    background-color: #b71c1c;

}


#limparPlacar:hover {

    background-color: #d32f2f;

}


/* ================================= */
/* RESPONSIVIDADE                    */
/* ================================= */

@media (max-width: 500px) {

    .placar {

        grid-template-columns: 1fr;

    }


    .tabuleiro {

        width: 300px;

        height: 300px;

        grid-template-columns:
            repeat(3, 100px);

        grid-template-rows:
            repeat(3, 100px);

    }


    .casa {

        width: 100px;

        height: 100px;

        font-size: 50px;

    }


    .botoes {

        flex-direction: column;

    }


    #reiniciar,
    #limparPlacar {

        width: 100%;

    }

}