/* Existing competition components own layout. Libertadores supplies palette and scorebug only. */
html body.libertadores-route-active :is(#afcSimulatorScreen, #premierLeagueSeasonScreen) { display: none !important; }
body.libertadores-match-mode-active #appShell :is(.topbar, #roundBoard, #storyStrip, .plot-panel, #fieldOverview, .page-kicker, #uclEngineTablePanel, #plEngineTablePanel) { display: none !important; }
html:has(body.libertadores-route-active),
html body.libertadores-route-active,
html body [data-achievement-theme="libertadores-2026"] {
  --bg: #10100f;
  --panel: #1c1b18;
  --panel-2: #28251e;
  --panel-3: #332d20;
  --text: #fff9eb;
  --muted: #c7bda4;
  --line: #615437;
  --soft: #fff0c8;
  --lime: #d8b866;
  --lime-dark: #b6954c;
  --pl-bg: #10100f;
  --pl-surface: #1c1b18;
  --pl-surface-light: #28251e;
  --pl-muted: #c7bda4;
  --pl-line: #615437;
  --pl-soft: #28251e;
  --pl-era-canvas: #10100f;
  --pl-era-canvas-rgb: 16 16 15;
  --pl-era-deep: #10100f;
  --pl-era-deep-rgb: 16 16 15;
  --pl-era-surface: #1c1b18;
  --pl-era-surface-rgb: 28 27 24;
  --pl-era-raised: #28251e;
  --pl-era-raised-rgb: 40 37 30;
  --pl-era-accent: #d8b866;
  --pl-era-accent-rgb: 216 184 102;
  --pl-era-accent-text: #10100f;
  --pl-era-muted: #c7bda4;
  --pl-era-muted-rgb: 199 189 164;
  --pl-era-white: #fff9eb;
  --pl-era-white-rgb: 255 249 235;
  --pl-era-ice: #fff0c8;
  --pl-era-ice-rgb: 255 240 200;
  --domestic-setup-accent: #d8b866;
  --domestic-setup-accent-text: #10100f;
  --achievement-accent: #d8b866;
  --achievement-accent-text: #10100f;
  --achievement-surface: #1c1b18;
  --achievement-surface-deep: #10100f;
  --achievement-tab-surface: #28251e;
  --achievement-card: #1c1b18;
  --achievement-card-complete: #332d20;
  --achievement-copy: #fff9eb;
  --achievement-muted: #c7bda4;
  --achievement-points: #d8b866;
  --achievement-shadow: #0008;
  --popup-blue-950: #10100f;
  --popup-blue-900: #1c1b18;
  --popup-blue-850: #28251e;
  --popup-blue-800: #332d20;
  color: #fff9eb;
  color-scheme: dark;
  background: #10100f !important;
}
html body.libertadores-route-active::before,
html body.libertadores-route-active::after { display: none !important; }
html body.libertadores-route-active :is(#appShell, #mainContent, #matchStage, .ucl-simulator-screen, .ucl-simulator-header, .mode-route-setup, .mode-route-setup-panel, .ucl-simulator-main) {
  color: #fff9eb !important;
  background: #10100f !important;
  background-image: none !important;
}
html body.libertadores-route-active :is(.brand-mark, .brand-mark-number, .brand-mark-label) { color: #d8b866 !important; border-color: #d8b866 !important; }
html body.libertadores-route-active :is(.panel, .ucl-panel, .retro-inline-team-option, .afc-squad-dialog, .ucl-view-tabs, .lineups-panel, .tactics-panel, .snapshot-modal) {
  color: #fff9eb !important;
  border-color: #615437 !important;
  background: #1c1b18 !important;
  background-image: none !important;
}
html body.libertadores-route-active :is(button:not(.authored-test-match-timeline-marker), select, input, .utility-button, .ucl-back-button) {
  color: #fff9eb;
  border-color: #615437;
  background-color: #28251e;
}
html body.libertadores-route-active :is(.primary-button, #playButton, [aria-pressed="true"], .retro-inline-team-option.is-selected) {
  color: #10100f !important;
  background: #d8b866 !important;
  border-color: #eed797 !important;
  box-shadow: none !important;
}
html body.libertadores-route-active :is(.retro-inline-team-option.is-selected strong, .retro-inline-team-option.is-selected small) { color: #10100f !important; }
html body.libertadores-route-active :is(.text-button, .pl-engine-full-table, .scorer-minute, .player-rating, #homeScore, #awayScore) { color: #d8b866 !important; }
html body.libertadores-route-active :is(.match-stat-bar-fill, .tactic-button.active, .formation-button.active, .player-rating-badge) { color: #10100f !important; background: #d8b866 !important; }
html body.libertadores-route-active :is(.modal, dialog):not(.afc-squad-dialog) { color: #fff9eb !important; background: #1c1b18 !important; border-color: #615437 !important; }
html body.libertadores-route-active :focus-visible { outline: 2px solid #eed797; outline-offset: 3px; }

html body.libertadores-route-active .ucl-simulator-screen {
  --ucl-navy-950: #10100f;
  --ucl-navy-900: #1c1b18;
  --ucl-navy-850: #28251e;
  --ucl-navy-800: #332d20;
  --ucl-blue: #b6954c;
  --ucl-blue-bright: #d8b866;
  --ucl-gold: #d8b866;
  --ucl-ink: #fff9eb;
  --ucl-muted: #c7bda4;
  --ucl-line: #615437;
  --ucl-soft: #332d20;
}
html body.libertadores-route-active :is(.ucl-primary-action, .primary-button) { color: #10100f !important; background: #d8b866 !important; border-color: #eed797 !important; box-shadow: none; }
html body.libertadores-route-active :is(.ucl-panel, .ucl-golden-boot, .ucl-group-table, .ucl-secondary-action, .ucl-bracket-tie, .ucl-fixture-row, .ucl-opponent-card, .ucl-empty-state, .afc-squad-dialog) { background: #1c1b18; border-color: #615437; color: #fff9eb; }
html body.libertadores-route-active :is(.ucl-panel > header button, .ucl-panel-footer button, .ucl-fixtures-toolbar button, .ucl-matchday-nav button, .ucl-bracket-watch) { color: #d8b866; background: #28251e; border-color: #615437; }
html body.libertadores-route-active :is(.ucl-table th, .ucl-table td, .ucl-fixture-row, .ucl-golden-boot-row, .ucl-panel > header) { border-color: #615437; }
html body.libertadores-route-active :is(.ucl-golden-boot-empty, .ucl-fixture-md, .ucl-kickoff, .ucl-table thead th, .ucl-table-legend, .ucl-stage-copy p, .ucl-opponent-venue-label) { color: #c7bda4; }
html body.libertadores-route-active :is(.ucl-table-points, .ucl-golden-boot-row i, .ucl-score, .ucl-view-tabs button.active, .ucl-bracket-team.is-winner strong) { color: #d8b866; }
html body.libertadores-route-active :is(.ucl-table tr.is-managed, .ucl-fixture-row.is-managed, .ucl-bracket-team.is-winner) { background: #332d20; }
html body.libertadores-route-active :is(.utility-button, .brand-mark) { color: #d8b866 !important; }
html body.libertadores-route-active .brand-mark { background: #332d20 !important; }
html body.libertadores-route-active .news-icon i { background: #d8b866 !important; }
html body.libertadores-route-active .toast { background: #28251e !important; color: #fff9eb !important; }
html body.libertadores-route-active .ucl-view-tabs button::after { background: #d8b866; }
#libertadoresMatchPanel { min-width: 0; overflow: hidden; }
#libertadoresMatchPanel .ucl-table { min-width: 0; }
#libertadoresMatchPanel .ucl-table :is(td, th) { padding: 7px 3px; }
.competition-folder-libertadores, .competition-edition-libertadores { background: #1c1b18 !important; border-color: #75633b !important; }
:is(.competition-folder-libertadores, .competition-edition-libertadores) img { width: 90% !important; height: 90% !important; object-fit: contain; filter: brightness(0) saturate(100%) invert(79%) sepia(33%) saturate(550%) hue-rotate(2deg) brightness(93%); }
/* World-feed scorebug: trophy, home, central score, away, gold clock. */
html body #competitionBroadcastScoreboard[data-mode="libertadores"] { width: min(360px, 100%); max-width: 360px; margin: 12px auto 22px; padding: 0; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-context { display: none; }
html body #competitionBroadcastScoreboard[data-mode="libertadores"] .cb-scorebug { display: grid; grid-template-columns: 34px 64px 27px 27px 64px minmax(74px, 1fr); height: 36px; min-height: 36px; border: 1px solid #a88d48; border-radius: 0; background: #111 !important; box-shadow: none; overflow: visible; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-team { display: contents; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-logo { grid-column: 1; grid-row: 1; display: block; width: 30px; height: 32px; background: center / contain no-repeat url('/assets/libertadores-2026/scoreboard-mark.generated.png'); }
html body #competitionBroadcastScoreboard[data-mode="libertadores"] :is(.cb-code, .cb-score, time) { display: flex; align-items: center; justify-content: center; height: 34px; font: 700 17px Arial, sans-serif; color: #fff !important; transform: none; padding: 0; min-width: 0; background: #111 !important; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-home .cb-code { grid-column: 2; grid-row: 1; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-home .cb-score { grid-column: 3; grid-row: 1; position: relative; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-home .cb-score::after { content: "–"; position: absolute; right: -5px; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-away .cb-score { grid-column: 4; grid-row: 1; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-away .cb-code { grid-column: 5; grid-row: 1; }
html body #competitionBroadcastScoreboard[data-mode="libertadores"] .cb-scorebug time { position: static; inset: auto; width: auto; grid-column: 6; grid-row: 1; color: #111 !important; background: #d8b866 !important; font-size: 16px; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-badge { display: none; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-team i { position: static; grid-row: 1; align-self: end; justify-self: start; margin: 0 0 2px 3px; color: #e32335; font-size: 7px; z-index: 1; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-home i { grid-column: 2; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-away i { grid-column: 5; }
#competitionBroadcastScoreboard[data-mode="libertadores"] .cb-aggregate { position: absolute; top: 36px; right: 0; color: #d8b866; background: #111; font: 12px Arial, sans-serif; padding: 4px 8px; }

/* Palette overrides for existing shared competition controls. */
body.libertadores-route-active { --uefa-setup-accent: #d8b866; --uefa-setup-accent-strong: #b6954c; --uefa-setup-header: #10100f; --uefa-setup-header-soft: #332d20; --uefa-setup-panel: #10100f; --uefa-setup-card: #1c1b18; --uefa-setup-border: #615437; --uefa-setup-muted: #c7bda4; }
html body.libertadores-route-active :is(.ucl-site-brand, .ucl-header-left a, .ucl-header-actions a, .ucl-back-button) { text-decoration: none; }
html body.libertadores-route-active .ucl-back-button { background: transparent; }
html body.libertadores-route-active :is(.ucl-view-tabs button, .ucl-fixture-row) { background-color: transparent; }
html body.libertadores-route-active .ucl-fixture-row { width: 100%; color: #fff9eb; border-top: 0; border-left: 0; border-right: 0; font: inherit; text-align: left; }
html body.libertadores-route-active .ucl-view-tabs button.active { color: #d8b866 !important; background: transparent !important; }
html body.libertadores-route-active :is(.ucl-champion-card p, .ucl-golden-boot-row small, .ucl-bracket-team strong, .standard-tactic-matchup, .standard-tactic-opponent) { color: #c7bda4; }
html body.libertadores-route-active :is(.ucl-header-left, .ucl-header-actions) .utility-button > span:first-child { color: #d8b866; border-color: #d8b866; }
html body.libertadores-route-active :is(.ucl-panel > header, .ucl-panel-heading, .ucl-group-table > h3, .ucl-golden-boot > header) { background: #28251e !important; border-color: #615437 !important; }
html body.libertadores-route-active .ucl-table tr[data-zone="direct"] td:first-child { color: #d8b866; box-shadow: inset 3px 0 #d8b866; }
html body.libertadores-route-active .ucl-table tr[data-zone="playoff"] td:first-child { color: #c7bda4; box-shadow: inset 3px 0 #8a7951; }
html body.libertadores-route-active .ucl-table tr[data-zone="out"] td:first-child { color: #c7bda4; box-shadow: none; }
html body.libertadores-route-active :is(.ucl-opponent-number, .ucl-opponent-copy small, .ucl-opponent-venue, .ucl-opponent-venue-label, .ucl-champion-awards dt, .ucl-champion-awards small) { color: #c7bda4; }
html body.libertadores-route-active .ucl-table-legend span:nth-child(1) { --legend-color: #d8b866; }
html body.libertadores-route-active .ucl-table-legend span:nth-child(2) { --legend-color: #a99561; }
html body.libertadores-route-active .ucl-table-legend span:nth-child(3) { --legend-color: #756e5f; }
html body.libertadores-route-active .ucl-champion-awards > div { background: #28251e; border-color: #615437; }

/* Shared match chrome must use the cup palette as well as competition screens. */
html body.libertadores-route-active .utility-button > span:first-child,
html body.libertadores-route-active .utility-button > span:first-child :is(svg, path) {
  color: #d8b866 !important;
  border-color: #d8b866 !important;
}
html body.libertadores-route-active .ucl-site-brand { color: #d8b866 !important; }
html body.libertadores-route-active .footer-last-updated > * { color: #c7bda4 !important; }
html body.libertadores-route-active .toast { border-color: #615437 !important; }
html body.libertadores-route-active .ucl-kickoff.is-watch-action { background: #332d20; border-color: #615437; color: #d8b866; }
html body.libertadores-route-active .match-stat-row { color: #c7bda4 !important; }
html body.libertadores-route-active .match-stat-track { background: #332d20 !important; }
html body.libertadores-route-active #standardTacticFeedback { color: #c7bda4 !important; }
html body.libertadores-route-active .ucl-score {
  color: #fff9eb;
  background: #332d20;
}
html body.libertadores-route-active :is(.ucl-score, .ucl-bracket-team > b, .ucl-kickoff, .ucl-opponent-number, .ucl-table td) {
  font-family: "Manrope", system-ui, sans-serif !important;
  font-variant-numeric: tabular-nums;
}
html body.libertadores-route-active .ucl-fixture-row:is(:hover, :focus-visible) {
  background: #28251e;
  border-color: #b6954c;
}
html body.libertadores-route-active .ucl-fixture-row:is(:hover, :focus-visible) :is(.ucl-kickoff.is-watch-action, .ucl-score) {
  color: #fff9eb;
  background: #4a3c20;
  border-color: #d8b866;
}
html body.libertadores-route-active .ucl-bracket-tie:is(.is-playable, .is-watchable, .is-viewable) {
  border-color: #75633b;
  box-shadow: 0 8px 24px #0003;
}
html body.libertadores-route-active .ucl-bracket-tie:is(:hover, :focus-visible) {
  background: #332d20;
  border-color: #d8b866;
  box-shadow: 0 8px 24px #0003;
}
html body.libertadores-route-active .ucl-bracket-decider { color: #c7bda4; }
html body.libertadores-route-active :is(.ucl-table td, .ucl-table-club, .ucl-team-mark-small, .ucl-table-club img) {
  color: #fff9eb !important;
}
html body.libertadores-route-active :is(.golden-boot-empty, .golden-boot-empty > *, .golden-boot-row small, .match-stats-empty, .footer-last-updated, .live-view-button, .standard-tactic-matchup) {
  color: #c7bda4 !important;
}
html body.libertadores-route-active :is(.match-analysis-heading, .match-stat-row, .lineup-panel, .lineup-bench, .team-management-panel, .standard-tactic-options, .match-analysis) {
  border-color: #615437 !important;
}
html body.libertadores-route-active :is(.lineup-panel, .lineup-bench, .team-management-panel, .standard-tactic-options) {
  background: #1c1b18 !important;
}

/* A neutral match has no tactics rail: place summaries below the match, then groups. */
html body.libertadores-match-mode-active #mainContent.content:has(#standardMatchTactics[hidden]) {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-template-areas: "stage stage" "stats boot" "groups groups" !important;
  width: min(1100px, calc(100% - 28px)) !important;
  margin-inline: auto !important;
  gap: 16px !important;
}
html body.libertadores-match-mode-active #mainContent.content:has(#standardMatchTactics[hidden]) > .stage-column {
  grid-area: stage !important;
  width: 100% !important;
  max-width: 900px;
  justify-self: center;
}
html body.libertadores-match-mode-active #mainContent.content:has(#standardMatchTactics[hidden]) > .insight-right {
  grid-area: stats !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) !important;
  margin: 0 !important;
}
html body.libertadores-match-mode-active #mainContent.content:has(#standardMatchTactics[hidden]) > .insight-left {
  grid-area: boot !important;
  margin: 0 !important;
  align-content: stretch;
}
html body.libertadores-match-mode-active #mainContent #libertadoresMatchPanel {
  grid-area: auto !important;
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}
html body.libertadores-match-mode-active #libertadoresMatchPanel .ucl-table {
  width: 100%;
  table-layout: fixed;
}
html body.libertadores-match-mode-active #libertadoresMatchPanel .ucl-table :is(th, td):nth-child(2) { width: 55%; }
html body.libertadores-match-mode-active #libertadoresMatchPanel .ucl-table :is(th, td):nth-child(4),
html body.libertadores-match-mode-active #libertadoresMatchPanel .ucl-table :is(th, td):nth-child(5),
html body.libertadores-match-mode-active #libertadoresMatchPanel .ucl-table :is(th, td):nth-child(6) { display: none; }
html body.libertadores-match-mode-active #libertadoresMatchPanel .ucl-table-club strong {
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (min-width: 600px) {
  html body.libertadores-match-mode-active #mainContent #libertadoresMatchPanel .ucl-groups-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}
@media (max-width: 599px) {
  html body.libertadores-match-mode-active #mainContent.content:has(#standardMatchTactics[hidden]) {
    grid-template-areas: "stage stage" "stats stats" "boot boot" "groups groups" !important;
  }
  html body.libertadores-match-mode-active #libertadoresMatchPanel .ucl-groups-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

/* The shared winners ceremony follows the season palette. */
html body.libertadores-route-active :is(.ucl-champion-overlay, .ucl-champion-overview) {
  background: #10100f;
}
html body.libertadores-route-active .ucl-champion-card {
  width: min(780px, 100%);
  gap: 16px;
  padding: 32px 20px;
}
html body.libertadores-route-active .ucl-champion-card .ucl-trophy {
  display: none;
}
html body.libertadores-route-active .ucl-champion-badge {
  width: 112px;
  height: 112px;
  margin: 0;
  filter: drop-shadow(0 4px 16px rgba(216, 184, 102, 0.2));
}
html body.libertadores-route-active .ucl-champion-card h1 {
  margin: 0;
  line-height: 1.08;
  text-shadow: none;
}
html body.libertadores-route-active .ucl-champion-kicker {
  color: #d8b866;
  font: 800 15px/1.5 "Manrope", sans-serif;
  letter-spacing: 0;
}
html body.libertadores-route-active .ucl-champion-awards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  margin: 8px 0;
}
html body.libertadores-route-active .ucl-champion-awards dt {
  font-family: "Manrope", sans-serif;
}
html body.libertadores-route-active .ucl-champion-actions {
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}
@media (max-width: 480px) {
  html body.libertadores-route-active .ucl-champion-card {
    gap: 12px;
    padding: 24px 12px;
  }
  html body.libertadores-route-active .ucl-champion-awards {
    grid-template-columns: 1fr;
  }
}

/* Full competition context follows the match and its support rails. */
html body.libertadores-match-mode-active #mainContent:has(#standardMatchTactics[hidden]) #libertadoresMatchPanel {
  grid-area: groups !important;
}
html body.libertadores-match-mode-active #libertadoresMatchPanel {
  order: 100;
  min-width: 0;
}
@media (min-width: 1151px) {
  html body.libertadores-match-mode-active #mainContent #libertadoresMatchPanel .ucl-groups-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
html body.libertadores-route-active .authored-action-preview-controls .authored-test-match-timeline-marker {
  background: transparent;
  border: 0;
  box-shadow: none;
  pointer-events: auto;
  cursor: help;
}
html body.libertadores-route-active .authored-action-preview-controls .authored-test-match-timeline-marker::after {
  background: #28251e;
  border-color: #615437;
  color: #fff9eb;
}

html body.libertadores-route-active .ucl-bracket-decider {
  background: #28251e;
  color: #d8b866;
}
