/* Wrapper */
.mfb-bracket-wrapper {
    width: 100%;
    overflow-x: auto;
    padding: 1rem 0;
    text-align: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mfb-tournament-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #111827;
    letter-spacing: .06em;
}

/* Bracket layout */
.mfb-bracket {
    display: inline-flex;
    gap: 3rem;
    align-items: stretch;
    justify-content: center;
    text-align: left;
}

.mfb-round {
    min-width: 230px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.mfb-round-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    color: #4b5563;
}

.mfb-round-matches {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 1.4rem;
    justify-content: space-around;
}

/* Match card */
.mfb-match {
    background: #ffffff;
    border-radius: 14px;
    padding: 0.7rem 0.9rem;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.45);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    position: relative;
}

/* Connection lines between rounds */
.mfb-round:not(:last-child) .mfb-match::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -1.5rem;
    width: 1.5rem;
    border-top: 2px solid rgba(148, 163, 184, 0.9);
}

.mfb-round + .mfb-round .mfb-match::before {
    content: "";
    position: absolute;
    top: 50%;
    left: -1.5rem;
    width: 1.5rem;
    border-top: 2px solid rgba(148, 163, 184, 0.9);
}

/* Team rows */
.mfb-team-row {
    display: flex;
    align-items: flex-start;   /* <-- clave: alinear por arriba */
    justify-content: space-between;
    padding: 0.25rem 0.3rem;
    border-radius: 0.6rem;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
}


.mfb-team {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.mfb-team-logo img {
    width: 34px;
    height: 34px;

    width: 26px;
    height: 26px;
    border-radius: 999px;
    object-fit: cover;
    background: #e5e7eb;
}

.mfb-team-name {
    font-size: 1.1rem;
    font-weight: 800;

    font-size: 1.05rem;
    color: #0f172a;
    white-space: nowrap;
}

.mfb-scores {
    display: flex;
    align-items: baseline;
    gap: 0.15rem;
    font-variant-numeric: tabular-nums;
}

.mfb-score-main {
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
}

.mfb-score-pen {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Winner highlight */
.mfb-team-row.mfb-winner {
    background: linear-gradient(135deg, rgba(59,130,246,0.10), rgba(16,185,129,0.10));
    box-shadow: 0 0 0 1px rgba(59,130,246,0.65);
    transform: translateY(-1px);
}

.mfb-team-row.mfb-winner .mfb-team-name {
    font-size: 1.1rem;
    font-weight: 800;

    font-weight: 700;
}

.mfb-pen-label {
    margin-top: 0.15rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
}

/* Footer */
.mfb-match-footer {
    margin-top: 0.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.mfb-match-meta {
    font-weight: 700;
    color: #111827;
    text-align: left;
}

.mfb-match-meta div {
    line-height: 1.1;
}

.mfb-live-badge {
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    animation: mfb-blink 1s ease-in-out infinite;
}

/* Animaciones marcador vivo */
.mfb-score-live {
    animation: mfb-blink 1s ease-in-out infinite;
}

/* Durante penales: resultado gris y penales negros en negrita + parpadeando */
.mfb-score-regular-live {
    color: #9ca3af;
    font-weight: 600;
}

.mfb-score-pen-live {
    color: #111827;
    font-weight: 800;
    animation: mfb-blink 1s ease-in-out infinite;
}

@keyframes mfb-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* Admin (resumen) */
.mfb-admin-wrapper {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mfb-admin-rounds {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.mfb-admin-matches {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1rem;
}

.mfb-admin-match-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.75rem;
    background: #ffffff;
    box-shadow: 0 3px 8px rgba(15, 23, 42, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
    .mfb-round {
        min-width: 200px;
    }

    .mfb-team-name {
    font-size: 1.1rem;
    font-weight: 800;

        font-size: 0.95rem;
    }

    .mfb-score-main {
        font-size: 1rem;
    }

    .mfb-tournament-title {
        font-size: 1.5rem;
    }
}

/* =========================================
   LÍNEAS VERTICALES ENTRE BRACKETS
   ========================================= */
.mfb-bracket-column:not(:first-child) .mfb-bracket-match:nth-child(2n)::before {
    content: "";
    position: absolute;
    left: -25px;
    top: -50%;
    width: 2px;
    height: calc(100% + 50%);
    background: #8aa0b3;
}
/* Contenedor de todas las líneas de goleadores */
.mfb-scorers-block {
    display: block;
    margin-top: 2px;
}

.mfb-scorers-line {
    display: block;
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    line-height: 1.3;
}

.mfb-scorer-text {
    font-weight: 400;
}

.mfb-team {
    align-items: flex-start;
}

/* Forzar que el nombre del club quede pegado al logo
   y que todo crezca hacia abajo con los goleadores */
.mfb-team {
    align-items: flex-start !important;   /* top-align logo + nombre */
}

/* El nombre del equipo en una “caja” propia, texto normal */
.mfb-team-name {
    display: block;
    white-space: normal;                  /* permitir saltos de línea internos */
    font-weight: 700;
}

/* Contenedor de las líneas de goleadores */
.mfb-scorers-block {
    display: block;
    margin-top: 2px;
}

/* Cada goleador en línea aparte, tipo máquina de escribir */
.mfb-scorers-line {
    display: block;                       /* fuerza salto de línea */
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    line-height: 1.3;
}

/* Icono de pelota alineado con el texto */
.mfb-scorer-ball {
    margin-right: 4px;
}

/* Texto de goleador sin negrita */
.mfb-scorer-text {
    font-weight: 400;
}

.mfb-champion-label {
    margin-top: 2px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #f59e0b; /* doradito */
}

/* ==========================
   Panel de resultados en vivo (shortcode)
   =========================== */

.mfb-results-frontend {
    max-width: 100%;
    margin: 1.5rem auto;
    padding: 1rem 1.25rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Quitamos márgenes raros del .wrap que trae el admin */
.mfb-results-frontend .wrap {
    margin: 0;
    padding: 0;
}

/* Título dentro del panel en el front */
.mfb-results-frontend .wrap > h1 {
    font-size: 1.4rem;
    margin: 0 0 0.75rem 0;
    font-weight: 700;
    color: #111827;
}

/* Contenedor con scroll horizontal */
.mfb-results-scroll {
    width: 100%;
    overflow-x: auto;          /* *** Aquí aparece la barra horizontal *** */
    overflow-y: hidden;
}

/* La tabla de resultados más ancha para obligar el scroll en pantallas chicas */
.mfb-results-scroll table.widefat {
    min-width: 980px;
    border-collapse: collapse;
}

/* Cabecera más moderna */
.mfb-results-scroll table.widefat thead th {
    background: #111827;
    color: #f9fafb;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.45rem 0.6rem;
    white-space: nowrap;
}

/* Celdas */
.mfb-results-scroll table.widefat td {
    font-size: 0.85rem;
    padding: 0.35rem 0.6rem;
    white-space: nowrap;
}

/* Rayado tipo "striped" suave */
.mfb-results-scroll table.widefat tbody tr:nth-child(odd) {
    background: #f9fafb;
}

.mfb-results-scroll table.widefat tbody tr:nth-child(even) {
    background: #f3f4f6;
}

/* Hover de fila para ubicar rápido el partido */
.mfb-results-scroll table.widefat tbody tr:hover {
    background: #e5f0ff;
}

/* Inputs más bonitos y compactos */
.mfb-results-scroll input[type="number"],
.mfb-results-scroll input[type="text"],
.mfb-results-scroll textarea {
    width: 100%;
    max-width: 170px;
    font-size: 0.8rem;
    padding: 0.25rem 0.4rem;
    border-radius: 0.35rem;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
}

.mfb-results-scroll input[type="checkbox"] {
    transform: scale(1.1);
}

/* Botón guardar más visible */
.mfb-results-frontend .wrap form p.submit input[type="submit"],
.mfb-results-frontend .wrap input[type="submit"] {
    background: #2563eb;
    border-color: #1d4ed8;
    color: #fff;
    padding: 0.45rem 1.1rem;
    border-radius: 9999px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.1s ease;
}

.mfb-results-frontend .wrap form p.submit input[type="submit"]:hover,
.mfb-results-frontend .wrap input[type="submit"]:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}
.mfb-bracket-loading {
    padding: 12px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}
