/* ==========================================================================
   PES 2013 FULL-BLEED GRASS PITCH & FORMATION SCREEN
   ========================================================================== */

/* Squad, Training & League Viewport Mode: Koyu dikey çizgili çim arkaplanı */
.game-canvas-1080p.squad-mode,
.game-window-viewport.squad-mode,
.game-canvas-1080p.training-mode,
.game-window-viewport.training-mode,
.game-canvas-1080p.league-mode,
.game-window-viewport.league-mode {
  background: 
    radial-gradient(ellipse at 50% 15%, rgba(34, 197, 94, 0.35) 0%, rgba(4, 30, 15, 0.98) 100%),
    repeating-linear-gradient(
      90deg,
      #166534 0px,
      #166534 50px,
      #14532d 50px,
      #14532d 100px
    ) !important;
  background-size: cover !important;
  background-attachment: local !important;
}

.pes-squad-fullview {
  width: 100%;
  box-sizing: border-box;
  flex: 1 0 auto;
  min-height: 100%;
  height: auto;
  background: 
    radial-gradient(ellipse at 50% 15%, rgba(34, 197, 94, 0.35) 0%, rgba(4, 30, 15, 0.98) 100%),
    repeating-linear-gradient(
      90deg,
      #166534 0px,
      #166534 50px,
      #14532d 50px,
      #14532d 100px
    );
  background-size: 100% 100%;
  padding: 16px 20px 80px 20px;
  position: relative;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.85);
}

/* PES 2013 Top Tactics Header with Team Strength Star Card & Sub-Nav Tabs */
.pes-pitch-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 10px 18px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
  max-width: 1560px;
  margin-left: auto;
  margin-right: auto;
}

/* En Üst Sol Köşe: Takım Genel Gücü & Yıldız Derecelendirme Kartı */
.team-strength-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(30, 41, 59, 0.95);
  border: 1.5px solid rgba(251, 191, 36, 0.5);
  border-radius: 8px;
  padding: 6px 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(251, 191, 36, 0.15);
}

.team-finance-card {
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 0 12px rgba(52, 211, 153, 0.12);
}
.strength-badge-icon {
  font-size: 22px;
  line-height: 1;
}
.strength-info {
  display: flex;
  flex-direction: column;
}
.strength-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #94a3b8;
  text-transform: uppercase;
}
.strength-value-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.strength-ovr-num {
  font-family: 'Rajdhani', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #fbbf24;
  line-height: 1;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.7);
}
.strength-stars-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stars-svg-row {
  display: flex;
  align-items: center;
  gap: 3px;
}
.star-svg-item {
  display: inline-block;
  vertical-align: middle;
  filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.6));
  transition: transform 0.15s ease;
}
.star-svg-item:hover {
  transform: scale(1.18);
}
.strength-stars-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #fef08a;
  margin-left: 2px;
}

/* Sub-Nav Switcher Tabs: "Formasyon" "Diziliş" "Taktikler" */
.squad-subnav-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.squad-subtab-btn {
  background: transparent;
  color: #94a3b8;
  border: none;
  font-family: 'Chakra Petch', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.squad-subtab-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.squad-subtab-btn.active {
  color: #0f172a;
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.5);
}

.pes-squad-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Saha ve Sağ Yan Eylem Çubuğu Kapsayıcısı (İlk 11 Sahasını Tam Merkezde Tutar) */
.pes-pitch-stage-container {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto 35px auto;
  position: relative;
}

.pes-pitch-stage-container .pes-main-pitch {
  width: 100%;
  max-width: 1560px;
  margin: 0;
}

/* Sağ Taraf: Sahanın Konumunu Bozmadan En Sağ Dışına Yerleştirilen Kare Buton */
.pes-pitch-side-actions {
  position: absolute;
  left: calc(100% + 20px);
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 20;
}

@container game (max-width: 1740px) {
  .pes-pitch-side-actions {
    left: auto;
    right: 14px;
    top: 14px;
  }
}

.btn-square-autolineup {
  width: 78px;
  height: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  color: #34d399;
  border: 2px solid #10b981;
  border-radius: 10px;
  padding: 8px 4px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.6px;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7), 0 0 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-square-autolineup:hover {
  background: #10b981;
  color: #064e3b;
  border-color: #34d399;
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.85);
  transform: translateY(-3px) scale(1.06);
}

.btn-square-autolineup:active {
  transform: translateY(0) scale(0.96);
}

.btn-square-autolineup .square-auto-icon {
  font-size: 22px;
  color: #fbbf24;
  line-height: 1;
}

.btn-square-autolineup .square-auto-text {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

/* ==========================================================================
   TACTICS PITCH PREVIEW & DYNAMIC SVG ARROWS
   ========================================================================== */
.tactics-preview-wrap {
  margin-bottom: 24px;
}
.tactics-pitch-canvas {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  aspect-ratio: 16 / 9.2;
  min-height: 520px;
  position: relative;
  overflow: hidden;
  border-radius: 0px;
  border: 3px solid rgba(255, 255, 255, 0.95);
  background-color: #14532d;
  background-image: 
    repeating-linear-gradient(0deg, #166534 0px, #166534 60px, #15803d 60px, #15803d 120px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0px, rgba(0, 0, 0, 0.16) 60px, transparent 60px, transparent 120px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), inset 0 0 60px rgba(0, 0, 0, 0.4);
}
.tactics-svg-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}
.tactics-pitch-badge {
  position: absolute;
  bottom: 12px;
  left: 14px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  z-index: 15;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
}
.tactics-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: liveDotPulse 1.2s infinite alternate ease-in-out;
}
@keyframes liveDotPulse {
  0% { transform: scale(0.9); opacity: 0.7; }
  100% { transform: scale(1.3); opacity: 1; }
}

.pes-squad-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}
.pes-form-tag {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 4px 12px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
}

/* ==========================================================================
   SUB-VIEW 2: DİZİLİŞ (LİSTE GÖRÜNÜMÜ - NO PITCH)
   ========================================================================== */
.squad-list-container {
  max-width: 1560px;
  margin: 0 auto 35px auto;
  display: flex;
  flex-direction: column;
  gap: 25px;
}
.squad-list-section {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.squad-list-header {
  padding: 12px 20px;
  background: rgba(30, 41, 59, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Chakra Petch', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.squad-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.squad-table th {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.35);
  color: #94a3b8;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.squad-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
}
.squad-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}
.squad-table-name {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
}
.squad-table-ovr {
  font-size: 18px;
  font-weight: 900;
}

/* ==========================================================================
   SUB-VIEW 3: TAKTİKLER PANELİ (TACTICS DASHBOARD)
   ========================================================================== */
.tactics-dashboard-container {
  max-width: 1560px;
  margin: 0 auto 35px auto;
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
}
.tactics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}
.tactic-group-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
.tactic-group-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tactic-options-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.tactic-pill-btn {
  flex: 1;
  min-width: 80px;
  background: rgba(0, 0, 0, 0.4);
  color: #94a3b8;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
}
.tactic-pill-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
.tactic-pill-btn.active {
  background: #16a34a;
  color: #ffffff;
  border-color: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}

/* Section 1: Main Horizontal Pitch with 90° Sharp Corners & Straight Grid Mower Pattern */
.pes-main-pitch {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto 35px auto;
  aspect-ratio: 16 / 9.2;
  min-height: 280px;
  border-radius: 0px; /* 90 derece dik keskin köşeler */
  position: relative;
  overflow: hidden;
  background-color: #14532d;
  background-image: 
    repeating-linear-gradient(0deg, #166534 0px, #166534 60px, #15803d 60px, #15803d 120px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0px, rgba(0, 0, 0, 0.16) 60px, transparent 60px, transparent 120px);
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75), inset 0 0 60px rgba(0, 0, 0, 0.4);
}

/* Tactical Zones Overlay (Shown on Player Drag / Select) */
.pes-zones-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  animation: fadeIn 0.2s ease forwards;
}

.pes-tactical-zone {
  position: absolute;
  border: 2px dashed rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.pes-tactical-zone .zone-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
  pointer-events: none;
}

/* Translucent Yellow / Gold Active Zone for Dragged Player */
.pes-tactical-zone.active-target-zone {
  background: rgba(250, 204, 21, 0.36) !important;
  border: 3px solid #facc15 !important;
  box-shadow: 0 0 35px rgba(250, 204, 21, 0.7), inset 0 0 30px rgba(250, 204, 21, 0.4) !important;
  z-index: 9;
  animation: targetZonePulse 1.2s infinite alternate ease-in-out;
}

.pes-tactical-zone.active-target-zone .zone-label {
  color: #fef08a !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  background: rgba(0, 0, 0, 0.82);
  padding: 4px 14px;
  border-radius: 6px;
  border: 1.5px solid #facc15;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.9), 0 2px 4px rgba(0, 0, 0, 0.95);
}

@keyframes targetZonePulse {
  0% { transform: scale(1); opacity: 0.88; }
  100% { transform: scale(1.03); opacity: 1; }
}

/* Center Line, Circle & Center Spot */
.pes-pitch-line.center-line-h {
  position: absolute;
  top: 0;
  left: 50%;
  width: 0;
  height: 100%;
  border-left: 2.5px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
}
.pes-pitch-circle.center-circle-h {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.pes-pitch-dot.center-spot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  pointer-events: none;
  z-index: 2;
}

/* Penalty Box & Goal Box (Left & Right) */
.pes-pitch-box.penalty-left {
  position: absolute;
  left: 0;
  top: 50%;
  width: 155px;
  height: 300px;
  transform: translateY(-50%);
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-left: none;
  pointer-events: none;
}
.pes-pitch-box.goal-left {
  position: absolute;
  left: 0;
  top: 50%;
  width: 60px;
  height: 140px;
  transform: translateY(-50%);
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-left: none;
  pointer-events: none;
}
.pes-pitch-box.penalty-right {
  position: absolute;
  right: 0;
  top: 50%;
  width: 155px;
  height: 300px;
  transform: translateY(-50%);
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-right: none;
  pointer-events: none;
}
.pes-pitch-box.goal-right {
  position: absolute;
  right: 0;
  top: 50%;
  width: 60px;
  height: 140px;
  transform: translateY(-50%);
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-right: none;
  pointer-events: none;
}

/* Penalty Arcs (D-Boxes) & Penalty Spots */
.pes-pitch-arc.arc-left {
  position: absolute;
  top: 50%;
  left: 155px;
  width: 55px;
  height: 100px;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-left: none;
  border-radius: 0 100px 100px 0;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}
.pes-pitch-dot.spot-left {
  position: absolute;
  top: 50%;
  left: 105px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  pointer-events: none;
  z-index: 2;
}
.pes-pitch-arc.arc-right {
  position: absolute;
  top: 50%;
  right: 155px;
  width: 55px;
  height: 100px;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  border-right: none;
  border-radius: 100px 0 0 100px;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 1;
}
.pes-pitch-dot.spot-right {
  position: absolute;
  top: 50%;
  right: 105px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffffff;
  transform: translate(50%, -50%);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
  pointer-events: none;
  z-index: 2;
}

/* 4 Corner Arcs */
.pes-corner-arc {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255, 255, 255, 0.85);
  pointer-events: none;
  z-index: 1;
}
.corner-top-left {
  top: 0;
  left: 0;
  border-top: none;
  border-left: none;
  border-radius: 0 0 24px 0;
}
.corner-bottom-left {
  bottom: 0;
  left: 0;
  border-bottom: none;
  border-left: none;
  border-radius: 0 24px 0 0;
}
.corner-top-right {
  top: 0;
  right: 0;
  border-top: none;
  border-right: none;
  border-radius: 0 0 0 24px;
}
.corner-bottom-right {
  bottom: 0;
  right: 0;
  border-bottom: none;
  border-right: none;
  border-radius: 24px 0 0 0;
}

.pes-corner-flag {
  position: absolute;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
  z-index: 3;
}
.flag-top-left { top: 2px; left: 2px; }
.flag-bottom-left { bottom: 2px; left: 2px; }
.flag-top-right { top: 2px; right: 2px; }
.flag-bottom-right { bottom: 2px; right: 2px; }

/* PES Formation Bottom Badge (e.g. 4-3-3 👤1) */
.pes-bottom-formation-badge {
  position: absolute;
  bottom: 14px;
  right: 16px;
  background: rgba(0, 0, 0, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.45);
  padding: 5px 12px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  z-index: 5;
}
.pes-formation-icon { font-size: 14px; color: #fbbf24; }

/* Starting XI Players Layer */
.pes-players-layer {
  position: absolute;
  inset: 0;
}

/* ==========================================================================
   UNIFIED CLEAN PLAYER CARDS (Pitch, Bench, Reserves)
   ========================================================================== */

.pes-player-card {
  width: 126px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  user-select: none;
  z-index: 10;
  position: relative;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), filter 0.18s ease;
}
.pes-player-card:active {
  cursor: grabbing;
}
.pes-player-card:hover {
  transform: translateY(-5px) scale(1.14);
  z-index: 30;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.9));
}
.pes-player-card.selected {
  transform: scale(1.18);
  z-index: 30;
}
.pes-player-card.selected .pes-card-pos {
  box-shadow: 0 0 16px #38bdf8, inset 0 0 6px #38bdf8;
  border-color: #38bdf8;
}

/* Out of Position Warning Badge (Sarı & Kırmızı Uyarı Rozetleri) */
.pes-out-of-pos-badge {
  position: absolute;
  top: -8px;
  left: 8px;
  width: 26px;
  height: 26px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  z-index: 25;
}

/* Sarı Uyarı: Komşu/İkincil Uyumlu Bölge (Örn: MC -> DMC veya AMC) */
.pes-out-of-pos-badge.badge-yellow {
  background: #f59e0b;
  color: #0f172a;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.95);
  animation: outOfPosYellowPulse 1.2s infinite alternate ease-in-out;
}
/* composited: only transform / opacity animate (a box-shadow / filter / left animation repainted every frame) */
.pes-out-of-pos-badge.badge-yellow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(251, 191, 36, 1);
  opacity: 0;
  pointer-events: none;
  animation: outOfPosYellowPulseGlow 1.2s infinite alternate ease-in-out;
}
@keyframes outOfPosYellowPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.18); }
}
@keyframes outOfPosYellowPulseGlow {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Kırmızı Uyarı: Tamamen Uzak/Uyumsuz Bölge (Örn: MC -> AMR veya SF; KL -> SF) */
.pes-out-of-pos-badge.badge-red {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.95);
  animation: outOfPosRedPulse 1.2s infinite alternate ease-in-out;
}
/* composited: only transform / opacity animate (a box-shadow / filter / left animation repainted every frame) */
.pes-out-of-pos-badge.badge-red::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(239, 68, 68, 1);
  opacity: 0;
  pointer-events: none;
  animation: outOfPosRedPulseGlow 1.2s infinite alternate ease-in-out;
}
@keyframes outOfPosRedPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.2); }
}
@keyframes outOfPosRedPulseGlow {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Drag & Drop Visual States */
.pes-player-card.dragging {
  opacity: 0.45;
  transform: scale(0.92);
  filter: grayscale(40%);
}
.pes-player-card.drag-over {
  transform: scale(1.22) !important;
  z-index: 40 !important;
  filter: drop-shadow(0 0 20px #38bdf8) !important;
}
.pes-player-card.drag-over .pes-card-pos {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 22px #38bdf8 !important;
}
.pes-player-card.selected-for-swap {
  transform: scale(1.2) !important;
  z-index: 35 !important;
  /* (pulse removed: a filter animation repainted every frame) */
}
@keyframes swapPulse {
  0% { filter: drop-shadow(0 0 8px #fbbf24); }
  100% { filter: drop-shadow(0 0 24px #f59e0b) drop-shadow(0 0 6px #ffffff); }
}

/* On-pitch specific positioning */
.pes-pitch-card {
  position: absolute;
  transform: translate(-50%, -50%);
}
.pes-pitch-card:hover {
  transform: translate(-50%, -50%) scale(1.16);
}
.pes-pitch-card.selected {
  transform: translate(-50%, -50%) scale(1.2);
}
.pes-pitch-card.selected-for-swap {
  transform: translate(-50%, -50%) scale(1.22) !important;
}

/* Big High-Contrast OVR Rating Tiers */
.pes-card-ovr {
  font-family: 'Rajdhani', sans-serif;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  text-shadow: 
    -1.5px -1.5px 0 #000, 
     1.5px -1.5px 0 #000, 
    -1.5px  1.5px 0 #000, 
     1.5px  1.5px 0 #000,
     0 4px 8px rgba(0,0,0,0.95);
  margin-bottom: 4px;
}
/* 120 - 150: Mutant Mor */
.pes-card-ovr.ovr-mutant {
  color: #d946ef;
  text-shadow: -1.5px -1.5px 0 #701a75, 1.5px -1.5px 0 #701a75, -1.5px 1.5px 0 #701a75, 1.5px 1.5px 0 #701a75, 0 0 18px rgba(217, 70, 239, 0.95);
}
/* 100 - 120: Kırmızı */
.pes-card-ovr.ovr-red {
  color: #ef4444;
  text-shadow: -1.5px -1.5px 0 #7f1d1d, 1.5px -1.5px 0 #7f1d1d, -1.5px 1.5px 0 #7f1d1d, 1.5px 1.5px 0 #7f1d1d, 0 0 16px rgba(239, 68, 68, 0.9);
}
/* 85 - 99: Turuncu */
.pes-card-ovr.ovr-orange {
  color: #f97316;
  text-shadow: -1.5px -1.5px 0 #7c2d12, 1.5px -1.5px 0 #7c2d12, -1.5px 1.5px 0 #7c2d12, 1.5px 1.5px 0 #7c2d12, 0 0 14px rgba(249, 115, 22, 0.85);
}
/* 75 - 84: Sarı */
.pes-card-ovr.ovr-yellow {
  color: #facc15;
  text-shadow: -1.5px -1.5px 0 #713f12, 1.5px -1.5px 0 #713f12, -1.5px 1.5px 0 #713f12, 1.5px 1.5px 0 #713f12, 0 0 14px rgba(250, 204, 21, 0.85);
}
/* 51 - 74: DENEME — Turkuaz/Camgöbeği, açık maviye kaykaymış (bkz. Docs/PlayerOvrColors.md).
   Çim sahası yeşiliyle karışmıyor, gri kadar soluk değil, saf açık mavi kadar parlak değil. */
.pes-card-ovr.ovr-green {
  color: #0891b2;
  text-shadow: -1.5px -1.5px 0 #083344, 1.5px -1.5px 0 #083344, -1.5px 1.5px 0 #083344, 1.5px 1.5px 0 #083344, 0 0 14px rgba(8, 145, 178, 0.85);
}
/* 0 - 50: Beyaz */
.pes-card-ovr.ovr-white, .pes-card-ovr.ovr-grey {
  color: #ffffff;
  text-shadow: -1.5px -1.5px 0 #1e293b, 1.5px -1.5px 0 #1e293b, -1.5px 1.5px 0 #1e293b, 1.5px 1.5px 0 #1e293b, 0 0 14px rgba(255, 255, 255, 0.9);
}

/* Position Badge with Bold Text & Color Bar (Daha Belirgin) */
.pes-card-pos {
  background: #0f172a;
  color: #ffffff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 5px 16px 5px 14px;
  border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85);
  position: relative;
  overflow: hidden;
  margin-bottom: 5px;
  min-width: 62px;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.pes-card-pos::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
}
.pes-pos-gk::before { background: #f59e0b; }
.pes-pos-def::before { background: #0284c7; }
.pes-pos-mid::before { background: #16a34a; }
.pes-pos-att::before { background: #ef4444; }

/* Player Surname Capsule */
.pes-card-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.6px;
  background: rgba(0, 0, 0, 0.88);
  padding: 4px 12px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  max-width: 124px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* ==========================================================================
   SECTIONS 2 & 3: YEDEKLER & REZERV KADRO (ON GRASS WITH MODERN DIVIDER)
   ========================================================================== */

.pes-bench-zone, .pes-reserve-zone {
  max-width: 1560px;
  margin: 0 auto 35px auto;
  position: relative;
}

.pes-zone-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.pes-zone-line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}
.pes-zone-title {
  font-family: 'Chakra Petch', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

/* Modern Rezerv Kadro Divider */
.divider-reserve .pes-zone-line {
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.8), transparent);
}
.divider-reserve .pes-zone-title {
  color: #38bdf8;
  font-size: 16px;
  letter-spacing: 3px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.5), 0 2px 8px rgba(0, 0, 0, 0.9);
}

.pes-cards-shelf {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px 24px;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  border: 1.5px dashed rgba(255, 255, 255, 0.25);
}

.footer {
  margin-top: 30px;
  color: var(--text-dim);
  font-size: 12px;
  text-align: center;
}
.footer code {
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 4px;
}

@container game (max-width: 600px) {
  body { padding: 16px; }
  .progress-panel { flex-direction: column; align-items: flex-start; }
  .reset-btn { margin-left: 0; }
}

/* ==========================================================================
   ULTRA-THIN HAIRLINE OUTLINE (Çok İnce Siyah Kontur Efekti)
   ========================================================================== */
.ultra-thin-outline,
.overview-title,
.training-title,
.match-vs-text,
.team-name,
.drill-name,
.lastmatch-result-title,
.season-summary-title,
.drawer-item,
.btn-primary,
.btn-start-training,
.btn-match-preview,
.topbar-club-name,
.ovr-badge,
.player-pos-badge,
.stat-tag,
.team-role-tag {
  text-shadow: 
    -0.4px -0.4px 0 rgba(0, 0, 0, 0.8),
     0.4px -0.4px 0 rgba(0, 0, 0, 0.8),
    -0.4px  0.4px 0 rgba(0, 0, 0, 0.8),
     0.4px  0.4px 0 rgba(0, 0, 0, 0.8);
}

/* Players away on loan (squadLoans.js) */
.squad-loans-pill {
  align-self: center;
  border: 1.5px solid #fbbf24;
  background: linear-gradient(135deg, #78350f 0%, #1e293b 100%);
  color: #fde68a;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 800;
  font-size: 14px;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.squad-loans-pill:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

/* ==========================================================================
   TELEFON VE KOMPAKT EKRANLAR İÇİN SAHA VE İLK 11 ÖLÇEKLENDİRMESİ
   ========================================================================== */
@container game (max-height: 760px) {
  .pes-squad-fullview {
    padding: 10px 14px 40px 14px;
  }
  .pes-pitch-top-bar {
    padding: 6px 12px;
    margin-bottom: 10px;
    gap: 8px;
  }
  .pes-pitch-stage-container {
    margin: 0 auto 14px auto;
    max-width: min(100%, calc((100cqh - 150px) * (16 / 9.2)));
  }
  .pes-pitch-stage-container .pes-main-pitch {
    max-height: calc(100cqh - 150px);
    aspect-ratio: 16 / 9.2;
    min-height: 280px;
  }
  .pes-pitch-card {
    transform: translate(-50%, -50%) scale(0.85);
  }
  .btn-square-autolineup {
    width: 62px;
    height: 62px;
    font-size: 11px;
  }
}

@container game (max-height: 580px) {
  .pes-squad-fullview {
    padding: 6px 10px 24px 10px;
  }
  .pes-pitch-top-bar {
    padding: 4px 8px;
    margin-bottom: 6px;
    gap: 6px;
  }
  .pes-pitch-stage-container {
    margin: 0 auto 8px auto;
    max-width: min(100%, calc((100cqh - 110px) * (16 / 9.2)));
  }
  .pes-pitch-stage-container .pes-main-pitch {
    max-height: calc(100cqh - 110px);
    aspect-ratio: 16 / 9.2;
    min-height: 240px;
  }
  .pes-pitch-card {
    transform: translate(-50%, -50%) scale(0.72);
  }
  .pes-pitch-card .card-avatar-wrap {
    width: 32px;
    height: 32px;
  }
  .btn-square-autolineup {
    width: 50px;
    height: 50px;
    font-size: 10px;
  }
}

/* Tier-coloured star PNG rows (renderTierStarsHtml) */
.tier-stars-row {
  display: flex;
  align-items: center;
  gap: 2px;
}
.tier-star-img {
  display: block;
  object-fit: contain;
}

/* ==========================================================================
   DURAN TOPLAR & SAHA İÇİ GÖREVLER (Formasyon ile Birebir PES Sahası & Kartları)
   ========================================================================== */
.setpieces-dashboard-container {
  width: 100%;
}

.setpieces-pitch-canvas {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  aspect-ratio: 16 / 9.2;
  position: relative;
  overflow: hidden;
}

.setpieces-roles-layer {
  position: absolute;
  inset: 0;
  pointer-events: auto;
}

.setpiece-role-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), filter 0.18s ease;
  z-index: 10;
}

.setpiece-role-slot:hover {
  transform: translate(-50%, -50%) scale(1.1);
  z-index: 30;
}

.setpiece-role-slot.drag-hover {
  transform: translate(-50%, -50%) scale(1.15);
  filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.95));
  z-index: 40;
}

.role-badge-header {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #facc15;
  border: 1.5px solid rgba(250, 204, 21, 0.7);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.role-player-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.88) 0%, rgba(2, 6, 23, 0.98) 100%);
  border: 2px dashed rgba(255, 255, 255, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  transition: all 0.2s ease;
  overflow: visible;
  position: relative;
}

.setpiece-role-slot.has-assigned-player .role-player-circle {
  border: none;
  background: transparent;
  box-shadow: none;
  width: auto;
  height: auto;
  border-radius: 0;
}

.role-empty-icon {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 2px;
}

.role-empty-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  text-align: center;
  padding: 0 4px;
  line-height: 1.1;
}

.setpiece-assigned-card {
  width: 120px !important;
  position: relative;
}

.btn-clear-role {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dc2626;
  color: #ffffff;
  border: 1.5px solid #ffffff;
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 35;
}

.btn-clear-role:hover {
  transform: scale(1.25);
  background: #ef4444;
}

.setpieces-starters-zone {
  max-width: 1560px;
  margin: 0 auto 35px auto;
  position: relative;
}

.setpieces-starters-zone .pes-cards-shelf {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.setpiece-player-card {
  position: relative;
  flex-shrink: 0;
}

.setpiece-player-card.is-selected-for-role {
  transform: scale(1.16) translateY(-4px) !important;
  z-index: 35 !important;
  filter: drop-shadow(0 0 18px #facc15) !important;
}

.setpiece-player-card.is-selected-for-role .pes-card-pos {
  border-color: #facc15 !important;
  box-shadow: 0 0 16px rgba(250, 204, 21, 0.85) !important;
}

.setpiece-roles-held-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: rgba(15, 23, 42, 0.96);
  border: 1.5px solid #facc15;
  color: #fef08a;
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.85);
  z-index: 25;
}

/* injured player (player/playerInjury.ts): red plaster badge with the days left */
.pes-injury-badge {
  position: absolute;
  bottom: -5px;
  left: -5px;
  z-index: 5;
  padding: 1px 4px;
  border-radius: 4px;
  background: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  pointer-events: none;
}
