/* ─────────────────────────────────────────────────────────────────────────
   Pitch player cards in the official FPL style.

   FPL draws no box around a player: the shirt stands on the grass, with a
   small rounded label underneath — the name on one row, the fixture on the
   next. FPL Analyzer keeps every figure it showed before (price, expected
   points, expected minutes, fixture difficulty, captain and availability),
   so those sit where FPL puts similar marks: the extra numbers in a third
   label row, the captain and status as badges on the shirt.

   Loaded after squad-card-glass.css and scoped to the pitch and bench, so it
   replaces the glass card there and nowhere else.
   ───────────────────────────────────────────────────────────────────────── */

:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card {
  isolation: isolate;
  overflow: visible !important;
  min-height: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transition: transform 160ms cubic-bezier(.2, .8, .2, 1) !important;
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card::before,
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card::after {
  display: none !important;
}
@media (hover: hover) and (pointer: fine) {
  :is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: none !important;
  }
  :is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card:hover .player-card-body {
    box-shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 6px 14px rgba(0, 0, 0, .22);
  }
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── the shirt, straight on the grass ── */
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-shirt-container {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  padding: 10px 0 2px !important;
  background: transparent !important;
}
/* As on FPL, the shirt is about as wide as the label beneath it. */
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-shirt-img {
  width: 92% !important;
  height: auto !important;
  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: name, fixture, then the Analyzer numbers ── */
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .player-card-body {
  position: relative;
  z-index: 2;
  display: flex !important;
  flex-direction: column;
  gap: 0 !important;
  width: 100%;
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 4px;
  background: #fff !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 3px 8px rgba(0, 0, 0, .16);
  color: #1a1a1a;
  transition: box-shadow 160ms ease;
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-name {
  order: 1;
  padding: 3px 4px 2px !important;
  overflow: hidden;
  border: 0 !important;
  background: #f4f4f4 !important;
  color: #1a1a1a !important;
  font-size: clamp(.64rem, 1.05vw, .74rem) !important;
  font-weight: 700 !important;
  letter-spacing: -.005em;
  line-height: 1.2 !important;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-fix {
  order: 2;
  padding: 2px 4px 3px !important;
  overflow: hidden;
  border: 0 !important;
  border-top: 1px solid #e3e3e3 !important;
  background: #fff !important;
  color: #1a1a1a !important;
  font-size: clamp(.6rem, 1vw, .7rem) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  line-height: 1.2 !important;
  text-align: center;
  text-overflow: ellipsis;
  text-transform: none !important;
  white-space: nowrap;
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-meta {
  order: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px !important;
  min-height: 0 !important;
  padding: 2px 3px 3px !important;
  border: 0 !important;
  border-top: 1px solid #e3e3e3 !important;
  background: #f4f4f4 !important;
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-xp {
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: #37003c !important;
  font-size: .62rem !important;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-mins {
  padding: 0 !important;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: #5a5a5a !important;
  font-size: .58rem !important;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-fdr {
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

/* ── marks on the shirt ── */
/* Price: a small tag at the shirt's shoulder. */
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-price {
  z-index: 5;
  top: 2px !important;
  right: 0 !important;
  padding: 1px 4px !important;
  border: 0 !important;
  border-radius: 3px !important;
  background: rgba(20, 20, 22, .72) !important;
  color: #fff !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  font-size: .58rem !important;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
  line-height: 1.25 !important;
  text-shadow: none !important;
}
/* Captain: FPL's black "C" disc beside the shirt. */
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .cap-hint {
  z-index: 6;
  top: 16px !important;
  left: 2px !important;
  width: 18px !important;
  height: 18px !important;
  border: 1.5px solid #fff !important;
  border-radius: 50%;
  background: #1a1a1a !important;
  color: #fff !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35) !important;
  font-size: .6rem !important;
  font-weight: 800 !important;
}
/* Availability: FPL-style "!" flag — amber for a doubt, red when out. */
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-status {
  z-index: 6;
  top: 16px !important;
  right: 2px !important;
  width: 16px !important;
  height: 16px !important;
  border: 1.5px solid #fff !important;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-status.doubt,
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-status.out {
  display: grid !important;
  place-items: center;
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-status.doubt { background: #ffab1b !important; color: #1a1a1a; }
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-status.out { background: #d81920 !important; color: #fff; }
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-status.doubt::before,
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-status.out::before {
  content: '!';
  font: 900 10px/1 system-ui, sans-serif;
}
/* Pro's edit/remove controls stay reachable above the shirt. */
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-remove {
  z-index: 7;
  top: 0 !important;
  left: 0 !important;
}
:is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .edit-proj-btn { z-index: 7; }

/* ── light theme: the label is FPL white in both themes ── */
:root.light-mode :is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .player-card-body { background: #fff !important; }

/* ── phones ──
   The shared squad pitch (squad-pitch.css) draws its own phone card; these
   only tighten the few other pitches that still use this layer. */
@media (max-width: 768px) {
  :is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-shirt-container { padding: 8px 0 2px !important; }
  :is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-name { font-size: .6rem !important; padding: 2px 2px 1px !important; }
  :is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-fix { font-size: .57rem !important; padding: 1px 2px 2px !important; }
  :is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card .pc-meta { gap: 3px !important; padding: 1px 2px 2px !important; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.pitch-bg, .bench-view, .bench-area, #futurePitchPlayers, #futureBenchPlayers) .player-card { transition: none !important; }
}
