/* ====== Estrutura principal ====== */
.tabelas-wrapper {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* CORRIGIDO */
    gap: 18px;
    align-items: flex-start;
    padding-top: 16px;
    width: 100%;
}

@media (max-width: 767px) {
    .tabelas-wrapper {
        grid-template-columns: 1fr;
    }
}

/* ====== Cards ====== */
.card {
    background: #181818;
    border: 1px solid #272727;
    border-radius: 0;
    overflow: hidden;
}

.card.fora {
    margin-top: 0 !important;
 
}

.card.casa {padding: 0px !important;}

.card.fora {padding: 0px !important;}

/* ====== Header do card ====== */
.card .card-header {
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding: 16px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    text-align: center;
}

.card .team-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.card .logo-time {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.card .team-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #f3f3f3;
}

/* ====== Filtros ====== */
.card .partidas-filtros {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.card .filtro-btn {
    background: #2d2d2d;
    border: 1px solid #3f3f3f;
    color: #f3f3f3;
    border-radius: 0;
    min-width: 74px;
    height: 32px;
    padding: 0 12px;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: background .15s ease, border .15s ease;
    cursor: pointer;
}

.card .filtro-btn.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

/* ====== Select de competição ====== */
.card .competicao-wrap {
    padding-top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.card .competicao-select {
    width: 100%;
    max-width: 320px;
    height: 36px;
    background: #121212;
    border: 1px solid #3f3f3f;
    border-radius: 0;
    color: #f3f3f3;
    padding: 0 12px;
    font-size: 14px;
    line-height: 1;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: menulist;
    appearance: menulist;
}

.card .competicao-select:disabled {
    opacity: .55;
    cursor: not-allowed;
}

@media (max-width: 900px) {
    .card .competicao-select {
        font-size: 16px;
        height: 40px;
    }
}

/* ====== Container da lista com scroll ====== */
.card .partidas-container {
    width: 100%;
}

.card .tabela-partidas {
    max-height: 480px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.card .tabela-partidas::-webkit-scrollbar {
    width: 5px;
}

.card .tabela-partidas::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.card .tabela-partidas::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.card .tabela-partidas::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ====== Lista de partidas ====== */
.card .partidas-lista {
    list-style: none;
    margin: 0;
    padding: 14px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ====== Item da partida ====== */
.card .partida-box {
    background: #242424;
    border-radius: 0;
    padding: 12px 16px 10px 22px;
    position: relative;
    overflow: hidden;
}

.card .partida-box::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0;
    background: #3a3a3a;
}

.card .partida-box.vitoria::before { background: #21e05f; }
.card .partida-box.empate::before { background: #9b9b9b; }
.card .partida-box.derrota::before { background: #e82121; }
.card .partida-box.futura::before { background: #1a73e8; }

/* ====== Link da partida ====== */
.card .link-partida {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card .link-partida:hover {
    opacity: 0.95;
}

/* ====== Topo da partida (info) ====== */
.card .partida-topo {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    text-align: center;
    font-size: 0.7rem;
    margin-bottom: 6px;
    color: #8d8d8d !important;
}

.card .partida-topo * {
    color: #8d8d8d !important;
}

/* ====== Linha principal (times + placar) ====== */
.card .partida-times-placar {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) 60px minmax(0, 1.2fr);
    align-items: center;
    column-gap: 14px;
}

.card .time-casa,
.card .time-fora {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.card .time-casa {
    justify-self: end;
    justify-content: flex-end;
    text-align: right;
    flex-direction: row-reverse;
    padding-right: 4px;
}

.card .time-fora {
    justify-self: start;
    justify-content: flex-start;
    text-align: left;
    flex-direction: row;
}

.card .partida-box .logo-time {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.card .partida-nome {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.78rem;
    color: #f3f3f3;
}

.card .partida-placar {
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
}

/* ====== Mensagem sem partidas ====== */
.card .sem-partidas {
    color: #8d8d8d;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* ====== Ajustes responsivos ====== */
@media (min-width: 1200px) {
    .card .partidas-lista {
        gap: 14px;
        padding: 16px 16px 14px;
    }
    .card .partida-box {
        padding: 14px 22px 12px 26px;
    }
    .card .partida-nome {
        max-width: 180px;
        font-size: 0.8rem;
    }
    .card .partida-placar {
        font-size: 1rem;
    }
    .card .partida-times-placar {
        grid-template-columns: minmax(0, 1.25fr) 66px minmax(0, 1.25fr);
        column-gap: 16px;
    }
}

@media (max-width: 992px) {
    .card .card-header {
        padding: 14px 10px 10px;
    }
    .card .partida-box {
        padding: 10px 12px 8px 18px;
    }
    .card .partida-times-placar {
        grid-template-columns: minmax(0,1fr) 54px minmax(0,1fr);
        column-gap: 10px;
    }
}

@media (max-width: 520px) {
    .card .partida-box {
        padding: 8px 8px 6px 16px;
    }
    .card .partida-topo {
        font-size: 0.65rem;
    }
    .card .partida-times-placar {
        grid-template-columns: minmax(0,1fr) 46px minmax(0,1fr);
        column-gap: 6px;
    }
    .card .partida-nome {
        max-width: 100px;
        font-size: 0.7rem;
    }
    .card .partida-box .logo-time {
        width: 18px;
        height: 18px;
    }
    .card .filtro-btn {
        min-width: 62px;
        height: 28px;
        font-size: 0.7rem;
    }
}

@media (max-width: 360px) {
    .card .partida-times-placar {
        grid-template-columns: minmax(0,1fr) 40px minmax(0,1fr);
    }
    .card .partida-nome {
        max-width: 72px;
        font-size: 0.66rem;
    }
    .card .partida-box .logo-time {
        width: 16px;
        height: 16px;
    }
    .card .filtro-btn {
        min-width: 56px;
        height: 26px;
        font-size: 0.66rem;
    }
}

/* Oculta todas as colunas por padrão no mobile */
@media (max-width: 767px) {
    .coluna-partida {
        display: none;
    }
    .coluna-partida.active-mobile {
        display: block;
    }
}

/* ====== Seletor mobile de times (Casa/Fora) - agora idêntico ao das estatísticas ====== */
#mobile-time-selector {
    display: none; /* escondido por padrão, exibido apenas no breakpoint mobile */
    width: 100% !important;
    margin-bottom: 15px;
    gap: 0;
}

@media (max-width: 767px) {
    #mobile-time-selector {
        display: flex !important;
        justify-content: center;
        width: 95% !important;
        margin: 0 auto 12px;
    }
}

#mobile-time-selector .btn {
    flex: 1 1 0;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 0 !important;
    background: rgba(255, 255, 255, .03) !important;
    padding: 9px 8px !important;
    font-size: .78rem !important;
    line-height: 1.1 !important;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(13, 110, 253, .90);
    transition: background .15s ease, border-color .15s ease, transform .15s ease;
    box-shadow: none !important;
    max-width: 200px;
}

/* Remove borda dupla entre os botões */
#mobile-time-selector .btn:first-child {
    border-right: none !important;
}

/* Hover exato das estatísticas */
#mobile-time-selector .btn:hover {
    background: rgba(255, 255, 255, .06) !important;
}

/* Estado ativo – igual ao das estatísticas */
#mobile-time-selector .btn.active {
    background: rgba(13, 110, 253, .90) !important;
    border-color: rgba(13, 110, 253, .90) !important;
    color: #fff !important;
}

/* Remove outline indesejado */
#mobile-time-selector .btn:focus,
#mobile-time-selector .btn:active {
    outline: none !important;
    box-shadow: none !important;
}

@media (max-width: 380px) {
    .card .filtro-btn {
        min-width: 48px;      /* menor largura mínima */
        height: 24px;         /* altura menor */
        padding: 0 6px;       /* reduz espaçamento interno */
        font-size: 0.6rem;    /* fonte um pouco menor */
    }
}

@media (max-width: 330px) {
    .card .filtro-btn {
        min-width: 40px;      /* menor largura mínima */
        height: 20px;         /* altura menor */
        padding: 0 2px;       /* reduz espaçamento interno */
        font-size: 0.6rem;    /* fonte um pouco menor */
    }
}