.itf-tournament-bracket {
    display: flex;
    overflow-x: auto;
    padding: 20px 10px;
    background-color: #f8fafc;
    border-radius: 8px;
}

.itf-bracket-wrapper {
    display: flex;
    flex-direction: row;
}

/* Columna de la ronda */
.itf-round-column {
    display: flex;
    flex-direction: column;
    width: 320px;
    /* Antes 280px - Ahora las tarjetas son más anchas */
    position: relative;
}

/* Encabezado fijo de la ronda fuera de la lógica del árbol */
.itf-round-header {
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #475569;
    padding: 10px 0;
    background-color: #ffffff;
    border-bottom: 2px solid #cbd5e1;
    text-transform: uppercase;
    margin-bottom: 15px;
}

/* Lista de partidos */
.itf-match-list {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex-grow: 1;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Contenedor de cada ítem de partido */
.itf-match-item {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 10px 15px;
    width: 100%;
    height: 100%;
    /* Permite estirarse de forma proporcional */
}

/* Tarjeta del partido */
.itf-match-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    z-index: 2;
    transition: all 0.2s ease;
}

.itf-match-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.itf-match-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    height: 38px;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
}

.itf-match-player:last-child {
    border-bottom: none;
}

.itf-match-player.is-winner {
    background-color: #f0fdf4;
    font-weight: bold;
    color: #16a34a;
}

.itf-player-info {
    display: flex;
    align-items: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex-grow: 1;
    margin-right: 5px;
}

.itf-player-seed {
    font-size: 10px;
    color: #64748b;
    background: #e2e8f0;
    padding: 1px 4px;
    border-radius: 3px;
    margin-right: 6px;
    min-width: 14px;
    text-align: center;
}

.itf-player-scores {
    display: flex;
    gap: 4px;
    /* Un poco más de separación entre sets */
    margin-left: auto;
    /* Empuja el marcador al extremo derecho de forma limpia */
    padding-left: 8px;
}

/* Incrementamos sutilmente el tamaño de las celdas de los sets para mejor visualización */
.itf-score-cell {
    width: 24px;
    /* Antes 20px */
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background-color: #f1f5f9;
    border-radius: 4px;
}

/* --- CONECTORES GEOMÉTRICOS VERTICALES (SOMBRAS ORIGINALES) --- */

/* Línea base que sale hacia la izquierda (entrada a la ronda) */
.itf-match-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 15px;
    height: 2px;
    background-color: #cbd5e1;
    z-index: 1;
}

/* Línea base que sale hacia la derecha (salida de la ronda) */
.itf-match-item::after {
    content: "";
    position: absolute;
    right: 0;
    width: 15px;
    background-color: #cbd5e1;
    z-index: 1;
}

/* Ocultar conectores en bordes del torneo */
.itf-round-column:first-child .itf-match-item::before {
    display: none;
}

.itf-round-column:last-child .itf-match-item::after {
    display: none;
}

/* Configuración matemática del árbol: une pares de partidos */

/* Partidos impares (1, 3, 5...): la línea sale de la mitad y baja cubriendo el 50% inferior */
.itf-match-list .itf-match-item:nth-child(odd)::after {
    height: 50%;
    top: 50%;
    border-right: 2px solid #cbd5e1;
    border-bottom: 2px solid #cbd5e1;
    border-radius: 0 0 4px 0;
}

/* Partidos pares (2, 4, 6...): la línea sube cubriendo el 50% superior y se une con el impar */
.itf-match-list .itf-match-item:nth-child(even)::after {
    height: 50%;
    top: 0;
    border-right: 2px solid #cbd5e1;
    border-top: 2px solid #cbd5e1;
    border-radius: 0 4px 0 0;
}

/* Clase base para el nombre del jugador */
.itf-player-name {
    display: inline-block;
    white-space: nowrap;
    transition: font-size 0.2s ease;
    /* Transición suave por si cambia de tamaño */
}