.period-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
}

.period-picker label {
  margin: 0;
}

.period-picker select {
  flex: 1 1 240px;
  max-width: 420px;
}

.stat-highlights {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin-bottom: 1rem;
}

.highlight-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 0;
  border-top: 4px solid var(--cp-accent);
}

.highlight-emoji {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
}

.highlight-label {
  margin: 0 0 0.2rem;
  color: var(--cp-text-muted);
  font-size: 0.82rem;
}

.highlight-value {
  margin: 0;
  font-weight: 700;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.highlight-card.hidden {
  display: none;
}

#hl-progress { border-top-color: #eab308; }
#hl-comeback { border-top-color: #22c55e; }
#hl-record { border-top-color: #ec4899; }
#hl-runner { border-top-color: #3b82f6; }
#hl-active { border-top-color: #f97316; }

/* Rank evolution cell */
.rank-change {
  font-weight: 700;
}

.rank-change.up { color: var(--cp-success); }
.rank-change.down { color: var(--cp-danger); }
.rank-change.same { color: var(--cp-text-muted); font-weight: 600; }

.rank-badge-new {
  display: inline-block;
  background: var(--cp-accent);
  color: var(--cp-accent-fg);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Team section */
.team-section {
  border-top: 4px solid #8b5cf6;
}

.gauge {
  margin: 0.9rem 0;
}

.gauge-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  margin-bottom: 0.35rem;
}

.gauge-title {
  font-weight: 600;
}

.gauge-num {
  color: var(--cp-text-muted);
  font-size: 0.9rem;
}

.gauge-track {
  height: 16px;
  border-radius: 999px;
  background: var(--cp-surface-soft);
  border: 1px solid var(--cp-border);
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cp-accent), #8b5cf6);
  transition: width 0.6s ease;
}

#gauge-run .gauge-fill { background: linear-gradient(90deg, #22c55e, #3b82f6); }
#gauge-swim .gauge-fill { background: linear-gradient(90deg, #06b6d4, #3b82f6); }

.team-counters {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 1rem;
}

.total-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 1rem;
  border: 1px solid var(--cp-border);
  border-radius: 0.75rem;
  background: var(--cp-surface-soft);
  text-align: center;
}

.total-emoji {
  font-size: 1.8rem;
  line-height: 1;
}

.total-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.total-label {
  color: var(--cp-text-muted);
  font-size: 0.85rem;
}
