.br-grid {
    display: flex;
    gap: 42px;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
}

.br-col {
    min-width: 320px;
    position: relative;
    flex-shrink: 0;
}

.br-col-title {
    color: #8b98b7;
    font-weight: 600;
    margin: 0 0 10px;
    text-align: center;
    font-size: 0.9rem;
}

/* Card & nội dung */
.br-card {
    background: #0b1220;
    border: 1px solid #101826;
    border-radius: 14px;
    padding: 14px 16px;
    color: #d9e1f2;
    position: relative;
    margin-bottom: 18px;
    height: 104px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.br-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.br-team {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    transition: all 0.3s ease;
    flex: 1;
}

.br-team img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.br-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

/* Player link styles */
.br-name a {
    color: inherit !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
}

.br-name a:hover {
    color: #4ade80 !important;
    text-decoration: underline !important;
}

.br-team.winner .br-name a:hover {
    color: #22c55e !important;
}

/* Team winner/loser styles */
.br-team.winner {
    color: #4ade80;
    font-weight: 700;
}

.br-team.winner .br-name {
    color: #4ade80;
}

.br-team.loser {
    color: #6b7280;
    opacity: 0.7;
}

.br-team.loser .br-name {
    color: #6b7280;
}

.br-team.draw {
    color: #fbbf24;
}

.br-team.draw .br-name {
    color: #fbbf24;
}

/* Score styles */
.agg {
    min-width: 48px;
    text-align: center;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    background: #121a2b;
    border: 1px solid #1c2540;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.agg.winner-p1,
.agg.winner-p2 {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border-color: #16a34a;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.3);
}

.agg.draw {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: #d97706;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* Leg chips */
.br-legs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.leg-chip {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 999px;
    background: #121a2b;
    border: 1px solid #1e2b4a;
}

.leg-chip--p1 {
    border-color: #2a7cff;
    background: rgba(42, 124, 255, 0.1);
}

.leg-chip--p2 {
    border-color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
}

/* ===== RESET DEFAULTS ===== */
.br-col .br-card {
    margin-bottom: 18px;
}

.br-col {
    padding-top: 0;
}

/* ===== 2 ROUNDS TOURNAMENT (SF → F) - 4 TEAMS ===== */
.br-grid[data-total-rounds="2"] .br-col[data-round-index="0"] {
    padding-top: 61px;
}

.br-grid[data-total-rounds="2"] .br-col[data-round-index="0"] .br-card {
    margin-bottom: 140px;
}

.br-grid[data-total-rounds="2"] .br-col[data-round-index="1"] {
    padding-top: 183px;
}

/* ===== 3 ROUNDS TOURNAMENT (QF → SF → F) - 8 TEAMS ===== */
.br-grid[data-total-rounds="3"] .br-col[data-round-index="0"] {
    padding-top: 0;
}

.br-grid[data-total-rounds="3"] .br-col[data-round-index="1"] {
    padding-top: 61px;
}

.br-grid[data-total-rounds="3"] .br-col[data-round-index="1"] .br-card {
    margin-bottom: 140px;
}

.br-grid[data-total-rounds="3"] .br-col[data-round-index="2"] {
    padding-top: 183px;
}

/* ===== 4 ROUNDS TOURNAMENT (R16 → QF → SF → F) - 16 TEAMS ===== */
.br-grid[data-total-rounds="4"] .br-col[data-round-index="0"] {
    padding-top: 0;
}

.br-grid[data-total-rounds="4"] .br-col[data-round-index="1"] {
    padding-top: 61px;
}

.br-grid[data-total-rounds="4"] .br-col[data-round-index="1"] .br-card {
    margin-bottom: 140px;
}

.br-grid[data-total-rounds="4"] .br-col[data-round-index="2"] {
    padding-top: 183px;
}

.br-grid[data-total-rounds="4"] .br-col[data-round-index="2"] .br-card {
    margin-bottom: 380px;
}

.br-grid[data-total-rounds="4"] .br-col[data-round-index="3"] {
    padding-top: 420px;
}

/* ===== 5 ROUNDS TOURNAMENT (R32 → R16 → QF → SF → F) - 32 TEAMS ===== */
.br-grid[data-total-rounds="5"] .br-col[data-round-index="0"] {
    padding-top: 0;
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="1"] {
    padding-top: 61px;
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="1"] .br-card {
    margin-bottom: 140px;
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="2"] {
    padding-top: 183px;
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="2"] .br-card {
    margin-bottom: 388px;
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="3"] {
    padding-top: 419px;
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="3"] .br-card {
    margin-bottom: 894px;
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="4"] {
    padding-top: 908px;
}

/* ===== CONNECTOR LINES ===== */

/* Đường ngang */
.br-col:not([data-is-first="true"]) .br-card::before {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 22px;
    height: 1px;
    background: #2a3550;
    transform: translateY(-50%);
}

/* Connector lines cho 2 rounds */
.br-grid[data-total-rounds="2"] .br-col[data-round-index="1"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 122px;
    background: #2a3550;
    transform: translateY(-50%);
}

/* Connector lines cho 3 rounds */
.br-grid[data-total-rounds="3"] .br-col[data-round-index="1"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 122px;
    background: #2a3550;
    transform: translateY(-50%);
}

.br-grid[data-total-rounds="3"] .br-col[data-round-index="2"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 122px;
    background: #2a3550;
    transform: translateY(-50%);
}

/* Connector lines cho 4 rounds */
.br-grid[data-total-rounds="4"] .br-col[data-round-index="1"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 122px;
    background: #2a3550;
    transform: translateY(-50%);
}

.br-grid[data-total-rounds="4"] .br-col[data-round-index="2"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 244px;
    background: #2a3550;
    transform: translateY(-50%);
}

.br-grid[data-total-rounds="4"] .br-col[data-round-index="3"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 444px;
    background: #2a3550;
    transform: translateY(-50%);
}

/* Connector lines cho 5 rounds */
.br-grid[data-total-rounds="5"] .br-col[data-round-index="1"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 122px;
    background: #2a3550;
    transform: translateY(-50%);
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="2"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 370px;
    background: #2a3550;
    transform: translateY(-50%);
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="3"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 776px;
    background: #2a3550;
    transform: translateY(-50%);
}

.br-grid[data-total-rounds="5"] .br-col[data-round-index="4"] .br-card::after {
    content: "";
    position: absolute;
    left: -22px;
    top: 50%;
    width: 1px;
    height: 776px;
    background: #2a3550;
    transform: translateY(-50%);
}

/* Hover effects */
.br-card:hover {
    border-color: #1c2540;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.br-card:hover .br-team.winner {
    color: #22c55e;
}

/* ===== PLACEHOLDER STYLES ===== */
.br-card--placeholder {
    border-style: dashed;
    border-color: #334155;
    background: rgba(15, 23, 42, 0.3);
    opacity: 0.8;
}

.br-team--placeholder {
    color: #64748b !important;
    font-style: italic;
}

.br-team--placeholder .br-name {
    color: #64748b !important;
    font-weight: 400 !important;
}

.agg--placeholder {
    background: rgba(30, 41, 59, 0.5) !important;
    border: 1px dashed #475569 !important;
    color: #64748b !important;
    font-style: italic;
    box-shadow: none !important;
}

.br-card--placeholder:hover {
    transform: none;
    box-shadow: none;
    border-color: #475569;
}

/* Animation for when placeholder gets filled */
.br-card {
    transition: all 0.3s ease;
}

.br-team {
    transition: all 0.3s ease;
}

.agg {
    transition: all 0.3s ease;
}
