/* Pitch */
.formation-pitch {
  position: relative;
  /* Stay within the available content column (sidebar + padding safe) */
  width: 100%;
  max-width: 960px;
  aspect-ratio: 115 / 120;
  margin: 0 auto;
  border: 2px solid #fff;
  border-radius: 8px;
  overflow: hidden;
  background: #033218;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}

.formation-pitch__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  z-index: 0;
  pointer-events: none;
}

.formation-pitch__cards {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Cards */
.formation-card {
  position: absolute;
  left: var(--x);
  top: var(--y);

  /* keep python formation coords as truth, but allow JS to apply a tiny nudge */
  transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, 0px));
  /*will-change: transform;*/
  width: clamp(140px, 13vw, 180px);
  aspect-ratio: 4.5 / 5.0;

  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
  background: #e5e7eb;
  color: #111827;

  /* Drag friendliness */
  touch-action: none;
  user-select: none;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.formation-card:hover {
  z-index: 5;
  box-shadow: 0 6px 14px rgba(0,0,0,0.24);
}

.formation-card.dragging {
  cursor: grabbing;
  z-index: 50;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.formation-card.placeholder-card {
  border: 1px dashed #64748b;
  background: #0b1220;
  color: #e5e7eb;
  box-shadow: inset 0 0 0 1px #1e293b;
  pointer-events: none;
}
