/* The matchup page's filter panel (BETA: feature matchup_filter_dock;
   scripts/matchup-filter-dock.js). The look is the Player Stats filter rail's
   (styles/player-props-dfs.css, .psb-*), under its own names so neither page
   changes the other. */

/* ---- The rows ---- */
.mfd-rail { margin: 0 0 10px; }
.mfd-rail-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px; }
.mfd-rail-title { font-size: 0.85rem; font-weight: 700; color: var(--tmb-gray-900); }
html.mfd-docked .mfd-rail-title { display: none; }
#mfd-rail .mfd-clear {
    padding: 2px 9px; font-size: 0.72rem; line-height: 1.3; color: var(--tmb-gray-700); cursor: pointer;
    background: var(--tmb-surface) !important; border: 1px solid var(--tmb-gray-300); border-radius: 6px;
}
#mfd-rail .mfd-clear:hover:not(:disabled) { border-color: var(--tmb-switch-on); color: var(--tmb-gray-900); }
#mfd-rail .mfd-clear:disabled { opacity: 0.45; cursor: default; }

/* A row, its label, its segmented choice and the Games slider are
   filter-panel.css (.tmb-fr-*, TMB.filterRows); here only this panel's own. */
.mfd-frow-in { margin: 8px 0 0; }
.mfd-frow-in > .mfd-flabel { flex: 0 0 auto; }

/* The bar's controls the rows drive are hidden; anything else (Coming off,
   the injury pills) stays. */
.mfd-bar .mfd-mapped, .mfd-bar .filter-item--empty { display: none !important; }
.mfd-bar .filter-row:not(:has(.filter-item:not(.mfd-mapped):not(.filter-item--empty))) { display: none !important; }
.mfd-bar { border: none !important; background: none !important; padding: 0 !important; box-shadow: none !important; }

/* ---- The panel's frame is filter-panel.css (TMB.filterPanel); here only what it holds ---- */
.mfd-dock .gl-filters-note { display: none; }

/* "Coming off" (staff) in the panel: a section of its own, always open, in
   place of the pill and its pop-out (Zach, 2026-11-22). Its chips apply at
   once here (no Apply button: matchup-comp-stats.js, instant()); Clear stays. */
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .filter-row:has(.co-item) { display: block !important; margin: 4px 0 0; }
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-item { width: 100%; max-width: 100%; padding: 0 !important; }
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-bar { padding: 10px 0 0; border-top: 1px solid var(--tmb-gray-300); }
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-bar::before {
    content: 'Coming off'; display: block; margin-bottom: 6px;
    font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--tmb-gray-600);
}
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-pill { display: none !important; }
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-panel, :is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-panel[hidden] {
    display: block !important; position: static !important; width: auto !important;
    padding: 0; border: none; box-shadow: none; background: none;
}
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-cols { grid-template-columns: minmax(0, 1fr); gap: 10px; }
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-col { padding: 8px; background: var(--tmb-gray-100); border: 1px solid var(--tmb-gray-300); border-radius: 8px; }
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-apply { display: none !important; }
:is(#mfd-dock, #mfd-sheet, #mfd-ftbar) .co-hint { flex-basis: 100%; }
/* ---- Phone: the Filters pill on the breadcrumb line (the sheet is filter-panel.css) ---- */
#mfd-m-filters { display: none; }
html.mfd-phone #mfd-m-filters { display: inline-flex; flex: 0 0 auto; margin-left: auto; }
html.mfd-phone .mfd-rail-title { display: none; }
#mfd-sheet .gl-filters-note { display: none; }

/* The Games slider (matchup-filter-dock.js; Zach, 2026-11-24) */

/* A wider panel lays the filters side by side (Zach, 2026-11-24: "if someone
   stretches the panel wider the filters will go onto the same line"). The
   panel's body is the container, so this follows the dragged width. Each row
   keeps its label over its choice; the head and the Similar / Ranked panel
   take a line of their own. */
.mfd-dock .mfd-dock-body { container-type: inline-size; container-name: mfddock; }
@container mfddock (min-width: 440px) {
    #mfd-rail { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 18px; }
    #mfd-rail > .mfd-rail-head, #mfd-rail > .tmb-op, #mfd-rail > .mfd-sub { flex: 0 0 100%; }
    #mfd-rail > .mfd-frow { flex: 0 0 auto; max-width: 100%; }
    #mfd-rail > .mfd-frow-games { flex: 1 1 260px; }
}

/* ---- The bar across the top (feature filter_top_bar; the frame is
   filter-panel.css, .tmb-ft-*): here only what this page's pop-outs hold ---- */
#mfd-ftbar .mfd-rail, #mfd-ftbar .mfd-bar, #mfd-ftbar .mfd-bar .filter-row { margin: 0; }
#mfd-ftbar .gl-filters-host { min-height: 0; }
#mfd-ftbar .co-bar { padding-top: 0; border-top: 0; }
#mfd-ftbar .tmb-op { margin-top: 0; }
#mfd-ftbar [id^="filters-"] { padding: 0; margin: 0; border: 0; }

/* A phone, the website (Zach, 2026-12-02: as the app; matchup-filter-dock.js
   phoneBar()): the sticky bar opens with the dark green teams-and-lines line,
   then the sport, the game and the date as dropdowns on one line, then Filters
   (with "My page" beside it where there is one). The page's wrappers are
   flattened so the controls are the bar's own items. No Customize, Tour or
   crumb here; the app draws its own bar. ":is(..., #tmb-x)" carries an id's
   weight: layout-matchup.css styles #betting-header's divs and controls. */
/* Wider than a phone both stay out: the green line is filter-panel.css's
   .tmb-ft-mini, which is display: flex everywhere. */
.tmb-sport-bar :is(.mfd-m-sport, .mfd-m-info) { display: none !important; }
@media (max-width: 767px) {
    html.mfd-mbar .tmb-sport-bar .mfd-m-info:not([hidden]) { display: flex !important; }
    html.mfd-mbar .content-wrapper .tmb-sport-bar { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px 6px; padding-top: 10px !important; margin-top: -60px !important; }
    html.mfd-mbar .content-wrapper .tmb-sport-bar:has(> .mfd-m-info:not([hidden])) { padding-top: 0 !important; }
    html.mfd-mbar .content-wrapper .tmb-sport-bar :is(.row, .row > [class*="col-"], .row .d-flex, .mdb-toolbar-controls) { display: contents !important; }
    html.mfd-mbar .content-wrapper .tmb-sport-bar > *,
    html.mfd-mbar .content-wrapper .tmb-sport-bar :is(.row .d-flex, .mdb-toolbar-controls) > * { order: 9; margin: 0 !important; }
    html.mfd-mbar .tmb-sport-bar :is(.mfd-m-info, #tmb-x) { order: -1 !important; position: relative; flex: 0 0 auto; width: 100vw !important; margin: 0 calc(50% - 50vw) 2px !important; padding: 8px 15px; gap: 2px 14px; font-size: 0.8rem; }
    html.mfd-mbar .tmb-sport-bar .mfd-m-info[hidden] { display: none !important; }
    html.mfd-mbar .tmb-sport-bar .mfd-m-info .tmb-ft-mini-t { flex: 0 0 100%; }
    html.mfd-mbar .tmb-sport-bar .mfd-m-info .tmb-ft-mini-r { position: absolute; right: 15px; top: 8px; line-height: 22px; }
    html.mfd-mbar .tmb-sport-bar :is(.tmb-nav-breadcrumb, .matchup-tour-btn, #mdb-customize-link) { display: none !important; }
    html.mfd-mbar .tmb-sport-bar :is(.mfd-m-sport, #tmb-x) {
        display: block !important; order: 1 !important; flex: 0 0 84px; height: 30px !important; min-height: 30px; padding: 0 22px 0 12px !important;
        font-size: 12px !important; line-height: 28px !important; border-radius: 999px !important; box-sizing: border-box;
    }
    html.mfd-mbar .tmb-sport-bar :is(.matchup-search, .mdb-game-search, #tmb-x) { order: 2 !important; flex: 1 1 0 !important; min-width: 0 !important; max-width: none !important; width: auto !important; }
    html.mfd-mbar .tmb-sport-bar :is(.matchup-search, .mdb-game-search, #tmb-x) select { width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
    html.mfd-mbar .tmb-sport-bar :is(#datePicker, #week-selector, #mdb-date-input, #tmb-x) { order: 3 !important; flex: 0 0 118px !important; width: 118px !important; }
    html.mfd-mbar .tmb-sport-bar :is(#mfd-m-filters, #tmb-x) { order: 4 !important; flex: 1 1 60% !important; justify-content: center; margin: 0 !important; }
    html.mfd-mbar .tmb-sport-bar .matchup-customize-btn { order: 4 !important; flex: 0 0 auto; }
    html.mfd-mbar .tmb-sport-bar .tmb-fp-mchips { order: 5 !important; margin-top: 0 !important; }
}
