/* Title-odds race chart + archive pages (tennis/WTA simulations history).
   Rides the design-system tokens; the chart palette itself lives in
   static/js/title_race.js (validated against --surface-1 #11141B). */

.trc-wrap {
    margin: 18px 0 6px;
}

.trc-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.trc-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.trc-title i {
    color: var(--sport-tennis, #f2784b);
}

.trc-sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin: 0;
}

.trc-canvas-wrap {
    position: relative;
    height: 340px;
    background: var(--surface-1);
    border-radius: 10px;
}

.trc-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.trc-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--surface-2);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.trc-chip:hover {
    background: var(--surface-3);
    color: var(--text-primary);
}

.trc-chip--active {
    background: var(--surface-3);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.25);
}

.trc-chip--out {
    opacity: 0.65;
}

.trc-chip-key {
    width: 14px;
    height: 3px;
    border-radius: 2px;
    flex: none;
}

.trc-note {
    font-size: 0.74rem;
    color: var(--text-secondary);
    opacity: 0.85;
    margin: 10px 0 0;
}

/* Collapsed data-table twin (the accessible / crawlable equivalent) */
.trc-table {
    margin-top: 12px;
    font-size: 0.78rem;
}

.trc-table summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 600;
}

.trc-table .table-responsive {
    margin-top: 8px;
}

.trc-table table {
    width: 100%;
    color: var(--text-secondary);
    border-collapse: collapse;
    font-variant-numeric: tabular-nums;
}

.trc-table th,
.trc-table td {
    padding: 4px 8px;
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
    text-align: right;
    white-space: nowrap;
}

.trc-table th:first-child,
.trc-table td:first-child {
    text-align: left;
}

.trc-table thead th {
    color: var(--text-primary);
    border-top: none;
}

/* ── Archive page ─────────────────────────────────────────────────────── */

.trc-page {
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.trc-breadcrumb {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.trc-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.trc-breadcrumb a:hover {
    color: var(--text-primary);
}

.trc-hero {
    margin-bottom: 18px;
}

.trc-hero h1 {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.trc-hero .lede {
    color: var(--text-secondary);
    font-size: 0.92rem;
    max-width: 640px;
}

.trc-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.trc-badge {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
}

.trc-badge--champion {
    color: #0ca30c;
    border-color: rgba(12, 163, 12, 0.35);
    background: rgba(12, 163, 12, 0.08);
}

.trc-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.trc-selector select {
    background: var(--surface-2);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.82rem;
    max-width: 320px;
}

.trc-card {
    background: var(--surface-1);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
}

.trc-story {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

.trc-story strong {
    color: var(--text-primary);
}

.trc-final-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.trc-final-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.06));
    padding-top: 6px;
}

.trc-final-list .pct {
    color: var(--text-primary);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Sim-page link chip to the archive */
.trc-archive-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 640px) {
    .trc-canvas-wrap {
        height: 280px;
    }
}
