/* Super League v2 — the luggage-tag aesthetic under the MoMA laws.
 *
 * Ground and ink, and a third of the surface is solid ink: bands with the
 * type knocked out of them, because reversal is the cheapest hierarchy there
 * is and it survives a half-second glance. One saturated rail per screen,
 * used as a domain and never as flavour. Zero radius. One hairline weight,
 * drawn with box-shadow and never with a border, because a border occupies
 * layout space and pushes every child a pixel inward — which is Law I, and
 * the reason edges on a page ever fail to line up.
 *
 * Spacing comes from one closed scale. Type is three sizes, each welded to
 * its leading. And nothing scrolls: a screen is a screen, the way an arcade
 * cabinet or Championship Manager is a screen, and the browser's own back
 * button is how you leave it.
 */

:root {
  /* Ground and ink — thermal face stock, near-white and slightly warm. */
  --ground: #f7f6f2;
  --ground-strict: #fffefa;
  --ink: #111111;
  --ink-soft: #2a2a2a;
  --dim: #5c5c58;
  --rule: rgba(17, 17, 17, .28);
  --hair: 0 0 0 1px var(--rule);        /* the one hairline, as a shadow */

  /* Reversal: type knocked out of solid ink. */
  --reverse-ground: #111111;
  --reverse-ink: #fffefa;

  /* Rails. Colour is a domain: one per screen, declared on the shell. */
  --rail-league:  #e8471f;   /* the competition itself */
  --rail-career:  #14489c;   /* a season under way */
  --rail-world:   #1c8a4a;   /* the world cup */
  --rail-gods:    #6b21a8;   /* the all-time XI */
  --rail-watch:   #f2b706;   /* spectating */
  --rail: var(--rail-league);

  /* The scale. There is no sixteenth value. */
  --s0: 0; --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 48px; --s10: 64px;

  /* Three sizes, each with its leading. */
  --t-micro: 11px;   --lh-micro: 16px;
  --t-body: 14px;    --lh-body: 20px;
  --t-display: 32px; --lh-display: 36px;

  /* The two sides, and the ground the pitch sits on. The board box and the
     canvas paint the same value, so the surround is one field rather than a
     letterbox with a seam down each side of it. */
  --red: #e8471f;
  --blue: #cfd6e4;
  --pitch-surround: #06080c;

  --mono: "JetBrains Mono", ui-monospace, "SF Mono", monospace;
  --arcade: "Press Start 2P", var(--mono);
  --rail-w: 12px;
}

*, *::before, *::after { box-sizing: border-box; border-radius: 0; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;                      /* a screen is a screen */
  background: var(--ink);
  color: var(--ink);
  font: var(--t-body)/var(--lh-body) var(--mono);
  -webkit-font-smoothing: antialiased;
}

body {
  display: grid;
  grid-template-rows: 1fr auto;
  padding-left: var(--rail-w);           /* the rail is the page's left edge */
  background: linear-gradient(90deg, var(--rail) 0 var(--rail-w), var(--ground) var(--rail-w));
}

#app {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--ground);
  padding: var(--s4) var(--s6) 0;
  gap: var(--s3);
}

/* Anything that must hold more than a screen scrolls inside its own frame,
   never the page. */
.sl-scroll { min-height: 0; overflow: auto; scrollbar-width: thin; }

/* ── Masthead ─────────────────────────────────────────────────────────── */
.sl-head { grid-row: 1; min-height: 0; }
.sl-hero {
  display: block;
  position: relative;
  height: 120px;
  overflow: hidden;
  margin-bottom: var(--s2);
  box-shadow: var(--hair);
}
.sl-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
  filter: brightness(0.8) contrast(1.15);
}
.sl-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 20, 16, 0.1) 0%, rgba(11, 20, 16, 0.75) 100%);
  pointer-events: none;
}

.sl-head-copy {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: var(--s3);
  background: var(--reverse-ground);
  color: var(--reverse-ink);
  padding: var(--s2) var(--s3);
}
.sl-head-copy > div { display: flex; align-items: baseline; gap: var(--s3); min-width: 0; }
.sl-head-copy b {
  font-family: var(--arcade);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: -.02em;
}
.sl-head-copy span { font-size: var(--t-micro); line-height: var(--lh-micro); letter-spacing: .16em; opacity: .72; }
.sl-head-copy p {
  margin: 0;
  font-size: var(--t-micro);
  line-height: var(--lh-micro);
  opacity: .72;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ── Controls ─────────────────────────────────────────────────────────── */
button {
  font: inherit;
  font-size: var(--t-micro);
  line-height: var(--lh-micro);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--ground-strict);
  box-shadow: var(--hair);
  border: 0;
  padding: var(--s2) var(--s3);
  cursor: pointer;
}
button:hover:not(:disabled), button:focus-visible { background: var(--ink); color: var(--reverse-ink); outline: 0; }
button:disabled { color: var(--dim); opacity: .5; cursor: default; }
button.is-on, .is-on { background: var(--ink); color: var(--reverse-ink); }

.sl-kickoff {
  background: var(--rail);
  color: var(--reverse-ink);
  font-family: var(--arcade);
  font-size: var(--t-micro);
  padding: var(--s3) var(--s4);
  box-shadow: none;
}
.sl-kickoff:hover { background: var(--ink); }

/* ── The lobby ────────────────────────────────────────────────────────── */
.sl-pick {
  grid-row: 2;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4);
}
.sl-pick-col { min-height: 0; display: flex; flex-direction: column; gap: var(--s2); align-content: start; }
.sl-pick-col h2, .sl-mode-section-title, .sl-tournament-groups h2, .sl-tournament-bracket h2,
.sl-legend h2, .sl-xi-bench h2, .sl-sheet-style h2 {
  margin: 0;
  font-family: var(--arcade);
  font-size: var(--t-micro);
  line-height: var(--lh-micro);
  letter-spacing: .02em;
  background: var(--ink);
  color: var(--reverse-ink);
  padding: var(--s1) var(--s2);
}

/* Law IV: the grid fills. Twenty-six clubs into a fixed thirteen columns. */
.sl-grid { display: grid; grid-template-columns: repeat(13, 1fr); grid-auto-rows: 44px; gap: 1px; background: var(--rule); box-shadow: var(--hair); align-content: start; min-height: 0; overflow: auto; }
.sl-team {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: var(--s1) 0;
  background: var(--ground-strict);
  box-shadow: none;
  min-height: 0;
}
.sl-team span { font-size: var(--t-micro); line-height: var(--lh-micro); letter-spacing: .04em; }
.sl-crest { width: 14px; height: 14px; display: block; background: linear-gradient(135deg, var(--a) 0 50%, var(--b) 50% 100%); }

.sl-shapes, .sl-seats, .sl-sheet-shapes, .sl-sheet-sides, .sl-legend-actions, .sl-result-actions { display: flex; gap: var(--s1); flex-wrap: wrap; }
.sl-shapes button {
  padding: var(--s1) var(--s2);
  font-family: var(--arcade);
  font-size: 8px;
  letter-spacing: .04em;
}

.sl-btn-practice {
  background: #047857;
  color: var(--reverse-ink);
  font-family: var(--arcade);
  font-size: var(--t-micro);
  letter-spacing: .04em;
}
.sl-btn-practice:hover {
  background: #059669;
  color: var(--reverse-ink);
}

/* Squad Preview below selection */
.sl-squad-preview {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s2);
  background: var(--ground-strict);
  box-shadow: var(--hair);
}
.sl-squad-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--t-micro);
  font-family: var(--arcade);
}
.sl-squad-preview-head b { font-size: 9px; }
.sl-squad-meta {
  font-size: 8px;
  color: var(--rail);
  letter-spacing: .05em;
}
.sl-squad-avatars {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 2px;
  align-items: start;
}
.sl-squad-man {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  text-align: center;
}
.sl-squad-face {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  background: #111;
  box-shadow: var(--hair);
  display: block;
}
.sl-squad-pos {
  font-size: 7px;
  font-weight: 700;
  padding: 0 1px;
  line-height: 9px;
  width: 100%;
}
.sl-squad-pname {
  font-size: 7px;
  line-height: 8px;
  max-width: 32px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sl-fixture { grid-row: 3; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--s3); padding-bottom: var(--s3); }
.sl-vs { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-body); min-width: 0; }
.sl-vs b { color: var(--rail); }
.sl-vs span { display: flex; align-items: center; gap: var(--s2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sl-rules { display: none; }
.sl-squads { display: none; }

/* ── Modes ────────────────────────────────────────────────────────────── */
.sl-mode-section { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--s2); }
.sl-modes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule); box-shadow: var(--hair); min-height: 0; }
.sl-mode { display: grid; align-content: start; gap: var(--s2); text-align: left; padding: var(--s3); background: var(--ground-strict); box-shadow: none; text-transform: none; }
.sl-mode b { font-family: var(--arcade); font-size: var(--t-micro); line-height: var(--lh-micro); color: var(--rail); letter-spacing: .02em; }
.sl-mode:hover b, .sl-mode:focus-visible b { color: inherit; }
.sl-mode span { font-size: var(--t-micro); line-height: var(--lh-micro); letter-spacing: .02em; text-transform: none; }

/* ── Match ────────────────────────────────────────────────────────────── */
.sl-match { grid-row: 1 / -1; min-height: 0; display: grid; }
.sl-frame { min-height: 0; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr) auto; background: var(--ink); }
.sl-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s3); background: var(--ink); color: var(--reverse-ink); }
.sl-bar-title { display: grid; gap: 2px; min-width: 0; }
.sl-bar-title b { font-family: var(--arcade); font-size: var(--t-micro); line-height: var(--lh-micro); color: var(--rail); }
.sl-bar-title span { font-size: var(--t-micro); line-height: var(--lh-micro); letter-spacing: .14em; opacity: .6; }
.sl-bar-actions { display: flex; gap: var(--s1); }
.sl-bar-actions button { background: transparent; color: var(--reverse-ink); box-shadow: inset 0 0 0 1px rgba(255, 254, 250, .35); }
.sl-bar-actions button:hover { background: var(--reverse-ink); color: var(--ink); }

.sl-strip { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s3); background: var(--reverse-ground); color: var(--reverse-ink); font-size: var(--t-micro); line-height: var(--lh-micro); letter-spacing: .1em; overflow: hidden; white-space: nowrap; }
.sl-clock { font-family: var(--arcade); color: var(--rail); }
.sl-poss { display: flex; width: 96px; height: 4px; }
.sl-poss i { display: block; height: 100%; }
.sl-stat em { font-style: normal; opacity: .55; margin-right: var(--s1); }

.sl-turn { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s3);
  background: var(--reverse-ground); color: var(--reverse-ink);
  font-size: var(--t-micro); line-height: var(--lh-micro); letter-spacing: .1em;
  white-space: nowrap; overflow: hidden; box-shadow: inset 0 2px 0 0 var(--dim); }
.sl-turn[data-side="red"] { box-shadow: inset 0 2px 0 0 var(--red); }
.sl-turn[data-side="blue"] { box-shadow: inset 0 2px 0 0 var(--blue); }
.sl-score { font-family: var(--arcade); font-size: var(--t-micro); letter-spacing: .02em; }
.sl-score i { font-style: normal; opacity: .6; }
.sl-score em { font-style: normal; opacity: .45; margin: 0 var(--s1); }
.sl-tick { font-family: var(--mono); opacity: .35; min-width: 34px; }
.sl-tick.is-live { opacity: 1; }
.sl-tick.is-low { color: var(--red); }
.sl-phase { font-weight: 700; }
.sl-prompt { margin-left: auto; opacity: .7; overflow: hidden; text-overflow: ellipsis; }
.sl-turn .ps-skip, .sl-turn .ps-cancel-kick { flex: none; background: none; color: var(--reverse-ink);
  box-shadow: inset 0 0 0 1px rgba(255,254,250,.4); padding: var(--s1) var(--s2);
  font: inherit; letter-spacing: .12em; cursor: pointer; border: 0; border-radius: 0; }
.sl-turn .ps-skip:hover, .sl-turn .ps-cancel-kick:hover { background: var(--reverse-ink); color: var(--reverse-ground); }

/* The canvas is taken out of flow on purpose. Left in it, `height: 100%`
   against an auto-sized grid row is circular, so the browser falls back to
   the element's intrinsic ratio (1100x640) and the canvas grows taller than
   the cell that is supposed to hold it — 576px of pitch in a 522px box,
   painting straight over the player cards below. Absolute inset pins it to
   the box, and the box is the one the grid decided. */
.ps-board { position: relative; min-height: 0; overflow: hidden; background: var(--pitch-surround); }
.ps-pitch { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; }

.sl-card { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); height: 128px; }
.sl-card-slot { background: var(--ground); padding: var(--s2) var(--s3); min-height: 0; overflow: hidden; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: var(--s1); }
.sl-card-slot.is-empty { place-items: center; color: var(--dim); font-size: var(--t-micro); letter-spacing: .16em; }
.sl-card-label { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); font-size: var(--t-micro); line-height: var(--lh-micro); letter-spacing: .16em; color: var(--dim); }
.sl-card-side { font-style: normal; font-weight: 700; }
.sl-card-id { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.sl-card-id em { font-style: normal; width: 22px; height: 22px; display: grid; place-items: center; font-size: var(--t-micro); font-weight: 700; color: var(--reverse-ink); }
.sl-card-portrait, .sl-portrait, .sl-xi-face { image-rendering: pixelated; }
.sl-card-portrait { width: 26px; height: 26px; box-shadow: var(--hair); }
.sl-card-id strong { font-size: var(--t-body); line-height: var(--lh-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sl-card-id small { display: block; font-size: var(--t-micro); line-height: var(--lh-micro); color: var(--dim); letter-spacing: .1em; }
.sl-card-body { display: grid; grid-template-columns: 76px 1fr; gap: var(--s3); align-items: center; min-height: 0; overflow: hidden; }
.sl-card-radar { width: 76px; height: 76px; display: block; overflow: visible; }
.sl-card-read p { margin: 0 0 var(--s1); font-size: var(--t-micro); line-height: var(--lh-micro); }
.sl-card-kinds { display: flex; gap: var(--s1); margin-bottom: var(--s1); }
.sl-card-kinds i { font-style: normal; font-size: 9px; letter-spacing: .12em; padding: 0 var(--s1); box-shadow: var(--hair); color: var(--dim); }
.sl-card-kinds i.has { background: var(--ink); color: var(--reverse-ink); box-shadow: none; }
.sl-card-facts, .sl-card-basis { display: block; font-size: 9px; letter-spacing: .1em; color: var(--dim); }
.sl-card-traits { display: flex; gap: var(--s1); flex-wrap: wrap; margin-top: var(--s1); }
.sl-card-traits span { font-size: 9px; letter-spacing: .12em; padding: 0 var(--s1); background: var(--rail); color: var(--reverse-ink); }

.sl-result { position: absolute; inset: 0; z-index: 20; display: grid; place-content: center; justify-items: center; gap: var(--s4); padding: var(--s7); background: rgba(247, 246, 242, .96); text-align: center; }
.sl-result h2 { margin: 0; font-family: var(--arcade); font-size: var(--t-display); line-height: var(--lh-display); letter-spacing: -.02em; }
.sl-result p { margin: 0; max-width: 52ch; font-size: var(--t-micro); line-height: var(--lh-micro); color: var(--ink-soft); }

.sl-handoff { position: absolute; inset: 0; z-index: 22; display: none; place-content: center; justify-items: center; gap: var(--s4); background: var(--ink); color: var(--reverse-ink); }
.sl-handoff.is-on { display: grid; }
.sl-handoff-num { font-family: var(--arcade); font-size: var(--t-display); line-height: var(--lh-display); }
.sl-handoff-team { font-size: var(--t-body); letter-spacing: .16em; }

.sl-ready-gate { position: absolute; inset: 0; z-index: 21; display: grid; place-content: center; gap: var(--s3); background: rgba(17, 17, 17, .92); color: var(--reverse-ink); font-family: var(--arcade); font-size: var(--t-micro); letter-spacing: .04em; text-align: center; cursor: pointer; }

/* ── Team sheet ───────────────────────────────────────────────────────── */
.sl-sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.sl-sheet { grid-row: 2; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--s3); }
.sl-xi-pitch {
  position: relative;
  min-height: 0;
  background: repeating-linear-gradient(
    90deg,
    #134e27 0px,
    #134e27 48px,
    #175b2e 48px,
    #175b2e 96px
  );
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.6), var(--hair);
  border: 2px solid rgba(255, 255, 255, 0.4);
  overflow: hidden;
}
.sl-pitch-markings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.sl-pm-halfway {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255, 255, 255, 0.4);
  transform: translateX(-50%);
}
.sl-pm-center-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110px;
  height: 110px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.sl-pm-center-spot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.sl-pm-box-left {
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 0;
  width: 16%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-left: 0;
}
.sl-pm-goal-left {
  position: absolute;
  top: 34%;
  bottom: 34%;
  left: 0;
  width: 6%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-left: 0;
}
.sl-pm-spot-left {
  position: absolute;
  top: 50%;
  left: 11%;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  transform: translateY(-50%);
}
.sl-pm-box-right {
  position: absolute;
  top: 18%;
  bottom: 18%;
  right: 0;
  width: 16%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-right: 0;
}
.sl-pm-goal-right {
  position: absolute;
  top: 34%;
  bottom: 34%;
  right: 0;
  width: 6%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-right: 0;
}
.sl-pm-spot-right {
  position: absolute;
  top: 50%;
  right: 11%;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  transform: translateY(-50%);
}

.sl-xi-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: auto;
  z-index: 5;
}
.sl-xi-disc {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: 0;
  box-shadow: none;
  cursor: grab;
  user-select: none;
  padding: 0;
}
.sl-disc-body {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #1e293b;
  box-shadow: 0 3px 8px rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.12s ease;
}
.sl-disc-face {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}
.sl-disc-num {
  position: absolute;
  bottom: 0;
  right: 0;
  background: var(--ink);
  color: var(--reverse-ink);
  font-family: var(--arcade);
  font-size: 7px;
  padding: 1px 2px;
  line-height: 1;
}
.sl-disc-tag {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(11, 20, 16, 0.92);
  color: #ffffff;
  padding: 1px 4px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  white-space: nowrap;
  font-size: 8px;
  line-height: 11px;
}
.sl-disc-name {
  font-weight: 700;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sl-disc-pos {
  font-weight: 700;
  font-size: 7px;
  padding: 0 2px;
}
.sl-disc-ovr {
  color: var(--rail-priority);
  font-family: var(--mono);
  font-size: 7px;
}

/* Position badge colors */
.sl-pos-gk .sl-disc-body { border-color: #f59e0b; }
.sl-pos-gk .sl-disc-pos, .sl-pos-gk.sl-squad-pos, .sl-pos-gk .sl-xi-pos { background: #f59e0b; color: #000; }
.sl-pos-df .sl-disc-body { border-color: #06b6d4; }
.sl-pos-df .sl-disc-pos, .sl-pos-df.sl-squad-pos, .sl-pos-df .sl-xi-pos { background: #06b6d4; color: #000; }
.sl-pos-mf .sl-disc-body { border-color: #10b981; }
.sl-pos-mf .sl-disc-pos, .sl-pos-mf.sl-squad-pos, .sl-pos-mf .sl-xi-pos { background: #10b981; color: #000; }
.sl-pos-fw .sl-disc-body { border-color: #f43f5e; }
.sl-pos-fw .sl-disc-pos, .sl-pos-fw.sl-squad-pos, .sl-pos-fw .sl-xi-pos { background: #f43f5e; color: #fff; }

.sl-xi-disc.is-picked .sl-disc-body {
  transform: scale(1.2);
  box-shadow: 0 0 0 3px #ffffff, 0 4px 12px rgba(0,0,0,0.9);
}
.sl-xi-disc.is-over .sl-disc-body {
  transform: scale(1.25);
  border-color: var(--rail-world);
}

/* Bench items */
.sl-xi-bench-man {
  position: relative;
  display: grid;
  grid-template-columns: 24px 18px 24px 1fr 22px;
  gap: 2px var(--s1);
  align-items: center;
  padding: 3px var(--s1);
  background: var(--ground-strict);
  box-shadow: var(--hair);
  cursor: grab;
  font-size: 9px;
  line-height: 12px;
}
.sl-xi-bench-man .sl-xi-face {
  width: 24px;
  height: 24px;
}
.sl-xi-bench-man .sl-xi-pos {
  font-weight: 700;
  padding: 1px 2px;
  text-align: center;
  font-size: 8px;
}
.sl-xi-bench-man.is-picked {
  background: var(--ink);
  color: var(--reverse-ink);
}
.sl-xi-bench-man.is-over {
  background: var(--rail);
  color: var(--reverse-ink);
}

.sl-xi-bars { grid-column: 1 / -1; display: grid; gap: 1px; }
.sl-xi-bars b { display: grid; grid-template-columns: 18px 1fr 14px; gap: 2px; align-items: center; font-weight: 400; }
.sl-xi-bars i { font-style: normal; color: var(--dim); font-size: 8px; }
.sl-xi-bars u { height: 2px; background: var(--rail); text-decoration: none; display: block; }
.sl-xi-bars s { text-decoration: none; color: var(--dim); font-size: 8px; text-align: right; }
.sl-xi-bench { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--s2); }
.sl-xi-bench-list { min-height: 0; overflow: auto; display: grid; gap: var(--s1); align-content: start; }
.sl-sheet-style { grid-row: 3; display: grid; grid-template-columns: auto 1fr; gap: var(--s3); align-items: center; padding-bottom: var(--s2); }
.sl-styles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--rule); box-shadow: var(--hair); }
.sl-styles button { display: grid; gap: 2px; text-align: left; padding: var(--s1) var(--s2); background: var(--ground-strict); box-shadow: none; text-transform: none; }
.sl-styles button b { font-family: var(--arcade); font-size: 9px; color: var(--rail); }
.sl-styles button.is-on b { color: var(--reverse-ink); }
.sl-styles button span { font-size: 9px; line-height: 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ── Tournaments ──────────────────────────────────────────────────────── */
.sl-tournament { grid-row: 2; min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr) 280px; gap: var(--s3); }
.sl-tournament-next, .sl-tournament-groups, .sl-tournament-bracket { min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: var(--s2); align-content: start; }
.sl-tournament-groups, .sl-tournament-bracket { overflow: auto; }
.sl-next { display: grid; gap: var(--s2); align-content: start; padding: var(--s3); box-shadow: var(--hair); }
.sl-next h2 { font-family: var(--arcade); font-size: var(--t-micro); background: none; color: var(--ink); padding: 0; }
.sl-meta { margin: 0; font-size: var(--t-micro); line-height: var(--lh-micro); color: var(--dim); letter-spacing: .1em; }
.sl-read { margin: 0; font-size: var(--t-micro); line-height: var(--lh-micro); color: var(--dim); letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-read b { color: var(--ink); font-weight: 700; }
.sl-group { margin-bottom: var(--s2); box-shadow: var(--hair); padding: var(--s2); }
.sl-group summary { font-family: var(--arcade); font-size: 9px; cursor: pointer; }
.sl-group-table { width: 100%; border-collapse: collapse; font-size: 9px; margin-top: var(--s1); }
.sl-group-table th, .sl-group-table td { padding: 1px var(--s1); text-align: center; }
.sl-group-table th { color: var(--dim); font-weight: 400; }
.sl-group-table td:nth-child(2) { text-align: left; }
.sl-group-table tr.is-you td { background: var(--ink); color: var(--reverse-ink); }
.sl-fixtures { list-style: none; margin: var(--s1) 0 0; padding: 0; font-size: 9px; display: grid; gap: 1px; }
.sl-fixtures li.is-next { background: var(--rail); color: var(--reverse-ink); }
.sl-bracket { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s1); }
.sl-bracket-round { box-shadow: var(--hair); padding: var(--s1); }
.sl-bracket-round h3 { margin: 0 0 var(--s1); font-family: var(--arcade); font-size: 8px; }
.sl-bracket-round ul { list-style: none; margin: 0; padding: 0; font-size: 9px; display: grid; gap: 1px; }
.sl-bracket-round li.is-empty { color: var(--dim); }

/* ── Gods XI ──────────────────────────────────────────────────────────── */
.sl-legend { grid-row: 2; min-height: 0; display: grid; grid-template-columns: 240px minmax(0, 1fr) 240px; gap: var(--s3); }
.sl-legend > div { min-height: 0; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: var(--s2); box-shadow: var(--hair); padding: var(--s2); }
.sl-legend ol { list-style: none; margin: 0; padding: 0; min-height: 0; overflow: auto; font-size: var(--t-micro); line-height: var(--lh-micro); display: grid; gap: 1px; align-content: start; }
.sl-legend li { display: flex; align-items: center; gap: var(--s1); padding: 1px var(--s1); cursor: pointer; }
.sl-legend li.is-picked { background: var(--ink); color: var(--reverse-ink); }
.sl-legend li.is-bench { color: var(--dim); }
.sl-legend li b { color: var(--rail); width: 20px; }
.sl-legend li.is-picked b { color: var(--reverse-ink); }
.sl-legend li small { margin-left: auto; font-size: 9px; color: var(--dim); }
.sl-legend li.is-picked small { color: rgba(255, 254, 250, .7); }
.sl-legend input { width: 100%; font: inherit; font-size: var(--t-micro); padding: var(--s1); background: var(--ground-strict); box-shadow: var(--hair); border: 0; }
.sl-legend-opponent .sl-grid { grid-template-columns: repeat(6, 1fr); }
.sl-legend-after { justify-content: center; }

/* ── Foot ─────────────────────────────────────────────────────────────── */
.sl-foot {
  grid-row: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: var(--s2) var(--s6);
  background: var(--ink);
  color: var(--reverse-ink);
  font-size: 9px;
  letter-spacing: .16em;
}
body > .sl-foot span:last-child { opacity: .5; }
#app .sl-foot { grid-row: 3; background: none; color: inherit; padding: var(--s2) 0 var(--s3); }

.sl-loading { color: var(--dim); font-size: var(--t-micro); letter-spacing: .16em; }
.sl-prov, .sl-ok, .sl-warn, .sl-ev { font-size: 9px; letter-spacing: .1em; color: var(--dim); font-style: normal; }
.sl-ok { color: var(--rail-world); }
.sl-warn { color: var(--rail-priority); }

/* Rails by domain: one per screen, set on the shell. */
[data-rail="career"] { --rail: var(--rail-career); }
[data-rail="world"] { --rail: var(--rail-world); }
[data-rail="gods"] { --rail: var(--rail-gods); }
[data-rail="watch"] { --rail: var(--rail-watch); }

@media (max-width: 1100px) {
  .sl-tournament, .sl-legend { grid-template-columns: minmax(0, 1fr); }
  .sl-grid { grid-template-columns: repeat(7, 1fr); }
  .sl-sheet { grid-template-columns: minmax(0, 1fr); }
}
