/* =====================================================
   SWISS SYSTEM — Standings Zones + Bracket + Schedule
   ===================================================== */

/* --- Standings Legend --- */
.standings-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #aab2c0;
}
.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* --- Standings Zone Rows --- */
/* Only first cell gets the colored left border */
.zone-r16 td:first-child { border-left: 3px solid #2ecc71 !important; }
.zone-playin td:first-child { border-left: 3px solid #f2d367 !important; }
.zone-out td:first-child { border-left: 3px solid #e74c3c !important; }

/* Remove right-side borders on all cells */
#standings-table-main td { border-right: none !important; }

.zone-divider-row td {
    padding: 1px !important;
    background: transparent !important;
    border: none !important;
    height: 6px;
}
.zone-divider-row td div {
    height: 2px;
    border-radius: 1px;
}
.zone-divider-green div { background: rgba(46, 204, 113, 0.3); }
.zone-divider-yellow div { background: rgba(242, 211, 103, 0.3); }

.gd-pos { color: #2ecc71; font-weight: 700; }
.gd-neg { color: #e74c3c; font-weight: 700; }

/* --- Standings team cell with logo --- */
.standings-team-cell { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.standings-logo { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; flex-shrink: 0; }

/* --- Bracket Legend --- */
.bracket-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* --- Bracket Layout --- */
.bracket-scroll-wrapper {
    overflow-x: auto;
    padding-bottom: 20px;
    -webkit-overflow-scrolling: touch;
}

.bracket-grid {
    display: flex;
    gap: 16px;
    min-width: 1200px;
    align-items: stretch;
    padding: 10px 0;
}

.bracket-column {
    display: flex;
    flex-direction: column;
    min-width: 190px;
    flex-shrink: 0;
}

.bracket-col-title {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #666;
    margin-bottom: 10px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.03);
}
.bracket-col-title.playin { color: #aaa; }
.bracket-col-title.r16 { color: #f2d367; background: rgba(242,211,103,0.06); }
.bracket-col-title.qf { color: #f2d367; background: rgba(242,211,103,0.06); }
.bracket-col-title.sf { color: #f2d367; background: rgba(242,211,103,0.06); }
.bracket-col-title.finals { color: #ffd700; background: rgba(255,215,0,0.08); }

.bracket-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    gap: 6px;
}

/* Individual match slot */
.bracket-match {
    background: rgba(30, 30, 36, 0.8);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 6px 10px;
    transition: all 0.2s ease;
}
.bracket-match:hover {
    border-color: rgba(255,255,255,0.15);
    background: rgba(40, 40, 48, 0.9);
}
.bracket-match.played { border-color: rgba(46, 204, 113, 0.25); }
.bracket-match.final-slot {
    border: 2px solid rgba(255, 215, 0, 0.35);
    background: rgba(255, 215, 0, 0.04);
}
.bracket-match.third-slot {
    border: 1px solid rgba(205, 127, 50, 0.3);
}

.bracket-match-label {
    font-size: 0.6rem;
    color: #555;
    font-weight: 700;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bracket-team-row {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #999;
}
.bracket-team-row.has-team { color: #ccc; }
.bracket-team-row.winner { color: #2ecc71; font-weight: 800; }

.bracket-team-row .seed {
    color: #555;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 20px;
    text-align: right;
}
.bracket-team-row .team-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bracket-team-row .score {
    font-weight: 800;
    min-width: 16px;
    text-align: right;
    color: #888;
}
.bracket-team-row.winner .score { color: #2ecc71; }

.bracket-vs-line {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 1px 0;
}

/* --- Schedule Rounds --- */
.schedule-rounds {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.schedule-round-block {
    background: rgba(30, 30, 36, 0.5);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 12px;
    overflow: hidden;
}

.schedule-round-header {
    padding: 12px 20px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-weight: 800;
    font-size: 0.95rem;
    color: #f2d367;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.schedule-round-header.playoff {
    color: #ffd700;
    background: rgba(255,215,0,0.04);
}

.schedule-round-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
    padding: 12px;
}

.schedule-no-matches {
    color: #555;
    padding: 20px;
    text-align: center;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .bracket-grid { min-width: 950px; }
    .bracket-column { min-width: 155px; }
    .schedule-round-grid { grid-template-columns: 1fr; }
}