/* ========================================
   Pitch Component Styles
   Split-pitch layout, markings, player
   markers, grid system, ghost markers,
   and responsive toggle.
   Extracted from _formation_tactics_board.html.erb
   ======================================== */

/* ---- Layout Structure ---- */

.formation-split-view {
  padding: 0.5rem;
}

/* Two-column layout for all stat types */
.two-column-layout {
  padding: 0.25rem;
}

/* Three-panel grid: pitches (left) + sticky analysis (right) */
.columns-container {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 16px;
  align-items: start;
}

.column-left {
  min-width: 0; /* Allow grid child to shrink */
}

/* Sticky scrollable analysis panel */
.column-right {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  /* Glass-morphism panel styling */
  background: linear-gradient(180deg, rgba(var(--glow-rgb), 0.04) 0%, rgba(0, 0, 0, 0.15) 100%);
  border: 1px solid var(--border-glow);
  border-radius: 10px;
  padding: 16px;
  /* Phosphor green scrollbar */
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--glow-rgb), 0.15) transparent;
}

.column-right::-webkit-scrollbar {
  width: 4px;
}

.column-right::-webkit-scrollbar-track {
  background: transparent;
}

.column-right::-webkit-scrollbar-thumb {
  background: rgba(var(--glow-rgb), 0.2);
  border-radius: 2px;
}

.column-right:hover::-webkit-scrollbar-thumb {
  background: rgba(var(--glow-rgb), 0.35);
}

/* Remove extra padding from pis-12 class in grid layout */
.columns-container .column-right.pis-12 {
  padding-inline-start: 16px;
}

/* Tablet/smaller: single column stacked layout */
@media (max-width: 1399px) {
  .columns-container {
    grid-template-columns: 1fr;
  }

  .column-right {
    position: static;
    max-height: none;
    overflow-y: visible;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
  }

  .columns-container .column-right.pis-12 {
    padding-inline-start: 0;
    margin-block-start: var(--size-12);
  }
}

/* Make pitch smaller in two-column mode */
.two-column-layout .split-pitch-container {
  min-height: 550px;
}

/* ---- Global Pitch Filter Bar ---- */

.pitch-global-filter-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 8px 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 8px;
}

.pitch-global-filter-bar__spacer {
  flex: 1;
}

.pitch-lineup-indicator {
  display: flex;
  align-items: center;
}

.pitch-lineup-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  font-weight: 500;
}

.pitch-lineup-badge--confirmed {
  background: rgba(var(--glow-rgb), 0.15);
  color: var(--glow);
  border: 1px solid rgba(var(--glow-rgb), 0.3);
}

.pitch-lineup-badge--expected {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.pitch-lineup-badge svg {
  width: 12px;
  height: 12px;
}

/* ---- Split Pitch Container ---- */

.split-pitch-container {
  display: grid;
  grid-template-columns: 1fr 4px 1fr;
  grid-template-rows: auto 1fr;
  gap: 0;
  border-radius: 0;  /* Straight corners */
  overflow: hidden;
  min-height: 550px;
}

/* ---- Sub-Filter Bars ---- */

.pitch-sub-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(var(--glow-rgb), 0.04) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid var(--border-glow);
}

.pitch-sub-filter-bar--left {
  grid-column: 1;
  grid-row: 1;
  border-radius: 8px 0 0 0;
  border-right: none;
}

.pitch-sub-filter-bar--right {
  grid-column: 3;
  grid-row: 1;
  border-radius: 0 8px 0 0;
  border-left: none;
}

.pitch-sub-filter-spacer {
  grid-column: 2;
  grid-row: 1;
  background: rgba(255, 255, 255, 0.08);
}

.pitch-sub-filter__team-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pitch-sub-filter__team-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pitch-sub-filter__team-name {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.2;
}

.pitch-sub-filter__formation {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 500;
}

/* Team strength badge (ELT, TC, STR, MID, STG, WB) */
.pitch-sub-filter__team-strength-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid;
}

/* Lineup strength badge (percentage) */
.pitch-sub-filter__strength-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid;
}

/* Stat toggle wrapper */
.pitch-sub-filter__stat-toggle {
  display: flex;
  align-items: center;
}

/* ---- Pitch Half ---- */

.pitch-half {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 0;  /* Straight corners */
  min-height: 550px;
  background: linear-gradient(180deg, #1a472a 0%, #2d5a3f 50%, #1a472a 100%);
}

/* Pitch halves in grid - second row */
.pitch-half--left {
  grid-column: 1;
  grid-row: 2;
}

.pitch-half--right {
  grid-column: 3;
  grid-row: 2;
}

.pitch-divider {
  grid-column: 2;
  grid-row: 2;
  width: 4px;
  background: rgba(255, 255, 255, 0.4);
  position: relative;
  z-index: 1;
}

/* ---- Pitch Markings ---- */

/* Center line through the middle of each pitch */
.pitch-half::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

/* Center circle */
.pitch-half::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: transparent;
  pointer-events: none;
}

/* Pitch markings container */
.pitch-markings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Center spot */
.pitch-markings__center-spot {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

/* 18-yard box: 17.1% of pitch height, 64.7% of pitch width */
.pitch-markings__box-top,
.pitch-markings__box-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 64.7%;
  height: 17.1%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.pitch-markings__box-top {
  top: 0;
  border-top: none;
}

.pitch-markings__box-bottom {
  bottom: 0;
  border-bottom: none;
}

/* Penalty spot: 12 yards from goal = 11.4% from edge */
.pitch-markings__penalty-spot-top,
.pitch-markings__penalty-spot-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
}

.pitch-markings__penalty-spot-top {
  top: 11.4%;
}

.pitch-markings__penalty-spot-bottom {
  bottom: 11.4%;
}

/* Penalty arc (D-shape) */
.pitch-markings__box-top::after,
.pitch-markings__box-bottom::after {
  content: '';
  position: absolute;
  left: 50%;
  width: 30%;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
}

.pitch-markings__box-top::after {
  bottom: 0;
  transform: translateX(-50%) translateY(40%);
  clip-path: inset(60% 0 0 0);
}

.pitch-markings__box-bottom::after {
  top: 0;
  transform: translateX(-50%) translateY(-40%);
  clip-path: inset(0 0 60% 0);
}

/* 6-yard box: 5.7% of pitch height, 29.4% of pitch width */
.pitch-markings__goal-area-top,
.pitch-markings__goal-area-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 29.4%;
  height: 5.7%;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.pitch-markings__goal-area-top {
  top: 0;
  border-top: none;
}

.pitch-markings__goal-area-bottom {
  bottom: 0;
  border-bottom: none;
}

/* Goal: 8 yards = 11.8% of pitch width */
.pitch-markings__goal-top,
.pitch-markings__goal-bottom {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 11.8%;
  height: 4px;
  background: rgba(255, 255, 255, 0.4);
}

.pitch-markings__goal-top {
  top: 0;
}

.pitch-markings__goal-bottom {
  bottom: 0;
}

/* Corner flags */
.pitch-markings__corner {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.pitch-markings__corner--top-left {
  top: 0;
  left: 0;
  border-top: none;
  border-left: none;
  border-radius: 0 0 100% 0;
}

.pitch-markings__corner--top-right {
  top: 0;
  right: 0;
  border-top: none;
  border-right: none;
  border-radius: 0 0 0 100%;
}

.pitch-markings__corner--bottom-left {
  bottom: 0;
  left: 0;
  border-bottom: none;
  border-left: none;
  border-radius: 0 100% 0 0;
}

.pitch-markings__corner--bottom-right {
  bottom: 0;
  right: 0;
  border-bottom: none;
  border-right: none;
  border-radius: 100% 0 0 0;
}

/* ---- Player Row Positioning ---- */

/* Lines: L5=10%, L4=30%, L3=50%, L2=70%, L1=90% */
.pitch-player-row {
  position: absolute;
  left: 0;
  right: 0;
  height: 60px;
  transform: translateY(-50%);
}

/* LEFT pitch (home team - attackers at top) */
.pitch-half--left .pitch-player-row[data-line="5"] { top: 17%; }
.pitch-half--left .pitch-player-row[data-line="4"] { top: 33.5%; }
.pitch-half--left .pitch-player-row[data-line="3"] { top: 50%; }
.pitch-half--left .pitch-player-row[data-line="2"] { top: 66.5%; }
.pitch-half--left .pitch-player-row[data-line="1"] { top: 83%; }

/* RIGHT pitch (away team - defense at top, mirrored) */
.pitch-half--right .pitch-player-row[data-line="1"] { top: 17%; }
.pitch-half--right .pitch-player-row[data-line="2"] { top: 33.5%; }
.pitch-half--right .pitch-player-row[data-line="3"] { top: 50%; }
.pitch-half--right .pitch-player-row[data-line="4"] { top: 66.5%; }
.pitch-half--right .pitch-player-row[data-line="5"] { top: 83%; }

.pitch-line--empty {
  /* Empty placeholder line for vertical alignment */
}

/* ---- Player Markers ---- */

.pitch-player {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  transform: translateX(-50%);
  z-index: 10;
}

/* Dot positions - formula: ((dot - 1) / 8 * 76) + 12 = left % */
.pitch-player[data-dot="1"] { left: 12%; }
.pitch-player[data-dot="2"] { left: 21.5%; }
.pitch-player[data-dot="3"] { left: 31%; }
.pitch-player[data-dot="4"] { left: 40.5%; }
.pitch-player[data-dot="5"] { left: 50%; }
.pitch-player[data-dot="6"] { left: 59.5%; }
.pitch-player[data-dot="7"] { left: 69%; }
.pitch-player[data-dot="8"] { left: 78.5%; }
.pitch-player[data-dot="9"] { left: 88%; }

.pitch-player__marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(100, 100, 100, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
}

.pitch-player__abbrev {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
}

.pitch-player__name {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pitch-player__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.pitch-player__position {
  font-size: 8px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  margin-top: -7px;
  line-height: 0;
}

/* Hit rate boxes above pitch players */
.pitch-player__hit-rates {
  display: flex;
  gap: 2px;
  margin-bottom: 2px;
  order: -1;  /* Move above the marker */
}

.pitch-player__hit-rate {
  width: 20px;
  height: 16px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Selected player - cyan highlight */
.pitch-player--selected .pitch-player__marker {
  background: #06b6d4;
  border-color: #22d3ee;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.7);
}

.pitch-player--selected .pitch-player__name {
  color: #22d3ee;
  font-weight: 600;
}

/* Primary matchup - green highlight */
.pitch-player--primary .pitch-player__marker {
  background: var(--color-success, var(--glow));
  border-color: #4ade80;
  box-shadow: 0 0 10px rgba(var(--glow-rgb), 0.6);
}

.pitch-player--primary .pitch-player__name {
  color: #4ade80;
  font-weight: 600;
}

/* Secondary matchup - amber highlight */
.pitch-player--secondary .pitch-player__marker {
  background: var(--color-warning, #f59e0b);
  border-color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.pitch-player--secondary .pitch-player__name {
  color: #fbbf24;
  font-weight: 500;
}

/* Clickable matchup players */
.pitch-player--clickable {
  cursor: pointer;
}

.pitch-player--clickable:hover .pitch-player__marker {
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}

/* ---- Legend Footer ---- */

.pitch-legend-footer {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.1);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 0 0.5rem 0.5rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot--selected {
  background: #06b6d4;
  box-shadow: 0 0 4px rgba(6, 182, 212, 0.5);
}

.legend-dot--primary {
  background: var(--color-success, var(--glow));
  box-shadow: 0 0 4px rgba(var(--glow-rgb), 0.5);
}

.legend-dot--secondary {
  background: var(--color-warning, #f59e0b);
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}

.legend-dot--ghost {
  background: rgba(6, 182, 212, 0.3);
  border: 2px dashed rgba(34, 211, 238, 0.6);
}

/* ---- 9-Dot Grid Overlay ---- */

.pitch-half.show-dot-grid .dot-grid-overlay {
  display: block;
}

.dot-grid-overlay {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.dot-grid-row {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 12%;
}

.dot-grid-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.dot-grid-dot::after {
  content: attr(data-label);
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
}

/* All dots use neutral grey */
.dot-grid-dot[data-dot="1"],
.dot-grid-dot[data-dot="2"],
.dot-grid-dot[data-dot="3"],
.dot-grid-dot[data-dot="4"],
.dot-grid-dot[data-dot="5"],
.dot-grid-dot[data-dot="6"],
.dot-grid-dot[data-dot="7"],
.dot-grid-dot[data-dot="8"],
.dot-grid-dot[data-dot="9"] {
  background: rgba(156, 163, 175, 0.25);
  border-color: rgba(156, 163, 175, 0.5);
}

/* Dot matchup highlighting - primary range (GREEN) */
.dot-grid-dot--primary-range {
  background: rgba(var(--glow-rgb), 0.5) !important;
  border-color: rgba(74, 222, 128, 0.9) !important;
  box-shadow: 0 0 6px rgba(var(--glow-rgb), 0.6);
}

/* Secondary range (ORANGE) */
.dot-grid-dot--secondary-range {
  background: rgba(245, 158, 11, 0.4) !important;
  border-color: rgba(251, 191, 36, 0.8) !important;
  box-shadow: 0 0 5px rgba(245, 158, 11, 0.5);
}

/* ---- 5-Line Pitch Zones Overlay ---- */

.pitch-half.show-pitch-lines .pitch-lines-overlay {
  display: block;
}

.pitch-lines-overlay {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.pitch-zone-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(236, 72, 153, 0.4) 10%,
    rgba(236, 72, 153, 0.6) 50%,
    rgba(236, 72, 153, 0.4) 90%,
    transparent 100%
  );
  transform: translateY(-50%);
}

.pitch-zone-line__label {
  position: absolute;
  top: -8px;
  font-size: 9px;
  font-weight: 600;
  color: rgba(236, 72, 153, 0.8);
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 3px;
  border-radius: 2px;
}

.pitch-zone-line__label--left {
  left: 2px;
}

.pitch-zone-line__label--right {
  right: 2px;
}

/* Line colors by zone */
.pitch-zone-line[data-line="1"] {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(59, 130, 246, 0.4) 10%,
    rgba(59, 130, 246, 0.6) 50%,
    rgba(59, 130, 246, 0.4) 90%,
    transparent 100%
  );
}
.pitch-zone-line[data-line="1"] .pitch-zone-line__label {
  color: rgba(59, 130, 246, 0.9);
}

.pitch-zone-line[data-line="2"] {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(99, 102, 241, 0.4) 10%,
    rgba(99, 102, 241, 0.6) 50%,
    rgba(99, 102, 241, 0.4) 90%,
    transparent 100%
  );
}
.pitch-zone-line[data-line="2"] .pitch-zone-line__label {
  color: rgba(99, 102, 241, 0.9);
}

.pitch-zone-line[data-line="3"] {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(168, 85, 247, 0.4) 10%,
    rgba(168, 85, 247, 0.6) 50%,
    rgba(168, 85, 247, 0.4) 90%,
    transparent 100%
  );
}
.pitch-zone-line[data-line="3"] .pitch-zone-line__label {
  color: rgba(168, 85, 247, 0.9);
}

.pitch-zone-line[data-line="4"] {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(236, 72, 153, 0.4) 10%,
    rgba(236, 72, 153, 0.6) 50%,
    rgba(236, 72, 153, 0.4) 90%,
    transparent 100%
  );
}
.pitch-zone-line[data-line="4"] .pitch-zone-line__label {
  color: rgba(236, 72, 153, 0.9);
}

.pitch-zone-line[data-line="5"] {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(239, 68, 68, 0.4) 10%,
    rgba(239, 68, 68, 0.6) 50%,
    rgba(239, 68, 68, 0.4) 90%,
    transparent 100%
  );
}
.pitch-zone-line[data-line="5"] .pitch-zone-line__label {
  color: rgba(239, 68, 68, 0.9);
}

/* ---- Debug Section ---- */

.debug-section {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 0.75rem;
}

.debug-content {
  max-height: 400px;
  overflow-y: auto;
}

/* ---- Ghost Marker ---- */

.pitch-player--ghost {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 15;
  cursor: help;
}

.pitch-player__marker--ghost {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.3);
  border: 2px solid rgba(34, 211, 238, 0.8);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pitch-player__ghost-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.pitch-player__ghost-name {
  font-size: 9px;
  color: rgba(34, 211, 238, 0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  max-width: 60px;
  text-align: center;
}

/* Pointer arrow (default - up, for right pitch) */
.pitch-player__marker--ghost::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 6px solid rgba(34, 211, 238, 0.5);
}

/* Arrow pointing down for left pitch */
.pitch-player--ghost-down .pitch-player__marker--ghost::before {
  top: auto;
  bottom: -5px;
  border-bottom: none;
  border-top: 6px solid rgba(34, 211, 238, 0.5);
}

.pitch-player--ghost-down {
  flex-direction: column;
}

.pitch-player--ghost-down .pitch-player__ghost-name {
  order: -1;
  margin-top: 0;
  margin-bottom: 3px;
}

/* ---- Pitch Team Toggle (responsive single-pitch mode) ---- */

.pitch-team-toggle {
  display: none; /* Hidden at >=1400px (both pitches visible in grid layout) */
  justify-content: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 8px;
}

.pitch-team-toggle__btn {
  flex: 1;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-align: center;
}

.pitch-team-toggle__btn:hover {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
}

.pitch-team-toggle__btn--active {
  background: rgba(var(--glow-rgb), 0.20);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(var(--glow-rgb), 0.30), 0 0 8px rgba(var(--glow-rgb), 0.1);
}

/* ---- Responsive: <1400px — show toggle, single pitch ---- */

@media (max-width: 1399px) {
  .pitch-team-toggle {
    display: flex;
  }

  .split-pitch-container {
    grid-template-columns: 1fr !important;
  }

  /* Hide away-side elements by default */
  .split-pitch-container .pitch-half--right,
  .split-pitch-container .pitch-sub-filter-bar--right {
    display: none;
  }

  .split-pitch-container .pitch-sub-filter-spacer,
  .split-pitch-container .pitch-divider {
    display: none;
  }

  /* Left side takes full width */
  .split-pitch-container .pitch-half--left {
    grid-column: 1;
  }

  .split-pitch-container .pitch-sub-filter-bar--left {
    grid-column: 1;
    border-radius: 8px 8px 0 0;
    border-right: 1px solid var(--border-glow);
  }

  /* When showing away team */
  .split-pitch-container.show-away .pitch-half--left,
  .split-pitch-container.show-away .pitch-sub-filter-bar--left {
    display: none;
  }

  .split-pitch-container.show-away .pitch-half--right {
    display: block;
    grid-column: 1;
    grid-row: 2;
  }

  .split-pitch-container.show-away .pitch-sub-filter-bar--right {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    border-radius: 8px 8px 0 0;
    border-left: 1px solid var(--border-glow);
  }
}

/* ---- Mobile: compact pitch ---- */

@media (max-width: 768px) {
  .pitch-half {
    min-height: 420px;
  }

  .pitch-sub-filter-bar {
    padding: 8px 10px;
  }

  .pitch-sub-filter__team-name {
    font-size: 11px;
  }

  .pitch-sub-filter__formation {
    font-size: 9px;
  }

  .pitch-player__name {
    font-size: 8px;
    max-width: 65px;
  }

  .pitch-player__hit-rate {
    font-size: 8px;
    min-width: 22px;
    padding: 1px 3px;
  }

  .pitch-global-filter-bar {
    padding: 6px 10px;
    gap: 10px;
  }
}
