/* Reusable components. Class names match the markup the views produce. */

/* ---------- containers ---------- */
section.view { display: grid; gap: 20px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; min-width: 0; }
.panel > h3 { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }

/* min(100%, 300px): on the narrowest phones a 300px column was wider than its panel and pushed the page sideways */
.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.note { font-size: var(--fs-sm); color: var(--muted); }
.empty { padding: 32px 0; text-align: center; color: var(--muted); }

@media (max-width: 1000px) { .grid2 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- StatBadge ---------- */
.stat { display: grid; gap: 1px; margin: 0; min-width: 0; }
.stat dt { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.stat dd { margin: 0; font-weight: 650; font-size: var(--fs-lg); line-height: 1.2; letter-spacing: -.01em; white-space: nowrap; }
.stat dd.stat-sub { font-size: var(--fs-xs); font-weight: 500; color: var(--muted); letter-spacing: 0; }
.stat dd.up { color: var(--good); }
.stat dd.down { color: var(--bad); }
.stat dd.accent { color: var(--accent-text); }
.stat.big dd:first-of-type { font-size: var(--fs-num); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kpis.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpis.kpis-3 .kpi { padding: 12px; }

@media (max-width: 520px) { .kpis.kpis-3 { grid-template-columns: minmax(0, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.kpi b { display: block; font-size: var(--fs-num); font-weight: 650; line-height: 1.15; letter-spacing: -.02em; }
.kpi .lbl, .plansum .lbl { font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--ls-label); text-transform: uppercase; color: var(--faint); }
.kpi .delta { font-size: var(--fs-sm); }

/* Scoreline: a running head-to-head score in the style of a TV score bug. The side in front is green. */
.scoreline { display: grid; grid-template-columns: auto auto auto; justify-content: start; align-items: center; gap: 4px 10px; max-width: 100%; margin: 0 0 14px; }
.sl-side { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; line-height: 1.05; }
.sl-side.home { text-align: right; }
.sl-score { display: inline-flex; align-items: center; gap: 2px; background: var(--sunk); border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px 6px; }
.sl-score b { font-family: var(--display); font-weight: 700; font-size: 34px; line-height: 1.05; min-width: 1.1ch; text-align: center; color: var(--fg); font-variant-numeric: tabular-nums; }
.sl-score i { font-style: normal; font-family: var(--display); font-size: 24px; color: var(--faint); padding: 0 2px; }
.scoreline.lead-home .sl-side.home, .scoreline.lead-away .sl-side.away { color: var(--good); }
.scoreline.lead-home .sl-score b:first-child, .scoreline.lead-away .sl-score b:last-of-type { color: var(--good); }
.sl-cap { grid-column: 1 / -1; justify-self: start; font-size: var(--fs-xs); color: var(--muted); }
.scoreline.mini { gap: 6px; margin: 8px 0 0; }
.scoreline.mini .sl-side { font-size: 13px; }
.scoreline.mini .sl-score { padding: 0 4px; border-radius: 5px; }
.scoreline.mini .sl-score b { font-size: 18px; }
.scoreline.mini .sl-score i { font-size: 14px; }

/* ---------- buttons and controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); background: var(--raised); color: var(--fg);
  border-radius: var(--r-sm); padding: 7px 13px; font-size: var(--fs-sm); font-weight: 550; line-height: 1.2;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) { .btn:hover { border-color: var(--accent-text); } }
.btn .ic { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

@media (hover: hover) and (pointer: fine) { .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); } }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }

@media (hover: hover) and (pointer: fine) { .btn.ghost:hover { color: var(--fg); border-color: var(--line-strong); } }
.btn.sm { padding: 5px 10px; font-size: var(--fs-xs); }
.btn[disabled] { opacity: .5; cursor: default; }
.btn[aria-busy="true"] .ic { animation: spin 1s linear infinite; }
a.btn { text-decoration: none; }

@keyframes spin { to { transform: rotate(360deg); } }

.seg { display: inline-flex; background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { background: none; border: 0; border-radius: 4px; padding: 5px 11px; font-size: var(--fs-sm); font-weight: 550; color: var(--muted); white-space: nowrap; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }

@media (hover: hover) and (pointer: fine) { .seg button:hover { color: var(--fg); } }
.subnav { justify-self: start; margin-bottom: -6px; }
.seg button[aria-pressed="true"], .seg button[role="tab"][aria-selected="true"] { background: var(--raised); color: var(--fg); box-shadow: 0 0 0 1px var(--line-strong); }
.ptabs { justify-self: start; flex-wrap: wrap; overflow: visible; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select, .filters input, .sel {
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; font-size: var(--fs-sm); max-width: 100%;
  transition: border-color var(--t-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) { .filters select:hover, .filters input:hover, .sel:hover { border-color: var(--line-strong); } }
.filters input[type="search"] { flex: 1 1 200px; min-width: 0; }

/* ---------- pills, tags, badges ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); font-weight: 600; border-radius: 999px; padding: 2px 9px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.pill.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.pill.bad { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.pill.mut { color: var(--muted); }
.tag { font-size: var(--fs-xs); font-weight: 600; border-radius: 4px; padding: 1px 6px; background: var(--sunk); color: var(--muted); }
.cbadge { font-size: var(--fs-xs); font-weight: 650; border-radius: 4px; padding: 1px 6px; background: var(--accent-soft); color: var(--accent-text); }
.cbadge.used { background: var(--sunk); color: var(--faint); text-decoration: line-through; }
.chipset { display: inline-flex; gap: 3px; }
.verdict { border-left: 3px solid var(--accent-text); background: var(--sunk); padding: 12px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.verdict.lu-behind { border-left-color: var(--warn); margin: 0; font-size: var(--fs-sm); }
.verdict.lu-behind p { margin: 0 0 8px; }

/* ---------- FDRChip: official difficulty, number always shown ---------- */
.fdr {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 0; border-radius: 4px; padding: 2px 6px; font-size: 12px; font-weight: 600; line-height: 1.35; white-space: nowrap;
}
.fdr b { font-weight: 700; } /* FL-123: was .85em at 75% opacity, 8.5px and 2.4:1 on the hardest fixtures */
.fdr.xs { font-size: 11px; padding: 1px 3px; gap: 2px; }
.fdr.f1, .d1 { background: var(--f1); color: var(--f1-fg); }
.fdr.f2, .d2 { background: var(--f2); color: var(--f2-fg); }
.fdr.f3, .d3 { background: var(--f3); color: var(--f3-fg); }
.fdr.f4, .d4 { background: var(--f4); color: var(--f4-fg); }
.fdr.f5, .d5 { background: var(--f5); color: var(--f5-fg); }
.fdr.blank { background: var(--sunk); color: var(--faint); }
.eudot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: currentcolor; opacity: .8; }
.fdr-key { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: var(--fs-xs); color: var(--muted); }

/* ---------- PitchView and PlayerCard ---------- */
.pitchwrap { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--sunk); }
.pitch {
  --focus: var(--armband); /* These turf surfaces stay dark in both themes. */

  position: relative; display: grid; gap: 14px; padding: 22px 8px 16px;
  background:
    radial-gradient(120% 60% at 50% -10%, var(--floodlight), transparent 60%),
    repeating-linear-gradient(180deg, var(--turf) 0 52px, var(--turf-2) 52px 104px);
}
.pitch::before { content: ""; position: absolute; inset: 8px; border: 1.5px solid var(--chalk); border-radius: 3px; pointer-events: none; }
.pitch::after { content: ""; position: absolute; left: 50%; top: 8px; width: 34%; max-width: 170px; height: 56px; transform: translateX(-50%); border: 1.5px solid var(--chalk); border-top: 0; pointer-events: none; }
.row { position: relative; z-index: 1; display: flex; justify-content: center; gap: 6px; min-width: 0; }
.pitch-key { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); }
.pitch-key .fdr-key { margin-left: auto; }
.bench { display: flex; justify-content: center; gap: 6px; padding: 12px 8px; background: var(--sunk); border-top: 1px solid var(--line); }
.bench .lbl { align-self: center; writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; }
.pc {
  position: relative; width: 104px; flex: 0 1 104px; min-width: 0;
  background: var(--surface); color: var(--fg); border: 1px solid transparent; border-radius: 8px; padding: 6px 5px 5px; text-align: center;
  box-shadow: inset 0 3px 0 var(--club, transparent), 0 2px 6px rgb(0 0 0 / 25%);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}

@media (hover: hover) and (pointer: fine) { .pc:hover { border-color: var(--accent-text); } }
.pc .shirt { display: block; width: 30px; height: 30px; margin: -2px auto 1px; object-fit: contain; }
.pc > span { display: block; }
.pc .pc-meta { display: flex; justify-content: center; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 500; }
.pc-form { color: var(--accent-text); background: var(--accent-soft); border-radius: 3px; padding: 0 4px; }

/* names in the condensed display face, as the lineup cards (.lu-cards) have them, and up to two lines breaking only at
   spaces and hyphens, so "Muharemović" and "Calvert-Lewin" fit a phone card instead of being cut to "Muharem…" */
.pc .nm { display: -webkit-box; max-width: 100%; overflow: hidden; font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1.05; letter-spacing: .01em;
  white-space: normal; overflow-wrap: normal; word-break: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pc .xp { font-family: var(--display); font-weight: 700; font-size: 21px; line-height: 1.05; letter-spacing: .01em; }
.pc .xp.asm { color: var(--on-turf-muted); }
.pc .fx { display: flex !important; gap: 2px; justify-content: center; margin-top: 4px; }
.pc .fx .fdr { flex: 1 1 0; padding: 1px 3px; gap: 2px; font-size: 11px; }
.pc .fx .fdr:nth-child(n+3) { display: none; } /* cards show the next two fixtures; the detail sheet shows them all */
.pc .fx .eudot { display: none; }
.pc.sel { outline: 2px solid var(--hi); outline-offset: 1px; }
.pc.newin { box-shadow: inset 0 3px 0 var(--club, transparent), inset 0 -3px 0 var(--good), 0 2px 6px rgb(0 0 0 / 25%); }
.pc.is-capt { outline: 2px solid var(--hi); outline-offset: 0; }
.pc.is-capt.sel { outline-offset: 1px; }
.armband {
  position: absolute; top: 12px; left: calc(50% - 31px); z-index: 1; width: 34px; height: 10px; border-radius: 2px; transform: rotate(-8deg);
  display: grid; place-items: center; font-size: 11px; font-weight: 800; letter-spacing: .1em; line-height: 1; text-indent: .1em;
  background: var(--armband); color: var(--armband-fg); box-shadow: 0 1px 2px rgb(0 0 0 / 35%); pointer-events: none;
}
.armband.v { background: var(--armband-vice); }
.badge {
  position: absolute; top: -7px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 750; font-size: 11px;
  background: var(--hi); color: var(--hi-fg); box-shadow: 0 0 0 2px var(--surface);
}
.badge.v { background: var(--fg); color: var(--bg); }
.flag { position: absolute; top: -6px; left: -5px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px; font-size: 11px; font-weight: 700; line-height: 18px; color: #fff; box-shadow: 0 0 0 2px var(--surface); }
.flag.d { background: var(--warn); color: var(--surface); }
.flag.i, .flag.s, .flag.u, .flag.n { background: var(--f5); }

@media (prefers-reduced-motion: no-preference) {
  @media (hover: hover) and (pointer: fine) { .pc:hover { transform: translateY(-1px); } }
}

@media (max-width: 520px) {
  .pc { flex-basis: 68px; padding: 5px 2px 4px; }
  .pc .shirt { width: 22px; height: 22px; }
  .armband { top: 10px; left: calc(50% - 27px); }
  .pc .nm { font-size: 12.5px; letter-spacing: 0; }
  .pc .pc-meta { font-size: 11px; gap: 4px; }
  .pc .xp { font-size: 17px; }
  .pc .fx .fdr { font-size: 11px; gap: 3px; }
  .pc .fx .fdr:nth-child(n+2) { display: none; } /* phones: next fixture only, so the difficulty number still fits */
  .row, .bench { gap: 4px; }
}

/* ---------- DataTable ---------- */
.tablebox { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); max-height: min(75vh, 900px); }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-sm); }
th, td { padding: 8px 10px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { position: sticky; top: 0; z-index: 2; background: var(--raised); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
th.sort { cursor: pointer; user-select: none; }

@media (hover: hover) and (pointer: fine) { th.sort:hover { color: var(--fg); } }
th.sort[aria-sort] { color: var(--fg); }
td.n, th.n { text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--t-fast) var(--ease); }

@media (hover: hover) and (pointer: fine) { tbody tr:hover { background: var(--raised); } }
tr.mine td:first-child { box-shadow: inset 3px 0 0 var(--hi-text); } /* FL-181: --hi-text, 3:1+ on light surfaces; same yellow as --hi in dark */
.pname { font-weight: 600; }
.tick td.fxc { padding: 3px; }
.fxc > span { display: flex; justify-content: center; align-items: baseline; gap: 4px; border-radius: 4px; padding: 5px 4px; font-weight: 600; font-size: var(--fs-sm); min-width: 62px; }
.fxc > span + span { margin-top: 2px; }
.minibar { display: inline-block; height: 7px; border-radius: 4px; background: var(--accent); vertical-align: middle; }
.minibar.neg { background: var(--bad); }

/* ---------- lists and rows ---------- */
.alerts { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.alerts li { display: grid; grid-template-columns: 8px 1fr; gap: 10px; align-items: start; }
.alerts li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; background: var(--info); }
.alerts li.bad::before { background: var(--bad); }
.alerts li.warn::before { background: var(--warn); }
.alerts li.good::before { background: var(--good); }
.tx { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.tx:first-of-type { border-top: 0; }
.tx .step { font-weight: 700; font-size: var(--fs-lg); color: var(--faint); width: 26px; }
.tx .mv, .move { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; font-weight: 600; }
.tx .mv .out, .move .out { color: var(--bad); }
.tx .mv .in, .move .in { color: var(--good); }
.tx .why { grid-column: 2 / 4; font-size: var(--fs-sm); color: var(--muted); }
.tx .gain { text-align: right; font-weight: 700; font-size: var(--fs-lg); }
.moves { display: grid; gap: 6px; margin: 6px 0 2px; }
.cand { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 12px; align-items: center; width: 100%; padding: 9px 8px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; border-radius: 0; transition: background var(--t-fast) var(--ease); }

@media (hover: hover) and (pointer: fine) { .cand:hover { background: var(--raised); } }
.cand .d { grid-column: 1 / 4; font-size: var(--fs-xs); color: var(--muted); }
.cand b { font-size: var(--fs-lg); text-align: right; }

/* captain bars */
.capbars { display: grid; gap: 12px; }
.cb { display: grid; grid-template-columns: minmax(0, 140px) minmax(0, 1fr) 52px; gap: 10px; align-items: center; }
.cb .track { height: 10px; background: var(--sunk); border-radius: 5px; overflow: hidden; }
.cb .fill { height: 100%; background: var(--accent); border-radius: 5px; }
.cb.top .fill { background: var(--hi-text); }
.cb .val { font-family: var(--display); font-weight: 700; font-size: 20px; text-align: right; }
.cb .why { grid-column: 1 / 4; font-size: var(--fs-xs); color: var(--muted); margin-top: -6px; }

@media (prefers-reduced-motion: no-preference) {
  .fill { transition: width .4s var(--ease); }
}

/* step cards (This week) */
.steps { display: grid; gap: 12px; align-content: start; }
.steps-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stepcard { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 0 14px; align-items: start; padding: 16px 18px; }
.stepcard + .stepcard { border-top: 1px solid var(--line); }
.stepcard .howto-btn { display: flex; width: fit-content; margin-top: 10px; }
.stepcard .sbody { display: grid; gap: 6px; min-width: 0; }
.stepcard .no { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: var(--fs-sm); background: var(--sunk); color: var(--muted); border: 1px solid var(--line); }
.stepcard.act .no { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.stepcard.ok .no { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.stepcard h3 { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: var(--fs-lg); }
.stepcard .do { font-size: 15px; font-weight: 600; }
.stepcard .sub { font-size: var(--fs-sm); color: var(--muted); }

/* option tiles */

/* Planner → Plan: one recommendation card. The gain is the big number; the alternative (roll, or the most points when
   the pick is a roll) is a full-width row you can tap to look at instead; More options folds the rest away. */
.pvrec { display: grid; gap: 10px; border-color: var(--accent); }
.pvrec > .bar { margin: 0; }
.pvrec-moves .sugg:first-child { padding-top: 0; }
.pvrec-g { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0; }
.pvrec-g small { font-size: var(--fs-xs); color: var(--muted); }
.pvc-gain { font-family: var(--display); font-size: 34px; font-weight: 700; line-height: 1; }
.pvalt { display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 12px; width: 100%; padding: 10px 0 0; border: 0; border-top: 1px solid var(--line); background: none; color: var(--muted); font: inherit; font-size: var(--fs-sm); text-align: left; cursor: pointer; }
.pvalt b { font-variant-numeric: tabular-nums; }
.pvalt:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pvmore { border-top: 1px solid var(--line); padding-top: 8px; }
.pvmore-body { display: grid; gap: 10px; padding-top: 10px; min-width: 0; }

@media (hover: hover) and (pointer: fine) { .pvalt:hover span { color: var(--fg); } }
.gwsel { display: flex; gap: 6px; flex-wrap: wrap; }
.gwsel button { border: 1px solid var(--line); background: var(--sunk); border-radius: var(--r-sm); padding: 6px 11px; font-weight: 650; min-width: 64px; text-align: left; }
.gwsel button small { display: block; font-weight: 500; font-size: var(--fs-xs); color: var(--muted); }
.gwsel button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-text); }
.gwsel button[aria-pressed="true"] small { color: var(--fg); }   /* muted grey on the green selection was 3.2:1 (FL-123) */
.plansum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.plansum .kpi { background: none; border: 0; border-radius: 0; padding: 14px 18px; display: grid; gap: 3px; align-content: start; min-width: 0; }
.plansum .kpi:first-child { padding-left: 0; }
.plansum .kpi + .kpi { border-left: 1px solid var(--line); }
.plansum .kpi b { font-family: var(--display); font-size: 36px; font-weight: 700; line-height: 1; letter-spacing: .01em; }
.plansum .kpi b.up { color: var(--good); }
.plansum .kpi b.down { color: var(--bad); }

@media (max-width: 640px) {
  .plansum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plansum .kpi, .plansum .kpi:first-child { padding: 12px 14px; }
  .plansum .kpi:nth-child(odd) { border-left: 0; padding-left: 0; }
  .plansum .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .plansum .kpi b { font-size: 30px; }
}

/* suggestions */
.sugg { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.sugg:first-of-type { border-top: 0; }
.sg-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.sg-gain { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1; }
.sg-meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sgfx { display: inline-flex; gap: 2px; }
.sg-why { font-size: var(--fs-sm); color: var(--muted); }
.sg-add { justify-self: start; }
.capalt { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 2px 0; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.rules { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.rules > .booked-transfers { flex-direction: column; align-items: stretch; }
.booked-transfers form { display: grid; gap: 8px; padding-block: 8px; }
.booked-transfers select { max-width: 100%; }
.rules > div { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }

/* FL-005: chip pins, one chip a line */
.chip-pins { display: grid; gap: 6px; width: 100%; }
.chip-pin { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.chip-pin .sel { min-width: 150px; }
.chip-na { display: block; }

/* chips, compare */
.chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }

@media (max-width: 900px) { .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 480px) { .chips { grid-template-columns: minmax(0, 1fr); } }
.chips-panel .verdict, .chips-panel .note { max-width: 75ch; }
.chip { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; background: var(--surface); }
.chip h3 { font-size: var(--fs-lg); }
.chip.used { background: var(--sunk); border-style: dashed; }
.chip.used h3 { color: var(--muted); }

/* FL-143: the GW20 renewal between first- and second-half chips */
.chip-divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-sm); }
.chip-divider::before, .chip-divider::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
tr.divider td { color: var(--muted); font-size: var(--fs-sm); text-align: center; border-top: 1px dashed var(--line); }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.cmp { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--sunk); }
.cmp dl { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 8px 0 0; font-size: var(--fs-sm); }
.cmp dt { color: var(--muted); }
.cmp dd { margin: 0; text-align: right; font-weight: 600; }
.cmp dd.best { color: var(--good); }

/* ---------- charts ---------- */
.chart { width: 100%; max-width: 760px; height: auto; display: block; }
.chart .grid { stroke: var(--line); }
svg text { fill: var(--muted); font-family: var(--font); font-size: 11px; }
.chart text { font-size: 13px; }

/* FL-182: fit charts are drawn at their real width (lineChart in views/stats.js), so this is the size on screen */
.chart.fit { max-width: none; }
.chart.fit text { font-size: var(--fs-xs); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-sm); }
.legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.s1 { stroke: var(--accent-text); background: var(--accent-text); }
.s2 { stroke: var(--info); background: var(--info); }   /* FL-228: --info blue separates series 2 from --accent without implying captain/deadline */
.s3 { stroke: var(--warn); background: var(--warn); }
.chart polyline.s3 { stroke-dasharray: 5 3; }
.legend i.s3 { background: repeating-linear-gradient(to right, var(--warn) 0 5px, transparent 5px 8px); }
.s4 { stroke: var(--bad); background: var(--bad); }
.gwbars { overflow-x: auto; display: flex; gap: 5px; align-items: flex-end; height: 96px; }
.gwbars div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; font-size: 11px; color: var(--muted); }
.gwbars i { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; }

/* ---------- details / disclosure ---------- */
details { margin-top: 4px; }
details summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); font-weight: 550; list-style: none; width: fit-content; }

@media (hover: hover) and (pointer: fine) { details summary:hover { color: var(--fg); } }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-right: 1.5px solid currentcolor; border-bottom: 1.5px solid currentcolor; transform: rotate(-45deg) translateY(-1px); transition: transform var(--t-fast) var(--ease); }
details[open] summary::before { transform: rotate(45deg) translateY(-3px); }
.dbody { display: grid; gap: 8px; margin-top: 8px; }

/* tap-to-explain */
.term { all: unset; cursor: help; border-bottom: 1px dotted currentcolor; }
.term:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#tip { position: fixed; z-index: 50; max-width: 320px; background: var(--raised); color: var(--fg); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 11px 13px; box-shadow: var(--shadow); font-size: var(--fs-sm); line-height: 1.5; }
#tip b { display: block; margin-bottom: 4px; }
#tip p { margin: 0; color: var(--muted); }
.pillwrap { display: inline-flex; }

/* ---------- dialog / player detail sheet ---------- */
dialog {
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--fg); padding: 0;
  width: min(600px, calc(100vw - 32px)); max-height: 88vh; box-shadow: var(--shadow);
}
dialog::backdrop { background: rgb(0 0 0 / 55%); }
.dlg { padding: 20px; display: grid; gap: 16px; overflow: auto; }
.dlg .x { position: absolute; z-index: 3; right: 10px; top: 10px; width: 34px; height: 34px; border-radius: 50%; background: var(--sunk); border: 1px solid var(--line); font-size: 18px; line-height: 1; color: var(--muted); }

@media (hover: hover) and (pointer: fine) { .dlg .x:hover { color: var(--fg); } }
.brk { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.brk div { background: var(--sunk); border-radius: var(--r-sm); padding: 7px 9px; font-size: var(--fs-xs); color: var(--muted); }
.brk b { display: block; font-size: var(--fs-lg); color: var(--fg); }
.phead { display: flex; gap: 14px; align-items: flex-start; }
.photo { width: 72px; height: 92px; object-fit: cover; border-radius: var(--r-sm); background: var(--sunk); flex: none; }

.dlg-grab { display: none; }

@media (max-width: 640px) {
  dialog { width: 100vw; max-width: 100vw; max-height: 90vh; margin: auto 0 0; border-radius: var(--r-lg) var(--r-lg) 0 0; border-bottom: 0; overscroll-behavior: contain; }
  .dlg { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

  /* the drag handle: a 40px-tall strip pinned to the top of the sheet, so it can be grabbed however far you've scrolled */
  .dlg-grab { position: sticky; top: 0; z-index: 2; display: grid; place-items: center; height: 40px; margin-bottom: -20px; touch-action: none; cursor: grab; background: linear-gradient(var(--surface) 60%, transparent); }
  .dlg-grab span { width: 40px; height: 5px; border-radius: 99px; background: var(--line-strong); }
}

@media (prefers-reduced-motion: no-preference) {
  dialog[open] { animation: rise-sheet var(--t) var(--ease); } /* rise-sheet: layout.css */
}

/* ---------- loading, empty and error states ---------- */
.sk { display: block; border-radius: 5px; background: linear-gradient(90deg, var(--sunk) 0%, var(--raised) 50%, var(--sunk) 100%) 0 0 / 200% 100%; }
.skel { display: grid; gap: 12px; }
.skel-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.pitch-skel { min-height: 460px; background: linear-gradient(180deg, var(--turf), var(--turf-2)); opacity: .5; border: 0; }

@media (prefers-reduced-motion: no-preference) {
  .sk { animation: shimmer 1.4s linear infinite; }
}

@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 1000px) { .skel-grid { grid-template-columns: minmax(0, 1fr); } }

.state { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 56px 20px; max-width: 460px; margin: 0 auto; }
.state p { color: var(--muted); }
.state .btn { margin-top: 8px; }
.state-ic { width: 36px; height: 36px; color: var(--faint); stroke-width: 1.5; }
.state.error .state-ic { color: var(--bad); }

/* ---------- search everywhere ---------- */
.searchbtn { display: inline-flex; align-items: center; gap: 8px; min-width: 200px; padding: 8px 10px 8px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sunk); color: var(--muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; }

@media (hover: hover) and (pointer: fine) { .searchbtn:hover { border-color: var(--line-strong); color: var(--fg); } }
.searchbtn .ic { width: 16px; height: 16px; }
.searchbtn kbd { margin-left: auto; font: inherit; font-size: 11px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; }

@media (max-width: 899px) {
  .searchbtn { min-width: 0; width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .searchbtn span, .searchbtn kbd { display: none; }
}
#searchDlg { width: min(620px, calc(100vw - 32px)); margin: 10vh auto auto; padding: 0; overflow: hidden; }
#searchDlg[open] { display: flex; flex-direction: column; max-height: 75vh; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.search-box .ic { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search-box:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search-box input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: var(--fs-md); padding: 6px 0; outline: none; }
#searchList { list-style: none; margin: 0; padding: 6px; overflow: auto; }
#searchList li[role="option"] { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; }
#searchList li[aria-selected="true"] { background: var(--sunk); box-shadow: inset 3px 0 0 var(--accent); }

@media (hover: hover) and (pointer: fine) { #searchList li[role="option"]:hover { background: var(--sunk); } }
.sr-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--sunk); color: var(--muted); font-size: 11px; font-weight: 700; }
.sr-ic .ic { width: 16px; height: 16px; }
.sr-txt { display: grid; min-width: 0; }
.sr-txt b { font-weight: 600; }
.sr-txt span { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-empty { padding: 14px 10px; color: var(--muted); font-size: var(--fs-sm); }

@media (max-width: 640px) {
  #searchDlg { width: 100vw; max-width: 100vw; margin: 0 0 auto; border-radius: 0 0 var(--r-lg) var(--r-lg); border-top: 0; max-height: 85vh; }
}

/* ---------- refresh health banner ---------- */
.health { flex-basis: 100%; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); font-size: var(--fs-sm); }
.health.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.health > .ic { width: 18px; height: 18px; flex: none; color: var(--warn); }
.health.bad > .ic { color: var(--bad); }
.health > span { flex: 1 1 240px; }
.health a { color: inherit; text-decoration: underline; }

/* ---------- decision grades ---------- */
.grade { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; font-weight: 700; font-size: var(--fs-sm); }
.grade.big { width: 40px; height: 40px; font-size: var(--fs-lg); border-radius: 10px; }
.g-A { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.g-B { background: color-mix(in srgb, var(--info) 12%, transparent); color: color-mix(in srgb, var(--info) 85%, var(--fg)); }   /* plain --info was 4.0:1 in light (FL-123) */
.g-C { background: color-mix(in srgb, var(--warn) 18%, transparent); color: color-mix(in srgb, var(--warn) 85%, var(--fg)); }   /* plain --warn was 4.32:1 on --sunk in light */
.g-D { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); }
:root[data-theme="light"] .g-D { color: color-mix(in srgb, var(--bad) 80%, var(--fg)); }

/* ---------- compare any team ---------- */
.chiprow { display: flex; flex-wrap: wrap; gap: 6px; }
.chipbtn { display: inline-grid; text-align: left; gap: 1px; padding: 6px 11px; border: 1px solid var(--line); border-radius: var(--r); background: var(--sunk); color: var(--fg); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; max-width: 220px; }
.chipbtn span { font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@media (hover: hover) and (pointer: fine) { .chipbtn:hover { border-color: var(--line-strong); } }
.chipbtn[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cmp-panel { margin: 0; }
.panel .cmp-panel { padding: 0; border: 0; background: none; box-shadow: none; margin-top: 4px; }

.morechips { flex-basis: 100%; margin-top: 4px; }
.morechips summary { cursor: pointer; color: var(--muted); font-size: var(--fs-sm); padding: 4px 0; }
.morechips .chiprow { margin-top: 6px; }

/* ---------- drag and drop (planner) ---------- */
.view-planner .pc, .view-planner .cand { -webkit-touch-callout: none; user-select: none; }
.view-planner .pc img { -webkit-user-drag: none; }
.drag-ghost { background: var(--raised); border-radius: var(--r); position: fixed; z-index: 50; pointer-events: none; opacity: .92; box-shadow: var(--shadow); transform-origin: 0 0; margin: 0; }
.dragging, .dragging * { cursor: grabbing !important; }
.drag-src { opacity: .35; }
.pc.drop-ok { outline: 2px dashed var(--accent); outline-offset: 2px; }
.pc.drop-no { outline: 2px dashed var(--bad); outline-offset: 2px; }
#toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 12px); max-width: min(480px, calc(100vw - 32px)); padding: 10px 14px; border-radius: var(--r); background: var(--raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-size: var(--fs-sm); opacity: 0; pointer-events: none; transition: opacity var(--t-fast), transform var(--t-fast); }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 900px) { #toast { bottom: 24px; } }

/* ---------- make these moves ---------- */
.howto-btn { justify-self: start; }
.howto { margin: 0; padding-left: 22px; display: grid; gap: 14px; }
.howto h3 { font-size: var(--fs-md); margin: 0 0 6px; }
.howto h3 .muted { font-weight: 400; font-size: var(--fs-sm); }
.xi-lines { display: grid; grid-template-columns: max-content 1fr; gap: 3px 10px; margin: 0; font-size: var(--fs-sm); }
.xi-lines dt { color: var(--muted); font-weight: 600; }
.xi-lines dd { margin: 0; }

/* ---------- news history ---------- */
.newsline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 8px; }
.newsline li { position: relative; display: grid; gap: 1px; font-size: var(--fs-sm); }
.newsline li::before { content: ""; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.newsline li.good::before { background: var(--good); }
.newsline li.warn::before { background: var(--warn); }
.newsline li.bad::before { background: var(--bad); }
.newsline time { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- squad rating ---------- */
.rate-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; margin-bottom: 14px; }
.rate-badge { display: grid; justify-items: center; gap: 6px; }
.rate-score { --p: 0;

 display: grid; place-content: center; justify-items: center; width: 96px; height: 96px; border-radius: 50%; line-height: 1;
  background: radial-gradient(closest-side, var(--surface) 80%, transparent 81%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--sunk) 0); }
.rate-score b { font-family: var(--display); font-size: 38px; font-weight: 700; letter-spacing: .01em; }
.rate-score span { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.rate-badge small { font-size: var(--fs-xs); font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.rating .kpis { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.rating .kpi b small { font-size: var(--fs-xs); color: var(--muted); font-weight: 400; margin-left: 2px; }
.rate-uplift { margin: 0 0 14px; font-size: var(--fs-sm); line-height: 1.6; }
.rate-uplift .lbl { display: block; }
.rating .kpi b { font-size: var(--fs-xl); }
.rate-pos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.rate-pos > div { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); background: var(--sunk); min-width: 0; }
.rate-pos span:last-child { display: grid; font-size: var(--fs-sm); min-width: 0; }
.rate-pos small { color: var(--muted); font-size: var(--fs-xs); }
.rate-links { list-style: none; margin: 6px 0 0; padding: 0; display: grid; }
.rate-links li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.rate-links li:last-child { border-bottom: 1px solid var(--line); }
.rl-move { min-width: 0; }
.rl-gain { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rl-gain small { font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.rate-links .btn { white-space: nowrap; }
.rate-links + .note { margin-top: 12px; }
.rl-move .pname { font-weight: 600; }

@media (max-width: 1280px) { .rate-pos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

@media (max-width: 1100px) and (min-width: 900px), (max-width: 520px) {
  .rate-top { grid-template-columns: 1fr; justify-items: center; }
  .rating .kpis { width: 100%; }
}

@media (max-width: 420px) {
  .rate-links li { grid-template-columns: minmax(0, 1fr) auto; }
  .rate-links .btn { grid-column: 1 / -1; justify-self: start; }
  .rating .kpi b { font-size: var(--fs-lg); }
}

/* ---------- past team viewer ---------- */
.pc.past .xp { font-size: 22px; }
.pc.past.haul .xp { color: var(--good); }
.subtag { font-size: 11px; font-weight: 700; }
.subtag.in { color: var(--good); }
.subtag.out { color: var(--bad); }

/* ---------- stats: what the labels mean ---------- */
.stats-nav { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.labels { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: 8px 14px; margin: 0; font-size: var(--fs-sm); }
.labels dt { font-weight: 600; }
.labels dd { margin: 0; color: var(--muted); }
#dlgBody section h3 { margin: 0 0 8px; }

@media (max-width: 480px) { .labels { grid-template-columns: 1fr; gap: 2px; } .labels dd { margin-bottom: 8px; } }

/* ---------- why this projection ---------- */
.why { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.why li { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; font-size: var(--fs-sm); }
.why-k { font-weight: 600; }
.why-t { color: var(--muted); }
.why-t b { color: var(--fg); font-weight: 600; }
.why-v { font-variant-numeric: tabular-nums; }

@media (max-width: 480px) { .why li { grid-template-columns: minmax(0, 1fr) auto; } .why-t { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- player comparison ---------- */
.cmp-table table { min-width: 520px; }
.cmp-table thead th { vertical-align: top; text-align: right; white-space: normal; }
.cmp-table thead th:first-child, .cmp-table tbody th { text-align: left; }
.cmp-table tbody th { font-weight: 500; color: var(--muted); white-space: nowrap; }
.cmp-table td.best { color: var(--good); font-weight: 700; }
.cmp-h th { padding-top: 14px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--fg); }
.cmp-fx { display: flex; gap: 3px; justify-content: flex-end; }
.cmp-fx > span { display: grid; justify-items: center; gap: 1px; }
.cmp-fx small { font-size: 11px; color: var(--muted); }

/* ---------- fixture swings ---------- */
.swings li { grid-template-columns: 8px minmax(0, 1fr) auto; }
.swing-spark { display: flex; align-items: flex-end; gap: 2px; height: 24px; }
.swing-spark i { width: 5px; border-radius: 1px; background: var(--line-strong); }
.swing-spark i.hl { background: var(--accent); }
.swings .bad .swing-spark i.hl { background: var(--bad); }

/* ---------- player tags ---------- */
.ptags { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; margin-left: 4px; }
.ptag { font-size: 11px; font-weight: 600; line-height: 1; padding: 3px 6px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.t-hot, .t-easy, .t-value { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.t-cold, .t-tough, .t-rot, .t-ban { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.t-oop, .t-pen { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }

/* ---------- shot map ---------- */
.sm-wrap { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 14px; align-items: start; }
.shotmap { width: 100%; height: auto; display: block; }
.sm-pitch { fill: var(--turf); }
.sm-line { fill: none; stroke: rgb(255 255 255 / 45%); stroke-width: 1.2; }
.sm-goal { fill: rgb(255 255 255 / 70%); }
.sm-dot { fill: rgb(255 255 255 / 60%); }
.sm-shot { stroke-width: 1.4; }
.sm-g { fill: var(--good); stroke: var(--good); }
.sm-s { fill: rgb(255 255 255 / 55%); stroke: #fff; }
.sm-b, .sm-m { fill: transparent; stroke: rgb(255 255 255 / 70%); }
.sm-key { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 8px; vertical-align: -1px; border: 1.4px solid; }
.sm-key.sm-g { transform: rotate(45deg); border-radius: 0; background: var(--good); border-color: var(--good); }
.sm-key.sm-s { background: #bbb; border-color: #888; }
.sm-key.sm-m { background: transparent; border-color: var(--muted); }

@media (max-width: 560px) { .sm-wrap { grid-template-columns: 1fr; } }

/* ---------- team profile ---------- */
.tm-res { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }

@media (max-width: 1440px) { .tm-res { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tm-res > div { display: grid; justify-items: center; gap: 1px; padding: 6px; border-radius: var(--r-sm); background: var(--sunk); font-size: var(--fs-sm); min-width: 0; }
.tm-res b { font-size: var(--fs-md); }
.tm-res small { font-size: 11px; color: var(--muted); }
.tm-res .r-W b { color: var(--good); }
.tm-res .r-L b { color: var(--bad); }

/* ---------- live gameweek ---------- */
.live-panel { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.live-panel h2 { display: flex; align-items: center; gap: 8px; }
.lv-st { font-size: var(--fs-xs); font-weight: 600; }
.lv-done { color: var(--muted); }
.lv-playing { color: var(--good); }
.lv-toplay { color: var(--info); }
.lv-blank { color: var(--bad); }
.lv-bench td { color: var(--muted); background: var(--sunk); }
.lv-bench .pname { color: var(--muted); }
.lv-fx { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: var(--fs-xs); }
.lv-fx span { padding: 3px 8px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.lv-fx span.on { color: var(--good); font-weight: 600; }
.lv-fx span.done { color: var(--fg); }

/* ---------- this week ---------- */
.week-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: var(--fs-sm); }
.week-list li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 3px 0; }
.week-list time { color: var(--muted); font-variant-numeric: tabular-nums; }
.week-list .wk-day { display: block; font-weight: 700; margin-top: 8px; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--fg); }
.week-list .wk-deadline span { color: var(--hi-text); }
.week-list .wk-eu span { color: var(--muted); }
.dl-hero { display: grid; gap: 4px; }
.dl-hero > b { font-size: 44px; line-height: 1.1; color: var(--hi-text); font-variant-numeric: tabular-nums; }
.stat.deadline[data-godl] { cursor: pointer; }
.st-when[data-gohealth] { cursor: pointer; }

/* ---------- club crests ---------- */
.crest { --sz: 28px; display: inline-grid; place-items: center; width: var(--sz); height: var(--sz); flex: none; position: relative; }
.crest img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 25%)); }
.crest i { display: none; }
.crest.nob i { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--club); color: #fff; font-style: normal; font-size: calc(var(--sz) * .3); font-weight: 800; letter-spacing: -.02em; box-shadow: inset 0 0 0 2px rgb(255 255 255 / 25%); }

/* ---------- live scores ---------- */
.scores { margin-bottom: 20px; }
.scores h2 { display: flex; align-items: center; gap: 8px; }
.score-rail { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.mcard { display: grid; gap: 8px; align-content: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / 12%); transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease); }

@media (hover: hover) and (pointer: fine) { .mcard:hover { transform: translateY(-1px); border-color: var(--line-strong); } }
.mcard.live { border-color: color-mix(in srgb, var(--good) 55%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--good) 9%, var(--surface)), var(--surface) 60%); }
.mcard.ft { background: var(--surface); }
.mcard.mine { box-shadow: inset 3px 0 0 var(--hi-text), 0 1px 2px rgb(0 0 0 / 12%); }
.mc-top { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .02em; min-height: 18px; }
.mc-live { display: inline-flex; align-items: center; gap: 6px; color: var(--good); }
.mc-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); }
.mc-ft { color: var(--muted); }
.mc-pre { color: var(--muted); font-weight: 600; }
.mc-tag { font-size: 11px; font-weight: 600; color: var(--hi-text); }
.mc-team { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.mc-club { all: unset; display: flex; align-items: center; gap: 10px; min-width: 0; cursor: pointer; font-weight: 600; }
.mc-club span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-club:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }

@media (hover: hover) and (pointer: fine) { .mc-club:hover span { text-decoration: underline; text-underline-offset: 3px; } }
.mc-sc { font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1; min-width: 1ch; text-align: right; }
.mcard.ft .mc-team:not(.win) .mc-sc { color: var(--muted); }
.mc-ev { font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line); padding-top: 7px; }
.mc-ev > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mc-ev > div span:last-child { text-align: right; }
.mc-ev > div span::before { content: "⚽ "; }
.mc-ev > div span:empty::before, .mc-ev > div span:only-child::before { content: none; }
.mc-red { margin: 4px 0 0; color: var(--bad); }
.mc-mine { display: flex; flex-wrap: wrap; gap: 4px; }
.mc-p { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: 999px; background: var(--sunk); font-size: 11.5px; font-weight: 600; }
.mc-p:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mc-p b { color: var(--accent-text); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: no-preference) {
  .mc-live i { animation: pulse-ring 1.6s ease-out infinite; }

  @keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
}

@media (max-width: 700px) {
  .score-rail { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 6px; gap: 10px; }
  .score-rail::-webkit-scrollbar { display: none; }
  .mcard { flex: 0 0 76%; scroll-snap-align: start; }
}
.fx-club { display: inline-flex; align-items: center; gap: 8px; }
.tm-title { display: flex; align-items: center; gap: 12px; }

/* a sideways-scrolling row must not widen the page: grid and flex children default to min-width: auto */
.view > *, .scores { min-width: 0; max-width: 100%; }

/* ---------- display face: section headings (screens only, not dialogs or empty states) ---------- */
.view h2 { font-family: var(--display); font-size: 22px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.1; }
.view .state h2 { font-family: var(--font); font-size: 19px; font-weight: 650; letter-spacing: -.015em; text-transform: none; line-height: 1.2; }
.page-title { display: grid; gap: 6px; }
.page-title h1 { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1; letter-spacing: .02em; text-transform: uppercase; }
.page-title p { margin: 0; max-width: 60ch; color: var(--muted); font-size: var(--fs-md); }

@media (max-width: 520px) {
  .page-title h1 { font-size: 36px; }
}
