/* ---------------------------------------------------------------------------
 * Shared look for every page: the five difficulty bands, the rating tiles,
 * the band key, pill controls, the gameweek ribbon and the two-slot pickers.
 * Each page links this before its own <style>, so a page can still adjust
 * spacing locally -- but colours and components live here, once.
 * ------------------------------------------------------------------------- */
:root{
  --surface-3:#4A1752;
  --bar:#04F5FF;
  /* The five bands, hardest (0) to easiest (4). Each has a pill colour (the
     stripe, the micro bar, the key) and a type colour tuned to read on the
     dark plum ground: crimson, clay, warm slate, mint, deep emerald.
     Saturation, not brightness, carries the extremes. */
  --b0p:#C2264F; --b0t:#FF6B8B;
  --b1p:#C9846F; --b1t:#F2B5A2;
  --b2p:#857A8B; --b2t:#E4DCE6;
  --b3p:#86C7A9; --b3t:#B6E6CF;
  --b4p:#16A866; --b4t:#4FE3A0;
  --cellbg:rgba(255,255,255,.035);
}
.b0{--bp:var(--b0p);--bt:var(--b0t)} .b1{--bp:var(--b1p);--bt:var(--b1t)}
.b2{--bp:var(--b2p);--bt:var(--b2t)} .b3{--bp:var(--b3p);--bt:var(--b3t)}
.b4{--bp:var(--b4p);--bt:var(--b4t)}

h2.kick{font-family:"Roboto Mono",ui-monospace,monospace;font-size:10px;font-weight:600;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted);margin:0}

/* ---- fused pill controls ---- */
.seg{display:inline-flex;flex-wrap:wrap;background:var(--surface-2);border:0;border-radius:99px;padding:3px;gap:2px}
.seg button{font:inherit;font-family:Barlow,Arial,Helvetica,sans-serif;font-size:13px;font-weight:600;
  padding:6px 15px;border:0;border-radius:99px;background:transparent;color:var(--muted);cursor:pointer;
  box-shadow:none;transition:background .14s,color .14s}
/* hover lightens an unselected option only; on the selected one it would put white text on white */
.seg button:not([aria-pressed="true"]):hover:not(:disabled){color:var(--ink)}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--ground);box-shadow:none}
.seg button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.seg button:disabled{opacity:.35;cursor:not-allowed}
.seg.sm button{font-size:12px;padding:5px 12px}

/* ---- a rating tile ----
   Neutral ground, the band as a stripe on the left, the number in the band's
   colour, a wash fading out from the stripe so a column scans by colour, and a
   hairline bar for where the value sits on the whole scale. */
.cell{position:relative;display:flex;flex-direction:column;justify-content:center;gap:2px;min-width:64px;
  padding:5px 6px 8px 10px;border-radius:5px;overflow:hidden;text-align:left;
  background:linear-gradient(90deg,color-mix(in srgb,var(--bp,transparent) 16%,transparent),transparent 72%),var(--cellbg);
  font-family:"Roboto Mono",ui-monospace,monospace;line-height:1.1;color:var(--ink)}
.cell.b2,.cell.blank{background:var(--cellbg)}
.cell::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--bp,transparent)}
.cell .o{font-size:10.5px;font-weight:600;color:var(--ink);letter-spacing:.03em;white-space:nowrap}
.cell .o small{font-size:8.5px;font-weight:500;color:var(--muted);margin-left:4px;letter-spacing:.06em}
.cell .v{font-size:13.5px;font-weight:700;color:var(--bt);font-variant-numeric:tabular-nums;letter-spacing:-.01em}
.cell .mb{position:absolute;left:10px;right:7px;bottom:3px;height:2px;border-radius:2px;background:rgba(255,255,255,.06)}
.cell .mb::after{content:"";position:absolute;left:0;top:0;bottom:0;width:var(--w);border-radius:2px;background:var(--bp)}
/* colour-only tile: the opponent in the band's colour, no number */
.cell.plain{padding:9px 6px 11px 10px}
.cell.plain .o{font-size:12px;font-weight:700;color:var(--bt)}
.cell.blank{color:var(--muted);box-shadow:inset 0 0 0 1px var(--border)}
.cell.blank .o{color:var(--muted);font-weight:500}
/* stacked: a double gameweek is two tiles in one cell */
.cell + .cell{margin-top:3px}
/* mini: three to a row, inside a list or under a shirt */
.cell.mini{min-width:0;flex:1 1 0;padding:3px 3px 4px 7px;gap:0;border-radius:4px}
.cell.mini::before{width:2.5px}
.cell.mini .o{font-size:9.5px;font-weight:700;color:var(--bt)}
.cell.mini .o small{display:block;margin:1px 0 0;font-size:8px}
.cell.mini + .cell.mini{margin-top:0}
/* on a light card (the pitch's name bars): the same tile, inked darker */
.light .cell{--cellbg:rgba(30,0,33,.06);color:#1E0021}
.light .cell .o small{color:#6B5A6E}
.light .cell.b0{--bt:#B0103C} .light .cell.b1{--bt:#A4522F} .light .cell.b2{--bt:#4A3F4E}
.light .cell.b3{--bt:#1F7A55} .light .cell.b4{--bt:#0A7A45}
.light .cell.blank{box-shadow:inset 0 0 0 1px rgba(30,0,33,.15)}
.light .cell.blank .o{color:#6B5A6E}

.priced{position:relative}
.priced::after{content:"";position:absolute;top:4px;right:4px;width:4px;height:4px;border-radius:50%;background:var(--bar)}

/* ---- the band key ---- */
.legend{display:flex;align-items:center;gap:4px 12px;flex-wrap:wrap;font-family:"Roboto Mono",ui-monospace,monospace;font-size:10.5px;color:var(--muted)}
.legend .end{font-family:Barlow,Arial,sans-serif;font-size:10px;letter-spacing:.12em;text-transform:uppercase}
.lg{display:inline-flex;align-items:center;gap:5px;color:var(--bt);font-weight:600}
.lg i{width:3px;height:12px;border-radius:2px;background:var(--bp)}
.dot{display:inline-block;width:5px;height:5px;border-radius:50%;background:var(--bar);vertical-align:middle;margin:0 1px 2px}

/* ---- the gameweek ribbon ----
   One timeline, next gameweek to 38. The window is a single connected band on
   it with solid ends. Drag across it, or click one week then a later one. */
.gwwin{padding:15px 16px 12px}
.winhead{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:10px 18px;margin-bottom:10px}
.readout{font-weight:800;font-size:22px;letter-spacing:-.02em;line-height:1.1;margin-top:5px;
  font-variant-numeric:tabular-nums;display:flex;align-items:baseline;gap:9px;flex-wrap:wrap}
.readout small{font-weight:500;font-size:12.5px;color:var(--muted);letter-spacing:0}
.ribwrap{display:flex;align-items:stretch;gap:6px}
.nudge{flex:none;width:30px;border:0;border-radius:9px;background:var(--surface-2);color:var(--ink);
  font:inherit;font-size:17px;line-height:1;cursor:pointer;transition:background .12s}
.nudge:hover:not(:disabled){background:var(--surface-3)}
.nudge:disabled{opacity:.3;cursor:default}
.nudge:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.ribbon{flex:1;min-width:0;display:flex;overflow-x:auto;scrollbar-width:none;touch-action:pan-x;
  user-select:none;-webkit-user-select:none;scroll-behavior:smooth;border-radius:10px}
.ribbon::-webkit-scrollbar{display:none}
.ribbon .gwb{flex:1 0 34px;position:relative;border:0;border-radius:0;background:transparent;color:var(--muted);cursor:pointer;
  font:inherit;font-family:"Roboto Mono",ui-monospace,monospace;padding:4px 0 11px;min-width:0;box-shadow:none;
  display:flex;flex-direction:column;align-items:center;gap:2px;transition:background .14s,color .14s}
.ribbon .gwb s{text-decoration:none;font-size:8.5px;font-weight:600;letter-spacing:.12em;height:11px;color:var(--muted);opacity:.85}
.ribbon .gwb b{display:grid;place-items:center;min-width:26px;height:24px;padding:0 3px;border-radius:7px;
  font-size:12.5px;font-weight:600;transition:background .14s,color .14s,box-shadow .14s}
.ribbon .gwb::after{content:"";position:absolute;left:0;right:0;bottom:4px;height:3px;background:var(--surface-2);transition:background .14s}
.ribbon .gwb:first-child::after{left:4px;border-radius:3px 0 0 3px}
.ribbon .gwb:last-child::after{right:4px;border-radius:0 3px 3px 0}
.ribbon .gwb:hover b{background:var(--surface-2);color:var(--ink)}
.ribbon .gwb:focus-visible{outline:none}
.ribbon .gwb:focus-visible b{outline:2px solid var(--accent);outline-offset:1px}
.ribbon .gwb[data-in="1"]{background:rgba(0,255,135,.07);color:var(--ink)}
.ribbon .gwb[data-in="1"]::after{background:var(--accent)}
.ribbon .gwb[data-start="1"]{border-radius:10px 0 0 10px}
.ribbon .gwb[data-end="1"]{border-radius:0 10px 10px 0}
.ribbon .gwb[data-start="1"][data-end="1"]{border-radius:10px}
.ribbon .gwb[data-edge="1"] b{background:var(--accent);color:var(--accent-ink);font-weight:700}
.ribbon .gwb[data-preview="1"]{background:rgba(0,255,135,.045)}
.ribbon .gwb[data-preview="1"]::after{background:rgba(0,255,135,.4)}
.ribbon .gwb[data-anchor="1"] b{box-shadow:0 0 0 2px var(--surface),0 0 0 4px rgba(0,255,135,.55)}
.gwhint{margin:8px 0 0;font-size:11.5px;color:var(--muted);min-height:1.2em}

/* ---- two slots and a grid to fill them from (rotation pairs) ---- */
.rslots{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.rslot{font:inherit;border:0;border-radius:10px;background:var(--surface-2);color:var(--ink);
  padding:7px 12px 7px 8px;display:flex;align-items:center;gap:9px;min-width:158px;cursor:pointer;text-align:left;
  box-shadow:inset 0 0 0 1.5px transparent;transition:box-shadow .14s,background .14s}
.rslot:hover{background:var(--surface-3)}
.rslot[data-active="1"]{box-shadow:inset 0 0 0 1.5px var(--accent)}
.rslot:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.rslot .k{font-family:"Roboto Mono",monospace;font-size:9.5px;font-weight:700;color:var(--muted);
  border-radius:5px;padding:2px 6px;background:var(--surface)}
.rslot[data-active="1"] .k{background:var(--accent);color:var(--accent-ink)}
.rslot b{font-weight:800;font-size:15px;letter-spacing:.03em}
.rslot em{font-style:normal;font-size:11.5px;color:var(--muted)}
.rslot.empty b{font-weight:500;font-size:13px;color:var(--muted);letter-spacing:0}
.rslots .over{color:var(--muted);font-weight:600;margin:0 1px}
.txtbtn{font:inherit;font-size:12px;background:none;border:0;color:var(--muted);cursor:pointer;padding:6px 5px;
  text-decoration:underline;text-decoration-color:var(--border-strong);text-underline-offset:3px}
.txtbtn:hover{color:var(--ink)}
.txtbtn:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
.rgrid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:4px}
.rtb{position:relative;font:inherit;border:0;border-radius:8px;background:var(--surface-2);color:var(--muted);
  padding:8px 6px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:6px;min-width:0;
  font-weight:800;font-size:13px;letter-spacing:.04em;transition:background .12s,color .12s,transform .08s}
.rtb i{width:3px;height:13px;border-radius:2px;flex:none}
.rtb span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rtb:hover{color:var(--ink);background:var(--surface-3)}
.rtb:active{transform:scale(.96)}
.rtb:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.rtb[aria-pressed="true"]{background:var(--ink);color:var(--ground)}
.rtb em{position:absolute;top:-5px;right:-3px;font-style:normal;font-family:"Roboto Mono",monospace;
  font-size:9px;font-weight:700;line-height:1;padding:3px 5px;border-radius:99px;
  background:var(--accent);color:var(--accent-ink)}

/* ---- a rotation strip: one tile a week ---- */
.pcell{flex:1 0 54px;position:relative;border-radius:5px;padding:5px 4px 6px 9px;overflow:hidden;min-width:0;text-align:left;
  background:linear-gradient(90deg,color-mix(in srgb,var(--bp,transparent) 16%,transparent),transparent 72%),var(--cellbg);
  font-family:"Roboto Mono",ui-monospace,monospace;line-height:1.2;color:var(--ink)}
.pcell.b2{background:var(--cellbg)}
.pcell::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px;background:var(--bp,transparent)}
.pcell b{display:block;font-size:8.5px;font-weight:600;color:var(--muted);letter-spacing:.06em}
.pcell strong{display:block;font-size:12.5px;font-weight:800;letter-spacing:.03em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pcell u{display:block;text-decoration:none;font-size:9.5px;font-weight:600;color:var(--bt,var(--muted))}
.pcell.blank{background:transparent;box-shadow:inset 0 0 0 1px var(--border);color:var(--muted)}
.pcell.blank::before{display:none}

@media (max-width:700px){
  .seg button{font-size:12px;padding:6px 12px}
  .gwwin{padding:13px 12px 10px}
  .readout{font-size:19px}
  .ribbon .gwb{flex:0 0 34px}
  .rslots{width:100%}
  .rslot{min-width:0;flex:1 1 0}
  .rslots .act{flex-basis:100%;display:flex;justify-content:flex-end;margin-top:-2px}
  .rgrid{grid-template-columns:repeat(5,minmax(0,1fr))}
}
@media (prefers-reduced-motion:reduce){
  .seg button,.ribbon,.ribbon .gwb,.ribbon .gwb b,.rslot,.rtb,.nudge{transition:none!important;scroll-behavior:auto!important}
}

/* ---- our socials, under the page name in every masthead ---- */
.socials{display:flex;align-items:center;gap:10px;margin-top:11px}
.socials .lab{font-family:"Roboto Mono",ui-monospace,monospace;font-size:9.5px;font-weight:600;letter-spacing:.14em;
  text-transform:uppercase;color:var(--muted);margin-right:1px}
.socials a{display:block;line-height:0;border-radius:7px;transition:transform .12s,filter .12s}
.socials a:hover{transform:translateY(-1px);filter:brightness(1.15)}
.socials a:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.socials img{display:block;height:28px;width:auto}
.socials a.x img{border-radius:7px}
@media (prefers-reduced-motion:reduce){.socials a{transition:none}}

/* ---- club crests ----
   <span class="crest" style="--c:<club colour>;--cs:<size>"><img …></span>.
   If the image fails it removes itself and the span falls back to the old
   club-colour bar, so a missing file never leaves a hole. */
.crest{display:inline-grid;place-items:center;flex:none;width:var(--cs,20px);height:var(--cs,20px)}
.crest img{display:block;width:100%;height:100%;object-fit:contain}
.crest:empty::before{content:"";width:3px;height:75%;border-radius:2px;background:var(--c,#888)}
