/* ============================================================
   FEATURE CSS: HOME
   Only the home screen uses these. Deleting this file removes
   the home styling and nothing else.
   ============================================================ */

/* ── Rank card ────────────────────────────────────────────── */
.rank-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}
.rank-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
}
.rank-now {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.rank-mark {
  font-size: 1.6rem;
  line-height: 1;
}
.rank-name {
  font-size: 1rem;
  font-weight: var(--body-weight-strong);
}
.rank-next { text-align: right; }
.rank-next-name {
  font-size: 0.84rem;
  font-weight: var(--body-weight-strong);
  color: var(--support-2);
}
.rank-foot {
  display: flex;
  justify-content: space-between;
  gap: var(--s-3);
  font-size: 0.7rem;
  font-weight: var(--body-weight-strong);
  color: var(--text-dimmer);
}

/* ── Streak ───────────────────────────────────────────────── */
.streak {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--s-3) var(--s-4);
}
.streak-mark { font-size: 1.2rem; }
.streak-text { flex: 1; min-width: 0; }
.streak-count {
  font-size: 0.84rem;
  font-weight: var(--body-weight-strong);
}
.streak-sub {
  font-size: 0.66rem;
  color: var(--text-dimmer);
}
.streak-week {
  display: flex;
  gap: var(--s-1);
}
.streak-day {
  width: 8px;
  height: 20px;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, var(--text) 9%, transparent);
}
.streak-day.is-done { background: var(--support-2); }
.streak-day.is-today { background: var(--accent); }

/* ── Quest — the loud element ─────────────────────────────── */
.quest {
  position: relative;
  padding: 2px;
  border-radius: calc(var(--r-xl) + 2px);
  background: linear-gradient(135deg, var(--accent), var(--support), var(--support-2));
  animation: questBreathe 3.4s ease-in-out infinite;
}
@keyframes questBreathe {
  0%, 100% { box-shadow: 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
  50% { box-shadow: 0 0 28px color-mix(in srgb, var(--accent) 45%, transparent); }
}
.quest-inner {
  border-radius: var(--r-xl);
  background: var(--surface);
  padding: var(--s-5);
  display: flex;
  flex-direction: column;
  gap: var(--s-1);
}
.quest-title {
  font-size: 1.2rem;
  font-weight: var(--body-weight-strong);
  margin-top: 2px;
}
.quest-sub {
  font-size: 0.76rem;
  color: var(--text-dimmer);
  margin-bottom: var(--s-3);
}

/* ── Stat tiles ───────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.stat {
  padding: var(--s-3) var(--s-2);
  border-radius: var(--r-md);
  text-align: center;
}
.stat-value {
  font-size: 1.05rem;
  font-weight: var(--body-weight-strong);
}
.stat-label {
  margin-top: 2px;
  font-size: 0.62rem;
  color: var(--text-dimmer);
}

/* ── Mini leaderboard ─────────────────────────────────────── */
.mini-board {
  padding: 0;
  overflow: hidden;
}
.mini-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4) 10px;
  border-bottom: var(--border-w) solid var(--rim);
}
.mini-board-title {
  font-size: 0.76rem;
  font-weight: var(--body-weight-strong);
  color: var(--text-dim);
}
.mini-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px var(--s-4);
  border-bottom: var(--border-w) solid var(--rim);
  transition: background var(--dur-fast) ease;
}
.mini-row:last-child { border-bottom: none; }
.mini-row:hover { background: var(--surface-2); }
.mini-pos {
  min-width: 20px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
  color: var(--text-dimmer);
}
.mini-pos.is-gold { color: var(--tier-gold); }
.mini-pos.is-silver { color: var(--tier-silver); }
.mini-pos.is-bronze { color: var(--tier-bronze); }
.mini-name {
  flex: 1;
  min-width: 0;
  font-size: 0.84rem;
  font-weight: var(--body-weight-strong);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-xp {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}
.mini-row.is-you {
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  box-shadow: inset 2px 0 0 var(--accent);
}
.mini-row.is-you .mini-name,
.mini-row.is-you .mini-xp,
.mini-row.is-you .mini-pos { color: var(--accent-2); }

@media (prefers-reduced-motion: reduce) {
  .quest { animation: none; }
  .bar-fill { transition: none; }
}

/* ── PHASE SESSION CARD ───────────────────────────────────────
   Replaces the old static quest block. The exercise list sits
   inside the same card as the phase header so the whole thing
   reads as one session, not a card followed by a list. */

.phase-quest { padding-bottom: 0; }

.quest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.quest-mark { font-size: 1.5rem; line-height: 1; }

.quest-bar { margin-top: 13px; }
.quest-bar-fill {
  background: var(--form-accent, var(--accent));
  transition: width var(--dur-slow, .6s) var(--ease);
}
.quest-count {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: var(--text-dimmer);
}
.quest-meta {
  margin: 12px 0 0;
  font-size: 0.74rem;
  color: var(--text-dimmer);
}

.quest-body { padding: 14px 0 0; }

.quest-foot {
  padding: 0 0 14px;
  display: flex;
  justify-content: center;
}
.quest-foot button { width: 100%; }

.quest--empty .quest-title { margin-bottom: 6px; }

.home-note {
  margin: 4px 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--text-dimmer);
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .quest-bar-fill { transition: none; }
}
