/* ========================================
   TEA AI Tournament Studio - Leaderboard UI
   Phase 4: Tournament Engine & Publish System
   ======================================== */

.lb-toolbar {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}

.lb-toolbar .form-select {
    min-width: 220px;
}

.lb-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    display: inline-block;
    margin-right: 6px;
}

.lb-live-dot.on {
    background: var(--color-success);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: lbPulse 1.6s ease-out infinite;
}

@keyframes lbPulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.lb-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
    background: var(--bg-surface);
}

.lb-table th,
.lb-table td {
    padding: var(--space-3) var(--space-4);
    text-align: center;
    white-space: nowrap;
    border-bottom: 1px solid var(--border-subtle);
}

.lb-table th {
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    background: var(--bg-elevated);
    position: sticky;
    top: 0;
}

.lb-table td.lb-rank,
.lb-table th.lb-rank {
    position: sticky;
    left: 0;
    background: var(--bg-elevated);
    z-index: 1;
}

.lb-table td.lb-team,
.lb-table th.lb-team {
    position: sticky;
    left: 56px;
    background: var(--bg-surface);
    text-align: left;
    font-weight: 600;
    z-index: 1;
}

.lb-table tbody tr:hover td {
    background: var(--bg-hover);
}

.lb-table tbody tr:hover td.lb-rank,
.lb-table tbody tr:hover td.lb-team {
    background: var(--bg-hover);
}

.lb-table td.lb-grand-total {
    font-weight: 800;
    color: var(--color-primary);
}

.lb-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: var(--text-sm);
    background: var(--bg-active);
    color: var(--text-secondary);
}

.lb-rank-badge.gold { background: rgba(255, 195, 0, 0.18); color: #ffc300; }
.lb-rank-badge.silver { background: rgba(192, 192, 200, 0.18); color: #c0c0c8; }
.lb-rank-badge.bronze { background: rgba(205, 127, 50, 0.2); color: #cd7f32; }

.lb-match-cell {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.lb-match-cell .lb-match-kills {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.lb-empty-cell {
    color: var(--text-muted);
}

/* ── Champion Rush ────────────────────────────────────────────────── */
.lb-cr-banner {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: rgba(255, 107, 0, 0.1);
    border: 1px solid rgba(255, 107, 0, 0.3);
    font-size: var(--text-sm);
    margin-bottom: var(--space-4);
}

.lb-cr-banner-champion {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.18), rgba(255, 215, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.45);
    font-size: var(--text-base);
}

.lb-row-eligible td {
    background: rgba(255, 107, 0, 0.06);
}

.lb-row-champion td {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.16), transparent 70%) !important;
    font-weight: 700;
}

/* Banned team (hack / third-party tool) — set on the Publish page. */
.lb-table tr.lb-row-banned td {
    background: rgba(214, 31, 44, 0.16);
    color: #ff8a92;
}
.lb-banned-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #fff;
    background: #d61f2c;
    border-radius: 4px;
    padding: 1px 6px;
    vertical-align: middle;
}

/* select + MVP button share the first row; the MVP button sits at the right */
.lb-select-row { display: flex; align-items: center; gap: var(--space-3); width: 100%; }
.lb-select-row .form-select { flex: 1 1 auto; min-width: 0; }
.lb-select-row .btn { flex: none; }
