/* Match the type scale and reading surfaces of the competition preview. */
@media screen {
  html[data-theme] body[data-palette] :is(#ratings, #global, #predict, #profile, #collection-dialog) {
    --font-ui: var(--site-type);
    --font-sans: var(--font-ui);
    --table-number-size: 1.0625rem;
    --table-change-size: .9375rem;
    --table-heading-size: .8125rem;
    --analysis-rule: var(--line);
    --analysis-header: var(--soft);
    font-family: var(--font-ui);
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main :is(#ratings,#global) .table-shell {
    box-sizing: border-box;
    min-width: 0;
    padding: 0;
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--analysis-rule);
    border-radius: 8px;
    box-shadow: none;
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main :is(#ratings,#global) .table-heading-controls {
    background: var(--analysis-header);
    border-block: 0 1px solid var(--analysis-rule);
    border-radius: 8px 8px 0 0;
    padding: 5px 14px;
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main :is(#ratings,#global) :is(.table-settings,.global-table-toolbar,.table-options) {
    padding-inline: 14px;
    background: var(--panel);
    color: var(--ink);
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main :is(#ratings,#global) .table-description {
    padding-inline: 14px;
    color: var(--muted);
    font: 400 .875rem/1.45 var(--font-ui);
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main :is(#ratings,#global) .table-heading-value {
    font-family: var(--font-ui);
    letter-spacing: -.025em;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table tr:not(.desktop-column-groups,.tournament-group-heading) > :is(th,td) {
    border-inline: 0;
    border-bottom: 1px solid var(--analysis-rule);
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    vertical-align: middle;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table thead tr:last-child th {
    font: 600 var(--table-heading-size)/1.22 var(--font-ui);
    background: var(--analysis-header);
    color: var(--muted);
    text-transform: none;
    letter-spacing: 0;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table thead th:is([aria-sort=ascending],[aria-sort=descending]) button {
    color: var(--green);
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table tbody :is(.club,.club-name) {
    font-family: var(--font-ui);
    font-weight: 550;
    line-height: 1.22;
    text-align: start;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table tbody :is(.score,.goal-value) {
    font-variant-numeric: tabular-nums;
    font-weight: 620;
    letter-spacing: -.02em;
  }
  html[data-theme] body[data-palette] :is(#ratings,#global,#profile,#predict) .club-badge:has(img) {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  html[data-theme="dark"] body[data-palette] :is(#ratings,#global,#profile,#predict) .club-badge img {
    filter: drop-shadow(0 0 .7px #e1e7ed);
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main #predict .match-forecast {
    padding: clamp(14px,2.1vw,24px);
    background: var(--panel);
    border-radius: 8px;
    box-shadow: none;
  }
  html[data-theme] body[data-palette] #main #predict :is(.comparison-select,.predictor-options) {
    gap: 10px;
  }
  html[data-theme] body[data-palette] #main #predict .matchup-team-button {
    min-width: 0;
    padding: 8px 12px;
    background: var(--panel);
    border-color: var(--control-edge);
  }
  html[data-theme] body[data-palette] #main #predict .prediction-score strong {
    font: 600 clamp(2.25rem,3.5vw,3rem)/1.08 var(--font-ui);
    letter-spacing: -.055em;
  }
  html[data-theme] body[data-palette] #main #predict .matchup-narrative {
    max-width: 72ch;
    color: var(--muted);
    font-size: .9375rem;
    line-height: 1.5;
  }
  html[data-theme] body[data-palette] #main #predict .desktop-match-comparison thead th {
    background: var(--analysis-header);
    color: var(--ink);
  }
  html[data-theme] body[data-palette] #main #predict .desktop-match-comparison tbody :is(th,td) {
    padding-block: 9px;
    border-bottom: 1px solid var(--line);
    font-size: .9375rem;
  }
  html[data-theme] body[data-palette] #main #predict .match-forecast .probabilities {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    align-items: start;
    gap: 7px;
    margin: 5px 0 1px;
    border: 0;
    background: transparent;
  }
  html[data-theme] body[data-palette] #main #predict .match-forecast .probabilities > span {
    display: grid;
    gap: 3px;
    border: 0;
    border-radius: 0;
    border-top: 2px solid var(--control-edge);
    padding: 5px 0 0;
    background: transparent;
    font: 450 .8125rem/1.22 var(--font-ui);
    color: var(--muted);
    text-align: center;
  }
  html[data-theme] body[data-palette] #main #predict .match-forecast .probabilities > span:first-child { border-top-color: var(--green); }
  html[data-theme] body[data-palette] #main #predict .match-forecast .probabilities b {
    margin: 0;
    font: 620 1.15rem/1.22 var(--font-ui);
    color: var(--ink);
    font-variant-numeric: tabular-nums;
  }
  html[data-theme] body[data-palette] #main #ratings :is(.tournament-knockout,.tournament-tie-team) {
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    min-width: 0;
  }
  html[data-theme] body[data-palette] #profile {
    box-sizing: border-box;
    width: min(680px,calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: clamp(15px,2vw,24px);
    border-radius: 10px;
    overflow-y: auto;
  }
  html[data-theme] body[data-palette] #profile :is(#profile-name,.profile-identity h2) {
    font: 620 clamp(1.38rem,2vw,1.7rem)/1.16 var(--font-ui);
    letter-spacing: -.035em;
  }
  html[data-theme] body[data-palette] #profile #profileBody .team-dial {
    max-width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background-color: var(--soft);
  }
  html[data-theme] body[data-palette] #profile #profileBody .team-description {
    max-width: 65ch;
    font: 400 .9375rem/1.5 var(--font-ui);
  }
  #collection-dialog .collection-card-head h2 {
    font: 630 clamp(1.2rem,2.4vw,1.6rem)/1.16 var(--site-type);
    letter-spacing: -.03em;
  }
  #collection-dialog :is(.collection-caption,.collection-card-controls,.collection-plot-guide,.collection-values,.collection-explanation) {
    font-family: var(--site-type);
  }
}

@media screen and (min-width: 761px) {
  html[data-theme][data-analysis-navigation] body[data-palette] #main :is(#ratings,#global,#predict) {
    width: 100%;
    max-width: none;
    padding-inline: 0;
    min-width: 0;
    box-sizing: border-box;
    margin-inline: auto;
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main #ratings .table-heading-league .table-heading-value {
    font: 620 clamp(1.12rem,1.55vw,1.375rem)/1.15 var(--font-ui);
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main #ratings .table-heading-view .table-heading-value {
    font: 580 clamp(1rem,1.3vw,1.2rem)/1.2 var(--font-ui);
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table tbody tr:not(.tournament-group-heading) > td {
    height: 48px;
    padding-block: 5px;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table[data-desktop-columns] tr:not(.desktop-column-groups,.tournament-group-heading) > :nth-child(n+3),
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table[data-desktop-columns] thead tr:last-child th:nth-child(n+3) button {
    justify-content: center;
    text-align: center;
    padding-inline: 8px;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table tbody .club {
    min-height: 36px;
    gap: 9px;
    font-size: .975rem;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table td:first-child {
    font-size: .8125rem;
    color: var(--muted);
  }
  html[data-theme][data-table-navigation] body[data-palette] #main #strength-table .bar { margin-inline: auto; }
}

@media screen and (max-width: 760px) {
  html[data-theme] body[data-palette] :is(#ratings,#global) {
    --table-number-size: .9375rem;
    --table-heading-size: .78rem;
    --table-change-size: .875rem;
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main :is(#ratings,#global) .table-heading-controls {
    padding: 3px 7px;
  }
  html[data-theme][data-analysis-navigation] body[data-palette] #main :is(#ratings,#global) :is(.table-settings,.global-table-toolbar,.table-options,.table-description) {
    padding-inline: 7px;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table tbody tr:not(.tournament-group-heading) > td {
    height: 44px;
    padding-block: 4px;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table tbody .club {
    gap: 5px;
    font-size: .875rem;
  }
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table tbody .club-badge,
  html[data-theme][data-table-navigation] body[data-palette] #main :is(#ratings,#global) table tbody .club-badge img {
    width: 19px;
    height: 21px;
    flex: 0 0 19px;
    object-fit: contain;
  }
  html[data-theme] body[data-palette] #profile { max-height: calc(100dvh - 12px); padding: 12px; }
  html[data-theme] body[data-palette] #profile #profileBody .team-dial {
    display: grid;
    grid-template-columns: minmax(0,1.1fr) minmax(0,1fr);
    align-items: center;
    gap: 4px 8px;
    padding: 9px;
  }
  html[data-theme] body[data-palette] #profile #profileBody .team-dial svg { grid-column: 1; grid-row: 1; }
  html[data-theme] body[data-palette] #profile #profileBody .team-dial p { grid-column: 1; grid-row: 2; margin: 0; }
  html[data-theme] body[data-palette] #profile #profileBody .team-dial dl {
    grid-column: 2; grid-row: 1/span 2; display: grid; grid-template-columns: 1fr;
    gap: 5px; margin: 0; padding: 0 0 0 8px;
    border-top: 0; border-inline-start: 1px solid var(--line);
  }
}
