/* ==========================================
   PARTE 1: RESET, ESTRUTURA BASE E PARTIDAS
   ========================================== */

   * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: linear-gradient(to bottom, #f7f7f7, #ececec);
    min-height: 100vh;
    padding-bottom: 100px; /* Evita que o último grupo fique escondido sob os botões flutuantes */
}

header {
    background: linear-gradient(135deg, #009c3b, #ffdf00, #002776);
    color: white;
    text-align: center;
    padding: 40px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.jogos,
.tabelas-classificacao {
    width: 90%;
    max-width: 900px;
    margin: 30px auto;
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,.12);
}

.jogos h2,
.tabelas-classificacao h2 {
    color: #002776;
    margin-bottom: 20px;
    text-align: center;
}

.jogos h3,
.bloco-tabela-grupo h3 {
    color: #009c3b;
    margin: 20px 0 10px 0;
    font-size: 1.3rem;
    border-bottom: 2px solid #ffdf00;
    padding-bottom: 5px;
}

.partida {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.partida span {
    font-size: 18px;
    font-weight: 500;
}

.partida input {
    width: 60px;
    padding: 8px;
    text-align: center;
    font-size: 20px;
    border: 2px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.partida input:focus {
    border-color: #002776;
}

hr {
    border: 0;
    height: 1px;
    background: #ddd;
    margin: 30px 0;
}
/* ==========================================
   PARTE 2: TABELAS E CLASSIFICAÇÃO
   ========================================== */

   .bloco-tabela-grupo {
    flex: 1 1 280px;
    margin-bottom: 40px;
    overflow-x: auto; /* Permite rolagem lateral em telas pequenas */
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    background: #ffffff;
}
.bloco-tabela-grupo p {
    margin: 6px 0;
}
#container-classificados {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.tabela-grupo {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.tabela-grupo th {
    background: #ffdf00;
    color: #002776;
    padding: 12px;
    font-weight: bold;
    font-size: 16px;
    border-bottom: 3px solid #009c3b;
}

.tabela-grupo td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    font-size: 16px;
}

.tabela-grupo .nome-time {
    text-align: left;
    font-weight: 500;
    min-width: 180px; /* Garante espaço para a bandeira e nome do país */
}

/* Destaque para saldo positivo e negativo */
.saldo-positivo {
    color: #009c3b;
    font-weight: bold;
}

.saldo-negativo {
    color: #c62828;
    font-weight: bold;
}

/* Linhas com destaque personalizado */
.tabela-grupo tbody tr:nth-child(1) {
    background-color: #fff3b0; /* Cor do Líder do seu código original */
    font-weight: bold;
}

.tabela-grupo tbody tr:nth-child(2) {
    background-color: #d9ffd9; /* Cor do Classificado do seu código original */
    font-weight: bold;
}

/* Bordas laterais para os classificados */
.tabela-grupo tbody tr:nth-child(1) td:first-child {
    border-left: 5px solid #ffdf00;
}

.tabela-grupo tbody tr:nth-child(2) td:first-child {
    border-left: 5px solid #009c3b;
}
/* ==========================================
   PARTE 3: BOTÕES FLUTUANTES E RESPONSIVIDADE
   ========================================== */

   .botoes-flutuantes {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%); /* Centraliza perfeitamente na tela */
    display: flex;
    gap: 15px;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 12px 25px;
    border-radius: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000; /* Garante que fique acima de todas as tabelas */
    backdrop-filter: blur(5px); /* Efeito de vidro fosco moderno */
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.botoes-flutuantes button {
    margin: 0; /* Remove as margens automáticas antigas */
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

#simular {
    background: #002776;
    color: white;
}

#simular:hover {
    background: #001f5c;
    transform: translateY(-2px);
}

#limpar {
    background: #c62828;
    color: white;
}

#limpar:hover {
    background: #b71c1c;
    transform: translateY(-2px);
}

/* ==========================================
   MEDIA QUERIES (RESPONSIVIDADE MOBILE)
   ========================================== */

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .jogos,
    .tabelas-classificacao {
        width: 95%;
        padding: 15px;
        margin: 15px auto;
    }

    .tabela-grupo {
        font-size: 14px;
    }

    .tabela-grupo th, 
    .tabela-grupo td {
        padding: 8px 4px;
    }

    .tabela-grupo .nome-time {
        min-width: 140px;
    }

    .botoes-flutuantes {
        width: 90%;
        bottom: 15px;
        padding: 10px 15px;
        justify-content: center;
    }

    .botoes-flutuantes button {
        padding: 10px 16px;
        font-size: 14px;
        flex: 1; /* Faz os botões dividirem o espaço igualmente no celular */
        text-align: center;
    }
}