/* =============================================================================
   МОБИЛЬНАЯ ВЕРСИЯ ОСНОВНОЙ ТАБЛИЦЫ
   Подключается ПОСЛЕ css/style.css, поэтому при равной специфичности
   переопределяет её правила (в т.ч. старые медиа-блоки 560/768/860/1100px).

   Эталоны:
     img/example/мобилка.PNG   — таблица матчей на главной (карточки)
     img/example/мобилка1.PNG  — карточка выбранного события (рынки)

   Служебные узлы .mref-mhead / .mref-mleague / .mref-mstage создаёт
   js/mref-mobile.js; на десктопе они скрыты (см. правило ниже).
   ========================================================================== */

.mref-mhead,
.mref-mleague,
.mref-mstage { display: none; }

@media (max-width: 768px) {

/* ===========================================================================
   1. ТАБЛИЦА МАТЧЕЙ — карточки
   ========================================================================= */

.content-center > .matches-ref {
    padding: 2px 8px 10px;
    background: #eef1f5;
}

.mref-new {
    background: transparent;
    border-radius: 0;
}

/* шапка лиги с колонками рынков на телефоне не нужна —
   название лиги печатается внутри каждой карточки */
.mref-new .mref-lhd { display: none !important; }

/* ---------------------------------------------------------- сама карточка */

.mref-new .mref-row {
    display: block;
    height: auto;
    margin-bottom: 6px;
    border-top: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(24, 42, 66, .10);
    overflow: hidden;
}
.mref-new .mref-row:hover { background: #fff; }

.mref-new .mref-info {
    flex: none;
    width: auto;
    display: flex;
    flex-direction: column;
    padding: 0;
}

/* порядок блоков внутри карточки */
.mref-new .mref-status   { order: 1; }
.mref-new .mref-mleague  { order: 2; }
.mref-new .mref-team     { order: 3; }
.mref-new .mref-mstage   { order: 4; }

/* ---- 1. верхняя полоса: значок спорта, время/период, трансляция, «⋮» ---- */

.mref-new .mref-status {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 10px;
    border-bottom: 1px solid #e9eef3;
    font-size: 13px;
    color: #4a6481;
}
.mref-new .mref-status-txt { display: none; }

.mref-new .mref-mhead {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1;
    min-width: 0;
}
.mref-new .mref-mhead > i,
.mref-new .mref-mhead > .mref-lhd__icon {
    flex-shrink: 0;
    font-size: 14px;
    color: #7a93ae;
}
.mref-new .mref-mhead > b {
    font-weight: 400;
    font-size: 13px;
    color: #4a6481;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* из всех значков действий оставляем только «смотреть» */
.mref-new .mref-st-icons { flex-shrink: 0; gap: 0; }
.mref-new .mref-st-icons button { display: none; }
.mref-new .mref-st-icons button.mref-ic-play {
    display: flex;
    width: 30px;
    height: 21px;
    border-radius: 4px;
    background: #62a523;
    color: #fff;
    font-size: 10px;
}

/* стрелка под-игр на телефоне — «кебаб» в правом углу полосы */
.mref-new .mref-expand-btn {
    margin-left: 0;
    width: 24px;
    height: 26px;
    color: #8aa0b8;
    font-size: 15px;
}
.mref-new .mref-expand-btn::after,
.mref-new .mref-expand-btn::before { content: none; }
.mref-new .mref-expand-btn i::before { content: "\f142"; }
.mref-new .mref-row.is-expanded .mref-expand-btn {
    background: transparent;
    color: #3969a2;
}
.mref-new .mref-row.is-expanded .mref-expand-btn i { transform: none; }

/* ------------------------------- 2. лига / 3. команды / 4. стадия ------- */

.mref-new .mref-mleague {
    display: block;
    padding: 8px 10px 5px;
    font-size: 13px;
    color: #26405f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mref-new .mref-team {
    height: 26px;
    padding: 0 10px;
    gap: 9px;
}
.mref-new .mref-pin { display: none; }
.mref-new .mref-logo { flex-shrink: 0; }
.mref-new .mref-name {
    font-size: 14px;
    font-weight: 700;
    color: #23405f;
}
.mref-new .mref-scores { align-self: center; }
.mref-new .mref-scores span {
    width: auto;
    min-width: 12px;
    border: none !important;
    font-size: 14px;
    font-weight: 700;
    color: #23405f;
}
.mref-new .mref-scores span + span { display: none; }

.mref-new .mref-mstage {
    display: block;
    padding: 6px 10px 2px;
    font-size: 12px;
    line-height: 1.25;
    color: #3969a2;
}

/* ------------------------------------ 5. лента коэффициентов с подписями */

.mref-new .mref-odds {
    display: flex;
    align-items: stretch;
    gap: 4px;
    padding: 8px 10px 10px;
    grid-template-columns: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.mref-new .mref-odds::-webkit-scrollbar { height: 0; }

/* группы рынков растворяем — пилюли становятся прямыми детьми ленты */
.mref-new .mref-odds .mref-grp { display: contents; }
.mref-new .mref-odds .mref-line { display: none; }
.mref-new .mref-odds button.mref-odd.mref-dash { display: none; }

.mref-new button.mref-odd {
    flex: 0 0 auto;
    width: 76px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    padding: 0 4px;
    border-radius: 6px;
    background: #eef1f5;
    font-size: 13px;
    font-weight: 700;
    color: #26405f;
}
.mref-new button.mref-odd::before {
    content: attr(data-mlbl);
    max-width: 100%;
    font-size: 9px;
    font-weight: 400;
    line-height: 1.1;
    color: #8097ae;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mref-new button.mref-odd.mref-selected { background: #bfdcfd; }

.mref-new .mref-more {
    flex: 0 0 auto;
    align-self: center;
    height: 40px;
    padding: 0 8px;
    border-left: none;
    font-size: 12px;
}

/* ------------------------------------------------- строки под-игр (чевро) */

.mref-new .mref-subrow {
    display: block;
    height: auto;
    margin: 0 0 6px;
    border-top: none;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(24, 42, 66, .10);
    overflow: hidden;
}
.mref-new .mref-subrow__info {
    flex: none;
    width: auto;
    height: 34px;
    padding: 0 10px 0 14px;
    border-bottom: 1px solid #e9eef3;
}
.mref-new .mref-subrow__name { font-size: 13px; }


/* ===========================================================================
   2. КАРТОЧКА СОБЫТИЯ — выбранная игра (эталон «мобилка1»)
   ========================================================================= */

.mev {
    border-radius: 0;
    box-shadow: none;
}

/* ------------------------------------------- тёмная шапка со счётом ----- */

.mev .mev__top {
    height: auto;
    flex-direction: column;
}
/* панель статистики на телефоне не показываем — шапка остаётся компактной */
.mev .mev__stats { display: none; }

.mev .mev__banner {
    padding: 12px 12px 0;
    background:
        radial-gradient(ellipse 70% 130% at 30% 35%, rgba(74, 122, 173, .32), transparent 70%),
        linear-gradient(100deg, #16283f 0%, #24374d 45%, #16283f 100%);
}

/* порядок: счёт → табло/бейджи → лига → нижние кнопки */
.mev .mev__score       { order: 1; margin-top: 0; }
.mev .mev__banner-sep  { order: 2; margin-top: 8px; }
.mev .mev__periods     { order: 3; }
.mev .mev__banner-top  { order: 4; justify-content: center; padding: 4px 0 8px; }
.mev .mev__banner-foot { order: 5; }

.mev .mev__score-row { gap: 10px; }
.mev .mev__score-team { font-size: 14px; gap: 7px; }
.mev .mev__score-team img { width: 22px; height: 22px; }
.mev .mev__score-team i.mev__dot { width: 20px; height: 20px; }
.mev .mev__score-val {
    gap: 5px;
    padding: 3px 9px;
    border-radius: 5px;
    background: rgba(61, 118, 180, .55);
    font-size: 18px;
}
.mev .mev__score-time { font-size: 11px; }

/* бейджи (угловые / карточки) встают в строку рядом с табло периодов */
.mev .mev__periods {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 18px;
    padding-top: 10px;
}
.mev .mev__cards-badge {
    position: static;
    justify-content: center;
    gap: 12px;
}
.mev .mev__ptable > span { height: 22px; font-size: 11px; }
.mev .mev__pserve { display: none; }

/* верхняя строка переехала вниз: только название стадии, без погоды/арены */
.mev .mev__banner-top { font-size: 12px; }
.mev .mev__env { display: none; }
.mev .mev__banner-stage { justify-content: center; }

/* нижние кнопки шапки — компактной прокручиваемой лентой */
.mev .mev__banner-foot {
    height: 36px;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
}
.mev .mev__banner-foot::-webkit-scrollbar { height: 0; }
.mev .mev__banner-foot .mev__foot-mid,
.mev .mev__banner-foot .mev__foot-right {
    position: static;
    transform: none;
    margin-left: 0;
}

/* ----------------------------------- полоса рынков → пилюли + поиск ----- */

.mev .mev__bar {
    height: auto;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    padding: 10px 10px 4px;
    background: #f4f8fc;
    border-top: none;
    border-bottom: none;
}
/* разрыв строки: поиск и кнопка «назад» уходят на вторую строку */
.mev .mev__bar::before {
    content: "";
    order: 2;
    flex: 0 0 100%;
    height: 0;
}

.mev .mev__bar-game {
    order: 1;
    height: 36px;
    padding: 0 14px;
    gap: 8px;
    border-right: none;
    border-radius: 18px;
    background: #1f4e85;
    color: #fff;
    font-size: 13px;
}
.mev .mev__bar-game[aria-expanded="true"] { background: #163c69; }
.mev .mev__bar-game i { color: #cddff0; }
.mev .mev__game-menu { top: calc(100% + 6px); }

.mev .mev__bar-tabs {
    order: 1;
    flex: 1 1 0;
    min-width: 0;
    gap: 7px;
    align-items: center;
}
.mev .mev__tab {
    height: 36px;
    padding: 0 14px;
    border-radius: 18px;
    background: #e4ebf3;
    color: #2d4e7a;
    font-size: 13px;
}
.mev .mev__tab.is-active {
    background: #1f4e85;
    color: #fff;
    font-weight: 400;
}
.mev .mev__tab.is-active::after { display: none; }

.mev .mev__bar-tools { display: none; }

.mev .mev__bar-icons {
    order: 3;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    gap: 0;
    padding: 0;
    border-left: none;
}
.mev .mev__bar-icons > span[data-locked-notice] { display: none; }

.mev .mev__bar-search { flex: 1; min-width: 0; }
.mev .mev__bar-search input {
    width: 100%;
    height: 40px;
    padding: 0 12px 0 38px;
    border: 1px solid #d8e2ec;
    border-radius: 8px;
    background: #fff;
    color: #2d4e7a;
    font-size: 13px;
}
.mev .mev__bar-search input::placeholder { color: #93a9bf; }
.mev .mev__bar-search i {
    left: 14px;
    right: auto;
    color: #7a93ae;
}

.mev .mev__bar-collapse {
    order: 3;
    flex: 0 0 46px;
    width: 46px;
    height: 40px;
    border: 1px solid #d8e2ec;
    border-left: 1px solid #d8e2ec;
    border-radius: 8px;
    background: #fff;
    color: #3969a2;
}
.mev .mev__bar-collapse:hover { background: #eaf1f8; }

/* ------------------------------------------- карточки рынков ----------- */

.mev .mev__markets {
    flex-direction: column;
    gap: 0;
    padding: 10px;
}
.mev .mev__col { width: 100%; }
.mev .mev__col > .mev__mk:last-child { margin-bottom: 8px; }

.mev .mev__mk {
    margin-bottom: 8px;
    border-radius: 6px;
}
.mev .mev__mk-head {
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
}

/* на телефоне оставляем 2–3 колонки, как в эталоне */
.mev .mev__mk-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mev .mev__mk-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* пустые слоты — просто просвет карточки, а не белая плитка */
.mev .mev__cell {
    display: block;
    height: auto;
    background: transparent;
}

.mev button.mev-odd {
    height: 100%;
    min-height: 38px;
    gap: 4px;
    padding: 5px 8px;
    font-size: 12px;
}
.mev .mev-odd__lbl {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15;
}
.mev .mev-odd__val { font-size: 13px; }

}

/* на совсем узких экранах — две колонки вместо трёх */
@media (max-width: 420px) {
    .mev .mev__mk-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
