/* Marca Futsal Staff — compact referee-style horizontal rows */
.mf-staff-wrapper,
.mf-staff-wrapper * { box-sizing: border-box; }

.mf-staff-wrapper { font-size: 14px; line-height: 1.35; }

.mf-staff-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 15px;
    align-items: center;
    margin-bottom: 15px;
}

.mf-staff-controls label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mf-staff-controls select { max-width: 100%; }

.mf-table-scroll,
.mf-staff-matches-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* =========================================================
   TABLA = LISTA HORIZONTAL COMPACTA
   ========================================================= */
.mf-staff-list {
    width: 100%;
}

.mf-staff-list-header,
.mf-staff-row {
    display: grid;
    grid-template-columns: minmax(270px, 2.9fr) .58fr .58fr 1.05fr .58fr 1.05fr .58fr 1.05fr;
    align-items: center;
    column-gap: 0;
}

.mf-staff-list-header {
    min-height: 30px;
    padding: 0 10px 6px;
    color: #777;
    font-size: 12px;
    font-weight: 600;
}

.mf-staff-sort {
    appearance: none;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 2px 5px;
    margin: 0;
    text-align: left;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.mf-staff-sort::after {
    content: '↕';
    margin-left: 3px;
    opacity: .35;
    font-size: 11px;
}

.mf-staff-sort.asc::after { content: '↑'; opacity: .8; }
.mf-staff-sort.desc::after { content: '↓'; opacity: .8; }

.mf-staff-row {
    min-height: 58px;
    margin-bottom: 7px;
    padding: 7px 10px;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.045);
    transition: box-shadow .15s ease, transform .15s ease;
}

.mf-staff-row:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,.08);
}

.mf-staff-cell {
    min-width: 0;
    padding: 0 5px;
    color: #111;
}

.mf-staff-col-stat { text-align: left; }
.mf-staff-col-stat strong { font-weight: 500; }

.mf-staff-person {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 9px;
    color: #222;
    text-decoration: none;
}

.mf-staff-person:hover { text-decoration: none; }

.mf-staff-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-width: 42px;
    overflow: hidden;
    border-radius: 50%;
    background: #f1f1f1;
}

.mf-staff-avatar img {
    display: block;
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
}

.mf-staff-person-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1f3f60;
}

.mf-staff-col-percent {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding-right: 12px;
}

.mf-staff-percent-value {
    display: block;
    font-size: 12px;
    line-height: 1.1;
}

.mf-staff-bar {
    display: block;
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 4px;
    background: #ededed;
}

.mf-staff-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.mf-staff-percent-win .mf-staff-bar span { background: #2ecc71; }
.mf-staff-percent-draw .mf-staff-bar span { background: #f1c40f; }
.mf-staff-percent-loss .mf-staff-bar span { background: #e74c3c; }

.mf-staff-mobile-label { display: none; }

/* =========================================================
   CARDS = COMPACTAS, LIMPIAS Y RESPONSIVE
   ========================================================= */
.mf-view-cards {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

.mf-card {
    min-width: 0;
    padding: 14px 12px 13px;
    border: 1px solid #dedede;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.045);
    transition: transform .15s ease, box-shadow .15s ease;
}

.mf-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0,0,0,.08);
}

.mf-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
}

.mf-card-header a {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.mf-card-header img {
    display: block;
    flex: 0 0 auto;
    width: 70px !important;
    height: 70px !important;
    max-width: 70px;
    margin: 0 auto 7px;
    object-fit: cover;
    object-position: center;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.mf-card-header h3 {
    width: 100%;
    min-height: 38px;
    margin: 2px 0 3px;
    padding: 0 2px;
    color: #111;
    font-size: 17px;
    line-height: 1.15;
    font-weight: 700;
    text-align: center;
    overflow-wrap: anywhere;
}

.mf-card-header > span {
    display: block;
    margin: 0 0 4px;
    color: #666;
    font-size: 13px;
    line-height: 1.2;
    text-align: center;
}

.mf-card-bars {
    margin-top: 1px;
}

.mf-card-bars > div {
    margin-top: 7px;
    color: #222;
    font-size: 12px;
    line-height: 1.2;
}

.mf-card-bars > div:first-child { margin-top: 5px; }

.bar {
    display: block;
    height: 6px;
    width: var(--mf-bar-width, 0%);
    max-width: 100%;
    margin: 4px 0 0;
    border-radius: 4px;
    background: #ddd;
}

.bar.win  { background: #2ecc71; }
.bar.draw { background: #f1c40f; }
.bar.loss { background: #e74c3c; }

.mf-is-loading {
    opacity: .6;
    pointer-events: none;
    transition: opacity .15s ease;
}

.mf-staff-matches-table {
    width: 100%;
    border-collapse: collapse;
}

.mf-staff-matches-table th,
.mf-staff-matches-table td { padding: 6px; vertical-align: middle; }
.mf-staff-matches-table img { width: 28px; height: 28px; object-fit: cover; vertical-align: middle; margin-right: 5px; }
.mf-match-row { cursor: pointer; }
.mf-result { font-weight: 700; text-align: center; white-space: nowrap; }

@media (max-width: 1100px) {
    .mf-view-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .mf-staff-list-header,
    .mf-staff-row {
        grid-template-columns: minmax(210px, 2.5fr) .55fr .55fr .9fr .55fr .9fr .55fr .9fr;
    }

    .mf-staff-person-name { font-size: 13px; }

    .mf-view-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 680px) {
    .mf-staff-controls {
        gap: 8px 12px;
        margin-bottom: 12px;
    }

    .mf-staff-controls label {
        font-size: 13px;
    }

    .mf-staff-controls select {
        min-height: 34px;
    }

    /* Tabla: en móvil se mantiene horizontal y compacta; se desplaza dentro
       del propio bloque para no romper el ancho de la página. */
    .mf-view-table {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }

    .mf-staff-list {
        min-width: 650px;
    }

    .mf-staff-list-header { display: grid; }

    .mf-staff-row {
        min-height: 52px;
        margin-bottom: 6px;
        padding: 6px 7px;
    }

    .mf-staff-cell { padding: 0 3px; }
    .mf-staff-person { gap: 7px; }

    .mf-staff-avatar,
    .mf-staff-avatar img {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }

    .mf-staff-person-name { font-size: 12px; }
    .mf-staff-col-stat strong,
    .mf-staff-percent-value { font-size: 11px; }
    .mf-staff-bar { height: 4px; min-width: 28px; }
    .mf-staff-col-percent { min-width: 42px; padding-right: 3px; }
    .mf-staff-mobile-label { display: none; }

    /* Cards: una columna, manteniendo el mismo diseño compacto. */
    .mf-view-cards {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .mf-card {
        display: grid;
        grid-template-columns: 72px minmax(0, 1fr);
        column-gap: 12px;
        align-items: center;
        min-height: 92px;
        padding: 10px 12px;
        border-radius: 13px;
    }

    .mf-card-header {
        grid-row: 1 / span 2;
    }

    .mf-card-header a {
        width: 100%;
    }

    .mf-card-header img {
        width: 58px !important;
        height: 58px !important;
        max-width: 58px;
        margin-bottom: 5px;
    }

    .mf-card-header h3 {
        min-height: 0;
        margin: 0;
        font-size: 13px;
        line-height: 1.15;
    }

    .mf-card-header > span {
        display: none;
    }

    .mf-card-bars {
        grid-column: 2;
        margin-top: 0;
    }

    .mf-card-bars > div {
        margin-top: 5px;
        font-size: 11px;
    }

    .mf-card-bars > div:first-child { margin-top: 0; }
    .mf-card-bars .bar { height: 5px; margin-top: 3px; }

    .mf-staff-matches-table {
        min-width: 760px;
    }
}

@media (max-width: 430px) {
    .mf-staff-controls {
        align-items: flex-start;
    }

    .mf-staff-controls label {
        flex: 1 1 auto;
    }

    .mf-staff-controls select {
        min-width: 0;
        max-width: 100%;
    }

    .mf-card {
        grid-template-columns: 62px minmax(0, 1fr);
        column-gap: 10px;
        min-height: 84px;
        padding: 8px 10px;
    }

    .mf-card-header img {
        width: 50px !important;
        height: 50px !important;
        max-width: 50px;
    }

    .mf-card-header h3 {
        font-size: 12px;
    }

    .mf-card-bars > div {
        font-size: 10px;
        margin-top: 4px;
    }

    .mf-card-bars .bar {
        height: 4px;
        margin-top: 2px;
    }
}
