/* Sportsbook v2 layout - see docs/superpowers/plans/2026-05-29-sportsbook-layout-redesign-p0-p1.md
   Structural shell + rail + event-row + slip styling. Colours inherit each
   affiliate's palette via CSS vars (--panel-bg / --brand-accent) with dark
   fallbacks; per-site palette tuning happens in the browser pass.
   Base rules first, then @media (odd max-width breakpoints) per CLAUDE.md. */

/* ===== Three-pane shell ===== */
.sb2 {
  --sb2-gap: 12px;
  --sb2-rail-w: 240px;
  --sb2-slip-w: 320px;
  --sb2-panel: var(--panel-bg, #161b22);
  --sb2-line: rgba(255, 255, 255, .08);
  --sb2-accent: var(--brand-accent, #d4af37);
  display: grid;
  /* Desktop: the sports rail now lives in the left sidebar, so the shell is just
     content; the slip column appears only once the slip has a selection. */
  grid-template-columns: 1fr;
  gap: var(--sb2-gap);
  align-items: start;
  color: #e8eef5;
}
.sb2.sb2--has-slip { grid-template-columns: 1fr var(--sb2-slip-w); }
.sb2__rail,
.sb2__slip {
  position: sticky;
  top: 70px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: var(--sb2-panel);
  border: 1px solid var(--sb2-line);
  border-radius: 10px;
}
/* Desktop hides the shell rail (the sidebar carries sports); both come back as
   the column/drawer below 1200px where the desktop sidebar is not shown. */
.sb2__rail { display: none; }
.sb2__slip { display: none; }
.sb2.sb2--has-slip .sb2__slip { display: block; }
.sb2__content { min-width: 0; }
.sb2__content-head { padding: 4px 2px; }
.sb2__h1 { font-size: 20px; margin: 4px 0 12px; }

/* ===== Odds-format switcher (decimal / American / fractional) - sits under the
   sports list in the left sidebar (desktop) and the in-shell rail (tablet/mobile) ===== */
.sb2-oddsfmt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; margin-top: 4px; border-top: 1px solid var(--sb2-line, #232a35); }
.sb2-oddsfmt__label { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: #8b98a5; }
.sb2-oddsfmt__sel { background: var(--sb2-panel, #161b22); color: #cdd6e0; border: 1px solid var(--sb2-line, #232a35); border-radius: 8px; padding: 5px 8px; font-size: 12px; cursor: pointer; }
.sb2-oddsfmt__sel:focus { outline: none; border-color: var(--sb2-accent); }
.sb2__events { display: flex; flex-direction: column; gap: 8px; }
.sb2__tabbar { display: none; }

/* ===== Left rail ===== */
.sb2-rail__search {
  width: calc(100% - 16px);
  margin: 8px;
  padding: 8px 10px;
  background: #0d1117;
  border: 1px solid var(--sb2-line);
  border-radius: 8px;
  color: #e8eef5;
}
.sb2-rail__list { list-style: none; margin: 0; padding: 4px; }
.sb2-rail__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: #cdd6e0;
  text-decoration: none;
}
.sb2-rail__link:hover { background: rgba(255, 255, 255, .05); }
.sb2-rail__icon { width: 18px; height: 18px; flex: 0 0 auto; }

/* ===== Odds-first event row ===== */
.sb2-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--sb2-panel);
  border: 1px solid var(--sb2-line);
  border-radius: 10px;
}
.sb2-row__teams { display: grid; gap: 2px; min-width: 0; color: #e8eef5; text-decoration: none; }
.sb2-row__time { font-size: 11px; color: #8b98a5; }
.sb2-row__markets { display: flex; gap: 6px; align-items: center; }
.sb2-odd {
  display: grid;
  gap: 2px;
  min-width: 64px;
  padding: 8px 10px;
  background: #0d1117;
  border: 1px solid var(--sb2-line);
  border-radius: 8px;
  color: #e8eef5;
  font: inherit;
  text-align: center;
  cursor: pointer;
}
.sb2-odd.is-selected { border-color: var(--sb2-accent); background: rgba(212, 175, 55, .12); }
.sb2-odd__label { font-size: 11px; color: #8b98a5; }
.sb2-odd__price { font-weight: 700; }
.sb2-row__more { align-self: center; white-space: nowrap; color: var(--sb2-accent); text-decoration: none; font-size: 13px; }

/* ===== Bet slip ===== */
.sb2-slip { padding: 10px; }
.sb2-slip__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }

/* ===== Reused bet-slip engine, restyled (markup loaded into #betTicketSlip) ===== */
.sb2__slip .progress-status { display: none; }
.sb2__slip .workrowopen { padding: 0; }
.sb2__slip .workrowopen > h2 { display: none; }
.sb2__slip #betTicketSlip { padding: 0; }
.sb2__slip .sports-ticket-wrpper { margin-bottom: 8px; }
.sb2__slip .match-box { background: #0d1117; border: 1px solid var(--sb2-line); border-radius: 8px; padding: 8px 10px; }
.sb2__slip .match-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sb2__slip .ticket-header { font-size: 13px; margin: 0; color: #e8eef5; }
.sb2__slip .btn-del { color: #8b98a5; }
.sb2__slip .match-head-datetime { font-size: 11px; color: #8b98a5; }
.sb2__slip .match-srbx label { font-size: 11px; color: #8b98a5; }
.sb2__slip .match-srbx h6 { font-size: 13px; color: #e8eef5; }
.sb2__slip .mtrw { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.sb2__slip .form-group { flex: 1; position: relative; }
.sb2__slip .form-group input,
.sb2__slip input.form-control { width: 100%; padding: 8px; background: #161b22; border: 1px solid var(--sb2-line); border-radius: 8px; color: #e8eef5; }
.sb2__slip .jackbox h6 { font-size: 11px; color: #8b98a5; margin: 0; }
.sb2__slip .jackbox h4 { font-size: 13px; color: #e8eef5; margin: 0; }
.sb2__slip .totalbox { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--sb2-line); }
.sb2__slip .totalbox h4 { display: flex; justify-content: space-between; font-size: 13px; color: #e8eef5; }
.sb2__slip .standard-multiple-block,
.sb2__slip .played-block { margin-top: 8px; }
.sb2__slip .in-addbx { background: #0d1117; border: 1px solid var(--sb2-line); border-radius: 8px; padding: 8px; margin-bottom: 6px; }
.sb2__slip #place_bet_button { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.sb2__slip #place_bet_button .btn-main,
.sb2__slip #click_to_place_bet { display: block; width: 100%; padding: 11px; border: 0; border-radius: 9px; background: var(--sb2-accent); color: #1a1a1a; font-weight: 700; text-align: center; text-decoration: none; }
.sb2__slip #place_bet_button .btn-danger,
.sb2__slip .delete_all_tickets { display: block; width: 100%; padding: 9px; border-radius: 9px; background: transparent; border: 1px solid var(--sb2-line); color: #8b98a5; text-align: center; text-decoration: none; }
.sb2__slip #my_bets_betslip_button { margin-top: 8px; }
.sb2__slip #my_bets_betslip_button .btn-main { display: block; text-align: center; padding: 9px; border-radius: 9px; background: transparent; border: 1px solid var(--sb2-accent); color: var(--sb2-accent); text-decoration: none; }

/* ===== My Bets (v2 restyle - reuses bets#index / #settled, gated .sb2-mybets) ===== */
.sb2-mybets { --sb2-accent: var(--brand-accent, #d4af37); }
.sb2-mybets .bets-history-pills-btn.active { background: var(--sb2-accent); border-color: var(--sb2-accent); color: #1a1a1a; }
.sb2-mybets .bet-history-header { background: rgba(255, 255, 255, .04); border-left: 3px solid var(--sb2-accent); }

/* ===== Match detail (v2, Stake-style grouped markets) ===== */
.sb2-match__crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: #8b98a5; margin: 2px 0 12px; }
.sb2-match__crumb-link { color: #8b98a5; text-decoration: none; }
.sb2-match__crumb-link:hover { color: var(--sb2-accent); }
.sb2-match__crumb-sep { color: #4a5562; }
.sb2-match__head { background: var(--sb2-panel); border: 1px solid var(--sb2-line); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.sb2-match__teams { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sb2-match__team { font-size: 18px; font-weight: 700; color: #e8eef5; }
.sb2-match__sep { font-size: 12px; color: #8b98a5; text-transform: uppercase; letter-spacing: .04em; }
.sb2-match__meta { margin-top: 10px; font-size: 12px; color: #8b98a5; }
.sb2-match__empty { color: #8b98a5; padding: 24px 8px; }
.sb2-match__tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--sb2-line); margin-bottom: 12px; scrollbar-width: thin; }
.sb2-match__tab { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border: 0; background: transparent; color: #8b98a5; font-size: 13px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.sb2-match__tab:hover { color: #e8eef5; }
.sb2-match__tab.is-active { color: var(--sb2-accent); border-bottom-color: var(--sb2-accent); }
.sb2-match__tab-count { font-size: 11px; color: #6b7681; background: rgba(255, 255, 255, .06); border-radius: 9px; padding: 0 6px; }
.sb2-match__tab.is-active .sb2-match__tab-count { color: #1a1a1a; background: var(--sb2-accent); }
.sb2-match__pane { display: none; flex-direction: column; gap: 8px; }
.sb2-match__pane.is-active { display: flex; }
.sb2-mkt { background: var(--sb2-panel); border: 1px solid var(--sb2-line); border-radius: 10px; overflow: hidden; }
.sb2-mkt__head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 12px 14px; border: 0; background: transparent; color: #e8eef5; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; }
.sb2-mkt__chev { width: 8px; height: 8px; border-right: 2px solid #8b98a5; border-bottom: 2px solid #8b98a5; transform: rotate(45deg); transition: transform .15s ease; flex: 0 0 auto; }
.sb2-mkt.is-collapsed .sb2-mkt__chev { transform: rotate(-45deg); }
.sb2-mkt.is-collapsed .sb2-mkt__body { display: none; }
.sb2-mkt__body { display: grid; gap: 6px; padding: 0 12px 12px; }
.sb2-mkt__cols-1 { grid-template-columns: 1fr; }
.sb2-mkt__cols-2 { grid-template-columns: repeat(2, 1fr); }
.sb2-mkt__cols-3 { grid-template-columns: repeat(3, 1fr); }
.sb2-mkt__odd { display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; background: #0d1117; border: 1px solid var(--sb2-line); border-radius: 8px; cursor: pointer; min-width: 0; transition: border-color .12s ease; }
.sb2-mkt__odd:hover { border-color: var(--sb2-accent); }
.sb2-mkt__odd .sb2-odd__label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: #8b98a5; text-align: left; min-width: 0; }
.sb2-mkt__odd .sb2-odd__line { font-size: 11px; color: #6b7681; }
.sb2-mkt__odd .sb2-odd__price { font-size: 14px; font-weight: 700; color: #e8eef5; flex: 0 0 auto; }
.sb2-mkt__odd.is-selected { border-color: var(--sb2-accent); background: rgba(212, 175, 55, .12); }

/* ===== Sport / league landing (v2) ===== */
.sb2-league { margin-bottom: 16px; }
.sb2-league__head { font-size: 14px; font-weight: 700; color: #e8eef5; margin: 4px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--sb2-line); }
.sb2-league__events { display: flex; flex-direction: column; gap: 8px; }

/* ===== Book nav (Stake-style index tabs) ===== */
.sb2-booknav { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--sb2-line); margin-bottom: 12px; scrollbar-width: thin; }
.sb2-booknav__tab { flex: 0 0 auto; padding: 9px 14px; color: #8b98a5; font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.sb2-booknav__tab:hover { color: #e8eef5; }
.sb2-booknav__tab.is-active { color: var(--sb2-accent); border-bottom-color: var(--sb2-accent); }

/* ===== Home sections: featured competition + Top Matches ===== */
.sb2-section-head { font-size: 15px; font-weight: 700; color: #e8eef5; margin: 4px 0 10px; }
.sb2-section-head--featured { color: var(--sb2-accent); }
.sb2-featured { margin-bottom: 18px; padding: 10px 14px 4px; border: 1px solid rgba(212, 175, 55, .22); border-radius: 10px; background: linear-gradient(180deg, rgba(212, 175, 55, .05), rgba(212, 175, 55, 0)); }
.sb2-top { margin-bottom: 18px; }
.sb2-top__strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.sb2-top__card { flex: 0 0 260px; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--sb2-panel); border: 1px solid var(--sb2-line); border-radius: 10px; }
.sb2-top__link { display: grid; gap: 2px; text-decoration: none; }
.sb2-top__meta { font-size: 11px; color: #8b98a5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb2-top__team { font-size: 14px; font-weight: 600; color: #e8eef5; }
.sb2-top__odds { display: flex; gap: 6px; margin-top: 2px; }
.sb2-top__odd { flex: 1; }

/* ===== Left-sidebar sports tree (v2, Stake-style) ===== */
.sb2-side { --sb2-accent: var(--brand-accent, #d4af37); color: #cdd6e0; }
.sb2-side__head { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #8b98a5; padding: 6px 10px 2px; }
.sb2-side__sports { list-style: none; margin: 0; padding: 0; }
.sb2-side__row { display: flex; align-items: center; }
.sb2-side__sport-link { flex: 1; padding: 8px 10px; color: #cdd6e0; text-decoration: none; font-size: 14px; }
.sb2-side__sport-link:hover { color: #fff; }
.sb2-side__toggle { background: none; border: 0; padding: 8px 12px; cursor: pointer; line-height: 1; }
.sb2-side__chev { display: inline-block; width: 7px; height: 7px; border-right: 2px solid #8b98a5; border-bottom: 2px solid #8b98a5; transform: rotate(45deg); transition: transform .15s ease; }
.sb2-side__sport.is-open .sb2-side__chev { transform: rotate(-135deg); }
.sb2-side__leagues { list-style: none; margin: 0 0 4px; padding: 0 0 0 12px; }
.sb2-side__league { display: block; padding: 6px 10px; color: #8b98a5; text-decoration: none; font-size: 13px; }
.sb2-side__league:hover { color: var(--sb2-accent); }

/* ===== Tablet ===== */
@media (max-width: 1199px) {
  /* The slip is a bottom sheet here regardless of the desktop slip-on-add state. */
  .sb2, .sb2.sb2--has-slip { grid-template-columns: var(--sb2-rail-w) 1fr; }
  .sb2__rail { display: block; }   /* shell rail returns below 1200px (desktop sidebar hidden) */
  .sb2-side { display: none; }     /* the left-sidebar sports tree is desktop-only */
  .sb2__slip {
    display: block;
    position: fixed;
    right: 0;
    bottom: 0;
    top: auto;
    width: min(380px, 100%);
    max-height: 70vh;
    transform: translateY(100%);
    transition: transform .25s ease;
    z-index: 60;
    border-radius: 12px 12px 0 0;
  }
  .sb2__slip.is-open { transform: translateY(0); }
  /* The slip is an off-screen sheet from 1199px down, so the bottom tab-bar
     (its only toggle) must be available across this whole range, not just on
     phones - otherwise tablet users can add selections but never open the slip. */
  .sb2 { padding-bottom: 64px; }
  .sb2__tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 56px;
    background: var(--sb2-panel);
    border-top: 1px solid var(--sb2-line);
    z-index: 65;
  }
  .sb2__tab { flex: 1; background: none; border: 0; color: #cdd6e0; font-size: 12px; cursor: pointer; }
  .sb2__tab-badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--sb2-accent); color: #1a1a1a; }
}

/* ===== Mobile ===== */
@media (max-width: 767px) {
  .sb2, .sb2.sb2--has-slip { grid-template-columns: 1fr; }
  .sb2__rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 82%;
    max-width: 320px;
    max-height: none;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 70;
    border-radius: 0;
  }
  .sb2__rail.is-open { transform: translateX(0); }
  .sb2-row { grid-template-columns: 1fr; }
  .sb2-row__markets { flex-wrap: wrap; }
}
