/* Squad builder (resources/views/pages/builder/main/builder.php): summary header, toolbar, vertical pitch, subs and
   reserves, bottom sheets (centred dialogs on desktop). Page bar: page-bar.css.
   Plain CSS served as-is (not part of the gulp site.min.css bundle); the old _builder.scss rules are scoped to
   .site-builder-page, which this page no longer uses. */

.sb,
.sb-sheet-wrap {
  --sb-glass: linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
  --sb-line: rgba(255, 255, 255, 0.1);
  --sb-fg-2: rgba(255, 255, 255, 0.78);
  --sb-fg-3: rgba(255, 255, 255, 0.5);
  --sb-accent: #5cf8db;
  --sb-ink: #0b1d1a;
  --sb-display: "DINPro-Cond-Bold", "DINPro-Cond", "Barlow Condensed", "Arial Narrow", sans-serif;
  --sb-t1: rgb(58, 200, 66);
  --sb-t2: rgb(142, 174, 78);
  --sb-t3: rgb(187, 170, 7);
  --sb-t4: rgb(209, 28, 66);
  --sb-spot: 58px;
  color: #fff;
}
.sb {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  padding-bottom: 40px;
}
.sb > * {
  min-width: 0;
}
.sb a:hover {
  text-decoration: none;
}
.sb-glass {
  background: var(--sb-glass);
  border: 1px solid var(--sb-line);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.sb-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sb-fg-3);
}
.sb .t1, .sb-sheet-wrap .t1 { color: var(--sb-t1); }
.sb .t2, .sb-sheet-wrap .t2 { color: var(--sb-t2); }
.sb .t3, .sb-sheet-wrap .t3 { color: var(--sb-t3); }
.sb .t4, .sb-sheet-wrap .t4 { color: var(--sb-t4); }
.sb-pot {
  color: var(--sb-accent);
}

/* header: title + summary tiles */
/* title outside a box, like the teams / leagues pages (.tp-head); the page bar (breadcrumb) follows */
.sb-head {
  min-width: 0;
}
.sb-head h1 {
  margin: 0;
  font-family: var(--sb-display);
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  overflow-wrap: anywhere; /* long squad names wrap */
  color: #fff;
}
.sb-head h1 small {
  display: block;
  margin-bottom: 4px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--sb-fg-3);
}
/* squad information (.sb-info): a row of tiles above the pitch below 1200px, the left column from 1200px (responsive) */
.sb-info {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px 18px;
  padding: 10px 12px;
}
.sb-info-group {
  display: flex;
  align-items: center;
  min-width: 0;
}
.sb-info-h {
  display: none;
  margin: 0 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sb-fg-3);
}
.sb-stats {
  display: flex;
  gap: 6px;
}
.sb-stat {
  display: grid;
  gap: 2px;
  min-width: 64px;
  padding: 8px 12px;
  text-align: center;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--sb-line);
  border-radius: 10px;
}
.sb-stat b {
  font-family: var(--sb-display);
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* OVR by line: label, bar (column only), average */
.sb-line-list {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sb-line {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 52px;
  padding: 8px 8px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--sb-line);
  border-radius: 10px;
}
.sb-line b {
  font-family: var(--sb-display);
  font-size: 22px;
  line-height: 1;
  color: var(--sb-fg-3);
  font-variant-numeric: tabular-nums;
}
.sb-line-bar {
  display: none;
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
}
.sb-line-bar > i {
  display: block;
  width: 0;
  height: 100%;
  background: currentColor;
  border-radius: 3px;
  transition: width 0.25s ease-out;
}
/* position fit counts: always shown here (the pitch legend only explains the marks) */
.sb-fit-sum {
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  color: var(--sb-fg-2);
}
.sb-fit-sum span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sb-fit-sum b,
.sb-fit-sum .sb-fit-out b {
  display: inline-block;
  min-width: 22px;
  margin-left: auto;
  padding: 1px 6px;
  font-size: 12px;
  text-align: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9px;
}
.sb-fit-sum .sb-fit-out.has-out b {
  background: #ff4d6d;
}

/* controls (formation + card numbers, top of the left column) and actions (clear / save, under the information) */
.sb-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sb-controls .sb-formation-btn {
  flex: 1 1 auto;
  justify-content: flex-start;
  height: 40px;
}
.sb-controls .sb-formation-btn .sb-caret {
  margin-left: auto;
}
.sb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sb-actions .sb-btn {
  flex: 1 1 0;
  height: 42px;
}
/* Save before the XI is full: a plain button (still saves); full XI: .sb-primary */
.sb-save:not(.sb-primary) i {
  color: var(--sb-fg-2);
}
.sb-save-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--sb-fg-3);
}
.sb-save-hint[hidden] {
  display: none;
}
.sb-save-hint i {
  margin-right: 4px;
  color: var(--sb-accent);
}
.sb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.sb-btn:hover,
.sb-btn:focus-visible {
  color: #fff;
  background: rgba(92, 248, 219, 0.12);
  border-color: var(--sb-accent);
}
.sb-btn[disabled] {
  cursor: default;
  opacity: 1;
}
.sb-btn[disabled]:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
}
.sb-btn i {
  color: var(--sb-accent);
}
.sb-btn .sb-caret {
  font-size: 10px;
  color: var(--sb-fg-3);
}
.sb-primary {
  color: var(--sb-ink);
  background: var(--sb-accent);
  border-color: var(--sb-accent);
}
.sb-primary i {
  color: inherit;
}
.sb-primary:hover,
.sb-primary:focus-visible {
  color: var(--sb-ink);
  background: var(--sb-accent);
  filter: brightness(1.08);
}
.sb-primary[disabled] {
  opacity: 0.6;
}
.sb-ghost {
  background: transparent;
}
.sb-ghost i {
  color: var(--sb-fg-2);
}
.sb-formation-btn .selected-formation {
  font-weight: 700;
}
/* show / hide OVR and POT on the cards: a quiet overlay in the pitch's top left corner; eye = shown, eye-slash = hidden */
.sb-seg {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 8px;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.sb-seg:hover,
.sb-seg:focus-within {
  opacity: 1;
}
.sb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.85);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.sb-chip:hover {
  background: rgba(255, 255, 255, 0.1);
}
.sb-chip i {
  font-size: 10px;
}
.sb-chip[aria-pressed="false"] {
  color: rgba(255, 255, 255, 0.45);
  text-decoration: line-through;
}
.sb-chip[aria-pressed="false"] i::before {
  content: "\f070"; /* eye-slash */
}
.sb-ad:empty {
  display: none;
}

/* move mode */
.sb-move-bar {
  position: sticky;
  top: 70px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  font-size: 13.5px;
  color: var(--sb-ink);
  background: var(--sb-accent);
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.sb-move-bar[hidden] {
  display: none;
}
.sb-move-bar .sb-btn {
  height: 32px;
  color: var(--sb-ink);
  border-color: rgba(11, 29, 26, 0.35);
}
.sb-move-bar .sb-btn:hover {
  background: rgba(11, 29, 26, 0.1);
}

/* main area. Below 1200px the column wrappers dissolve and the parts sit in grid areas (992-1199px: controls | actions,
   the information row, pitch | side; phones: one column in that order). 1200px+: three columns (responsive) */
.sb-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas:
    "controls actions"
    "info info"
    "pitch side";
  gap: 14px;
  align-items: start;
}
.sb-col {
  display: contents;
}
.sb-controls { grid-area: controls; }
.sb-actions { grid-area: actions; }
.sb-info { grid-area: info; }
.sb-pitch-card { grid-area: pitch; }
.sb-side { grid-area: side; }
.sb-pitch-card {
  padding: 12px;
}
.sb-pitch {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  aspect-ratio: 68 / 92;
  overflow: hidden;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 9.09%, transparent 9.09% 18.18%),
    radial-gradient(120% 80% at 50% 0%, #2f9a52 0%, #1f7a3e 55%, #155e2f 100%);
  border-radius: 12px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.14), inset 0 0 60px rgba(0, 0, 0, 0.35);
}
.sb-lines {
  position: absolute;
  inset: 3.5%;
  pointer-events: none;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
}
.sb-lines i {
  position: absolute;
  display: block;
  border: 2px solid rgba(255, 255, 255, 0.28);
}
.sb-lines .sb-half {
  top: 50%;
  left: 0;
  right: 0;
  border-width: 2px 0 0;
}
.sb-lines .sb-circle {
  top: 50%;
  left: 50%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.sb-lines .sb-box {
  left: 22%;
  right: 22%;
  height: 14%;
}
.sb-lines .sb-box-top {
  top: -2px;
  border-top: 0;
}
.sb-lines .sb-box-bottom {
  bottom: -2px;
  border-bottom: 0;
}
.formation-holder {
  position: absolute;
  inset: 0;
}

/* spots (pitch + bench) */
.player-holder.sb-spot {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 84px;
  margin: 0; /* the old site.min.css builder rules shift .player-holder on phones */
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
.formation-holder .player-holder.sb-spot {
  position: absolute;
  transform: translate(-50%, -38%);
}
.sb-spot .ph-plus {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  width: var(--sb-spot);
  height: var(--sb-spot);
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.28);
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
}
.sb-edit .sb-spot:hover .ph-plus,
.sb-spot:focus-visible .ph-plus {
  background: rgba(92, 248, 219, 0.2);
  border-color: var(--sb-accent);
  transform: scale(1.06);
}
.sb-spot.filled .ph-plus {
  visibility: hidden;
}
.sb-spot .ph-inner {
  grid-area: 1 / 1;
  position: relative;
  width: var(--sb-spot);
  height: var(--sb-spot);
}
.sb-spot .ph-inner:empty {
  pointer-events: none;
}
.sb-spot .ph-position {
  padding: 1px 7px;
  font-family: var(--sb-display);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 6px;
}
.sb-spot.filled .ph-position {
  color: var(--sb-accent);
}

/* filled card: face circle, club badge, OVR / POT bubbles, name */
.sb-face {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 30%, #3a3478, #1b1450);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}
.sb-face .ph-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 50%;
}
/* club crest: a dark chip so the dark-background crest variant (white Spurs / Juventus) reads; the thin light outline
   keeps a dark crest visible when the dark variant is missing and the normal crest is used */
.sb-face .ph-card-club {
  position: absolute;
  right: -7px;
  bottom: -5px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: #15113f;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.sb-face .ph-card-club:empty {
  display: none;
}
.sb-face .ph-card-club-img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  filter: drop-shadow(0 0 0.6px rgba(255, 255, 255, 0.8));
}
.sb-r,
.sb-p {
  position: absolute;
  top: -6px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 20px;
  padding: 0 4px;
  font-family: var(--sb-display);
  font-size: 13px;
  line-height: 1;
  background: #120f3a;
  border: 1px solid currentColor;
  border-radius: 10px;
}
.sb-r {
  left: -10px;
}
.sb-p {
  right: -10px;
  color: var(--sb-accent) !important;
}
.sb-r[hidden],
.sb-p[hidden] {
  display: none;
}
.sb-spot .ph-card-name {
  box-sizing: border-box;
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  z-index: 1;
  max-width: 84px;
  overflow: hidden;
  padding: 1px 6px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #fff;
  background: rgba(10, 8, 40, 0.82);
  border-radius: 6px;
  transform: translateX(-50%);
}
.sb-spot.filled .ph-position {
  margin-top: 18px;
}
.sb-edit .sb-spot.filled:hover .sb-face {
  border-color: var(--sb-accent);
}
.ph-inner[draggable="true"] {
  cursor: grab;
}

/* move / drag feedback */
.sb-moving .sb-spot .ph-plus {
  border-color: var(--sb-accent);
  border-style: solid;
}
.sb-spot.sb-moving-src .sb-face {
  border-color: var(--sb-accent);
  box-shadow: 0 0 0 4px rgba(92, 248, 219, 0.35);
}
.sb-spot.drop-hover .ph-plus,
.sb-spot.drop-hover .sb-face {
  border-color: var(--sb-accent);
  transform: scale(1.08);
}

/* position fit (starting XI): ring colour; green one of his positions, red not his (+ a badge) */
.sb-fit-badge {
  display: none;
}
.sb-spot.fit-main .sb-face {
  border-color: var(--sb-t1);
  box-shadow: 0 0 0 2px rgba(58, 200, 66, 0.35), 0 6px 14px rgba(0, 0, 0, 0.4);
}
.sb-spot.fit-out .sb-face {
  border-color: #ff4d6d;
  box-shadow: 0 0 0 3px rgba(255, 77, 109, 0.4), 0 6px 14px rgba(0, 0, 0, 0.4);
}
.sb-spot.fit-out .sb-fit-badge {
  position: absolute;
  bottom: -4px;
  left: -6px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free";
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  border: 2px solid #120f3a;
  border-radius: 50%;
}
.sb-spot.fit-out .sb-fit-badge {
  color: #fff;
  background: #ff4d6d;
}
.sb-spot.fit-out .sb-fit-badge::before {
  content: "!";
  font-family: var(--sb-display);
  font-size: 13px;
}
.sb-spot.fit-main .ph-position { color: var(--sb-t1); }
.sb-spot.fit-out .ph-position { color: #fff; background: rgba(255, 77, 109, 0.85); }

/* the spot's role: short name after the position; + / ++ badge where the out-of-position "!" sits */
.sb-spot .ph-role {
  margin-left: 4px;
  font-size: 10px;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.75);
}
.sb-spot.role-1 .sb-fit-badge,
.sb-spot.role-2 .sb-fit-badge {
  position: absolute;
  bottom: -4px;
  left: -6px;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  font-family: var(--sb-display);
  font-size: 12px;
  font-style: normal;
  line-height: 1;
  color: #0b1d1a;
  background: var(--sb-t1);
  border: 2px solid #120f3a;
  border-radius: 9px;
}
.sb-spot.role-1 .sb-fit-badge {
  background: var(--sb-t2);
}
.sb-spot.role-1 .sb-fit-badge::before,
.sb-spot.role-2 .sb-fit-badge::before {
  content: attr(data-level);
}
.sb-role-key {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 16px;
  padding: 0 3px;
  font-family: var(--sb-display);
  font-size: 11px;
  font-style: normal;
  color: #0b1d1a;
  background: var(--sb-t1);
  border-radius: 8px;
}
.sb-role-key.sb-role-1 {
  background: var(--sb-t2);
}
.sb-fit-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--sb-fg-3);
}
.sb-fit-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sb-dot {
  width: 10px;
  height: 10px;
  border: 2px solid;
  border-radius: 50%;
}
.sb-dot.fit-main { border-color: var(--sb-t1); }
.sb-dot.fit-out { border-color: #ff4d6d; }
.sb-fit-out b {
  display: none;
  min-width: 18px;
  padding: 0 5px;
  font-size: 11px;
  text-align: center;
  color: #fff;
  background: #ff4d6d;
  border-radius: 9px;
}
.sb-fit-out.has-out {
  color: #ffb3c2;
}
.sb-fit-out.has-out b {
  display: inline-block;
}
.sb-pick-pos,
.sb-pick-fit {
  display: block;
  margin-top: 3px;
}
.sb-pick-fit {
  font-weight: 700;
}
.sb-pick-fit.fit-main { color: var(--sb-t1); }
.sb-pick-fit.fit-out { color: #ff4d6d; }
.sb-row-fit {
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--sb-t1);
  background: rgba(58, 200, 66, 0.14);
  border-radius: 8px;
}

/* side: subs and reserves */
.sb-side {
  display: grid;
  gap: 10px;
}
.sb-bench-card {
  padding: 14px 14px 16px;
}
.sb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 2px 10px;
}
.sb-card-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sb-fg-2);
}
.sb-bench + .sb-card-head {
  margin-top: 18px;
}
.sb-bench {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 22px 4px;
  --sb-spot: 48px;
}
.sb-bench .player-holder.sb-spot {
  width: auto;
  min-width: 0;
}
.sb-bench .ph-card-name {
  max-width: 76px;
}
.sb-hint {
  margin: 0 4px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--sb-fg-3);
}
.sb-hint i {
  margin-right: 4px;
  color: var(--sb-accent);
}

/* selected player panel (desktop, 992px+; phones and tablets use the player sheet) */
.sb-panel {
  padding: 12px 14px;
  transition: border-color 0.15s, background 0.15s;
}
.sb-panel.is-picked {
  padding: 14px;
  background: linear-gradient(160deg, rgba(92, 248, 219, 0.12) 0%, rgba(92, 248, 219, 0.03) 100%);
  border-color: rgba(92, 248, 219, 0.45);
}
.sb-panel-empty {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--sb-fg-3);
}
.sb-panel-empty[hidden],
.sb-panel-pick[hidden] {
  display: none;
}
.sb-panel-empty > i {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  font-size: 15px;
  color: var(--sb-accent);
  border: 1.5px dashed rgba(92, 248, 219, 0.45);
  border-radius: 50%;
}
.sb-panel-empty b {
  display: block;
  font-size: 13px;
  color: var(--sb-fg-2);
}
.sb-panel-pick {
  display: grid;
  gap: 12px;
  animation: sb-fade 0.15s ease-out;
}
.sb-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.sb-panel .sb-pick-face {
  width: 48px;
  height: 48px;
}
.sb-panel .sb-pick h3 {
  margin: 0 0 2px;
  font-family: var(--sb-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
}
.sb-panel .sb-pick-meta {
  font-size: 12px;
}
.sb-panel .sb-x {
  width: 30px;
  height: 30px;
  font-size: 13px;
}
.sb-panel .sb-pick-roles {
  margin-bottom: 0;
}
.sb-panel .sb-role-opt {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}
.sb-panel .sb-pick-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.sb-panel .sb-act {
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 54px;
  padding: 6px 4px;
  font-size: 11.5px;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
}
.sb-panel .sb-act i {
  width: auto;
  font-size: 15px;
}
/* the selected spot on the pitch / bench */
.sb-spot.sb-selected .sb-face {
  border-color: var(--sb-accent);
  box-shadow: 0 0 0 3px rgba(92, 248, 219, 0.35), 0 0 18px rgba(92, 248, 219, 0.45);
}
.sb-spot.sb-selected .ph-card-name {
  color: var(--sb-ink);
  background: var(--sb-accent);
}
@keyframes sb-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* view mode */
.sb-view .sb-spot:not(.filled) {
  cursor: default;
}
.sb-view .sb-spot:not(.filled) .ph-plus {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ---------- sheets ---------- */
body.sb-locked {
  overflow: hidden;
}
.sb-sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 1060;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sb-sheet-wrap[hidden] {
  display: none;
}
.sb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 28, 0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.sb-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 520px;
  max-height: min(680px, 88vh);
  padding: 16px;
  background: linear-gradient(160deg, #2a2766 0%, #1b1450 100%);
  border: 1px solid var(--sb-line);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.sb-sheet[hidden] {
  display: none;
}
.sb-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.sb-sheet-head h3 {
  margin: 0;
  font-family: var(--sb-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
}
.sb-sheet-pos {
  color: var(--sb-accent);
}
.sb-x {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 16px;
  color: var(--sb-fg-2);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--sb-line);
  border-radius: 50%;
  cursor: pointer;
}
.sb-x:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

/* search: the sheet keeps one height and the box keeps its place and size; results scroll under it */
.sb-sheet[data-sb-sheet="search"] {
  height: min(680px, 88vh);
}
.sb-sheet[data-sb-sheet="search"] > :not(.sb-results) {
  flex: none;
}
.sb-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  margin: 0;
  padding: 0 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--sb-line);
  border-radius: 12px;
}
.sb-search:focus-within {
  border-color: var(--sb-accent);
}
.sb-search i {
  color: var(--sb-fg-3);
}
.sb-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  font-size: 16px; /* 16px stops iOS zooming in */
  color: #fff;
  background: none;
  border: 0;
  outline: none;
}
.sb-search input::placeholder {
  color: var(--sb-fg-3);
}
.sb-results {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0 -6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  transition: opacity 0.15s;
}
/* scrolling lists (search results, formations): the site's thin accent scrollbar (as players-filters .fp-scroll) */
.sb-results,
.sb-forms {
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 248, 219, 0.45) transparent;
}
.sb-results::-webkit-scrollbar,
.sb-forms::-webkit-scrollbar {
  width: 8px;
}
.sb-results::-webkit-scrollbar-track,
.sb-forms::-webkit-scrollbar-track {
  margin: 8px 0;
  background: transparent;
}
.sb-results::-webkit-scrollbar-thumb,
.sb-forms::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: rgba(92, 248, 219, 0.35);
  background-clip: padding-box;
}
.sb-results::-webkit-scrollbar-thumb:hover,
.sb-forms::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 248, 219, 0.7);
  background-clip: padding-box;
}
/* a search running: the last results stay (dimmed) and the icon in the box spins */
.sb-results.is-loading {
  opacity: 0.55;
}
.sb-search.is-loading i::before {
  content: "\f1ce"; /* circle-notch */
}
.sb-search.is-loading i {
  animation: fa-spin 0.8s linear infinite;
}
.sb-empty {
  margin: 0;
  padding: 24px 6px;
  font-size: 13px;
  text-align: center;
  color: var(--sb-fg-3);
}
.sb-list-head {
  margin: 0 6px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sb-fg-3);
}
.sb-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0 6px;
  list-style: none;
}
.sb-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
}
.sb-row:hover,
.sb-row:focus-visible {
  background: rgba(92, 248, 219, 0.1);
  border-color: rgba(92, 248, 219, 0.45);
  outline: none;
}
.sb-row:disabled {
  cursor: default;
  opacity: 0.45;
}
.sb-row.loading {
  opacity: 0.7;
}
.sb-row-face {
  width: 44px;
  height: 44px;
  object-fit: cover;
  object-position: top;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}
.sb-row-who {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.sb-row-name {
  overflow: hidden;
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sb-row-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--sb-fg-3);
}
.sb-row-meta b {
  color: var(--sb-accent);
}
.sb-row-meta img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}
.sb-row-meta em {
  font-style: normal;
  font-weight: 700;
  color: var(--sb-fg-2);
}
.sb-row-ovr {
  font-family: var(--sb-display);
  font-size: 24px;
  line-height: 1;
}

/* picked player */
.sb-pick {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.sb-pick-face {
  width: 56px;
  height: 56px;
  object-fit: cover;
  object-position: top;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}
.sb-pick h3 {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sb-pick-meta {
  font-size: 12.5px;
  color: var(--sb-fg-3);
}
.sb-pick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sb-act {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sb-line);
  border-radius: 12px;
  cursor: pointer;
}
.sb-act:hover {
  color: #fff;
  background: rgba(92, 248, 219, 0.1);
  border-color: rgba(92, 248, 219, 0.45);
}
.sb-act i {
  width: 18px;
  text-align: center;
  color: var(--sb-accent);
}
.sb-act.sb-danger i {
  color: var(--sb-t4);
}
.sb-act.sb-danger:hover {
  background: rgba(230, 70, 100, 0.12);
  border-color: rgba(230, 70, 100, 0.5);
}

/* picked player: club, league and nation */
.sb-pick-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.sb-pick-badges[hidden] {
  display: none;
}
.sb-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  height: 28px;
  padding: 0 10px 0 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--sb-fg-2);
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--sb-line);
  border-radius: 14px;
}
.sb-badge span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.sb-badge-img {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 0 0.6px rgba(255, 255, 255, 0.8));
}
/* a normal (not dark-background) crest or league logo: on a light disc, as it may be dark (navy Spurs cockerel) */
.sb-face .ph-card-club-img.is-fb,
.sb-badge-img.is-fb {
  box-sizing: border-box;
  padding: 2px;
  background: #fff;
  border-radius: 50%;
  filter: none;
}
.sb-face .ph-card-club-img.is-fb {
  width: 22px;
  height: 22px;
}
.sb-sheet .sb-pick-badges {
  margin-top: -2px;
}

/* picked player: the spot's role (starting XI, FC 25+); + / ++ when the player has it */
.sb-pick-roles {
  margin-bottom: 12px;
}
.sb-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.sb-role-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sb-fg-2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--sb-line);
  border-radius: 18px;
  cursor: pointer;
}
.sb-role-opt:hover {
  color: #fff;
  border-color: rgba(92, 248, 219, 0.45);
}
.sb-role-opt b {
  font-family: var(--sb-display);
  color: var(--sb-t1);
}
.sb-role-opt.has-1 b {
  color: var(--sb-t2);
}
.sb-role-opt[aria-pressed="true"] {
  color: var(--sb-ink);
  background: var(--sb-accent);
  border-color: var(--sb-accent);
}
.sb-role-opt[aria-pressed="true"] b {
  color: var(--sb-ink);
}

/* formations */
.sb-forms {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin: 0 -4px;
  padding: 0 4px 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sb-form {
  height: 42px;
  padding: 0 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--sb-fg-2);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--sb-line);
  border-radius: 10px;
  cursor: pointer;
}
.sb-form:hover {
  color: #fff;
  border-color: rgba(92, 248, 219, 0.45);
}
.sb-form[aria-pressed="true"] {
  color: #fff;
  background: rgba(92, 248, 219, 0.14);
  border-color: var(--sb-accent);
}

/* save */
.sb-field {
  display: grid;
  gap: 6px;
  margin: 0;
}
.sb-field input {
  height: 46px;
  padding: 0 14px;
  font-size: 16px;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--sb-line);
  border-radius: 12px;
  outline: none;
}
.sb-field input:focus {
  border-color: var(--sb-accent);
}
.sb-save-msg {
  margin: 0;
  font-size: 13px;
  color: #ffb3c2;
}
.sb-sheet-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ---------- responsive ---------- */
/* 1200px+: three columns. Left: the picked player, subs and reserves, centre: the pitch, right: information */
@media (min-width: 1200px) {
  .sb-main {
    grid-template-columns: 320px minmax(0, 1fr) 220px;
    grid-template-areas: none;
  }
  .sb-col {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
  }
  .sb-col-left { grid-column: 1; grid-row: 1; }
  .sb-main > .sb-pitch-card { grid-column: 2; grid-row: 1; }
  .sb-col-right {
    grid-column: 3;
    grid-row: 1;
    position: sticky;
    top: 80px;
  }
  .sb-controls,
  .sb-actions,
  .sb-info,
  .sb-side {
    grid-area: auto;
  }
  .sb-info {
    display: grid;
    align-content: start;
    gap: 18px;
    padding: 14px 12px 16px;
  }
  .sb-info-group {
    display: block;
  }
  .sb-info-h {
    display: block;
  }
  .sb-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .sb-stat {
    min-width: 0;
    padding: 8px 6px;
  }
  .sb-stat-big b {
    font-size: 34px;
  }
  .sb-stat-wide {
    grid-column: 1 / -1;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 9px 12px;
  }
  .sb-stat-wide b {
    font-size: 20px;
  }
  .sb-line-list {
    display: grid;
    gap: 8px;
  }
  .sb-line {
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 2px;
    background: none;
    border: 0;
  }
  .sb-line .sb-label {
    justify-self: start;
  }
  .sb-line b {
    justify-self: end;
    font-size: 19px;
  }
  .sb-line-bar {
    display: block;
    width: 100%;
  }
}
@media (max-width: 1199.98px) {
  .sb-info-fit {
    margin-left: auto;
  }
}
@media (max-width: 991.98px) {
  .sb-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "controls" "actions" "info" "pitch" "side";
    gap: 10px;
  }
  .sb-desk-only,
  .sb-panel {
    display: none;
  }
}
@media (max-width: 767.98px) {
  /* phones: the information as compact rows (XI, cost, lines, fit) */
  .sb-info {
    display: grid;
    gap: 6px;
    padding: 8px;
  }
  .sb-stats,
  .sb-line-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }
  .sb-info-group:nth-child(2) .sb-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sb-stat,
  .sb-line {
    min-width: 0;
    padding: 7px 4px;
  }
  .sb-stat b,
  .sb-line b {
    font-size: 19px;
  }
  .sb-info-fit {
    margin-left: 0;
  }
  .sb-fit-sum {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 2px 4px;
    font-size: 12px;
  }
  .sb-fit-sum b,
  .sb-fit-sum .sb-fit-out b {
    margin-left: 0;
  }
  .sb-pitch-card {
    padding: 6px;
  }
  .sb {
    --sb-spot: 46px;
  }
  .player-holder.sb-spot {
    width: 70px;
  }
  .sb-spot .ph-card-name {
    max-width: 62px;
    padding: 1px 4px;
    font-size: 10.5px;
  }
  .sb-spot .ph-position {
    font-size: 11.5px;
  }
  /* filled spots on the pitch show the name only; the position is in the player sheet */
  .formation-holder .sb-spot.filled .ph-position {
    visibility: hidden;
  }
  .sb-r,
  .sb-p {
    min-width: 21px;
    height: 18px;
    font-size: 12px;
  }
  .sb-r {
    left: -8px;
  }
  .sb-p {
    right: -8px;
  }
  .sb-bench {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    --sb-spot: 44px;
  }
  /* sheets slide up from the bottom on phones */
  .sb-sheet-wrap {
    align-items: flex-end;
    padding: 0;
  }
  .sb-sheet {
    max-width: none;
    max-height: 86vh;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0;
    animation: sb-up 0.2s ease-out;
  }
  .sb-sheet[data-sb-sheet="search"] {
    height: 86vh;
  }
  .sb-sheet::before {
    content: "";
    align-self: center;
    width: 40px;
    height: 4px;
    margin: -4px 0 2px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
  }
  .sb-pick-actions {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 400px) {
  .sb {
    --sb-spot: 40px;
  }
  .player-holder.sb-spot {
    width: 62px;
  }
  .sb-spot .ph-card-name {
    max-width: 58px;
  }
}
@keyframes sb-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
