/* The shared squad pitch in Simple, Normal and Pro. */
.fpl-squad-pitch {
  max-width: 1000px;
  margin-inline: auto;
  padding-bottom: 18px;
  overflow: hidden;
  border-radius: 14px;
  background: #111316;
}

.fpl-squad-pitch .pitch-bg {
  isolation: isolate;
  min-height: 680px;
  padding: 76px 14px 75px;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: #111316 !important;
  box-shadow: none;
}

.fpl-squad-pitch .pitch-stripes {
  z-index: 0;
  inset: 50px 0 0;
  clip-path: polygon(17% 0, 83% 0, 100% 46%, 100% 100%, 0 100%, 0 46%);
  background: repeating-linear-gradient(180deg, #00a94e 0 82px, #009b46 82px 164px) !important;
}

.fpl-squad-pitch .squad-pitch-markings {
  position: absolute;
  z-index: 1;
  inset: 50px 0 0;
  width: 100%;
  height: calc(100% - 50px);
  overflow: visible;
  fill: none;
  stroke: rgba(255, 255, 255, .92);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.fpl-squad-pitch .squad-pitch-markings-mobile { display: none; }
.fpl-squad-pitch .squad-pitch-markings path,
.fpl-squad-pitch .squad-pitch-markings circle { vector-effect: non-scaling-stroke; }
.fpl-squad-pitch .pitch-circle,
.fpl-squad-pitch .pitch-midline { display: none; }

.fpl-squad-pitch .squad-pitch-brand {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 17%;
  right: 17%;
  display: flex;
  height: 45px;
  border-radius: 9px 9px 0 0;
  background: linear-gradient(100deg, #09d8d9 0%, #28b9ef 48%, #5a86f5 100%);
  box-shadow: 0 4px 10px rgba(0, 26, 31, .16);
  pointer-events: none;
}
.fpl-squad-pitch .squad-pitch-brand-side {
  z-index: 1;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  color: #0a252d;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(.95rem, 1.8vw, 1.25rem);
  font-weight: 800;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.fpl-squad-pitch .squad-pitch-brand-side img {
  width: 27px;
  height: 27px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}
.fpl-squad-pitch .squad-pitch-goal {
  position: absolute;
  z-index: 0;
  top: 7px;
  left: 50%;
  width: clamp(80px, 13%, 120px);
  height: 70px;
  transform: translateX(-50%);
  border: 3px solid white;
  border-bottom: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.78) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(0deg, rgba(255,255,255,.78) 0 1px, transparent 1px 9px),
    rgba(0, 111, 83, .36);
  box-shadow: 0 3px 9px rgba(0, 32, 25, .2);
}

.fpl-squad-pitch .pitch-players {
  z-index: 4;
  min-height: 530px;
  justify-content: space-between;
  gap: 16px;
}
.fpl-squad-pitch .pitch-row {
  min-height: 0;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: clamp(5px, 1.6vw, 15px);
}
.fpl-squad-pitch .pitch-players .player-card {
  flex: 0 0 auto;
  width: clamp(72px, 9.7vw, 106px) !important;
}

/* Translucent shirt panel and the existing white player label. */
.fpl-squad-pitch .player-card .pc-shirt-container {
  min-height: 84px;
  padding: 8px 0 8px !important;
  overflow: hidden;
  border: 0px solid rgba(255, 255, 255, .24);
  border-bottom: 0;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, rgba(1, 42, 34, .44), rgba(0, 50, 37, .2)) !important;
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: blur(0px);
}
.fpl-squad-pitch .player-card .pc-shirt-img {
  width: 100% !important;
  max-height: 78px;
  object-fit: contain;
  transform: scale(1.15) !important;
}
.fpl-squad-pitch .player-card .player-card-body {
  border-radius: 0 0 4px 4px;
}

.fpl-squad-pitch :is(#benchView, .bench-view) {
  position: relative;
  z-index: 5;
  width: min(72%, 710px);
  margin: -42px auto 0 !important;
  padding: 10px 14px 0 !important;
  border: 0 !important;
  border-radius: 8px 8px 0 0 !important;
  background-color: #78c99c !important;
  background-image: linear-gradient(180deg, #9cddb4 0%, #85cfa3 53%, #25382e 79%, #111316 100%) !important;
  box-shadow: 0 -2px 12px rgba(0, 50, 36, .15);
}
.fpl-squad-pitch .bench-view .pitch-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  justify-items: center;
  width: 100%;
  gap: clamp(5px, 1.4vw, 14px) !important;
}
.fpl-squad-pitch .bench-view .pitch-row > span {
  grid-column: 1 / -1;
  color: #102a23 !important;
  font-weight: 700;
}
.fpl-squad-pitch .squad-bench-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
}
.fpl-squad-pitch .squad-bench-position {
  color: #102a23;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}
.fpl-squad-pitch .bench-view .player-card {
  width: min(100%, 106px) !important;
}
.fpl-squad-pitch .bench-view h4 {
  margin: 7px -14px 0 !important;
  padding: 12px 8px 2px;
  color: #fff !important;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.3rem !important;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-transform: none !important;
}

@media (max-width: 600px) {
  .fpl-squad-pitch {
    container-type: inline-size;
    position: relative;
    left: 50%;
    width: calc(100vw - 12px);
    max-width: none;
    margin-left: 0;
    padding-bottom: 4.6cqw;
    border-radius: 8px;
    background: #0a0a0b;
    transform: translateX(-50%);
  }
  .fpl-squad-pitch .pitch-bg {
    height: 162cqw;
    min-height: 0;
    padding: 13.8cqw 2px 0 !important;
    background: #0a0a0b !important;
  }
  .fpl-squad-pitch .pitch-stripes {
    inset: 10.1cqw 0 0;
    clip-path: polygon(4% 0, 96% 0, 100% 11%, 100% 100%, 0 100%, 0 11%);
    background: repeating-linear-gradient(180deg, #009c49 0 95px, #00a750 95px 194px) !important;
  }
  .fpl-squad-pitch .squad-pitch-markings { display: none; }
  .fpl-squad-pitch .squad-pitch-markings-mobile {
    position: absolute;
    z-index: 1;
    display: block;
    inset: 10.1cqw 0 0;
    width: 100%;
    height: calc(100% - 10.1cqw);
    fill: none;
    stroke: #fff;
    stroke-width: 1.6;
    pointer-events: none;
  }
  .fpl-squad-pitch .squad-pitch-brand {
    top: 2cqw;
    left: 4%;
    right: 4%;
    height: 9cqw;
    border-radius: 8px 8px 0 0;
    box-shadow: none;
  }
  .fpl-squad-pitch .squad-pitch-brand-side {
    gap: 4px;
    font-size: clamp(10px, 3cqw, 13px);
    letter-spacing: -.04em;
  }
  .fpl-squad-pitch .squad-pitch-brand-side img {
    width: 4.9cqw;
    height: 4.9cqw;
    border-radius: 3px;
  }
  .fpl-squad-pitch .squad-pitch-goal {
    top: 1.8cqw;
    width: 18cqw;
    height: 13.8cqw;
    border-width: 2px;
    box-shadow: none;
  }
  .fpl-squad-pitch .pitch-players {
    height: 142cqw;
    min-height: 0;
    gap: 0;
  }
  .fpl-squad-pitch .pitch-row { justify-content: center; gap: 5px !important; }
  /* ── the player card on a phone ──
     Exactly the desktop card, scaled to a phone: the translucent shirt panel
     with its thin border, the white label beneath (name on grey, fixture on
     white, numbers on grey), the dark price tag and red × in the top corners.
     Only sizes change; text keeps a small minimum so it stays readable. The
     card keeps its row-fitting height and the shirt panel flexes, so the
     label is always shown in full. */
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card {
    display: flex !important;
    flex-direction: column;
    width: clamp(61px, 17cqw, 78px) !important;
    height: 35cqw;
    min-height: 0 !important;
    overflow: visible !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  .fpl-squad-pitch .player-card::before { display: none; }

  /* The shirt panel — the desktop panel, scaled. */
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-shirt-container {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    padding: 4cqw 0 .8cqw !important;
    overflow: hidden;
    border: 0px solid rgba(255, 255, 255, .24) !important;
    border-bottom: 0 !important;
    border-radius: 3px 3px 0 0;
    background: transparent !important;
    -webkit-backdrop-filter: blur(0px);
    backdrop-filter: blur(0px);
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-shirt-img {
    width: 95% !important;
    max-height: 100%;
    object-fit: contain;
    transform: none !important;
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .32)) drop-shadow(0 1px 1px rgba(0, 0, 0, .2)) !important;
  }

  /* The label — the desktop label, scaled. */
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .player-card-body {
    flex: 0 0 auto;
    height: auto;
    border-radius: 0 0 3px 3px !important;
    background: #fff !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 2px 5px rgba(0, 0, 0, .16) !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-name,
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-fix {
    display: block;
    flex: 0 0 auto;
    height: auto;
    overflow: hidden;
    color: #1a1a1a !important;
    line-height: 1.2 !important;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-name {
    padding: 1px 2px 1px !important;
    background: #f4f4f4 !important;
    font-size: clamp(8px, 2.55cqw, 10px) !important;
    font-weight: 700 !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-fix {
    padding: 1px 2px 1px !important;
    border-top: 1px solid #e3e3e3 !important;
    background: #fff !important;
    font-size: clamp(7.5px, 2.35cqw, 9.5px) !important;
    font-weight: 600 !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-meta {
    display: flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center !important;
    gap: 1cqw !important;
    width: 100%;
    height: auto;
    min-height: 0 !important;
    padding: 1px 1px 2px !important;
    border: 0 !important;
    border-top: 1px solid #e3e3e3 !important;
    background: #f4f4f4 !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-xp,
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-mins {
    display: block !important;
    padding: 0 !important;
    line-height: 1 !important;
    white-space: nowrap;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-xp {
    color: #37003c !important;
    font-size: clamp(7.5px, 2.3cqw, 9px) !important;
    font-weight: 800 !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-mins {
    color: #5a5a5a !important;
    font-size: clamp(7px, 2.1cqw, 8.5px) !important;
    font-weight: 600 !important;
  }
  .fpl-squad-pitch .player-card .pc-xp::before,
  .fpl-squad-pitch .player-card .pc-mins::before { content: none; }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-fdr {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 11px !important;
    height: 11px !important;
    padding: 0 2px !important;
    border-radius: 2px !important;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
    font-size: 7px !important;
    font-weight: 800 !important;
    line-height: 11px !important;
    white-space: nowrap;
  }
  .fpl-squad-pitch .player-card .pc-fdr:not(.is-position-fdr)::before { content: none; }
  /* Position FDR in full ("ATC4", "DEF2"), as on desktop. */
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-fdr.is-position-fdr {
    width: auto !important;
    min-width: 0 !important;
    padding: 0 2px !important;
    font-size: 6.5px !important;
  }
  .fpl-squad-pitch .player-card .pc-fdr-long { display: inline !important; }
  .fpl-squad-pitch .player-card .pc-fdr-short { display: none !important; }

  /* Corner marks — the desktop marks, scaled. */
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-price {
    display: block !important;
    top: 1px !important;
    right: 1px !important;
    height: auto;
    padding: 0 3px !important;
    border: 0 !important;
    border-radius: 3px !important;
    color: #fff !important;
    background: rgba(20, 20, 22, .72) !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-remove {
    top: 1px !important;
    left: 1px !important;
    right: auto !important;
    width: 13px !important;
    height: 13px !important;
    border-radius: 50% !important;
    color: #fff !important;
    font-size: 8px !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .cap-hint {
    top: 3.2cqw !important;
    left: 1px !important;
    width: 13px !important;
    height: 13px !important;
    border: 1px solid #fff !important;
    background: #1a1a1a !important;
    color: #fff !important;
    font-size: 7.5px !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-status {
    top: 3.2cqw !important;
    right: 1px !important;
    left: auto !important;
    width: 12px !important;
    height: 12px !important;
    border-width: 1px !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-status.ok {
    display: none !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-status.doubt {
    background: #ffab1b !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-status.out {
    background: #d81920 !important;
  }
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-status.doubt::before,
  .fpl-squad-pitch :is(.pitch-bg, .bench-view, #benchView) .player-card .pc-status.out::before { font-size: 8px !important; }
  .fpl-squad-pitch :is(#benchView, .bench-view) {
    width: 86%;
    height: 50cqw;
    min-height: 0;
    margin-top: -4.5cqw !important;
    padding: 2cqw 2cqw 0 !important;
    border-radius: 8px 8px 0 0 !important;
    background-color: #151a1d !important;
    background-image: linear-gradient(180deg, #206b63 0%, #203b3a 28%, #151a1d 100%) !important;
    box-shadow: none;
  }
  .fpl-squad-pitch :is(#benchView, .bench-view)::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, #c21500, #ffc500);
  }
  .fpl-squad-pitch .bench-view .pitch-row { gap: 5px !important; }
  .fpl-squad-pitch .squad-bench-slot { gap: 5px; }
  .fpl-squad-pitch .squad-bench-position {
    color: #defdf6;
    font-size: clamp(8px, 2.3cqw, 10px);
    line-height: 1.2;
  }
  .fpl-squad-pitch .bench-view h4 {
    margin: 3.5cqw -2cqw 0 !important;
    padding: 0;
    font-size: clamp(17px, 5cqw, 21px) !important;
    line-height: 1.2;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .fpl-squad-pitch .player-card .pc-shirt-container { background: rgba(0, 55, 42, .9) !important; backdrop-filter: none; }
}
