/* Race v3: preserve the blue, orange and warm gold 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; }
.betting-style { display: flex; padding: 3px; border-radius: 8px; background: #ead1ad; gap: 3px; }
.betting-style button { min-height: 34px; min-width: 72px; padding: 6px 16px; border-radius: 6px; font-size: 14px; font-weight: 750; color: #795735; }
.betting-style button.active { color: #fff; background: #155f86; box-shadow: 0 2px 5px #114a6b25; }
#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); }

/* Official and Favorites show complete rows, with page scrolling rather than hidden positions. */
.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; Official and Favorites only change panel content. */
  body:not(.layout-basic) .play-grid { grid-template-areas: "live bet" "history tickets"; }
  body.layout-basic .play-grid { grid-template-areas: "live history" "bet tickets"; }
  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; }
  .betting-style button { min-height: 38px; }
}
.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; } }
