/* Decorative material only. Component styles continue to own dimensions,
 * scrolling, focus, interaction and semantic grade / side / outcome colours.
 * No additional image is needed: every etched line is a CSS paint layer. */
:root {
  --hex-metal: #bdab7e;
  --hex-energy: #83c8da;
  --hex-edge: color-mix(in srgb,var(--hex-metal) 25%,var(--line));
  --hex-rule: color-mix(in srgb,var(--hex-energy) 12%,var(--line));
  --hex-etch: #88c7da06;
  --hex-highlight: #d3efff0e;
  --hex-shadow: #020b1729;
  --hex-dialog-shadow: #02071366;
  --hex-wash: #82cad709;
}
:root[data-theme=light] {
  --hex-metal: #927b4d;
  --hex-energy: #407e94;
  --hex-edge: color-mix(in srgb,var(--hex-metal) 23%,var(--line));
  --hex-rule: color-mix(in srgb,var(--hex-energy) 15%,var(--line));
  --hex-etch: #356f8c04;
  --hex-highlight: #ffffffd9;
  --hex-shadow: #193c5e0d;
  --hex-dialog-shadow: #17365326;
  --hex-wash: #437e9307;
}

/* An opaque reading surface remains between the scenery and its data. */
.home-page :is(.home-matches-panel,.home-teams-panel,.home-recent-results),
.schedule-page .schedule-panel,
.players-page .catalog-controls.catalog-filter,
.teams-page .team-selector-rail,
.teams-page .team-quick-directory,
.player-dossier .dossier-abilities,
.player-dossier .dossier-performance > .panel,
.events-page .event-tile {
  border-color: var(--hex-edge);
  background-image: linear-gradient(135deg,var(--hex-wash),transparent 42%);
  box-shadow: inset 0 1px 0 var(--hex-highlight),0 6px 24px var(--hex-shadow);
}
.home-page .home-overview,
.teams-page .team-identity {
  border-color: var(--hex-edge);
  box-shadow: inset 0 1px 0 #d3efff16,inset 0 -1px 0 #bdab7e16,0 6px 24px var(--hex-shadow);
}
.home-page .home-stage-path,
.home-page .home-team-grid > a,
.home-page .event-shortcuts > a,
.teams-page .team-quick-grid .team-quick-card,
.events-page .event-tile-content {
  background-color: var(--surface);
  background-image: linear-gradient(135deg,var(--hex-wash),transparent 65%);
}
.teams-page .team-identity > .team-mark,
.home-page .home-team-grid .team-mark {
  box-shadow: inset 0 0 0 1px var(--hex-rule),0 2px 8px var(--hex-shadow);
}

/* The current card silhouette and each grade's frame remain intact. Etched
 * facets sit on existing decoration nodes, below the portrait and all text. */
.player-card .player-card-link::before {
  background-color: #111c26;
  background-image:
    radial-gradient(ellipse at 50% 7%,rgb(var(--tier-rgb) / .18),transparent 54%),
    linear-gradient(118deg,transparent 24%,#8bc9d808 24.2%,transparent 24.5% 76%,#8bc9d806 76.2%,transparent 76.5%),
    repeating-linear-gradient(0deg,transparent 0 35px,#b5dce303 35px 36px),
    linear-gradient(180deg,#1b2b36,#101820 74%,#15232d);
}
.player-card .player-card-link::after {
  box-shadow: inset 0 1px 0 rgb(var(--tier-rgb) / .13),inset 0 -1px 0 #8bc9d80a;
}
.player-card .card-material::before {
  background-image:
    radial-gradient(ellipse at 50% 44%,rgb(var(--tier-rgb) / .22),transparent 65%),
    linear-gradient(135deg,transparent 36%,rgb(var(--tier-rgb) / .08) 36% 36.5%,transparent 36.5% 63%,#8bc9d80c 63% 63.5%,transparent 63.5%);
}
.player-card .card-material::after {
  border-color: rgb(var(--tier-rgb) / .15);
  box-shadow: inset 1px 0 0 #82c8d807;
}
.player-card .player-role {
  background-image: linear-gradient(135deg,#a7dbea0d,transparent 65%);
  box-shadow: inset 0 1px 0 rgb(var(--tier-rgb) / .1);
}
.player-card .card-footer,
.player-card .card-dimensions-panel {
  background-image: linear-gradient(90deg,transparent,#a7dbea04,transparent);
}
.player-card .champion-icon {
  box-shadow: inset 0 0 0 1px #050c14,0 1px 4px #00000024;
}

/* Tournament frames borrow the same metal and cool light, while the existing
 * win / loss edges, blue / red support tracks and flow focus stay authoritative. */
.schedule-page {
  --stage-top: #2b4859;
  --stage-bottom: #172e40;
  --stage-edge: #647e88;
  --stage-wash: var(--hex-wash);
}
:root[data-theme=light] .schedule-page {
  --stage-top: #3b5a6a;
  --stage-bottom: #294456;
  --stage-edge: #82949b;
  --stage-wash: var(--hex-wash);
}
.schedule-page .schedule-stagebar {
  border-bottom-color: var(--hex-rule);
  background-image: linear-gradient(100deg,var(--hex-wash),transparent 70%);
  box-shadow: inset 0 1px 0 var(--hex-highlight);
}
.schedule-page .schedule-panel .schedule-toolbar {
  background-image: linear-gradient(100deg,var(--hex-etch),transparent 70%);
}
.schedule-page .schedule-panel :is(.swiss-scroll,.bracket-scroll) {
  background-image:
    radial-gradient(ellipse at 50% 0,var(--hex-wash),transparent 60%),
    repeating-linear-gradient(0deg,transparent 0 47px,var(--hex-etch) 47px 48px);
}
.schedule-page .swiss-layout .record-group {
  background-image: linear-gradient(145deg,var(--hex-wash),transparent 60%);
}
.schedule-page .swiss-layout .record-group.is-pending {
  background-image: linear-gradient(145deg,var(--hex-etch),transparent 60%);
}
.schedule-page .swiss-layout .record-group.is-pending .record-heading {
  background-image: linear-gradient(110deg,var(--hex-wash),transparent 70%);
}
.home-page .cup-match-card.fixture-card,
.teams-page .cup-match-card.fixture-card,
.schedule-page .cup-match-card.fixture-card {
  background-image: linear-gradient(115deg,var(--hex-wash),transparent 65%);
}
.schedule-page .swiss-layout .record-matches .fixture-card {
  background-image: linear-gradient(110deg,var(--hex-wash),transparent 80%);
}
.schedule-page .schedule-panel .playoff-pending {
  background-image: linear-gradient(110deg,var(--hex-etch),transparent 75%);
}
.schedule-page #standings {
  border-color: var(--hex-edge);
  box-shadow: inset 0 1px 0 var(--hex-highlight),0 6px 24px var(--hex-shadow);
}

/* These selectors also outrank the fragment styles loaded in page content.
 * No pseudo-element is added over a dialog, control, focus ring or report. */
body .site-main :is(.match-dialog,.profile-preview-dialog,.audience-rating-dialog) {
  border-color: var(--hex-edge);
  background-image: linear-gradient(135deg,var(--hex-wash),transparent 42%);
  box-shadow: 0 28px 84px var(--hex-dialog-shadow),0 7px 22px var(--hex-shadow),inset 0 1px 0 var(--hex-highlight);
}
body .site-main :is(.match-dialog-toolbar,.profile-preview-toolbar) {
  border-bottom-color: var(--hex-rule);
  background-image: linear-gradient(110deg,var(--hex-wash),transparent 70%);
  box-shadow: inset 0 1px 0 var(--hex-highlight);
}
body .site-main .match-dialog .match-scoreboard {
  border-color: var(--hex-rule);
  background-image: linear-gradient(110deg,var(--hex-wash),transparent 70%);
  box-shadow: inset 0 1px 0 var(--hex-highlight);
}
body .site-main .match-dialog .match-preview-lineup {
  box-shadow: inset 0 1px 0 var(--hex-highlight),0 3px 12px var(--hex-shadow);
}
body .site-main .match-dialog .match-preview-roles > span::before {
  border-color: var(--hex-edge);
  background-image: linear-gradient(135deg,var(--hex-wash),transparent 75%);
}
body .site-main .profile-preview-dialog .profile-preview-slot {
  background-image: linear-gradient(135deg,var(--hex-wash),transparent 70%);
  box-shadow: inset 0 1px 0 var(--hex-highlight);
}

/* No motion is introduced. The reduced-data mode also drops etched paint and
 * the existing decorative card frame image; identity images remain content. */
@media (prefers-reduced-data:reduce) {
  .player-card .card-frame::before,
  .player-card .card-frame::after { background-image: none; }
  .schedule-page .schedule-panel :is(.swiss-scroll,.bracket-scroll) {
    background-image: none;
  }
}
@media (prefers-reduced-motion:reduce) {
  .player-card .card-material,
  .player-card .card-material::before,
  .player-card .card-material::after { animation: none; transition: none; }
}
@media (forced-colors:active), print {
  :root[data-theme] .schedule-page .schedule-panel .swiss-layout .record-group:not(.is-pending) .record-heading {
    background-image: none;
  }
  .home-page :is(.home-overview,.home-matches-panel,.home-teams-panel,.home-recent-results,.home-stage-path),
  .home-page .home-team-grid > a,
  .home-page .event-shortcuts > a,
  .schedule-page :is(.schedule-panel,.schedule-stagebar,#standings),
  .schedule-page .schedule-panel :is(.schedule-toolbar,.swiss-scroll,.bracket-scroll,.playoff-pending),
  .schedule-page .swiss-layout :is(.record-group,.record-heading,.record-matches .fixture-card),
  .home-page .cup-match-card.fixture-card,
  .teams-page .cup-match-card.fixture-card,
  .schedule-page .cup-match-card.fixture-card,
  .players-page .catalog-controls.catalog-filter,
  .teams-page :is(.team-identity,.team-selector-rail,.team-quick-directory),
  .teams-page .team-quick-grid .team-quick-card,
  .player-dossier .dossier-abilities,
  .player-dossier .dossier-performance > .panel,
  .events-page :is(.event-tile,.event-tile-content),
  body .site-main :is(.match-dialog,.profile-preview-dialog,.audience-rating-dialog,.match-dialog-toolbar,.profile-preview-toolbar),
  body .site-main .match-dialog :is(.match-scoreboard,.match-preview-lineup),
  body .site-main .match-dialog .match-preview-roles > span::before,
  body .site-main .profile-preview-dialog .profile-preview-slot {
    background-image: none;
    box-shadow: none;
  }
  .player-card[data-grade] .player-card-link::before {
    background-image: none;
  }
  .player-card .player-card-link::after,
  .player-card .card-material::before,
  .player-card .card-material::after,
  .player-card .card-frame::before,
  .player-card .card-frame::after { background-image: none; box-shadow: none; }
  .player-card :is(.player-card-link,.player-role,.champion-icon,.card-footer,.card-dimensions-panel) {
    background-image: none;
    box-shadow: none;
  }
}
@media (forced-colors:active) {
  :root[data-theme] { --hex-edge: CanvasText; --hex-rule: CanvasText; }
  .player-card[data-grade] .player-card-link::before { background-color: Canvas; }
  .player-card .player-card-link::after { border-color: CanvasText; }
  body .site-main .match-dialog .match-preview-roles > span:focus-visible::before {
    border-color: Highlight;
  }
}
@media print {
  :root[data-theme] { --hex-edge: #777; --hex-rule: #aaa; }
  .player-card[data-grade] .player-card-link::before { background-color: #fff; }
  .player-card .player-card-link,
  .player-card .player-role,
  .player-card .player-card-info > .player-game-id,
  .player-card .card-dimension :is(dt,dd),
  .player-card .card-mean-score { color: #111; }
  .player-card .player-role { background-color: #fff; }
}
