/* Shared editorial finish, derived from News. News keeps its reference styling.
   Page layouts, photo overlays, status colors and the fantasy pitch stay local. */
.ft-site {
  --editorial-panel: color-mix(in srgb, var(--surface) 65%, var(--bg));
  --editorial-header: radial-gradient(ellipse at 95% 5%, color-mix(in srgb, var(--green) 12%, transparent), transparent 70%);
  --editorial-lead: radial-gradient(ellipse at 95% 5%, color-mix(in srgb, var(--green) 18%, transparent), transparent 70%);
  /* News' image headers use alternating 60px diagonal bands at 140 degrees. */
  --editorial-bands: repeating-linear-gradient(140deg, transparent 0, transparent 60px, color-mix(in srgb, var(--green) 5%, transparent) 60px, color-mix(in srgb, var(--green) 5%, transparent) 120px);
  --editorial-radius: 12px;
}

/* Use the News palette in both themes, including Home's previously local tokens. */
body.ft-site:not([data-page=news]) {
  --surface: #141b18;
  --muted: #a1afa5;
  --line: #2a3730;
  --home-header-start: color-mix(in srgb, var(--green) 8%, var(--surface));
  --home-header-end: var(--surface);
  --home-key-surface: var(--raised);
  --home-key-border: var(--line);
  --home-button-top: var(--green);
  --home-button-bottom: var(--green);
  background: radial-gradient(ellipse at 20% 38%, color-mix(in srgb, var(--green) 5%, transparent), transparent 55%), var(--bg);
}
[data-theme=light] body.ft-site:not([data-page=news]) {
  --surface: #fff;
  --muted: #5b6c60;
  --line: #dce3d7;
}

/* Match News' heading hierarchy without changing any page's grid or controls. */
body.ft-site:not([data-page=news]) :is(.hero, .ft-hero, .live-header) h1,
body.ft-site[data-page="404"] .empty h1 {
  font-family: var(--font-display);
  font-size: clamp(34px, 4.8vw, 66px);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -2px;
  overflow-wrap: anywhere;
}
body.ft-site:not([data-page=news]) :is(.hero, .ft-hero, .live-header) > div { min-width: 0; }
body.ft-site:not([data-page=news]) :is(.hero, .ft-hero, .live-header) :is(.eyebrow, .ft-eyebrow) { color: var(--green); }
body.ft-site:not([data-page=news]) :is(.hero, .ft-hero, .live-header) > div > p:not(.eyebrow):not(.ft-eyebrow) {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.5;
  margin-top: 10px;
  color: var(--muted);
}
body.ft-site:not([data-page=news]) .home-briefing-header h2 {
  font-size: clamp(27px, 3vw, 43px);
  line-height: 1.13;
  letter-spacing: -1.3px;
}

/* Reading surfaces stay quiet; gradients belong to headings and key information. */
body.ft-site:not([data-page=news]) :is(.panel, .fixtures-league, .preview-panel, .fpl-import, .stats-fixture-card, .stats-numbers, .stats-efficiency) {
  background: var(--editorial-panel);
  border-color: var(--line);
  border-radius: var(--editorial-radius);
  box-shadow: none;
}
body.ft-site:not([data-page=news]) :is(.panel-head, .fixtures-league-header) {
  background: var(--editorial-bands), var(--editorial-header), var(--editorial-panel);
  box-shadow: inset 0 -1px 0 var(--line);
}
body.ft-site[data-page=fantasy] #fantasy > .metrics {
  background: var(--editorial-bands), var(--editorial-header), var(--editorial-panel);
}
body.ft-site[data-page=fantasy] #fantasy > .metrics > .metric {
  position: relative;
  isolation: isolate;
  border-right: 0;
}
body.ft-site[data-page=fantasy] #fantasy > .metrics > .metric:not(:last-child)::after {
  content: '';
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  right: 0;
  width: 1px;
  background: var(--line);
  transform: skewX(-40deg);
  opacity: .65;
  pointer-events: none;
}
@media (max-width: 600px) {
  body.ft-site[data-page=fantasy] #fantasy > .metrics > .metric:nth-child(odd)::after { display: none; }
}
body.ft-site:not([data-page=news]) .panel-head h2 {
  font: 500 12px var(--font-body);
  text-transform: uppercase;
  letter-spacing: 1.8px;
  line-height: 1.5;
}
body.ft-site:not([data-page=news]) :is(.home-briefing-header, .home-fantasy-header) {
  background: var(--editorial-bands), var(--editorial-lead), var(--surface);
}
body.ft-site:not([data-page=news]) .home-feature-layout > .feature {
  background: var(--editorial-panel);
  border-radius: var(--editorial-radius);
}
body.ft-site:not([data-page=news]) :is(.home-briefing-header, .home-fantasy-header) { border-radius: 11px 11px 0 0; }
body.ft-site:not([data-page=news]) :is(.stats-player-hero, .recap-scoreboard, .recap-fantasy) {
  background: var(--editorial-lead), var(--surface);
  border-radius: var(--editorial-radius);
}
body.ft-site:not([data-page=news]) .stats-page .panel-head {
  background-color: var(--editorial-panel);
  background-image: var(--editorial-bands), var(--editorial-header);
  background-size: auto;
}
body.ft-site:not([data-page=news]) .stats-player-hero .stat-identity { background: var(--editorial-bands); }
body.ft-site:not([data-page=news]) .ft-admin .card,
body.ft-site:not([data-page=news]) .ft-checks :is(.summary, .status, .next-steps) {
  border-radius: var(--editorial-radius);
  box-shadow: none;
}

/* Story cards share News' border, image treatment and restrained hover. */
body.ft-site:not([data-page=news]) :is(.article-card, .archive-match-card) {
  background: transparent;
  border-radius: 10px;
  transition: border-color .18s ease, transform .18s ease;
}
body.ft-site:not([data-page=news]) .article-card h3 { font-size: 23px; line-height: 1.25; }
body.ft-site:not([data-page=news]) .article-card p { font-size: 14px; line-height: 1.5; }
body.ft-site:not([data-page=news]) .article-art { background: var(--editorial-bands), var(--editorial-header), var(--raised); }
body.ft-site:not([data-page=news]) .article-art:before { background: none; }
body.ft-site:not([data-page=news]) .article-card .article-meta { font-size: 11px; flex-wrap: wrap; gap: 10px; }

/* Home and Fixtures share one score capsule, including the status underneath. */
body.ft-site:is([data-page=home], [data-page=live]) :is(.match .score, .fixture-mid) {
  background: var(--raised);
  color: var(--text);
  border-radius: 7px;
  box-shadow: inset 0 0 0 1px var(--line);
}
body.ft-site[data-page=live] .fixture-mid {
  width: 100%;
  min-width: 0;
  padding: 3px 4px;
  gap: 5px;
}
/* Allow full team/stat labels to wrap in the stacked mobile match preview. */
body.ft-site[data-page=live] .preview-panel .stats-table { table-layout: fixed; white-space: normal; }
body.ft-site[data-page=live] .preview-panel .stats-table :is(th, td) { overflow-wrap: anywhere; }
body.ft-site[data-page=live] .preview-panel .stats-table :is(th, td):nth-child(2) { width: 50%; }

/* Selected-match treatment follows the approved Fixtures concept. */
body.ft-site[data-page=live] .preview-panel { overflow: hidden; }
.preview-masthead { margin: -22px -22px 0; padding: 22px; background: var(--editorial-bands), var(--editorial-header); border-bottom: 1px solid var(--line); }
.preview-eyebrow { margin: 0 0 24px; color: var(--muted); font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; }
.preview-eyebrow span { margin-inline: 8px; color: var(--green); }
.preview-match-display { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); align-items: center; gap: 14px; }
.preview-team { min-width: 0; text-align: center; }
.preview-team img { width: 60px; height: 60px; object-fit: contain; margin: 0 auto 10px; }
.preview-team h2 { margin: 0; font-family: var(--font-display); font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.preview-score { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.preview-score strong { font-family: var(--font-display); font-size: clamp(30px,3.5vw,52px); line-height: 1; white-space: nowrap; }
.preview-status { border: 1px solid var(--line); border-radius: 20px; padding: 4px 10px; color: var(--green); font-size: 11px; white-space: nowrap; }
.preview-tabs-nav { display: flex; gap: 12px; margin: 16px 0 0; border-bottom: 1px solid var(--line); }
body.ft-site[data-page=live] .preview-tabs-nav .tab-btn { border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; padding: 12px 6px; min-height: 44px; font-size: 14px; color: var(--muted); }
body.ft-site[data-page=live] .preview-tabs-nav .tab-btn.active { color: var(--green); border-bottom-color: var(--green); }
.preview-tabs-body { border: 0; padding-top: 16px; }
.preview-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; font-size: 13px; }
body.ft-site[data-page=live] .preview-actions .text-link { background: transparent; color: var(--green); border: 0; box-shadow: none; padding: 8px 0; }
body.ft-site[data-page=live] .preview-panel .stats-table th { background: transparent; color: var(--muted); }
.preview-lineups { display: grid; gap: 24px; }
.preview-lineup header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.preview-lineup h3 { margin: 0; font-family: var(--font-display); font-size: 21px; }
.preview-formation { color: var(--green); font-size: 13px; white-space: nowrap; }
.preview-lineup h4 { margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; font-size: 11px; letter-spacing: 1.4px; }
.preview-player-list { list-style: none; padding: 0; margin: 0; }
.preview-player-list li { display: grid; grid-template-columns: 28px minmax(0,1fr) 20px; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.preview-player-list small, .preview-number { color: var(--muted); }
.preview-substitutes { margin-top: 14px; }
.preview-substitutes summary { cursor: pointer; min-height: 44px; align-content: center; color: var(--green); font-size: 13px; }
.preview-pitch { position: relative; isolation: isolate; display: flex; flex-direction: column-reverse; justify-content: space-between; gap: 16px; padding: 24px 8px; min-height: 450px; border: 1px solid #45604c; border-radius: 12px; background: repeating-linear-gradient(to bottom,#163529 0 9%,#193c2d 9% 18%); }
.preview-pitch-lines { position: absolute; z-index: -1; inset: 10px; border: 1px solid #bee0c638; pointer-events: none; }
.preview-pitch-lines::before { content: ''; position: absolute; top: 50%; width: 100%; border-top: 1px solid #bee0c638; }
.preview-pitch-lines::after { content: ''; position: absolute; top: 50%; left: 50%; width: 26%; aspect-ratio: 1; border: 1px solid #bee0c638; border-radius: 50%; transform: translate(-50%,-50%); }
.preview-pitch-lines i { position: absolute; left: 28%; width: 44%; height: 16%; border: 1px solid #bee0c638; }
.preview-pitch-lines i:first-child { top: -1px; }
.preview-pitch-lines i:nth-child(2) { bottom: -1px; }
.preview-pitch-lines i:last-child { top: 50%; left: 50%; width: 4px; height: 4px; border: 0; background: #bee0c638; border-radius: 50%; transform: translate(-50%,-50%); }
.preview-pitch-row { display: flex; justify-content: space-evenly; gap: 4px; }
.preview-pitch-player { flex: 0 1 110px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.preview-shirt { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; background: #b8d69b; color: #15270a; clip-path: polygon(25% 0,40% 8%,60% 8%,75% 0,100% 24%,84% 45%,75% 35%,75% 100%,25% 100%,25% 35%,16% 45%,0 24%); }
.preview-shirt span { padding-top: 4px; font-size: 13px; font-weight: 700; }
.preview-shirt.is-keeper { background: #e4bc58; }
.preview-pitch-name { max-width: 100%; box-sizing: border-box; border-radius: 4px; padding: 4px 5px; background: #10231ee6; color: #eef3ec; font-size: 12px; line-height: 1.3; overflow-wrap: anywhere; }
.preview-combined-pitch { flex-direction: column; gap: 0; padding-block: 18px; min-height: 0; }
.preview-pitch-half { display: flex; flex-direction: column; justify-content: space-between; flex: 1; gap: 16px; padding-block: 6px 28px; min-height: 390px; }
.preview-pitch-half.team-1 { flex-direction: column-reverse; padding-block: 28px 6px; }
.preview-pitch-half.team-1 .preview-pitch-row { flex-direction: row-reverse; }
.team-1 .preview-shirt:not(.is-keeper) { background: #a9c9ee; color: #10243e; }
.preview-team-keys, .preview-benches { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.preview-team-key { border-left: 3px solid #b8d69b; padding-left: 10px; }
.preview-team-key.team-1 { border-color: #a9c9ee; }
.preview-team-key h3 { font-family: var(--font-display); font-size: 18px; margin: 0 0 4px; overflow-wrap: anywhere; }
.preview-bench { min-width: 0; }
.preview-bench header { display: block; }
.preview-bench h3 { font-size: 17px; overflow-wrap: anywhere; margin-bottom: 6px; }
.preview-bench .preview-player-list li { grid-template-columns: 22px minmax(0,1fr) 12px; gap: 4px; font-size: 12px; }
.preview-bench .preview-player-list li > span:nth-child(2) { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .preview-pitch { padding-inline: 5px; }
  .preview-pitch-name { font-size: 11px; padding-inline: 3px; }
  .preview-shirt { width: 32px; height: 34px; }
}
body.ft-site[data-page=live] .preview-panel .stats-table { border-collapse: separate; border-spacing: 0 7px; }
body.ft-site[data-page=live] .preview-panel .stats-table td { background: var(--surface); border-block: 1px solid var(--line); padding: 10px 8px; }
body.ft-site[data-page=live] .preview-panel .stats-table td:first-child { border-left: 1px solid var(--line); border-radius: 7px 0 0 7px; font-weight: 700; }
body.ft-site[data-page=live] .preview-panel .stats-table td:last-child { border-right: 1px solid var(--line); border-radius: 0 7px 7px 0; font-weight: 700; }
body.ft-site[data-page=live] .preview-panel .stats-table td:nth-child(2) { color: var(--muted); font-size: 12px; text-align: center; }
@media (max-width: 520px) {
  .preview-match-display { gap: 8px; }
  .preview-team img { width: 44px; height: 44px; }
  .preview-team h2 { font-size: 16px; }
}


/* Share the action language without recoloring chips, warnings or player cards. */
body.ft-site:not([data-page=news]) :is(.button, .ft-button, .fpl-btn, .btn-primary):not(.secondary):not(.fpl-btn--ghost):not(.fpl-btn--danger) {
  background: var(--green);
  color: var(--green-ink);
  border-color: transparent;
  border-radius: 9px;
}
body.ft-site:not([data-page=news]) :is(.button.secondary, .ft-button.secondary, .fpl-btn--ghost, .btn-ghost) {
  background: var(--editorial-panel);
  border-color: var(--line);
  color: var(--text);
}
body.ft-site:not([data-page=news]) :is(.fpl-tabs .fpl-tab, .league-tab) { border-radius: 24px; }
body.ft-site:not([data-page=news]) :is(.fpl-tabs .fpl-tab.is-active, .league-tab.active, .segment button.active) {
  background: var(--green);
  color: var(--green-ink);
  border-color: var(--green);
}
body.ft-site:not([data-page=news]) :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}
body.ft-site:not([data-page=news]) :is(.native-empty, .no-matches, .preview-empty) {
  background: var(--editorial-panel);
  border-color: var(--line);
  border-radius: var(--editorial-radius);
}

@media (min-width: 901px) {
  body.ft-site:not([data-page=news]) .brand { font-family: var(--font-display); font-size: 25px; }
}
@media (hover: hover) {
  body.ft-site:not([data-page=news]) :is(.article-card, .archive-match-card):hover {
    border-color: var(--green);
    transform: translateY(-2px);
  }
}
@media (max-width: 800px) {
  body.ft-site:not([data-page=news]) :is(.hero, .ft-hero, .live-header) h1 { font-size: 44px; }
}
@media (max-width: 500px) {
  body.ft-site:not([data-page=news]) :is(.hero, .ft-hero, .live-header) h1,
  body.ft-site[data-page="404"] .empty h1 { font-size: 34px; letter-spacing: -1px; }
  body.ft-site:not([data-page=news]) :is(.hero, .ft-hero, .live-header) > div > p:not(.eyebrow):not(.ft-eyebrow) { font-size: 15px; }
  body.ft-site:not([data-page=news]) .home-briefing-header h2 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) {
  body.ft-site:not([data-page=news]) :is(.article-card, .archive-match-card) { transition: none; transform: none; }
}
