/* Bracket Styles */
.bracket-container {
    display: block; /* Switch to block to ensure scrollbars stay in the viewport */
    overflow: auto;
    padding: 0;
    background: rgba(0,0,0,0.05);
    border-radius: 16px;
    border: 1px solid var(--surface-border);
    height: 100%;
    max-height: 100%;
    position: relative;
    --bracket-line: rgba(255, 255, 255, 0.4);
}

[data-theme="light"] .bracket-container {
    --bracket-line: rgba(0, 0, 0, 0.35);
}

.bracket-round {
    display: flex;
    flex-direction: column;
    min-width: 250px;
    align-items: center;
    padding: 0 1rem;
    flex-shrink: 0;
    height: auto;
    min-height: min-content;
}

.bracket-match {
    background: var(--bg-color);
    border: 1px solid var(--surface-border);
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    position: relative;
    width: 100%;
}

.bracket-match::after {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    width: 20px;
    border-top: 2px solid var(--bracket-line);
}

.bracket-match::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 20px;
    border-top: 2px solid var(--bracket-line);
}

.bracket-round:first-child .bracket-match::before {
    display: none;
}

.match-wrapper.connect-down::before {
    content: '';
    position: absolute;
    right: -20px;
    top: 50%;
    height: 100%;
    border-right: 2px solid var(--bracket-line);
    z-index: 10;
}

.bracket-round:last-child .bracket-match::after {
    display: none;
}

.match-team {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    min-height: 40px;
}

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

.match-team.owned {
    background: rgba(79, 172, 254, 0.15);
    border-left: 3px solid #00f2fe;
}

.team-info {
    display: flex;
    gap: 6px;
    align-items: baseline;
}

.bracket-seed {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.team-score {
    font-weight: bold;
    margin-left: 10px;
    color: var(--accent-color);
    font-size: 0.9rem;
}

.bracket-owner {
    font-size: 0.7rem;
    color: #48bb78;
    background: rgba(72, 187, 120, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}
.bracket-owner.is-me {
    color: #00f2fe;
    background: rgba(0, 242, 254, 0.1);
}

/* Round Headers at the top of each column */
.round-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px 0;
    margin-bottom: 20px;
    width: 100%;
    position: sticky;
    top: -1px; /* Slightly offset to prevent sub-pixel gaps */
    z-index: 1000;
    background: var(--bg-overlay);
    backdrop-filter: var(--glass-blur);
    border-bottom: 2px solid var(--accent-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.round-title {
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
}

.round-subtitle {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 4px;
    width: 100%;            /* Ensures the text alignment has full room to center */
}