/* ═══════════════════════════════════════════
   CHARTS — Animated Bar / Donut / Pie
═══════════════════════════════════════════ */

/* ── Bar Chart ── */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 100%;
  width: 100%;
  padding-bottom: 4px;
}

.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
  min-width: 0;
}

.chart-bar-value {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  transition: all var(--t-normal);
}

.chart-bar-track {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border-radius: 6px 6px 3px 3px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  flex: 1;
  max-height: calc(100% - 52px);
}

.chart-bar-fill {
  width: 100%;
  border-radius: 6px 6px 3px 3px;
  transition: height 0.65s cubic-bezier(0.34,1.1,0.64,1);
  position: relative;
  min-height: 4px;
  transform-origin: bottom center;
}

.chart-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.2), transparent);
  border-radius: inherit;
}

.chart-bar-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* ── Canvas-based Donut / Pie ── */
.chart-circular-wrap {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 100%;
  width: 100%;
}

.chart-circular-canvas {
  flex-shrink: 0;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chart-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.chart-legend-label {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chart-legend-value {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* ── Empty State ── */
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  color: rgba(255,255,255,0.25);
  font-size: 13px;
  font-weight: 500;
}

.chart-empty-icon {
  font-size: 36px;
  opacity: 0.3;
}

/* ── Mini Bar Chart (Participant Results) ── */
.mini-bars {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.mini-bar-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.mini-bar-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.mini-bar-track {
  flex: 1;
  height: 10px;
  background: var(--surface-3);
  border-radius: var(--r-full);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: var(--r-full);
  transition: width 0.65s cubic-bezier(0.4,0,0.2,1);
  min-width: 3px;
}

.mini-bar-pct {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text-accent);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Real-time animation pulse ── */
@keyframes barPop {
  0%   { transform: scaleY(0.95); }
  50%  { transform: scaleY(1.02); }
  100% { transform: scaleY(1); }
}

.chart-bar-fill.updated {
  animation: barPop 0.3s ease;
}
