/* ======================================
   QUESTS (2026-10-03)
   The Quests page and the First days card on General, drawn by
   js/ui/quests.js. A chain is a manuscript checklist - a gilt ring for a
   step not reached, a rubric ring for the current one, a filled seal for
   one done - and the achievements are small leaves, earliest tier first.
   Colours from tokens.css only, so light mode follows by itself.
   ====================================== */

.quests-page {
  padding: 0.75rem;
  max-width: var(--page-default);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.quests-page > .panel-card { margin: 0; }

/* -- The checklist ------------------------------------------------------- */
.quest-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.quest-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--gild-faint);
}
.quest-step:last-child { border-bottom: none; }
.quest-mark {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.2rem;
  border-radius: 50%;
  border: 1.5px solid var(--gild);
  background: transparent;
}
.quest-step.is-current .quest-mark {
  border-color: var(--rubric);
  box-shadow: 0 0 0 3px var(--gild-faint);
}
.quest-step.is-done .quest-mark {
  border-color: var(--accent-gold);
  background: var(--accent-gold);
}
.quest-step-main { flex: 1 1 auto; min-width: 0; }
.quest-step-title {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: var(--fs-text);
  color: var(--text-primary);
  line-height: 1.25;
}
.quest-step.is-locked .quest-step-title { color: var(--text-muted); }
.quest-step.is-done.is-claimed .quest-step-title { color: var(--text-secondary); }
.quest-step-body {
  font-family: var(--font-serif);
  font-size: var(--fs-text);
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0.3rem 0 0;
}

/* -- Progress, rewards, buttons ------------------------------------------ */
.quest-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.45rem;
  max-width: 20rem;
}
.quest-progress .bar-track { flex: 1 1 auto; }
.quest-count {
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.quest-reward {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.45rem;
}
.quest-chip {
  font-family: var(--font-display);
  font-variant: small-caps;
  font-size: var(--fs-small);
  letter-spacing: 0.06em;
  color: var(--gild-ink);
  border: 1px solid var(--gild-faint);
  border-radius: 999px;
  padding: 0.1rem 0.6rem;
  line-height: 1.4;
}
.quest-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.quest-paid {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-small);
  color: var(--text-muted);
}

/* -- The achievements ---------------------------------------------------- */
.ach-tier {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gild-faint);
}
.ach-tier:last-child { border-bottom: none; }
.ach-card {
  border: 1px solid var(--gild-faint);
  border-radius: 2px;
  background: var(--leaf);
  padding: 0.6rem 0.7rem;
  min-width: 0;
}
.ach-card.is-done { border-color: var(--gild); }
.ach-card.is-done:not(.is-claimed) { box-shadow: inset 3px 0 0 var(--rubric); }
.ach-card.is-hidden .ach-title { color: var(--text-muted); letter-spacing: 0.2em; }
.ach-title {
  font-family: var(--font-display);
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: var(--fs-text);
  color: var(--text-primary);
}
.ach-card.is-claimed .ach-title { color: var(--accent-gold); }
.ach-desc {
  font-family: var(--font-serif);
  font-size: var(--fs-small);
  line-height: 1.45;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* -- The card on General ------------------------------------------------- */
.quest-next-pane { margin: 0.9rem 0 1rem; }   /* the same edges as the two columns under it */
.quest-next-claim {
  padding-top: 0.55rem;
  margin-top: 0.55rem;
  border-top: 1px solid var(--gild-faint);
}

@media (max-width: 600px) {
  .quests-page { padding: 0.5rem; }
  .ach-tier { grid-template-columns: 1fr; }
}
