:root {
  --bg: #0e0b1a;
  --bg-2: #160f29;
  --panel: #1d1534;
  --panel-2: #251b42;
  --line: #33275a;
  --text: #f1eefb;
  --muted: #a49cc4;
  --dim: #6f6893;
  --accent: #00ff87;
  --accent-2: #04f5ff;
  --purple: #38003c;
  --pink: #e90052;
  /* player status on the pitch (and its legend): played = --purple, playing now = --pink */
  --st-yet: #64748b;   /* slate grey: no purple in it, so it can't be mistaken for "played" */
  --st-bonus: #ffc233; /* gold: stands apart from the purples, pink and the green pitch */
  --gold: #ffd166;
  --up: #00e676;
  --down: #ff4d6d;
  --pitch-1: #1b7a3e;
  --pitch-2: #17703a;
  --radius: 14px;
  --bar-1: #00ff87; --bar-2: #04c9d6;
  --c-gold: #ffd166; --c-pink: #e90052; --c-cyan: #04f5ff;
  --s0: #00ff87; --s1: #04f5ff; --s2: #ffd166; --s3: #e90052; --s4: #a78bfa; --s5: #ff8c42;
  --s6: #4dabf7; --s7: #f783ac; --s8: #69db7c; --s9: #ffe066; --s10: #b197fc; --s11: #63e6be;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #2a1155 0%, transparent 60%),
              radial-gradient(900px 500px at 110% 0%, #0b3a4a 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 10px 24px;
  background: rgba(14, 11, 26, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--purple);
  font-weight: 800; font-size: 15px;
}
.brand-name { font-size: 18px; font-weight: 500; letter-spacing: -.2px; }
.brand-name b { font-weight: 800; color: var(--accent); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { white-space: nowrap;
  color: var(--muted); padding: 7px 12px; border-radius: 9px; font-weight: 600;
}
.nav a:hover { color: var(--text); background: var(--panel); text-decoration: none; }
.nav a.active { color: var(--bg); background: var(--accent); }
.top-forms { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.id-filter { display: flex; gap: 6px; }
.id-filter input, .input {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 8px 12px; width: 140px; font: inherit;
}
.id-filter input:focus, .input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.id-filter button, .btn {
  background: var(--accent); color: var(--bg); border: 0; border-radius: 9px;
  padding: 8px 14px; font-weight: 700;
}
.btn.ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.btn:disabled { opacity: .4; cursor: default; }

.gw-strip {
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap;
  padding: 8px 24px; font-size: 13px; color: var(--muted);
  border-bottom: 1px solid var(--line); background: rgba(22, 15, 41, .7);
}
.gw-strip b { color: var(--text); }
.gw-strip .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); margin-right: 6px; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 22px 24px 40px; flex: 1; }
.footer { text-align: center; color: var(--dim); font-size: 12px; padding: 18px 16px 26px; }

/* ---------- generic ---------- */
.loading { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 80px 0; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error { background: rgba(255, 77, 109, .1); border: 1px solid var(--down); color: #ffc2cd; padding: 14px 16px; border-radius: var(--radius); }
.notice { background: rgba(4, 245, 255, .08); border: 1px solid rgba(4, 245, 255, .4); padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; color: #bdf7fb; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.5px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.page-head .sub a { color: var(--muted); text-decoration: underline; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 980px) { .grid.two, .grid.halves { grid-template-columns: minmax(0, 1fr); } }

.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 16px;
  min-width: 0;
}
.card h2 { font-size: 15px; margin: 0 0 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card h2 small { color: var(--muted); font-weight: 500; font-size: 12px; }
.section-gap { margin-top: 18px; }

.stats-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; min-width: 0;
}
.stat .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.stat .v { font-size: 24px; font-weight: 800; margin-top: 2px; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.stat.hero { background: linear-gradient(135deg, #3d0a5a, #1a0b3a); border-color: #5b2a86; }
.stat.hero .v { color: var(--accent); font-size: 32px; }

.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; white-space: nowrap; }
tbody tr:hover { background: rgba(255, 255, 255, .03); }
tr.me { background: rgba(0, 255, 135, .08); }
tr.me td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.selected { background: rgba(4, 245, 255, .08); }
tr.clickable { cursor: pointer; }
.mgr { display: flex; flex-direction: column; min-width: 0; }
.mgr .team { font-weight: 700; color: var(--text); }
.mgr .person { color: var(--muted); font-size: 12px; }
.rank-badge { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: var(--panel-2); font-weight: 800; }
.rank-badge.r1 { background: var(--gold); color: #2a1d00; }
.mv { font-size: 11px; margin-left: 4px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--panel-2); border: 1px solid var(--line); white-space: nowrap; }
.pill.chip { background: rgba(233, 0, 82, .18); border-color: var(--pink); color: #ffb3cb; }
.pill.cap { background: rgba(255, 209, 102, .15); border-color: var(--gold); color: var(--gold); }
.pill.good { background: rgba(0, 255, 135, .12); border-color: var(--accent); color: var(--accent); }
.pts { font-weight: 800; font-size: 15px; }

.heat td { text-align: center; font-variant-numeric: tabular-nums; padding: 7px 5px; font-weight: 600; }
.heat th { text-align: center; }
.heat td.name, .heat th.name { text-align: left; }

/* ---------- pitch ---------- */
.pitch {
  position: relative; border-radius: 12px; padding: 18px 8px 10px; overflow: hidden;
  background: repeating-linear-gradient(180deg, var(--pitch-1) 0 44px, var(--pitch-2) 44px 88px);
  border: 1px solid #2b8a50;
}
.pitch::before {
  content: ""; position: absolute; left: 50%; top: -60px; width: 200px; height: 120px; transform: translateX(-50%);
  border: 2px solid rgba(255, 255, 255, .18); border-radius: 0 0 50% 50% / 0 0 100% 100%; pointer-events: none;
}
.pitch::after {
  content: ""; position: absolute; inset: 8px; border: 2px solid rgba(255, 255, 255, .15); border-radius: 6px; pointer-events: none;
}
.pitch-row { position: relative; z-index: 1; display: flex; justify-content: center; gap: 6px; margin: 4px 0 10px; }
.bench { margin-top: 10px; background: rgba(255, 255, 255, .04); border: 1px dashed var(--line); border-radius: 12px; padding: 10px 6px 4px; }
.bench .label { text-align: center; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px; }
.player {
  position: relative; width: 92px; text-align: center; cursor: pointer; background: none; border: 0; padding: 0; color: inherit;
}
.player img { width: 50px; height: 66px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .4)); display: block; margin: 0 auto -4px; }
.player .nm {
  background: #f5f2ff; color: #1b1033; font-weight: 700; font-size: 11.5px; padding: 3px 4px;
  border-radius: 6px 6px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.player .pp { background: var(--purple); color: #fff; font-weight: 800; font-size: 13px; padding: 2px 4px; }
.player .fx { background: rgba(0, 0, 0, .55); color: #ddd; font-size: 10.5px; padding: 2px 4px; border-radius: 0 0 6px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player.st-yet .pp { background: var(--st-yet); }
.player.st-playing .pp { background: var(--pink); }
/* dim the shirt and boxes of players who didn't play or were subbed out, but keep their badges and flags at full strength */
.player.st-dnp > :not(.badge):not(.flag):not(.inj) { opacity: .55; }
.player.sub-out > :not(.badge):not(.flag):not(.inj) { opacity: .45; }
/* captain/vice badges and IN/OUT/bonus flags sit above the shirt (the shirt's drop-shadow filter would otherwise paint over them) */
.player .badge, .player .flag { z-index: 4; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.player .badge {
  position: absolute; top: 2px; left: 12px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 800; background: #111; color: #fff; border: 2px solid #fff;
}
.player .badge.c { background: var(--gold); color: #2a1d00; border-color: #2a1d00; }
.player .badge.tc { background: var(--pink); color: #fff; }
.player .flag { position: absolute; top: 2px; right: 12px; font-size: 10px; font-weight: 800; padding: 1px 5px; border-radius: 6px; }
.player .flag.in { background: var(--up); color: #00331a; }
.player .flag.out { background: var(--down); color: #fff; }
.player .flag.bonus { background: var(--st-bonus); color: #3d2a00; top: 22px; }
.player:hover .nm { background: var(--accent); }
@media (max-width: 560px) {
  .player { width: 64px; }
  .player img { width: 38px; height: 50px; }
  .player .nm { font-size: 10px; }
  .player .badge { left: 2px; }
  .player .flag { right: 0; }
  .pitch-row { gap: 2px; }
}
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
/* the dark "played" purple needs an outline to show on the dark page */
:root:not([data-theme="light"]) .legend i { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28); }

/* ---------- toolbar / gw selector ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gw-select { display: flex; align-items: center; gap: 6px; }
.gw-select .gw-label { min-width: 74px; text-align: center; font-weight: 700; }
select.input { width: auto; }

/* ---------- charts ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.chart-legend i { width: 12px; height: 4px; border-radius: 2px; display: inline-block; }

/* ---------- bars list ---------- */
.barlist { display: flex; flex-direction: column; gap: 8px; }
.barlist .row { display: grid; grid-template-columns: minmax(90px, 160px) 1fr 54px; align-items: center; gap: 10px; }
.barlist .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.barlist .track { background: var(--panel-2); border-radius: 6px; height: 12px; overflow: hidden; }
.barlist .fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 6px; }
.barlist .val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }

/* ---------- fixtures ---------- */
.fixtures { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.fixture { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px; font-weight: 700; }
.fixture .a { text-align: right; }
.fixture .sc { background: var(--panel-2); border-radius: 6px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.fixture.live .sc { background: var(--pink); }
.fixture .when { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 11px; font-weight: 500; }

/* ---------- home ---------- */
.banner {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: center;
  background: linear-gradient(120deg, #38003c 0%, #2a0a52 45%, #06404d 100%);
  border: 1px solid #5b2a86; border-radius: 18px; padding: 26px; margin-bottom: 20px;
}
.banner h1 { margin: 0 0 6px; font-size: 32px; letter-spacing: -.8px; }
.banner .league-name { font-size: 20px; color: var(--accent); font-weight: 700; }
.banner p { color: #d8cdf0; margin: 8px 0 0; }
.finder { background: rgba(0, 0, 0, .25); border-radius: 14px; padding: 16px; }
.finder label { display: block; font-weight: 700; margin-bottom: 8px; }
.finder .row { display: flex; gap: 8px; }
.finder .row .input { flex: 1; width: auto; }
.finder .or { color: var(--muted); font-size: 12px; margin: 10px 0 6px; }
.finder select { width: 100%; }
@media (max-width: 760px) { .banner { grid-template-columns: 1fr; } .banner h1 { font-size: 26px; } }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5, 3, 12, .7); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-card { position: relative; width: min(620px, 100%); max-height: 88vh; overflow: auto; background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.modal-close { position: absolute; top: 10px; right: 12px; background: none; border: 0; color: var(--muted); font-size: 26px; line-height: 1; }
.pl-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.pl-head img { width: 96px; height: 96px; object-fit: cover; object-position: top; border-radius: 50%; background: linear-gradient(160deg, #3d0a5a, #06404d); border: 2px solid var(--accent); flex: none; }
.pl-head img.shirt { object-fit: contain; padding: 10px; }
.pl-head h3 { margin: 0; font-size: 20px; }
.fdr { display: inline-block; min-width: 54px; text-align: center; padding: 4px 6px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.fdr-1 { background: #257d5a; color: #fff; } .fdr-2 { background: #01fc7a; color: #00331a; }
.fdr-3 { background: #e7e7e7; color: #222; } .fdr-4 { background: #ff1751; color: #fff; } .fdr-5 { background: #80072d; color: #fff; }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .id-filter input { width: 110px; }
  .container { padding: 16px 16px 30px; }
  .gw-strip { padding: 8px 16px; gap: 12px; }
  .brand-name { font-size: 16px; }
}

/* ---------- logo + RIP Bob tagline ---------- */
.brand-mark { width: 38px; height: 40px; background: none; border-radius: 0; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-rip { font-size: 10.5px; font-weight: 600; letter-spacing: .4px; color: var(--gold); opacity: .85; font-style: italic; }
.banner-title { display: flex; align-items: center; gap: 18px; min-width: 0; }
.banner-logo {
  width: 118px; height: auto; flex: none;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .5));
  animation: crest-bob 3.2s ease-in-out infinite;
}
@keyframes crest-bob { 50% { transform: translateY(-5px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .banner-logo { animation: none; } }
.rip {
  display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 10px;
  padding: 5px 14px; border-radius: 999px;
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 209, 102, .45);
  box-shadow: 0 0 18px rgba(255, 209, 102, .15) inset;
}
.rip-text {
  font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; font-size: 15px; letter-spacing: .3px;
  background: linear-gradient(90deg, #ffe08a, #ffd166 40%, #fff3c4 50%, #ffd166 60%, #c8901c);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rip-shine 4s linear infinite;
}
@keyframes rip-shine { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .rip-text { animation: none; } }
.rip-icon { font-size: 15px; }
@media (max-width: 760px) {
  .banner-logo { width: 78px; }
  .banner-title { gap: 12px; }
  .rip-text { font-size: 13px; }
  .brand-rip { display: none; }
}

/* ---------- fixtures navigation ---------- */
#fx-card h2 { flex-wrap: wrap; }
.fx-title { display: inline-flex; align-items: center; gap: 8px; }
#fx-card .gw-select select { padding: 7px 10px; }
.fx-deadline { font-size: 12px; margin: -4px 0 10px; }
.fx-day { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin: 12px 0 6px; }
.fx-day:first-of-type { margin-top: 0; }

/* ---------- league switcher, toast ---------- */
.toast {
  position: fixed; top: 70px; right: 24px; z-index: 60; max-width: min(380px, calc(100vw - 32px));
  background: var(--panel-2); border: 1px solid var(--accent-2); color: var(--text);
  padding: 10px 14px; border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.toast[hidden] { display: none; }
@media (max-width: 760px) {
  .top-forms { order: 2; width: 100%; margin: 0; justify-content: stretch; }
  .top-forms .id-filter { flex: 1; }
  .top-forms .id-filter input { flex: 1; width: auto; min-width: 0; }
  .toast { right: 16px; top: 120px; }
}

/* ---------- leader / tail boxes: show the full team name ---------- */
.stat.wide { grid-column: span 2; }
.stat .v.text, .stat.hero .v.text {
  white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
  font-size: 24px; line-height: 1.15; margin: 4px 0 2px;
}
.stat.tail { background: linear-gradient(135deg, #4a0a1e, #1a0b2a); border-color: #8a1f3d; }
.stat.tail .v { color: #ff8fa3; }
@media (max-width: 340px) { .stat.wide { grid-column: auto; } }

/* ---------- Premier League brand + league name ---------- */
.pl-badge {
  display: grid; place-items: center; width: 40px; height: 40px; flex: none;
  background: #fff; border-radius: 11px; padding: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.pl-badge img { width: 100%; height: 100%; object-fit: contain; }
.brand-text .brand-name { font-size: 17px; font-weight: 800; color: var(--text); max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .3px; }
.brand-sub b { color: var(--accent); }
.nav-prices { display: inline-flex; align-items: center; gap: 5px; }
.nav a.active.nav-prices svg path { stroke: var(--bg); }

/* ---------- rank impact / prices ---------- */
.impact-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.impact-head h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.impact-note { font-size: 12px; margin-bottom: 10px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-weight: 700; font-size: 13px; }
.seg button.active { background: var(--accent); color: var(--bg); }
.sub-h { font-size: 13px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .5px; }
table.compact th, table.compact td { padding: 6px 6px; }
.pl-link { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.pl-link:hover { text-decoration: none; color: var(--accent); }
img.mini { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--panel-2); flex: none; }
tr.threat-live td:first-child { box-shadow: inset 3px 0 0 var(--pink); }
.prices-title { display: flex; align-items: center; gap: 10px; }
.price-filters #price-search { width: 200px; }
@media (max-width: 560px) { .price-filters #price-search { width: 100%; } .price-filters { width: 100%; } }

/* ---------- rank boxes: green when climbing, red when falling ---------- */
.stat.rank-up { background: linear-gradient(135deg, rgba(0, 230, 118, .22), rgba(0, 230, 118, .06)); border-color: rgba(0, 230, 118, .6); }
.stat.rank-up .v { color: var(--up); }
.stat.rank-down { background: linear-gradient(135deg, rgba(255, 77, 109, .24), rgba(255, 77, 109, .06)); border-color: rgba(255, 77, 109, .6); }
.stat.rank-down .v { color: var(--down); }
.stat .v.long { font-size: 19px; line-height: 1.5; }

/* =====================================================================
   Light theme (Apple-style): <html data-theme="light">. Dark is the default.
   ===================================================================== */
:root[data-theme="light"] {
  --bg: #f5f5f7;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f2f2f7;
  --line: #e5e5ea;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --dim: #aeaeb2;
  --accent: #0071e3;
  --accent-2: #0066cc;
  --purple: #38003c;
  --pink: #ff2d55;
  --gold: #ff9f0a;
  --up: #248a3d;
  --down: #d70015;
  --bar-1: #34c759; --bar-2: #30b0c7;
  --c-gold: #ff9f0a; --c-pink: #ff2d55; --c-cyan: #007aff;
  --s0: #34c759; --s1: #007aff; --s2: #ff9f0a; --s3: #ff2d55; --s4: #af52de; --s5: #ff6b35;
  --s6: #30b0c7; --s7: #5856d6; --s8: #a2845e; --s9: #ffcc00; --s10: #00c7be; --s11: #8e8e93;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 20px rgba(0, 0, 0, .06);
  color-scheme: light;
}
[data-theme="light"] body {
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", Inter, "Segoe UI", system-ui, sans-serif;
}
[data-theme="light"] .topbar { background: rgba(255, 255, 255, .78); backdrop-filter: saturate(180%) blur(20px); }
[data-theme="light"] .gw-strip { background: rgba(255, 255, 255, .6); }
[data-theme="light"] .card { background: var(--panel); border-color: transparent; box-shadow: var(--shadow); border-radius: 18px; }
[data-theme="light"] .stat { border-color: transparent; box-shadow: var(--shadow); }
[data-theme="light"] .stat.hero { background: linear-gradient(135deg, #eef5ff, #ffffff); border-color: #cfe3ff; }
[data-theme="light"] .stat.tail { background: linear-gradient(135deg, #fff0f3, #ffffff); border-color: #ffd1da; }
[data-theme="light"] .stat.tail .v { color: var(--down); }
[data-theme="light"] .stat.rank-up { background: linear-gradient(135deg, rgba(52, 199, 89, .16), #ffffff); border-color: rgba(52, 199, 89, .55); }
[data-theme="light"] .stat.rank-down { background: linear-gradient(135deg, rgba(255, 59, 48, .14), #ffffff); border-color: rgba(255, 59, 48, .5); }
[data-theme="light"] .error { background: #fff2f2; color: #8a0010; border-color: #ffb3b3; }
[data-theme="light"] .notice { background: #eef5ff; color: #0b4a8f; border-color: #b9d7ff; }
[data-theme="light"] tbody tr:hover { background: rgba(0, 0, 0, .025); }
[data-theme="light"] tr.me { background: rgba(0, 113, 227, .07); }
[data-theme="light"] tr.selected { background: rgba(0, 113, 227, .06); }
[data-theme="light"] .rank-badge.r1 { background: #ffcc00; }
[data-theme="light"] .pill { background: #f2f2f7; border-color: #e5e5ea; }
[data-theme="light"] .pill.chip { background: rgba(255, 45, 85, .1); border-color: rgba(255, 45, 85, .45); color: #c4002f; }
[data-theme="light"] .pill.cap { background: rgba(255, 159, 10, .12); border-color: rgba(255, 159, 10, .5); color: #a35400; }
[data-theme="light"] .pill.good { background: rgba(52, 199, 89, .12); border-color: rgba(52, 199, 89, .5); color: var(--up); }
[data-theme="light"] .bench { background: #fafafa; }
[data-theme="light"] .pitch { box-shadow: var(--shadow); }
[data-theme="light"] .fixture { border-color: transparent; box-shadow: var(--shadow); }
[data-theme="light"] .banner {
  background: linear-gradient(135deg, #ffffff 0%, #f1f6ff 55%, #edfaf2 100%);
  border-color: transparent; box-shadow: var(--shadow);
}
[data-theme="light"] .banner p { color: var(--muted); }
[data-theme="light"] .finder { background: #f5f5f7; }
[data-theme="light"] .rip { background: #fff8e8; border-color: rgba(255, 159, 10, .45); box-shadow: none; }
[data-theme="light"] .rip-text { background-image: linear-gradient(90deg, #8a5200, #c27700 40%, #f0b429 50%, #c27700 60%, #8a5200); }
[data-theme="light"] .modal { background: rgba(0, 0, 0, .3); }
[data-theme="light"] .modal-card { background: #ffffff; border-color: transparent; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
[data-theme="light"] .pl-head img { background: linear-gradient(160deg, #eef5ff, #edfaf2); }
[data-theme="light"] .toast { background: #ffffff; box-shadow: 0 8px 30px rgba(0, 0, 0, .15); }
[data-theme="light"] .seg { background: #f2f2f7; border-color: transparent; }
[data-theme="light"] .seg button.active { background: #ffffff; color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
[data-theme="light"] .nav a.active { color: #fff; }
[data-theme="light"] .id-filter button, [data-theme="light"] .btn { color: #fff; }
[data-theme="light"] .btn.ghost { background: #f2f2f7; color: var(--text); border-color: transparent; }
[data-theme="light"] .id-filter input, [data-theme="light"] .input { background: #ffffff; border-color: #d2d2d7; }
[data-theme="light"] .brand-mark, [data-theme="light"] .pl-badge { box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
[data-theme="light"] .fixture.live .sc { color: #fff; }

/* ---------- theme toggle ---------- */
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 50%; border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 0;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun { display: none; }
[data-theme="light"] .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: none; }
@media (max-width: 760px) { .theme-toggle { margin-left: auto; } }

/* ---------- plan (transfer planner) ---------- */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr); gap: 18px; align-items: start; }
.plan-side { position: sticky; top: 76px; max-height: calc(100vh - 92px); display: flex; flex-direction: column; min-height: 0; }
#plan-list { overflow-y: auto; min-height: 0; margin: 0 -8px; padding: 0 8px; }
@media (max-width: 980px) {
  .plan-layout { grid-template-columns: minmax(0, 1fr); }
  .plan-side { position: static; max-height: none; }
  #plan-list { max-height: 70vh; }
}
.plan-gw { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.plan-bar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--panel-2); border-radius: 12px; margin-bottom: 14px; overflow: hidden; }
.plan-bar > div { padding: 10px 12px; text-align: center; border-left: 1px solid var(--line); }
.plan-bar > div:first-child { border-left: 0; }
.plan-bar .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.plan-bar .v { font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.plan-bar .v.accent, .accent { color: var(--accent); }
.plan-warn { margin: -6px 0 12px; padding: 8px 12px; }
.plan-pl.selected .nm { background: var(--accent); color: var(--bg); }
.plan-pl.selected img { transform: translateY(-3px); filter: drop-shadow(0 0 8px var(--accent)); }
.plan-pl .fx.fdr-0 { background: rgba(0, 0, 0, .55); color: #ddd; }
.plan-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.plan-tools label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.chip-btn.on { background: var(--pink); color: #fff; border-color: var(--pink); }
.small { font-size: 12px; }
.small-btn { padding: 3px 9px; font-size: 12px; }
.plan-selected { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.plan-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.plan-filters .input { flex: 1; min-width: 120px; width: auto; }
.seg button:disabled { opacity: .55; cursor: default; }
.plan-choice {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto 54px 40px; align-items: center; gap: 8px;
  width: 100%; text-align: left; padding: 7px 4px; background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--text);
}
.plan-choice:hover { background: var(--panel-2); }
.plan-choice.blocked { opacity: .45; }
.plan-choice .pc-name { display: flex; flex-direction: column; min-width: 0; }
.plan-choice .pc-name b, .plan-choice .pc-name .dim { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-choice .pc-name .dim { font-size: 12px; }
.plan-choice .fdr { min-width: 0; font-size: 11px; padding: 3px 6px; }
.plan-choice .pc-num { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.plan-empty p { margin: 0; }
@media (max-width: 560px) {
  .plan-bar .v { font-size: 18px; }
  .plan-bar > div { padding: 8px 4px; }
  .plan-choice { grid-template-columns: 30px minmax(0, 1fr) 50px 36px; }
  .plan-choice .fdr { display: none; }
}

/* ---------- injury / doubt warning icon ---------- */
.inj { display: inline-grid; place-items: center; width: 16px; height: 16px; vertical-align: -3px; }
.inj svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.inj .tri { stroke: #1a1200; stroke-width: 1.4; }
.inj.warn .tri { fill: #ffcc00; }
.inj.bad .tri { fill: #ff3b30; stroke: #4a0000; }
.inj .mark { stroke: #1a1200; fill: none; }
.inj .dot { fill: #1a1200; }
.inj.bad .mark { stroke: #fff; }
.inj.bad .dot { fill: #fff; }
/* on the pitch: top-right corner of the shirt, above everything else */
.player .inj { position: absolute; top: 4px; right: 14px; z-index: 3; width: 22px; height: 22px; }
.plan-pl .flag.in { left: 6px; right: auto; top: 28px; z-index: 3; }
@media (max-width: 560px) { .player .inj { right: 4px; width: 18px; height: 18px; } }

/* ---------- banner when showing last-known data ---------- */
.stale-banner { padding: 9px 24px; font-size: 13px; background: rgba(255, 159, 10, .14); border-bottom: 1px solid rgba(255, 159, 10, .45); color: var(--text); }
.stale-banner[hidden] { display: none; }
@media (max-width: 760px) { .stale-banner { padding: 9px 16px; } }

/* ---------- brand ---------- */
.brand-text .brand-name { font-size: 18px; font-weight: 600; letter-spacing: -.2px; }
.brand-text .brand-name b { font-weight: 800; color: var(--accent); }
.brand-sub { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner .tagline { color: var(--muted); font-size: 14px; margin: 2px 0 10px; }
.banner-logo { animation: none; }


/* ---------- profile: rank hero (livefpl-style) ---------- */
.rank-hero {
  display: grid; grid-template-columns: minmax(220px, 1.1fr) minmax(0, 1.6fr) minmax(200px, 1fr); gap: 18px; align-items: center;
  background: linear-gradient(135deg, #2a0b4a 0%, #1b0f33 60%, #06303a 100%);
  border: 1px solid #5b2a86; border-radius: 20px; padding: 22px; margin-bottom: 16px;
}
.rank-hero.rank-up { background: linear-gradient(135deg, #0b3a2a 0%, #14102e 65%, #06303a 100%); border-color: rgba(0, 230, 118, .55); }
.rank-hero.rank-down { background: linear-gradient(135deg, #4a0b1e 0%, #1a0b2a 65%, #1b0f33 100%); border-color: rgba(255, 77, 109, .55); }
.rank-hero .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.rh-rank { font-size: 52px; font-weight: 800; letter-spacing: -1.5px; line-height: 1.05; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.rank-up .rh-rank { color: var(--up); }
.rank-down .rh-rank { color: var(--down); }
.rh-move { font-size: 14px; font-weight: 600; }
.rh-note { font-size: 12px; margin-top: 4px; }
.rh-safety { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 10px; padding: 6px 12px;
  border-radius: 10px; font-size: 13.5px; border: 1px solid var(--line); background: rgba(0, 0, 0, .18); }
.rh-safety b { font-weight: 800; }
.rh-safety-k { color: var(--muted); font-weight: 600; }
.rh-safety-k b { color: var(--text); font-size: 15px; }
.rh-safety.need { border-color: rgba(255, 77, 109, .55); }
.rh-safety.safe { border-color: rgba(0, 230, 118, .55); }
[data-theme="light"] .rh-safety { background: rgba(255, 255, 255, .7); }
.rh-spin { display: inline-block; width: 12px; height: 12px; border-width: 2px; vertical-align: -2px; margin-right: 4px; }
.rh-subs { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 13px; }
.rh-subs b { font-weight: 800; }
.rh-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rh-stat { background: rgba(0, 0, 0, .22); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.rh-stat .v { font-size: 22px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-stat .s { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rh-spark { text-align: center; }
.rank-spark { width: 100%; max-width: 260px; height: auto; }
@media (max-width: 980px) { .rank-hero { grid-template-columns: 1fr; } .rh-spark { order: 3; } }
@media (max-width: 560px) { .rh-rank { font-size: 42px; } }
[data-theme="light"] .rank-hero { background: linear-gradient(135deg, #f1ecff, #ffffff 60%, #eafaf3); border-color: transparent; box-shadow: var(--shadow); }
[data-theme="light"] .rank-hero.rank-up { background: linear-gradient(135deg, #e3f8e9, #ffffff 65%); }
[data-theme="light"] .rank-hero.rank-down { background: linear-gradient(135deg, #ffe9ec, #ffffff 65%); }
[data-theme="light"] .rh-stat { background: rgba(0, 0, 0, .04); }

/* ---------- welcome page ---------- */
.welcome { max-width: 560px; margin: 24px auto; text-align: center; padding: 30px 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.welcome h1 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.6px; }
.welcome p { margin: 0; max-width: 460px; }
.welcome-form { width: 100%; text-align: left; margin-top: 6px; }
.welcome-form label { font-weight: 700; font-size: 13px; display: block; margin-bottom: 6px; }
.welcome-form .row { display: flex; gap: 8px; }
.welcome-form .input { flex: 1; width: auto; font-size: 16px; padding: 12px 14px; }
.welcome-form .btn { padding: 12px 18px; }
.welcome-help { width: 100%; text-align: left; color: var(--muted); font-size: 13px; }
.welcome-help summary { cursor: pointer; color: var(--accent-2); }
.welcome-help ol { margin: 8px 0 0; padding-left: 20px; }
.welcome-features { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0; }
@media (max-width: 560px) { .welcome-form .row { flex-direction: column; } .welcome h1 { font-size: 24px; } }
.back-link { display: inline-block; margin: -6px 0 12px; color: var(--muted); font-weight: 600; font-size: 13px; }
.back-link:hover { color: var(--text); }
.seg[hidden] { display: none; }

/* ---------- league page banner: just the league ---------- */
.league-banner { grid-template-columns: 1fr; padding: 20px 24px; }
.league-banner h1.league-name { margin: 0; font-size: 28px; letter-spacing: -.4px; }

/* ---------- top-right boxes only for visitors without an FPL ID ---------- */
body.has-user .top-forms { display: none; }
body.has-user .change-id { margin-left: auto; }
.open-league .row { display: flex; gap: 8px; }
.open-league .input { flex: 1; width: auto; }

/* ---------- Change FPL ID (top right, only once an ID is entered) + confirm popup ---------- */
.change-id { display: none; white-space: nowrap; }
body.has-user .change-id { display: inline-block; }
dialog.confirm {
  border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(400px, calc(100vw - 32px));
  background: var(--bg-2); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
}
dialog.confirm::backdrop { background: rgba(5, 3, 12, .65); }
dialog.confirm h3 { margin: 0 0 8px; font-size: 18px; }
dialog.confirm p { margin: 0 0 18px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-actions .btn { min-width: 76px; }
[data-theme="light"] dialog.confirm { background: #fff; border-color: transparent; }
[data-theme="light"] dialog.confirm::backdrop { background: rgba(0, 0, 0, .3); }
@media (max-width: 760px) { body.has-user .change-id { margin-left: auto; padding: 7px 10px; font-size: 13px; } body.has-user .theme-toggle { margin-left: 0; } }

/* ---------- Live fixtures ---------- */
.lf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 8px; }
.lf-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.lf-card.live { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink) inset; }
.lf-head { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; }
.lf-team { display: flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.lf-team span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lf-team.away { justify-content: flex-end; text-align: right; }
.club-badge { width: 30px; height: 30px; object-fit: contain; flex: none; }
.lf-score { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; padding: 2px 12px; border-radius: 10px; background: var(--panel-2); white-space: nowrap; }
.lf-card.live .lf-score { background: var(--pink); color: #fff; }
.lf-status { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0 10px; }
.lf-live { color: var(--pink); font-weight: 700; }
.lf-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 6px; align-items: start; padding: 4px 0; border-top: 1px solid var(--line); font-size: 13px; }
.lf-row .lf-h { text-align: right; }
.lf-row .lf-ico { text-align: center; }
.lf-row a { color: var(--text); font-weight: 600; }
.lf-none { text-align: center; padding: 6px 0; }
.lf-bonus { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.lf-bonus .k { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; margin-right: 6px; }
.lf-bonus .pill a { color: inherit; }
.lf-pre { text-align: center; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; align-items: center; }
@media (max-width: 420px) { .lf-grid { grid-template-columns: 1fr; } .lf-team span { font-size: 13px; } }
.section-title { font-size: 20px; margin: 6px 0 12px; display: flex; align-items: baseline; gap: 10px; }
.section-title small { color: var(--muted); font-weight: 500; font-size: 13px; }

/* ---------- league tables: 10 rows, then scroll inside the box ---------- */
.table-wrap.limit-rows.scrolls { overflow-y: auto; overscroll-behavior: contain; border-bottom: 1px solid var(--line); }
.table-wrap.limit-rows.scrolls thead th { position: sticky; top: 0; z-index: 2; background: var(--panel); }
.table-wrap.limit-rows.scrolls::-webkit-scrollbar { width: 8px; height: 8px; }
.table-wrap.limit-rows.scrolls::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.table-wrap.limit-rows.scrolls::-webkit-scrollbar-thumb:hover { background: var(--dim); }

/* ---------- Premier League table + fixture ratings (Live fixtures) ---------- */
.lf-extras { align-items: start; }
.pl-table .club-badge, .fdr-table .club-badge { width: 20px; height: 20px; vertical-align: -5px; margin-right: 4px; }
.pl-table tr.pl-ucl td:first-child { box-shadow: inset 3px 0 0 #1f8bff; }
.pl-table tr.pl-rel td:first-child { box-shadow: inset 3px 0 0 var(--down); }
.legend .pl-ucl-key { background: #1f8bff; }
.legend .pl-rel-key { background: var(--down); }
.pl-table [class^="form-"] { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; font-size: 10px; font-weight: 800; color: #fff; margin-right: 2px; }
.pl-table .form-W { background: #13a05a; }
.pl-table .form-D { background: #8e8e93; }
.pl-table .form-L { background: #e0263c; }
.fdr-controls { margin-bottom: 10px; }
.fdr-table th, .fdr-table td { text-align: center; }
.fdr-table td:first-child, .fdr-table th:first-child { text-align: left; }
.fdr-cell { font-size: 11px; font-weight: 700; white-space: nowrap; border-left: 2px solid var(--panel); }
.fdr-table td.fdr-1 { background: #257d5a; color: #fff; }
.fdr-table td.fdr-2 { background: #01fc7a; color: #00331a; }
.fdr-table td.fdr-3 { background: #e7e7e7; color: #222; }
.fdr-table td.fdr-4 { background: #ff1751; color: #fff; }
.fdr-table td.fdr-5 { background: #80072d; color: #fff; }
.fdr-table td.fdr-blank { background: var(--panel-2); color: var(--dim); }
.legend .fdr { min-width: 22px; padding: 2px 6px; }
@media (max-width: 1100px) { .lf-extras { grid-template-columns: minmax(0, 1fr); } }

/* =====================================================================
   Stats: club hub
   ===================================================================== */
.crest-img { width: 34px; height: 34px; object-fit: contain; flex: none; }
.crest-img.crest-xs { width: 20px; height: 20px; vertical-align: -5px; }
.crest-img.crest-sm { width: 24px; height: 24px; }
.crest-img.crest-xl { width: 92px; height: 92px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25)); }

/* club strip: the clickable filter */
.club-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px 4px 10px; margin: -6px -4px 16px;
  scroll-snap-type: x proximity; scrollbar-width: thin;
}
.club-chip {
  flex: none; scroll-snap-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 64px; padding: 8px 4px 6px; border-radius: 14px; border: 1px solid transparent; background: var(--panel);
  color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .3px; transition: transform .15s, border-color .15s, background .15s;
}
.club-chip:hover { text-decoration: none; transform: translateY(-2px); border-color: var(--line); color: var(--text); }
.club-chip.active { border-color: var(--accent); background: var(--panel-2); color: var(--text); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); }
.club-all { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; }
[data-theme="light"] .club-chip { box-shadow: var(--shadow); }

/* club hero */
.club-hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 24px; margin-bottom: 4px;
  background: linear-gradient(135deg, #2a0b4a, #1b0f33 55%, #0b2f3a); border: 1px solid #5b2a86;
}
[data-theme="light"] .club-hero { background: linear-gradient(135deg, #f3ecff, #ffffff 55%, #eefaf4); border-color: transparent; box-shadow: var(--shadow); }
.club-hero-bg { position: absolute; right: -40px; top: -40px; opacity: .08; pointer-events: none; }
.club-hero-bg .crest-img { width: 320px; height: 320px; }
.club-hero-main { position: relative; display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.club-hero h1 { margin: 0; font-size: 32px; letter-spacing: -.6px; }
.club-pos { color: var(--muted); margin: 4px 0 8px; }
.club-pos b { color: var(--text); }
.club-form [class^="form-"], .fx-list [class^="form-"] {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 5px; font-size: 10.5px; font-weight: 800; color: #fff; margin-right: 3px;
}
.form-W { background: #13a05a; } .form-D { background: #8e8e93; } .form-L { background: #e0263c; }
.club-tiles { position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.club-tiles > div { background: rgba(0, 0, 0, .2); border-radius: 14px; padding: 10px 12px; }
[data-theme="light"] .club-tiles > div { background: rgba(255, 255, 255, .75); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.club-tiles .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; }
.club-tiles .v { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.club-tiles .s { color: var(--muted); font-size: 12px; }
@media (max-width: 560px) { .club-hero h1 { font-size: 24px; } .crest-img.crest-xl { width: 64px; height: 64px; } }

/* fixtures lists */
.fx-list { list-style: none; margin: 0; padding: 0; }
.fx-list li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.fx-list li:last-child { border-bottom: 0; }
.fx-opp { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fx-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.fx-gw { min-width: 38px; }

/* leader cards */
.leaders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.leader-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; min-width: 0; }
[data-theme="light"] .leader-card { border-color: transparent; box-shadow: var(--shadow); }
.leader-card .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; margin-bottom: 8px; }
.leader-top { display: flex; align-items: center; gap: 12px; color: var(--text); }
.leader-top:hover { text-decoration: none; }
.leader-top img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--panel-2); border: 2px solid var(--accent); flex: none; }
.leader-name { font-weight: 800; font-size: 15px; }
.leader-val { font-size: 20px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.leader-rest { list-style: none; counter-reset: lr 1; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid var(--line); font-size: 13px; }
.leader-rest li { counter-increment: lr; display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.leader-rest li::before { content: counter(lr) "."; color: var(--dim); width: 18px; flex: none; }
.leader-rest li a { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leader-rest li span { color: var(--muted); font-variant-numeric: tabular-nums; }

/* news */
.news-scroll { max-height: 460px; overflow-y: auto; margin-right: -6px; padding-right: 6px; }
.news-list, .club-news { list-style: none; margin: 0; padding: 0; }
.news-list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.news-list li:last-child, .club-news li:last-child { border-bottom: 0; }
.news-list .crest-xs { margin-top: 2px; }
.news-body { min-width: 0; }
.news-body a { color: var(--text); }
.news-body .pill { margin-left: 6px; text-transform: capitalize; }
.inj-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex: none; }
.inj-dot.bad { background: #ff3b30; } .inj-dot.warn { background: #ffcc00; } .inj-dot.ok { background: #34c759; }
.club-news li { padding: 9px 0; border-bottom: 1px solid var(--line); }

/* set pieces */
.sp-row { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); align-items: start; }
.sp-row:last-child { border-bottom: 0; }
.sp-row .k { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding-top: 3px; }
.sp-row .pill { margin: 0 4px 4px 0; } .sp-row .pill a { color: inherit; }

/* squad table */
.squad-tools { justify-content: space-between; margin-bottom: 10px; }
.squad-wrap { overflow-x: auto; }
.squad-table th.sortable { cursor: pointer; user-select: none; }
.squad-table th.sortable:hover, .squad-table th.sorted { color: var(--accent); }
.squad-table .sticky-col { position: sticky; left: 0; background: var(--panel); z-index: 1; }
.squad-table .pos-pill { font-size: 10px; padding: 1px 6px; }
.squad-table td, .squad-table th { white-space: nowrap; }

/* movers */
.movers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.movers .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; margin-bottom: 4px; }
.movers ol { margin: 0; padding-left: 18px; font-size: 13px; }
.movers li { padding: 2px 0; } .movers li a { color: var(--text); }
.movers li span { float: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.clubs-table tr.clickable:hover td { background: var(--panel-2); }
@media (max-width: 560px) { .movers { grid-template-columns: 1fr; } .sp-row { grid-template-columns: 1fr; } }

/* club strip wraps onto more lines instead of scrolling sideways */
.club-strip { flex-wrap: wrap; overflow-x: visible; justify-content: flex-start; scroll-snap-type: none; padding: 4px 0 6px; margin: 0 0 16px; }
.club-chip { scroll-snap-align: none; }
@media (max-width: 560px) { .club-chip { width: 56px; padding: 6px 2px 5px; } .club-chip .crest-img, .club-all { width: 28px; height: 28px; } }

/* main menu wraps onto the next line instead of scrolling sideways */
.nav { flex-wrap: wrap; overflow-x: visible; row-gap: 4px; }
@media (max-width: 760px) { .nav { overflow-x: visible; } }

/* shorter "Change ID" label on phones so the theme button stays on the same line */
.change-id .lbl-short { display: none; }
@media (max-width: 480px) {
  .change-id .lbl-long { display: none; }
  .change-id .lbl-short { display: inline; }
  body.has-user .change-id { padding: 6px 9px; font-size: 12px; }
  .theme-toggle { width: 34px; height: 34px; }
  .topbar { gap: 8px; }
}

/* ---------- plan: gameweek tabs, estimates, your teams in the difficulty grid ---------- */
.plan-weeks { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.plan-week {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 92px;
  padding: 7px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-align: left;
}
.plan-week b { font-size: 14px; }
.plan-week small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.plan-week.has-plan { border-color: var(--accent-2); }
.plan-week.has-plan small { color: var(--accent-2); }
.plan-week.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.plan-week.active small { color: rgba(255, 255, 255, .85); }
[data-theme="light"] .plan-week { border-color: transparent; box-shadow: var(--shadow); }
.est { font-size: 9.5px; font-weight: 800; letter-spacing: .4px; padding: 1px 5px; border-radius: 6px; background: var(--panel); color: var(--muted); vertical-align: 1px; }
.fdr-table tr.fdr-mine td:first-child { box-shadow: inset 3px 0 0 var(--accent); background: var(--panel-2); }
.fdr-table tr.fdr-mine td:first-child .pill { font-size: 10px; padding: 0 6px; margin-left: 4px; }
@media (max-width: 560px) { .plan-week { min-width: 0; flex: 1 1 calc(25% - 6px); padding: 6px 8px; } .plan-week small { font-size: 10px; } }

/* plan on narrow screens: team, transfers, then player choices, then fixture difficulty */
@media (max-width: 980px) {
  .plan-layout { display: flex; flex-direction: column; gap: 0; }
  .plan-main { display: contents; }
  .plan-team { order: 1; }
  #plan-moves { order: 2; }
  .plan-side { order: 3; margin-top: 18px; }
  .plan-fdr-card { order: 4; }
}

/* plan: gameweek navigator */
.plan-weeknav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 0 0 14px; }
.plan-weeknav select { min-width: 190px; }

.over-budget { color: #c27700; font-weight: 600; }
:root:not([data-theme="light"]) .over-budget { color: var(--gold); }

/* squad players from the club of a blocked (3-per-club) choice */
.plan-pl.club-hl .nm { background: #ff9f0a; color: #1a1200; }
.plan-pl.club-hl img { filter: drop-shadow(0 0 7px #ff9f0a) drop-shadow(0 0 2px #ff9f0a); transform: translateY(-3px); }
.plan-pl img { transition: transform .15s, filter .15s; }
.plan-choice[data-club-full] { cursor: help; }

/* phones: hide secondary columns so tables fit their boxes */
@media (max-width: 560px) {
  .hide-sm { display: none; }
  .impact-table th, .impact-table td { padding: 6px 4px; font-size: 12.5px; }
  .impact-table img.mini { width: 24px; height: 24px; }
  .impact-table .pl-link { gap: 5px; }
  .impact-table .pill { font-size: 10px; padding: 1px 6px; }
  .impact-table th { font-size: 10.5px; letter-spacing: .3px; }
}

/* phones: short chip codes and no club abbreviation in the rank-impact tables */
.show-sm { display: none; }
@media (max-width: 560px) {
  .show-sm { display: inline; }
  .impact-table td > .dim { display: none; }
  .impact-table img.mini { width: 22px; height: 22px; }
  #app .table-wrap table th, #app .table-wrap table td { padding-left: 5px; padding-right: 5px; }
}
@media (max-width: 560px) { .impact-table .pl-link span { display: inline-block; max-width: 86px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; } }
@media (max-width: 560px) { .impact-table td:last-child, .impact-table th:last-child { font-size: 11.5px; padding-right: 2px; } }

/* ---------- phones: league tables scroll sideways, with the name columns pinned ---------- */
.swipe-hint { display: none; }
@media (max-width: 760px) {
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .table-wrap::-webkit-scrollbar { height: 6px; width: 6px; }
  .table-wrap::-webkit-scrollbar-thumb { background: var(--dim); border-radius: 6px; }
  .swipe-hint { display: block; font-size: 11.5px; color: var(--muted); margin: -4px 0 6px; text-align: right; }

  table.sticky-first td:first-child, table.sticky-first th:first-child,
  table.sticky-two td:nth-child(-n+2), table.sticky-two th:nth-child(-n+2) {
    position: sticky; z-index: 1; background: var(--panel);
  }
  table.sticky-first td:first-child, table.sticky-first th:first-child,
  table.sticky-two td:first-child, table.sticky-two th:first-child { left: 0; }
  table.sticky-two td:first-child, table.sticky-two th:first-child { min-width: 56px; width: 56px; max-width: 56px; }
  table.sticky-two td:nth-child(2), table.sticky-two th:nth-child(2) { left: 56px; }
  table.sticky-first td:first-child, table.sticky-first th:first-child,
  table.sticky-two td:nth-child(2), table.sticky-two th:nth-child(2) { box-shadow: 6px 0 6px -6px rgba(0, 0, 0, .3); }
  /* the top-left heading cells sit above both the pinned column and the pinned header row */
  table.sticky-first thead th:first-child, table.sticky-two thead th:nth-child(-n+2) { z-index: 3; }
  table.sticky-first tr.me td:first-child, table.sticky-two tr.me td:nth-child(-n+2),
  table.sticky-first tr.selected td:first-child, table.sticky-two tr.selected td:nth-child(-n+2) { background: var(--panel-2); }
  /* names on one line so rows stay compact; the table scrolls instead */
  table.sticky-first .mgr .team, table.sticky-first .mgr .person,
  table.sticky-two .mgr .team, table.sticky-two .mgr .person { white-space: nowrap; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  table.sticky-first td, table.sticky-two td { white-space: nowrap; }
}

/* =====================================================================
   Stats: Clubs / Players tabs, players table, player profile
   ===================================================================== */
.stats-tabs { display: inline-flex; gap: 2px; padding: 4px; margin: 0 0 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.stats-tabs a { padding: 8px 22px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.stats-tabs a:hover { text-decoration: none; color: var(--text); }
.stats-tabs a.active { background: var(--accent); color: #fff; }
[data-theme="light"] .stats-tabs { border-color: transparent; box-shadow: var(--shadow); }

.player-filter { display: flex; align-items: stretch; gap: 10px; margin: 0 0 16px; flex-wrap: wrap; }
.player-filter .player-all { width: auto; flex-direction: row; gap: 8px; padding: 8px 14px; font-size: 13px; }
.player-search { position: relative; flex: 1; min-width: 220px; }
.player-search .input { width: 100%; height: 100%; min-height: 46px; font-size: 15px; padding: 10px 14px; }
.player-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: 0 14px 40px rgba(0, 0, 0, .25); padding: 6px; max-height: 360px; overflow-y: auto;
}
[data-theme="light"] .player-suggest { background: #fff; border-color: transparent; }
.player-suggest[hidden] { display: none; }
.player-suggest a { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.player-suggest a:hover { background: var(--panel-2); text-decoration: none; }
.player-suggest .dim { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }

.players-filters { margin-bottom: 10px; }
.players-filters select { width: auto; }
.group-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.group-chips .pill { cursor: pointer; font-size: 12px; padding: 4px 11px; }
.players-count { margin-bottom: 6px; }
.players-table th.sortable { cursor: pointer; user-select: none; }
.players-table th.sortable:hover, .players-table th.sorted { color: var(--accent); }
.players-table td, .players-table th { white-space: nowrap; }
.players-table .pl-meta { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; }
.players-table .pos-pill { font-size: 10px; padding: 1px 6px; }

/* player profile */
.player-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 20px; align-items: center;
  border-radius: 22px; padding: 22px; background: linear-gradient(135deg, #2a0b4a, #1b0f33 55%, #0b2f3a); border: 1px solid #5b2a86;
}
[data-theme="light"] .player-hero { background: linear-gradient(135deg, #f3ecff, #ffffff 55%, #eefaf4); border-color: transparent; box-shadow: var(--shadow); }
.player-hero-photo { position: relative; width: 150px; height: 150px; object-fit: cover; object-position: top; border-radius: 50%; background: var(--panel-2); border: 3px solid var(--accent); }
.player-hero-main { position: relative; min-width: 0; }
.player-hero h1 { margin: 4px 0; font-size: 30px; letter-spacing: -.6px; }
.player-hero-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.player-tiles { grid-column: 1 / -1; }
.kv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.kv-card dl { margin: 0; }
.kv-card dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv-card dl > div:last-child { border-bottom: 0; }
.kv-card dt { color: var(--muted); }
.kv-card dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .stats-tabs { display: flex; }
  .stats-tabs a { flex: 1; text-align: center; padding: 8px 10px; }
  .player-hero { grid-template-columns: 1fr; text-align: left; }
  .player-hero-photo { width: 104px; height: 104px; }
  .player-hero h1 { font-size: 23px; }
  .player-search { min-width: 0; }
}

/* club rows in the player search suggestions */
.suggest-head { font-size: 10.5px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.suggest-club { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-radius: 10px; }
.suggest-club > a { flex: 1; min-width: 200px; }
.suggest-go { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.suggest-filter { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; margin-right: 6px; }
.suggest-filter:hover { border-color: var(--accent); color: var(--accent); }


/* ---------- ProFantasyStats logo: Breakout Crest + wordmark ("PRO" pill and FANTASY, then a big green STATS) ---------- */
.brand { gap: 10px; }
.brand-logo { width: 42px; height: 46px; flex: none; filter: drop-shadow(0 2px 4px rgba(14, 6, 56, .3)); }
.brand-text .brand-name { display: block; line-height: 1; }
.wm { display: inline-flex; flex-direction: column; line-height: .92; transform: skewX(-7deg); font-family: Outfit, Inter, system-ui, sans-serif; }
.wm-l1 { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 11.5px; letter-spacing: 1.5px; color: var(--text); }
.wm-pro { background: #00e676; color: #062b16; border-radius: 4px; padding: 1px 4px 0; font-weight: 900; letter-spacing: .8px; }
.wm-l2 { display: flex; align-items: center; gap: 3px; font-weight: 900; font-size: 23px; letter-spacing: .8px;
  background: linear-gradient(90deg, #0091ea, #00b85c 55%, #5fae00); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root:not([data-theme="light"]) .wm-l2 { background-image: linear-gradient(90deg, #00e5ff, #00e676 55%, #b6ff3b); }
.wm-l2 svg { width: 17px; height: 17px; transform: skewX(7deg); }
.brand-text .brand-sub { margin-top: 3px; }
@media (max-width: 760px) {
  .brand-logo { width: 36px; height: 40px; }
  .wm-l1 { font-size: 10px; } .wm-l2 { font-size: 19px; } .wm-l2 svg { width: 14px; height: 14px; }
}
.welcome-logo { width: 120px; height: 120px; filter: drop-shadow(0 8px 18px rgba(14, 6, 56, .3)); }

/* ---------- loading: the crest over a bar filling with the logo gradient ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.logo-loader { flex-direction: column; gap: 16px; padding: 90px 0; }
.logo-loader.compact { gap: 10px; padding: 22px 0; }
.loader-logo { width: 84px; height: 84px; filter: drop-shadow(0 8px 16px rgba(14, 6, 56, .28)); animation: loader-bob 1.6s ease-in-out infinite; }
.compact .loader-logo { width: 40px; height: 40px; }
.loader-bar { position: relative; width: 180px; max-width: 60vw; height: 8px; border-radius: 99px; overflow: hidden; background: var(--line); }
.compact .loader-bar { width: 120px; height: 6px; }
.loader-bar span {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #00b8ff, #00e676 60%, #b6ff3b); box-shadow: 0 0 10px rgba(0, 230, 118, .45);
  animation: loader-fill 1.6s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes loader-fill { 0% { width: 0; opacity: 1; } 80% { width: 100%; opacity: 1; } 100% { width: 100%; opacity: 0; } }
@keyframes loader-bob { 50% { transform: translateY(-4px) scale(1.04); } }
@media (prefers-reduced-motion: reduce) {
  .loader-logo { animation: none; }
  .loader-bar span { animation: none; width: 100%; opacity: .6; }
}

/* ---------- sign in with Google (auth.js) ---------- */
.auth-slot { position: relative; display: flex; align-items: center; }
.auth-slot:empty { display: none; }
.auth-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.auth-btn svg { width: 16px; height: 16px; }
.auth-avatar {
  width: 38px; height: 38px; padding: 0; border-radius: 50%; overflow: hidden; cursor: pointer;
  display: grid; place-items: center; border: 2px solid #00e676; background: var(--panel-2); color: var(--text); font-weight: 800; font-size: 15px;
}
.auth-avatar img { width: 100%; height: 100%; object-fit: cover; }
.auth-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 270px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0, 0, 0, .25);
}
[data-theme="light"] .auth-menu { background: #fff; border-color: transparent; }
.auth-menu[hidden] { display: none; }
.auth-who { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.auth-who span { color: var(--muted); overflow-wrap: anywhere; }
.auth-note { font-size: 12.5px; color: var(--muted); background: var(--panel-2); border-radius: 10px; padding: 8px 10px; line-height: 1.4; }
.auth-note b { color: var(--text); }
dialog.signin { max-width: 400px; }
.signin-buttons { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 8px; }
.signin-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: 12px;
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; border: 1px solid #dadce0;
}
.signin-btn svg { width: 20px; height: 20px; flex: none; }
.signin-btn.google { background: #fff; color: #1f1f1f; }
.signin-btn:disabled { opacity: .55; cursor: wait; }
dialog.signin .signin-status { min-height: 1.2em; margin: 0 0 12px; }
@media (max-width: 760px) {
  .auth-btn .auth-lbl { display: none; }
  .auth-btn { padding: 7px 9px; }
  .auth-avatar { width: 34px; height: 34px; }
  body:not(.has-user) .auth-slot:not(:empty) { margin-left: auto; }
  body:not(.has-user) .auth-slot:not(:empty) ~ .theme-toggle { margin-left: 0; }
}

/* ---------- start page: sign-in / create-account box next to "Track your FPL rank live" ---------- */
.welcome-wrap { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 560px); justify-content: center; align-items: start; gap: 20px; margin: 24px auto; }
.welcome-wrap .welcome { margin: 0; }
.welcome-wrap.no-auth { grid-template-columns: minmax(0, 560px); }
.welcome-wrap.no-auth .auth-box { display: none; }
@media (max-width: 960px) { .welcome-wrap, .welcome-wrap.no-auth { grid-template-columns: minmax(0, 560px); } }
.auth-box { padding: 24px 22px; display: flex; flex-direction: column; gap: 12px; }
.auth-box.in-dialog { padding: 0; margin: 4px 0 14px; }
.ab-title { margin: 0; font-size: 20px; letter-spacing: -.3px; }
.ab-lead { margin: -4px 0 2px; font-size: 13.5px; }
.ab-tabs { display: flex; padding: 4px; gap: 2px; border-radius: 12px; background: var(--panel-2); }
.ab-tabs button { flex: 1; padding: 8px 10px; border: 0; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.ab-tabs button.active { background: var(--accent); color: #fff; }
.ab-form { display: flex; flex-direction: column; gap: 10px; }
.ab-form[hidden] { display: none; }
.ab-form label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 700; }
.ab-form .input { width: 100%; font-size: 15px; padding: 10px 12px; font-weight: 400; }
.ab-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ab-link { align-self: flex-end; margin-top: -4px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ab-link:hover { text-decoration: underline; }
.ab-submit { width: 100%; padding: 11px 14px; font-size: 15px; }
.ab-status { margin: 0; min-height: 1.2em; font-size: 13px; color: var(--down); }
.ab-status.ok { color: var(--up); }
.ab-status:empty { min-height: 0; }
.ab-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; }
.ab-or::before, .ab-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-box .signin-btn { width: 100%; }
.auth-box button:disabled, .auth-box input:disabled { opacity: .6; cursor: wait; }
dialog.signin { width: min(420px, calc(100vw - 32px)); }
@media (max-width: 420px) { .ab-two { grid-template-columns: 1fr; } }
/* forgot password: the reset form inside the sign-in box */
.ab-subtitle { margin: 2px 0 0; font-size: 16px; }
.ab-help { margin: 0; font-size: 13px; line-height: 1.45; }
.ab-back { align-self: center; margin-top: 0; }

/* ---------- Manage page (#/manage) ---------- */
.manage-notice { max-width: 560px; margin: 24px auto; }
.manage-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.manage-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.manage-tile span { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.manage-tile b { font-size: 26px; }
.manage-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.manage-tools .input { flex: 1; min-width: 200px; }
.manage-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.manage-table th.sorted { color: var(--accent); }
.manage-table td { white-space: nowrap; }
.auth-menu .auth-manage { text-align: center; }
.manage-ip { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; }
.manage-help { margin: -4px 0 10px; }
.manage-map { height: 420px; margin-top: 4px; }
.manage-where { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .manage-where { grid-template-columns: minmax(0, 1fr); } .manage-map { height: 280px; } }
.jvm-tooltip { font-family: Inter, system-ui, sans-serif; font-size: 12.5px; line-height: 1.4; padding: 6px 9px; border-radius: 8px; background: #1d1b2e; }
.manage-map { position: relative; }
.manage-legend { position: absolute; left: 0; bottom: 0; display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); }
.manage-legend i { width: 18px; height: 10px; border-radius: 3px; display: inline-block; }
.manage-legend span { margin: 0 4px; }
/* the map library styles its box as .jvm-container (height 100%); keep the map's own height */
.manage-map.jvm-container { height: 420px; }
@media (max-width: 960px) { .manage-map.jvm-container { height: 280px; } }

/* ---------- strong passwords: show/hide button, strength bar and checklist ---------- */
.ab-pw { position: relative; display: block; }
.ab-pw .input { padding-right: 42px; }
.ab-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; padding: 0; border: 0;
  border-radius: 8px; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.ab-eye svg { width: 18px; height: 18px; }
.ab-eye:hover, .ab-eye.on { color: var(--accent); }
.ab-strength { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: -4px; }
.ab-strength span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .2s, background .2s; background: var(--down); }
.ab-strength[data-score="2"] span { background: #ff9f0a; }
.ab-strength[data-score="3"] span { background: #a8d81a; }
.ab-strength[data-score="4"] span { background: var(--up); }
.ab-rules { list-style: none; margin: -2px 0 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 12px; color: var(--muted); }
.ab-rules li::before { content: '○'; margin-right: 5px; }
.ab-rules li.ok { color: var(--up); }
.ab-rules li.ok::before { content: '✓'; }
.ab-rules li[data-rule="guess"] { grid-column: 1 / -1; }
.ab-resend { display: inline; margin: 0; }
@media (max-width: 420px) { .ab-rules { grid-template-columns: 1fr; } }

/* ---------- cookie consent (consent.js) and the Cookie & Privacy page ---------- */
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--muted); }
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; gap: 20px; padding: 18px 20px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .45);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner h2 { margin: 0 0 6px; font-size: 16px; }
.cookie-banner p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.cookie-banner p b { color: var(--text); font-weight: 600; }
.cookie-actions { display: flex; gap: 8px; flex: none; }
.cookie-actions .btn, .cookie-dlg-actions .btn { white-space: nowrap; padding: 10px 16px; }
body.has-cookie-banner { padding-bottom: 170px; }
@media (max-width: 860px) {
  .cookie-banner { flex-direction: column; align-items: stretch; gap: 14px; left: 8px; right: 8px; bottom: 8px; padding: 16px; }
  .cookie-actions { flex-direction: column-reverse; }
  .cookie-actions .btn { width: 100%; }
  body.has-cookie-banner { padding-bottom: 330px; }
}
dialog.cookie-dialog { max-width: 560px; width: calc(100% - 32px); }
.cookie-cat { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.cookie-cat p { margin: 6px 0 0; font-size: 13px; }
.cookie-cat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cookie-cat-head label { cursor: pointer; }
.cookie-always { color: var(--accent); font-size: 12px; font-weight: 700; }
.cookie-switch { position: relative; width: 44px; height: 24px; flex: none; }
.cookie-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.cookie-switch span { position: absolute; inset: 0; border-radius: 12px; background: var(--line); transition: background .15s; }
.cookie-switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.cookie-switch input:checked + span { background: var(--accent); }
.cookie-switch input:checked + span::after { transform: translateX(20px); }
.cookie-switch input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.cookie-dlg-actions { flex-wrap: wrap; margin-top: 14px; }
[data-theme="light"] .cookie-banner { background: #fff; border-color: #e3e3ea; box-shadow: 0 10px 36px rgba(0, 0, 0, .18); }
.policy { max-width: 820px; margin: 0 auto; line-height: 1.6; }
.policy h1 { font-size: 26px; margin: 0 0 4px; }
.policy h2 { font-size: 17px; margin: 22px 0 8px; }
.policy table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.policy th, .policy td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.policy .table-wrap { overflow-x: auto; }

/* ---------- match centre (#/match/<id>) ---------- */
.lf-card[data-match], .fixture[data-match] { cursor: pointer; transition: border-color .15s; }
.lf-card[data-match]:hover, .fixture[data-match]:hover { border-color: var(--accent-2); }
.lf-more { display: block; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); text-align: right; font-size: 12.5px; font-weight: 700; }
.mc-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.mc-nav .btn { text-decoration: none; }
.mc-hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 18px 20px 16px; border: 1px solid #3a2a6e;
  background: radial-gradient(600px 220px at 50% 0%, rgba(4, 245, 255, .12), transparent 70%),
              linear-gradient(135deg, #2a0d52 0%, #160f29 55%, #0b2a3a 100%);
}
.mc-hero.live { border-color: var(--pink); box-shadow: 0 0 0 1px var(--pink) inset; }
.mc-meta { text-align: center; color: #b9b1d8; font-size: 12.5px; font-weight: 600; letter-spacing: .3px; }
.mc-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 14px; margin-top: 10px; }
.mc-team { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #fff; text-decoration: none; min-width: 0; }
.mc-team:hover { text-decoration: none; }
.mc-team:hover .mc-name { color: var(--accent); }
.mc-kit { width: 86px; height: 96px; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
.mc-name { font-size: 20px; font-weight: 800; text-align: center; line-height: 1.15; max-width: 100%; overflow-wrap: anywhere; }
.mc-pos { color: #b9b1d8; font-size: 12px; }
.mc-centre { text-align: center; }
.mc-sc { font-size: 46px; font-weight: 900; letter-spacing: -1px; color: #fff; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1; }
.mc-status { margin-top: 8px; color: #d9d4ee; font-size: 13px; font-weight: 700; }
.mc-live { display: inline-flex; align-items: center; gap: 6px; background: var(--pink); color: #fff; padding: 3px 10px; border-radius: 999px; }
.mc-live .live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.4s infinite; }
.mc-scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 12px; color: #e8e4f7; font-size: 13px; }
.mc-scorers > div:first-child { text-align: right; }
.mc-fdr { text-align: center; color: #b9b1d8; margin-top: 12px; }
.mc-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mc-events-head { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 6px; color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.mc-events-head span:first-child { text-align: right; }
.mc-fpl-sum { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.mc-fpl-sum b { color: var(--text); }
.mc-potm { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 194, 51, .16), rgba(255, 194, 51, .03)); border: 1px solid rgba(255, 194, 51, .45); }
.mc-potm img { width: 64px; height: 72px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.mc-potm .k { color: var(--st-bonus); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }
.mc-potm-name { display: block; font-size: 17px; font-weight: 800; color: var(--text); }
.mc-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.mc-potm-pts { text-align: center; }
.mc-potm-pts b { display: block; font-size: 34px; font-weight: 900; color: var(--st-bonus); line-height: 1; }
.mc-potm-pts span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.mc-bps-title { margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.mc-bps-row { display: grid; grid-template-columns: minmax(80px, 130px) minmax(0, 1fr) 34px 30px; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; }
.mc-bps-row a { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-bps-bar { height: 8px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.mc-bps-bar i { display: block; height: 100%; border-radius: 6px; }
.mc-bps-row b { text-align: right; font-variant-numeric: tabular-nums; }
.mc-medal { font-size: 11px; font-weight: 800; text-align: center; border-radius: 6px; padding: 1px 0; }
.mc-medal.m3 { background: var(--st-bonus); color: #3d2a00; }
.mc-medal.m2 { background: #c9d1dc; color: #1d2733; }
.mc-medal.m1 { background: #d79a6a; color: #3a1d06; }
.mc-key { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.mc-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.mc-cmp { padding: 7px 0; border-bottom: 1px solid var(--line); }
.mc-cmp-top { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; align-items: center; font-size: 13px; }
.mc-cmp-top span { text-align: center; color: var(--muted); }
.mc-cmp-top b { font-variant-numeric: tabular-nums; font-size: 14px; }
.mc-cmp-top b:last-child { text-align: right; }
.mc-cmp-top b.lead { color: var(--accent); }
.mc-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 5px; }
.mc-bar span { height: 6px; background: var(--panel-2); border-radius: 4px; overflow: hidden; display: flex; }
.mc-bar span:first-child { justify-content: flex-end; }
.mc-bar i { display: block; height: 100%; border-radius: 4px; }
.mc-note { margin-top: 10px; }
.mc-pitch { padding-top: 10px; }
.mc-pitch-label { position: relative; z-index: 1; text-align: center; color: rgba(255, 255, 255, .8); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; margin: 2px 0 6px; }
.mc-halfway { position: relative; z-index: 1; height: 2px; background: rgba(255, 255, 255, .28); margin: 6px 6px 14px; }
.mc-halfway::after { content: ""; position: absolute; left: 50%; top: -24px; width: 50px; height: 50px; transform: translateX(-50%); border: 2px solid rgba(255, 255, 255, .22); border-radius: 50%; }
.mc-pitch .player { width: 84px; }
.mc-subs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.mc-subs .label, .mc-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 700; margin: 4px 0 6px; }
.mc-sub { display: flex; align-items: center; gap: 8px; padding: 5px 4px; border-radius: 8px; color: var(--text); }
.mc-sub:hover { background: var(--panel-2); text-decoration: none; }
.mc-sub img { width: 28px; height: 32px; object-fit: contain; flex: none; }
.mc-sub span { min-width: 0; display: flex; flex-direction: column; }
.mc-sub b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-sub small { color: var(--muted); font-size: 11.5px; }
.mc-side { margin-bottom: 10px; }
.mc-table td, .mc-table th { font-variant-numeric: tabular-nums; }
.mc-table th.sortable { cursor: pointer; user-select: none; }
.mc-table th.sorted { color: var(--text); }
.mc-table td.pts { font-weight: 800; color: var(--accent); }
.mc-table td.zero { color: var(--dim); }
.mc-table tr.mine td:first-child { box-shadow: inset 3px 0 0 var(--st-bonus); }
.mc-pl { display: flex; align-items: center; gap: 8px; color: var(--text); }
.mc-pl:hover { text-decoration: none; }
.mc-pl:hover b { color: var(--accent); }
.mc-pl img { width: 26px; height: 30px; object-fit: contain; flex: none; }
.mc-pl span { display: flex; flex-direction: column; line-height: 1.25; }
.mc-pl small { color: var(--muted); font-size: 11px; }
.mc-star { color: var(--st-bonus); }
.mc-prov { color: var(--st-bonus); font-weight: 800; }
.mc-form-team { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mc-form-team .club-form { margin-top: 6px; }
.mc-met { padding-top: 10px; }
.mc-met .k { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; font-size: 11px; margin-right: 6px; }
.mc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mc-news { font-size: 12.5px; padding: 3px 0; }
[data-theme="light"] .mc-hero { border-color: transparent; box-shadow: var(--shadow);
  background: radial-gradient(600px 220px at 50% 0%, rgba(0, 113, 227, .10), transparent 70%), linear-gradient(135deg, #f3ecff 0%, #ffffff 55%, #eafaf3 100%); }
[data-theme="light"] .mc-hero.live { box-shadow: 0 0 0 2px var(--pink) inset, var(--shadow); }
[data-theme="light"] .mc-team, [data-theme="light"] .mc-sc { color: var(--text); }
[data-theme="light"] .mc-meta, [data-theme="light"] .mc-pos, [data-theme="light"] .mc-fdr { color: var(--muted); }
[data-theme="light"] .mc-status, [data-theme="light"] .mc-scorers { color: #3a3a40; }
[data-theme="light"] .mc-potm { background: linear-gradient(135deg, rgba(255, 159, 10, .14), #ffffff); border-color: rgba(255, 159, 10, .45); }
[data-theme="light"] .mc-potm .k, [data-theme="light"] .mc-potm-pts b, [data-theme="light"] .mc-star, [data-theme="light"] .mc-prov { color: #c27700; }
@media (max-width: 980px) { .mc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .mc-hero { padding: 14px 10px; }
  .mc-kit { width: 58px; height: 66px; }
  .mc-name { font-size: 15px; }
  .mc-sc { font-size: 34px; }
  .mc-scorers { gap: 14px; font-size: 12px; }
  .mc-pitch .player { width: 64px; }
  .mc-pitch .player img { width: 38px; height: 50px; }
  .mc-pitch .player .nm { font-size: 10px; }
  .mc-pitch .player .fx { font-size: 9.5px; }
  .mc-pitch .pitch-row { gap: 3px; }
  .mc-two, .mc-subs { grid-template-columns: 1fr; }
  .mc-potm { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .mc-potm img { width: 48px; height: 56px; }
  .mc-nav .toolbar .btn { padding: 6px 9px; font-size: 12.5px; }
}

/* ---------- league tabs and the league cup (#/league/<id>/cup) ---------- */
.league-tabs { display: flex; width: fit-content; margin: 0 0 12px; } /* on its own line, under "← Your leagues" */
.league-tabs a { padding: 8px 26px; }
.cup-wait { text-align: center; padding: 34px 20px; }
.cup-wait h2 { justify-content: center; font-size: 20px; }
.cup-wait p { max-width: 560px; margin: 8px auto 0; }
.cup-trophy { font-size: 46px; line-height: 1; margin-bottom: 8px; filter: drop-shadow(0 6px 12px rgba(255, 194, 51, .35)); }
.cup-status { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.cup-rounds { margin-bottom: 12px; overflow-x: auto; }
.cup-rounds .seg { flex-wrap: nowrap; }
.cup-rounds .seg button { white-space: nowrap; }
.cup-list { display: grid; gap: 8px; }
.cup-round-label { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-top: 6px; }
.cup-match { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.cup-match.live { border-color: var(--pink); }
.cup-side { display: flex; flex-direction: column; min-width: 0; color: var(--text); padding: 2px 6px; border-radius: 8px; }
.cup-side:hover { text-decoration: none; background: rgba(255, 255, 255, .04); }
.cup-side b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cup-side small { color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cup-side.away { text-align: right; }
.cup-side.won b { color: var(--up); }
.cup-side.won b::after { content: " ✓"; }
.cup-side.lost { opacity: .6; }
.cup-side.me { box-shadow: inset 0 0 0 1px var(--st-bonus); }
.cup-side.bye b { color: var(--muted); }
.cup-score { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: center; white-space: nowrap; }
.cup-score span { color: var(--dim); margin: 0 2px; }
.cup-score small { display: block; font-size: 10px; color: var(--pink); text-transform: uppercase; letter-spacing: .6px; }
.cup-note { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 11.5px; }
[data-theme="light"] .cup-match { background: #fafafc; border-color: #ececf1; }
@media (max-width: 560px) { .cup-match { padding: 8px; gap: 6px; } .cup-score { font-size: 16px; } .league-tabs { width: auto; } .league-tabs a { flex: 1; text-align: center; } }

/* ---------- favourite league star ---------- */
.fav-cell { width: 28px; padding-right: 0 !important; }
.fav-star { background: none; border: 0; padding: 0 4px; font-size: 18px; line-height: 1; color: var(--dim); cursor: pointer; }
.fav-star:hover { color: var(--st-bonus); }
.fav-star.on { color: var(--st-bonus); }
.fav-star.btn { font-size: 14px; padding: 7px 12px; color: var(--text); }
.fav-star.btn.on { color: var(--st-bonus); border-color: rgba(255, 194, 51, .6); }
.fav-banner { margin-top: 10px; }
.fav-mark { color: var(--st-bonus); }
.fav-note { margin: -6px 0 8px; }
[data-theme="light"] .fav-star.on, [data-theme="light"] .fav-mark, [data-theme="light"] .fav-star:hover { color: #e39a00; }
.fav-inline { display: inline-block; margin: 0 4px 0 -4px; vertical-align: -1px; }
/* the star stays on the left: the cell is left-to-right, only the name inside follows its own language */
.league-cell { direction: ltr; text-align: left; }
.league-cell a[dir="auto"] { unicode-bidi: isolate; }

/* match centre: bonus ranking under key events, top FPL scorers */
.mc-bonus { border-top: 1px solid var(--line); margin-top: 12px; }
.mc-bonus .mc-bps-title small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.mc-bps-row { grid-template-columns: 22px minmax(110px, 170px) minmax(0, 1fr) 34px 30px; }
.mc-bps-pos { color: var(--muted); font-size: 12px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.mc-bps-row a { display: flex; align-items: center; gap: 6px; min-width: 0; }
.mc-bps-row a img { width: 20px; height: 23px; object-fit: contain; flex: none; }
.mc-bps-row a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-bps-row a small { color: var(--muted); font-weight: 500; font-size: 11px; }
.mc-bps-row.gets a { font-weight: 800; }
.mc-more { margin-top: 6px; }
.mc-more summary { cursor: pointer; color: var(--accent-2); font-size: 13px; font-weight: 600; padding: 4px 0; }
.mc-top { display: grid; gap: 2px; }
.mc-top .mc-sub { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; }
.mc-top-pts { font-size: 18px; font-weight: 900; color: var(--accent); text-align: right; line-height: 1; }
.mc-top-pts small { display: block; font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
@media (max-width: 560px) { .mc-bps-row { grid-template-columns: 20px minmax(90px, 1fr) minmax(40px, 70px) 30px 28px; gap: 6px; } }

/* league page: Monthly stats */
.monthly-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.monthly-head h2 { margin: 0; }
.monthly-head select { width: auto; min-width: 150px; }
.monthly .stats-row { margin-bottom: 14px; }
.monthly-table td.pts b { color: var(--accent); }

/* match centre: substitutions */
.mc-subs-box { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.mc-subs-team { display: flex; align-items: center; gap: 6px; font-weight: 800; margin-bottom: 6px; }
.mc-subrow { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.mc-subrow:last-child { border-bottom: 0; }
.mc-min { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); }
.mc-subrow a { color: var(--text); font-weight: 600; }
.mc-in { color: var(--up); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-out { color: var(--down); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-red { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .mc-subs-box { grid-template-columns: 1fr; } }
/* substitutions sit in the narrower left column: each change shows the player on above the player off */
.mc-subrow { grid-template-columns: 40px minmax(0, 1fr); row-gap: 1px; }
.mc-subrow > .mc-min { grid-row: span 2; align-self: center; }
.mc-subrow > span:nth-child(3) { grid-column: 2; font-size: 12.5px; }

/* ---------- ad spaces (ads.js): side rails on wide screens, a banner fixed to the bottom otherwise ---------- */
.ad-rail { position: fixed; top: 128px; z-index: 5; width: 160px; }
.ad-rail.left { left: calc(50% - 640px - 176px); }
.ad-rail.right { right: calc(50% - 640px - 176px); }
.ad-rail[hidden], .ad-anchor[hidden] { display: none; }
.ad-anchor { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; justify-content: center; align-items: center;
  min-height: 58px; padding: 4px 40px 4px 4px; background: var(--bg-2); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .25); }
.ad-close { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; }
.ad-close:hover { color: var(--text); }
body.has-ad-anchor { padding-bottom: 62px; }
body.has-ad-anchor .cookie-banner { bottom: 74px; }
.ad-preview { display: grid; place-items: center; text-align: center; border: 2px dashed var(--line); border-radius: 8px;
  color: var(--muted); font-size: 12px; font-weight: 700; background: repeating-linear-gradient(45deg, transparent 0 10px, rgba(127, 127, 127, .06) 10px 20px); }
.ad-preview small { font-weight: 500; }
[data-theme="light"] .ad-anchor { background: #fff; box-shadow: 0 -4px 16px rgba(0, 0, 0, .08); }
@media print { .ad-rail, .ad-anchor { display: none !important; } }
.ad-anchor > .ad-preview, .ad-anchor > ins { flex: none; } /* ads keep their size: 320 + the close button fits a 360px phone */
/* mock ads (preview on localhost only) */
.ad-mock { position: relative; display: flex; flex: none; color: #fff; border-radius: 6px; overflow: hidden; font-family: Arial, Helvetica, sans-serif; box-shadow: 0 2px 8px rgba(0, 0, 0, .25); }
.ad-mock.tall { flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 18px; padding: 20px 12px; }
.ad-mock.wide { flex-direction: row; align-items: center; gap: 8px; padding: 0 10px 0 12px; }
.ad-mock b { font-size: 22px; line-height: 1.1; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.ad-mock.wide b { font-size: 15px; white-space: nowrap; }
.ad-mock-text { font-size: 14px; line-height: 1.35; opacity: .95; }
.ad-mock.wide .ad-mock-text { font-size: 11px; line-height: 1.2; flex: 1; min-width: 0; }
.ad-mock-cta { background: #fff; color: #222; font-weight: 800; font-size: 13px; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.ad-mock.wide .ad-mock-cta { font-size: 11px; padding: 5px 10px; }
.ad-mock-tag { position: absolute; top: 3px; left: 4px; font-size: 8px; font-weight: 800; letter-spacing: .6px; background: rgba(0, 0, 0, .45); padding: 1px 4px; border-radius: 3px; }
.ad-mock.wide .ad-mock-tag { top: 2px; left: auto; right: 4px; }
