/* Mega Stake user-selectable dark theme. Loaded after page styles where possible. */
html[data-theme="dark"] {
    --bb-ink: #ffffff;
    --bb-muted: #c4cad3;
    --bb-page: #101318;
    --bb-card: #1c2129;
    --bb-line: #3a424e;
    --bb-green-soft: #17351e;
    --bg-main: #101318;
    --bg-card: #1c2129;
    --bg-card2: #252b35;
    --text-main: #ffffff;
    --text-dim: #c4cad3;
    --border: #3a424e;
    --nav-bg: rgba(18, 20, 25, .97);
    color-scheme: dark;
}

/* Keep secondary copy readable instead of low-contrast grey on dark cards. */
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    color: #f8fafc !important;
    caret-color: #ffdf00;
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #9fa8b5 !important; opacity: 1; }
html[data-theme="dark"] option { background: #20252d; color: #f8fafc; }

html[data-theme="dark"],
html[data-theme="dark"] body {
    background: #101318 !important;
    color: #fbfcfe !important;
}

html[data-theme="dark"] .bb-shell,
html[data-theme="dark"] .matches-app,
html[data-theme="dark"] .ob-container,
html[data-theme="dark"] .open-list,
html[data-theme="dark"] .games-wrap {
    background: #101318 !important;
    color: #fbfcfe !important;
}

html[data-theme="dark"] .bb-quick-tabs,
html[data-theme="dark"] .featured-panel,
html[data-theme="dark"] .sportsbook-live,
html[data-theme="dark"] .highlights-panel,
html[data-theme="dark"] .highlights-feed,
html[data-theme="dark"] .match-controls,
html[data-theme="dark"] .match-list,
html[data-theme="dark"] .market-rail,
html[data-theme="dark"] .filter-row,
html[data-theme="dark"] .results-note,
html[data-theme="dark"] .odds-heading {
    background: #15181d !important;
    border-color: #2b3038 !important;
    color: #c7cdd6 !important;
}

html[data-theme="dark"] .bb-quick-tab,
html[data-theme="dark"] .league-tab,
html[data-theme="dark"] .action-tab,
html[data-theme="dark"] .market-pill,
html[data-theme="dark"] .filter-control,
html[data-theme="dark"] .sport-tab i {
    background: #20242b !important;
    border-color: #303640 !important;
    color: #edf0f4 !important;
}

html[data-theme="dark"] .market-pill.active,
html[data-theme="dark"] .action-tab.active {
    background: #ffdf00 !important;
    color: #252832 !important;
}

html[data-theme="dark"] .match-card,
html[data-theme="dark"] .today-card,
html[data-theme="dark"] .popular-card,
html[data-theme="dark"] .match-row,
html[data-theme="dark"] .bb-jackpot-card {
    background: linear-gradient(110deg, #1b1e24 0%, #171a1f 72%) !important;
    border: 1px solid rgba(255,255,255,.18) !important;
    border-left-color: rgba(255,255,255,.42) !important;
    color: #fbfcfe !important;
    box-shadow: inset 1px 0 rgba(255,255,255,.08), 0 5px 18px rgba(0,0,0,.24) !important;
}

html[data-theme="dark"] .hdr-theme-btn {
    color: #20232b !important;
    background: rgba(255,255,255,.24) !important;
    border: 1px solid rgba(32,35,43,.16) !important;
}

html[data-theme="dark"] .team-name,
html[data-theme="dark"] .team-line strong,
html[data-theme="dark"] .featured-side strong,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .match-card .team-name {
    color: #ffffff !important;
}

html[data-theme="dark"] .match-time,
html[data-theme="dark"] .match-league,
html[data-theme="dark"] .match-foot,
html[data-theme="dark"] .league-name,
html[data-theme="dark"] .section-sub {
    color: #c4cad3 !important;
}

html[data-theme="dark"] .odd-btn,
html[data-theme="dark"] .odd-cell {
    background: #173a21 !important;
    border-color: #285231 !important;
    color: #55df70 !important;
}

html[data-theme="dark"] .odd-btn.selected,
html[data-theme="dark"] .odd-cell.selected {
    background: #08a918 !important;
    color: #fff !important;
}

html[data-theme="dark"] .nav-wrapper {
    background: rgba(18,20,25,.97) !important;
    border-color: #30343c !important;
    box-shadow: 0 -5px 18px rgba(0,0,0,.28) !important;
}

html[data-theme="dark"] .nav-icon,
html[data-theme="dark"] .nav-label { color: #c8ced7 !important; opacity: 1 !important; }
html[data-theme="dark"] .nav-item.active .nav-icon,
html[data-theme="dark"] .nav-item.active .nav-label { color: #37d54b !important; }

/* Account page */
html[data-theme="dark"] body.me-page { background: #090b0e !important; color: #f5f6f8 !important; }
html[data-theme="dark"] .me-shell {
    background: radial-gradient(circle at 86% 0, rgba(47,150,67,.22), transparent 145px),
                radial-gradient(circle at 38% 0, rgba(255,232,23,.10), transparent 122px), #0f1115 !important;
}
html[data-theme="dark"] .me-user-handle,
html[data-theme="dark"] .me-top-action,
html[data-theme="dark"] .me-reward-item,
html[data-theme="dark"] .me-affiliate,
html[data-theme="dark"] .me-tool,
html[data-theme="dark"] .me-brand { color: #f2f4f7 !important; }
html[data-theme="dark"] .me-wallet,
html[data-theme="dark"] .me-reward-card,
html[data-theme="dark"] .me-affiliate,
html[data-theme="dark"] .me-tools,
html[data-theme="dark"] .me-settings-sheet {
    background: #191c22 !important;
    border: 1px solid #2d323b;
    box-shadow: 0 8px 24px rgba(0,0,0,.24);
}
html[data-theme="dark"] .me-wallet-main { background: #ffdf00 !important; border: 0; box-shadow: none; }
html[data-theme="dark"] .me-bps { color: #f2f4f7 !important; }
html[data-theme="dark"] .me-reward-label { background: #4b4214 !important; color: #fff1a0 !important; }
html[data-theme="dark"] .me-reward-card.casino .me-reward-label { background: #173d21 !important; color: #77e78b !important; }
html[data-theme="dark"] .me-tool i { color: #d6dae1 !important; }
html[data-theme="dark"] .me-tool.theme-control,
html[data-theme="dark"] .me-tool.theme-control i { color: #ffdf00 !important; }
html[data-theme="dark"] .me-tool.logout,
html[data-theme="dark"] .me-tool.logout i { color: #ff6b72 !important; }
html[data-theme="dark"] .me-settings-close,
html[data-theme="dark"] .form-control,
html[data-theme="dark"] .me-install-step {
    background: #23272e !important;
    border-color: #353b45 !important;
    color: #f2f4f7 !important;
}
html[data-theme="dark"] .form-group label,
html[data-theme="dark"] .me-install-intro,
html[data-theme="dark"] .me-install-step span { color: #c7cdd6 !important; }

/* My Bets light redesign */
html[data-theme="dark"] .bets-pagebar { background: linear-gradient(105deg,#282409,#152019 54%,#111418 100%) !important; }
html[data-theme="dark"] .bets-view-link { background: #242830 !important; border-color: #414956 !important; color: #e7ebf0 !important; }
html[data-theme="dark"] .bets-view-link.active { background: linear-gradient(105deg,#ffdf00,#82d852) !important; color:#252832 !important; }
html[data-theme="dark"] .bets-filter-wrap { background: #191d22 !important; border-color: #323842 !important; }
html[data-theme="dark"] .bets-filter-tabs button { color: #cbd1d9 !important; }
html[data-theme="dark"] .bet-card { background: linear-gradient(112deg,#1b1e24,#171b20) !important; border-color:#353b32 !important; color:#edf0f4 !important; box-shadow:0 5px 16px rgba(0,0,0,.26) !important; }
html[data-theme="dark"] .card-header { background:#22262d !important; border-color:#343a44 !important; }
html[data-theme="dark"] .ticket-kind,
html[data-theme="dark"] .ticket-money-row strong { color:#f4f6f8 !important; }

/* Matches page */
html[data-theme="dark"] .matches-auth.balance { background:#1c2420 !important; color:#4cdb61 !important; }
html[data-theme="dark"] .matches-search-box input { background:#1a1d22 !important; color:#f4f6f8 !important; border-color:#343a43 !important; }
html[data-theme="dark"] .league-chip { filter:saturate(.72) brightness(.73); color:#15171b !important; }
html[data-theme="dark"] .load-more { background:#191d22 !important; }

/* Dashboard live and highlights controls */
html[data-theme="dark"] #sportsbook-live,
html[data-theme="dark"] .sportsbook-live,
html[data-theme="dark"] .highlights-panel,
html[data-theme="dark"] .live-sports-tabs,
html[data-theme="dark"] .market-tabs,
html[data-theme="dark"] .bb-highlight-tabs,
html[data-theme="dark"] .bb-market-columns {
    background: #171a1f !important;
    border-color: #30353e !important;
    color: #c7cdd6 !important;
}
html[data-theme="dark"] .live-sports-tabs strong,
html[data-theme="dark"] .live-sports-tabs button,
html[data-theme="dark"] .bb-highlight-tabs strong,
html[data-theme="dark"] .bb-highlight-tabs button {
    color: #e5e9ee !important;
    border-color: #343943 !important;
}
html[data-theme="dark"] .live-sports-tabs button.active,
html[data-theme="dark"] .bb-highlight-tabs button.active { color: #3bd451 !important; }
html[data-theme="dark"] .market-tabs button {
    background: #292d35 !important;
    color: #d8dde4 !important;
}
html[data-theme="dark"] .market-tabs button.active {
    background: #ffdf00 !important;
    color: #17191e !important;
}

/* Dashboard copy and match metadata */
html[data-theme="dark"] .featured-card-head,
html[data-theme="dark"] .featured-center small,
html[data-theme="dark"] .today-league,
html[data-theme="dark"] .today-time,
html[data-theme="dark"] .today-foot,
html[data-theme="dark"] .today-meta,
html[data-theme="dark"] .highlight-card .today-meta,
html[data-theme="dark"] .bb-market-columns,
html[data-theme="dark"] .results-note,
html[data-theme="dark"] .ticket-date,
html[data-theme="dark"] .ticket-match-meta,
html[data-theme="dark"] .ticket-market,
html[data-theme="dark"] .ticket-status {
    color: #c4cad3 !important;
}
html[data-theme="dark"] .featured-center strong,
html[data-theme="dark"] .today-teams strong,
html[data-theme="dark"] .highlight-card .today-teams,
html[data-theme="dark"] .ticket-team,
html[data-theme="dark"] .ticket-summary,
html[data-theme="dark"] .ticket-money-row,
html[data-theme="dark"] .bets-filter-tabs button.active {
    color: #ffffff !important;
}

/* Deposit */
html[data-theme="dark"] .deposit-wrap,
html[data-theme="dark"] .deposit-panel,
html[data-theme="dark"] .deposit-tabs,
html[data-theme="dark"] .operator-sheet,
html[data-theme="dark"] .usdt-card {
    background: #171b21 !important;
    border-color: #3a424e !important;
    color: #f8fafc !important;
}
html[data-theme="dark"] .deposit-panel-title,
html[data-theme="dark"] .amount-title,
html[data-theme="dark"] .deposit-number-field > span,
html[data-theme="dark"] .deposit-reward-line,
html[data-theme="dark"] .deposit-notes,
html[data-theme="dark"] .operator-sheet-title { color: #f1f4f8 !important; }
html[data-theme="dark"] .deposit-method,
html[data-theme="dark"] .deposit-quick-grid button,
html[data-theme="dark"] .deposit-number-field > div,
html[data-theme="dark"] .amount-row {
    background: #242a33 !important;
    border-color: #424b58 !important;
    color: #f8fafc !important;
}
html[data-theme="dark"] .deposit-method.active,
html[data-theme="dark"] .deposit-quick-grid button.selected {
    background: #253b25 !important;
    border-color: #35c849 !important;
    color: #72ed82 !important;
}
html[data-theme="dark"] .amount-currency { color: #c7cdd6 !important; }

/* Withdrawal and transaction surfaces */
html[data-theme="dark"] .withdraw-container,
html[data-theme="dark"] .withdraw-form-card,
html[data-theme="dark"] .withdraw-step,
html[data-theme="dark"] .withdraw-message-card,
html[data-theme="dark"] .verify-gate-card,
html[data-theme="dark"] .tx-card {
    background: #191e25 !important;
    border-color: #3a424e !important;
    color: #f8fafc !important;
}
html[data-theme="dark"] .withdraw-hero {
    background: linear-gradient(120deg, #2c301a, #1c2920 54%, #182027) !important;
    border-color: #48513b !important;
}
html[data-theme="dark"] .withdraw-hero-amount strong,
html[data-theme="dark"] .withdraw-step-head strong { color: #ffffff !important; }
html[data-theme="dark"] .withdraw-step-head,
html[data-theme="dark"] .withdraw-label,
html[data-theme="dark"] .withdraw-meta,
html[data-theme="dark"] .withdraw-note-card,
html[data-theme="dark"] .withdraw-hero-label,
html[data-theme="dark"] .withdraw-hero-sub,
html[data-theme="dark"] .withdraw-step-head small,
html[data-theme="dark"] .withdraw-grid button small { color: #c7cdd6 !important; }
html[data-theme="dark"] .withdraw-field .input-wrap,
html[data-theme="dark"] .withdraw-field input,
html[data-theme="dark"] .withdraw-field select {
    background: #252b34 !important;
    border-color: #424b58 !important;
    color: #ffffff !important;
}
html[data-theme="dark"] .withdraw-grid button {
    background: #252b34 !important;
    border-color: #424b58 !important;
    color: #f8fafc !important;
}
html[data-theme="dark"] .withdraw-note-card,
html[data-theme="dark"] .withdraw-meta { background: #20272d !important; border-color: #405047 !important; }

/* General modal and empty-state clarity */
html[data-theme="dark"] .state-msg,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .settings-input {
    color: #e9edf2 !important;
}

@media (prefers-reduced-motion: reduce) {
    html[data-theme="dark"] *, html[data-theme="light"] * { transition: none !important; }
}
