/* ==========================================================================
   Research pages: /picks, /props, /record, /how-it-works and the Research
   tab on the game page. Mobile-first; everything wide scrolls inside
   .rs-table-wrap, never the page.
   ========================================================================== */

.rs-page {
    max-width: 1200px;
    margin: 20px auto 0;
    padding: 0 16px;
}

.rs-hero {
    margin-bottom: 16px;
}

.rs-hero h1 {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--text-primary);
}

.rs-hero p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

.rs-updated {
    font-size: 12px;
    color: #888;
}

/* Body links (zero specificity, so tabs and buttons keep their own colours) */
:where(.rs-page, .rs-panel) a {
    color: var(--primary-blue);
    text-decoration: none;
}

:where(.rs-page, .rs-panel) a:hover { text-decoration: underline; }

.rs-muted { color: #888; }
.rs-nowrap { white-space: nowrap; }
.rs-sub { font-size: 11px; color: #888; font-weight: 400; line-height: 1.4; }
.rs-small { font-size: 12px; }

/* --- Cards / sections ---------------------------------------------------- */
.rs-card,
.rs-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rs-section {
    padding: 16px;
    margin-bottom: 16px;
    min-width: 0;
}

.rs-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.3;
}

.rs-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.rs-section p + p { margin-top: 10px; }

.rs-note {
    font-size: 12px;
    color: #777;
    margin-top: 10px;
}

.rs-empty {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 36px 20px;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.rs-empty strong {
    display: block;
    color: var(--text-primary);
    font-size: 16px;
    margin-bottom: 4px;
}

.rs-two {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}

.rs-two > * { min-width: 0; }

/* A .rs-two holding whole sections: the grid gap does the spacing */
.rs-stack { margin-bottom: 16px; }
.rs-stack > .rs-section { margin-bottom: 0; }

/* --- Tabs (sports, dates, markets) ---------------------------------------- */
.rs-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px 2px 6px;
    margin-bottom: 10px;
    scrollbar-width: thin;
}

.rs-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--border-gray);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s, border-color 0.2s;
}

.rs-tab:hover {
    border-color: var(--primary-blue);
    text-decoration: none;
}

.rs-tab.active {
    background: var(--primary-blue);
    border-color: var(--primary-blue);
    color: #fff;
    font-weight: 600;
}

.rs-tab-count {
    font-size: 11px;
    font-weight: 600;
    background: rgba(64, 81, 181, 0.1);
    color: var(--primary-blue);
    border-radius: 999px;
    padding: 1px 7px;
}

.rs-tab.active .rs-tab-count {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.rs-tab-off {
    color: #999;
    background: #fafafa;
    border-style: dashed;
    cursor: default;
}

.rs-tab-off:hover { border-color: var(--border-gray); }

.rs-tabs-sm .rs-tab {
    padding: 6px 12px;
    font-size: 13px;
}

/* --- Method / backtest box --------------------------------------------- */
.rs-method {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-left: 4px solid var(--primary-blue);
    padding: 14px 16px;
    margin-bottom: 16px;
}

.rs-method-name {
    font-weight: 700;
    font-size: 15px;
}

.rs-method-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.rs-tiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.rs-tile {
    background: #f6f7fc;
    border-radius: 8px;
    padding: 8px 10px;
    min-width: 0;
}

.rs-tile-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.rs-tile-value {
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.rs-tile-sub {
    font-size: 12px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.rs-pos { color: #1e7e34; }
.rs-neg { color: #c62828; }

/* --- Game cards ------------------------------------------------------------ */
.rs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.rs-game-card {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.rs-game-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.rs-venue {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.rs-matchup {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rs-team-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.rs-team-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rs-team-name .rs-sub { margin-left: 4px; }

.rs-team-score {
    flex: 0 0 auto;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-size: 15px;
    font-weight: 700;
}

.rs-team-score .rs-sub { display: block; }

.rs-abbr {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 28px;
    padding: 0 6px;
    border-radius: 6px;
    background: #eef0fa;
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.rs-line-cells {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    background: #f6f7fc;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.rs-line-cells > div { min-width: 0; }

.rs-line-cells span {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.rs-line-book { margin-top: 3px; }

.rs-proj-line {
    font-size: 13px;
    color: var(--text-secondary);
}

.rs-proj-line strong { color: var(--text-primary); }

/* Pick rows */
.rs-picks {
    border-top: 1px solid #eee;
}

.rs-picks-head {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) auto;
    gap: 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #999;
    padding: 6px 0 2px;
}

.rs-picks-head > :last-child { text-align: right; }

.rs-pick-row {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.rs-pick-row:last-child { border-bottom: 0; }

.rs-pick-best {
    background: #fffaf0;
    box-shadow: -14px 0 0 #fffaf0, 14px 0 0 #fffaf0;
}

.rs-pick-market {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.rs-pick-main {
    min-width: 0;
    font-size: 14px;
}

.rs-pick-sel {
    font-weight: 600;
}

.rs-price {
    font-variant-numeric: tabular-nums;
    color: var(--text-secondary);
    font-size: 13px;
}

.rs-pick-meta {
    text-align: right;
    white-space: nowrap;
}

.rs-prob {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    font-size: 14px;
}

.rs-stars {
    color: #f5a623;
    letter-spacing: 1px;
    font-size: 13px;
    white-space: nowrap;
}

.rs-stars-off { color: #dcdcdc; }

.rs-best {
    display: inline-block;
    vertical-align: 1px;
    margin-left: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #fff1cc;
    border: 1px solid #f5c451;
    color: #8a5a00;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.rs-likely {
    background: #eef7f0;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
}

.rs-likely-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #1e7e34;
    margin-right: 4px;
}

.rs-writeup {
    font-size: 13px;
    color: #444;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rs-card-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    align-self: flex-start;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
}

.rs-card-link:hover { text-decoration: underline; }

/* Status + results */
.rs-status {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.rs-status-time { color: var(--text-primary); }

.rs-status-final {
    background: #eee;
    color: #555;
    border-radius: 999px;
    padding: 2px 8px;
}

.rs-status-live {
    color: #d32f2f;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rs-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d32f2f;
    animation: rs-pulse 1.4s ease-in-out infinite;
}

@keyframes rs-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

.rs-status-detail {
    font-size: 12px;
    color: var(--text-secondary);
}

.rs-result {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: 1px;
}

.rs-result-win { background: #e6f4ea; color: #1e7e34; }
.rs-result-loss { background: #fdecea; color: #c62828; }
.rs-result-push { background: #eee; color: #555; }

/* --- Tables ---------------------------------------------------------------- */
.rs-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.rs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rs-table th {
    background: #f6f7fc;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    padding: 9px 10px;
    white-space: nowrap;
}

.rs-table td {
    padding: 9px 10px;
    border-top: 1px solid #eee;
    vertical-align: top;
}

.rs-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rs-table tbody tr:hover td { background: #fafbff; }

.rs-props-table { min-width: 860px; }
.rs-wide-table { min-width: 620px; }

.rs-player { min-width: 150px; }

/* Phones: tighter cells, and the player column stays put while the
   props table scrolls sideways */
@media (max-width: 639px) {
    .rs-table th,
    .rs-table td { padding: 8px 7px; }

    .rs-props-table .rs-player {
        position: sticky;
        left: 0;
        z-index: 1;
        background: #fff;
        min-width: 130px;
        max-width: 150px;
        box-shadow: 1px 0 0 #eee;
    }

    .rs-props-table thead th:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        background: #f6f7fc;
    }
}

.rs-pick-side { font-weight: 700; }
.rs-pick-over { color: #1e7e34; }
.rs-pick-under { color: #c62828; }

/* --- Market filter ---------------------------------------------------- */
.rs-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 4px 0 6px;
}

/* --- Game page Research tab ------------------------------------------------ */
.rs-panel { margin-bottom: 20px; }

.rs-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.rs-summary > .rs-section { margin-bottom: 0; }

.rs-projscore {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 6px 0 12px;
}

.rs-projscore-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.rs-projscore-num {
    font-size: 30px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.rs-projscore-sep {
    color: #bbb;
    font-size: 22px;
}

.rs-probbar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #eee;
}

.rs-probbar-away { background: #a8b1e0; }
.rs-probbar-home { background: var(--primary-blue); }

.rs-probbar-legend {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-variant-numeric: tabular-nums;
}

.rs-kv {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 4px 12px;
    font-size: 13px;
    margin-top: 12px;
}

.rs-kv dt { color: var(--text-secondary); }
.rs-kv dd { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }

.rs-writeup-full {
    font-size: 15px;
    line-height: 1.65;
    color: #333;
}

.rs-factors {
    list-style: none;
}

.rs-factors li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 12px;
    padding: 10px 0;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.rs-factors li:first-child { border-top: 0; padding-top: 0; }

.rs-factor-label {
    font-weight: 600;
}

.rs-factor-impact {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.rs-factor-detail {
    grid-column: 1 / -1;
    color: var(--text-secondary);
    font-size: 13px;
}

.rs-favors {
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-blue);
    background: #eef0fa;
    border-radius: 999px;
    padding: 0 7px;
}

.rs-list {
    list-style: none;
    font-size: 13px;
}

.rs-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid #f0f0f0;
}

.rs-list li:first-child { border-top: 0; }

.rs-list-right {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.rs-inj-status {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.rs-inj-out { color: #c62828; }
.rs-inj-q { color: #b26a00; }

.rs-team-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

.rs-chips { display: inline-flex; gap: 3px; flex-wrap: wrap; }

.rs-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
}

.rs-chip-w { background: #e6f4ea; color: #1e7e34; }
.rs-chip-l { background: #fdecea; color: #c62828; }
.rs-chip-o { background: #eee; color: #666; }

.rs-goalie-name {
    font-weight: 700;
    font-size: 15px;
}

.rs-statgrid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
}

.rs-stat {
    background: #f6f7fc;
    border-radius: 6px;
    padding: 6px 8px;
    min-width: 0;
}

.rs-stat span {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.rs-stat strong {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* Histogram (simulation distribution) */
.rs-hist {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    padding-top: 6px;
}

.rs-hist-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.rs-hist-barwrap {
    height: 120px;
    display: flex;
    align-items: flex-end;
}

.rs-hist-bar {
    width: 100%;
    background: #c5cbe9;
    border-radius: 3px 3px 0 0;
}

.rs-hist-mark .rs-hist-bar { background: var(--primary-blue); }

.rs-hist-label {
    font-size: 10px;
    color: #888;
    text-align: center;
    height: 16px;
    line-height: 16px;
    white-space: nowrap;
    overflow: visible;
    font-variant-numeric: tabular-nums;
}

/* Game page tab bar with a third tab: keep it on one row on phones */
@media (max-width: 480px) {
    .game-tabs .game-tab {
        padding: 10px 4px;
        font-size: 13px;
    }

    .game-tabs .game-tab i { display: none; }
}

/* --- How it works -------------------------------------------------------- */
.rs-prose {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.rs-prose h2 { margin-top: 24px; }
.rs-prose h2:first-child { margin-top: 0; }

.rs-prose ul {
    padding-left: 20px;
    margin: 8px 0;
}

.rs-prose li { margin-bottom: 6px; }

.rs-bt-sport { margin-top: 18px; }
.rs-bt-sport:first-of-type { margin-top: 4px; }
.rs-mt { margin-top: 10px; }

.rs-callout {
    background: #fff8e6;
    border: 1px solid #f5d27a;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: #5f4300;
    margin-bottom: 16px;
}

/* --- Wider screens --------------------------------------------------------- */
@media (min-width: 640px) {
    .rs-page { padding: 0 20px; }
    .rs-hero h1 { font-size: 30px; }
    .rs-section { padding: 20px; }
    .rs-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .rs-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
    .rs-summary { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
}
