/* BE Fit Club · css/setup.css · OWNER: Round 5 · Console builder · ref.setup + setup sheets (.scr-ref-setup, .sh-setup-*)
   Tokens only. Team colour always comes from Teams (.t-<id> sets --tc) and sits next to the team word.
   Light: the team wash on ticked squad rows (.wash) and the team-tinted title bar of the "+ From" sheet (.lit). Everything else flat. */

/* ---------------------------------------------------------------- Who's here? */
.scr-ref-setup .su-chips { margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
@media (min-width: 960px) { .scr-ref-setup .su-chips { margin: 0; padding: 0; } }
.scr-ref-setup .su-none,
.sh-setup .su-none { color: var(--ink3); font-size: var(--fs-body); padding: var(--sp-4) 2px; }
.scr-ref-setup .rows .r.tall .meta .pos { line-height: 1.6; }
.scr-ref-setup .su-foot .su-kl { margin-top: var(--sp-4); }

/* Not ready yet: a quiet line at the end of the page (no bar, no button) */
.scr-ref-setup .su-hint { margin-top: var(--sp-4); padding: var(--sp-3) 2px; text-align: center; color: var(--ink3); font-size: 13.5px; }

/* ---------------------------------------------------------------- the kick-off bar (5 Nov)
   Once both sides have players: Small poles | Big poles, the football + whistle and "Hold to kick off · n players",
   pinned to the bottom of the screen just above the tabs (and the phone's safe area). It is sticky, not fixed: it
   keeps its own place at the end of the page, so it never covers the last squad rows or the keepers. The screen is
   a column at least the window's height, so on a short list the bar still sits on the bottom edge. */
body:has(.scr-ref-setup > .su-pin:not([hidden])) .screen-host { display: flex; flex-direction: column; padding-bottom: calc(var(--h-nav) + var(--safe-b)); }
body.no-nav:has(.scr-ref-setup > .su-pin:not([hidden])) .screen-host { padding-bottom: var(--safe-b); }
body:has(.scr-ref-setup > .su-pin:not([hidden])) .scr-ref-setup { flex: 1 0 auto; display: flex; flex-direction: column; }
.scr-ref-setup > .su-pin {
  position: sticky; bottom: calc(var(--h-nav) + var(--safe-b)); z-index: 35;
  margin: auto calc(-1 * var(--gutter)) 0; padding: 10px var(--gutter) 12px;
  background: var(--bg); border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
body.no-nav .scr-ref-setup > .su-pin { bottom: var(--safe-b); padding-bottom: calc(12px + var(--safe-b)); }
.scr-ref-setup .su-foot { scroll-margin-top: calc(var(--h-header) + 12px); }
.scr-ref-setup:has(> .su-pin:not([hidden])) .su-foot { padding-bottom: var(--sp-4); }   /* 16 px between the page and the bar */
.scr-ref-setup .su-pin-go { display: flex; align-items: center; gap: 10px; }
.scr-ref-setup .su-pic { width: 44px; height: 44px; flex: none; }
.su-pic .ball { fill: none; stroke: var(--ink); stroke-width: 2; }
.su-pic .patch { fill: var(--ink); }
.su-pic .seam { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.su-pic .wh { fill: var(--ink); stroke: var(--bg); stroke-width: 2.5; paint-order: stroke; stroke-linejoin: round; }
.su-pic .whh { fill: var(--bg); }
/* the hold button: the app's primary (ink fill); a darker band fills it left to right over 1.5 s */
.scr-ref-setup .hold.su-kick { flex: 1 1 auto; min-width: 0; height: 56px; background: var(--ink); color: var(--on-ink); box-shadow: none; font-weight: 700; font-size: 15px; }
.scr-ref-setup .hold.su-kick .fill { background: color-mix(in srgb, var(--on-ink) 26%, transparent); }
.scr-ref-setup .hold.su-kick.done .fill { width: 100%; }
.scr-ref-setup .hold.su-kick.is-saving { opacity: 1; }
.scr-ref-setup .hold.su-kick .hl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
/* big poles with a side still to pick: the way to the keepers (they stay on the page, above the bar) */
.scr-ref-setup .su-pk { min-height: var(--h-target); border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-weight: 650; font-size: 14px; color: var(--ink); background: var(--s1); box-shadow: inset 0 0 0 1.5px var(--ink); }
.scr-ref-setup .su-pk:active { transform: scale(.98); }
.scr-ref-setup .su-pk.is-go { flex: 1 1 auto; min-width: 0; height: 56px; font-size: 15px; font-weight: 700; color: var(--on-ink); background: var(--ink); box-shadow: none; }   /* in place of "Hold to kick off" */
/* the Undo bar and toasts float above the kick-off bar, never over "Hold to kick off" */
body:has(.scr-ref-setup > .su-pin:not([hidden])) { --float-bottom: calc(var(--h-nav) + var(--safe-b) + 142px); }
body.no-nav:has(.scr-ref-setup > .su-pin:not([hidden])) { --float-bottom: calc(var(--safe-b) + 154px); }
@media (min-width: 960px) {
  body:has(.scr-ref-setup > .su-pin:not([hidden])) .screen-host { padding-bottom: 0; }
  .scr-ref-setup > .su-pin, body.no-nav .scr-ref-setup > .su-pin { bottom: 0; padding-bottom: 16px; }
  body:has(.scr-ref-setup > .su-pin:not([hidden])) { --float-bottom: 158px; }
}

/* ---------------------------------------------------------------- person rows with a side button each */
.scr-ref-setup .su-pr, .sh-setup .su-pr { padding-right: 8px; }
.scr-ref-setup .su-tbs, .sh-setup .su-tbs { gap: 6px; }
.scr-ref-setup .su-tb, .sh-setup .su-tb {
  height: var(--h-target); min-width: 64px; padding: 0 12px; border-radius: var(--r-chip);
  background: var(--s2); color: var(--ink); font-weight: 600; font-size: 13.5px; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.scr-ref-setup .su-tb:active, .sh-setup .su-tb:active { background: var(--s3); transform: scale(.98); }
.scr-ref-setup .su-tb.is-saving, .sh-setup .su-tb.is-saving { opacity: 1; background: var(--ink); color: var(--on-ink); box-shadow: none; min-width: 88px; }
.scr-ref-setup .su-on .end, .sh-setup .su-on .end { padding-right: 6px; }

/* "Someone new": + Green | + Red (any number of teams) */
.scr-ref-setup .su-newg, .sh-setup .su-newg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.scr-ref-setup .su-newg.n3, .sh-setup .su-newg.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scr-ref-setup .su-newg.n1, .sh-setup .su-newg.n1 { grid-template-columns: minmax(0, 1fr); }
.scr-ref-setup .su-new, .sh-setup .su-new {
  height: 56px; border-radius: var(--r-btn); background: var(--s1); color: var(--ink);
  font-weight: 600; font-size: 15px; text-align: center; box-shadow: var(--ring); position: relative; overflow: hidden;
}
/* team buttons: a flat team tint + team ring, always with the team word (Blue-ready: --tc comes from Teams) */
.scr-ref-setup .su-tb, .sh-setup .su-tb, .scr-ref-setup .su-new, .sh-setup .su-new, .sh-setup .su-mrow .mv2 {
  background: color-mix(in srgb, var(--tc, var(--s3)) var(--tint-soft), var(--s2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc, var(--s3)) var(--tint-ring), transparent);
}
.scr-ref-setup .su-new:active, .sh-setup .su-new:active { background: var(--s3); transform: scale(.98); }
.scr-ref-setup .su-new.is-saving, .sh-setup .su-new.is-saving { opacity: 1; background: var(--ink); color: var(--on-ink); box-shadow: none; }

/* ---------------------------------------------------------------- keeper picks (3 across, 64 px) */
.scr-ref-setup .su-kl, .sh-setup .su-kl { margin-top: var(--sp-4); }
.sh-setup .su-kl:first-child { margin-top: 0; }
.scr-ref-setup .su-k .ptile, .sh-setup .su-k .ptile { padding: 8px 12px; }
.scr-ref-setup .su-k .ptile:not(.sel) { background: var(--s1); box-shadow: var(--ring); }
.scr-ref-setup .su-some .pt-name, .sh-setup .su-some .pt-name { font-size: 13.5px; font-weight: 600; }
/* "Other ›" (any of tonight's players on that side); with no known keeper it is the main, full-width choice */
.scr-ref-setup .su-kother.is-main, .sh-setup .su-kother.is-main { width: 100%; min-height: 64px; border-radius: var(--r-btn); padding: 10px 14px; text-align: left;
  display: flex; align-items: center; background: var(--s1); box-shadow: inset 0 0 0 1.5px var(--ink); }
.sh-setup .su-kother.is-main { background: var(--s2); }
.su-kother.is-main .grow { display: flex; flex-direction: column; gap: 2px; }
.su-kother.is-main .nm { font-weight: 700; font-size: 15px; }
.su-kother.is-main .meta { font-size: 12.5px; color: var(--ink2); }
.su-kother:active { transform: scale(.98); }
.sh-setup-kother .su-korow.chg { box-shadow: inset 3px 0 0 var(--ink); }
.sh-setup-kother .sheet-f .btn { flex: none; }

/* ---------------------------------------------------------------- sheets */
.sh-setup .su-res { padding-bottom: 2px; }
.sh-setup .su-done {
  min-height: var(--h-target); min-width: var(--h-target); padding: 0 4px;
  font: 500 14px var(--font); color: var(--ink2);
}
.sh-setup-teams h4 { margin-bottom: var(--sp-2); }
.sh-setup .su-mrow { padding-right: 8px; }
.sh-setup .su-mrow .end { gap: 6px; }
.sh-setup .su-mrow .mv2.is-saving { opacity: 1; background: var(--ink); color: var(--on-ink); box-shadow: none; }
.sh-setup .su-mrow .tagm { background: var(--s3); }
.sh-setup-player .grid2, .sh-setup-player .grid3 { gap: var(--sp-2); }

/* ---------------------------------------------------------------- round 5: Tonight (the hero), who plays, team tabs */
  display: inline-flex; align-items: center; gap: 7px; background: var(--s1); box-shadow: inset 0 0 0 1px var(--s3); }
/* the active team tab is tinted in its team colour (flat) */
.scr-ref-setup .seg > button.team.on, .sh-setup .seg > button.team.on { background: color-mix(in srgb, var(--tc) 22%, var(--s2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) var(--tint-ring), transparent); }
.scr-ref-setup .rows, .sh-setup .rows { box-shadow: var(--edge); }

/* ---------------------------------------------------------------- ROUND 6 · the lineup picker */
/* tabs: one 56 px tab per team tonight, team word in team colour, "n of 10" under it;
   the open tab gets a 16% team fill and a 3 px team underline */
.scr-ref-setup .su-tabs { padding: 0; gap: var(--sp-2); background: transparent; box-shadow: none; }
.scr-ref-setup .su-tabs > .su-tab { height: 56px; min-height: 56px; flex: 1 1 0; flex-direction: column; gap: 2px; border-radius: 12px; background: var(--s1); box-shadow: var(--edge); }
.scr-ref-setup .su-tabs > .su-tab::before { display: none; }
.scr-ref-setup .su-tab .su-tw { font-size: 15px; font-weight: 700; color: var(--tc); }
[data-theme="light"] .scr-ref-setup .su-tab .su-tw { color: color-mix(in srgb, var(--tc) 80%, #000); }
.scr-ref-setup .su-tab .n { font-family: var(--font); font-size: 12.5px; color: var(--ink2); opacity: 1; font-variant-numeric: tabular-nums; }
.scr-ref-setup .su-tabs > .su-tab.on { background: color-mix(in srgb, var(--tc) 16%, var(--s1)); box-shadow: inset 0 -3px 0 var(--tc), inset 0 0 0 1px color-mix(in srgb, var(--tc) 30%, transparent); }

/* action row: "+ From Red" (team-tinted, flex 1) · "+ New person" (flex 1) · search 48 × 48 */
.scr-ref-setup .su-acts { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.scr-ref-setup .su-from, .scr-ref-setup .su-newp { flex: 1 1 0; min-width: 0; height: 48px; border-radius: 12px; font-weight: 650; font-size: 14px; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 8px; background: var(--s1); box-shadow: var(--edge); }
.scr-ref-setup .su-from { background: color-mix(in srgb, var(--tc, var(--s3)) 14%, var(--s1)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc, var(--s3)) 40%, transparent); }
.scr-ref-setup .su-from.t-none, .scr-ref-setup .su-from:not([class*="t-"]) { background: var(--s1); box-shadow: var(--edge); }
.scr-ref-setup .su-find { width: 48px; height: 48px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--s1); box-shadow: var(--edge); color: var(--ink2); }
.scr-ref-setup .su-find svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.scr-ref-setup .su-from:active, .scr-ref-setup .su-newp:active, .scr-ref-setup .su-find:active { transform: scale(.98); filter: brightness(1.1); }

/* squad rows: 60 px, avatar, name, "POS · n of last 8", a 28 px tick; ticked = team wash + 3 px edge + filled tick */
.scr-ref-setup .su-sqlbl, .sh-setup .su-sqlbl { margin-top: var(--sp-4); }
.scr-ref-setup .su-squad .r.su-sq, .sh-setup .su-squad .r.su-sq { min-height: 60px; gap: 12px; padding: 8px 14px; }
.su-sq .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.su-sq .nm { font-weight: 650; overflow-wrap: anywhere; }
.su-sq .meta { font-size: 12.5px; color: var(--ink3); }
.su-sq .av { flex: none; }
.su-sq.on { background: linear-gradient(90deg, color-mix(in srgb, var(--tc) 18%, transparent), color-mix(in srgb, var(--tc) 5%, transparent)); box-shadow: inset 3px 0 0 var(--tc); }
.su-tick { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--s3); font-size: 14px; font-weight: 800; color: var(--on-ink); }
.su-tick.on { background: var(--tc); box-shadow: none; color: #0B0D10; }
.scr-ref-setup .su-more, .sh-setup .su-more { width: 100%; min-height: 48px; margin-top: var(--sp-2); font-size: 13.5px; color: var(--ink2); font-weight: 550; border-radius: 12px; }
.scr-ref-setup .su-more:active, .sh-setup .su-more:active { background: var(--s2); }

/* the ready state: a team sheet card per side (header 18% tint with the count, keeper first) */
.scr-ref-setup .su-tslbl { margin-top: var(--sp-6); }
.scr-ref-setup .su-ts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.scr-ref-setup .su-ts.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scr-ref-setup .su-tsc { background: var(--s1); border-radius: 14px; overflow: hidden; box-shadow: var(--edge); min-width: 0; }
.scr-ref-setup .su-tsh { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  background: color-mix(in srgb, var(--tc) 18%, var(--s1)); }
.scr-ref-setup .su-tsh b { font-size: 15px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.scr-ref-setup .su-tsr { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 48px; padding: 7px 12px; text-align: left; border-top: 1px solid var(--line); }
.scr-ref-setup .su-tsr:first-of-type { border-top: 0; }
.scr-ref-setup .su-tsr .nm { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.scr-ref-setup .su-tsr .pos { font-size: 12px; }
.scr-ref-setup .su-tsr.gk { background: color-mix(in srgb, var(--tc) 8%, transparent); }
.scr-ref-setup .su-tsr:active { background: var(--s2); }

/* "+ From Red" sheet: team-tinted title bar ("Add to Green tonight"), a tab per other team */
.sh-setup-from .sheet-h.su-fbar { margin: 0 calc(-1 * var(--gutter)); padding-left: var(--gutter); padding-right: var(--gutter); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 24%, var(--sheet)), var(--sheet)); }
.sh-setup-from .sheet-h.su-fbar .sheet-title { color: var(--tc); font-weight: 700; }
[data-theme="light"] .sh-setup-from .sheet-h.su-fbar .sheet-title { color: color-mix(in srgb, var(--tc) 85%, #000); }
.sh-setup-from .su-ftabs > button { min-height: 48px; }
