/* ── ECG-style championship contention pulse ──────────────────────────────
   Amplitude/color driven by --pulse-amp (0–1) and --pulse-state
   (alive | weak | flat), set inline per row by ecg-widget.js */

.ecg-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 64px;
  flex-shrink: 0;
}

.ecg-wrap {
  width: 40px;
  height: 20px;
  overflow: hidden;
  flex-shrink: 0;
}

.ecg-svg {
  width: 200%; /* line is drawn twice-width and scrolls, for a looping effect */
  height: 100%;
  display: block;
}

.ecg-line {
  fill: none;
  stroke: #2ecc71;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* Alive — full animated pulse, amplitude set per-row via --pulse-amp */
.ecg-wrap[data-state="alive"] .ecg-svg {
  animation: ecg-scroll 1.8s linear infinite;
}

.ecg-wrap[data-state="alive"] .ecg-line {
  stroke: #2ecc71;
}

/* ── Leader gets a distinct line colour, reinforcing the trophy ──────────── */
.ecg-wrap[data-state="alive"][data-leader="true"] .ecg-line {
  stroke: #ffd447; /* gold, ties visually to the lit trophy */
}



/* Weak — still mathematically alive, but needs almost everything left.
   Same scroll animation, but the underlying path is pre-flattened by
   ecg-widget.js according to amplitude, and colour shifts toward amber. */
.ecg-wrap[data-state="weak"] .ecg-svg {
  animation: ecg-scroll 1.8s linear infinite;
}

.ecg-wrap[data-state="weak"] .ecg-line {
  stroke: #f5a623;
}

/* Flat — mathematically eliminated. No animation, flat grey line. */
.ecg-wrap[data-state="flat"] .ecg-line {
  stroke: rgba(150,150,160,0.5);
}

@keyframes ecg-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Trophy icon — lit only for the mathematical points leader ──────────── */
.ecg-trophy {
  font-size: 0.8rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.25;
  filter: grayscale(1);
  transition: opacity 0.2s, filter 0.2s;
}

.ecg-trophy.leader {
  opacity: 1;
  filter: none;
}

body.light-theme .ecg-wrap[data-state="flat"] .ecg-line {
  stroke: rgba(0,0,0,0.25);
}


.ecg-wrap.ecg-static .ecg-svg {
  animation: none !important;
}