/* ============================================================
   Classic sportsbook layout — magic365 pre-match style.
   Reference: 22magic365.com/es/sports-book/pre-match
   Loaded after common.css. Brand/accent colors are CSS vars so
   each skin re-themes via an inline :root{} override. The deep
   navy data palette is shared across all skins.
   ============================================================ */
html, body { overflow: hidden; }

/* ── App shell (below the 52px skin navbar) ───────────────── */
.mb-app { position: fixed; top: 52px; left: 0; right: 0; bottom: 0; display: flex; background: #070f19; overflow: hidden; }
.mb-app *::-webkit-scrollbar { width: 6px; height: 6px; }
.mb-app *::-webkit-scrollbar-thumb { background: #1e3a55; border-radius: 3px; }
.mb-app *::-webkit-scrollbar-track { background: transparent; }

/* ── LEFT panel ───────────────────────────────────────────── */
.mb-left { width: 300px; flex-shrink: 0; background: #0a1424; border-right: 1px solid #16263b; overflow-y: auto; display: flex; flex-direction: column; }
.mb-search { padding: 12px; position: relative; }
.mb-search input { width: 100%; background: #0f1d30; border: 1px solid #1e3a55; border-radius: 8px; color: #c9d6e3; font-size: 0.78rem; padding: 10px 36px 10px 12px; outline: none; }
.mb-search input::placeholder { color: #496685; }
.mb-search .mb-search-ic { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); color: #496685; pointer-events: none; }

/* PRE-PARTIDA / EN VIVO toggle */
.mb-prelive { display: flex; gap: 0; padding: 0 12px 10px; }
.mb-pl-tab { flex: 1; text-align: center; padding: 9px 6px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; color: #6a8baa; background: #0f1d30; border: 1px solid #1e3a55; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.mb-pl-tab:first-child { border-radius: 8px 0 0 8px; border-right: none; }
.mb-pl-tab:last-child { border-radius: 0 8px 8px 0; }
.mb-pl-tab.active { color: #fff; background: var(--sbk-brand); border-color: var(--sbk-brand); }
.mb-live-badge { background: var(--sbk-brand); color: #fff; font-size: 0.62rem; font-weight: 800; border-radius: 9px; padding: 1px 6px; min-width: 18px; text-align: center; }
.mb-pl-tab.active .mb-live-badge { background: rgba(255,255,255,.25); }

/* All-events row */
.mb-allevents { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; margin: 0 12px 6px; background: #0f1d30; border: 1px solid #16263b; border-radius: 8px; }
.mb-allevents span { font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #8faac0; line-height: 1.2; }
.mb-switch { position: relative; display: inline-block; width: 38px; height: 20px; flex-shrink: 0; }
.mb-switch input { display: none; }
.mb-slider { position: absolute; inset: 0; background: #1e3a55; border-radius: 20px; transition: .2s; }
.mb-slider::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #c9d6e3; border-radius: 50%; transition: .2s; }
.mb-switch input:checked + .mb-slider { background: var(--sbk-brand); }
.mb-switch input:checked + .mb-slider::before { transform: translateX(18px); background: #fff; }

/* Section heading inside left */
.mb-left-heading { padding: 10px 14px 6px; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: #4a6685; }

/* Popular competitions + sports rows */
.mb-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; border-bottom: 1px solid #0d1828; font-size: 0.78rem; color: #b4c6d8; transition: background .12s; }
.mb-row:hover { background: rgba(255,255,255,.03); color: #fff; }
.mb-row.active { background: var(--sbk-brand-tint); color: #fff; }
.mb-row .mb-row-ic { width: 20px; height: 20px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 15px; }
.mb-row .mb-row-ic img { width: 18px; height: 13px; object-fit: cover; border-radius: 2px; }
.mb-row .mb-row-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-row .mb-row-count { font-size: 0.66rem; color: #5a7a95; }
.mb-row .mb-row-caret { color: #4a6685; font-size: 0.6rem; transition: transform .2s; }
.mb-row.open .mb-row-caret { transform: rotate(180deg); }
.mb-sub-leagues { background: #08111e; }
.mb-sub-league { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 30px; font-size: 0.72rem; color: #7e98b2; cursor: pointer; border-bottom: 1px solid #0c1726; }
.mb-sub-league:hover { color: #fff; }
.mb-sub-league.active { color: var(--sbk-accent-bright); }
.mb-sub-league img { width: 16px; height: 11px; object-fit: cover; border-radius: 1px; }

/* ── CENTER ───────────────────────────────────────────────── */
.mb-center { flex: 1; min-width: 0; overflow-y: auto; background: #081120; position: relative; }
.mb-subtabs { display: flex; align-items: center; gap: 2px; padding: 0 14px; height: 46px; background: #0a1424; border-bottom: 1px solid #16263b; position: sticky; top: 0; z-index: 20; overflow-x: auto; }
.mb-subtabs::-webkit-scrollbar { height: 0; }
.mb-subtab { padding: 8px 12px; font-size: 0.78rem; font-weight: 600; color: #8faac0; cursor: pointer; white-space: nowrap; border-bottom: 2px solid transparent; }
.mb-subtab:first-child { font-weight: 800; color: #c9d6e3; }
.mb-subtab:hover { color: #fff; }
.mb-subtab.active { color: #fff; border-bottom-color: var(--sbk-accent); }
.mb-subtabs-sep { width: 1px; height: 18px; background: #1e3a55; margin: 0 4px; }
.mb-subtabs-right { margin-left: auto; display: flex; gap: 6px; }
.mb-icon-btn { width: 32px; height: 32px; border-radius: 7px; background: #0f1d30; border: 1px solid #1e3a55; color: #8faac0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.mb-icon-btn:hover { color: #fff; border-color: var(--sbk-accent); }

/* Featured hero */
.mb-hero { margin: 14px; border-radius: 12px; overflow: hidden; background: linear-gradient(120deg, #0c2036 0%, #102c4d 45%, #0a1a30 100%); position: relative; min-height: 168px; display: flex; }
.mb-hero-nav { position: absolute; bottom: 10px; right: 12px; display: flex; gap: 6px; z-index: 3; }
.mb-hero-nav button { width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.15); color: #fff; cursor: pointer; font-size: 0.9rem; }
.mb-hero-nav button:hover { background: var(--sbk-brand); }
.mb-hero-inner { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 18px 22px; }
.mb-hero-league { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #8faac0; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.mb-hero-teams { font-size: 1.3rem; font-weight: 800; color: #fff; line-height: 1.2; margin-bottom: 4px; }
.mb-hero-date { font-size: 0.72rem; color: #9fb6cc; margin-bottom: 14px; }
.mb-hero-odds { display: flex; gap: 8px; max-width: 420px; }
.mb-hero-odd { flex: 1; background: rgba(8,18,32,.7); border: 1px solid #24496e; border-radius: 8px; padding: 8px 6px; text-align: center; cursor: pointer; transition: all .15s; }
.mb-hero-odd:hover { border-color: var(--sbk-accent); background: rgba(8,18,32,.95); }
.mb-hero-odd.active { background: var(--sbk-accent-tint-3); border-color: var(--sbk-accent); }
.mb-hero-odd .lbl { display: block; font-size: 0.6rem; color: #8faac0; margin-bottom: 2px; }
.mb-hero-odd .val { display: block; font-size: 0.95rem; font-weight: 800; color: #fff; }

/* Section blocks */
.mb-block { margin: 0 14px 16px; }
.mb-block-head { display: flex; align-items: center; gap: 8px; padding: 12px 2px 8px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sbk-accent-bright); }
.mb-block-head .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #ff3b3b; box-shadow: 0 0 0 0 rgba(255,59,59,.6); animation: mbpulse 1.3s infinite; }
@keyframes mbpulse { 0%{box-shadow:0 0 0 0 rgba(255,59,59,.6);} 70%{box-shadow:0 0 0 6px rgba(255,59,59,0);} 100%{box-shadow:0 0 0 0 rgba(255,59,59,0);} }

/* League/sport group */
.mb-group { background: #0b1626; border: 1px solid #16263b; border-radius: 10px; overflow: hidden; margin-bottom: 10px; }
.mb-group-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: #0e1d30; cursor: pointer; font-size: 0.72rem; font-weight: 700; color: #b4c6d8; border-bottom: 1px solid #16263b; }
.mb-group-head .gh-ic { font-size: 14px; }
.mb-group-head .gh-count { color: #5a7a95; font-weight: 600; }
.mb-group-head .gh-caret { margin-left: auto; color: #4a6685; font-size: 0.6rem; transition: transform .2s; }
.mb-group.collapsed .gh-caret { transform: rotate(-90deg); }
.mb-group.collapsed .mb-table { display: none; }

/* Events table */
.mb-table { width: 100%; border-collapse: collapse; }
.mb-table thead th { font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #5a7a95; padding: 6px 6px; text-align: center; background: #0a1626; border-bottom: 1px solid #14273c; }
.mb-table thead th.evh { text-align: left; width: 100%; padding-left: 12px; }
.mb-table td { border-bottom: 1px solid #0e1c2e; vertical-align: middle; padding: 0; }
.mb-table tr:last-child td { border-bottom: none; }
.mb-ev-row:hover { background: rgba(46,139,201,.04); }
.mb-ev-cell { padding: 8px 12px; cursor: pointer; }
.mb-ev-line { display: flex; align-items: center; gap: 8px; font-size: 0.76rem; color: #d3dfeb; margin: 2px 0; }
.mb-ev-score { min-width: 14px; text-align: center; font-weight: 800; color: var(--sbk-accent-bright); font-size: 0.72rem; }
.mb-ev-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.mb-ev-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 0.6rem; color: #5a7a95; }
.mb-ev-min { color: #2ec36b; font-weight: 700; }
.mb-odd-td { width: 64px; padding: 5px 4px; text-align: center; }
.mb-odd { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; width: 100%; min-height: 38px; background: #11233a; border: 1px solid #1e3a55; border-radius: 6px; color: #d3dfeb; font-size: 0.78rem; font-weight: 700; cursor: pointer; transition: all .12s; padding: 4px 2px; }
.mb-odd:hover { background: rgba(46,139,201,.2); border-color: var(--sbk-accent); color: #fff; }
.mb-odd.active { background: var(--sbk-accent); border-color: var(--sbk-accent); color: #fff; }
.mb-odd .od-lbl { font-size: 0.54rem; color: #6a8baa; font-weight: 600; }
.mb-odd.active .od-lbl { color: rgba(255,255,255,.8); }
.mb-odd.dead { opacity: .4; cursor: default; }
.mb-more-td { width: 56px; padding: 5px 6px 5px 0; text-align: center; }
.mb-more-btn { background: #0f2034; border: 1px solid #24496e; border-radius: 6px; color: #8faac0; font-size: 0.7rem; font-weight: 700; padding: 8px 6px; cursor: pointer; width: 100%; }
.mb-more-btn:hover { color: #fff; border-color: var(--sbk-accent); }
.mb-more-row td { background: #07121f; padding: 8px 12px; }
.mb-more-markets { display: flex; flex-wrap: wrap; gap: 6px; }
.mb-more-mk { display: flex; flex-direction: column; gap: 4px; background: #0c1a2c; border: 1px solid #16263b; border-radius: 6px; padding: 6px 8px; min-width: 120px; }
.mb-more-mk-title { font-size: 0.58rem; text-transform: uppercase; letter-spacing: .05em; color: #5a7a95; font-weight: 700; }
.mb-more-mk-odds { display: flex; gap: 4px; }
.mb-more-mk-odds .mb-odd { min-height: 32px; }

.mb-empty { padding: 30px 16px; text-align: center; color: #496685; font-size: 0.78rem; }

/* ── RIGHT panel ──────────────────────────────────────────── */
.mb-right { width: 322px; flex-shrink: 0; background: #0a1424; border-left: 1px solid #16263b; overflow-y: auto; display: flex; flex-direction: column; }
.mb-liveinfo-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #c9d6e3; border-bottom: 1px solid #16263b; }
.mb-live-select { margin: 10px 12px; background: #0f1d30; border: 1px solid #1e3a55; border-radius: 8px; color: #c9d6e3; font-size: 0.74rem; padding: 9px 10px; outline: none; cursor: pointer; }
.mb-tracker { margin: 0 12px 12px; }
.mb-tk-league { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #8faac0; text-align: center; margin-bottom: 8px; }
.mb-tk-scoreline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mb-tk-team { flex: 1; font-size: 0.78rem; font-weight: 700; color: #d3dfeb; }
.mb-tk-team.away { text-align: right; }
.mb-tk-score { font-size: 1.2rem; font-weight: 900; color: #fff; background: #0f1d30; border-radius: 6px; padding: 2px 12px; letter-spacing: 2px; }
.mb-tk-min { text-align: center; font-size: 0.66rem; color: #2ec36b; font-weight: 700; margin-bottom: 8px; }
/* Pitch */
.mb-pitch { position: relative; height: 120px; border-radius: 10px; background: repeating-linear-gradient(90deg, #14803f 0 28px, #16924a 28px 56px); border: 1px solid #0c5a2c; overflow: hidden; margin-bottom: 8px; }
.mb-pitch::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.55); transform: translateX(-1px); }
.mb-pitch-circle { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; border: 2px solid rgba(255,255,255,.5); border-radius: 50%; transform: translate(-50%,-50%); }
.mb-pitch-box { position: absolute; top: 50%; transform: translateY(-50%); width: 22px; height: 56px; border: 2px solid rgba(255,255,255,.45); }
.mb-pitch-box.l { left: 0; border-left: none; }
.mb-pitch-box.r { right: 0; border-right: none; }
.mb-pitch-poss { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; font-size: 0.58rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.mb-ball { position: absolute; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.8); transform: translate(-50%,-50%); transition: left 1.5s ease; }
/* possession bar */
.mb-poss-bar { display: flex; height: 8px; border-radius: 5px; overflow: hidden; margin-bottom: 4px; background: #0f1d30; }
.mb-poss-bar .h { background: var(--sbk-accent); }
.mb-poss-bar .a { background: #c0392b; }
.mb-poss-labels { display: flex; justify-content: space-between; font-size: 0.62rem; color: #8faac0; margin-bottom: 12px; }
/* stats */
.mb-stats { background: #0b1626; border: 1px solid #16263b; border-radius: 8px; overflow: hidden; }
.mb-stat-row { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; padding: 6px 10px; font-size: 0.66rem; border-bottom: 1px solid #0e1c2e; }
.mb-stat-row:last-child { border-bottom: none; }
.mb-stat-row .sv { font-weight: 800; color: #d3dfeb; }
.mb-stat-row .sv.h { text-align: left; }
.mb-stat-row .sv.a { text-align: right; }
.mb-stat-row .sl { text-align: center; color: #6a8baa; text-transform: uppercase; letter-spacing: .03em; font-size: 0.58rem; }
.mb-tk-empty { padding: 24px 12px; text-align: center; color: #496685; font-size: 0.74rem; }

/* ── Betslip (HOJA DE APUESTAS) ───────────────────────────── */
.mb-slip { border-top: 4px solid #06101c; margin-top: auto; background: #0a1424; display: flex; flex-direction: column; }
.mb-slip-head { padding: 11px 14px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: var(--sbk-brand); }
.rp-slip-tabs { display: flex; border-bottom: 1px solid #16263b; }
.rp-slip-tab { flex: 1; text-align: center; padding: 10px 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; cursor: pointer; color: #6a8baa; border-bottom: 2px solid transparent; background: #0a1626; }
.rp-slip-tab + .rp-slip-tab { border-left: 1px solid #16263b; }
.rp-slip-tab.active { color: #fff; border-bottom-color: var(--sbk-accent); background: #0e1d30; }
.rp-empty { color: #496685; font-size: 0.74rem; padding: 22px 12px; text-align: center; }
.rp-bet-item { background: #0c1a2c; border: 1px solid #1e3a55; border-radius: 8px; padding: 10px 10px 8px; margin: 8px 10px; }
.rp-bet-odd { font-size: 1rem; font-weight: 800; color: var(--sbk-accent-bright); }
.rp-bet-type { font-size: 0.62rem; color: #5a7a95; }
.rp-bet-teams { font-size: 0.72rem; color: #b4c6d8; margin: 4px 0 2px; line-height: 1.4; }
.rp-bet-league { font-size: 0.6rem; color: #496685; }
.rp-bet-remove { float: right; background: none; border: none; color: #496685; cursor: pointer; font-size: 0.95rem; padding: 0; }
.rp-bet-remove:hover { color: var(--sbk-brand); }
.rp-stake-input { width: calc(100% - 20px); margin: 4px 10px; background: #0f1d30; border: 1px solid #1e3a55; color: #c9d6e3; padding: 8px 10px; border-radius: 6px; font-size: 0.74rem; outline: none; }
.rp-stake-input::placeholder { color: #496685; }
.rp-profit-row { display: flex; justify-content: space-between; padding: 4px 12px; font-size: 0.68rem; color: #6a8baa; }
.rp-profit-val { color: var(--sbk-accent-bright); font-weight: 700; }
.rp-place-btn { width: calc(100% - 20px); margin: 10px 10px 6px; background: var(--sbk-win); color: #fff; border: none; padding: 11px; border-radius: 7px; font-size: 0.8rem; font-weight: 800; cursor: pointer; }
.rp-place-btn:hover { background: var(--sbk-win-hover); }
.rp-clear-btn { width: calc(100% - 20px); margin: 0 10px 12px; background: transparent; border: 1px solid #1e3a55; color: #6a8baa; padding: 8px; border-radius: 7px; font-size: 0.7rem; cursor: pointer; }
.rp-clear-btn:hover { color: var(--sbk-brand); border-color: var(--sbk-brand-tint-strong); }
.rp-multi-total { margin: 6px 10px; background: #0c1a2c; border: 1px solid #1e3a55; border-radius: 8px; padding: 8px 10px; display: flex; justify-content: space-between; font-size: 0.74rem; color: #b4c6d8; }
.rp-multi-total-odd { font-size: 1rem; font-weight: 800; color: var(--sbk-accent-bright); }

/* ── Mobile betslip FAB + drawers ─────────────────────────── */
.mb-fab { display: none; position: fixed; bottom: 16px; right: 16px; z-index: 960; background: var(--sbk-brand); color: #fff; border: none; border-radius: 30px; padding: 11px 18px; font-size: 0.78rem; font-weight: 800; cursor: pointer; align-items: center; gap: 8px; box-shadow: 0 6px 20px var(--sbk-brand-tint-strong); }
.mb-fab .fab-count { background: #fff; color: var(--sbk-brand); border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; font-size: 0.66rem; font-weight: 900; }

/* mobile horizontal sport bar (hidden on desktop) */
.mb-msports { display: none; gap: 6px; padding: 8px 12px; overflow-x: auto; background: #0a1424; border-bottom: 1px solid #16263b; }
.mb-msports::-webkit-scrollbar { height: 0; }
.mb-msport { flex-shrink: 0; padding: 6px 12px; border-radius: 16px; background: #0f1d30; border: 1px solid #1e3a55; color: #8faac0; font-size: 0.7rem; font-weight: 700; white-space: nowrap; cursor: pointer; }
.mb-msport.active { background: var(--sbk-brand); border-color: var(--sbk-brand); color: #fff; }

/* ── Search overlay ───────────────────────────────────────── */
.mb-search-results { position: absolute; left: 0; right: 0; top: 100%; max-height: 60vh; overflow-y: auto; background: #0a1626; border: 1px solid #1e3a55; border-radius: 0 0 10px 10px; z-index: 50; display: none; }
.mb-search-results.open { display: block; }
.mb-sr-group { padding: 8px 12px; }
.mb-sr-league { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; color: #5a7a95; padding: 4px 0; }
.mb-sr-match { display: flex; flex-direction: column; gap: 2px; padding: 7px 0; border-bottom: 1px solid #0e1c2e; cursor: pointer; }
.mb-sr-match:hover { color: #fff; }
.mb-sr-teams { font-size: 0.74rem; color: #b4c6d8; }
.mb-sr-time { font-size: 0.6rem; color: #496685; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1199px) {
    .mb-right { position: fixed; top: 52px; right: 0; bottom: 0; width: 340px; max-width: 92vw; transform: translateX(100%); transition: transform .3s ease; z-index: 955; box-shadow: -6px 0 24px rgba(0,0,0,.55); }
    .mb-right.open { transform: translateX(0); }
    .mb-fab { display: flex; }
}
@media (max-width: 899px) {
    .mb-left { position: fixed; top: 52px; left: 0; bottom: 0; width: 280px; max-width: 86vw; transform: translateX(-100%); transition: transform .3s ease; z-index: 955; box-shadow: 6px 0 24px rgba(0,0,0,.55); }
    .mb-left.open { transform: translateX(0); }
    .mb-msports { display: flex; }
    .mb-hero-teams { font-size: 1.05rem; }
    .mb-ev-name { max-width: 150px; }
}
