/* ============================================================
   Rotowizards — Rankings / Projections Table (dark theme)
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.rw-rankings-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ── League selection bar ────────────────────────────────── */
.rw-league-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    min-height: 40px;
}

/* .rw-league-bar-label removed — the shared .rw-league-picker has its own
   "LEAGUE" label built in. The format badge below still applies. */

.rw-league-bar-format {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 6px;
    background: var(--rw-surface, #111827);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.12));
    color: var(--rw-text-muted, #9CA3AF);
    white-space: nowrap;
}

.rw-league-fmt-ppr      { color: #0ABFBC; border-color: rgba(10,191,188,0.3);   background: rgba(10,191,188,0.08); }
.rw-league-fmt-half_ppr { color: #C084FC; border-color: rgba(192,132,252,0.3);  background: rgba(192,132,252,0.08); }
.rw-league-fmt-std      { color: #FBBF24; border-color: rgba(251,191,36,0.3);   background: rgba(251,191,36,0.08); }
.rw-league-fmt-custom   { color: #2EE8A0; border-color: rgba(46,232,160,0.3);   background: rgba(46,232,160,0.08); }

/* ── Projections gate ────────────────────────────────────── */
.rw-projections-gate[hidden] { display: none; }

.rw-projections-gate {
    padding: 60px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rw-gate-card {
    background: var(--rw-card, #1F2937);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.1));
    border-radius: 20px;
    padding: 48px 40px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,0.3);
}

.rw-gate-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    line-height: 1;
}

.rw-gate-title {
    font-family: 'Barlow', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--rw-text, #F9FAFB);
    margin: 0 0 12px;
}

.rw-gate-desc {
    font-size: 0.9rem;
    color: var(--rw-text-muted, #9CA3AF);
    line-height: 1.6;
    margin: 0 0 28px;
}

.rw-gate-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.rw-gate-btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 10px;
    font-family: 'Barlow', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.rw-gate-btn-primary {
    background: var(--rw-gradient, linear-gradient(135deg, #0D9488, #7C3AED));
    color: #fff;
    box-shadow: 0 4px 16px rgba(124,58,237,0.3);
}

.rw-gate-btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 6px 20px rgba(124,58,237,0.4);
    color: #fff;
    text-decoration: none;
}

.rw-gate-btn-secondary {
    background: transparent;
    color: var(--rw-text, #F9FAFB);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.2));
}

.rw-gate-btn-secondary:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.3);
    color: var(--rw-text, #F9FAFB);
    text-decoration: none;
}

.rw-gate-picker {
    margin-top: 8px;
}

/* Inside the gate, give the shared picker some breathing room so it reads
   as the main interactive element on the gate card. */
.rw-gate-picker .rw-league-picker {
    width: 100%;
    max-width: 360px;
}
.rw-gate-picker .rw-league-picker-select {
    flex: 1;
}

/* ── Display limits bar ──────────────────────────────────── */
.rw-display-limits {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--rw-card, #1F2937);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.08));
    border-radius: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.rw-display-limits-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--rw-text-muted, #9CA3AF);
    white-space: nowrap;
}

.rw-display-limits-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.rw-limit-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.rw-limit-group select {
    background: var(--rw-surface, #111827);
    color: var(--rw-text, #F9FAFB);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.12));
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s;
}

.rw-limit-group select:focus {
    outline: none;
    border-color: var(--rw-teal, #0ABFBC);
}

/* Position-colored labels */
.rw-limit-qb  { color: #FF6B6B; }
.rw-limit-rb  { color: #2EE8A0; }
.rw-limit-wr  { color: #C084FC; }
.rw-limit-te  { color: #FBBF24; }
.rw-limit-k   { color: #CBD5E1; }
.rw-limit-def { color: #22D3EE; }

/* ── Filters bar ─────────────────────────────────────────── */
.rw-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 20px;
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--rw-card, #1F2937);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.08));
    border-radius: 12px;
}

.rw-filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rw-text-muted, #9CA3AF);
    white-space: nowrap;
}

.rw-filters select {
    background: var(--rw-surface, #111827);
    color: var(--rw-text, #F9FAFB);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.12));
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.2s;
}

.rw-filters select:focus {
    outline: none;
    border-color: var(--rw-teal, #0ABFBC);
}

.rw-last-updated {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--rw-text-muted, #9CA3AF);
}

/* ── Week / ROS selector ─────────────────────────────────── */
.rw-week-selector-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--rw-text, #F9FAFB);
    white-space: nowrap;
}

.rw-week-selector {
    background: var(--rw-surface, #111827);
    color: var(--rw-text, #F9FAFB);
    border: 1px solid var(--rw-teal, #0ABFBC);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rw-week-selector:focus {
    outline: none;
    border-color: var(--rw-teal, #0ABFBC);
    box-shadow: 0 0 0 2px rgba(10,191,188,0.2);
}

/* ── Table ───────────────────────────────────────────────── */
table.rw-table {
    width: 100% !important;
    min-width: 1159px;          /* fixed cols (934px) + player (225px) — wrapper overflow-x:auto scrolls on narrow screens */
    table-layout: fixed;        /* lock column widths — never resize based on content */
    border-collapse: collapse;
    font-size: 0.875rem;
    color: var(--rw-text, #F9FAFB);
}

/* Fixed widths for every column except Player (col 3), which fills remaining space.
   Order: Rank | POS Rank | Player | Pos | Team | Status | Proj Pts |
          Pass Yds | Pass TD | Pass INT | Rush Yds | Rush TD | Rec | Rec Yds | Rec TD | Targets */
table.rw-table thead th:nth-child(1)  { width: 42px;  } /* Rank       */
table.rw-table thead th:nth-child(2)  { width: 60px;  } /* POS Rank   */
table.rw-table thead th:nth-child(3)  { width: 225px; } /* Player */
table.rw-table thead th:nth-child(4)  { width: 48px;  } /* Pos        */
table.rw-table thead th:nth-child(5)  { width: 54px;  } /* Team       */
table.rw-table thead th:nth-child(6)  { width: 82px;  } /* Status     */
table.rw-table thead th:nth-child(7)  { width: 74px;  } /* Proj Pts   */
table.rw-table thead th:nth-child(8)  { width: 70px;  } /* Pass Yds   */
table.rw-table thead th:nth-child(9)  { width: 62px;  } /* Pass TD    */
table.rw-table thead th:nth-child(10) { width: 68px;  } /* Pass INT   */
table.rw-table thead th:nth-child(11) { width: 70px;  } /* Rush Yds   */
table.rw-table thead th:nth-child(12) { width: 62px;  } /* Rush TD    */
table.rw-table thead th:nth-child(13) { width: 48px;  } /* Rec        */
table.rw-table thead th:nth-child(14) { width: 70px;  } /* Rec Yds    */
table.rw-table thead th:nth-child(15) { width: 62px;  } /* Rec TD     */
table.rw-table thead th:nth-child(16) { width: 62px;  } /* Targets    */

table.rw-table thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

table.rw-table thead th {
    background: var(--rw-surface, #111827);
    color: var(--rw-text-muted, #9CA3AF);
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 5px 8px;
    border: none;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
    transition: color 0.15s;
}

table.rw-table thead th:first-child {
    border-left: 3px solid var(--rw-teal, #0ABFBC);
    padding-left: 14px;
}

/* ── Rank & POS Rank columns ─────────────────────────────── */
td.rw-overall-rank {
    width: 36px;
    min-width: 36px;
    color: var(--rw-text-muted, #9CA3AF);
    font-size: 0.78rem;
    font-weight: 700;
    text-align: center;
}

td.rw-pos-rank {
    width: 56px;
    min-width: 56px;
    text-align: center;
}

td.rw-pos-rank {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--rw-text-muted, #9CA3AF);
    letter-spacing: 0.04em;
}

table.rw-table thead th:hover {
    color: var(--rw-text, #F9FAFB);
}

table.rw-table tbody tr {
    background: var(--rw-card, #1F2937);
    transition: background 0.15s;
}

table.rw-table tbody tr.rw-row-alt {
    background: var(--rw-surface, #111827);
}

table.rw-table tbody tr:hover {
    background: rgba(10, 191, 188, 0.08);
}

table.rw-table tbody td {
    padding: 0 8px;
    height: 16px;
    max-height: 16px;
    border-bottom: 1px solid var(--rw-border, rgba(255,255,255,0.06));
    vertical-align: middle;
    font-size: 0.82rem;
}

/* ── Player name ─────────────────────────────────────────── */
.rw-player-name {
    font-weight: 600;
    color: var(--rw-text, #F9FAFB);
    white-space: nowrap;
    overflow: hidden;           /* required for ellipsis with table-layout: fixed */
    max-width: 0;               /* lets table-layout:fixed govern the actual width */
}

/* ── Position badges ─────────────────────────────────────── */
.rw-pos {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: center;
    min-width: 30px;
    background: var(--rw-surface, #111827);
    color: var(--rw-text-muted, #9CA3AF);
}

.rw-pos-qb  { background: rgba(239,68,68,0.28);   color: #FF6B6B; border: 1px solid rgba(239,68,68,0.5); }
.rw-pos-rb  { background: rgba(16,185,129,0.28);  color: #2EE8A0; border: 1px solid rgba(16,185,129,0.5); }
.rw-pos-wr  { background: rgba(139,92,246,0.28);  color: #C084FC; border: 1px solid rgba(139,92,246,0.5); }
.rw-pos-te  { background: rgba(245,158,11,0.28);  color: #FBBF24; border: 1px solid rgba(245,158,11,0.5); }
.rw-pos-k   { background: rgba(148,163,184,0.22); color: #CBD5E1; border: 1px solid rgba(148,163,184,0.4); }
.rw-pos-def { background: rgba(6,182,212,0.28);   color: #22D3EE; border: 1px solid rgba(6,182,212,0.5); }

/* ── Points column ───────────────────────────────────────── */
.rw-pts {
    font-weight: 700;
    color: var(--rw-teal, #0ABFBC);
}

/* ── Status / injury ─────────────────────────────────────── */
.rw-injured {
    color: #F87171;
    font-weight: 600;
}

/* ── No data message ─────────────────────────────────────── */
.rw-no-data {
    padding: 40px 20px;
    text-align: center;
    color: var(--rw-text-muted, #9CA3AF);
    background: var(--rw-card, #1F2937);
    border-radius: 12px;
    border: 1px solid var(--rw-border, rgba(255,255,255,0.08));
}

.rw-no-data a {
    color: var(--rw-teal, #0ABFBC);
    text-decoration: underline;
}

/* ── Player name button ──────────────────────────────────── */
.rw-player-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--rw-text, #F9FAFB);
    cursor: pointer;
    text-align: left;
    text-decoration: underline;
    text-decoration-color: rgba(10,191,188,0.4);
    text-underline-offset: 3px;
    transition: color 0.2s, text-decoration-color 0.2s;
    white-space: nowrap;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.rw-player-btn:hover {
    color: var(--rw-teal, #0ABFBC);
    text-decoration-color: var(--rw-teal, #0ABFBC);
}

/* ── Modal overlay ───────────────────────────────────────── */
.rw-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.rw-modal-overlay.rw-modal-visible {
    display: flex;
}

body.rw-modal-open { overflow: hidden; }

/* ── Modal card ──────────────────────────────────────────── */
.rw-modal {
    background: var(--rw-card, #1F2937);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.1));
    border-radius: 20px;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,0.6);
    animation: rw-modal-in 0.2s ease;
}

/* v2 redesign — wider, hero photo + helmet, stat cards, tabbed body */
.rw-modal-v2 {
    max-width: 680px;
    --team-color: #0ABFBC;
}

/* ── Hero band ───────────────────────────────────────────── */
.rw-modal-hero {
    display: grid;
    grid-template-columns: 96px 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 24px 28px 22px;
    background:
        linear-gradient(135deg,
            color-mix(in srgb, var(--team-color) 55%, transparent) 0%,
            color-mix(in srgb, var(--team-color) 20%, transparent) 45%,
            transparent 85%),
        var(--rw-card, #1F2937);
    border-bottom: 1px solid var(--rw-border, rgba(255,255,255,0.08));
    border-radius: 20px 20px 0 0;
    position: relative;
}
.rw-modal-photo-wrap {
    position: relative;
    width: 96px;
    height: 96px;
}
.rw-modal-photo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top center;
    background: color-mix(in srgb, var(--team-color) 25%, #111827);
    border: 3px solid var(--team-color);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
.rw-modal-helmet {
    position: absolute;
    bottom: -4px;
    right: -6px;
    width: 36px;
    height: 36px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
    background: rgba(0,0,0,0.0);
}
.rw-modal-photo[src=""],
.rw-modal-helmet[src=""] { visibility: hidden; }

/* TABLED: helmet-replaces-photo styling (see the TABLED block in player-modal.js).
.rw-modal-photo.rw-modal-photo--helmet {
    background: transparent;
    border: none;
    box-shadow: none;
    object-fit: contain;
    padding: 4px;
}
*/

.rw-modal-hero-info { min-width: 0; }
.rw-modal-hero-info .rw-modal-name {
    margin: 0 0 6px;
    font-size: 1.55rem;
    font-weight: 900;
    color: var(--rw-text, #F9FAFB);
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rw-modal-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--rw-text-muted, #9CA3AF);
}
.rw-modal-hero-meta .rw-modal-pos-badge {
    padding: 4px 10px;
    font-size: 0.7rem;
}
.rw-modal-bio {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.78rem;
    color: var(--rw-text-muted, #9CA3AF);
}
.rw-modal-bio li { white-space: nowrap; }
.rw-modal-bio li strong {
    color: var(--rw-text, #E5E7EB);
    font-weight: 700;
    margin-right: 4px;
}

.rw-modal-hero-status {
    display: flex;
    align-items: flex-start;
}
.rw-modal-status {
    padding: 5px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    background: rgba(52,211,153,0.12);
    color: #34D399;
    border: 1px solid rgba(52,211,153,0.3);
    text-transform: uppercase;
}
.rw-modal-status.rw-injured {
    background: rgba(248,113,113,0.12);
    color: #F87171;
    border-color: rgba(248,113,113,0.3);
}

/* ── Stat cards row ──────────────────────────────────────── */
.rw-modal-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding: 18px 28px;
    background: var(--rw-surface, #111827);
    border-bottom: 1px solid var(--rw-border, rgba(255,255,255,0.08));
}
@media (max-width: 600px) {
    .rw-modal-cards { grid-template-columns: repeat(3, 1fr); }
}
.rw-modal-card {
    background: var(--rw-card, #1F2937);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.06));
    border-radius: 10px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}
.rw-modal-card-label {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rw-text-muted, #9CA3AF);
}
.rw-modal-card-val {
    font-family: 'Barlow', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--rw-text, #F9FAFB);
    line-height: 1.1;
}
.rw-modal-card-val-teal { color: var(--rw-teal, #0ABFBC); }
.rw-modal-card-sub {
    font-size: 0.66rem;
    color: var(--rw-text-muted, #6B7280);
}

/* ── Next game banner ────────────────────────────────────── */
.rw-modal-next-game {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 28px;
    background: color-mix(in srgb, var(--team-color) 8%, transparent);
    border-bottom: 1px solid var(--rw-border, rgba(255,255,255,0.06));
    font-size: 0.85rem;
}
.rw-modal-next-game-label {
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rw-text-muted, #9CA3AF);
}
.rw-modal-next-game-body {
    color: var(--rw-text, #F9FAFB);
    font-weight: 600;
}

/* ── Tab nav ─────────────────────────────────────────────── */
.rw-modal-tabs {
    display: flex;
    gap: 4px;
    padding: 0 28px;
    border-bottom: 1px solid var(--rw-border, rgba(255,255,255,0.08));
    background: var(--rw-card, #1F2937);
}
.rw-modal-tab {
    background: none;
    border: none;
    color: var(--rw-text-muted, #9CA3AF);
    font-family: 'Barlow', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 14px 18px 12px;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.rw-modal-tab:hover { color: var(--rw-text, #F9FAFB); }
.rw-modal-tab-active {
    color: var(--rw-teal, #0ABFBC);
    border-bottom-color: var(--rw-teal, #0ABFBC);
}

.rw-modal-tab-body {
    padding: 20px 28px 28px;
}

/* Recent form mini cards */
.rw-modal-form-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.rw-modal-form-card {
    background: var(--rw-surface, #111827);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.06));
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rw-modal-form-label {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rw-text-muted, #9CA3AF);
}
.rw-modal-form-val {
    font-family: 'Barlow', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--rw-text, #F9FAFB);
}
.rw-modal-form-year {
    font-weight: 600;
    color: var(--rw-text-muted, #9CA3AF);
    margin-left: 6px;
    text-transform: none;
    letter-spacing: 0;
}
.rw-modal-form-note {
    font-weight: 500;
    color: var(--rw-text-muted, #6B7280);
    margin-left: 4px;
    text-transform: none;
    letter-spacing: 0;
}

/* Game log table */
.rw-modal-gamelog {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
}
.rw-modal-gamelog th {
    text-align: left;
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--rw-text-muted, #9CA3AF);
    padding: 8px 10px;
    border-bottom: 1px solid var(--rw-border, rgba(255,255,255,0.08));
}
.rw-modal-gamelog td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--rw-text, #E5E7EB);
}
.rw-modal-gamelog .rw-mgl-result-w { color: #34D399; font-weight: 700; }
.rw-modal-gamelog .rw-mgl-result-l { color: #F87171; font-weight: 700; }
.rw-modal-gamelog .rw-mgl-result-t { color: #FBBF24; font-weight: 700; }
.rw-modal-gamelog .rw-mgl-fpts { font-weight: 700; color: #F9FAFB; text-align: right; }
/* Per-game performance vs. season average:
   green when the player went ≥ 20% above their avg/game, red when they
   came in ≥ 20% below, neutral within ±20%. Coloring is skipped when avg
   is ~0 so a player with no production doesn't have every week look the
   same shade. */
.rw-modal-gamelog .rw-mgl-fpts-good { color: #34D399; }
.rw-modal-gamelog .rw-mgl-fpts-bad  { color: #F87171; }

.rw-modal-loading {
    text-align: center;
    color: var(--rw-text-muted, #9CA3AF);
    font-size: 0.85rem;
    padding: 24px 0;
}
.rw-modal-empty {
    text-align: center;
    color: var(--rw-text-muted, #9CA3AF);
    font-size: 0.85rem;
    padding: 16px 0;
    margin: 0;
}

.rw-modal-stat-sub {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rw-text-muted, #9CA3AF);
    margin: 0 0 6px;
}

@keyframes rw-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.rw-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10; /* sit above the hero photo, which is also positioned */
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.28);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
    color: #fff; /* solid white × — readable on the dark/photo hero */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.rw-modal-close:hover,
.rw-modal-close:focus-visible {
    background: rgba(0,0,0,0.78);
    color: #fff;
}

/* ── Modal header ────────────────────────────────────────── */
.rw-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 28px 20px;
    border-bottom: 1px solid var(--rw-border, rgba(255,255,255,0.08));
}

.rw-modal-pos-badge {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 6px 12px;
    border-radius: 8px;
    flex-shrink: 0;
}

.rw-modal-name {
    font-family: 'Barlow', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--rw-text, #F9FAFB);
    margin: 0 0 4px;
    line-height: 1.2;
}

.rw-modal-team {
    font-size: 0.85rem;
    color: var(--rw-text-muted, #9CA3AF);
    margin: 0;
}

.rw-modal-status {
    margin-left: auto;
    font-size: 0.78rem;
    font-weight: 700;
    color: #34D399;
    flex-shrink: 0;
}

.rw-modal-status.rw-injured { color: #F87171; }

/* ── Scoring row ─────────────────────────────────────────── */
.rw-modal-scoring {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: var(--rw-border, rgba(255,255,255,0.08));
    border-bottom: 1px solid var(--rw-border, rgba(255,255,255,0.08));
}

.rw-modal-score-block {
    background: var(--rw-surface, #111827);
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rw-modal-score-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rw-text-muted, #9CA3AF);
}

.rw-modal-score-val {
    font-family: 'Barlow', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--rw-teal, #0ABFBC);
}

/* ── Stat groups ─────────────────────────────────────────── */
.rw-modal-stats {
    padding: 20px 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rw-modal-stat-heading {
    font-family: 'Barlow', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rw-text-muted, #9CA3AF);
    margin: 0 0 10px;
}

.rw-modal-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--rw-border, rgba(255,255,255,0.05));
    font-size: 0.9rem;
}

.rw-modal-stat-row span { color: var(--rw-text-muted, #9CA3AF); }
.rw-modal-stat-row strong { color: var(--rw-text, #F9FAFB); font-weight: 700; }

/* ── Injury flag (in table) ──────────────────────────────── */
.rw-injury-flag {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.75rem;
    color: #F59E0B;
    vertical-align: middle;
    cursor: pointer;
    line-height: 1;
}

/* ── Injury notes (in modal) ─────────────────────────────── */
.rw-modal-injury {
    margin: 0 28px 4px;
    padding: 12px 16px;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 8px;
}

.rw-modal-injury .rw-modal-stat-heading {
    color: #F59E0B;
    margin-bottom: 6px;
}

.rw-modal-injury-notes {
    font-size: 0.9rem;
    color: var(--rw-text, #F9FAFB);
    line-height: 1.6;
    margin: 0;
}

/* ── News dot indicator (player name cell) ───────────────── */
.rw-news-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0ABFBC;
    margin-left: 5px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Modal — FantasyNerds news items ─────────────────────── */
.rw-fn-news-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 18px;
}

.rw-fn-news-item {
    padding: 12px 14px;
    background: var(--rw-surface, #111827);
    border: 1px solid var(--rw-border, rgba(255,255,255,0.08));
    border-radius: 8px;
}

.rw-fn-news-headline {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0ABFBC;
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 5px;
}
.rw-fn-news-headline:hover { text-decoration: underline; }

.rw-fn-news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--rw-text-muted, #6B7280);
    margin-bottom: 6px;
}

.rw-fn-news-excerpt {
    font-size: 0.78rem;
    color: var(--rw-text-muted, #9CA3AF);
    line-height: 1.5;
    margin: 0;
}

/* ── Modal news links ────────────────────────────────────── */
.rw-modal-news {
    padding: 0 28px 28px;
    border-top: 1px solid var(--rw-border, rgba(255,255,255,0.08));
    padding-top: 20px;
    margin-top: 4px;
}

.rw-modal-news-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 12px;
}

.rw-modal-news-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid var(--rw-border, rgba(255,255,255,0.1));
    background: var(--rw-surface, #111827);
    color: var(--rw-text-muted, #9CA3AF);
    transition: all 0.2s;
}

.rw-modal-news-btn:hover { color: #fff; border-color: transparent; }

.rw-news-google:hover    { background: #1a73e8; }
.rw-news-twitter:hover   { background: #000; }
.rw-news-espn:hover      { background: #cc0000; }
.rw-news-rotoballer:hover { background: linear-gradient(135deg, #0D9488, #7C3AED); }

/* ── DataTables overrides (dark theme) ───────────────────── */

/* Wrapper — DataTables always adds this div */
.dataTables_wrapper {
    color: var(--rw-text, #F9FAFB);
}

/* Sortable column header arrows */
table.dataTable thead .sorting::after,
table.dataTable thead .sorting_asc::after,
table.dataTable thead .sorting_desc::after {
    display: inline-block;
    margin-left: 4px;
    font-size: 0.7em;
    vertical-align: middle;
    line-height: 1;
}

/* Unsorted: faint double-arrow hint */
table.dataTable thead .sorting::after {
    content: '↕';
    opacity: 0.3;
    color: var(--rw-text-muted, #9CA3AF);
}

/* Active sort: teal directional arrow */
table.dataTable thead .sorting_asc::after {
    content: '↑';
    color: var(--rw-teal, #0ABFBC);
    opacity: 1;
}
table.dataTable thead .sorting_desc::after {
    content: '↓';
    color: var(--rw-teal, #0ABFBC);
    opacity: 1;
}

/* Highlight header of active sort column */
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    color: var(--rw-text, #F9FAFB);
}

/* Subtle column highlight on active sort cells */
table.rw-table tbody td.sorting_1 {
    background: rgba(10, 191, 188, 0.04);
}

/* Remove DataTables default border */
table.dataTable.no-footer {
    border-bottom: none;
}

/* ── Team / league selector ──────────────────────────────── */
/* Container wrapper for legacy selectorId targets. The picker itself uses
   the shared .rw-league-picker classes (style.css); .rw-team-sel-prompt
   below is still emitted by RWScoring's renderLegacySelector for the
   "not logged in" / "no teams" fallback states, so it stays. */
.rw-team-selector,
#rw-league-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rw-team-sel-prompt {
    font-size: 0.8rem;
    color: var(--rw-text-muted, #9CA3AF);
    font-style: italic;
}

.rw-team-sel-prompt a {
    color: var(--rw-accent, #0ABFBC);
    text-decoration: none;
}

.rw-team-sel-prompt a:hover {
    text-decoration: underline;
}

/* ============================================================
   Single Sheet print view (rankings page)
   ============================================================ */

/* ── Position colours (shared with cheat sheet) ─────────── */
.rw-cs-pos-qb,  .rw-cs-pos-QB  { background: rgba(239,68,68,0.28);   color: #FF6B6B; border: 1px solid rgba(239,68,68,0.5); }
.rw-cs-pos-rb,  .rw-cs-pos-RB  { background: rgba(16,185,129,0.28);  color: #2EE8A0; border: 1px solid rgba(16,185,129,0.5); }
.rw-cs-pos-wr,  .rw-cs-pos-WR  { background: rgba(139,92,246,0.28);  color: #C084FC; border: 1px solid rgba(139,92,246,0.5); }
.rw-cs-pos-te,  .rw-cs-pos-TE  { background: rgba(245,158,11,0.28);  color: #FBBF24; border: 1px solid rgba(245,158,11,0.5); }
.rw-cs-pos-k,   .rw-cs-pos-K   { background: rgba(148,163,184,0.22); color: #CBD5E1; border: 1px solid rgba(148,163,184,0.4); }
.rw-cs-pos-def, .rw-cs-pos-DEF { background: rgba(6,182,212,0.28);   color: #22D3EE; border: 1px solid rgba(6,182,212,0.5); }

/* ── Grid ────────────────────────────────────────────────── */
.rw-cs-pv-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0 6px;
    padding: 10px 14px;
    align-items: start;
}

.rw-cs-pv-col { min-width: 0; }

/* ── Column header ───────────────────────────────────────── */
.rw-cs-pv-col-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    border-radius: 4px 4px 0 0;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.rw-cs-pv-col-hd-all {
    background: rgba(255,255,255,0.07);
    color: #F9FAFB;
    border: 1px solid rgba(255,255,255,0.14);
}

.rw-cs-pv-col-count {
    font-weight: 500;
    opacity: 0.75;
    font-size: 0.6rem;
}

/* ── Rows ────────────────────────────────────────────────── */
.rw-cs-pv-row {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 4px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    min-width: 0;
}

.rw-cs-pv-row:nth-child(even) { background: rgba(255,255,255,0.02); }

.rw-cs-pv-out   { background: rgba(239,68,68,0.1)   !important; }
.rw-cs-pv-doubt { background: rgba(251,146,60,0.1)  !important; }
.rw-cs-pv-q     { background: rgba(250,204,21,0.07) !important; }

/* rank / pos rank */
.rw-cs-pv-pr {
    flex-shrink: 0;
    width: 26px;
    font-size: 0.68rem;
    color: #0D9488;
    font-weight: 600;
}

/* position badge in ALL column */
.rw-cs-pv-pos-badge {
    font-size: 0.5rem;
    font-weight: 800;
    padding: 1px 3px;
    border-radius: 3px;
    letter-spacing: 0.03em;
    width: 26px;
    text-align: center;
    flex-shrink: 0;
}

/* player name */
.rw-cs-pv-nm {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.63rem;
    font-weight: 500;
    color: #F9FAFB;
}

/* team */
.rw-cs-pv-tm {
    flex-shrink: 0;
    width: 22px;
    font-size: 0.55rem;
    color: rgba(249,250,251,0.4);
    text-align: right;
}

/* pts */
.rw-cs-pv-pt {
    flex-shrink: 0;
    width: 32px;
    font-size: 0.68rem;
    font-weight: 700;
    text-align: right;
    background: linear-gradient(135deg, #0D9488, #7C3AED);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rw-cs-pv-empty {
    padding: 8px 4px;
    color: rgba(249,250,251,0.25);
    font-size: 0.7rem;
    text-align: center;
    margin: 0;
}

/* expand button */
.rw-cs-pv-expand-btn {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 5px 0;
    background: none;
    border: 1px dashed rgba(255,255,255,0.2);
    border-radius: 4px;
    color: var(--rw-text-muted, #9CA3AF);
    font-size: 0.72rem;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, color 0.15s;
}

.rw-cs-pv-expand-btn:hover {
    border-color: var(--rw-accent, #0ABFBC);
    color: var(--rw-accent, #0ABFBC);
}

/* ── Print media ─────────────────────────────────────────── */
@media print {
    .rw-page-hero,
    .rw-view-toggle-bar,
    #rw-main-table-inner,
    .rw-pv-actions,
    .rw-projections-section.rw-section-alt { display: none !important; }

    #rw-pv-wrap { display: block !important; padding: 0; }

    .rw-cs-pv-grid { padding: 4px 0; gap: 0 4px; }

    .rw-cs-pv-col-hd {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .rw-cs-pv-row         { border-bottom: 1px solid #eee; background: #fff !important; }
    .rw-cs-pv-row:nth-child(even) { background: #f9f9f9 !important; }
    .rw-cs-pv-out         { background: #fde8e8 !important; }
    .rw-cs-pv-doubt       { background: #fef0e6 !important; }
    .rw-cs-pv-q           { background: #fefce8 !important; }

    .rw-cs-pv-nm { color: #111; }
    .rw-cs-pv-pr { color: #888; }
    .rw-cs-pv-tm { color: #666; }
    .rw-cs-pv-pt {
        background: none;
        -webkit-text-fill-color: #0D6E6E;
        color: #0D6E6E;
    }
}
