/*
 * Mobile fixes - loaded LAST on every page (base.html and the standalone auth/error
 * templates), so it wins over page CSS without !important where possible.
 *
 * Everything here came out of rendering the site at 320-430px with Playwright and
 * measuring: page-wide horizontal scroll, off-centre content, tap targets under ~32px,
 * and form fields under 16px (iOS zooms the page when one of those is focused).
 */

/* Media never wider than its container. */
img, video, iframe {
    max-width: 100%;
}

/* Tables that do not fit scroll inside their own box, never the whole page. */
.table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    /* Safety net: a single stray wide element must not give the whole page a
       sideways scroll. `clip` (unlike `hidden`) keeps position: sticky working. */
    html, body {
        overflow-x: clip;
    }

    /* Long team names, e-mails and URLs wrap instead of pushing the layout out. */
    body {
        overflow-wrap: break-word;
    }

    /* iOS Safari zooms into any field whose text is under 16px and does not zoom
       back out. Login, register, contact and the footer newsletter were 12-14px. */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="hidden"]),
    select,
    textarea {
        font-size: 16px !important;
    }

    /* Open mobile menu: fully opaque, otherwise the glowing hero headline shows
       through behind the menu items. */
    #menu.mobile-open {
        background-color: #08090d;
    }

    /* A field's intrinsic width grows with its font size, so the 16px rule above
       would widen the footer newsletter row past 320px. Let fields shrink instead. */
    .footer-columns > *,
    .newsletter-form > * {
        min-width: 0;
    }

    .newsletter-form input {
        width: 100%;
    }

    /* Home hero kept its desktop padding-right: 40px, so on a phone the text and both
       buttons sat 14px from the left edge and 54px from the right. */
    .hero-content {
        padding-right: 0 !important;
    }

    .hero-cta {
        justify-content: center;
    }

    /* Tap targets: enlarge the hit area without moving anything visually
       (padding grows the box, the equal negative margin cancels it in the layout). */
    .sp-crumbs a,
    .pg-hero .crumb a,
    .auth-forgot,
    .help-link,
    .back-link a,
    .sp-league-head a,
    #Footer .footer-column .nav-dropdown > .dropdown-toggle {
        display: inline-block;
        padding-top: 12px;
        padding-bottom: 12px;
        margin-top: -12px;
        margin-bottom: -12px;
    }

    /* Row links in the public fixture lists were 21px tall. */
    .sp-list li a {
        display: inline-block;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    /* Legal cookie table: 4 columns do not fit 320px - scroll inside .table-scroll. */
    .table-scroll > .cookie-table {
        min-width: 560px;
    }
}

/* ---------------------------------------------------------------------------
 * Dashboard match card
 *
 * Odds, headline pick and the BTTS / over-under chips shared ONE non-wrapping row.
 * On a phone the pick column was ~73px wide and the chips were pushed past the
 * card's right edge, where the card's overflow:hidden cut them off - the extra
 * markets were simply invisible on mobile. A legacy rule in dashboard.css also hid
 * .prediction-outcome on mobile, so a BTTS / O-U headline pick read as a bare "51%".
 * ------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .fc-card-bottom {
        flex-wrap: wrap;
        row-gap: 10px;
    }

    .fc-card-bottom .fc-card-odds {
        flex: 1 1 100%;
    }

    .fc-card-bottom .fc-card-odds .odds-row {
        justify-content: center;
    }

    .fc-card-bottom .fc-card-odds .odds-item {
        flex: 1 1 0;
        min-width: 0;
        padding: 6px 4px;
    }

    .fc-card-bottom .fc-card-prediction {
        flex: 1 1 100%;
    }

    .fc-card-bottom .match-card-prediction .prediction-result {
        flex-wrap: wrap;
        row-gap: 6px;
    }

    .fc-card-bottom .match-card-prediction .prediction-content {
        flex: 1 1 100%;
        min-width: 0;
    }

    .fc-card-bottom .match-card-prediction .prediction-outcome {
        display: inline;
        white-space: nowrap;
    }

    .fc-card-bottom .mkt-chip-row {
        flex: 1 1 100%;
        margin-top: 0;
    }
}

/* Team names: crest above the name and up to two lines, instead of
   "Słowa..." / "Kazac..." squeezed next to the crest. */
@media (max-width: 480px) {
    .fc-card-team,
    .fc-card-team.away {
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .fc-card-team-name {
        white-space: normal;
        overflow-wrap: anywhere;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        line-height: 1.25;
    }
}

/* ---------------------------------------------------------------------------
 * Logged-in pages (measured with a test account)
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* /agents: sections were width: min(96vw, ...) = 360px inside a 320px content
       box, so every section stuck out 20px on the right. */
    .agents-guide-section,
    .leaderboard-section,
    .todays-picks-section,
    .all-agents-section,
    .charts-section,
    .recent-predictions-section {
        width: auto;
        margin-left: 0;
        margin-right: 0;
    }

    /* /billing: a `1fr` track never shrinks below its content (~380px). */
    .billing-grid,
    .billing-stack {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    /* Invisible hit-area extension for controls that must stay visually small. */
    .bb-dot,
    .refresh-btn {
        position: relative;
    }

    .bb-dot::after,
    .refresh-btn::after {
        content: '';
        position: absolute;
        inset: -12px;
    }

    /* /playerbets date and sort buttons (29-30px). */
    .pb-date,
    .pb-sort button {
        min-height: 40px;
    }

    .pb-dates {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }

    /* /profile row buttons (32px). */
    .setting-row .btn-action {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Dashboard onboarding tour "Skip" (27px). */
    .rb-tour-skip {
        min-height: 40px;
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Inline text links that sit alone on a line. */
    .current-plan-note a,
    .player-name a {
        display: inline-block;
        padding-top: 10px;
        padding-bottom: 10px;
        margin-top: -10px;
        margin-bottom: -10px;
    }
}

/* ---------------------------------------------------------------------------
 * /history on a phone: one card per pick instead of an 800px-wide table.
 *
 * The table scrolled sideways inside its box, so a phone showed Date and Match
 * and nothing else - the pick, odds, result and hit/miss were all off to the right.
 * ------------------------------------------------------------------------- */
@media (max-width: 640px) {
    body.history-style-page #predictions-container .table-dark {
        min-width: 0 !important;
        width: 100%;
    }

    body.history-style-page #predictions-container .table-responsive,
    body.history-style-page #predictions-container {
        overflow-x: visible;
    }

    body.history-style-page #predictions-container thead {
        display: none;
    }

    body.history-style-page #predictions-container tbody,
    body.history-style-page #predictions-container table {
        display: block;
    }

    body.history-style-page #predictions-container tr.prediction-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "date   status"
            "match  match"
            "league league"
            "pick   odds"
            "conf   result";
        gap: 6px 12px;
        padding: 12px 14px;
        margin-bottom: 10px;
        border-bottom: 1px solid var(--rb-border-muted, rgba(255, 255, 255, 0.08));
    }

    body.history-style-page #predictions-container tr.prediction-row > td {
        display: block;
        width: auto !important;
        min-width: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        text-align: left;
        white-space: normal;
        background: transparent;
    }

    body.history-style-page #predictions-container .h-date   { grid-area: date; color: var(--rb-text-tertiary, #94a3b8); font-size: 0.8rem; }
    body.history-style-page #predictions-container .h-status { grid-area: status; }
    body.history-style-page #predictions-container .h-match  { grid-area: match; font-size: 0.95rem; }
    body.history-style-page #predictions-container .h-league { grid-area: league; color: var(--rb-text-tertiary, #94a3b8); font-size: 0.78rem; }
    body.history-style-page #predictions-container .h-pick   { grid-area: pick; }
    body.history-style-page #predictions-container .h-odds   { grid-area: odds; text-align: right; }
    body.history-style-page #predictions-container .h-conf   { grid-area: conf; }
    body.history-style-page #predictions-container .h-result { grid-area: result; text-align: right; }

    /* Small caption above the value, so the columns keep their meaning without a header. */
    body.history-style-page #predictions-container td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.65rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--rb-text-tertiary, #94a3b8);
        margin-bottom: 2px;
    }

    body.history-style-page #predictions-container .status-cell {
        flex-direction: row;
        justify-content: flex-end;
        min-width: 0;
    }

    body.history-style-page #predictions-container .prediction-badge {
        min-width: 0;
    }

    body.history-style-page #predictions-container .h-conf .confidence-bar {
        display: inline-block;
        vertical-align: middle;
        width: 60px;
        margin-right: 6px;
    }
}

@media (max-width: 640px) {
    /* Bootstrap's striped table paints every cell of odd rows (inset box-shadow),
       which turned each field of every other card into a grey tile. */
    body.history-style-page #predictions-container tr.prediction-row > td {
        box-shadow: none !important;
        --bs-table-accent-bg: transparent;
        --bs-table-bg-type: transparent;
    }

    /* "Home vs Away" on one line instead of a tall centred block. */
    /* dashboard.css forces .match-teams into a centred column with !important. */
    body.history-style-page #predictions-container .h-match .match-teams {
        display: block !important;
        text-align: left;
        min-height: 0 !important;
        height: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    body.history-style-page #predictions-container .h-match .match-teams strong {
        display: inline;
    }
}

/* 30.10.2026: the /playerbets fixed-layout table rule (v1 page) was removed here - the v3 page
   (templates/partials/playerbets_style.html) sizes its own tables; fixed 58px tracks made the
   name column overlap the line column. */

@media (max-width: 480px) {
    /* /bet-builder header: team names were cut to "Be..." / "M..." next to their crests. */
    .bb-versus .bb-team {
        flex: 1 1 0;
        min-width: 0;
        flex-direction: column;
        text-align: center;
        gap: 4px;
    }

    .bb-versus .bb-team-away {
        flex-direction: column-reverse;
    }

    .bb-card-top {
        padding: 18px 14px 16px;
    }

    .bb-versus {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        gap: 8px;
    }

    .bb-versus .bb-ai-ring {
        width: 60px;
        height: 60px;
    }

    /* League tag + kickoff: the tag no longer pushes the kickoff off the card. */
    .bb-match-strip {
        gap: 8px;
    }

    .bb-match-strip .bb-league-tag {
        flex: 1 1 auto;
        min-width: 0;
        padding: 6px 10px;
    }

    .bb-match-strip .bb-league-name {
        max-width: 100%;
    }

    .bb-match-strip .bb-kickoff {
        flex-shrink: 0;
    }

    .bb-versus .bb-team-name {
        font-size: 0.92rem;
        white-space: normal;
        overflow-wrap: break-word;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.25;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* /agents refresh icon was squeezed to 13px wide by its flex row. */
    .predictions-filters .refresh-btn {
        flex-shrink: 0;
        min-width: 40px;
    }
}

@media (max-width: 640px) {
    /* /results/predictions: League and Confidence are hidden on phones (template);
       the rest wraps so pick, result and status fit without sideways scrolling. */
    .table-responsive > .table td,
    .table-responsive > .table th {
        white-space: normal;
        padding-left: 6px;
        padding-right: 6px;
        font-size: 0.85rem;
    }

    .table-responsive > .table .badge {
        white-space: normal;
        text-align: left;
    }
}

@media (max-width: 640px) {
    .results-table {
        table-layout: fixed;
        width: 100%;
    }

    .results-table th:last-child,
    .results-table td:last-child {
        width: 34px;
        text-align: center;
    }

    .results-table .badge {
        white-space: normal !important;
        display: inline-block;
        max-width: 100%;
    }

    /* Visible columns on a phone: Date, Match, Prediction, Status (League, Confidence
       and Result are md+ only - the score is already under the match). */
    .results-table th:nth-child(1),
    .results-table td:nth-child(1) { width: 58px; }
    .results-table th:nth-child(4),
    .results-table td:nth-child(4) { width: 72px; }

    .results-table td,
    .results-table th {
        overflow-wrap: break-word;
    }
}

/* ---------------------------------------------------------------------------
 * /player-stats on a phone. Each tab's table is 5-9 columns (~820px), so the
 * numbers people come for were all off to the right. The player column now
 * sticks to the left while the stat columns scroll inside the table box.
 * ------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .stats-table th:nth-child(1),
    .stats-table td:nth-child(1) {
        display: none;
    }

    .stats-table th:nth-child(2),
    .stats-table td:nth-child(2) {
        position: sticky;
        left: 0;
        z-index: 1;
        background: rgb(19, 23, 34);
        max-width: 150px;
        box-shadow: 1px 0 0 rgba(255, 255, 255, 0.08);
    }

    .stats-table th,
    .stats-table td {
        padding: 8px 8px;
        font-size: 0.85rem;
    }

    .stats-table td:not(:nth-child(2)) {
        white-space: nowrap;
        text-align: center;
    }

    .stats-table .player-photo,
    .stats-table .player-avatar {
        width: 32px;
        height: 32px;
    }

    .stats-table .player-cell {
        gap: 8px;
    }

    .stats-table .player-name {
        white-space: normal;
        line-height: 1.2;
    }

    /* Team: crest only; the name is in the crest's alt/title. */
    .stats-table .team-cell span {
        display: none;
    }
}

@media (max-width: 640px) {
    /* Team column = crest only, so it can be narrow. */
    .stats-table th:nth-child(3),
    .stats-table td:nth-child(3) {
        width: 44px;
        min-width: 0 !important;
        max-width: 44px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .stats-table thead th:nth-child(3) {
        font-size: 0;            /* "DRUŻYNA" header would force the width back */
    }

    .stats-table .team-cell {
        justify-content: center;
        min-width: 0;
    }

    /* Overview: the position badge ("ATTACKER") is the widest cell and says the
       least - the numbers matter more on a phone. */
    .tab-content[data-tab="overview"] .stats-table th:nth-child(4),
    .tab-content[data-tab="overview"] .stats-table td:nth-child(4) {
        display: none;
    }

    .stats-table thead th {
        white-space: nowrap;
        font-size: 0.7rem;
    }
}

@media (max-width: 640px) {
    /* player-stats.css pins the table at min-width 620-760px; let it size to its
       columns - the wide tabs still scroll inside .table-container. */
    .stats-table {
        min-width: 0 !important;
    }

    .stats-table thead th {
        padding: 8px 6px !important;
        white-space: normal !important;
        letter-spacing: 0 !important;
        line-height: 1.15;
        vertical-align: bottom;
    }

    .stats-table th:nth-child(2),
    .stats-table td:nth-child(2) {
        max-width: 124px;
        width: 124px;
    }

    .stats-table .player-number {
        font-size: 0.72rem;
    }
}

@media (max-width: 640px) {
    /* The photo cost ~40px of the sticky column and names broke mid-word
       ("Fernánd-ez"); on a phone the name matters more. */
    .stats-table .player-photo,
    .stats-table .player-avatar {
        display: none;
    }

    .stats-table .player-name {
        overflow-wrap: normal;
        word-break: normal;
        hyphens: auto;
    }
}

/* ---------------------------------------------------------------------------
 * Landing "Co nas wyróżnia?" comparison on a phone: one card per criterion.
 * As a 4-column table the RobotBets column - the one with the live numbers -
 * sat off-screen to the right behind the two competitor columns.
 * ------------------------------------------------------------------------- */
@media (max-width: 640px) {
    .comparison-section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .comparison-table-wrapper {
        overflow-x: visible;
        background: transparent;
        padding: 0;
    }

    .comparison-table thead {
        display: none;
    }

    .comparison-table,
    .comparison-table tbody,
    .comparison-table tr,
    .comparison-table td {
        display: block;
        width: 100%;
        background: transparent;
    }

    .comparison-table tr {
        margin-bottom: 12px;
        padding: 14px 16px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: 10px;
        background: rgba(15, 23, 42, 0.6);
    }

    .comparison-table td {
        padding: 0 !important;
        border: 0 !important;
        text-align: left;
    }

    .comparison-table td.criteria-cell {
        font-weight: 700;
        font-size: 1rem;
        margin-bottom: 8px;
    }

    .comparison-table td[data-label] {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        gap: 12px;
        padding: 5px 0 !important;
        font-size: 0.9rem;
        text-align: right;
    }

    .comparison-table td[data-label]::before {
        content: attr(data-label);
        flex-shrink: 0;
        text-align: left;
        font-size: 0.78rem;
        opacity: 0.6;
    }

    .comparison-table td.highlight-column {
        margin-top: 6px;
        padding-top: 10px !important;
        border-top: 1px solid rgba(45, 212, 191, 0.3) !important;
        color: #2dd4bf;
        font-weight: 600;
    }

    .comparison-table td.highlight-column::before {
        color: #2dd4bf;
        opacity: 1;
        font-weight: 700;
    }

    .comparison-table td.highlight-column .comparison-note {
        display: block;
        font-weight: 400;
    }

    .comparison-table .checkmark-wrapper {
        justify-content: flex-end;
    }
}

@media (max-width: 640px) {
    /* The RobotBets cell mixes text and spans ("108 aktywnych", "Śr. 51,5 %"); as a
       flex row each piece was spread apart. Plain block, label floated left. */
    .comparison-table td.highlight-column[data-label] {
        display: block;
        text-align: right;
    }

    .comparison-table td.highlight-column[data-label]::before {
        float: left;
        margin-right: 12px;
    }

    .comparison-table td.highlight-column .comparison-note {
        clear: both;
        text-align: right;
        margin-top: 2px;
    }

    .comparison-table td,
    .comparison-table td.criteria-cell,
    .comparison-table td.highlight-column {
        background: transparent !important;
    }
}

/* ---------------------------------------------------------------------------
 * Dashboard on phones - audit 2026-10-25 (v3: compact card)
 *
 * Owner: "na telefonie wygląd dashboardu jest niewystarczający", then "overlaye na
 * siebie nachodzą, a drugie predykcje nie są w jednej linii, bo ta główna linijka
 * jest duża". Measured before: first pick 1135px (Premium) / 1472px (Free) below
 * the top, cards 330-376px tall, fixed ☰ and "?" over the last card.
 *
 * Phone card = three rows: crest·name·time·name·crest / 1 X 2 odds boxes with the
 * headline pick highlighted ("58%" under the odds) / every other market as one
 * horizontally scrollable line of chips. dashboard.js (rbPhoneDashboard) adds the
 * .rb-compact / .is-pick / .rb-chips bits on <=768px only; desktop (>768px) is
 * untouched by everything in this block.
 * ------------------------------------------------------------------------- */
@media (max-width: 768px) {
    /* --- Above the list ------------------------------------------------- */
    /* 30-day stats: 2x2 tiles (140px) -> one 44px bar that opens /history. */
    body.fc-layout-active .fc-content .perf-card {
        display: flex;
        align-items: stretch;
        min-height: 44px;
        margin-bottom: 8px;
        gap: 1px;
        cursor: pointer;
    }
    body.fc-layout-active .fc-content .perf-card__stat {
        flex: 1 1 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 4px 2px;
        text-align: center;
    }
    body.fc-layout-active .fc-content .perf-card__stat-value {
        font-size: 0.95rem;
        line-height: 1.1;
    }
    body.fc-layout-active .fc-content .perf-card__stat-label {
        font-size: 9px;
        line-height: 1.2;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* Charts collapsed behind a toggle (dashboard.js adds the button). */
    body.fc-layout-active .fc-content .perf-charts-row {
        display: none;
        margin-bottom: 8px;
    }
    body.fc-layout-active .fc-content .perf-charts-row.is-open { display: grid; }
    body.fc-layout-active .fc-content .perf-chart-panel__body,
    body.fc-layout-active .fc-content .perf-chart-panel__body--doughnut {
        height: 170px !important;
        max-height: 170px;
    }
    .rb-charts-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 40px;
        margin: 0 0 8px;
        padding: 0 12px;
        background: var(--rb-bg-surface, rgba(15, 23, 42, 0.4));
        border: 1px solid var(--rb-border, rgba(255, 255, 255, 0.1));
        color: var(--rb-text-secondary, #94a3b8);
        font-family: var(--font-mono, monospace);
        font-size: 0.72rem;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        cursor: pointer;
    }
    .rb-charts-toggle::after { content: "\25BE"; color: #2dd4bf; font-size: 0.9rem; }
    .rb-charts-toggle.is-open::after { content: "\25B4"; }

    /* Free-plan upgrade prompt: compact, left aligned, full-width button. */
    body.dashboard-style-page .fc-content .upgrade-prompt {
        padding: 10px 12px;
        margin-bottom: 8px;
        text-align: left;
        display: flex;
        flex-wrap: wrap;
        gap: 4px 10px;
    }
    body.dashboard-style-page .fc-content .upgrade-prompt h4 { flex: 1 1 100%; margin: 0; font-size: 0.9rem; }
    body.dashboard-style-page .fc-content .upgrade-prompt p { flex: 1 1 100%; margin: 0; font-size: 0.78rem; line-height: 1.35; }
    body.dashboard-style-page .fc-content .upgrade-prompt .btn {
        flex: 1 1 100%;
        min-height: 40px;
        margin-top: 4px;
        padding: 8px 14px;
        font-size: 0.78rem;
        text-align: center;
    }

    /* Date + filters: one horizontally scrollable strip of 40px chips. */
    body.fc-layout-active .fc-content .dashboard-controls {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 6px;
        padding: 6px 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    body.fc-layout-active .fc-content .dashboard-controls::-webkit-scrollbar { display: none; }
    body.fc-layout-active .fc-content .date-picker-group {
        display: flex;
        align-items: center;
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        margin: 0;
    }
    body.fc-layout-active .fc-content .date-picker-group label {
        position: absolute;
        width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    body.fc-layout-active .fc-content .date-input-shell { width: auto; min-width: 0; }
    body.fc-layout-active .fc-content .date-input-shell input[type="date"] {
        width: 150px;
        min-height: 40px;
        padding: 0 8px;
        font-size: 16px;
    }
    body.fc-layout-active .fc-content .match-filter-tabs {
        display: flex;
        flex: 0 0 auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 6px;
    }
    body.fc-layout-active .fc-content .match-filter-tabs .filter-tab {
        flex: 0 0 auto;
        min-height: 40px;
        padding: 0 12px;
        font-size: 0.78rem;
        white-space: nowrap;
        border: 1px solid var(--rb-border, rgba(255, 255, 255, 0.1));
        border-radius: 999px;
    }
    body.fc-layout-active .fc-content .match-filter-tabs .filter-tab.active {
        border-color: #2dd4bf;
        background: rgba(45, 212, 191, 0.1);
    }

    /* --- Compact card --------------------------------------------------- */
    /* Row 1: crest · name · time · name · crest (the <=480 rule stacked them). */
    .match-card.rb-compact { padding: 0 !important; }
    .match-card.rb-compact .fc-card-top { padding: 8px 10px !important; }
    .match-card.rb-compact .fc-card-teams { gap: 6px; align-items: center; }
    .match-card.rb-compact .fc-card-team,
    .match-card.rb-compact .fc-card-team.away {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        text-align: left;
        min-height: 40px;
    }
    .match-card.rb-compact .fc-card-team.away { flex-direction: row-reverse; text-align: right; }
    .match-card.rb-compact .fc-team-crest { width: 28px; height: 28px; flex: 0 0 28px; }
    .match-card.rb-compact .fc-team-crest img { width: 22px; height: 22px; }
    .match-card.rb-compact .fc-card-team-name {
        font-size: 13px !important;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        overflow-wrap: anywhere;
        white-space: normal;
    }
    .match-card.rb-compact .fc-card-center { min-width: 52px; max-width: 30%; gap: 2px; flex-shrink: 0; }
    .match-card.rb-compact .fc-card-time { font-size: 15px; }
    .match-card.rb-compact .fc-card-score { font-size: 16px; }
    .match-card.rb-compact .fc-card-venue { display: none; }
    .match-card.rb-compact .match-status-badge.status-ns { display: none; }
    .match-card.rb-compact .match-status-badge {
        font-size: 10px;
        padding: 1px 5px;
        letter-spacing: 0;
        white-space: nowrap;
    }
    .match-card.rb-compact .fc-card-pred-badge { top: auto; bottom: 6px; right: 8px; font-size: 10px; }

    /* Row 2: the three odds boxes; the headline 1X2 pick is the teal one. */
    .match-card.rb-compact .fc-card-bottom {
        padding: 8px 10px 8px !important;
        row-gap: 6px !important;
        flex-wrap: wrap;
    }
    .match-card.rb-compact .fc-card-odds { flex: 1 1 100%; }
    .match-card.rb-compact .fc-card-odds .odds-row { gap: 6px; }
    .match-card.rb-compact .fc-card-odds .odds-item {
        flex: 1 1 0;
        min-width: 0;
        min-height: 44px !important;
        padding: 4px 4px;
        justify-content: center;
        position: relative;
    }
    .match-card.rb-compact .fc-card-odds .odds-label { font-size: 11px !important; line-height: 1.1; }
    .match-card.rb-compact .fc-card-odds .odds-value { font-size: 14px; line-height: 1.2; }
    .match-card.rb-compact .fc-card-odds .odds-item.is-pick {
        border-color: #2dd4bf;
        background: rgba(45, 212, 191, 0.08);
    }
    .match-card.rb-compact .fc-card-odds .odds-item.is-pick .odds-label,
    .match-card.rb-compact .fc-card-odds .odds-item.is-pick .odds-value { color: #2dd4bf; }
    .match-card.rb-compact .rb-pick-pct {
        font-family: var(--font-mono, monospace);
        font-size: 11px;
        font-weight: 700;
        color: #2dd4bf;
        line-height: 1.1;
    }
    .match-card.rb-compact .odds-src { display: none; }

    /* The desktop pick tiles are replaced by the chips; the Free lock stays. */
    .match-card.rb-compact .fc-card-prediction .prediction-result:not(.locked-preview) { display: none; }
    .match-card.rb-compact .fc-card-prediction:not(:has(.locked-preview)):not(:has(.no-prediction)):not(:has(.prediction-loading)):not(:has(.prediction-placeholder)) {
        flex: 0 0 0;
        min-height: 0;
        padding: 0;
        margin: 0;
    }
    .match-card.rb-compact .fc-card-prediction { flex: 1 1 100%; }
    .match-card.rb-compact .fc-card-prediction:not(:has(.locked-preview)):not(:has(.no-prediction)):not(:has(.prediction-loading)):not(:has(.prediction-placeholder)) { display: none; }
    .match-card.rb-compact .match-card-prediction .prediction-result.locked-preview { min-height: 0; padding: 0; border: 0; background: transparent; }
    .match-card.rb-compact .match-card-prediction .prediction-lock-shell { padding: 6px 10px; min-height: 36px; display: flex; align-items: center; }
    .match-card.rb-compact .match-card-prediction .prediction-lock-badge { display: inline-flex; align-items: center; padding: 3px 8px; margin: 0; }
    .match-card.rb-compact .match-card-prediction .prediction-lock-bars { display: none; }
    .match-card.rb-compact .match-card-prediction .prediction-lock-copy { display: flex; flex-direction: row; align-items: center; gap: 8px; }
    .match-card.rb-compact .match-card-prediction .locked-preview > .prediction-label { display: none; }
    .match-card.rb-compact .match-card-prediction .prediction-lock-badge,
    .match-card.rb-compact .match-card-prediction .prediction-lock-text { font-size: 11px !important; }

    /* Row 3: every other market in ONE line, scrolling sideways, never wrapping. */
    .match-card.rb-compact .rb-chips {
        flex: 1 1 100%;
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 1px;
    }
    .match-card.rb-compact .rb-chips::-webkit-scrollbar { display: none; }
    .match-card.rb-compact .rb-chip {
        flex: 0 0 auto;
        display: inline-flex;
        align-items: center;
        gap: 5px;
        height: 30px;
        padding: 0 9px;
        border: 1px solid var(--rb-border, rgba(255, 255, 255, 0.12));
        border-left: 2px solid var(--pc, #64748b);
        background: rgba(255, 255, 255, 0.03);
        font-family: var(--font-mono, monospace);
        font-size: 11px;
        color: var(--rb-text-secondary, #94a3b8);
        white-space: nowrap;
    }
    .match-card.rb-compact .rb-chip .rb-chip-label { color: var(--rb-text-primary, #e2e8f0); }
    .match-card.rb-compact .rb-chip b { font-weight: 700; color: var(--rb-text-primary, #e2e8f0); }
    .match-card.rb-compact .rb-chip i { font-style: normal; color: var(--rb-text-tertiary, #64748b); }
    .match-card.rb-compact .rb-chip em { font-style: normal; font-weight: 700; }
    .match-card.rb-compact .rb-chip.hit em { color: #2dd4bf; }
    .match-card.rb-compact .rb-chip.miss em { color: #f87171; }
    .match-card.rb-compact .rb-chip.is-main {
        border-color: #2dd4bf;
        border-left-color: #2dd4bf;
        background: rgba(45, 212, 191, 0.08);
    }
    .match-card.rb-compact .rb-chip.is-main .rb-chip-label,
    .match-card.rb-compact .rb-chip.is-main b { color: #2dd4bf; }

    /* Superbet notice: once, under the whole list (the per-card line is hidden). */
    .rb-odds-notice {
        padding: 10px 12px 4px;
        font-family: var(--font-mono, monospace);
        font-size: 11px;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.55);
        text-align: center;
    }

    /* --- Fixed overlays --------------------------------------------------- */
    /* The list ends above the ☰ button instead of under it. */
    body.fc-layout-active .fc-content { padding-bottom: 76px; }
    /* "?" only for first-timers (server flag); done = gone. */
    body.rb-tour-done .rb-tour-launcher { display: none !important; }
    /* First-timers: a 32px ghost above the right edge, clear of ☰ (left) and the panel. */
    body.rb-phone .rb-tour-launcher {
        width: 32px;
        height: 32px;
        right: 12px;
        bottom: 26px;
        font-size: 0.9rem;
        opacity: 0.75;
    }
    body.fc-layout-active .fc-sidebar-toggle { bottom: 16px; left: 12px; }

    /* --- Match panel tap targets ----------------------------------------- */
    .fc-detail-panel .fc-detail-close { width: 40px; height: 40px; top: 6px; right: 6px; font-size: 20px; }
    .fc-detail-panel .fc-pl-tab { min-height: 36px; padding: 6px 12px; font-size: 12px; }
    .fc-detail-panel .fc-pl-name { font-size: 12px; }
    .fc-detail-panel .fc-lineup-player.is-clickable { min-height: 30px; display: flex; align-items: center; }

    /* --- /history: ~105px of empty space between the header and the title. */
    body.history-style-page #Content { padding-top: 0; }
    body.history-style-page section#dashboard { padding-top: 8px; }
    body.history-style-page .container.rb-page-shell { margin-top: 0; }
    body.history-style-page .dashboard-header.rb-page-header { margin-top: 0; padding-top: 18px; padding-bottom: 6px; }

    /* --- /playerbets: 9px bookmaker tag under the odds. */
    .pb-rung__src { font-size: 10px !important; }
}
