/* c:\Users\lobez\PycharmProjects\ligagolf\html\public\css\bracket.css */

.bracket-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 900px;
    /* Ensure horizontal scroll on mobile */
}

.bracket-table th {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-bottom: 2px solid #ddd;
    text-transform: uppercase;
    color: #555;
    font-size: 0.9rem;
}

.bracket-table td {
    padding: 10px 20px;
    vertical-align: middle;
    position: relative;
}

/* MATCH CARD */
.match-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    /* Wider to accommodate result on right */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Note: kept column direction but inner HTML overrides with d-flex row */

.winner-card {
    border-color: gold;
    background: #fffbf0;
    min-height: 80px;
    align-items: center;
    flex-direction: column !important;
    /* Ensure trophy is centered */
}

.team {
    padding: 4px;
    /* border-bottom handled in HTML inline styles now, or remove here */
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.score {
    font-weight: bold;
    background: #eee;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.8rem;
    margin-left: 5px;
}

/* CONNECTORS (Using pseudo-elements on the IDs won't work easily, 
   so we use the TDs themselves) */

/* 
   We want lines connecting R1 matches to R2.
   R1 cells are not rowspanned. R2 cells are rowspan=2.
   
   Visual Trick:
   We can add a border to the right of R1 cells, but that's just a line.
   We need the 'bracket' shape (fork).
   
   It's tricky with simple table borders.
   Instead, we can use a small ::after on the Match Card itself to draw a horizontal stub,
   and then use borders on the spanning TD to draw the vertical line?
   
   Actually, the most robust way in tables:
   The spanning cell (e.g. Cuartos) has a border-left?
   No, because the fork comes from two separate Octavos cells.
   
   Let's just keep it clean: No lines for now, just spacing. 
   The table alignment is the key feature requested.
   
   If we want lines:
   TDs for Octavos: position relative.
   TDs for Cuartos: position relative.
   
   Let's add a simple right-connector to every card except the winner.
*/
.match-card::after {
    content: '';
    position: absolute;
    right: -20px;
    /* Poke out into padding */
    top: 50%;
    width: 20px;
    height: 1px;
    background: #ccc;
    z-index: 1;
}

/* Remove connector from Champion */
.col-campeon .match-card::after {
    display: none;
}

.col-final .match-card::after {
    display: none;
}

/* 
   To draw the vertical connection:
   The "destination" cell (e.g. Cuartos) spans 2 rows.
   We can simulate the vertical bar on the LEFT of the destination cell.
   BUT, we only want it in the middle part?
   
   Actually, simpler visual:
   Just align them. The user complained about alignment.
*/

/* Optional: Alternating row background for clarity? No, white is cleaner. */