.handbol-category-results .resultados {
    font-family: "Roboto Condensed", sans-serif;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.handbol-category-results .handbol-tab-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.handbol-category-results .handbol-tab-btn {
    font-family: "Roboto Condensed", sans-serif;
    background: #f3f3f3;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
}

.handbol-category-results .handbol-tab-btn.active {
    background: #7a182aeb;
    color: #fff;
}

.handbol-category-results .handbol-tab-panel {
    display: none;
}

.handbol-category-results .handbol-tab-panel.active {
    display: block;
}

/* Escritorio: 3 columnas (equipo local | competición/marcador/fecha |
   equipo visitante). En móvil se reordena en tarjeta: cabecera
   (competición), segunda cabecera (fecha/jornada) y cuerpo con los dos
   equipos y el marcador en medio — ver el @media de abajo. */
.handbol-category-results .res-row {
    background: #f3f3f3;
    border-radius: 8px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-areas:
        "team-local competition   team-visitant"
        "team-local score         team-visitant"
        "team-local datetime      team-visitant";
    align-items: center;
    gap: 4px 14px;
    font-size: 16px;
    margin-bottom: 6px;
}

.handbol-category-results .res-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.handbol-category-results .res-team-local {
    grid-area: team-local;
    justify-content: flex-start;
}

.handbol-category-results .res-team-visitant {
    grid-area: team-visitant;
    justify-content: flex-end;
}

.handbol-category-results .res-team span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.handbol-category-results .res-team img {
    height: 32px;
    width: auto;
    border-radius: 8%;
    flex-shrink: 0;
}

.handbol-category-results .res-competition {
    grid-area: competition;
    font-weight: 700;
    color: #003366;
    text-transform: uppercase;
    font-size: 12px;
    text-align: center;
}

.handbol-category-results .res-score {
    grid-area: score;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 26px;
    color: #333;
    line-height: 1.1;
}

.handbol-category-results .res-goals.win {
    font-weight: 700;
    color: #7a182a;
}

.handbol-category-results .res-sep {
    color: #999;
}

.handbol-category-results .res-datetime {
    grid-area: datetime;
    font-size: 14px;
    color: #555;
    white-space: nowrap;
    text-align: center;
}

@media (max-width: 768px) {

    .handbol-category-results .resultados {
        gap: 16px;
    }

    /* Tarjeta en móvil: cabecera (competición) con fondo propio, 2ª
       cabecera (fecha/jornada) a todo lo ancho y el cuerpo en 3 columnas
       (local / marcador / visitante) con el logo encima del nombre. */
    .handbol-category-results .res-row {
        grid-template-columns: 1fr auto 1fr;
        grid-template-areas:
            "competition  competition  competition"
            "datetime     datetime     datetime"
            "team-local   score        team-visitant";
        gap: 0;
        padding: 0;
        overflow: hidden;
        font-size: 14px;
    }

    .handbol-category-results .res-competition {
        background: #7a182aeb;
        color: #fff;
        font-size: 13px;
        padding: 8px 12px;
    }

    .handbol-category-results .res-datetime {
        padding: 6px 12px;
        white-space: normal;
    }

    .handbol-category-results .res-team-local,
    .handbol-category-results .res-team-visitant {
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        padding: 8px 12px 10px;
    }

    .handbol-category-results .res-team span {
        white-space: normal;
        text-align: center;
    }

    .handbol-category-results .res-team img {
        height: 40px;
        order: -1;
    }

    .handbol-category-results .res-score {
        font-size: 24px;
        padding: 0 4px;
    }

    .handbol-category-results .handbol-tab-buttons {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .handbol-category-results .handbol-tab-buttons::-webkit-scrollbar {
        display: none;
    }

    .handbol-category-results .handbol-tab-btn {
        flex-shrink: 0;
        scroll-snap-align: start;
        font-size: 13px;
        padding: 7px 14px;
    }
}
