/* Swim Balance — ML-style stats panel */

.balance-panel {
  background: linear-gradient(135deg, rgba(6, 24, 48, 0.92) 0%, rgba(10, 40, 70, 0.88) 100%);
  border: 1px solid rgba(14, 165, 233, 0.35);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 0;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
  position: relative;
}

.balance-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(14, 165, 233, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.balance-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  position: relative;
  z-index: 1;
}

.balance-panel-title {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 0.5px;
  color: var(--accent);
}

.balance-kda-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--rating-color, var(--accent));
  color: var(--rating-color, var(--accent));
  white-space: nowrap;
}

.balance-layout {
  display: grid;
  grid-template-columns: 1fr min(48vw, 200px);
  gap: 8px 12px;
  align-items: start;
  position: relative;
  z-index: 1;
}

@media (max-width: 380px) {
  .balance-layout {
    grid-template-columns: 1fr;
  }
  .balance-radar-wrap {
    justify-self: center;
  }
}

.balance-kpis {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.balance-kpi {
  position: relative;
  width: 78px;
  height: 78px;
  flex-shrink: 0;
}

.balance-kpi-ring {
  width: 100%;
  height: 100%;
}

.balance-kpi-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 6;
}

.balance-kpi-progress {
  fill: none;
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dasharray 0.6s ease;
}

.balance-kpi--gold .balance-kpi-progress { stroke: var(--gold); filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5)); }
.balance-kpi--green .balance-kpi-progress { stroke: var(--green); filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.5)); }

.balance-kpi-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
}

.balance-kpi-value {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.1;
  color: #fff;
}

.balance-kpi--green .balance-kpi-value { font-size: 22px; }

.balance-kpi-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 2px;
}

.balance-kpi-sub {
  font-size: 9px;
  color: var(--accent2);
  margin-top: 1px;
}

.balance-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
}

.balance-stat-row {
  display: flex;
  flex-direction: column;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.balance-stat-val {
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  line-height: 1.2;
}

.balance-stat-lbl {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.balance-radar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.balance-radar-svg {
  width: 100%;
  max-width: 200px;
  height: auto;
  filter: drop-shadow(0 0 12px rgba(14, 165, 233, 0.25));
}

.radar-ring {
  fill: none;
  stroke: rgba(14, 165, 233, 0.15);
  stroke-width: 1;
}

.radar-spoke {
  stroke: rgba(14, 165, 233, 0.2);
  stroke-width: 1;
}

.radar-fill {
  fill: rgba(14, 165, 233, 0.35);
  stroke: rgba(14, 165, 233, 0.8);
  stroke-width: 2;
  stroke-linejoin: round;
  animation: radarPulse 3s ease-in-out infinite;
}

@keyframes radarPulse {
  0%, 100% { fill-opacity: 0.35; }
  50% { fill-opacity: 0.5; }
}

.radar-dot {
  filter: drop-shadow(0 0 4px currentColor);
}

.radar-label {
  font-size: 8px;
  fill: rgba(226, 244, 255, 0.85);
  font-weight: 600;
  font-family: var(--font);
}

.balance-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.balance-tag-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}

.balance-tag-title {
  font-size: 10px;
  color: var(--muted);
  margin-right: 4px;
}

.balance-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.balance-chip--strong {
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.balance-chip--weak {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.balance-chip--muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.balance-tip {
  font-size: 12px;
  color: var(--accent2);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(14, 165, 233, 0.2);
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

/* Mini badge on team cards */
.balance-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--rating-color, var(--accent));
  font-size: 11px;
}

.balance-mini-pct {
  font-weight: 800;
  color: var(--gold);
}

.balance-mini-rating {
  font-weight: 700;
  color: var(--rating-color);
}

.balance-panel--legend {
  border-color: rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(30, 20, 50, 0.95) 0%, rgba(20, 30, 50, 0.9) 100%);
}

.balance-panel--legend::before {
  background: radial-gradient(ellipse at 80% 20%, rgba(251, 191, 36, 0.15) 0%, transparent 60%);
}

.balance-kpi--legend .balance-kpi-value {
  font-size: 26px;
  background: linear-gradient(180deg, #fde68a, #fbbf24);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.balance-mini--legend {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.15);
}
