/* Shared match geometry. Competition skins keep their own colours and scoreboards. */
.match-table-team-code { display: none; }

/* The round and left-hand camera share one heading row. Reserve the camera's
   full touch target beside the label, rather than stacking another blank row
   between the label and the score. Hidden cameras reserve no space. */
body #mainContent .stage-column > .stage-topline {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 18px !important;
  margin: 0 !important;
  padding: 0 4px !important;
  border: 0 !important;
}
body #mainContent .stage-column > .stage-topline #stageRoundLabel {
  position: static !important;
  inset: auto !important;
  width: auto !important;
  max-width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  text-align: center;
}
body #mainContent .stage-topline:has(+ #matchSnapshotActions #snapshotButton:not([hidden])) {
  min-height: 44px !important;
  margin-bottom: 0 !important;
  padding-inline: 52px !important;
}
body #mainContent #matchSnapshotActions:has(#snapshotButton:not([hidden])) {
  position: relative;
  z-index: 1;
  margin: -44px 0 8px !important;
  pointer-events: none;
}
body #mainContent #matchSnapshotActions #snapshotButton { pointer-events: auto; }

/* Scorebar skins reserve their own space underneath for clocks, aggregates
   and cards. Remove only the generous leading margin above each graphic. */
body #mainContent #matchContent > :is(.pl-broadcast, .laliga-broadcast,
  .bl-broadcast, .sa-broadcast, .wc14-scoreboard, .cb-broadcast) {
  margin-top: 8px !important;
}
/* Custom and standard matches retain their badge/name score row. Tighten its
   padding too, so the shared heading does not push those pitches down. */
body.shared-live-match-layout-active #mainContent #matchStage.match-stage.is-live:not(.is-shootout) #matchup.matchup {
  padding-block: 10px !important;
  min-height: 96px !important;
}
@media (max-width: 700px) {
  body.shared-live-match-layout-active #mainContent #matchStage.match-stage.is-live:not(.is-shootout) #matchup.matchup {
    padding-block: 6px !important;
    min-height: 78px !important;
  }
}

/* Several historical skins hide the heading's children while keeping its
   100px+ placeholder. The match already has its competition and round context. */
body.retro-mode-active:has(#retroTournamentBody > #mainContent:not([hidden])) .retro-tournament-heading {
  display: none !important;
}
body.retro-mode-active:has(#retroTournamentBody > #mainContent:not([hidden])) .retro-tournament-main {
  padding-top: 12px !important;
}
body.retro-mode-active:has(#retroTournamentBody > #mainContent:not([hidden])) .retro-saved-tournament-actions {
  min-height: 40px;
  margin: 0 0 12px !important;
}
body.retro-mode-active:has(#retroTournamentBody > #mainContent:not([hidden])) #retroWorldCupBackButton {
  position: static !important;
  margin: 0 !important;
}
body.retro-mode-active:has(#retroTournamentBody > #mainContent:not([hidden])) .retro-view-tabs {
  margin-bottom: 12px !important;
}

/* Square flags keep their shape, without an emoji showing through the gaps.
   The existing image-error handler removes failed images, restoring the fallback. */
body #mainContent .retro-live-table-flag.country-flag:has(> img) {
  background: transparent !important;
}
body #mainContent .retro-live-table-flag.country-flag:has(> img) > .flag-fallback {
  display: none;
}
body #mainContent .retro-live-table-flag img { object-fit: contain !important; }

/* Keep the optional-renderer fallback usable, including older World Cups. */
body #mainContent #matchContent > #eventControls:not([hidden]) {
  position: static !important;
  inset: auto !important;
  display: flex !important;
  justify-content: center;
  flex-wrap: wrap;
  width: 100% !important;
  gap: 8px !important;
  margin: 12px 0 !important;
  transform: none !important;
}
body #mainContent #matchContent > #eventControls > :is(#skipControl, #shootoutSkipControl):not([hidden]) {
  position: static !important;
  inset: auto !important;
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  transform: none !important;
  order: 3;
}
body #mainContent #matchContent > #eventControls :is(#pauseLiveButton, #speedButton, #skipLiveButton, #shootoutSkipButton) {
  min-height: 44px !important;
  height: auto !important;
  margin: 0 !important;
}
body #mainContent #matchContent > #eventControls #pauseLiveButton { order: 1; }
body #mainContent #matchContent > #eventControls #speedButton { order: 2; }

@media (max-width: 850px) {
  /* On smaller screens, match decisions come before competition context.
     Keep stats and tactics together, then give scorers and standings equal space. */
  body:not(.before-start) #mainContent.content:not([hidden]):not(.has-visible-champion-stage) {
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-areas:
      "stage stage"
      "support support"
      "boot boot"
      "board board" !important;
    width: min(1040px, calc(100% - 32px)) !important;
    max-width: calc(100% - 32px) !important;
    margin-inline: auto !important;
    padding-inline: 0 !important;
    gap: 16px !important;
    align-items: stretch;
  }
  body:not(.before-start) #mainContent.content:not(.has-visible-champion-stage):has(> :is(#plEngineTablePanel, #uclEngineTablePanel, #afcEliteMatchPanel):not([hidden])) {
    grid-template-areas:
      "stage stage"
      "support support"
      "boot standings"
      "board board" !important;
  }
  body #mainContent.content:not(.has-visible-champion-stage) > .stage-column {
    grid-area: stage !important;
    width: min(100%, 860px) !important;
    min-width: 0 !important;
    justify-self: center;
  }
  body #mainContent .stage-column > .pl-live-back-button {
    margin-left: 0 !important;
  }
  body #mainContent.content:not(.has-visible-champion-stage) > .insight-right {
    display: grid !important;
    grid-area: support !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: auto !important;
    align-items: stretch;
    gap: inherit;
    width: 100% !important;
    min-width: 0;
    margin: 0 !important;
  }
  body #mainContent.content:not(.has-visible-champion-stage) > .insight-left {
    grid-area: boot !important;
    align-self: stretch !important;
    align-content: stretch;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  body #mainContent.content:not(.has-visible-champion-stage) .golden-boot-panel {
    box-sizing: border-box;
    height: 100%;
    margin: 0 !important;
  }
  body #mainContent #matchAnalysis {
    display: flex !important;
    flex-direction: column;
    grid-area: 1 / 1 !important;
    grid-column: 1 !important;
    align-self: stretch;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  body #mainContent .insight-right.tactics-hidden #matchAnalysis {
    grid-column: 1 / -1 !important;
  }
  body #mainContent #matchStatsGrid {
    display: grid !important;
    grid-auto-rows: minmax(32px, 1fr);
    flex: 1;
    min-height: 240px;
    box-sizing: border-box;
  }
  body #mainContent #matchStatsGrid:has(.match-stats-empty) {
    min-height: 160px;
  }
  body #mainContent #matchStatsGrid .match-stat-row {
    align-content: center;
  }
  body #mainContent :is(#standardMatchTactics, #plWatchTactics):not([hidden]) {
    grid-area: 1 / 2 !important;
    grid-column: 2 !important;
    align-self: stretch;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  body #mainContent #standardTacticButtons {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body #mainContent #standardTacticButtons button {
    min-height: 44px;
  }
  body #mainContent :is(#plEngineTablePanel, #uclEngineTablePanel, #afcEliteMatchPanel):not([hidden]) {
    grid-area: standings !important;
    align-self: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  body #mainContent :is(#plEngineTablePanel, #uclEngineTablePanel, #afcEliteMatchPanel, #standardMatchTactics, #plWatchTactics)[hidden] {
    display: none !important;
  }
  body #mainContent #roundBoard {
    grid-area: board !important;
    width: 100% !important;
    min-width: 0 !important;
  }
  /* Cup round lists follow the support panels without creating an implicit column. */
  body #mainContent > .fa-match-rounds:not([hidden]) {
    grid-area: auto / 1 / auto / -1 !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
  }
  body #mainContent .insight-right > .plot-panel { display: none !important; }
  body #mainContent .golden-boot-team-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

}

@media (max-width: 700px) {
  body #retroWorldCupScreen { width: 100% !important; max-width: 100% !important; }
  body:not(.before-start) #mainContent.content:not([hidden]):not(.has-visible-champion-stage) {
    width: calc(100% - 20px) !important;
    max-width: calc(100% - 20px) !important;
    gap: 10px !important;
  }
  body #mainContent .golden-boot-row {
    grid-template-columns: 12px minmax(0, 1fr) 18px !important;
    gap: 5px !important;
    padding: 10px 8px !important;
  }
  body #mainContent .golden-boot-player {
    min-width: 0;
  }
  body #mainContent .golden-boot-player strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  body #mainContent :is(#matchAnalysis .match-analysis-heading, .golden-boot-panel .panel-heading, #plEngineTablePanel .panel-heading, #uclEngineTablePanel .panel-heading) {
    box-sizing: border-box;
    min-height: 36px !important;
    padding: 8px !important;
    gap: 3px !important;
  }
  body #mainContent :is(#matchAnalysis .match-analysis-heading strong, #goldenBootTitle, #plEngineTablePanel .panel-heading > *, #uclEngineTablePanel .panel-heading > *) {
    font-size: 12px !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
  }
  body #mainContent #matchStatsGrid {
    padding: 8px !important;
    gap: 7px !important;
  }
  body #mainContent #matchStatsGrid .match-stat-row:not(.match-stats-empty) {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
    grid-template-rows: auto 5px !important;
    gap: 2px 5px !important;
    padding: 0 !important;
    min-height: 0 !important;
  }
  body #mainContent #matchStatsGrid .match-stat-row > span {
    grid-area: 1 / 2 !important;
    font-size: 10px !important;
    line-height: 1.3 !important;
    text-align: center;
    white-space: nowrap;
  }
  body #mainContent #matchStatsGrid .match-stat-row > b {
    grid-row: 1 !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
  }
  body #mainContent #matchStatsGrid .match-stat-row > b:first-child { text-align: left; }
  body #mainContent #matchStatsGrid .match-stat-row > b:nth-child(3) { text-align: right; }
  body #mainContent #matchStatsGrid .match-stat-bars { grid-row: 2 !important; height: 5px; }

  body #mainContent :is(.retro-live-table-head, .retro-live-table-row) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 12px 25px 19px !important;
    gap: 3px !important;
    padding-inline: 6px !important;
  }
  body #mainContent .retro-live-table-head { min-height: 25px; font-size: 9px !important; }
  body #mainContent .retro-live-table-row { min-height: 46px !important; }
  body #mainContent .retro-live-table-row > span { display: flex; gap: 3px !important; min-width: 0; }
  body #mainContent .retro-live-table-row > span > em {
    width: 9px !important;
    flex: 0 0 9px !important;
    font-size: 10px !important;
  }
  body #mainContent :is(.retro-live-table-flag, .retro-live-table-flag img) {
    width: 20px !important;
    height: 14px !important;
    flex: 0 0 20px !important;
    object-fit: contain;
  }
  body #mainContent .retro-live-table-row strong { overflow: hidden; min-width: 0; font-size: 11px !important; }
  body #mainContent .retro-live-table-row > b { font-size: 11px !important; }
  body #mainContent .retro-live-table-head b { font-size: 9px !important; }
  body #mainContent .match-table-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  body #mainContent :is(.pl-engine-table-head, .pl-engine-table-row) {
    grid-template-columns: 16px minmax(0, 1fr) 21px 22px !important;
    gap: 4px !important;
    padding-inline: 6px !important;
  }
  body #mainContent .pl-engine-table-head { min-height: 25px; font-size: 9px !important; }
  body #mainContent .pl-engine-table-head > span { white-space: nowrap; }
  body #mainContent .pl-engine-table-row { min-height: 40px !important; padding-block: 6px !important; }
  body #mainContent .pl-engine-table-row > span { gap: 4px !important; min-width: 0; }
  body #mainContent .pl-engine-table-row > span strong {
    font-size: 10px !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body #mainContent .pl-engine-table-row > :is(b, i, strong:last-child) { font-size: 12px !important; }
  body #mainContent .pl-engine-table-row :is(.fixture-flag, .fixture-flag img) {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    flex-basis: 18px !important;
    object-fit: contain;
  }
  body #mainContent .pl-engine-table-row > span > img {
    width: 18px !important;
    height: 18px !important;
    flex: 0 0 18px !important;
    object-fit: contain;
  }
  body #mainContent :is(#plEngineTablePanel, #uclEngineTablePanel) .panel-heading {
    justify-content: center;
    text-align: center;
  }
  body #mainContent :is(#plEngineTablePanel, #uclEngineTablePanel) .panel-heading > span { display: none; }
  body #mainContent .pl-engine-full-table { min-height: 44px; font-size: 11px; }

  body #mainContent #matchContent > #eventControls:not([hidden]) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 62px minmax(0, 1.2fr);
  }
  body #mainContent #matchContent > #eventControls :is(#pauseLiveButton, #speedButton, #skipLiveButton, #shootoutSkipButton) {
    width: 100% !important;
    min-width: 0 !important;
    padding: 8px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
  body #mainContent #matchStage.is-live { min-height: 0 !important; }
}
@media (max-width: 500px) {
  body #mainContent .match-table-team-name { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
  body #mainContent .match-table-team-code { display: inline; }
}
/* The shared matchday squad editor inherits each competition's existing theme. */
.retro-manager-bench-controls {
  gap: 8px;
  flex-wrap: wrap;
}
.retro-manager-bench-controls > span {
  margin-left: auto;
}
.retro-manager-bench-controls > .secondary-button {
  min-height: 44px;
  padding: 6px 10px;
  font-size: 13px;
}
.retro-manager-squad-group-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px 6px;
  color: inherit;
  font-size: 12px;
}
.retro-manager-player[data-retro-bench-player][aria-pressed="true"] > b::after {
  content: "✓";
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e8fff1;
  color: #075b30;
  font-size: 11px;
  line-height: 14px;
  text-align: center;
}
.retro-manager-player[data-retro-bench-player] > b {
  position: relative;
}

/* Shared XI controls stay above the pitch in every competition. */
html body #mainContent .prematch-lineup-toolbar.is-result-lineup-trigger {
  position: absolute;
  top: 0;
  right: 12px;
  z-index: 6;
  display: flex;
  margin: 0;
}
html body #mainContent .is-result-lineup-trigger .prematch-lineup-button {
  min-width: 150px;
  min-height: 36px;
  padding: 7px 12px;
  font-size: 12px;
  box-shadow: 0 3px 12px #0005;
}
html body.commentary-result-active #mainContent .commentary-match-feed {
  padding-top: 44px;
}
html body #mainContent .commentary-match-feed.is-lineup-transitioning > :is(#retroMatchLineupsPanel, ol) {
  will-change: opacity;
}
html body #mainContent .commentary-match-feed.has-result-lineups > :is(ol, .commentary-feed-heading) {
  display: none !important;
}
html body #mainContent #retroMatchLineupsPanel.is-result-inline[open] {
  position: relative;
  inset: auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
html body #mainContent #retroMatchLineupsPanel.is-result-inline > summary {
  display: none !important;
}
html body #mainContent #retroMatchLineupsPanel.is-result-inline > .retro-lineups-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
html body #mainContent #retroMatchLineupsPanel .retro-lineup-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
html body #mainContent #retroMatchLineupsPanel .retro-lineup-toolbar .retro-lineup-tabs {
  width: min(100%, 260px);
  flex: 0 1 260px;
  margin: 0;
  justify-self: start;
}
html body #mainContent #retroMatchLineupsPanel .retro-lineup-toolbar .retro-lineup-tabs button {
  min-height: 36px;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.2;
}
html body #mainContent #retroMatchLineupsPanel .retro-lineup-toolbar .retro-pitch-corner-control {
  position: static !important;
  inset: auto !important;
  margin: 0 !important;
  transform: none !important;
  flex: 0 0 auto;
}
html body #mainContent #retroMatchLineupsPanel .retro-lineup-toolbar [data-retro-manager-formation] {
  width: 112px;
  min-width: 112px;
  min-height: 36px;
  padding: 4px 8px;
  font-size: 12px;
}
html body #retroMatchLineupsPanel.is-pitch-overlay {
  container: lineup-panel / inline-size;
}
html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-lineup-workspace {
  grid-template-rows: auto minmax(0, 1fr);
}
html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-lineup-workspace:has(> .is-forced-management) {
  grid-template-rows: auto auto minmax(0, 1fr);
}
html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-pitch {
  min-height: 390px;
}
/* Keep competition button skins off the player markers, including hover/selection. */
html body #mainContent #retroMatchLineupsPanel .retro-pitch-player {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-content: normal;
  width: clamp(54px, 21%, 76px);
  padding: 2px 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #ffffff !important;
  text-shadow: 0 1px 2px #071b14, 0 0 4px #071b14, 0 0 8px #071b14;
}
html body #mainContent #retroMatchLineupsPanel .retro-pitch-player > span {
  color: #ffffff !important;
  background: transparent !important;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}
html body #mainContent #retroMatchLineupsPanel .retro-pitch-player > i {
  min-width: 0;
  padding: 0;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--lineup-rating-colour, #ffffff) !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-shadow: -1px 0 1px #071b14, 1px 0 1px #071b14, 0 -1px 1px #071b14, 0 2px 2px #071b14;
}
html body #mainContent #retroMatchLineupsPanel i.is-poor {
  --lineup-rating-colour: #ff8585;
}
html body #mainContent #retroMatchLineupsPanel i.is-average {
  --lineup-rating-colour: #ffbb70;
}
html body #mainContent #retroMatchLineupsPanel i.is-good {
  --lineup-rating-colour: #82e5a0;
}
html body #mainContent #retroMatchLineupsPanel i.is-excellent {
  --lineup-rating-colour: #b8f483;
}
html body #mainContent #retroMatchLineupsPanel .retro-manager-player > i:is(.is-poor, .is-average, .is-good, .is-excellent) {
  color: var(--lineup-rating-colour) !important;
  text-shadow: 0 1px 2px #071b14, 0 0 4px #071b14;
}
html body #mainContent #retroMatchLineupsPanel .retro-pitch-player > b {
  position: relative;
  overflow: visible;
}
html body #mainContent #retroMatchLineupsPanel .retro-pitch-player > b > .retro-player-card-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 8px;
  height: 11px;
  margin: 0;
  box-shadow: 0 1px 3px #071b14;
}
html body #mainContent #retroMatchLineupsPanel .retro-pitch-player.has-red-card > b {
  color: #c7cbc8 !important;
  background: color-mix(in srgb, var(--retro-team-kit, #244f40) 30%, #0b100d) !important;
  border-color: #78887d !important;
}
html body #mainContent #retroMatchLineupsPanel .retro-pitch-player.has-red-card > span {
  color: #b9c3bd !important;
}
@media (min-width: 601px) {
  html body #mainContent #retroMatchLineupsPanel:not(.is-pitch-overlay) .is-live-ratings .retro-manager-layout {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 35%);
  }
  html body #mainContent #retroMatchLineupsPanel:not(.is-pitch-overlay) .is-live-ratings .retro-manager-pitch {
    min-height: 390px;
  }
  html body #mainContent #retroMatchLineupsPanel:not(.is-pitch-overlay) .is-live-ratings .retro-manager-section.is-bench {
    height: 0;
    min-height: 100%;
    padding: 0 0 0 10px;
    border-top: 0;
    border-left: 1px solid var(--shared-live-border);
    overflow: hidden;
  }
  html body #mainContent #retroMatchLineupsPanel:not(.is-pitch-overlay) .is-live-ratings .retro-manager-player-list {
    max-height: none;
    overflow-y: auto;
  }
  @container lineup-panel (max-width: 620px) {
    html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-layout {
      grid-template-columns: minmax(0, 1fr) minmax(150px, 35%);
      gap: 8px;
      padding: 8px;
    }
    html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-section.is-bench {
      height: 0;
      min-height: 100%;
      padding: 0 0 0 8px;
      border-top: 0;
      border-left: 1px solid var(--shared-live-border);
      overflow: hidden;
    }
    html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-section.is-bench .retro-manager-player-list {
      max-height: none;
      overflow-y: auto;
    }
    html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-player {
      grid-template-columns: 20px minmax(0, 1fr) 24px;
      grid-template-rows: auto auto;
      gap: 2px 6px;
      min-height: 58px !important;
      padding: 6px;
    }
    html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-player > b {
      grid-column: 1;
      grid-row: 1;
    }
    html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-player > em {
      grid-column: 1;
      grid-row: 2;
      font-size: 8px;
    }
    html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-player > span {
      grid-column: 2;
      grid-row: 1 / span 2;
    }
    html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-player strong {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      white-space: normal;
      font-size: 11px;
      line-height: 1.25;
    }
    html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-player > i {
      grid-column: 3;
      grid-row: 1 / span 2;
    }
  }
}
@media (max-width: 600px) {
  html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-lineup-workspace {
    height: auto;
    min-height: 100%;
    grid-template-rows: auto auto;
  }
  html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-lineup-workspace:has(> .is-forced-management) {
    grid-template-rows: auto auto auto;
  }
  html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-lineup {
    overflow: visible;
  }
  html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    height: auto;
    gap: 10px;
    padding: 8px;
  }
  html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-pitch {
    height: auto;
    min-height: 380px;
    aspect-ratio: 1.2;
  }
  html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-section.is-bench {
    height: auto;
    min-height: 0;
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid var(--shared-live-border);
    overflow: visible;
  }
  html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-section.is-bench .retro-manager-player-list {
    max-height: 240px;
    overflow-y: auto;
  }
}
/* Bench rows give the name space, with the position underneath and a clear rating. */
html body #mainContent #retroMatchLineupsPanel .retro-manager-section.is-bench .retro-manager-player {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 36px;
  grid-template-rows: auto auto;
  align-content: center;
  column-gap: 8px;
  row-gap: 2px;
  min-height: 62px !important;
  padding: 8px 6px;
  border: 0;
  border-bottom: 1px solid var(--shared-live-border, var(--q22-line));
  border-radius: 0;
  background: transparent;
}
html body #mainContent #retroMatchLineupsPanel .retro-manager-section.is-bench .retro-manager-player > b {
  grid-column: 1;
  grid-row: 1 / span 2;
  display: grid;
  width: 26px;
  height: 30px;
  place-items: center;
  font: 800 12px Arial, Helvetica, sans-serif;
}
html body #mainContent #retroMatchLineupsPanel .retro-manager-section.is-bench .retro-manager-player > span {
  grid-column: 2;
  grid-row: 1;
}
html body #mainContent #retroMatchLineupsPanel .retro-manager-section.is-bench .retro-manager-player strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
html body #mainContent #retroMatchLineupsPanel .retro-manager-section.is-bench .retro-manager-player > em {
  grid-column: 2;
  grid-row: 2;
  justify-self: start;
  font: 700 10px Arial, Helvetica, sans-serif;
  letter-spacing: 0.04em;
}
html body #mainContent #retroMatchLineupsPanel .retro-manager-section.is-bench .retro-manager-player > i {
  grid-column: 3;
  grid-row: 1 / span 2;
  width: 36px;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: 900 17px/1.1 Arial, Helvetica, sans-serif;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 420px) {
  html body #mainContent #retroMatchLineupsPanel.is-pitch-overlay .retro-manager-pitch {
    aspect-ratio: 0.88;
  }
  html body #mainContent #retroMatchLineupsPanel .retro-lineup-toolbar .retro-lineup-tabs {
    flex: 1 1 170px;
    width: auto;
  }
}
