/* Race v4: six gameplay families, using the established brand palette. */
[hidden] { display: none !important; }
.betting-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; background: #ffeed6; border-bottom: 1px solid #e4bf8d; }
#commonPlays { min-height: 38px; border: 1px solid #b77535; border-radius: 6px; padding: 6px 10px; background: #fff9ed; color: #80501f; font-weight: 700; font-size: 13px; white-space: nowrap; }
#commonPlays span { font-size: 19px; vertical-align: -1px; }
.bet-panel .market-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; padding: 5px 6px; overflow: visible; }
.bet-panel .market-tabs button { border-radius: 5px; font-size: 12px; color: #6c512f; white-space: nowrap; padding: 8px 7px; }
.bet-panel .market-tabs button.active { background: #9b501c; color: #fff; box-shadow: 0 2px 5px #7e431325; }
.bet-panel .market-tabs button.active::after { display: none; }
.collection-tab small { background: #ffffff36; padding: 1px 4px; border-radius: 4px; margin-left: 3px; font-size: 10px; }
.bet-panel .positions button.active { background: #155f86; border-color: #155f86; color: #fff; box-shadow: inset 0 0 0 1px #155f86; }
.bet-panel .choice.selected { background: #19688c; border-color: #0e4b6a; color: #fff; box-shadow: inset 0 0 0 1px #0e4b6a, 0 2px 5px #12486825; }
.bet-panel .choice.selected small, .bet-panel .choice.selected .choice-label, .bet-panel .choice.selected::after { color: #fff; }
.bet-panel .choice.selected .ball { box-shadow: 0 0 0 2px #ffffff80, 0 2px 5px #092c4c50; }
.bet-panel .choice:focus-visible, .bet-panel button:focus-visible, .cancel-order:focus-visible { outline: 3px solid #145575; outline-offset: 3px; z-index: 1; }
.bet-panel .choice-toolbar { flex-wrap: wrap; gap: 5px; }
.bet-panel .choice-toolbar strong { font-size: 12px; }
.favorite-current { color: #8d551b; font-size: 11px; min-height: 30px; padding: 3px 5px; margin-left: auto; border: 1px solid #dec096; border-radius: 4px; background: #fff9ed; }
.bet-panel .quick-picks { margin-left: auto; }
.favorite-current[aria-pressed="true"] { color: #7f4414; background: #f6d59c; border-color: #c38a43; }
.bet-panel .play-note { color: #755b3c; }
.bet-panel .picked-row { flex-wrap: wrap; align-items: flex-start; padding: 6px 0; }
.bet-panel #selectionTags { max-height: 84px; overflow-y: auto; scrollbar-width: thin; }
.bet-notices { display: flex; align-items: flex-start; gap: 6px; padding-top: 7px; flex-wrap: wrap; }
.bet-notices #betNotice { flex: 1 1 170px; font-size: 10px; line-height: 1.6; margin: 0; }
#ordersShortcut { color: #145c80; font-size: 11px; font-weight: 750; padding: 2px 0; min-height: 26px; white-space: nowrap; }
.bet-panel #betNotice.error { color: #a33226; }
body:not(.layout-basic) .bet-panel { height: auto; min-height: var(--live-panel-height); }

/* Favorites collect saved plays into complete rows. */
.market-rows { container-type: inline-size; display: grid; gap: 5px; padding: 3px 0 6px; }
.play-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 5px; align-items: stretch; padding: 6px; background: #fffaf1; border: 1px solid #e7cda5; border-radius: 8px; }
.play-row-heading { position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 3px; }
.play-row h3 { color: #68431f; font-size: 12px; line-height: 1.5; font-weight: 750; }
.play-row-heading > small { color: #84694b; font-size: 10px; }
.row-favorite { color: #a97b45; min-width: 28px; min-height: 24px; padding: 1px 5px; font-size: 18px; border-radius: 4px; margin-left: -5px; line-height: 1.1; }
.row-favorite[aria-pressed="true"] { color: #98611c; }
.row-favorite:hover { background: #f4dfbc; }
.row-selected { color: #145c80; font-size: 10px; font-weight: 700; }
.row-choices { display: grid; gap: 3px; grid-template-columns: repeat(5, minmax(0, 1fr)); align-content: center; }
.row-choices.type-positionAttribute, .row-choices.type-sumAttribute { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row-choices.type-dragonTiger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bet-panel .row-choices .choice { min-height: 48px; gap: 3px; border-radius: 5px; }
.bet-panel .row-choices .choice small { font-size: 9px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bet-panel .row-choices .odds-prefix { display: none; }
.bet-panel .row-choices .choice .ball { width: clamp(21px, 5cqi, 30px); height: clamp(21px, 5cqi, 30px); font-size: clamp(10px, 2cqi, 12px); }
.bet-panel .row-choices .choice .choice-label { font-size: 21px; }
.bet-panel .row-choices .choice.selected::after { top: 1px; right: 3px; font-size: 9px; }
.bet-panel .row-choices.type-sumNumber .choice { min-height: 53px; }
.bet-panel .row-choices.type-sumNumber small { font-size: 9px; }
.favorites-empty { padding: 30px 15px; text-align: center; }
.favorites-empty > span { color: #bd8a41; font-size: 35px; }
.favorites-empty h3 { color: #725126; font-size: 16px; margin: 5px 0; }
.favorites-empty p { color: #8b7354; font-size: 12px; line-height: 1.7; }
.favorites-empty button { background: #155f86; color: white; border-radius: 6px; min-height: 42px; padding: 9px 20px; margin-top: 16px; }
@container (min-width: 340px) {
  .row-choices.type-number { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
@container (min-width: 540px) {
  .row-choices.type-sumNumber { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
body.betting-expanded .bet-panel { min-height: 0; height: auto; }
body.betting-expanded .selection-body { flex: none; display: block; }
body.betting-expanded .bet-footer { display: block; position: sticky; bottom: 0; z-index: 3; box-shadow: 0 -5px 15px #9a641c15; }
@media (min-width: 981px) {
  /* Overall layout belongs to Basic / Speed only, never to the betting style.
     Both modes retain the original 2.4fr / 400px-minimum columns from
     layout-refinements.css; Favorites only change panel content. */
  .play-grid, body.layout-basic .play-grid { grid-template-areas: none; grid-template-rows: none; }
  body:not(.layout-basic) .bet-panel .market-tabs button { font-size: 12px; }
  body:not(.layout-basic) .bet-panel .choices .choice { min-height: 62px; }
}
@media (max-width: 600px) {
  .topbar .games-nav { grid-column: 1 / -1; grid-row: 3; margin: 0; }
  .bet-panel .market-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bet-panel .market-tabs button { min-height: 37px; padding: 6px 3px; font-size: 13px; }
  .bet-panel .selection-body { padding-left: 9px; padding-right: 9px; }
  .play-row { grid-template-columns: 1fr; padding: 8px; gap: 6px; }
  .play-row-heading { flex-direction: row; align-items: center; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
  .row-favorite { margin-left: auto; min-width: 40px; min-height: 32px; }
  .row-selected { order: 2; }
  .row-choices.type-number { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .row-choices { gap: 5px; }
  .bet-panel .row-choices .choice { min-height: 60px; }
  .bet-panel .row-choices .choice .ball { width: 28px; height: 28px; font-size: 12px; }
}
.cancel-notice { padding: 9px 14px; background: #e4f3f6; border-bottom: 1px solid #b9d8e2; color: #155b7a; font-size: 11px; font-weight: 650; line-height: 1.6; }
.cancel-notice.closed { background: #f4ece1; color: #806544; border-color: #ddc8ac; }
.ticket-row .cancel-order { background: #155f86; border: 1px solid #155f86; color: white; padding: 6px 13px; min-height: 34px; border-radius: 5px; font-size: 12px; font-weight: 700; }
.ticket-row .cancel-order:disabled { background: #edf0f0; border-color: #d2dadc; color: #687b83; cursor: not-allowed; opacity: 1; }
#myTickets { scroll-margin-top: 14px; }
.favorites-dialog { width: min(700px, calc(100vw - 28px)); max-width: 700px; max-height: 88dvh; overflow-y: auto; padding: 26px; background: #fff8ed; border: 1px solid #ddb985; border-radius: 16px; }
.favorites-dialog h2 { color: #633f1e; font-size: 24px; margin-top: 5px; }
.favorites-intro { color: #786a58; font-size: 13px; line-height: 1.7; margin: 8px 0 14px; }
.favorites-controls { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid #e3ccb0; border-bottom: 1px solid #e3ccb0; }
.favorites-controls span { margin-right: auto; color: #72522d; font-size: 12px; }
.favorites-controls button { padding: 7px 12px; color: #145f85; font-size: 12px; border: 1px solid #c3d7df; border-radius: 5px; background: #f6fbfc; }
.favorite-options fieldset { border: 0; padding: 14px 0 4px; margin: 0; min-width: 0; }
.favorite-options legend { padding: 14px 0 0; color: #7d4c20; font-size: 13px; font-weight: 750; }
.favorite-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.favorite-option { display: flex; align-items: center; gap: 9px; background: #fffdfa; padding: 10px; min-height: 45px; border: 1px solid #dccbb3; border-radius: 6px; cursor: pointer; color: #625744; font-size: 12px; }
.favorite-option:has(input:checked) { background: #dcecf2; border-color: #367e9c; color: #135675; }
.favorite-option input { width: 18px; height: 18px; accent-color: #155f86; flex: none; }
.favorite-option small { display: block; font-size: 10px; margin-top: 3px; }
.favorites-footer { display: flex; justify-content: flex-end; gap: 12px; position: sticky; bottom: -26px; padding: 16px 0 8px; margin-top: 12px; background: #fff8ed; border-top: 1px solid #e2caae; }
.favorites-footer > button { min-width: 100px; min-height: 42px; font-size: 13px; }
.favorites-footer .button-bet { padding: 10px 20px; background: #155f86; color: white; border-radius: 6px; }
@media (max-width: 440px) { .favorites-dialog { padding: 20px 14px; } .favorite-grid { grid-template-columns: 1fr; } .favorites-footer { bottom: -20px; } }

/* Each desktop column flows independently, so a tall favorites panel cannot
   push the history panel away from the live player in the other column. */
.play-column { display: flex; flex-direction: column; align-items: stretch; gap: 12px; min-width: 0; }
.play-column > section { flex: none; min-width: 0; }
@media (max-width: 980px) { .play-column { display: contents; } }
body.live-only .play-column { display: contents; }
.history-panel[data-history-mode="dragon"] .history-row { min-height: 38px; }
.history-panel[data-history-mode="dragon"] .history-row .attr,
body.layout-basic .history-panel[data-history-mode="dragon"] .history-row .attr {
  width: 32px; height: 32px; font-size: 18px; font-weight: 750; border-radius: 5px;
}
.history-panel[data-history-mode="dragon"] .history-row .balls { gap: 8px; }
.history-panel[data-history-mode="dragon"] .history-row > small { font-size: 11px; }
.bet-panel .row-choices.type-dragonTiger .choice .choice-label { font-size: 28px; }
.balance-inline { display: flex; flex-direction: column; gap: 1px; flex: none; white-space: nowrap; line-height: 1.4; }
.balance-inline small { font-size: 10px; opacity: .8; }
.balance-inline strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.live-heading .balance-inline { margin-left: auto; color: #ffe0a4; }
.live-heading { gap: 12px; }
.live-heading .live-countdown { flex: none; }
.bet-panel .bet-heading { gap: 9px; flex-wrap: wrap; }
.bet-panel .bet-heading > div { display: block; }
.bet-panel .bet-heading h2 { font-size: 16px; }
.bet-panel .balance-inline { margin-left: auto; color: #6d451c; }
.section-balance { display: flex; align-items: baseline; gap: 8px; padding: 7px 14px; background: #f3f9fb; border-bottom: 1px solid #d8e6ed; color: #285e78; font-size: 11px; }
.section-balance strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.section-balance small { color: #7592a1; font-size: 10px; }
.history-preview-trigger { flex: none; margin-left: auto; border: 1px solid #b5cfdd; border-radius: 5px; color: #216485; background: #f5fafb; padding: 5px 8px; min-height: 32px; font-size: 11px; }
.history-preview-trigger[aria-expanded="true"] { background: #1d7199; color: white; border-color: #1d7199; }
.history-preview { position: fixed; z-index: 80; width: min(440px, calc(100vw - 20px)); background: #f8fcfe; border: 1px solid #94bdd2; border-radius: 10px; box-shadow: 0 12px 34px #173f5a38; overflow: hidden; }
.history-preview-heading { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #e4f1f7; border-bottom: 1px solid #c5dce8; }
.history-preview-heading strong { display: block; font-size: 14px; color: #174f70; }
.history-preview-heading small { color: #5f7f91; font-size: 10px; }
.history-preview-heading button { color: #315e76; font-size: 22px; width: 32px; height: 32px; }
.history-preview-list { max-height: min(350px, calc(100dvh - 150px)); overflow-y: auto; scrollbar-width: thin; padding: 3px 10px 8px; }
.history-preview-list > p { padding: 20px; color: #5f7f91; font-size: 12px; }
.preview-result-row { display: grid; grid-template-columns: 37px minmax(0, 1fr); align-items: center; gap: 6px; min-height: 36px; padding: 4px 0; border-bottom: 1px solid #dceaf1; }
.preview-result-row time { font-size: 11px; color: #527a92; font-variant-numeric: tabular-nums; }
.preview-result-balls { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.preview-result-balls .ball { width: 25px; height: 25px; font-size: 11px; justify-self: center; }
@media (max-width: 600px) {
  .live-heading { flex-wrap: wrap; gap: 6px 8px; }
  .live-heading .balance-inline strong { font-size: 12px; }
  .live-heading .balance-inline small { font-size: 9px; }
  .history-preview-trigger { font-size: 10px; padding: 4px; }
  .last-result { flex-wrap: wrap; height: auto; }
}
@media (max-width: 400px) {
  .live-heading .live-countdown { margin-left: auto; }
  .preview-result-balls { gap: 2px; }
  .preview-result-balls .ball { width: 21px; height: 21px; font-size: 10px; }
  .preview-result-row { grid-template-columns: 30px minmax(0, 1fr); gap: 4px; }
}

/* Six categories in two rows; favorites has its own quiet, full-width entry. */
.bet-panel .market-tabs .collection-tab { grid-column: 1 / -1; padding: 5px; min-height: 30px; }
.comparison-picker { padding: 10px; margin: 5px 0 10px; border: 1px solid #dcb783; border-radius: 8px; background: #ffefd7; }
.comparison-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 5px; margin-bottom: 9px; }
.comparison-heading strong { color: #68431f; font-size: 13px; }
.comparison-heading span { color: #795d3c; font-size: 11px; }
.comparison-balls { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; }
.comparison-balls button { display: grid; place-items: center; min-height: 48px; background: #fffaf2; border: 1px solid #dbc5a5; border-radius: 6px; }
.comparison-balls button.active { background: #19688c; border-color: #0e4b6a; box-shadow: inset 0 0 0 1px #0e4b6a; }
.comparison-balls .ball { width: 30px; height: 30px; font-size: 13px; }
.bet-panel .choices.duel-choices, .row-choices.type-duel { grid-template-columns: repeat(2,minmax(0,1fr)); }
.bet-panel .duel-choices .choice { min-height: 98px; gap: 7px; }
.bet-panel .duel-choices .ball { width: 40px; height: 40px; font-size: 17px; }
.duel-win-label { font-size: 12px; font-weight: 650; }
.row-choices .duel-win-label { font-size: 10px; }
.pair-empty { grid-column: 1 / -1; padding: 26px 10px; color: #886d49; text-align: center; font-size: 13px; }
.node-missing { font-size: 12px; color: #668297; line-height: 1.6; }
.history-sum { color: #176287; font-size: 16px; white-space: nowrap; }
.history-plus { font-size: 11px; color: #859bac; }
.history-comeback { font-size: 12px; color: #365f79; }
.history-panel[data-history-mode="comeback"] .history-row,
.history-panel[data-history-mode="lastComeback"] .history-row { min-height: 37px; }
.bet-panel button:disabled { cursor: not-allowed; }
#betNow:disabled, #submitCart:disabled { opacity: .6; }

.betting-tools-label { color: #795735; font-size: 13px; font-weight: 700; }
.history-no-event { font-size: 12px; color: #6f8797; }
