/**
 * LionBets UI — design tokens (dark mockup + light product reference).
 * Loaded after sparkpesa.css + app.css so these override legacy variables.
 */

:root {
  --lb-bottom-stack: calc(56px + 22px + env(safe-area-inset-bottom, 0px));
  --lb-betslip-dock-bottom: calc(56px + env(safe-area-inset-bottom, 0px));

  --lb-nav-total: calc(108px + env(safe-area-inset-top, 0px));
  --lb-quicknav-height: 52px;
  /* Home sport pills row (py-2.5 + pill); stacks under fixed nav when sticky */
  --lb-home-sport-filter-height: 48px;
  --lb-home-filter-stack-top: calc(var(--lb-nav-total) + var(--lb-home-sport-filter-height));


  --lb-fixture-list-pad-x: 12px;
  --lb-fixture-list-pad-y: 8px;
  --lb-fixture-card-radius: 8px;
  --lb-fixture-card-pad-x: 14px;
  --lb-fixture-card-pad-y: 14px;
  --lb-fixture-card-gap: 10px;
  --lb-fixture-card-margin-b: 8px;
  --lb-fixture-time-size: 14px;
  --lb-fixture-team-size: 15px;
  --lb-fixture-team-weight: 700;
  --lb-fixture-crumb-size: 12px;
  --lb-fixture-crumb-lh: 16px;
  --lb-fixture-odds-h: 48px;
  --lb-fixture-odds-radius: 4px;
  --lb-fixture-odds-gap: 6px;
  --lb-fixture-odds-pad-x: 10px;
  --lb-fixture-odds-label: 11px;
  --lb-fixture-odds-value: 15px;
  --lb-fixture-more-w: 40px;
  --lb-fixture-more-h: 48px;
  --lb-fixture-odds-pill-bg: rgba(255, 255, 255, 0.05);
  --lb-fixture-odds-pill-border: rgba(255, 255, 255, 0.1);
  --lb-fixture-odds-pill-hover-bg: rgba(232, 197, 71, 0.1);
  --lb-fixture-card-bg: var(--bb-card-bg);
  --lb-fixture-card-border-color: var(--bb-border-main);
  --lb-fixture-odds-label-fg: var(--bb-text-sub);
  --lb-fixture-odds-value-fg: var(--bb-text-main);
  --fmc-league-fg: var(--bb-text-main);
}

[data-theme="dark"] {
  /*
   * Dark palette — layered like light: gutter < body < chrome < card.
   * Gutter #000 · body #0d0d0d · chrome #121212 · card #121212 · gold #e8b94b
   */
  --lb-fixture-list-bg: #000000;
  --bb-body: #0d0d0d;
  --bb-tertiary: #0d0d0d;
  --bb-page-gutter: #000000;

  --bb-card-bg: #0d0d0d;
  --lb-fixture-card-bg: #121212;
  --bb-sport-item: #121212;
  --bb-betslip-bg: #121212;
  --bb-calendar-cell: #121212;
  --bb-profile-card: #121212;
  --bb-sharebet: #121212;
  --bb-market-header-bg: #121212;
  --bb-tertiary-light: #121212;
  --bb-tertiary-lighter: #121212;

  --bb-text-main: #ffffff;
  --bb-text-black: #ffffff;
  --bb-text-sub: #888888;
  --bb-text-gray: #888888;
  --bb-text-gray-dark: #aaaaaa;
  --bb-market-header-text: #888888;
  --lb-fixture-odds-col-label: #888888;
  --bb-placeholder: #666666;

  --lb-gold: #e8b94b;
  --lb-gold-hover: #f0c45a;
  --lb-gold-muted: #c9a03f;

  --bb-primary: #e8b94b;
  --bb-border-color: #e8b94b;
  --bb-border-boosted: #e8b94b;
  --bb-active_tab: #e8b94b;

  --bb-border-main: #262626;
  --bb-border-secondary: #333333;
  --bb-border-solid: #262626;
  --bb-bottom-border: #262626;

  --bb-main-header: #121212;
  --lb-navbar-row-bg: #121212;
  --lb-navbar-row-divider: 1px solid #262626;
  --bb-appfooter: #0d0d0d;
  --lb-brown: #0d0d0d;

  --bb-live-indicator: #e8b94b;
  --bb-stats-positive: #4ade80;
  --bb-activity-warn: #e8b94b;

  --bb-card-elevation: none;
  --bb-card-shadow: none;

  --lb-fixture-card-radius: 14px;
  --lb-fixture-card-border-color: #262626;
  --lb-fixture-card-border-hover-color: #e8b94b;
  --lb-fixture-card-hover-glow: 0 0 8px rgba(232, 185, 75, 0.5);
  --lb-fixture-odds-pill-bg: #1a1a1a;
  --lb-fixture-odds-pill-border: #262626;
  --lb-fixture-odds-pill-hover-bg: #222222;
  --lb-fixture-odds-label-fg: #888888;
  --lb-fixture-odds-value-fg: #ffffff;

  --fos-pill-active-fill: #262116;
  --fos-pill-active-fg: #ffffff;
  --fos-pill-active-border-w: 1.5px;
  --fos-pill-active-glow: 0 0 8px rgba(232, 185, 75, 0.35);

  --lb-qn-color: #888888;
  --lb-qn-color-hover: #ffffff;
  --lb-qn-active-bg: transparent;
  --lb-navbar-utility-fg: #888888;
  --lb-navbar-utility-hover-bg: rgba(255, 255, 255, 0.06);
  --lb-navbar-utility-hover-fg: #ffffff;
  --lb-btn-ghost-border: #262626;
  --lb-btn-ghost-fg: #888888;
  --lb-btn-ghost-sm-fg: #888888;
  --lb-tab-inactive-color: #888888;
  --lb-tab-inactive-hover: #ffffff;
  --lb-tab-fab-fill: #0d0d0d;
  --lb-tab-fab-border: 3px solid #e8b94b;
  --lb-tab-fab-shadow:
    0 0 0 1px rgba(232, 185, 75, 0.2),
    0 4px 14px rgba(0, 0, 0, 0.5),
    0 0 18px rgba(232, 185, 75, 0.38);
  --lb-tab-fab-shadow-hover:
    0 0 0 1px rgba(232, 185, 75, 0.35),
    0 6px 18px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(232, 185, 75, 0.52);
  --lb-tab-fab-icon: #e8b94b;
  --lb-bottom-tabs-elevation: none;
  --fmc-border: 1px solid #262626;
  --fmc-stats-accent: #e8b94b;
  --fmc-league-fg: #888888;

  --lb-footer-bg: #0d0d0d;
  --lb-footer-fg: #888888;
  --lb-footer-border-top: 1px solid #262626;
  --lb-footer-link-fg: #888888;
  --lb-footer-copy-fg: #666666;
  --lb-footer-legal-fg: #666666;

  --lb-menu-header-bg: #0d0d0d;
  --lb-menu-header-border: 1px solid #262626;
}

:root:not([data-theme="dark"]) {
  /* ── Light — product reference (white chrome, #f9f9f9 page, gold ~#e1a925) ── */
  --bb-body: #f9f9f9;
  --bb-page-gutter: #f4f4f4;
  /* List surface — white cards on white/gray panel, distinct from outer gutter */
  --lb-fixture-list-bg: #ffffff;
  --bb-tertiary: #ffffff;

  --bb-main-header: #ffffff;
  --lb-navbar-row-bg: #ffffff;
  --lb-navbar-row-divider: 1px solid rgba(0, 0, 0, 0.08);

  --lb-gold: #e1a925;
  --lb-gold-hover: #f0b82e;
  --lb-gold-muted: #b8860b;

  --bb-primary: #e1a925;
  --bb-border-color: #e1a925;
  --bb-border-boosted: #e1a925;
  --bb-active_tab: #e1a925;

  --bb-text-main: #000000;
  --bb-text-black: #000000;
  --bb-text-sub: #757575;
  --bb-text-gray: #757575;
  --bb-text-gray-dark: #424242;
  --bb-market-header-text: #333333;
  --lb-fixture-odds-col-label: #6b7280;

  --bb-card-bg: #ffffff;
  --bb-betslip-bg: #ffffff;
  --bb-sport-item: #ffffff;
  --bb-market-header-bg: #f5f5f5;
  --bb-profile-card: #f9f9f9;
  --bb-calendar-cell: #f5f5f5;
  --bb-sharebet: #f5f5f5;

  --bb-border-main: #e8e8e8;
  --bb-border-secondary: #d0d0d0;
  --bb-bottom-border: #e8e8e8;

  --bb-card-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  --bb-live-indicator: #ef4444;
  --bb-stats-positive: #22c55e;
  --bb-activity-warn: #f59e0b;

  --bb-appfooter: #ffffff;
  --lb-tab-fab-fill: linear-gradient(155deg, #ffb800 0%, #e1a925 55%, #c99815 100%);
  --lb-tab-fab-border: 4px solid #ffffff;
  --lb-tab-fab-shadow:
    0 2px 0 rgba(255, 255, 255, 0.35) inset,
    0 -2px 6px rgba(0, 0, 0, 0.12) inset,
    0 8px 22px rgba(0, 0, 0, 0.14),
    0 4px 10px rgba(225, 169, 37, 0.38);
  --lb-tab-fab-shadow-hover:
    0 2px 0 rgba(255, 255, 255, 0.4) inset,
    0 -2px 8px rgba(0, 0, 0, 0.14) inset,
    0 10px 28px rgba(0, 0, 0, 0.16),
    0 6px 16px rgba(225, 169, 37, 0.48);
  --lb-tab-fab-icon: #ffffff;
  --lb-bottom-tabs-elevation: 0 -1px 0 rgba(0, 0, 0, 0.06), 0 -6px 16px rgba(0, 0, 0, 0.04);

  --lb-qn-color: #757575;
  --lb-qn-color-hover: #424242;
  --lb-qn-active-bg: rgba(225, 169, 37, 0.14);
  --lb-navbar-utility-fg: #757575;
  --lb-navbar-utility-hover-bg: rgba(0, 0, 0, 0.06);
  --lb-navbar-utility-hover-fg: #000000;
  --lb-btn-ghost-border: rgba(0, 0, 0, 0.22);
  --lb-btn-ghost-fg: #424242;
  --lb-btn-ghost-sm-fg: #757575;
  --lb-tab-inactive-color: #757575;
  --lb-tab-inactive-hover: #424242;

  --fos-pill-active-fill: rgba(225, 169, 37, 0.2);
  --fos-pill-active-fg: var(--lb-gold);
  --fos-pill-active-border-w: 1px;
  --fos-pill-active-glow: none;

  --lb-fixture-odds-pill-bg: rgba(0, 0, 0, 0.05);
  --lb-fixture-odds-pill-border: rgba(0, 0, 0, 0.08);
  --lb-fixture-odds-pill-hover-bg: rgba(225, 169, 37, 0.12);
  --lb-fixture-card-bg: var(--bb-card-bg);
  --lb-fixture-card-border-color: var(--bb-border-main);
  --lb-fixture-odds-label-fg: var(--bb-text-sub);
  --lb-fixture-odds-value-fg: var(--bb-text-main);

  --fmc-border: 1px solid rgba(225, 169, 37, 0.35);
  --fmc-stats-accent: var(--lb-gold);
  --fmc-league-fg: var(--bb-text-main);

  --lb-footer-bg: #ffffff;
  --lb-footer-fg: #757575;
  --lb-footer-border-top: 1px solid rgba(0, 0, 0, 0.08);
  --lb-footer-link-fg: #757575;
  --lb-footer-copy-fg: #9e9e9e;
  --lb-footer-legal-fg: #9e9e9e;

  --lb-menu-header-bg: #ffffff;
  --lb-menu-header-border: 1px solid rgba(0, 0, 0, 0.08);
}

/* ---------------------------------------------------------------------------
   Bet history / share-slip modals (global `bh-*` — reuse in pages + components)
---------------------------------------------------------------------------- */
.bh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.bh-modal {
  background: var(--bb-card-bg);
  border-radius: 16px;
  width: 100%;
  max-width: 360px;
  overflow: hidden;
}

.bh-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--bb-border-main);
}

.bh-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--bb-text-main);
}

.bh-modal-title--gold {
  color: var(--lb-gold);
}

.bh-modal-close {
  background: none;
  border: none;
  color: var(--bb-text-sub);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  display: flex;
}

.bh-modal-close--gold {
  color: var(--lb-gold);
}

.bh-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Fixture filter sheets (leagues, markets, countries, sports) */
.ffilter-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.52);
}

.ffilter-panel {
  box-sizing: border-box;
  width: 100%;
  max-width: min(100vw, 815px);
  background: var(--bb-card-bg);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

@media (min-width: 640px) {
  .ffilter-overlay {
    align-items: center;
    padding: 16px;
  }

  .ffilter-panel {
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  }

  .ffilter-panel--multi {
    width: min(100%, 420px);
    max-width: 420px;
  }
}

.bh-cashout-amount {
  font-size: 16px;
  color: var(--bb-text-main);
  text-align: center;
  margin: 0;
}

.bh-error-text {
  color: #dc2626;
  font-size: 13px;
  margin: 0;
}

.bh-action-btn {
  width: 100%;
  background: var(--lb-gold, #be9c2e);
  color: #1a1400;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--lb-font, system-ui, sans-serif);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.bh-action-btn:hover {
  background: var(--lb-gold-hover, #d4af37);
}

.bh-action-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bh-share-date {
  font-size: 12px;
  color: var(--bb-text-sub);
  text-align: center;
  margin: 0;
}

.bh-share-code-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.bh-share-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--bb-text-sub);
  text-transform: uppercase;
}

.bh-share-code {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bb-sport-item);
  border: 1px solid var(--bb-border-main);
  border-radius: 10px;
  padding: 10px 14px;
}

.bh-share-code--wrap {
  flex-wrap: wrap;
}

.bh-share-code span,
.bh-share-code .bh-share-code-hit {
  font-size: 16px;
  font-weight: 700;
  color: var(--bb-text-main);
}

.bh-share-code .bh-share-code-hit {
  text-decoration: none;
}

.bh-share-url {
  flex: 1;
  min-width: 0;
  font-size: 12px !important;
  font-weight: 600 !important;
  word-break: break-all;
  color: var(--bb-text-main) !important;
}

.bh-share-open-link {
  display: flex;
  flex-shrink: 0;
  color: var(--bb-text-main);
  font-size: 22px;
}

.bh-copy-btn {
  background: none;
  border: none;
  color: var(--lb-gold);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  display: flex;
}