/* ===== Sezione TATTICHE ===== */
#section-tattiche #tattiche-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
#section-tattiche #tattiche-controls .style-label { margin-left: 12px; }
#section-tattiche #tattiche-controls .controls-left select { margin-right: 8px; }

/* Layout due colonne */
#section-tattiche #tattiche-container {
  display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap;
}

/* Viewer tattico */
:root { --tactics-pane: 600px; }
#section-tattiche #tactics-field {
  flex: 0 1 var(--tactics-pane);
  max-width: var(--tactics-pane);
  width: 100%;
  background: linear-gradient(180deg, #134e4a 0%, #083344 100%);
  border: 1px solid #0f766e; border-radius: 10px; padding: 10px; position: relative;
  min-height: 380px;
}
#section-tattiche .field-grid {
  position: relative; width: 100%; height: 360px; border-radius: 10px;
  background:
    linear-gradient(transparent 49%, rgba(255,255,255,.15) 50%, transparent 51%) 0/100% 20%,
    linear-gradient(90deg, transparent 49%, rgba(255,255,255,.15) 50%, transparent 51%) 0/20% 100%;
}

/* Slot di posizionamento */
#section-tattiche .slot {
  position: absolute; width: 90px; min-height: 64px;
  border: 2px dashed rgba(255,255,255,.55); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 6px; color: #fff; background: rgba(255,255,255,.06);
  transform: translate(-50%, -50%);
  transition: transform .05s, background .15s, border-color .15s, box-shadow .15s;
  user-select: none; font-size: 0.9rem;
}
#section-tattiche .slot[data-accept="GK"] { border-color: #22d3ee; }
#section-tattiche .slot[data-accept="OUT"] { border-color: #34d399; }
#section-tattiche .slot.drag-over { background: rgba(255,255,255,.18); box-shadow: 0 0 0 3px rgba(255,255,255,.15) inset; }
#section-tattiche .slot .assigned { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
#section-tattiche .assigned .topline { font-weight: 700; font-size: 0.9rem; text-align: center; }
#section-tattiche .assigned .secondary { font-size: 0.8rem; opacity: .95; }
#section-tattiche .suit-bar { width: 100%; height: 6px; background: rgba(255,255,255,.18); border-radius: 999px; overflow: hidden; }
#section-tattiche .suit-fill { height: 100%; width: 0%; background: #10b981; transition: width .25s ease; }
#section-tattiche .suit-fill.low { background: #ef4444; }
#section-tattiche .suit-fill.mid { background: #f59e0b; }
#section-tattiche .suit-fill.high { background: #10b981; }

/* Colonna riserve */
#section-tattiche #reserve-players { flex: 1 1 320px; min-width: 300px; }
#section-tattiche #reserve-players h3 { margin: 0 0 6px; }
#section-tattiche #reserve-list {
  display: grid; gap: 8px; grid-template-columns: 1fr;
  max-height: 360px; overflow: auto;
}

#section-tattiche .player-pill {
  background: #0b1220; border: 1px solid #2b364a; border-radius: 10px;
  padding: 8px 10px; display: flex; align-items: center; justify-content: space-between;
  cursor: grab;
}
#section-tattiche .player-pill.dragging { opacity: .6; }
#section-tattiche .player-pill.disabled { opacity: .5; cursor: not-allowed; text-decoration: line-through; }
#section-tattiche .player-name { margin-right: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70%; }
#section-tattiche .player-ovr { font-variant-numeric: tabular-nums; opacity: .95; }

/* Metriche */
#section-tattiche #metrics-wrap { margin-top: 12px; }
#section-tattiche .team-metrics {
  background: #0f172a; border: 1px solid #1f2a44; border-radius: 10px; padding: 12px;
  width: 100%; max-width: var(--tactics-pane); margin: 0;
}
#section-tattiche .metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
#section-tattiche .metric-card { display: flex; flex-direction: column; gap: 6px; }
#section-tattiche .metric-card .label { font-weight: 700; font-size: .95rem; }
#section-tattiche .metric-bar { width: 100%; height: 12px; background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden; }
#section-tattiche .metric-fill { height: 100%; width: 0%; transition: width .25s ease; }
#section-tattiche .metric-fill.attack  { background: #ef4444; }
#section-tattiche .metric-fill.defense { background: #10b981; }
#section-tattiche .metric-fill.passing { background: #60a5fa; }
#section-tattiche .metric-fill.phys    { background: #a78bfa; }

/* Responsive */
@media (max-width: 640px) {
  #section-tattiche .field-grid { height: 300px; }
  #section-tattiche .slot { width: 82px; min-height: 56px; font-size: 0.85rem; }
  #section-tattiche .metrics-grid { grid-template-columns: 1fr; }
}
