/* dashboard.css — League Dashboard page */

/* Forward link (e.g. "Open player card ›") */
.forward-link {
    display: inline-block;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--fs-085);
    transition: color 0.15s;
}
.forward-link:hover {
    color: var(--color-text);
}

/* League nav arrows in header — sit on their own line below the title
   with reasonable breathing room. The parent .page-header is text-align:center,
   so inline-flex keeps the pair centered. */
.league-nav {
    display: inline-flex;
    gap: var(--space-xs);
    vertical-align: middle;
    margin-top: var(--space-md);
}

.league-nav .nav-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    text-decoration: none;
    font-size: var(--fs-120);
    font-weight: 700;
    transition: background 0.15s;
}

.league-nav .nav-arrow:hover:not(.disabled) {
    background: var(--color-hover);
}

.league-nav .nav-arrow.disabled {
    opacity: 0.35;
    pointer-events: none;
}

/* Summary cards — always one row, equal-width columns, fluid sizing down to mobile. */
.dashboard-cards {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: clamp(6px, 0.3rem + 0.6vw, 16px);
    margin-bottom: var(--space-xl);
}

.dash-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: clamp(8px, 0.4rem + 0.8vw, 18px) clamp(6px, 0.3rem + 0.6vw, 16px);
    box-shadow: var(--shadow-sm);
    text-align: center;
    min-width: 0;
}

/* Flex card: stays 1fr when content fits, but expands past 1fr instead of
   ellipsis-clipping when content is wider — the other (non-flex) cards have
   min-width:0 so they shrink to make room. */
.dash-card.dash-card--flex {
    min-width: max-content;
}
.dash-card.dash-card--flex .dash-card-value {
    overflow: visible;
    text-overflow: clip;
}

.dash-card-label {
    font-size: var(--fs-085);
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: clamp(2px, 0.1rem + 0.2vw, 6px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-card-value {
    font-size: var(--fs-112);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Flag in the Leading Player card — sized in em so it tracks the player-name text,
   matching the proportion used in the B2 leaderboard cell. */
.dash-card-value .flag {
    height: 1em;
    width: auto;
    margin-right: 0.3em;
    vertical-align: middle;
    border-radius: 0.15em;
}

/* Sections */
.dash-section {
    margin-top: var(--space-xl);
}

.dash-section h2 {
    margin-bottom: var(--space-md);
    font-size: var(--fs-120);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: var(--space-xs);
    color: var(--color-text);
}

.dash-section h2 a {
    color: var(--color-accent);
    text-decoration: none;
}

.dash-section h2 a:hover {
    text-decoration: underline;
}

/* ---- Tab-panel framing (same surface-card look as the HOME page) ----
   Sections inside a .dash-tab-panel become framed cards; the panel hides via
   the shared .app-tab-panel[hidden] rule in css/tabs.css. */
.dash-tabs-shell { margin-bottom: var(--space-lg); }

.dash-tab-panel > .dash-section {
    margin: 0 0 var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    box-shadow: var(--shadow-sm);
}
.dash-tab-panel > .dash-section:last-child { margin-bottom: 0; }

/* H2 inside a framed card: no top margin, thinner divider (the card border frames it). */
.dash-tab-panel > .dash-section > h2 {
    margin-top: 0;
    margin-bottom: var(--space-md);
    border-bottom-width: 1px;
    padding-bottom: var(--space-sm);
}

.dash-controls {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.dash-controls label {
    color: var(--color-text-secondary);
    font-size: var(--fs-085);
}

.dash-controls select,
.dash-controls button {
    padding: 6px 12px;
    font-size: var(--fs-085);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    font-family: var(--font-main);
}

.dash-controls button:hover:not(:disabled) {
    background: var(--color-hover);
}

.dash-controls button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.round-label {
    font-weight: 600;
    min-width: 130px;
    text-align: center;
    color: var(--color-text);
}

/* Scroll wrapper — overflow-x + corner clipping live here, not on the table.
   overflow-x:auto triggers border-radius clipping per CSS spec (no overflow:hidden needed). */
.dash-table-wrap {
    --col1-w: 36px; /* fallback replaced by JS (iron rule 12) */
    overflow-x: auto;
    min-width: 0;
    box-shadow: var(--shadow-sm);
}

/* B2 rank column — sticky col 1 */
.dash-table-wrap .dash-table thead th:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--header-bg);
}
.dash-table-wrap .dash-table tbody td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 4;
    background: var(--color-surface);
}
.dash-table-wrap tbody tr:hover td:nth-child(1) {
    background: var(--color-hover);
}
/* B2 sticky col 1 — row tint overrides (iron rule 11) */
.dash-table-wrap .dash-table tbody tr.rank-gold td:nth-child(1)   { background: var(--color-gold-bg); }
.dash-table-wrap .dash-table tbody tr.rank-silver td:nth-child(1) { background: var(--color-silver-bg); }
.dash-table-wrap .dash-table tbody tr.rank-bronze td:nth-child(1) { background: var(--color-bronze-bg); }
.dash-table-wrap .dash-table tbody tr.unplayed-row td:nth-child(1) { background: var(--color-unplayed-bg); }

/* B2 Historical — player col is sticky col 2 (offset by col 1 width) */
.dash-table-wrap .dash-table th.player-col {
    position: sticky;
    left: var(--col1-w);
    z-index: 4;
}
.dash-table-wrap .dash-table td.player-cell {
    left: var(--col1-w);
}

/* B2 sticky column boundary drop-shadow — Google-style, appears only on scroll */
.dash-table-wrap .dash-table thead th.player-col {
    box-shadow: inset 0 -1px 0 var(--color-border);
}
.dash-table-wrap.is-scrolled-x .dash-table thead th.player-col {
    box-shadow: inset 0 -1px 0 var(--color-border), 6px 0 8px -4px rgba(0, 0, 0, 0.18);
}
.dash-table-wrap.is-scrolled-x .dash-table tbody td.player-cell {
    box-shadow: inset 0 -1px 0 var(--color-border), 6px 0 8px -4px rgba(0, 0, 0, 0.18);
}
.dash-table-wrap.is-scrolled-x .dash-table tbody tr:last-child td.player-cell {
    box-shadow: 6px 0 8px -4px rgba(0, 0, 0, 0.18);
}

/* Theme-aware dash tables */
.dash-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    color: var(--color-text);
}

.dash-table th,
.dash-table td {
    padding: 0.45em 0.5em;
    box-shadow: inset 0 -1px 0 var(--color-border);
    text-align: left;
    white-space: nowrap;
    font-size: inherit;
}

.dash-table tbody tr:last-child td { box-shadow: none; }

.dash-table th {
    background: var(--header-bg);
    color: var(--header-text);
    font-weight: 600;
}

.dash-table tr:hover td {
    background: var(--color-hover);
}

.dash-table tr.unplayed-row td {
    background: var(--color-unplayed-bg);
    color: var(--color-text-muted);
    font-style: italic;
}

/* Distinct medal row tints (override token collisions in variables.css) */
.dash-table tr.rank-gold td { background: var(--color-gold-bg); color: var(--color-gold-text); }
.dash-table tr.rank-silver td { background: var(--color-silver-bg); color: var(--color-silver-text); }
.dash-table tr.rank-bronze td { background: var(--color-bronze-bg); color: var(--color-bronze-text); }

/* Player column / cell alignment + sticky */
.dash-table th.player-col,
.dash-table td.player-cell {
    text-align: left;
    padding-left: var(--space-md);
}
.dash-table td.player-cell {
    position: sticky;
    left: 0;
    background: var(--color-surface);
}

.dash-table .flag {
    height: 1em;
    width: auto;
    vertical-align: middle;
    margin-right: 0.3em;
    object-fit: contain;
    border-radius: 0.15em;
}

/* .chart-panel, .chart-host, .bar-chart-canvas, .chart-info-panel — shared, defined in components.css */

.remove-chart {
    background: transparent !important;
    border: none !important;
    font-size: var(--fs-140) !important;
    color: var(--color-text-muted) !important;
    padding: 0 8px !important;
    cursor: pointer;
}

.remove-chart:hover {
    color: var(--color-loss) !important;
}

.add-chart-btn {
    padding: 8px 16px;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-secondary);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: var(--fs-095);
}

.add-chart-btn:hover {
    background: var(--color-hover);
    color: var(--color-text);
    border-color: var(--color-accent);
}

/* Open full table button (next to historical date select) */
.open-full-btn {
    margin-left: auto;
    padding: 6px 14px;
    background: var(--color-accent);
    color: #fff;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: var(--fs-085);
    font-weight: 500;
    transition: background 0.15s;
}

.open-full-btn:hover {
    background: var(--color-text);
}

/* Player name link — disabled (general card placeholder) */
.player-name-link {
    color: var(--color-accent);
    text-decoration: none;
    cursor: pointer;
}

.player-name-link:hover {
    text-decoration: underline;
}

.player-name-link.disabled-link {
    color: var(--color-text-muted);
    cursor: not-allowed;
    text-decoration: line-through;
}

.player-name-link.disabled-link:hover {
    text-decoration: line-through;
}

/* Right-click context menu */
.player-context-menu {
    position: fixed;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 4px 0;
    min-width: 200px;
    z-index: 1000;
    font-size: var(--fs-090);
}

.player-context-menu .cm-item {
    display: block;
    padding: 8px 14px;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
}

.player-context-menu .cm-item:hover:not(.disabled) {
    background: var(--color-hover);
}

.player-context-menu .cm-item.disabled {
    color: var(--color-text-muted);
    cursor: not-allowed;
    text-decoration: line-through;
}

/* ── Championship Predictor ─────────────────────────── */
.predictor-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--fs-075);
    font-weight: 700;
    cursor: pointer;
    vertical-align: middle;
    margin-left: var(--space-xs);
    user-select: none;
}
.predictor-tooltip:hover {
    background: var(--color-text-muted);
    color: var(--color-bg);
}

.predictor-info-popup {
    position: relative;
    background: var(--color-card-bg, var(--color-bg));
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: var(--space-md) var(--space-lg);
    margin-bottom: var(--space-md);
    font-size: var(--fs-085);
    line-height: 1.55;
    color: var(--color-text);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.predictor-info-popup h3 {
    margin: 0 0 var(--space-sm);
    font-size: var(--fs-100);
}
.predictor-info-popup h4 {
    margin: var(--space-sm) 0 var(--space-xs);
    font-size: var(--fs-090);
    color: var(--color-text-muted);
}
.predictor-info-popup ul {
    margin: var(--space-xs) 0;
    padding-left: 1.4em;
}
.predictor-info-popup li {
    margin-bottom: var(--space-xs);
}
.predictor-info-popup p {
    margin: var(--space-xs) 0;
}
.predictor-info-close {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-sm);
    background: none;
    border: none;
    font-size: var(--fs-120);
    cursor: pointer;
    color: var(--color-text-muted);
    line-height: 1;
}
.predictor-info-close:hover {
    color: var(--color-text);
}

.predictor-moe {
    font-size: var(--fs-080);
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
}


.predictor-topx-control {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
    font-size: var(--fs-088);
    color: var(--color-text-secondary);
}

.topx-select {
    padding: 2px var(--space-xs);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text);
    font-size: var(--fs-090);
    font-family: var(--font-main);
    cursor: pointer;
}
.topx-select:focus { outline: none; border-color: var(--color-accent); }

.predictor-pct-cell {
}

.predictor-pct-bar {
    position: relative;
    background: linear-gradient(to right, var(--bar-color, var(--color-success)) var(--pct, 0%), transparent var(--pct, 0%));
    border-radius: var(--radius-sm);
    padding: 0.15em 0.6em;
    font-size: inherit;
}

.predictor-expand-btn {
    display: block;
    margin: var(--space-sm) auto var(--space-xl);
    padding: 4px 16px;
    font-size: var(--fs-085);
    font-family: var(--font-main);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    cursor: pointer;
    transition: background 0.15s;
}

.predictor-expand-btn:hover {
    background: var(--color-hover);
}

/* ── Collapsible section heading (standard dashboard <h2>) ──
   Used by Prizes & Medals, Championship Predictor and What If. Chevron tracks
   aria-expanded; a `.dash-collapsed` class on the section hides its body. */
.dash-collapse-h2 {
    cursor: pointer;
    user-select: none;
}
.dash-collapse-h2::after {
    content: ' ▸';
    font-size: 0.85em;
    opacity: 0.7;
}
.dash-collapse-h2[aria-expanded="true"]::after {
    content: ' ▾';
}
/* Collapsed section — hide everything but the heading (beats inline display). */
.dash-section.dash-collapsed > *:not(h2) {
    display: none !important;
}

.prizes-info {
    margin-bottom: var(--space-sm);
    font-size: var(--fs-090);
}
.prizes-entry b {
    color: var(--color-accent);
}

.prizes-table-wrap {
    overflow-x: auto;
    min-width: 0;
    width: 70%;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}
.prizes-table {
}
.prize-row-gold td {
    background: rgba(245,158,11,0.1);
}
.prize-row-silver td {
    background: rgba(148,163,184,0.1);
}
.prize-row-bronze td {
    background: rgba(217,119,6,0.08);
}

/* ── What-If Simulator ──────────────────────────────────
   Standard collapsible .dash-section card (header is a .dash-collapse-h2, the
   `?` reuses .predictor-tooltip — shared with the predictor + landing page). */
.whatif-info-popup {
    position: relative;
    margin: var(--space-sm) 0;
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1px dashed var(--color-accent);
    border-radius: var(--radius-md);
    font-size: var(--fs-088);
    line-height: 1.5;
}
.whatif-info-popup h4 { margin: 0 0 var(--space-xs); font-size: var(--fs-100); }
.whatif-info-popup p { margin: var(--space-xs) 0; }
.whatif-info-popup ul { margin: var(--space-xs) 0; padding-left: var(--space-lg); }
.whatif-info-close {
    position: absolute;
    top: 6px;
    right: 6px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: var(--fs-120);
    cursor: pointer;
}

#whatif-body {
    margin-top: var(--space-sm);
    padding: var(--space-md);
    background: repeating-linear-gradient(
        135deg,
        var(--color-surface),
        var(--color-surface) 10px,
        var(--color-bg) 10px,
        var(--color-bg) 20px
    );
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
}

.whatif-picker {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.whatif-input {
    flex: 1;
    min-width: 140px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: var(--fs-090);
}
.whatif-input:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Custom combobox (works on mobile, unlike native <datalist>) */
.whatif-combo {
    position: relative;
    flex: 1;
    min-width: 140px;
    display: flex;
}
.whatif-combo .whatif-input {
    width: 100%;
    min-width: 0;
}
.whatif-options {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 30;
    margin: 0;
    padding: var(--space-2xs, 2px);
    list-style: none;
    max-height: 240px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    -webkit-overflow-scrolling: touch;
}
.whatif-options[hidden] {
    display: none;
}
.whatif-option {
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: var(--fs-090);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.whatif-option:hover,
.whatif-option.active {
    background: var(--color-accent);
    color: var(--color-bg);
}

.whatif-vs {
    font-weight: 600;
    color: var(--color-text-muted);
    font-size: var(--fs-085);
}

.whatif-add-btn,
.whatif-run-btn,
.whatif-clear-btn {
    padding: var(--space-xs) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-accent);
    border-radius: var(--radius-sm);
    color: var(--color-accent);
    cursor: pointer;
    font-size: var(--fs-088);
    font-weight: 600;
    transition: background 0.15s, color 0.15s;
}
.whatif-add-btn:hover,
.whatif-run-btn:hover,
.whatif-clear-btn:hover {
    background: var(--color-accent);
    color: var(--color-bg);
}
.whatif-run-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.whatif-err {
    color: var(--color-danger, #ef4444);
    font-size: var(--fs-082);
}

.whatif-staged {
    margin: var(--space-md) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.whatif-empty {
    text-align: center;
    color: var(--color-text-muted);
    font-style: italic;
    padding: var(--space-md);
    font-size: var(--fs-088);
}

.whatif-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: var(--fs-088);
    flex-wrap: wrap;
}
.whatif-row.was-played {
    background: var(--color-hover);
}

.whatif-row-player {
    font-weight: 600;
    min-width: 80px;
}
.whatif-vs-small {
    color: var(--color-text-muted);
    font-size: var(--fs-078);
}

.whatif-played-badge,
.whatif-unplayed-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    font-size: var(--fs-068);
    font-weight: 700;
    letter-spacing: 0.5px;
}
.whatif-played-badge {
    background: rgba(34,197,94,0.15);
    color: var(--color-success, #22c55e);
}
.whatif-unplayed-badge {
    background: rgba(148,163,184,0.15);
    color: var(--color-text-muted);
}

.whatif-result-group {
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
}
.whatif-res {
    padding: 3px 10px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: var(--fs-078);
    font-weight: 600;
}
.whatif-res:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.whatif-res:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.whatif-res:hover { color: var(--color-text); }
.whatif-res.active {
    background: var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
}

.whatif-warn {
    color: var(--color-warning, #f59e0b);
    font-size: var(--fs-100);
}

.whatif-del {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: var(--fs-120);
    cursor: pointer;
    padding: 0 6px;
}
.whatif-del:hover { color: var(--color-danger, #ef4444); }

.whatif-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
}

.whatif-output {
    position: relative;
    margin-top: var(--space-lg);
    padding: var(--space-md);
    border: 2px dashed var(--color-accent);
    border-radius: var(--radius-md);
    background: var(--color-surface);
}

.whatif-ribbon {
    display: inline-block;
    margin-bottom: var(--space-sm);
    padding: 3px 10px;
    background: var(--color-accent);
    color: var(--color-bg);
    border-radius: var(--radius-sm);
    font-size: var(--fs-072);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.whatif-moe {
    font-size: var(--fs-082);
    color: var(--color-text-muted);
    margin-bottom: var(--space-sm);
    font-style: italic;
}

.whatif-table {
    font-style: italic;
}
.whatif-table thead th {
    white-space: nowrap;
}

/* The 45deg hatch keeps px stripes intentionally — pure decorative texture
   should not scale with font (would create moiré at fractional pixels). */
.whatif-pct-bar {
    position: relative;
    background:
        linear-gradient(to right, var(--bar-color, var(--color-success)) var(--pct, 0%), transparent var(--pct, 0%)),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 4px,
            rgba(255,255,255,0.06) 4px,
            rgba(255,255,255,0.06) 8px
        );
    border-radius: var(--radius-sm);
    padding: 0.15em 0.45em;
    font-weight: 600;
    font-size: inherit;
    text-align: left;
    min-width: 3em;
    font-style: italic;
}

.whatif-expand-btn {
    display: block;
    margin: var(--space-sm) auto var(--space-xl);
    padding: 0.3em 1.1em;
    font-size: var(--fs-085);
    font-family: var(--font-main);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    cursor: pointer;
    transition: background 0.15s;
}
.whatif-expand-btn:hover {
    background: var(--color-hover);
}

/* ── Mobile: compact predictor & what-if bar padding (no min-width — iron rule 1) ──────── */
@media (max-width: 640px) {
    .predictor-pct-bar {
        padding: 0.15em 0.3em;
    }

    .whatif-pct-bar {
        padding: 0.1em 0.2em;
    }
}


/* --- Scroll wrappers — sticky # and Player columns (all league types, mobile + desktop) --- */
.predictor-scroll-wrap,
.whatif-scroll-wrap {
    --col1-w: 36px; /* fallback replaced by JS (iron rule 12) */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    box-shadow: var(--shadow-sm);
}
.predictor-scroll-wrap table,
.whatif-scroll-wrap table {
    table-layout: auto;
}
.predictor-scroll-wrap tbody td:nth-child(1),
.whatif-scroll-wrap tbody td:nth-child(1) {
    position: sticky;
    left: 0;
    background: var(--color-surface);
    z-index: 3;
}
.predictor-scroll-wrap tbody td:nth-child(2),
.whatif-scroll-wrap tbody td:nth-child(2) {
    position: sticky;
    left: var(--col1-w);
    background: var(--color-surface);
    z-index: 2;
}
/* Sticky header cells — use header background so sticky header row matches the rest of the thead */
.predictor-scroll-wrap thead th:nth-child(1),
.whatif-scroll-wrap thead th:nth-child(1) {
    position: sticky;
    left: 0;
    background: var(--header-bg);
    z-index: 4;
}
.predictor-scroll-wrap thead th:nth-child(2),
.whatif-scroll-wrap thead th:nth-child(2) {
    position: sticky;
    left: var(--col1-w);
    background: var(--header-bg);
    z-index: 3;
    box-shadow: inset 0 -1px 0 var(--color-border);
}

/* B3/B4 sticky col-2 boundary drop-shadow — Google-style, appears only on scroll */
.predictor-scroll-wrap.is-scrolled-x thead th:nth-child(2),
.whatif-scroll-wrap.is-scrolled-x thead th:nth-child(2) {
    box-shadow: inset 0 -1px 0 var(--color-border), 6px 0 8px -4px rgba(0, 0, 0, 0.18);
}
.predictor-scroll-wrap.is-scrolled-x tbody td:nth-child(2),
.whatif-scroll-wrap.is-scrolled-x tbody td:nth-child(2) {
    box-shadow: inset 0 -1px 0 var(--color-border), 6px 0 8px -4px rgba(0, 0, 0, 0.18);
}
.predictor-scroll-wrap.is-scrolled-x tbody tr:last-child td:nth-child(2),
.whatif-scroll-wrap.is-scrolled-x tbody tr:last-child td:nth-child(2) {
    box-shadow: 6px 0 8px -4px rgba(0, 0, 0, 0.18);
}

/* B3/B4 sticky cell hover override (sticky bg has higher specificity than .dash-table tr:hover td) */
.predictor-scroll-wrap tbody tr:hover td:nth-child(1),
.predictor-scroll-wrap tbody tr:hover td:nth-child(2),
.whatif-scroll-wrap tbody tr:hover td:nth-child(1),
.whatif-scroll-wrap tbody tr:hover td:nth-child(2) {
    background: var(--color-hover);
}

/* --- B5: Rounds table — Player A (sticky) | Player B (sticky) | Score | PR A | PR B | Luck A | Luck B | Date --- */
/* --col1-w and --col2-w are written by JS after render (iron rule 12) */
.rounds-scroll-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: var(--shadow-sm);
}
.rounds-scroll-wrap table {
    table-layout: auto;
}
/* Player A — sticky col 1 */
.rounds-scroll-wrap tbody td:nth-child(1) {
    position: sticky;
    left: 0;
    background: var(--color-surface);
    z-index: 3;
}
.rounds-scroll-wrap thead th:nth-child(1) {
    position: sticky;
    left: 0;
    background: var(--header-bg);
    z-index: 4;
}
/* Player B — sticky col 2 */
.rounds-scroll-wrap tbody td:nth-child(2) {
    position: sticky;
    left: var(--col1-w);
    background: var(--color-surface);
    z-index: 3;
}
.rounds-scroll-wrap thead th:nth-child(2) {
    position: sticky;
    left: var(--col1-w);
    background: var(--header-bg);
    z-index: 4;
    box-shadow: inset 0 -1px 0 var(--color-border);
}

/* B5 sticky col-2 boundary drop-shadow — Google-style, appears only on scroll */
.rounds-scroll-wrap.is-scrolled-x thead th:nth-child(2) {
    box-shadow: inset 0 -1px 0 var(--color-border), 6px 0 8px -4px rgba(0, 0, 0, 0.18);
}
.rounds-scroll-wrap.is-scrolled-x tbody td:nth-child(2) {
    box-shadow: inset 0 -1px 0 var(--color-border), 6px 0 8px -4px rgba(0, 0, 0, 0.18);
}
.rounds-scroll-wrap.is-scrolled-x tbody tr:last-child td:nth-child(2) {
    box-shadow: 6px 0 8px -4px rgba(0, 0, 0, 0.18);
}

/* B5 sticky cell hover override (sticky bg has higher specificity than .dash-table tr:hover td) */
.rounds-scroll-wrap tbody tr:hover td:nth-child(1),
.rounds-scroll-wrap tbody tr:hover td:nth-child(2) {
    background: var(--color-hover);
}

/* B5 unplayed row — sticky cells must match the row tint (iron rule 11) */
.rounds-scroll-wrap tbody tr.unplayed-row td:nth-child(1),
.rounds-scroll-wrap tbody tr.unplayed-row td:nth-child(2) {
    background: var(--color-unplayed-bg);
}

/* ── B6 Remaining Matches sub-tabs (B6a / B6b / B6c) ──── */
.rem-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-sm);
}

.rem-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-accent);
    font-family: var(--font-main);
    font-size: var(--fs-085);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}
.rem-tab-btn:hover {
    background: var(--color-hover);
    border-color: var(--color-accent);
}
.rem-tab-btn--open {
    background: var(--color-accent);
    color: var(--color-bg);
    border-color: var(--color-accent);
}
.rem-tab-btn--open:hover {
    background: var(--color-text);
    border-color: var(--color-text);
}
.rem-tab-arrow {
    font-size: 0.75em;
}

.rem-tab-panel {
    margin-top: var(--space-sm);
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* B6a — All Remaining */
.rem-b6a-wrap {
    width: 80%;
    margin: 0 auto;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
}

/* B6b — Remaining Report */
.rem-b6b-wrap {
    width: 60%;
    margin: 0 auto;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    background: var(--color-surface);
}
.rem-b6b-wrap .player-remaining-table {
    margin-top: 0;
}

/* B6c — Per Player */
.rem-b6c-outer {
    display: flex;
    justify-content: center;
}
.rem-b6c-content {
    width: 60%;
}
.rem-b6c-wrap {
    width: 100%;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    background: var(--color-surface);
}
.rem-b6c-search-row {
    margin-bottom: var(--space-sm);
}
.rem-b6c-input {
    width: 100%;
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: var(--fs-090);
    font-family: var(--font-main);
    box-sizing: border-box;
}
.rem-b6c-input:focus {
    outline: none;
    border-color: var(--color-accent);
}
.rem-b6c-header {
    margin-bottom: var(--space-xs);
    font-size: var(--fs-088);
    color: var(--color-text-muted);
}
.rem-b6c-player-name {
    font-weight: 700;
    color: var(--color-text);
}
.rem-b6c-rem-count {
    color: var(--color-accent);
}
.rem-b6c-export-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--space-xs);
}
.rem-b6c-table {
    width: 100%;
}

/* Shared remaining table */
.player-remaining-table {
    margin-top: var(--space-sm);
}

.player-remaining-divider td {
    padding: 4px 12px !important;
    border-top: 2px dashed var(--color-border) !important;
    border-bottom: none !important;
    font-size: var(--fs-075);
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
    background: transparent !important;
}
.player-remaining-divider--bold td {
    font-weight: 700 !important;
    color: var(--color-text) !important;
}



/* ── Platform credit footer ──────────────────────────────────────────── */
.platform-credit {
    margin-top: 56px;
    padding: 10px 0 14px;
    text-align: center;
    font-size: var(--fs-060);
    font-weight: 300;
    letter-spacing: 0.12em;
    color: color-mix(in srgb, var(--color-bg) 93%, var(--color-text) 7%);
    user-select: none;
    pointer-events: none;
}
