/* UEL - Upper Echelon Leagues */

/* Hub Page */
.uel-hub {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.uel-hub h1 {
    font-size: 2.5rem;
    margin-bottom: 0.25rem;
}

.uel-subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.league-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.league-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.league-card h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.league-seasons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.season-link {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}

.season-link:hover {
    background: var(--primary-hover);
}

.league-card.coming-soon {
    opacity: 0.6;
    border-style: dashed;
}

.coming-soon-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Recap Page */
.uel-recap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.recap-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.recap-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: var(--text-primary);
}

.recap-header h1 {
    font-size: 1.8rem;
}

.season-badge {
    background: var(--primary-color);
    color: #fff;
    padding: 0.2rem 0.7rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
}

.recap-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
}

.last-updated {
    color: var(--text-secondary);
}

.refresh-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.refresh-link:hover {
    text-decoration: underline;
}

/* Timeline */
.timeline-wrapper {
    overflow-x: auto;
    padding: 0.5rem 0 1rem;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
}

.timeline {
    display: flex;
    align-items: center;
    min-width: max-content;
    gap: 0;
    padding: 0.5rem 0;
}

.timeline-week {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
    text-decoration: none;
    transition: all 0.2s;
}

.timeline-week.completed.regular {
    background: var(--primary-color);
    color: #fff;
}

.timeline-week.completed.regular:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.timeline-week.completed.playoff {
    background: #f59e0b;
    color: #000;
}

.timeline-week.completed.playoff:hover {
    background: #d97706;
    transform: scale(1.1);
}

.timeline-week.selected {
    background: var(--success-color) !important;
    color: #fff !important;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
    transform: scale(1.15);
}

.timeline-week.disabled {
    background: var(--surface);
    color: var(--text-secondary);
    opacity: 0.5;
    cursor: default;
}

.timeline-connector {
    width: 16px;
    height: 3px;
    background: var(--border-color);
    flex-shrink: 0;
}

.timeline-connector.filled {
    background: var(--primary-color);
}

/* Week Label */
.week-label {
    text-align: center;
    margin-bottom: 1rem;
}

.week-label h2 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

/* Median Banner */
.median-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    margin-bottom: 1.5rem;
    border: 2px dashed var(--text-secondary);
    border-radius: 8px;
    background: rgba(100, 116, 139, 0.1);
}

.median-line-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.median-score {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
}

/* Matchup Grid */
.matchup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.matchup-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.matchup-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    transition: background 0.2s;
}

.matchup-team.winner {
    background: rgba(34, 197, 94, 0.08);
}

.team-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.team-avatar.placeholder {
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.team-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

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

.team-score {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-badges {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge.win {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.badge.loss {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge.tie {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

.badge-median {
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
}

.matchup-divider {
    text-align: center;
    padding: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--border-color);
    letter-spacing: 1px;
}

/* Standings */
.standings-section {
    margin-bottom: 2rem;
}

.standings-section h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.standings-table-wrapper {
    overflow-x: auto;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.standings-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.standings-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.standings-table .rank-col {
    width: 40px;
    text-align: center;
}

.standings-table .team-col {
    min-width: 160px;
}

.standings-table .pf-col {
    text-align: right;
}

.standings-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.standings-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.standings-avatar.placeholder {
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.total-record {
    font-weight: 700;
}

tr.playoff-team {
    background: rgba(34, 197, 94, 0.06);
}

tr.playoff-team td:first-child {
    position: relative;
}

tr.playoff-team td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--success-color);
}

/* Summary timeline button */
.timeline-week.summary {
    background: #8b5cf6;
    color: #fff;
    font-size: 0.75rem;
}

.timeline-week.summary:hover {
    background: #7c3aed;
    transform: scale(1.1);
}

/* Bracket sections */
.bracket-section {
    margin-bottom: 2rem;
}

.bracket-heading {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border-color);
}

.playoff-heading {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
}

.consolation-heading {
    color: var(--text-secondary);
}

/* Matchup labels */
.matchup-label {
    text-align: center;
    padding: 0.3rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.label-championship {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
}

.label-playoff {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.label-consolation {
    background: rgba(100, 116, 139, 0.15);
    color: var(--text-secondary);
}

.matchup-card.championship {
    border-color: #f59e0b;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.15);
}

.matchup-card.consolation {
    opacity: 0.85;
}

/* Champion Banner */
.champion-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(245, 158, 11, 0.04));
    border: 2px solid #f59e0b;
    border-radius: 12px;
}

.champion-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #f59e0b;
    object-fit: cover;
}

.champion-text {
    display: flex;
    flex-direction: column;
}

.champion-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #f59e0b;
}

.champion-name {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Summary Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.summary-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.summary-card-header {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    background: rgba(100, 116, 139, 0.06);
}

.summary-card-body {
    padding: 0.75rem 1rem;
}

/* Ranked list rows (e.g., trades leaderboard) */
.summary-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.35rem 0;
}

.summary-row.highlight {
    font-weight: 700;
}

.summary-rank {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
}

.summary-team-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.summary-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.summary-avatar.placeholder {
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.summary-value {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.summary-footnote {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Single highlight stat (e.g., most wins, most points) */
.summary-highlight-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.summary-avatar-lg {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.summary-big-name {
    font-weight: 700;
    font-size: 1rem;
}

.summary-big-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-color);
}

.summary-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Matchup-style stats (blowout, closest game) */
.summary-matchup-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.summary-winner {
    font-weight: 700;
    color: var(--success-color);
}

.summary-vs {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.summary-loser {
    font-weight: 600;
    color: var(--danger-color);
}

.summary-detail-center {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 640px) {
    .recap-header {
        flex-direction: column;
    }

    .recap-header h1 {
        font-size: 1.4rem;
    }

    .matchup-grid {
        grid-template-columns: 1fr;
    }

    .timeline-week {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }

    .timeline-connector {
        width: 10px;
    }
}
