/* Shared reading surfaces for competition tables, match forecasts and team profiles. */
@media (forced-colors: none) {
  html[data-theme] #main :is(#ratings,#global) .table-shell {
    background-color: var(--panel);
    border-color: var(--line);
    box-shadow: none;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    :is(#strength-table,#global-table,.snapshot-table) tbody tr:not(.tournament-group-heading) > :is(th,td) {
    border-bottom-color: var(--line);
    font-variant-numeric: tabular-nums lining-nums;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    :is(#strength-table,#global-table,.snapshot-table) tr:not(.tournament-group-heading) > td:first-child {
    color: var(--muted);
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    :is(#strength-table,#global-table,.snapshot-table) .club {
    color: var(--ink);
    font-weight: 600;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    :is(#strength-table,#global-table,.snapshot-table) .club-name > small {
    color: var(--muted);
    font-size: .765rem;
    line-height: 1.25;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    :is(#strength-table,#global-table,.snapshot-table) thead th {
    background-color: var(--table-heading);
    color: var(--muted);
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    :is(#strength-table,#global-table,.snapshot-table) thead th:is(.main-metric,[aria-sort=descending],[aria-sort=ascending]) {
    background-color: var(--selected);
    color: var(--green);
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    :is(#strength-table,#global-table,.snapshot-table) td.main-metric {
    background-color: var(--column);
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    :is(#strength-table,#global-table,.snapshot-table) td.main-metric :is(.score,.goal-value) {
    color: var(--ink);
    font-weight: 650;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    :is(#strength-table,#global-table,.snapshot-table) .bar {
    height: 3px;
    border-radius: 1px;
  }
  html[data-theme] body[data-palette] #main #ratings .fixture-day-heading {
    background: var(--soft);
    color: var(--ink);
    border-color: var(--line);
    font-weight: 650;
    letter-spacing: 0;
  }
  html[data-theme] body[data-palette] #main :is(#ratings,#todays-fixtures) .fixture-card .fixture-score {
    color: var(--ink);
    font-weight: 650;
    font-variant-numeric: tabular-nums;
  }
  html[data-theme] body[data-palette] #main :is(#ratings,#todays-fixtures) .fixture-card .probabilities b {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }

  /* Draw the colour behind the label; the tap target can grow without enlarging the pill. */
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    .collection-menu .collection-menu-toggle {
    position: relative;
    isolation: isolate;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .27rem;
    width: auto;
    min-width: 0;
    min-height: 32px;
    padding: 0 .55rem;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--on-selected);
    box-shadow: none;
    font-size: .8125rem;
    font-weight: 600;
    line-height: 1.15;
  }
  html[data-theme] #main :is(#ratings,#global) .collection-menu-toggle::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    transform: translateY(-50%);
    height: 26px;
    z-index: -1;
    background: var(--selected);
    border: 1px solid color-mix(in srgb, var(--green) 42%, var(--panel));
    border-radius: 5px;
    pointer-events: none;
  }
  html[data-theme] #main :is(#ratings,#global) .collection-menu-toggle[aria-expanded=true]::before {
    border-color: var(--green);
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
    .collection-menu .collection-menu-toggle svg {
    width: 14px;
    height: 14px;
  }

  html[data-theme] body[data-palette] #main #predict .match-forecast {
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: none;
  }
  html[data-theme] #main #predict .prediction-score strong {
    color: var(--ink);
    font-size: clamp(1.75rem, 3.3vw, 2.75rem);
    font-weight: 550;
    font-variant-numeric: tabular-nums;
    letter-spacing: -.035em;
  }
  html[data-theme] #main #predict .prediction-score :is(strong > span,p) { color: var(--muted); }
  html[data-theme] #main #predict .matchup-team-button {
    min-height: 54px;
    padding: .5rem .625rem;
    border-radius: 6px;
    border-color: var(--control-edge);
    background-color: var(--panel);
  }
  html[data-theme] #main #predict .matchup-team-caption { gap: 2px; }
  html[data-theme] #main #predict .matchup-team-caption strong {
    color: var(--ink);
    font-size: .975rem;
    font-weight: 600;
    line-height: 1.18;
  }
  html[data-theme] #main #predict .matchup-team-caption small {
    color: var(--muted);
    font-size: .77rem;
    line-height: 1.25;
  }
  html[data-theme] #main #predict .probabilities b {
    color: var(--ink);
    font-size: clamp(1.125rem,2vw,1.65rem);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  html[data-theme] body[data-palette] #profile {
    color: var(--ink);
    background: var(--panel);
    border-color: var(--line);
  }
  #profile #profileBody .profile-date {
    margin-block: .375rem .75rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  #profile #profile-name {
    letter-spacing: -.025em;
    line-height: 1.1;
    font-weight: 650;
  }
  #profile #profileBody .team-dial {
    width: min(100%, 38rem);
    max-width: 100%;
    box-sizing: border-box;
    margin: .875rem auto 1.125rem;
    padding: .75rem;
    border-radius: 9px;
    background: var(--soft);
    color: var(--ink);
  }
  #profile #profileBody .team-dial svg { max-width: 15.5rem; }
  #profile #profileBody .dial-needle { fill: var(--ink); }
  #profile #profileBody .dial-fill { stroke: var(--green); }
  #profile #profileBody .dial-track { stroke: var(--control-edge); }
  #profile #profileBody .dial-value {
    font-size: 36px;
    font-weight: 600;
    fill: var(--ink);
  }
  #profile #profileBody .dial-label { fill: var(--muted); font-size: 15px; }
  #profile #profileBody .team-dial dl { margin-bottom: 0; }
  #profile #profileBody .team-dial dt { font-size: .8125rem; }
  #profile #profileBody .team-dial dd {
    color: var(--ink);
    font-size: 1.5rem;
    line-height: 1.15;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
  }
  #profile #profileBody .card-fixture-columns {
    border-top: 1px solid var(--line);
    padding-top: .75rem;
  }

  @media (min-width: 600px) {
    #profile #profileBody .team-dial {
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
      align-items: center;
      gap: .25rem 1rem;
      text-align: left;
    }
    #profile #profileBody .team-dial svg { grid-column: 1; grid-row: 1; }
    #profile #profileBody .team-dial p { grid-column: 1; grid-row: 2; text-align: center; }
    #profile #profileBody .team-dial dl {
      grid-column: 2;
      grid-row: 1 / span 2;
      display: grid;
      grid-template-columns: 1fr;
      gap: .7rem;
      margin: 0;
      padding: 0 0 0 1rem;
      border: 0;
      border-left: 1px solid var(--line);
    }
  }
  @media (pointer: coarse) {
    html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global)
      .collection-menu .collection-menu-toggle { min-height: 44px; }
  }
}
