/* ============================================================
 * BETMAN 게임 페이지 — 베트맨 스타일 (블루+레드 액센트)
 * ============================================================ */

/* 기본 좌/우 사이드바 숨김 + shell 풀와이드 */
body.bm-shell .spk-sidebar,
body.bm-shell .spk-sidebar-right { display: none !important; }
body.bm-shell .spk-shell,
body.bm-shell .spk-shell:has(.spk-sidebar-right) {
    grid-template-columns: 1fr !important;
    max-width: min(1380px, calc(100% - 24px)) !important;
}
body.bm-shell .spk-side-banner { display: none !important; }
body.bm-shell .spk-main { width: 100% !important; }

:root {
    --bm-blue: #1a6dff;
    --bm-blue-deep: #0d52d4;
    --bm-red: #ed1c24;
    --bm-line: #d8e1ec;
    --bm-text: #1a2433;
    --bm-muted: #6a7a8c;
    --bm-bg: #f6f8fb;
    --bm-card: #ffffff;
    --bm-side: #f5f8fc;
}

.bm-wrap {
    background: var(--bm-bg);
    border-radius: 14px;
    /* overflow: hidden 이면 자식 sticky 가 작동 안 함 */
    overflow: visible;
    margin: 8px 0 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
/* 헤더만 라운드 처리 (overflow visible 보완) */
.bm-header { border-radius: 14px 14px 0 0; }

/* ============================================================
 * 헤더
 * ============================================================ */
.bm-header {
    background: linear-gradient(135deg, #fff 0%, #eaf1fa 100%);
    border-bottom: 1px solid var(--bm-line);
}
.bm-header-inner {
    padding: 22px 28px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
}
.bm-brand { display: flex; align-items: flex-start; gap: 18px; flex: 1 1 0; min-width: 0; }
.bm-brand-logo {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bm-blue), var(--bm-blue-deep));
    display: flex; align-items: center; justify-content: center;
    font-size: 30px; color: #fff;
    box-shadow: 0 6px 20px rgba(26,109,255,.3);
    flex-shrink: 0;
}
.bm-brand-txt h1 {
    margin: 0 0 6px; font-size: 22px;
    color: var(--bm-text); font-weight: 900; letter-spacing: -.02em;
    display: inline-flex; align-items: center; gap: 10px;
}
.bm-brand-tag {
    font-size: 11px; font-weight: 800;
    padding: 3px 10px; border-radius: 6px;
    background: var(--bm-red); color: #fff;
    letter-spacing: .03em;
}
.bm-brand-txt p {
    margin: 0; color: var(--bm-muted); font-size: 13px; line-height: 1.6;
    max-width: 720px;
}
.bm-brand-txt p b { color: var(--bm-blue-deep); font-weight: 700; }

.bm-brand-wallet {
    text-align: right;
    background: linear-gradient(135deg, #fff5d4, #ffd97d);
    border: 1px solid #f0c020;
    border-radius: 10px;
    padding: 10px 18px;
    box-shadow: 0 3px 10px rgba(240,192,32,.25);
}
.bm-wallet-label { font-size: 11px; color: #7a5400; display: block; font-weight: 700; }
.bm-wallet-amount { font-size: 20px; color: #b87600; font-weight: 800; }

/* ============================================================
 * 메인 그리드 — 사이드 + 메인 (+ 우측 베팅 슬립)
 * ============================================================ */
.bm-grid {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
    align-items: start;       /* sticky 가 작동하려면 stretch 가 아니어야 함 */
}
.bm-grid.bm-grid-3col {
    grid-template-columns: 230px minmax(0, 1fr) 280px;
}

/* ============================================================
 * 좌측 사이드바 — 구매가능 게임
 * ============================================================ */
.bm-sidebar {
    background: var(--bm-card);
    border: 1px solid var(--bm-line);
    border-radius: 10px;
    overflow: hidden;
    align-self: start;
    position: sticky;
    top: 65px;
    max-height: calc(100vh - 32px);
    display: flex; flex-direction: column;
    z-index: 49;
}
.bm-sidebar .bm-side-list {
    max-height: none;       /* 부모 max-height 가 제어 */
    flex: 1;
}
.bm-side-head {
    padding: 12px 14px;
    background: linear-gradient(135deg, var(--bm-blue), var(--bm-blue-deep));
    color: #fff;
    display: flex; justify-content: space-between; align-items: baseline;
}
.bm-side-head strong { font-size: 14px; font-weight: 800; }
.bm-side-head small { font-size: 10px; opacity: .85; }

.bm-side-tabs {
    display: flex; gap: 2px;
    padding: 8px 8px 0;
    background: #f0f5fc;
    border-bottom: 1px solid var(--bm-line);
    overflow-x: auto;
}
.bm-side-tab {
    padding: 7px 10px;
    color: var(--bm-muted);
    text-decoration: none;
    font-size: 12px; font-weight: 700;
    border-radius: 6px 6px 0 0;
    white-space: nowrap;
}
.bm-side-tab:hover { color: var(--bm-blue); }
.bm-side-tab.is-active {
    background: #fff; color: var(--bm-blue);
    border: 1px solid var(--bm-line);
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
}

.bm-side-list {
    padding: 8px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}
.bm-side-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--bm-text);
    transition: background .12s;
    margin-bottom: 4px;
    border-left: 3px solid transparent;
}
.bm-side-item:hover {
    background: #eaf1fa;
    border-left-color: var(--bm-blue);
}
.bm-side-item.is-closed {
    opacity: .55;
    background: #fafbfd;
}
.bm-side-item.is-closed:hover { opacity: 1; background: #eee; }
.bm-side-icon {
    font-size: 22px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.bm-side-info { flex: 1; min-width: 0; }
.bm-side-info strong {
    display: block; font-size: 13px; font-weight: 700; color: var(--bm-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bm-side-info small {
    font-size: 11px; font-weight: 700;
}
.bm-side-info small.is-ing {
    color: var(--bm-red);
    background: rgba(237,28,36,.1);
    padding: 2px 6px; border-radius: 3px;
}
.bm-side-info small.is-finish {
    color: #98a6b7;
    background: rgba(152,166,183,.1);
    padding: 2px 6px; border-radius: 3px;
}
.bm-side-empty {
    padding: 30px 14px; text-align: center; color: var(--bm-muted); font-size: 12px;
}

/* ============================================================
 * 메인 컨텐츠
 * ============================================================ */
.bm-main {
    background: var(--bm-card);
    border: 1px solid var(--bm-line);
    border-radius: 10px;
    padding: 22px 24px;
    min-height: 70vh;
}

/* 인트로 + 통계 */
.bm-intro-grid {
    display: grid; grid-template-columns: 1fr 320px; gap: 16px;
    margin-bottom: 22px;
}
.bm-intro-card {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 22px;
    background: linear-gradient(135deg, #eaf1fa, #d6e6f8);
    border: 1px solid #c2d6ed;
    border-radius: 10px;
}
.bm-intro-ic {
    font-size: 36px;
    flex-shrink: 0;
    width: 56px; height: 56px;
    background: var(--bm-blue); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(26,109,255,.3);
}
.bm-intro-card strong {
    display: block; font-size: 16px; color: var(--bm-text); font-weight: 800; margin-bottom: 4px;
}
.bm-intro-card p { margin: 0; color: var(--bm-muted); font-size: 12px; line-height: 1.5; }

.bm-intro-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.bm-stat {
    background: #f0f5fc;
    border: 1px solid var(--bm-line);
    border-radius: 8px;
    padding: 14px 10px;
    text-align: center;
}
.bm-stat label { display: block; color: var(--bm-muted); font-size: 11px; margin-bottom: 4px; font-weight: 700; }
.bm-stat b { font-size: 24px; color: var(--bm-text); font-weight: 800; }
.bm-stat.is-ing { background: linear-gradient(135deg, #ffe5e5, #ffd0d0); border-color: #ffb0b0; }
.bm-stat.is-ing b { color: var(--bm-red); }
.bm-stat.is-closed b { color: var(--bm-muted); }

/* 종목별 카드 그리드 */
.bm-sport-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 14px;
}
.bm-sport-card {
    background: var(--bm-card);
    border: 1px solid var(--bm-line);
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow .15s, transform .15s;
}
.bm-sport-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.bm-sport-card-head {
    background: linear-gradient(135deg, var(--bm-accent), color-mix(in srgb, var(--bm-accent) 70%, #000));
    color: #fff;
    padding: 12px 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.bm-sport-card-title { display: flex; align-items: center; gap: 12px; }
.bm-sport-emoji { font-size: 28px; }
.bm-sport-card-title strong { display: block; font-size: 16px; font-weight: 800; }
.bm-sport-card-title small { font-size: 11px; opacity: .85; }
.bm-sport-count {
    background: rgba(255,255,255,.25);
    padding: 4px 10px; border-radius: 4px;
    font-size: 12px; font-weight: 700;
}

.bm-sport-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.bm-sport-table th, .bm-sport-table td {
    padding: 9px 12px; border-bottom: 1px solid var(--bm-line);
    text-align: left;
}
.bm-sport-table th {
    background: #fafbfd; color: var(--bm-muted);
    font-size: 11px; font-weight: 700;
}
.bm-sport-table td { color: var(--bm-text); }
.bm-sport-table tr:last-child td { border-bottom: 0; }
.bm-sport-table tr.is-closed { opacity: .5; }
.bm-sport-table tr.is-closed:hover { opacity: 1; background: #f7f9fc; }

.bm-state {
    display: inline-block;
    padding: 3px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 700;
}
.bm-state-ing { background: rgba(237,28,36,.12); color: var(--bm-red); }
.bm-state-finish { background: rgba(152,166,183,.18); color: #5a6b7a; }

.bm-data-tag {
    display: inline-block;
    padding: 2px 7px; border-radius: 3px;
    font-size: 11px; font-weight: 700;
}
.bm-data-tag.is-on { background: rgba(14,203,129,.15); color: #0a8043; }
.bm-data-tag.is-off { background: rgba(152,166,183,.15); color: #98a6b7; }
.bm-slip-tag {
    display: inline-block; min-width: 22px;
    padding: 2px 8px;
    background: var(--bm-blue); color: #fff;
    border-radius: 10px;
    font-size: 12px; font-weight: 800;
    font-family: 'Roboto Mono', monospace;
    text-align: center;
}

.bm-go-btn {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bm-blue);
    color: #fff;
    border-radius: 5px;
    text-decoration: none;
    font-size: 12px; font-weight: 700;
    transition: background .12s, transform .1s;
}
.bm-go-btn:hover { background: var(--bm-blue-deep); transform: translateY(-1px); }

/* 면책 안내 */
.bm-disclaimer {
    margin-top: 24px;
    padding: 16px 20px;
    background: #fff8e1;
    border: 1px solid #ffd07a;
    border-radius: 8px;
}
.bm-disclaimer h4 { margin: 0 0 10px; color: #b87600; font-size: 14px; }
.bm-disclaimer ul { margin: 0; padding-left: 20px; color: var(--bm-text); font-size: 12px; line-height: 1.7; }
.bm-disclaimer a { color: var(--bm-blue); text-decoration: none; font-weight: 700; }
.bm-disclaimer a:hover { text-decoration: underline; }

/* ============================================================
 * 상세 페이지 (프로토 등)
 * ============================================================ */
.bm-detail { padding: 4px; }
.bm-detail-head {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 14px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--bm-line);
    margin-bottom: 18px;
}
.bm-detail-title { display: flex; align-items: center; gap: 12px; }
.bm-detail-emoji { font-size: 36px; }
.bm-detail-title h2 { margin: 0; font-size: 24px; color: var(--bm-text); font-weight: 800; }
.bm-detail-round { display: flex; gap: 6px; }
.bm-round-select {
    padding: 8px 14px;
    border: 1px solid var(--bm-line);
    border-radius: 6px;
    font-size: 14px;
    min-width: 220px;
    background: #fff;
}
.bm-round-btn {
    padding: 8px 16px;
    border: 1px solid var(--bm-line);
    border-radius: 6px;
    background: #f5f8fc;
    color: var(--bm-text);
    font-weight: 700;
    cursor: pointer;
}
.bm-round-btn:hover { background: var(--bm-blue); color: #fff; border-color: var(--bm-blue); }

.bm-detail-info {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
    margin-bottom: 18px;
}
.bm-info-cell {
    padding: 14px 18px;
    background: #f0f5fc;
    border: 1px solid var(--bm-line);
    border-radius: 8px;
    text-align: center;
}
.bm-info-cell label { display: block; color: var(--bm-muted); font-size: 11px; margin-bottom: 6px; font-weight: 700; }
.bm-info-cell strong { font-size: 14px; color: var(--bm-text); font-weight: 700; }

.bm-detail-tabs {
    display: flex; gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--bm-line);
}
.bm-d-tab {
    padding: 10px 22px;
    background: transparent;
    border: 0;
    color: var(--bm-muted);
    font-size: 14px; font-weight: 700;
    cursor: pointer;
    border-bottom: 3px solid transparent;
}
.bm-d-tab.is-active {
    color: var(--bm-blue);
    border-bottom-color: var(--bm-blue);
}

/* 통계 라인 */
.bm-stats-line {
    display: flex; gap: 16px; align-items: center;
    margin-bottom: 14px; padding: 10px 14px;
    background: #f0f5fc; border-radius: 6px;
    font-size: 13px; color: var(--bm-text);
}
.bm-stats-line b { color: var(--bm-blue); font-weight: 800; font-size: 14px; }
.bm-stats-meta { margin-left: auto; color: var(--bm-muted); font-size: 11px; }

/* 경기 리스트 */
.bm-match-list { display: flex; flex-direction: column; gap: 14px; }
.bm-match-block {
    background: #fff;
    border: 1px solid var(--bm-line);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.bm-match-head {
    background: linear-gradient(135deg, #2d4664, #1a2b44);
    color: #fff;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: minmax(160px, auto) 1fr minmax(160px, auto);
    align-items: center;
    gap: 16px;
    font-size: 13px;
}
.bm-match-meta {
    display: flex; align-items: center; gap: 10px;
    flex-wrap: wrap;
}
.bm-match-time {
    background: rgba(255,255,255,.15);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 12px;
    flex-shrink: 0;
}
.bm-match-time small { font-weight: 400; opacity: .8; margin: 0 4px; }
.bm-match-sport { font-weight: 700; opacity: .9; font-size: 12px; }
.bm-match-teams {
    display: flex; align-items: center; justify-content: center;
    gap: 18px;
    font-size: 18px;
    text-align: center;
}
.bm-match-teams b {
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -.02em;
    text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.bm-match-vs {
    color: rgba(255,255,255,.55);
    font-size: 13px;
    font-weight: 700;
    padding: 0 4px;
}
.bm-match-score {
    background: var(--bm-red);
    padding: 4px 14px;
    border-radius: 5px;
    font-weight: 900;
    font-size: 17px;
    font-family: 'Roboto Mono', monospace;
    letter-spacing: .04em;
}
.bm-match-pick-mark {
    display: flex; justify-content: flex-end;
    color: rgba(255,255,255,.6);
    font-size: 11px;
}
.bm-match-pick-mark .bm-mp-tag {
    background: var(--bm-blue);
    color: #fff;
    padding: 4px 10px;
    border-radius: 5px;
    font-weight: 800;
    font-size: 12px;
    letter-spacing: .02em;
}

/* 베팅 옵션 행 */
.bm-bet-rows { background: #fff; }
.bm-bet-row {
    display: grid;
    grid-template-columns: 60px minmax(140px, 200px) 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #eef2f7;
    transition: background .12s;
}
.bm-bet-row:last-child { border-bottom: 0; }
.bm-bet-row:hover { background: #fafbfd; }
.bm-bet-no {
    background: #f0f5fc;
    color: var(--bm-blue);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
}
.bm-bet-type {
    font-size: 13px; color: var(--bm-text); font-weight: 600;
    display: flex; align-items: center; gap: 6px;
}
.bm-hcap {
    font-style: normal;
    background: #fff5d4;
    color: #b87600;
    padding: 2px 7px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
}
.bm-odds {
    background: #f5f8fc;
    border: 1px solid var(--bm-line);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all .12s;
    display: flex; flex-direction: column; align-items: center;
    font-family: inherit;
    color: var(--bm-text);
    text-align: center;
    line-height: 1.3;
    min-height: 44px;
    justify-content: center;
}
.bm-odds:hover {
    background: #fff;
    border-color: var(--bm-blue);
    box-shadow: 0 2px 8px rgba(26,109,255,.2);
    transform: translateY(-1px);
}
.bm-odds.is-win {
    background: linear-gradient(135deg, #ffe5e5, #ffd0d0);
    border-color: var(--bm-red);
}
.bm-odds.is-empty {
    background: #fafbfd;
    border-style: dashed;
    pointer-events: none;
    opacity: .4;
}
.bm-odds-label {
    font-size: 11px;
    color: var(--bm-muted);
    font-weight: 700;
}
.bm-odds-val {
    font-size: 14px;
    color: var(--bm-text);
    font-weight: 800;
    font-family: 'Roboto Mono', monospace;
}
.bm-odds:hover .bm-odds-val { color: var(--bm-blue); }

@media (max-width: 800px) {
    /* 베팅 row: 첫 줄 [번호 + 게임주제], 둘째 줄 [옵션1 옵션2 옵션3] 한 줄 균등 */
    .bm-bet-row {
        /* minmax(0, 1fr) — 컨텐츠와 무관하게 강제 균등 분할 */
        grid-template-columns: 50px repeat(3, minmax(0, 1fr));
        grid-template-rows: auto auto;
        gap: 5px 6px;
        padding: 8px 10px;
        font-size: 12px;
    }
    .bm-bet-no {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: center;
    }
    .bm-bet-type {
        grid-column: 2 / -1;
        grid-row: 1;
        padding: 2px 0;
        font-size: 12.5px;
        font-weight: 700;
    }
    /* 옵션은 둘째 줄에 명시적 배치 (3개면 3컬럼, 2개+empty면 동일) */
    .bm-bet-row > .bm-odds:nth-of-type(1) { grid-column: 2; grid-row: 2; }
    .bm-bet-row > .bm-odds:nth-of-type(2) { grid-column: 3; grid-row: 2; }
    .bm-bet-row > .bm-odds:nth-of-type(3),
    .bm-bet-row > .bm-odds.is-empty       { grid-column: 4; grid-row: 2; }
    /* 박스 폭은 grid 셀 100% — 컨텐츠 길이로 인한 자동 확장 방지 */
    .bm-bet-row > .bm-odds {
        width: 100%;
        min-width: 0;
        min-height: 38px;
        padding: 5px 6px;
        box-sizing: border-box;
    }
    .bm-odds-label { font-size: 10.5px; }
    .bm-odds-val { font-size: 13px; }

    .bm-match-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .bm-match-teams { margin-left: 0; }
}

/* ============================================================
 * 토토 묶음 베팅 (sc1 등) — 14경기 표
 * ============================================================ */
.bm-toto-table {
    width: 100%; border-collapse: collapse;
    background: #fff;
    border: 1px solid var(--bm-line);
    border-radius: 8px; overflow: hidden;
    margin-bottom: 14px;
    font-size: 13px;
}
.bm-toto-table th {
    background: linear-gradient(180deg, #2d4664, #1a2b44);
    color: #fff;
    padding: 10px 8px; text-align: center;
    font-size: 12px; font-weight: 700;
}
.bm-toto-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #eef2f7;
    text-align: center;
}
.bm-toto-table tr:last-child td { border-bottom: 0; }
.bm-toto-table tr:hover { background: #fafbfd; }
.bm-toto-table tr.is-finished { background: #f5f8fc; opacity: .85; }
.bm-toto-team-h { text-align: right !important; font-weight: 700; }
.bm-toto-team-a { text-align: left !important; font-weight: 700; }
.bm-toto-score {
    display: inline-block; min-width: 22px;
    background: var(--bm-blue); color: #fff;
    padding: 1px 7px; border-radius: 3px;
    font-family: 'Roboto Mono', monospace;
    font-size: 11px; font-weight: 800;
    margin: 0 4px;
}

/* 픽 셀 (라디오 + 라벨) */
.bm-toto-pick-cell {
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; user-select: none;
    margin: 0;
}
.bm-toto-pick-cell input[type=radio] { display: none; }
.bm-toto-pick-cell span {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 32px;
    background: #f5f8fc;
    border: 2px solid var(--bm-line);
    border-radius: 6px;
    font-weight: 800; font-size: 13px;
    color: #6a7a8c;
    transition: all .12s;
}
.bm-toto-pick-cell:hover span {
    background: #fff;
    border-color: var(--bm-blue);
    color: var(--bm-blue);
    transform: scale(1.05);
}
.bm-toto-pick-cell input[type=radio]:checked + span {
    background: var(--bm-blue); color: #fff;
    border-color: var(--bm-blue-deep);
    box-shadow: 0 2px 8px rgba(26,109,255,.4);
}
.bm-toto-pick-cell input[type=radio][data-result=hit] + span {
    background: linear-gradient(135deg, #fff5d4, #ffd97d);
    border-color: #f0c020;
    color: #7a5400;
}
.bm-toto-pick-cell input[type=radio]:disabled + span {
    cursor: not-allowed; opacity: .55;
}

/* 결과 컬럼 */
.bm-toto-result-cell { font-weight: 800; }
.bm-toto-r-w { color: var(--bm-blue); }
.bm-toto-r-d { color: #6a7a8c; }
.bm-toto-r-l { color: var(--bm-red); }
.bm-toto-r-pending { color: #b0bcc9; }

/* 정산 결과 패널 */
.bm-toto-result {
    background: linear-gradient(135deg, #fff5d4, #ffe4a3);
    border: 1px solid #f0c020;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 18px;
}
.bm-toto-result h3 {
    margin: 0 0 12px; color: #7a5400; font-size: 16px;
}
.bm-toto-result-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}
.bm-toto-result-grid > div {
    background: rgba(255,255,255,.7);
    padding: 10px 14px; border-radius: 6px;
}
.bm-toto-result-grid label {
    display: block; color: #846800; font-size: 11px; font-weight: 700;
    margin-bottom: 3px;
}
.bm-toto-result-grid b {
    font-size: 16px; font-weight: 800; color: #4d3300;
    font-family: 'Roboto Mono', monospace;
}

/* 슬립 등록 바 */
.bm-toto-submit-bar {
    display: flex; align-items: center; gap: 16px;
    padding: 14px 20px;
    background: #1a2b44; color: #fff;
    border-radius: 10px;
    flex-wrap: wrap;
}
.bm-toto-stake-wrap label {
    display: block; font-size: 11px; color: rgba(255,255,255,.7); margin-bottom: 4px;
    font-weight: 700;
}
.bm-toto-stake-wrap input {
    background: #11141a; color: #fff; border: 1px solid #2b3139;
    padding: 9px 14px; border-radius: 6px;
    font-size: 14px; font-family: 'Roboto Mono', monospace;
    width: 140px; text-align: right; font-weight: 700;
}
.bm-toto-pick-status {
    margin-left: auto;
    color: rgba(255,255,255,.85); font-size: 13px; font-weight: 700;
}
.bm-toto-pick-status #bmTotoPickCount {
    font-size: 18px; color: var(--bm-blue); font-weight: 900;
    margin-right: 4px;
}
.bm-toto-submit {
    background: linear-gradient(135deg, var(--bm-red), #c01a20);
    color: #fff; border: 0; padding: 10px 22px;
    border-radius: 8px; font-size: 14px; font-weight: 800; cursor: pointer;
    box-shadow: 0 4px 12px rgba(237,28,36,.3);
}
.bm-toto-submit:hover { transform: translateY(-1px); }
.bm-toto-submit:disabled {
    background: #6a7a8c; cursor: not-allowed; opacity: .6; transform: none;
    box-shadow: none;
}
.bm-toto-locked {
    padding: 20px; text-align: center;
    background: #fafbfd; border: 1px dashed var(--bm-line);
    border-radius: 8px; color: var(--bm-muted); font-size: 13px;
}

/* placeholder */
.bm-games-empty {
    padding: 60px 20px;
    text-align: center;
    background: #fafbfd;
    border: 2px dashed var(--bm-line);
    border-radius: 10px;
}
.bm-empty-icon { font-size: 56px; margin-bottom: 14px; }
.bm-games-empty h3 { margin: 0 0 12px; color: var(--bm-text); font-size: 18px; }
.bm-games-empty p { margin: 4px 0; color: var(--bm-muted); font-size: 13px; }
.bm-empty-meta {
    margin-top: 14px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--bm-line);
    border-radius: 6px;
    font-size: 12px;
}
.bm-games-empty .bm-go-btn { margin-top: 16px; }

/* ============================================================
 * 베팅 슬립 카트 — 우측 사이드바 (항상 열림, sticky)
 * ============================================================ */
.bm-cart {
    background: #fff;
    border: 1px solid var(--bm-line);
    border-radius: 10px;
    overflow: hidden;
    align-self: start;        /* grid 셀 내 자체 배치 */
    position: sticky;
    top: 65px;                 /* 화면 상단에서 16px */
    max-height: calc(100vh - 32px);
    display: flex; flex-direction: column;
    z-index: 50;
    box-shadow: 0 4px 14px rgba(0,0,0,.06);
}
.bm-cart-head {
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--bm-blue), var(--bm-blue-deep));
    color: #fff;
    display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}
.bm-cart-head strong { font-size: 14px; font-weight: 800; }
.bm-cart-count {
    background: var(--bm-red);
    color: #fff;
    min-width: 26px; height: 24px;
    border-radius: 12px;
    padding: 0 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 900;
    font-family: 'Roboto Mono', monospace;
    opacity: .65;
    transition: all .2s;
}
.bm-cart-count.is-on {
    opacity: 1;
    animation: bmCountPulse .4s ease;
}
@keyframes bmCountPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); box-shadow: 0 0 0 6px rgba(237,28,36,.25); }
    100% { transform: scale(1); }
}
.bm-cart-body {
    padding: 10px 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 100px;
}
.bm-cart-empty {
    text-align: center;
    color: var(--bm-muted);
    padding: 20px 10px;
}
.bm-cart-empty p { margin: 0 0 6px; font-size: 14px; }
.bm-cart-empty small { font-size: 11px; }

.bm-cart-item {
    background: #f5f8fc;
    border: 1px solid var(--bm-line);
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    font-size: 12px;
}
.bm-cart-item-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 4px;
}
.bm-cart-no {
    background: #1a2b44; color: #fff;
    padding: 2px 7px; border-radius: 3px;
    font-size: 11px; font-weight: 800;
    font-family: 'Roboto Mono', monospace;
}
.bm-cart-bt { color: var(--bm-text); font-weight: 700; flex: 1; }
.bm-cart-bt em {
    font-style: normal;
    background: #fff5d4; color: #b87600;
    padding: 1px 5px; border-radius: 3px;
    font-size: 10px;
}
.bm-cart-rm {
    background: transparent;
    border: 0;
    color: var(--bm-muted);
    font-size: 18px; line-height: 1;
    cursor: pointer; padding: 0 4px;
}
.bm-cart-rm:hover { color: var(--bm-red); }
.bm-cart-item-match { color: var(--bm-text); font-weight: 600; margin-bottom: 4px; }
.bm-cart-item-match small { color: var(--bm-muted); margin: 0 4px; }
.bm-cart-item-pick {
    background: #fff;
    padding: 5px 10px; border-radius: 5px;
    border: 1px solid var(--bm-line);
    display: flex; justify-content: space-between;
}
.bm-cart-item-pick strong { color: var(--bm-blue); font-weight: 800; }
.bm-cart-item-pick span { color: var(--bm-muted); font-family: 'Roboto Mono', monospace; }

/* 카트 footer */
.bm-cart-foot {
    padding: 14px 18px;
    background: #fafbfd;
    border-top: 1px solid var(--bm-line);
}
.bm-cart-summary {
    background: #1a2b44; color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex; justify-content: space-between;
    font-size: 12px;
}
.bm-cart-summary > div { display: flex; flex-direction: column; gap: 2px; }
.bm-cart-summary span { color: rgba(255,255,255,.7); font-size: 10px; }
.bm-cart-summary strong { font-size: 16px; font-weight: 800; font-family: 'Roboto Mono', monospace; }
.bm-cart-payout.is-on { color: var(--bm-red); animation: bmPulse .4s; }
@keyframes bmPulse { 0%{transform:scale(1.1);} 100%{transform:scale(1);} }

.bm-cart-stake { margin-bottom: 8px; }
.bm-cart-stake label { display: block; font-size: 11px; color: var(--bm-muted); margin-bottom: 4px; font-weight: 700; }
.bm-cart-stake input {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--bm-line); border-radius: 6px;
    font-size: 14px; font-family: 'Roboto Mono', monospace;
    text-align: right; font-weight: 700;
}
.bm-cart-stake input:focus { outline: none; border-color: var(--bm-blue); box-shadow: 0 0 0 3px rgba(26,109,255,.15); }

.bm-cart-pct {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 4px; margin-bottom: 12px;
}
.bm-cart-pct button {
    background: #f0f5fc; color: var(--bm-muted);
    border: 1px solid var(--bm-line); border-radius: 5px;
    padding: 6px 0;
    font-size: 11px; font-weight: 700; cursor: pointer;
}
.bm-cart-pct button:hover { background: var(--bm-blue); color: #fff; border-color: var(--bm-blue); }

.bm-cart-submit {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, var(--bm-red), #c01a20); color: #fff;
    border: 0; border-radius: 8px;
    font-size: 15px; font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(237,28,36,.3);
    transition: all .15s;
}
.bm-cart-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(237,28,36,.4); }
.bm-cart-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.bm-cart-clear {
    width: 100%; margin-top: 6px;
    background: transparent; border: 0;
    color: var(--bm-muted);
    padding: 6px;
    font-size: 11px; cursor: pointer;
}
.bm-cart-clear:hover { color: var(--bm-red); }

/* 옵션 버튼 picked 상태 */
.bm-odds.is-picked {
    background: linear-gradient(135deg, var(--bm-blue), var(--bm-blue-deep)) !important;
    border-color: var(--bm-blue-deep) !important;
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(26,109,255,.4);
}
.bm-odds.is-picked .bm-odds-label,
.bm-odds.is-picked .bm-odds-val { color: #fff !important; }

/* 한 매치 한 베팅: 다른 게임번호 행 비활성 (배당만 dim, 행은 보임) */
.bm-bet-row { transition: opacity .2s ease, background .2s ease; }
.bm-bet-row.is-disabled {
    background: #f7f9fc;
    opacity: .7;
}
.bm-bet-row.is-disabled .bm-odds {
    background: #ecf0f6 !important;
    border-color: #d8e1ec !important;
    color: #b0bcc9 !important;
    cursor: not-allowed !important;
    opacity: .55;
    box-shadow: none !important;
    transform: none !important;
    pointer-events: auto; /* 토스트 띄우기 위해 클릭 살림 */
}
.bm-bet-row.is-disabled .bm-odds:hover {
    background: #ecf0f6 !important;
    transform: none !important;
    box-shadow: none !important;
}
.bm-bet-row.is-disabled .bm-odds-label,
.bm-bet-row.is-disabled .bm-odds-val { color: #b0bcc9 !important; }
.bm-bet-row.is-disabled .bm-bet-no {
    background: #e5ebf2; color: #98a6b7;
}

/* pt2 (프로토 기록식) — 단일 옵션 행: 게임번호 / 게임주제 / 결과 / 베팅버튼 */
.bm-bet-row-pt2 {
    grid-template-columns: 60px 1fr 100px 130px;
}
.bm-bet-type-pt2 {
    font-size: 13px; font-weight: 700;
    color: var(--bm-text);
}
.bm-bet-result {
    font-size: 12px;
    color: var(--bm-blue-deep); font-weight: 700;
    text-align: center;
}
.bm-odds-pt2 {
    background: linear-gradient(135deg, #fff5d4, #ffd97d);
    border-color: #f0c020;
    color: #7a5400 !important;
}
.bm-odds-pt2:hover {
    background: linear-gradient(135deg, #ffd97d, #f0ad1d) !important;
    border-color: #b87600 !important;
}
.bm-odds-pt2 .bm-odds-label,
.bm-odds-pt2 .bm-odds-val { color: #7a5400 !important; }

/* 매치 블록이 picked 됐을 때 좌측 컬러 강조 */
.bm-match-block.is-picked {
    box-shadow: 0 0 0 2px var(--bm-blue), 0 4px 12px rgba(26,109,255,.2);
    border-color: var(--bm-blue);
}

/* 진행중 매치 — 빨강 보더 + 옵션 잠금 */
.bm-match-block.is-live {
    border-color: var(--bm-red);
    box-shadow: 0 0 0 1px rgba(237,28,36,.4);
}
.bm-match-block.is-live .bm-bet-row .bm-odds {
    background: #f5f8fc !important;
    border-color: var(--bm-line) !important;
    color: #98a6b7 !important;
    cursor: not-allowed !important;
    opacity: .55;
    pointer-events: auto;
}
.bm-match-block.is-live .bm-bet-row .bm-odds:hover {
    transform: none !important;
    box-shadow: none !important;
}
.bm-match-block.is-live .bm-odds-label,
.bm-match-block.is-live .bm-odds-val { color: #98a6b7 !important; }

/* 종료된 매치 — 회색 dim */
.bm-match-block.is-finished {
    opacity: .82;
}
.bm-match-block.is-finished .bm-odds {
    background: #f5f8fc !important;
    cursor: not-allowed !important;
    opacity: .6;
}

/* 종료 매치 접힘/펼침 */
.bm-match-block.is-finished.is-collapsed .bm-bet-rows {
    max-height: 0;
    overflow: hidden;
    border: 0;
}
.bm-match-block.is-finished .bm-bet-rows {
    max-height: 1500px;
    transition: max-height .3s ease;
    overflow: hidden;
}

/* 토글 버튼 (▼ / ▲) */
.bm-match-toggle {
    background: rgba(255,255,255,.18);
    border: 0;
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    transition: background .15s, transform .15s;
    margin-left: 8px;
    display: inline-flex; align-items: center; justify-content: center;
}
.bm-match-toggle:hover { background: rgba(255,255,255,.32); transform: scale(1.1); }

/* 매치 헤더 우측 뱃지 */
.bm-mp-tag.bm-mp-live {
    background: var(--bm-red);
    color: #fff;
    display: inline-flex; align-items: center; gap: 6px;
    animation: bmLivePulse 1.6s ease-in-out infinite;
}
.bm-mp-tag.bm-mp-finished {
    background: rgba(255,255,255,.2);
    color: rgba(255,255,255,.85);
}
@keyframes bmLivePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(237,28,36,.5); }
    50%      { box-shadow: 0 0 0 6px rgba(237,28,36,0); }
}

/* 깜빡이는 빨간 불 (LIVE 뱃지 앞) */
.bm-live-dot {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #ff2d36;
    box-shadow:
        0 0 0 2px rgba(255,255,255,.5) inset,
        0 0 6px rgba(255,45,54,.9);
    animation: bmLiveDotBlink 0.9s ease-in-out infinite;
}
@keyframes bmLiveDotBlink {
    0%, 100% {
        opacity: 1;
        background: #ff2d36;
        box-shadow:
            0 0 0 2px rgba(255,255,255,.5) inset,
            0 0 8px rgba(255,45,54,1);
    }
    50% {
        opacity: 0.35;
        background: #b30b13;
        box-shadow:
            0 0 0 2px rgba(255,255,255,.3) inset,
            0 0 2px rgba(255,45,54,.4);
    }
}

/* 카트 하단 — 내 베팅 내역 링크 */
.bm-cart-myslips {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px;
    background: linear-gradient(135deg, #fff5d4, #ffd97d);
    color: #7a5400;
    text-decoration: none;
    font-weight: 800; font-size: 13px;
    border-top: 1px solid var(--bm-line);
    transition: background .15s, color .15s;
}
.bm-cart-myslips:hover, .bm-cart-myslips.is-active {
    background: linear-gradient(135deg, #ffd97d, #f0ad1d);
    color: #5a3e00;
}
.bm-cart-myslips i { font-style: normal; font-size: 16px; }

/* 슬립 내역 페이지 */
.bm-history-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px; margin-bottom: 20px;
}
.bm-hs-card {
    background: #f0f5fc;
    border: 1px solid var(--bm-line);
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
}
.bm-hs-card label { display: block; color: var(--bm-muted); font-size: 11px; margin-bottom: 4px; font-weight: 700; }
.bm-hs-card b { font-size: 18px; font-weight: 800; color: var(--bm-text); }
.bm-hs-card.is-pending b { color: #f0ad1d; }
.bm-hs-card.is-won b { color: #0a8043; }
.bm-hs-card.is-lost b { color: var(--bm-red); }
.bm-hs-card.is-pos b { color: #0a8043; }
.bm-hs-card.is-neg b { color: var(--bm-red); }

.bm-slips-list { display: flex; flex-direction: column; gap: 12px; }
.bm-slip-card {
    background: #fff;
    border: 1px solid var(--bm-line);
    border-left: 4px solid var(--bm-line);
    border-radius: 8px;
    overflow: hidden;
}
.bm-slip-card.is-pending { border-left-color: #f0ad1d; }
.bm-slip-card.is-won { border-left-color: #0a8043; background: linear-gradient(135deg, #e8f5ee, #fff); }
.bm-slip-card.is-lost { border-left-color: var(--bm-red); opacity: .85; }
.bm-slip-card.is-cancelled { border-left-color: #98a6b7; opacity: .7; }

.bm-slip-head {
    padding: 12px 16px;
    background: #fafbfd;
    border-bottom: 1px solid var(--bm-line);
    display: flex; align-items: center; gap: 12px;
    font-size: 13px;
}
.bm-slip-id { font-family: 'Roboto Mono', monospace; font-weight: 800; color: var(--bm-text); }
.bm-slip-status { font-weight: 700; }
.bm-slip-card.is-pending .bm-slip-status { color: #f0ad1d; }
.bm-slip-card.is-won .bm-slip-status { color: #0a8043; }
.bm-slip-card.is-lost .bm-slip-status { color: var(--bm-red); }
.bm-slip-date { margin-left: auto; color: var(--bm-muted); font-size: 12px; }
.bm-slip-cancel {
    background: var(--bm-red); color: #fff;
    border: 0; border-radius: 4px;
    padding: 4px 10px; cursor: pointer;
    font-size: 11px; font-weight: 700;
}
.bm-slip-cancel:hover { background: #c01a20; }

.bm-slip-picks { padding: 4px 16px; }
.bm-slip-pick {
    display: grid; grid-template-columns: 50px 1fr auto auto;
    gap: 12px; align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 13px;
}
.bm-slip-pick:last-child { border-bottom: 0; }
.bm-slip-pick.is-win { color: #0a8043; }
.bm-slip-pick.is-lose { color: var(--bm-red); text-decoration: line-through; opacity: .7; }
.bm-slip-pick-no {
    background: #f0f5fc; color: var(--bm-blue);
    padding: 3px 8px; border-radius: 4px;
    font-size: 11px; font-weight: 800;
    font-family: 'Roboto Mono', monospace;
    text-align: center;
}
.bm-slip-pick-match { font-weight: 700; }
.bm-slip-pick-type { color: var(--bm-muted); font-size: 11px; }
.bm-slip-pick-pick b { color: var(--bm-blue); }

.bm-toto-picks-display {
    padding: 10px 16px;
    display: flex; flex-wrap: wrap; gap: 4px;
    background: #fafbfd;
    border-bottom: 1px solid #eef2f7;
}
.bm-toto-pick-chip {
    background: #fff;
    border: 1px solid var(--bm-line);
    color: var(--bm-muted);
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 11px;
    font-family: 'Roboto Mono', monospace;
}
.bm-toto-pick-chip b {
    color: var(--bm-blue);
    font-weight: 800;
}

.bm-slip-foot {
    padding: 12px 16px;
    background: #fafbfd;
    border-top: 1px solid var(--bm-line);
    display: flex; gap: 24px;
    flex-wrap: wrap;
    font-size: 12px;
}
.bm-slip-foot > div { display: flex; flex-direction: column; gap: 2px; }
.bm-slip-foot span { color: var(--bm-muted); font-size: 10px; }
.bm-slip-foot strong { font-size: 14px; font-weight: 800; color: var(--bm-text); font-family: 'Roboto Mono', monospace; }
.bm-slip-payout { margin-left: auto; }
.bm-slip-payout strong { color: #0a8043; }

/* ============================================================
 * 모바일 호환성 (≤1180 / ≤768 / ≤540)
 * ============================================================ */

/* 모바일 전용 상단 바 (게임 셀렉트 + 내 베팅 내역 바로가기) */
.bm-mobile-bar { display: none; }
.bm-cart-fab { display: none; }
.bm-cart-mclose { display: none; }

@media (max-width: 1180px) {
    .bm-grid.bm-grid-3col {
        grid-template-columns: 230px minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    /* 헤더 */
    .bm-header-inner { padding: 14px 16px; gap: 12px; flex-direction: column; align-items: stretch; }
    .bm-brand { gap: 12px; }
    .bm-brand-logo { width: 44px; height: 44px; font-size: 22px; }
    .bm-brand-txt h1 { font-size: 17px; }
    .bm-brand-txt p { font-size: 12px; }
    .bm-brand-wallet { padding: 8px 12px; }
    .bm-wallet-amount { font-size: 16px; }

    /* 모바일 상단 바 — 셀렉트 + 내역 */
    .bm-mobile-bar {
        display: flex;
        gap: 8px;
        padding: 10px 12px;
        background: #fff;
        border-bottom: 1px solid var(--bm-line);
        position: sticky;
        top: 56px;
        z-index: 50;
    }
    .bm-mobile-game-sel {
        flex: 1;
        padding: 10px 12px;
        background: #f5f8fc;
        border: 1px solid var(--bm-line);
        border-radius: 8px;
        font-size: 13px;
        font-weight: 700;
        color: var(--bm-text);
        appearance: none;
        background-image: linear-gradient(45deg, transparent 50%, var(--bm-blue) 50%),
                          linear-gradient(135deg, var(--bm-blue) 50%, transparent 50%);
        background-position: calc(100% - 18px) center, calc(100% - 13px) center;
        background-size: 5px 5px, 5px 5px;
        background-repeat: no-repeat;
    }
    .bm-mobile-myslips {
        padding: 10px 14px;
        background: linear-gradient(135deg, #fff5d4, #ffd97d);
        color: #7a5400;
        text-decoration: none;
        border-radius: 8px;
        font-size: 13px; font-weight: 800;
        white-space: nowrap;
    }

    /* grid 1컬럼 + 좌측 사이드바 hide (모바일에선 셀렉트로 대체) */
    .bm-grid, .bm-grid.bm-grid-3col {
        grid-template-columns: 1fr !important;
        padding: 8px;
        gap: 10px;
    }
    .bm-sidebar { display: none !important; }
    .bm-main { padding: 14px 12px; }

    /* 베팅 슬립 카트 — 모바일 기본 숨김, FAB 클릭 시 노출 */
    .bm-cart {
        display: none !important;          /* 기본 숨김 */
        position: fixed !important;
        right: 0 !important; left: 0 !important; bottom: 0 !important;
        top: auto !important;
        width: 100% !important; max-width: 100% !important;
        max-height: 80vh;
        z-index: 9998;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -8px 32px rgba(0,0,0,.4);
        animation: bmCartSlideUp .25s ease-out;
    }
    .bm-cart.is-mobile-open {
        display: flex !important;          /* 열린 상태만 표시 */
    }
    @keyframes bmCartSlideUp {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    /* 카트 닫기 버튼 (모바일만 노출) */
    .bm-cart-mclose {
        display: inline-flex !important;
        background: transparent;
        border: 0;
        color: #fff;
        font-size: 26px; line-height: 1;
        cursor: pointer;
        padding: 0 4px;
        margin-left: auto;
    }

    /* floating FAB — 채팅 아이콘 */
    .bm-cart-fab {
        display: flex !important;
        position: fixed;
        right: 16px; bottom: 16px;
        width: 56px; height: 56px;
        border-radius: 50%;
        background: linear-gradient(135deg, var(--bm-blue), var(--bm-blue-deep));
        color: #fff;
        border: 0;
        font-size: 24px;
        cursor: pointer;
        box-shadow: 0 8px 24px rgba(26,109,255,.4);
        z-index: 9997;
        align-items: center; justify-content: center;
    }
    .bm-cart-fab:active { transform: scale(.95); }
    .bm-cart-fab-count {
        position: absolute;
        top: -4px; right: -4px;
        min-width: 22px; height: 22px;
        padding: 0 6px;
        background: var(--bm-red);
        color: #fff;
        border: 2px solid #fff;
        border-radius: 11px;
        font-size: 11px; font-weight: 900;
        font-family: 'Roboto Mono', monospace;
        display: flex; align-items: center; justify-content: center;
    }
    body.bm-cart-mobile-open { overflow: hidden; }

    /* 인트로 */
    .bm-intro-grid { grid-template-columns: 1fr; }
    .bm-sport-grid { grid-template-columns: 1fr; }

    /* 매치 헤더 — 3컬럼 → 1컬럼 stack */
    .bm-match-head {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px 12px;
        text-align: center;
    }
    .bm-match-meta { justify-content: center; flex-wrap: wrap; }
    .bm-match-teams { font-size: 15px; gap: 10px; }
    .bm-match-teams b { font-size: 16px; }
    .bm-match-pick-mark { justify-content: center; }

    /* 베팅 옵션 행 — 2줄 재배치 */
    .bm-bet-row {
        grid-template-columns: 50px 1fr 1fr 1fr;
        row-gap: 6px;
        padding: 10px 12px;
        font-size: 12px;
    }
    .bm-bet-no { grid-row: span 2; align-self: center; }
    .bm-bet-type { grid-column: span 3; }
    .bm-odds { min-height: 40px; }
    .bm-bet-row-pt2 { grid-template-columns: 50px 1fr 90px 100px; }
    .bm-bet-row-pt2 .bm-bet-no { grid-row: auto; }

    /* 토토 표 — 가로 스크롤 */
    .bm-toto-table {
        font-size: 11px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .bm-toto-table thead, .bm-toto-table tbody, .bm-toto-table tr { display: table; width: 100%; table-layout: fixed; }
    .bm-toto-table tbody { display: block; }
    .bm-toto-pick-cell span { width: 30px; height: 28px; font-size: 11px; }
    .bm-toto-team-h, .bm-toto-team-a { font-size: 11px; }

    /* 토토 슬립 등록 바 */
    .bm-toto-submit-bar { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px 14px; }
    .bm-toto-stake-wrap input { width: 100%; }
    .bm-toto-pick-status { margin-left: 0; text-align: center; }

    /* 상세 페이지 헤더 */
    .bm-detail-head { flex-direction: column; align-items: stretch; gap: 10px; }
    .bm-detail-info { grid-template-columns: 1fr; }
    .bm-detail-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .bm-d-tab { white-space: nowrap; padding: 9px 14px; font-size: 12px; }

    /* 슬립 페이지 */
    .bm-history-stats { grid-template-columns: repeat(2, 1fr); }
    .bm-slip-head { flex-wrap: wrap; }
    .bm-slip-pick { grid-template-columns: 40px 1fr; row-gap: 4px; }
    .bm-slip-pick-type, .bm-slip-pick-pick { grid-column: span 2; }
    .bm-slip-foot { gap: 12px 16px; }
}

@media (max-width: 540px) {
    /* 카트 — 화면 하단 풀와이드 */
    .bm-cart { right: 6px; left: 6px; bottom: 6px; width: auto; max-height: 60vh; }
    .bm-cart-head strong { font-size: 13px; }
    .bm-cart-body { padding: 8px 10px; }
    .bm-cart-foot { padding: 10px 14px; }

    /* 베팅 옵션 — 더 컴팩트 */
    .bm-bet-row { grid-template-columns: 44px 1fr 1fr; }
    .bm-bet-row .bm-bet-type { grid-column: span 2; }
    .bm-bet-row .bm-odds { padding: 4px 6px; min-height: 38px; }
    .bm-odds-val { font-size: 13px; }
    .bm-odds-label { font-size: 10px; }

    /* 매치 헤더 */
    .bm-match-time { font-size: 11px; padding: 3px 8px; }
    .bm-match-teams { font-size: 14px; gap: 8px; }
    .bm-match-teams b { font-size: 14px; }
    .bm-match-score { font-size: 14px; padding: 3px 10px; }

    /* 토토 표 — 더 작게 */
    .bm-toto-table { font-size: 10px; }
    .bm-toto-pick-cell span { width: 26px; height: 24px; font-size: 10px; }
    .bm-toto-table th, .bm-toto-table td { padding: 6px 4px; }

    /* 헤더 */
    .bm-brand-txt h1 { font-size: 16px; flex-wrap: wrap; }
    .bm-brand-tag { font-size: 10px; }
}

/* ============================================================
 * 반응형
 * ============================================================ */
@media (max-width: 980px) {
    .bm-grid { grid-template-columns: 1fr; }
    .bm-sidebar { position: static; }
    .bm-side-list { max-height: 360px; }
    .bm-intro-grid { grid-template-columns: 1fr; }
    .bm-detail-info { grid-template-columns: 1fr; }
    .bm-sport-grid { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
    .bm-header-inner { padding: 16px 18px; }
    .bm-brand-txt h1 { font-size: 18px; }
    .bm-main { padding: 16px; }
}

/* ============================================================
 * 경기 결과 / 경과 페이지 (?sub=results)
 * ============================================================ */
.bm-side-results {
    display: block;
    margin: 8px 10px 4px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #1a6dff, #0d52d4);
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(26,109,255,.25);
    transition: transform .15s, box-shadow .15s;
}
.bm-side-results:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,109,255,.35); }
.bm-side-results.is-active { background: linear-gradient(135deg, #ed1c24, #b50f15); box-shadow: 0 2px 8px rgba(237,28,36,.3); }
.bm-side-results span {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    opacity: .85;
    margin-top: 2px;
    letter-spacing: .02em;
}

.bm-mobile-results {
    flex-shrink: 0;
    padding: 9px 14px;
    background: linear-gradient(135deg, #1a6dff, #0d52d4);
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
}
.bm-mobile-results.is-active { background: linear-gradient(135deg, #ed1c24, #b50f15); }

.bm-results { padding: 4px 0 8px; }

.bm-rs-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
    padding: 18px 22px;
    background: linear-gradient(135deg, #fff, #eaf1fa);
    border: 1px solid var(--bm-line);
    border-radius: 12px;
    margin-bottom: 14px;
}
.bm-rs-title { display: flex; align-items: center; gap: 12px; flex: 1 1 auto; }
.bm-rs-emoji { font-size: 28px; }
.bm-rs-title h2 { margin: 0; font-size: 20px; color: var(--bm-text); font-weight: 900; letter-spacing: -.02em; }
.bm-rs-title small { color: var(--bm-muted); font-size: 12px; display: block; margin-top: 2px; }
.bm-rs-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.bm-rs-stat {
    background: #fff;
    border: 1px solid var(--bm-line);
    border-radius: 8px;
    padding: 8px 14px;
    text-align: center;
    min-width: 80px;
}
.bm-rs-stat label { display: block; font-size: 10.5px; color: var(--bm-muted); font-weight: 700; letter-spacing: .02em; }
.bm-rs-stat b { font-size: 19px; font-weight: 900; color: var(--bm-text); }
.bm-rs-stat.is-live { border-color: #ed1c24; }
.bm-rs-stat.is-live b { color: #ed1c24; }
.bm-rs-stat.is-sched { border-color: #1a6dff; }
.bm-rs-stat.is-sched b { color: #1a6dff; }
.bm-rs-stat.is-fin { border-color: #6a7a8c; }

.bm-rs-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 2px solid var(--bm-line);
    margin-bottom: 12px;
    padding: 0 4px;
}
.bm-rs-tab {
    padding: 10px 18px;
    background: transparent;
    color: var(--bm-muted);
    text-decoration: none;
    font-weight: 800;
    font-size: 13.5px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color .15s, border-color .15s;
    display: inline-flex; align-items: center; gap: 6px;
}
.bm-rs-tab i {
    font-style: normal;
    font-size: 11px;
    background: var(--bm-line);
    color: var(--bm-text);
    padding: 1px 7px;
    border-radius: 8px;
    font-weight: 800;
}
.bm-rs-tab:hover { color: var(--bm-text); }
.bm-rs-tab.is-active { color: var(--bm-blue-deep); border-bottom-color: var(--bm-blue-deep); }
.bm-rs-tab.is-active i { background: var(--bm-blue); color: #fff; }

.bm-rs-filters {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-bottom: 14px;
    padding: 0 4px;
}
.bm-rs-flt {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--bm-line);
    border-radius: 16px;
    color: var(--bm-text);
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    display: inline-flex; align-items: center; gap: 5px;
    transition: background .15s, border-color .15s;
}
.bm-rs-flt:hover { background: var(--bm-side); }
.bm-rs-flt.is-active {
    background: var(--bm-blue);
    border-color: var(--bm-blue);
    color: #fff;
}
.bm-rs-flt span { font-size: 14px; }
.bm-rs-total {
    margin-left: auto;
    font-size: 12px;
    color: var(--bm-muted);
    font-weight: 700;
}

.bm-rs-list { display: flex; flex-direction: column; gap: 14px; }
.bm-rs-empty {
    background: #fff;
    border: 1px dashed var(--bm-line);
    border-radius: 10px;
    padding: 38px 20px;
    text-align: center;
}
.bm-rs-empty p { margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--bm-text); }
.bm-rs-empty small { color: var(--bm-muted); }

.bm-rs-day {
    background: #fff;
    border: 1px solid var(--bm-line);
    border-radius: 10px;
    overflow: hidden;
}
.bm-rs-day-head {
    padding: 10px 16px;
    background: linear-gradient(180deg, #f5f8fc, #eaf0f7);
    border-bottom: 1px solid var(--bm-line);
    display: flex; align-items: center; justify-content: space-between;
}
.bm-rs-day-head strong { font-size: 13.5px; font-weight: 900; color: var(--bm-text); letter-spacing: -.01em; }
.bm-rs-day-head span { font-size: 11.5px; color: var(--bm-muted); font-weight: 700; }

.bm-rs-league { border-top: 1px solid var(--bm-line); }
.bm-rs-league:first-child { border-top: 0; }
.bm-rs-league-head {
    padding: 8px 16px;
    background: #fafcff;
    display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--bm-line);
    border-left: 3px solid var(--bm-rs-acc, var(--bm-blue));
}
.bm-rs-league-emoji { font-size: 15px; }
.bm-rs-league-head strong { font-size: 12.5px; font-weight: 800; color: var(--bm-text); }
.bm-rs-league-head small { font-size: 11px; color: var(--bm-muted); margin-left: auto; font-weight: 700; }

.bm-rs-matches { list-style: none; margin: 0; padding: 0; }
.bm-rs-row {
    display: grid;
    grid-template-columns: 90px 1fr 90px;
    gap: 10px;
    align-items: center;
    padding: 11px 16px;
    border-top: 1px solid #f0f3f8;
}
.bm-rs-row:first-child { border-top: 0; }
.bm-rs-row.is-live { background: linear-gradient(90deg, rgba(237,28,36,.04), transparent 60%); }
.bm-rs-row.is-fin  { color: var(--bm-muted); }
.bm-rs-row.is-fin .bm-rs-team { color: var(--bm-text); font-weight: 700; }

.bm-rs-time { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.bm-rs-time > span { font-size: 13px; font-weight: 800; color: var(--bm-text); }
.bm-rs-time em {
    font-style: normal;
    font-size: 10.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    letter-spacing: .03em;
}
.bm-rs-livedot {
    background: #ed1c24; color: #fff;
    position: relative; padding-left: 16px !important;
}
.bm-rs-livedot::before {
    content: ''; position: absolute; left: 6px; top: 50%; transform: translateY(-50%);
    width: 6px; height: 6px; border-radius: 50%; background: #fff;
    animation: bmRsBlink .9s ease-in-out infinite;
}
@keyframes bmRsBlink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.bm-rs-fin   { background: #e6ebf2; color: #6a7a8c; }
.bm-rs-sched { background: #e0eeff; color: #0d52d4; }

.bm-rs-teams {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
}
.bm-rs-team { font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.bm-rs-home { text-align: right; }
.bm-rs-away { text-align: left; }
.bm-rs-vs { font-size: 12px; color: var(--bm-muted); font-weight: 700; }
.bm-rs-score {
    display: inline-flex; align-items: center; gap: 6px;
    font-weight: 900; font-size: 17px;
    color: var(--bm-text);
    padding: 3px 10px;
    background: #f5f8fc;
    border-radius: 6px;
}
.bm-rs-row.is-live .bm-rs-score { background: #ffeded; color: #ed1c24; }
.bm-rs-score b.is-win  { color: var(--bm-blue-deep); }
.bm-rs-score b.is-lose { color: #b8c1ce; font-weight: 700; }
.bm-rs-score i { font-style: normal; color: var(--bm-muted); font-weight: 700; font-size: 13px; }

.bm-rs-result { text-align: right; }
.bm-rs-badge {
    display: inline-block;
    font-size: 11px; font-weight: 800;
    padding: 3px 9px;
    border-radius: 4px;
    letter-spacing: .02em;
}
.bm-rs-w { background: #e0eeff; color: #0d52d4; }
.bm-rs-d { background: #f5e7d8; color: #8a5a14; }
.bm-rs-l { background: #ffe2dc; color: #c41019; }

.bm-rs-foot {
    margin-top: 14px;
    padding: 10px 14px;
    text-align: center;
    color: var(--bm-muted);
    font-size: 11.5px;
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.bm-rs-autoupdate { color: #ed1c24; font-weight: 700; }

@media (max-width: 720px) {
    .bm-rs-head { padding: 14px 16px; }
    .bm-rs-title h2 { font-size: 17px; }
    .bm-rs-stat { padding: 6px 10px; min-width: 64px; }
    .bm-rs-stat b { font-size: 16px; }
    .bm-rs-tab { padding: 8px 12px; font-size: 12.5px; }
    .bm-rs-row {
        grid-template-columns: 64px 1fr;
        gap: 8px; padding: 10px 12px;
    }
    .bm-rs-result { grid-column: 1 / -1; text-align: right; }
    .bm-rs-time > span { font-size: 12px; }
    .bm-rs-team { font-size: 12.5px; }
    .bm-rs-score { font-size: 15px; padding: 2px 8px; }
}

/* ============================================================
 * 베팅 패턴 분석 위젯 (마이페이지)
 * ============================================================ */
.bm-pattern {
    background: linear-gradient(180deg, #fbf7ff 0%, #fdfdff 100%);
    border: 1px solid #e7d9ff;
    border-radius: 14px;
    padding: 18px 20px;
    margin: 18px 0 20px;
    box-shadow: 0 2px 12px rgba(162, 89, 255, .08);
}
.bm-pattern-head {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #e0d0ff;
}
.bm-pattern-emoji { font-size: 22px; line-height: 1; }
.bm-pattern-head h3 {
    margin: 0; font-size: 15px; font-weight: 800; color: #4a2c8c;
    letter-spacing: -.2px;
}
.bm-pattern-head small { margin-left: auto; color: #8b6fbe; font-size: 11.5px; font-weight: 600; }

.bm-pattern-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}
.bm-pp-card {
    background: #fff;
    border: 1px solid #ece2ff;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    transition: transform .12s, box-shadow .12s;
}
.bm-pp-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(162, 89, 255, .12); }
.bm-pp-card label {
    display: block;
    font-size: 11px; font-weight: 700;
    color: #8b6fbe;
    margin-bottom: 6px;
    letter-spacing: -.1px;
}
.bm-pp-big {
    display: block;
    font-size: 17px; font-weight: 800;
    color: #2c1654;
    line-height: 1.2;
    margin-bottom: 4px;
}
.bm-pp-em { margin-right: 4px; }
.bm-pp-sub {
    display: block;
    font-size: 10.5px; color: #9486b3; font-weight: 600;
}
.bm-pp-card.is-accent { background: linear-gradient(135deg, #fff8db 0%, #fff 100%); border-color: #f0d878; }
.bm-pp-card.is-accent .bm-pp-big { color: #b88300; }
.bm-pp-card.is-pos .bm-pp-big { color: #0a8043; }

.bm-pp-bars {
    background: #fff;
    border: 1px solid #ece2ff;
    border-radius: 10px;
    padding: 14px 16px;
}
.bm-pp-bars-title {
    font-size: 12px; font-weight: 800;
    color: #4a2c8c;
    margin-bottom: 10px;
}
.bm-pp-bar-row {
    display: grid;
    grid-template-columns: 24px 70px 1fr 60px 80px;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: 12px;
}
.bm-pp-bar-em { font-size: 16px; text-align: center; }
.bm-pp-bar-name { font-weight: 700; color: #2c1654; }
.bm-pp-bar-track {
    height: 8px;
    background: #f0e7ff;
    border-radius: 4px;
    overflow: hidden;
}
.bm-pp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #a259ff 0%, #c490ff 100%);
    border-radius: 4px;
    transition: width .4s ease-out;
}
.bm-pp-bar-cnt { color: #6b5894; font-weight: 700; text-align: right; }
.bm-pp-bar-wr { color: #8b6fbe; font-weight: 700; text-align: right; font-size: 11.5px; }
.bm-pp-bar-wr.is-pos { color: #0a8043; }

/* 다크 모드 (BETMAN 외부에서 로드되는 경우 보호) */
body.spk-dark-shell .bm-pattern {
    background: linear-gradient(180deg, #1a1530 0%, #14101e 100%);
    border-color: #3a2a5e;
}
body.spk-dark-shell .bm-pattern-head h3 { color: #d4b8ff; }
body.spk-dark-shell .bm-pattern-head small { color: #9586b3; }
body.spk-dark-shell .bm-pattern-head { border-bottom-color: #3a2a5e; }
body.spk-dark-shell .bm-pp-card,
body.spk-dark-shell .bm-pp-bars { background: #1f1934; border-color: #3a2a5e; }
body.spk-dark-shell .bm-pp-big { color: #f0e7ff; }
body.spk-dark-shell .bm-pp-bar-name { color: #f0e7ff; }
body.spk-dark-shell .bm-pp-bar-track { background: #2a2143; }
body.spk-dark-shell .bm-pp-card.is-accent { background: linear-gradient(135deg, #3d2f10 0%, #1f1934 100%); border-color: #8a6a1d; }
body.spk-dark-shell .bm-pp-card.is-accent .bm-pp-big { color: #f0d878; }

@media (max-width: 900px) {
    .bm-pattern-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
    .bm-pattern-grid { grid-template-columns: repeat(2, 1fr); }
    .bm-pp-bar-row { grid-template-columns: 22px 60px 1fr 60px; }
    .bm-pp-bar-wr { display: none; }
    .bm-pattern-head small { display: none; }
}
