/* The Matches homepage also uses this footer, before any table mode is selected. */
body:not(:has(#modeButtons [data-mode="handicaps"].selected):has(#handicapTable.handicap-table)) .site-footer .ppg-note,
body:has([data-bt-next-home="matches"].selected) .site-footer .ppg-note {
  display: none !important;
}

/* Reserve a price and a badge line even when the selected bookmaker has no quote. */
:is(#handicapTable.standard-table, .split-phase-table, .cup-league-table)
  :is(th, td):is(.outright-team-odds, .cup-table-odds) {
  --standings-odds-badge-height: 13px;
  --standings-odds-badge-gap: 2px;
}

#bt-uefa-section :is(.cup-standings, .cup-table-controls ~ .cup-league-table) .cup-table-odds {
  width: clamp(74px, 14%, 122px);
  box-sizing: border-box;
}

#bt-uefa-section :is(.cup-standings, .cup-player-controls + .cup-table-wrap .cup-league-table, .cup-table-controls ~ .cup-league-table)
  .cup-odds-price {
  display: flex;
  min-block-size: calc(1lh + var(--standings-odds-badge-gap) + var(--standings-odds-badge-height));
  contain: inline-size;
}

#bt-uefa-section :is(.cup-standings, .cup-player-controls + .cup-table-wrap .cup-league-table, .cup-table-controls ~ .cup-league-table)
  .cup-player-price-books {
  block-size: var(--standings-odds-badge-height);
}

/* A bookmaker may also supply a different player field in Full Market.
   Give the header the same column widths regardless of that field. */
#bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table {
  table-layout: fixed;
}

#bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table thead th {
  box-sizing: border-box;
}

#bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table thead th:first-child {
  width: 6%;
}

#bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table thead th:nth-child(2) {
  width: 32%;
}

#bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table thead th:nth-child(4) {
  width: 4%;
}

#bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table
  thead th:is(.cup-table-wide, :nth-last-child(4)) {
  width: 7%;
}

#bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table thead th.cup-table-odds {
  width: 84px;
}

#tableContainer.player-odds-mode #handicapTable.top-scorer-table
  :is(.player-odds-price-cell, .outright-player-odds) {
  --player-odds-badge-height: 11px;
}

#tableContainer.player-odds-mode #handicapTable.top-scorer-table td:is(.player-odds-price-cell, .outright-player-odds)
  :is(.player-odds-price, .player-odds-sus, .player-odds-unavailable, .outright-odds-price) {
  display: block;
  line-height: 1.05;
  min-block-size: 14px;
  contain: inline-size;
}

#tableContainer.player-odds-mode #handicapTable.top-scorer-table td:is(.player-odds-price-cell, .outright-player-odds)
  :is(.player-odds-best-provider-logos, .outright-odds-provider-logos, .outright-odds-book) {
  block-size: var(--player-odds-badge-height);
  min-block-size: var(--player-odds-badge-height);
  margin-block-start: 2px;
  flex-wrap: nowrap;
  contain: inline-size;
}

#tableContainer.player-odds-mode #handicapTable.top-scorer-table
  td:is(.player-odds-price-cell, .outright-player-odds)
  :is(.player-odds-best-provider-logos, .outright-odds-provider-logos) img {
  flex-shrink: 0;
}

#tableContainer.player-odds-mode #handicapTable.top-scorer-table
  td:is(.player-odds-price-cell, .outright-player-odds):not(:has(
    .player-odds-best-provider-logos, .outright-odds-provider-logos, .outright-odds-book
  ))::after {
  content: "";
  display: block;
  block-size: var(--player-odds-badge-height);
  margin-block-start: 2px;
}

:is(#handicapTable.standard-table, .split-phase-table) td.outright-team-odds
  :is(.outright-odds-price, .outright-odds-provider-logos, .outright-odds-book) {
  contain: inline-size;
}

:is(#handicapTable.standard-table, .split-phase-table) td.outright-team-odds
  .outright-odds-price {
  min-block-size: 14px;
}

:is(#handicapTable.standard-table, .split-phase-table) td.outright-team-odds
  :is(.outright-odds-provider-logos, .outright-odds-book) {
  block-size: var(--standings-odds-badge-height);
  min-block-size: var(--standings-odds-badge-height);
  margin-block-start: var(--standings-odds-badge-gap);
  flex-wrap: nowrap;
}

:is(#handicapTable.standard-table, .split-phase-table)
  td.outright-team-odds:not(:has(.outright-odds-provider-logos, .outright-odds-book))::after {
  content: "";
  display: block;
  block-size: var(--standings-odds-badge-height);
  margin-block-start: var(--standings-odds-badge-gap);
}

@media (max-width: 700px) {
  /* DataTables creates separate header and body tables inside this wrapper. */
  #bt-shared-competition-panel #regionalsContainer
    :is(.dataTables_scroll, .dataTables_scrollHead, .dataTables_scrollHeadInner, .dataTables_scrollBody) {
    box-sizing: border-box;
    width: 100% !important;
    padding-inline-end: 0 !important;
  }

  #bt-shared-competition-panel #regionalsContainer .dataTables_scroll table.bt-regional-table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: fixed !important;
  }

  /* The table fits without a scroller. Let bookmaker details open above a row. */
  #bt-shared-competition-panel #regionalsContainer .dataTables_scrollBody {
    overflow: visible !important;
  }

  #bt-shared-competition-panel #regionalsContainer table.bt-regional-table
    [data-bt-market-column]:not(.dataTables_empty):not(:is(
      [data-bt-market-column="position"], [data-bt-market-column="team"],
      [data-bt-market-column="played"], [data-bt-market-column="goal-difference"],
      [data-bt-market-column="points"], [data-bt-market-column="odds"], .bt-regional-price
    )) {
    display: none !important;
  }

  #bt-shared-competition-panel #regionalsContainer table.bt-regional-table
    :is([data-bt-market-column="position"], [data-bt-market-column="played"], [data-bt-market-column="goal-difference"],
        [data-bt-market-column="points"]) {
    box-sizing: border-box;
    padding-inline: 2px !important;
    width: 25px !important;
    white-space: nowrap;
  }

  #bt-shared-competition-panel #regionalsContainer table.bt-regional-table
    :is([data-bt-market-column="goal-difference"], [data-bt-market-column="points"]) {
    width: 31px !important;
  }

  #bt-shared-competition-panel #regionalsContainer table.bt-regional-table
    :is([data-bt-market-column="odds"], .bt-regional-price) {
    box-sizing: border-box;
    padding-inline: 2px !important;
    width: 58px !important;
    white-space: nowrap;
  }

  #bt-shared-competition-panel #regionalsContainer table.bt-regional-table .odds-best-more-popover {
    inset-inline-start: auto;
    inset-inline-end: 0;
    transform: none;
  }

  #bt-shared-competition-panel #regionalsContainer table.bt-regional-table [data-bt-market-column="team"] {
    min-width: 0 !important;
    width: auto !important;
  }

  #bt-shared-competition-panel #regionalsContainer table.bt-regional-table
    [data-bt-market-column="team"] :is(a, [data-team-name], .team-name, .l1mc-v6-team-name, .exp-standings-team-name),
  #bt-shared-competition-panel #regionalsContainer table.bt-regional-table [data-bt-market-column="team"] {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }

  #bt-uefa-section :is(.cup-standings, .cup-table-controls ~ .cup-league-table) .cup-table-odds {
    width: 58px;
  }

  #tableContainer.player-odds-mode #handicapTable.top-scorer-table
    :is(.player-odds-price-cell, .outright-player-odds) {
    --player-odds-badge-height: 9px;
    min-inline-size: 56px;
  }
}

@media (max-width: 480px) {
  #bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table thead th:first-child {
    width: 10%;
  }

  #bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table thead th:nth-child(4) {
    width: 6%;
  }

  #bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table thead th:nth-last-child(4) {
    width: 12%;
  }

  #bt-uefa-section .cup-player-controls + .cup-table-wrap .cup-league-table thead th.cup-table-odds {
    width: 60px;
  }
}

@media (min-width: 1025px) {
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.player-odds-table.bt-player-table:has(thead .player-odds-price-cell) thead th:not(:is(.bt-planner-col,.player-odds-price-cell,[data-bt-player-column="odds"])) {
    width: auto !important;
  }
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.player-odds-table.bt-player-table:has(thead .player-odds-price-cell) thead th[data-bt-player-column="player"] {width: 19% !important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.player-odds-table.bt-player-table:has(thead .player-odds-price-cell) thead th[data-bt-player-column="team"] {width: 15% !important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.player-odds-table.bt-player-table:has(thead .player-odds-price-cell) thead th[data-bt-player-column="position"] {width: 4% !important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.player-odds-table.bt-player-table:has(thead .player-odds-price-cell) thead th.bt-planner-col {width: 28px !important;min-width: 28px !important;max-width: 28px !important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.player-odds-table.bt-player-table :is(th,td):is([data-bt-player-column="player"],[data-bt-player-column="team"]) {white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.player-odds-table.bt-player-table :is([data-bt-player-column="player"],[data-bt-player-column="team"]) :is(a,span) {white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;}
}

@media (min-width: 1025px) {
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.bt-player-table:not(.player-odds-table):has(thead .bt-stats-odds-column):has(thead th:nth-child(12)) thead th:not(:is(.bt-planner-col,.bt-stats-odds-column,[data-bt-player-column="odds"])) {
    width: auto !important;
  }
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.bt-player-table:not(.player-odds-table):has(thead .bt-stats-odds-column):has(thead th:nth-child(12)) thead th[data-bt-player-column="player"] {width: 19% !important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.bt-player-table:not(.player-odds-table):has(thead .bt-stats-odds-column):has(thead th:nth-child(12)) thead th[data-bt-player-column="team"]:not(.bt-planner-col) {width: 15% !important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.bt-player-table:not(.player-odds-table):has(thead .bt-stats-odds-column):has(thead th:nth-child(12)) thead th[data-bt-player-column="position"] {width: 4% !important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.bt-player-table:not(.player-odds-table):has(thead .bt-stats-odds-column):has(thead th:nth-child(12)) thead th.bt-planner-col {width: 28px !important;min-width: 28px !important;max-width: 28px !important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.bt-player-table:not(.player-odds-table):has(thead .bt-stats-odds-column):has(thead th:nth-child(12)) :is(th,td):is([data-bt-player-column="player"],[data-bt-player-column="team"]):not(.bt-planner-col) {white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;}
  html body.bt-player-screen-active #tableContainer.bt-player-screen #handicapTable.bt-player-table:not(.player-odds-table):has(thead .bt-stats-odds-column):has(thead th:nth-child(12)) :is([data-bt-player-column="player"],[data-bt-player-column="team"]):not(.bt-planner-col) :is(a,span) {white-space:normal!important;word-break:normal!important;overflow-wrap:normal!important;}
}


/* Shared betting-table containment and planner action spacing.
   One layout rule is included in both supported standings stylesheet variants. */
#bt-shared-competition-panel #regionalsContainer.bt-market-table-host {
  max-width: 100% !important;
}
/* Layered important declarations make this shared control authoritative over
   older table-specific padding rules without changing ordinary data cells. */
@layer bt-market-controls {
  table.bt-planner-table :is(th, td).bt-planner-col {
    box-sizing: border-box !important;
    padding-inline: 2px !important;
    text-align: center !important;
    vertical-align: middle !important;
  }
  table.bt-planner-table .bt-planner-add {
    box-sizing: border-box !important;
    display: block !important;
    margin-inline: auto !important;
  }
}
