/* Daily Quests — consumer screen.
 *
 * Follows the monochrome direction (§17.1): chrome stays greyscale, and
 * the only colour is the streak ember. Asset-tier colour arrives with the
 * reward surfaces (ColorBleed, §17.3) — deliberately not invented here,
 * because tier colours are art-directed catalog metadata from the backend
 * rather than something a stylesheet should guess.
 */

.quests_screen {
  padding: 16px 4px 48px;
  max-width: 620px;
  margin: 0 auto;
}

.quests_hdr_row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.quests_title {
  font-size: 1.5rem;
  margin: 0;
}

/* Streak sits in the header because it is the thing worth protecting —
 * it should be readable before the list of things to do. */
.quests_streak {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: .95rem;
}

.quests_streak_flame {
  /* The ember is the one hue on the screen (§17.1). Opacity is driven
   * from JS: dimmed while the day is unfinished. */
  filter: saturate(1.1);
  transition: opacity .25s ease;
}

.quests_streak_count { font-weight: 700; }

/* Left-rail nav entry (quests_nav.js). Hidden server-side until the
 * API confirms the feature is enabled; the flame mirrors the screen's
 * at-risk dimming so the rail carries the same signal. */
.quests_nav_flame {
  font-size: 1.05rem;
  line-height: 1;
  transition: opacity .25s ease;
}

.quests_nav_count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  opacity: .7;
  margin-left: 2px;
}
.quests_streak_label { opacity: .6; }

/* Threshold meter */
.quests_meter { margin: 14px 0 6px; }

.quests_meter_track {
  height: 8px;
  border-radius: 4px;
  background: currentColor;
  opacity: .12;
  overflow: hidden;
}

.quests_meter_fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: currentColor;
  /* Eased rather than instant so an optimistic tick reads as movement
   * the user caused, and a silent correction reads as a settle rather
   * than a glitch. */
  transition: width .35s cubic-bezier(.2, .8, .2, 1);
}

.quests_meter_text {
  margin: 6px 0 0;
  font-size: .85rem;
  opacity: .7;
}

.quests_resets {
  margin: 2px 0 18px;
  font-size: .8rem;
  opacity: .5;
}

.quests_state {
  padding: 24px 0;
  opacity: .6;
  font-size: .9rem;
}

.quests_error { opacity: .9; }

/* Action list */
.quests_list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quests_item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 14%, transparent);
  transition: opacity .25s ease, border-color .25s ease;
}

.quests_item_done {
  /* Completed rows recede rather than disappear: the list should still
   * read as "what today was", not shrink as you go. */
  opacity: .55;
}

.quests_item_tick {
  width: 20px;
  text-align: center;
  font-weight: 700;
}

.quests_item_main { flex: 1; min-width: 0; }

.quests_item_title {
  margin: 0;
  font-weight: 600;
  font-size: .95rem;
}

.quests_item_desc,
.quests_item_prog {
  margin: 2px 0 0;
  font-size: .8rem;
  opacity: .6;
}

.quests_item_pts {
  font-variant-numeric: tabular-nums;
  font-size: .85rem;
  opacity: .55;
}

.quests_footnote {
  margin: 18px 0 0;
  font-size: .8rem;
  opacity: .5;
}

/* Weekly section (Phase W). Same components as the daily list; only the
 * separation is new. Hidden until the server says weekly is enabled. */
.quests_weekly {
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 14%, transparent);
}

.quests_weekly_title {
  font-size: 1.15rem;
  margin: 0;
}

/* In-context toast — where progress is FELT, since most ticks happen
 * while the user is somewhere else in the app. */
.quests_toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 12px);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: .85rem;
  background: rgba(0, 0, 0, .82);
  color: #fff;
  opacity: 0;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 9000;
  pointer-events: none;
}

.quests_toast_in {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Completion celebration. Server-confirmed only (D19) and deduped per
 * day — the reward was banked before any pixel moved, so skipping this
 * costs the user nothing. */
.quests_celebrate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .25s ease;
  z-index: 9500;
}

.quests_celebrate_in { opacity: 1; }

.quests_celebrate_card {
  text-align: center;
  padding: 28px 32px;
  border-radius: 18px;
  background: var(--surface, #111);
  color: var(--on-surface, #fff);
  transform: scale(.96);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}

.quests_celebrate_in .quests_celebrate_card { transform: scale(1); }

.quests_celebrate_art {
  font-size: 2.4rem;
  margin-bottom: 8px;
}

.quests_celebrate_close {
  margin-top: 16px;
  padding: 8px 22px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

/* §16: every animation is skippable and honours reduce-motion, with a
 * static result. Delight is optional; the reward is not — and it was
 * already banked server-side regardless of what happens here. */
@media (prefers-reduced-motion: reduce) {
  .quests_meter_fill,
  .quests_toast,
  .quests_celebrate,
  .quests_celebrate_card,
  .quests_streak_flame {
    transition: none !important;
  }
  .quests_celebrate_card { transform: none; }
}
