* {
    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: #f1f5f9;

    padding: 30px;
}

.container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* JOGO */

.jogo {
    text-align: center;

    background: white;

    padding: 40px;

    border-radius: 20px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

h1 {
    margin-bottom: 10px;

    color: #1e293b;
}

#status {
    margin-bottom: 25px;

    font-size: 18px;

    color: #64748b;
}

.tabuleiro {
    display: grid;

    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);

    gap: 8px;

    margin-bottom: 25px;
}

.casa {
    border: none;

    border-radius: 12px;

    background: #e2e8f0;

    font-size: 50px;
    font-weight: bold;

    cursor: pointer;

    transition:
        background 0.2s,
        transform 0.2s;
}

.casa:hover {
    background: #cbd5e1;

    transform: scale(1.03);
}

.casa.x {
    color: #ef4444;
}

.casa.o {
    color: #3b82f6;
}

.vitoria-x {
    background: #fee2e2;
}

.vitoria-o {
    background: #dbeafe;
}

#reiniciar,
#limparHistorico {
    border: none;

    padding: 12px 20px;

    border-radius: 10px;

    background: #1e293b;
    color: white;

    font-size: 15px;

    cursor: pointer;

    transition: 0.2s;
}

#reiniciar:hover,
#limparHistorico:hover {
    background: #334155;

    transform: translateY(-2px);
}

/* HISTÓRICO */

.historico {
    background: white;

    padding: 30px;

    border-radius: 20px;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);

    min-width: 450px;
}

.historico h2 {
    margin-bottom: 20px;

    color: #1e293b;
}

table {
    width: 100%;

    border-collapse: collapse;

    margin-bottom: 20px;
}

th,
td {
    padding: 12px;

    text-align: center;

    border-bottom: 1px solid #e2e8f0;
}

th {
    color: #475569;

    background: #f8fafc;
}

td {
    color: #64748b;
}

#limparHistorico {
    background: #dc2626;
}

#limparHistorico:hover {
    background: #b91c1c;
}

/* RESPONSIVIDADE */

@media (max-width: 900px) {

    .container {
        flex-direction: column;
        align-items: center;
    }

    .historico {
        min-width: 0;
        width: 100%;
    }

}

@media (max-width: 500px) {

    .jogo {
        padding: 25px;
    }

    .tabuleiro {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(3, 80px);
    }

    .casa {
        font-size: 40px;
    }

    .historico {
        padding: 20px;

        overflow-x: auto;
    }

    table {
        min-width: 400px;
    }

}
