/* SPOKAZ BET Room - Parlay Layout */
.bet-wrap { width: 100%; }

.bet-header {
    background: linear-gradient(135deg, #0c2d5e, #1a6dff);
    border-radius: var(--spk-radius);
    padding: 18px 22px; color: #fff; margin-bottom: 12px;
    box-shadow: 0 4px 20px rgba(26,109,255,.25);
}
.bet-header h2 { margin: 0 0 4px; font-size: 22px; font-weight: 900; letter-spacing: 1px; }
.bet-header p { margin: 0; font-size: 12px; color: rgba(255,255,255,0.75); }

.bet-balance-bar {
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(135deg, #ffcc33, #ff9900);
    border-radius: var(--spk-radius);
    padding: 12px 18px; margin-bottom: 12px; color: #000;
    box-shadow: 0 4px 14px rgba(255,153,0,.2);
}
.bet-balance-label { font-size: 12px; font-weight: 700; color: #663300; }
.bet-balance-amount { font-size: 20px; font-weight: 900; color: #000; letter-spacing: 1px; }
.bet-balance-guest { font-size: 13px; font-weight: 700; color: #663300; letter-spacing: 0; }

/* 사용설명서 버튼 — 보유 포인트 오른쪽 */
.bet-help-btn {
    margin-left: auto;
    padding: 8px 16px;
    border: 1.5px solid rgba(0,0,0,.2);
    border-radius: 8px;
    background: rgba(255,255,255,.85);
    color: #663300;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.bet-help-btn i { margin-right: 4px; }
.bet-help-btn:hover {
    background: #fff;
    color: #c14800;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
}

/* 모달 */
.bet-help-modal {
    position: fixed; inset: 0;
    z-index: 9999;
    background: rgba(2, 6, 18, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: betHelpIn .18s ease;
}
.bet-help-modal[hidden] { display: none; }
@keyframes betHelpIn { from { opacity: 0; } to { opacity: 1; } }
.bet-help-box {
    width: min(880px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}
.bet-help-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0c2d5e, #1a6dff);
    color: #fff;
}
.bet-help-head strong { font-size: 16px; font-weight: 900; letter-spacing: -.01em; }
.bet-help-head strong i { margin-right: 6px; }
.bet-help-close {
    width: 32px; height: 32px;
    border: 0;
    background: rgba(255,255,255,.15);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}
.bet-help-close:hover { background: rgba(255,255,255,.3); }

.bet-help-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px 30px;
    background: #fafcff;
    font-size: 13px;
    line-height: 1.7;
    color: #2c3e50;
}
.bet-help-body .help-intro {
    background: linear-gradient(135deg, #eaf2ff, #f3f7fc);
    border-left: 4px solid var(--spk-primary);
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 18px;
}
.bet-help-body .help-intro h3 {
    margin: 0 0 6px;
    font-size: 17px; font-weight: 900;
    color: var(--spk-primary-deep);
    letter-spacing: -.01em;
}
.bet-help-body .help-intro p { margin: 0 0 6px; color: #4a5d74; font-size: 13px; }
.bet-help-body .help-intro p:last-child { margin: 0; }

.bet-help-body .help-sec {
    margin: 14px 0;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--spk-line);
    border-radius: 10px;
}
.bet-help-body .help-sec h4 {
    margin: 0 0 10px;
    font-size: 14.5px; font-weight: 800;
    color: var(--spk-primary-deep);
}
.bet-help-body .help-sec h5 {
    margin: 14px 0 6px;
    font-size: 12.5px; font-weight: 800;
    color: var(--spk-primary);
}
.bet-help-body .help-sec p { margin: 0 0 8px; }
.bet-help-body .help-sec ul,
.bet-help-body .help-sec ol { margin: 8px 0 0; padding-left: 22px; }
.bet-help-body .help-sec li { margin-bottom: 6px; }
.bet-help-body .help-sec b { color: var(--spk-primary-deep); font-weight: 800; }
.bet-help-body .hl-red  { color: #cc2233; font-weight: 900; }
.bet-help-body .hl-blue { color: var(--spk-primary); font-weight: 900; }

.bet-help-body .hl-chip {
    display: inline-block;
    min-width: 40px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    text-align: center;
    margin: 0 1px;
}
.bet-help-body .hl-chip.hl-home { background: #1a6dff; }
.bet-help-body .hl-chip.hl-away { background: #cc2233; }
.bet-help-body .hl-chip.hl-draw { background: #98a6b7; }

.bet-help-body .hl-tip {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fff9e6;
    border-left: 4px solid #f4b400;
    border-radius: 6px;
    font-size: 12.5px;
    color: #6b5b00;
}

/* ⭐ 조합 베팅 핵심 섹션 */
.bet-help-body .help-highlight {
    background: linear-gradient(135deg, #fff4e6, #ffe0b3);
    border: 2px solid #ff6b00;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(255,107,0,0.15);
}
.bet-help-body .help-highlight h4 {
    color: #c14800;
    font-size: 15.5px;
}
.bet-help-body .hl-box {
    margin: 12px 0;
    padding: 14px 18px;
    background: #fff;
    border: 1.5px dashed #ff6b00;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.9;
    color: #2c3e50;
}
.bet-help-body .hl-box b { font-weight: 900; }

.bet-help-body .help-tip-sec {
    background: linear-gradient(135deg, #f5fffa, #e6fff0);
    border-color: #0abf53;
}
.bet-help-body .help-tip-sec h4 { color: #067838; }

.bet-help-body .help-disclaimer {
    background: #fff4f4;
    border-color: #f4c2c2;
}
.bet-help-body .help-disclaimer p { font-size: 12px; color: #7a3b3b; }

@media (max-width: 600px) {
    .bet-help-body { padding: 14px 16px 24px; }
    .bet-help-body .help-sec { padding: 12px 14px; }
    .bet-balance-bar { flex-wrap: wrap; }
    .bet-help-btn { margin-left: auto; }
}

/* 70/30 레이아웃 */
.bet-layout {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 12px;
    align-items: start;
}
.bet-main { min-width: 0; }
.bet-side { position: sticky; top: 10px; display: flex; flex-direction: column; gap: 10px; }

.bet-main-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 14px; margin-bottom: 8px;
    background: var(--spk-card); border-radius: 10px;
    box-shadow: var(--spk-shadow);
}
.bet-main-title { font-weight: 900; color: var(--spk-text); font-size: 14px; }
.bet-main-sub { font-size: 12px; color: var(--spk-muted); font-weight: 700; }

/* 경기 카드 */
.bet-events {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 8px;
}
.bet-loading, .bet-empty {
    padding: 30px; text-align: center; color: var(--spk-muted); font-size: 12px;
    background: var(--spk-card); border-radius: var(--spk-radius);
}
.bet-card {
    background: var(--spk-card); border-radius: 10px;
    padding: 10px; box-shadow: var(--spk-shadow);
    border: 1px solid var(--spk-line);
    transition: border-color .12s;
}
.bet-card-top {
    display: flex; align-items: center; gap: 6px;
    font-size: 10px; color: var(--spk-muted); margin-bottom: 6px;
    padding-bottom: 6px; border-bottom: 1px solid var(--spk-line);
}
.bet-league-logo { width: 14px; height: 14px; object-fit: contain; }
.bet-league { font-weight: 700; color: var(--spk-primary); }
.bet-time { margin-left: auto; font-weight: 700; color: var(--spk-text); }

.bet-card-body { display: flex; flex-direction: column; gap: 4px; }

/* 홈/원정을 배당 위쪽 좌/우로 배치 */
.bet-teams-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    align-items: center;
    margin-bottom: 2px;
}
.bet-team {
    display: flex; align-items: center; gap: 5px;
    font-size: 12px; font-weight: 700; color: var(--spk-text);
    min-width: 0;
}
.bet-team img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.bet-team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bet-team-home { justify-content: flex-start; }
.bet-team-away { justify-content: flex-end; text-align: right; }

/* 최근 폼 (W/D/L 아이콘) */
.bet-forms-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4px; margin-bottom: 2px;
}
.bet-form { display: flex; align-items: center; gap: 2px; }
.bet-form-home { justify-content: flex-start; }
.bet-form-away { justify-content: flex-end; }
.fm {
    display: inline-flex; align-items: center; justify-content: center;
    width: 14px; height: 14px; border-radius: 3px;
    font-size: 9px; font-weight: 900; color: #fff;
}
.fm-w { background: #00c864; }
.fm-d { background: #888; }
.fm-l { background: #dc283c; }
.fm-none { font-size: 10px; color: var(--spk-muted); }

.bet-picks { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; margin-top: 4px; }
.bet-pick {
    padding: 6px 2px; border: 1.5px solid var(--spk-line); border-radius: 6px;
    background: var(--spk-card); cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    transition: all .15s;
}
.bet-pick span { font-size: 10px; color: var(--spk-muted); font-weight: 800; }
.bet-pick b { font-size: 12px; color: var(--spk-text); font-weight: 900; }
.bet-pick:hover { background: rgba(61,26,95,.08); border-color: #3d1a5f; }
.bet-pick.active {
    background: linear-gradient(135deg, #3d1a5f, #6a2dd5); border-color: #3d1a5f;
}
.bet-pick.active span, .bet-pick.active b { color: #fff; }

/* 사이드 카드 */
.bet-side-card {
    background: var(--spk-card); border-radius: 12px;
    box-shadow: var(--spk-shadow);
    border: 1px solid var(--spk-line);
    overflow: hidden;
}
.bet-side-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 12px;
    background: linear-gradient(135deg, #1a0a28, #3d1a5f);
    color: #fff; font-size: 12px; font-weight: 800;
}
.bet-slip-count {
    background: rgba(255,255,255,.18);
    padding: 2px 8px; border-radius: 10px; font-size: 11px;
}

/* 슬립 */
.bet-slip-list { max-height: 380px; overflow-y: auto; padding: 8px; }
.bet-empty-mini { padding: 18px 10px; text-align: center; color: var(--spk-muted); font-size: 11px; }
.bet-slip-item {
    position: relative; padding: 8px 22px 8px 8px; margin-bottom: 4px;
    background: var(--spk-bg); border-radius: 6px; font-size: 11px;
    border: 1px solid var(--spk-line);
}
.bet-slip-x {
    position: absolute; top: 4px; right: 4px;
    width: 18px; height: 18px; border: none; background: rgba(220,40,60,.12);
    color: #dc283c; border-radius: 4px; cursor: pointer; font-weight: 700;
}
.bet-slip-match { font-size: 11px; color: var(--spk-text); font-weight: 700; margin-bottom: 2px; line-height: 1.3; }
.bet-slip-pick { display: flex; justify-content: space-between; }
.bet-slip-pick span { color: var(--spk-muted); font-size: 10px; }
.bet-slip-pick b { color: #3d1a5f; font-weight: 900; }

.bet-slip-stats {
    display: flex; justify-content: space-between;
    padding: 10px 12px;
    border-top: 1px solid var(--spk-line);
}
.bet-slip-stat { display: flex; justify-content: space-between; width: 100%; font-size: 12px; }
.bet-slip-stat span { color: var(--spk-muted); font-weight: 700; }
.bet-slip-stat b { color: #3d1a5f; font-weight: 900; font-size: 15px; }

.bet-slip-stake { padding: 8px 12px; border-top: 1px solid var(--spk-line); }
.bet-slip-stake label { display: block; font-size: 11px; color: var(--spk-muted); font-weight: 700; margin-bottom: 4px; }
.bet-slip-stake input {
    width: 100%; padding: 8px 10px; border: 1.5px solid var(--spk-line);
    border-radius: 6px; font-size: 14px; font-weight: 800; box-sizing: border-box;
}
.bet-slip-stake input:disabled { background: #f0f0f0; color: #999; }

.bet-stake-shortcuts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3px; margin-top: 5px; }
.bet-stake-shortcuts button {
    padding: 5px 0; border: 1px solid var(--spk-line); border-radius: 4px;
    background: var(--spk-card); cursor: pointer; font-size: 10px; font-weight: 700;
}
.bet-stake-shortcuts button:hover { background: #3d1a5f; color: #fff; border-color: #3d1a5f; }

.bet-slip-potential {
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(255,204,51,.15), rgba(255,153,0,.15));
    font-size: 12px; color: #663300; font-weight: 700;
    display: flex; justify-content: space-between; align-items: center;
}
.bet-slip-potential b { color: #d4930b; font-size: 15px; font-weight: 900; }

.bet-confirm-btn {
    display: block; width: 100%;
    padding: 12px 0; border: none;
    background: linear-gradient(135deg, #3d1a5f, #6a2dd5);
    color: #fff; font-size: 13px; font-weight: 900; cursor: pointer; letter-spacing: 1px;
    transition: opacity .15s;
    text-align: center; text-decoration: none;
}
.bet-confirm-btn:disabled { opacity: .5; cursor: default; }
.bet-confirm-btn.disabled { background: #888; }

.bet-slip-msg { padding: 6px 12px; font-size: 11px; text-align: center; font-weight: 700; min-height: 22px; }
.bet-slip-msg.is-err { color: #dc283c; background: rgba(220,40,60,.08); }
.bet-slip-msg.is-ok { color: #00a060; background: rgba(0,200,100,.08); }

/* 내 베팅 */
.bet-my-list { max-height: 340px; overflow-y: auto; padding: 6px; }
.bet-my-item {
    padding: 8px; margin-bottom: 4px;
    background: var(--spk-bg); border-radius: 6px; font-size: 11px;
    border-left: 3px solid var(--spk-muted);
}
.bet-my-item.bs-pending { border-color: #ffb400; }
.bet-my-item.bs-won { border-color: #00c864; }
.bet-my-item.bs-lost { border-color: #dc283c; }
.bet-my-top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 2px; }
.bet-my-top span:first-child { color: var(--spk-text); }
.bet-my-status { font-size: 10px; padding: 1px 6px; border-radius: 8px; background: rgba(0,0,0,.05); }
.bs-pending .bet-my-status { background: rgba(255,180,0,.15); color: #b88400; }
.bs-won .bet-my-status { background: rgba(0,200,100,.15); color: #00a050; }
.bs-lost .bet-my-status { background: rgba(220,40,60,.15); color: #dc283c; }
.bet-my-bottom { color: var(--spk-muted); font-size: 10px; padding-top: 4px; border-top: 1px dashed var(--spk-line); margin-top: 4px; }
.bet-my-bottom b { font-weight: 900;color: #dc283c; font-size:1.3em }
.bs-won-txt { color: #00c864; }
.bs-lost-txt { color: #dc283c; }

/* 슬립 내 경기 상세 */
.bet-my-picks { margin: 5px 0 4px; display: flex; flex-direction: column; gap: 3px; }
.bet-my-pick {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 6px; background: rgba(0,0,0,.03); border-radius: 4px;
    font-size: 10px; gap: 6px;
}
.bmp-teams { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1; }
.bmp-mark { font-weight: 900; flex-shrink: 0; width: 10px; text-align: center; color: var(--spk-muted); }
.bmp-match { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--spk-text); font-weight: 700; }
.bmp-score {
    flex-shrink: 0; padding: 1px 5px; border-radius: 4px;
    background: var(--spk-text); color: #fff; font-weight: 900; font-size: 10px;
}
.bmp-pick { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.bmp-pick span { color: var(--spk-muted); font-size: 9px; font-weight: 700; }
.bmp-pick b { color: #3d1a5f; font-weight: 900; font-size: 11px; }

.pst-won .bmp-mark { color: #00c864; }
.pst-lost .bmp-mark { color: #dc283c; }
.pst-won { background: rgba(0,200,100,.06); }
.pst-lost { background: rgba(220,40,60,.06); }

/* 랭킹 */
.bet-ranking-list { padding: 6px; }
.bet-rank-row {
    display: grid; grid-template-columns: 20px 1fr auto;
    align-items: center; gap: 6px;
    padding: 5px 6px; font-size: 11px;
    border-bottom: 1px solid var(--spk-line);
}
.bet-rank-row:last-child { border-bottom: none; }
.rk-i { font-weight: 900; color: var(--spk-muted); text-align: center; }
.rk-n { color: var(--spk-text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-p { font-weight: 800; text-align: right; }
.rp-pos { color: #00c864; }
.rp-neg { color: #dc283c; }

/* 모바일: 사이드를 아래로 */
@media (max-width: 900px) {
    .bet-layout { grid-template-columns: 1fr; }
    .bet-side { position: static; }
    .bet-events { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .bet-events { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════
   모바일 전용: 베팅슬립 / 내 베팅 플로팅 버튼 + 바텀시트 모달
   ═══════════════════════════════════════════════════════════════════ */
.bet-m-overlay,
.bet-m-actions { display: none; }

@media (max-width: 768px) {
    /* 사이드 숨김 (기본) */
    .bet-side {
        display: none !important;
    }

    /* 하단 플로팅 액션 버튼 */
    .bet-m-actions {
        display: flex;
        gap: 8px;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(74px + env(safe-area-inset-bottom)); /* 바텀탭 위 */
        z-index: 920;
    }
    .bet-m-action-btn {
        flex: 1;
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 46px;
        padding: 0 14px;
        border: 0;
        border-radius: 999px;
        font-family: inherit;
        font-size: 13px;
        font-weight: 800;
        color: #fff;
        cursor: pointer;
        box-shadow: 0 8px 18px rgba(0,0,0,0.22);
    }
    .bet-m-action-btn.is-slip {
        background: linear-gradient(135deg, #1a6dff, #0c2d5e);
    }
    .bet-m-action-btn.is-mybets {
        background: linear-gradient(135deg, #0abf53, #067a34);
    }
    .bet-m-action-btn:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
    .bet-m-action-btn i { font-size: 15px; }
    .bet-m-badge {
        min-width: 20px;
        padding: 2px 6px;
        border-radius: 10px;
        background: #ff4757;
        color: #fff;
        font-size: 10px;
        font-weight: 900;
        line-height: 1.2;
        display: none; /* JS가 개수에 따라 표시 */
    }

    /* 오버레이 */
    .bet-m-overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.55);
        z-index: 9990;
    }
    body.bet-m-slip-open .bet-m-overlay,
    body.bet-m-mybets-open .bet-m-overlay {
        display: block;
    }

    /* 열렸을 때 해당 카드를 바텀시트로 노출 */
    body.bet-m-slip-open .bet-side,
    body.bet-m-mybets-open .bet-side {
        display: block !important;
        position: fixed;
        left: 0; right: 0;
        bottom: 0;
        top: auto;
        max-height: 80vh;
        background: #fff;
        border-top-left-radius: 18px;
        border-top-right-radius: 18px;
        box-shadow: 0 -8px 28px rgba(0,0,0,0.3);
        overflow-y: auto;
        padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
        z-index: 9991;
        animation: betMobSheetIn .25s cubic-bezier(.2,.9,.3,1.2);
    }
    @keyframes betMobSheetIn {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    /* 각 상태에서 표시될 카드만 보이게 */
    body.bet-m-slip-open .bet-side .bet-side-card { display: none; }
    body.bet-m-slip-open .bet-side .bet-slip-card { display: block; }

    body.bet-m-mybets-open .bet-side .bet-side-card { display: none; }
    body.bet-m-mybets-open .bet-side .bet-mybets-card { display: block; }

    /* 바텀시트 그립 바 (상단 인디케이터) */
    body.bet-m-slip-open .bet-side::before,
    body.bet-m-mybets-open .bet-side::before {
        content: '';
        display: block;
        width: 40px; height: 4px;
        margin: 4px auto 10px;
        background: #d0d8e2;
        border-radius: 2px;
    }

    /* 카드 내부 여백 조정 (풀폭 활용) */
    body.bet-m-slip-open .bet-slip-card,
    body.bet-m-mybets-open .bet-mybets-card {
        margin: 0;
        border: 0;
        box-shadow: none;
    }
}
