/* ==========================================================================
   Tyag Streak — styles.css
   ==========================================================================
   Aesthetic: "Ember & Mala" — a dark, incense-smoke/ember palette (gold,
   saffron, deep maroon on near-black) for the Duolingo-style streak/gamified
   layer, with the recent-days calendar rendered as a japmala (prayer bead)
   strand instead of a generic contribution-graph grid — a small, deliberate
   nod to Jain counting practice that also happens to read as "gamified".

   Fonts are loaded via a <link> tag in index.html's <head> (not @import)
   for performance (avoids the render-blocking hop @import adds inside CSS).
   This is still just a plain HTTP request from static HTML — no build step
   — so it satisfies the "system fonts or a single Google Font" constraint.
     - Fraunces  → display serif, used for the wordmark, headlines and the
                   big streak number. Has real personality (soft-serif,
                   optical-size axis) — avoids the generic Inter/Space
                   Grotesk look.
     - Manrope   → body/UI sans, humanist and clean, used for everything else.

   Theme: dark is the default/primary surface per the brief. A
   prefers-color-scheme: light override repaints the same tokens onto a warm
   parchment surface — same accent hues, so it still reads as one brand.
   ========================================================================== */

/* -------------------------------- Reset -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
h1, h2, h3, p, figure, ol, ul { margin: 0; padding: 0; }
/* The browser's UA stylesheet sets `[hidden] { display: none }`, but that's
   user-agent origin — ANY normal author-origin `display` declaration below
   (e.g. `.dashboard-view { display: flex }`) wins over it regardless of
   specificity, because cascade origin is resolved before specificity. Several
   components in this file set `display` unconditionally, so without this
   rule, toggling the `hidden` attribute via JS would silently fail to hide
   them. `!important` forces this back to the intended behavior everywhere. */
[hidden] { display: none !important; }
ol, ul { list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; width: 1em; height: 1em; }
img { max-width: 100%; display: block; }

/* ------------------------------ Design tokens --------------------------- */
:root {
  /* Ember accents — shared across both themes */
  --gold: #f2b544;
  --gold-soft: #f6c96b;
  --saffron: #e8823a;
  --ember-red: #c1453b;
  --maroon: #6b1e2e;
  --maroon-deep: #43111d;

  /* Dark theme surface (default) */
  --bg: #0c0908;
  --bg-elevated: #17110f;
  --bg-card: rgba(255, 246, 232, 0.045);
  --bg-card-solid: #1a1411;
  --border-soft: rgba(242, 181, 68, 0.14);
  --border-strong: rgba(242, 181, 68, 0.32);
  --ink: #f4ece0;
  --ink-dim: #b9a999;
  --ink-faint: #7d6e60;
  --shadow-ambient: rgba(0, 0, 0, 0.45);

  --status-missed: #665a4f;
  --status-declined: #9b4a45;
  --status-empty-border: rgba(255, 246, 232, 0.14);
  --track-bg: rgba(255, 246, 232, 0.08);

  --focus-ring: #f6c96b;

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-standard: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6ecda;
    --bg-elevated: #fffaf0;
    --bg-card: rgba(255, 255, 255, 0.62);
    --bg-card-solid: #fffaf0;
    --border-soft: rgba(107, 30, 46, 0.12);
    --border-strong: rgba(107, 30, 46, 0.24);
    --ink: #2b1710;
    --ink-dim: #6b5343;
    --ink-faint: #97826f;
    --shadow-ambient: rgba(107, 60, 30, 0.18);

    --status-missed: #b9ab9a;
    --status-declined: #b5534c;
    --status-empty-border: rgba(43, 23, 16, 0.16);
    --track-bg: rgba(43, 23, 16, 0.08);

    --focus-ring: #a8571f;
  }
}

/* ------------------------------ Ambient bg ------------------------------ */
body {
  background-image:
    radial-gradient(60% 50% at 85% -6%, rgba(242, 181, 68, 0.20), transparent 60%),
    radial-gradient(55% 45% at -10% 15%, rgba(107, 30, 46, 0.30), transparent 60%),
    radial-gradient(80% 60% at 50% 120%, rgba(193, 69, 59, 0.14), transparent 60%);
  background-color: var(--bg);
  background-attachment: fixed;
}
@media (prefers-color-scheme: light) {
  body {
    background-image:
      radial-gradient(60% 50% at 85% -6%, rgba(242, 181, 68, 0.28), transparent 60%),
      radial-gradient(55% 45% at -10% 15%, rgba(107, 30, 46, 0.10), transparent 60%),
      radial-gradient(80% 60% at 50% 120%, rgba(193, 69, 59, 0.08), transparent 60%);
  }
}
/* Fine grain, kept extremely subtle so it reads as texture not noise */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* -------------------------------- Boot ---------------------------------- */
.boot-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.4s var(--ease-standard), visibility 0.4s;
}
.boot-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.boot-flame {
  width: 48px;
  height: 48px;
  color: var(--gold);
  filter: drop-shadow(0 0 18px rgba(242, 181, 68, 0.55));
  animation: flame-flicker 1.6s ease-in-out infinite;
}

/* ------------------------------- Toasts ---------------------------------- */
.toast-region {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-strong);
  color: var(--ink);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  box-shadow: 0 12px 30px var(--shadow-ambient);
  animation: toast-in 0.3s var(--ease-out-back);
}
.toast.toast-error { border-color: rgba(193, 69, 59, 0.5); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ------------------------------ App shell -------------------------------- */
.app-shell {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px 64px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px 22px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-flame {
  width: 26px;
  height: 26px;
  color: var(--gold);
  filter: drop-shadow(0 0 10px rgba(242, 181, 68, 0.45));
  animation: flame-flicker 3.2s ease-in-out infinite;
}
.brand-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(242, 181, 68, 0.3));
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}

.blessing-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.blessing-portrait {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 181, 68, 0.14);
}
.blessing-text {
  font-size: 0.78rem;
  color: var(--ink-dim);
  letter-spacing: 0.02em;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-dim);
  border: 1px solid var(--border-soft);
  transition: transform 0.2s var(--ease-standard), color 0.2s, border-color 0.2s, background 0.2s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--gold); border-color: var(--border-strong); background: var(--bg-card); }
.icon-btn:active { transform: scale(0.9) rotate(20deg); }
.icon-btn.is-spinning svg { animation: spin 0.7s linear; }

/* --------------------------------- Views --------------------------------- */
.view { animation: view-in 0.45s var(--ease-standard) both; }
@keyframes view-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------- Card base ------------------------------ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 22px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 18px 40px -22px var(--shadow-ambient);
}
.card-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.card-heading h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

/* ============================================================================
   ONBOARDING
   ============================================================================ */
.onboarding-hero { padding: 18px 4px 26px; text-align: left; }
.onboarding-title {
  font-family: var(--font-display);
  font-weight: 340;
  font-size: clamp(2.2rem, 9vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.onboarding-title em {
  font-style: italic;
  font-weight: 600;
  background: linear-gradient(100deg, var(--gold-soft), var(--saffron) 55%, var(--ember-red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.onboarding-sub {
  margin-top: 14px;
  max-width: 42ch;
  color: var(--ink-dim);
  font-size: 1rem;
  line-height: 1.55;
}

.onboarding-card { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.select-wrap { position: relative; }
select, input[type="tel"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  color: var(--ink);
  font-size: 1rem;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
select { padding-right: 42px; }
select:focus-visible, input:focus-visible {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(242, 181, 68, 0.22);
}
.select-caret {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--ink-faint);
  pointer-events: none;
}
.field-hint { font-size: 0.78rem; color: var(--ink-faint); }
.field-hint.field-error { color: var(--ember-red); }
.link-btn { text-decoration: underline; font-weight: 700; color: inherit; }

/* --------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.15s var(--ease-standard), box-shadow 0.2s, opacity 0.2s, filter 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }
.btn-icon { width: 18px; height: 18px; }

.btn-primary {
  color: #201005;
  background: linear-gradient(120deg, var(--gold-soft), var(--gold) 45%, var(--saffron));
  box-shadow: 0 10px 26px -8px rgba(232, 130, 58, 0.55);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-glow { position: relative; }
.btn-glow::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--gold-soft), var(--ember-red));
  z-index: -1;
  opacity: 0.35;
  filter: blur(14px);
  transition: opacity 0.2s;
}
.btn-glow:hover::after { opacity: 0.55; }

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--gold); }

.btn-accept, .btn-decline {
  flex: 1;
  padding: 14px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s var(--ease-standard), filter 0.2s, opacity 0.2s;
}
.btn-accept:active, .btn-decline:active { transform: scale(0.96); }
.btn-accept {
  color: #201005;
  background: linear-gradient(120deg, var(--gold-soft), var(--saffron));
}
.btn-decline {
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--border-strong);
}
.btn-decline:hover { border-color: var(--ember-red); color: var(--ember-red); }
.btn-accept:disabled, .btn-decline:disabled { opacity: 0.55; cursor: not-allowed; }

.onboarding-status {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--ink-dim);
  text-align: center;
}
.onboarding-status.is-error { color: var(--ember-red); }
.onboarding-fineprint {
  font-size: 0.74rem;
  color: var(--ink-faint);
  text-align: center;
  line-height: 1.4;
}

/* ============================================================================
   DASHBOARD
   ============================================================================ */
.dashboard-view { display: flex; flex-direction: column; gap: 20px; }

.notice-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--ink-dim);
  animation: view-in 0.3s var(--ease-standard);
}
.notice-banner svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--gold); }
.notice-banner span { flex: 1; }
.notice-banner .link-btn { color: var(--gold-soft); flex-shrink: 0; white-space: nowrap; }
.notice-banner .link-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.notice-dismiss { width: 22px; height: 22px; display: grid; place-items: center; color: var(--ink-faint); flex-shrink: 0; }
.notice-dismiss svg { width: 13px; height: 13px; }

.city-pill {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-soft);
  background: linear-gradient(120deg, rgba(242, 181, 68, 0.16), rgba(193, 69, 59, 0.10));
  border: 1px solid var(--border-soft);
  padding: 6px 14px;
  border-radius: 999px;
}

/* ------------------------------- Streak hero ------------------------------ */
.streak-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 0 6px;
}
.streak-flame-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  margin-bottom: 6px;
}
.streak-flame-glow {
  position: absolute;
  inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242, 181, 68, 0.35), transparent 68%);
  filter: blur(4px);
  animation: glow-pulse 3.6s ease-in-out infinite;
}
.streak-flame {
  position: relative;
  width: 64px;
  height: 64px;
  color: var(--gold);
  filter: drop-shadow(0 0 22px rgba(242, 181, 68, 0.6));
  animation: flame-flicker 2.6s ease-in-out infinite;
}
.ember-burst { position: absolute; inset: 0; pointer-events: none; }
.ember-burst span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 8px 2px rgba(242, 181, 68, 0.7);
  opacity: 0;
}
.ember-burst.is-bursting span { animation: ember-float 1.1s var(--ease-standard) forwards; }
.ember-burst span:nth-child(1) { animation-delay: 0s;   --dx: -46px; --dy: -70px; }
.ember-burst span:nth-child(2) { animation-delay: .05s; --dx: 10px;  --dy: -86px; }
.ember-burst span:nth-child(3) { animation-delay: .1s;  --dx: 52px;  --dy: -54px; }
.ember-burst span:nth-child(4) { animation-delay: .02s; --dx: -20px; --dy: -92px; }
.ember-burst span:nth-child(5) { animation-delay: .12s; --dx: 34px;  --dy: -74px; }
.ember-burst span:nth-child(6) { animation-delay: .08s; --dx: -54px; --dy: -40px; }

.streak-number-wrap { line-height: 1; }
.streak-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(4rem, 22vw, 5.6rem);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--gold-soft), var(--saffron) 60%, var(--ember-red));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.streak-number.is-incrementing { animation: streak-pop 0.7s var(--ease-out-back); }
.streak-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-top: 2px;
}
.streak-affirmation {
  margin-top: 10px;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-dim);
  font-family: var(--font-display);
  max-width: 32ch;
}

/* -------------------------------- Today card ------------------------------ */
.today-card { min-height: 132px; }
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.today-eyebrow { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-faint); }
.today-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.today-badge svg { width: 11px; height: 11px; }
.today-badge.badge-accepted { background: rgba(242, 181, 68, 0.16); color: var(--gold-soft); }
.today-badge.badge-declined { background: rgba(193, 69, 59, 0.16); color: var(--status-declined); }

.today-content {
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.5;
  margin-bottom: 18px;
  color: var(--ink);
}
.today-actions { display: flex; gap: 12px; }
.today-rest {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--ink-dim);
  padding: 6px 0;
}
.today-rest svg { width: 26px; height: 26px; color: var(--gold-soft); flex-shrink: 0; }
.today-rest-text strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; margin-bottom: 2px; }
.today-error { font-size: 0.82rem; color: var(--ember-red); margin-top: 10px; }

/* ------------------------------- Calendar / mala --------------------------- */
.calendar-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scroll-snap-type: x proximity;
  -ms-overflow-style: none;
  scrollbar-width: thin;
}
.calendar-strip::-webkit-scrollbar { height: 5px; }
.calendar-strip::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }

.bead-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  scroll-snap-align: start;
  flex-shrink: 0;
}
.bead-col .bead-date { font-size: 0.62rem; color: var(--ink-faint); }

.bead {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: transform 0.2s var(--ease-standard);
}
.bead-accepted {
  background: linear-gradient(135deg, var(--gold-soft), var(--saffron));
  box-shadow: 0 0 10px 1px rgba(242, 181, 68, 0.55);
}
.bead-declined {
  background: rgba(193, 69, 59, 0.28);
  border: 1.5px solid var(--status-declined);
}
.bead-missed {
  background: transparent;
  border: 1.5px dashed var(--status-missed);
}
.bead-empty {
  background: transparent;
  border: 1.5px dotted var(--status-empty-border);
}
.bead-pending {
  background: transparent;
  border: 1.5px dashed var(--gold);
  animation: bead-pulse 2.4s ease-in-out infinite;
}
.bead-unknown { background: var(--ink-faint); opacity: 0.4; }
.bead-col.is-today .bead-accepted { animation: bead-pulse 2.4s ease-in-out infinite; }
.bead-col.is-today .bead-date { color: var(--gold-soft); font-weight: 700; }

.bead-legend { width: 12px; height: 12px; }
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
  font-size: 0.76rem;
  color: var(--ink-faint);
}
.calendar-legend li { display: flex; align-items: center; gap: 6px; }

/* --------------------------------- Stats ---------------------------------- */
.stat-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.stat-tile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat-caption { font-size: 0.76rem; color: var(--ink-faint); }

.leaderboard { display: flex; flex-direction: column; gap: 2px; }
.leaderboard li, .leaderboard-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.9rem;
}
.leaderboard li:last-child, .leaderboard-row:last-child { border-bottom: none; }
.leaderboard-rank {
  width: 20px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.leaderboard-name { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-streak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.leaderboard-streak svg { width: 12px; height: 12px; }

.city-bar-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--track-bg);
  overflow: hidden;
}
.city-bar-fill {
  /* Both children here are plain <span>s (kept semantically light on
     purpose), but a <span> defaults to display:inline, which silently
     ignores width/height — without this, the fill would render at zero
     size regardless of its inline width:NN% style. */
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--saffron), var(--gold-soft));
}
.empty-row { color: var(--ink-faint); font-size: 0.85rem; padding: 6px 4px; }

/* -------------------------------- Error state ------------------------------ */
.dashboard-error {
  text-align: center;
  padding: 20px;
  color: var(--ink-dim);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

/* ============================================================================
   SKELETONS
   ============================================================================ */
.skeleton-block { display: block; }
/* (hiding on [hidden] is handled globally near the top of this file) */

.skeleton-line, .skeleton-beads, .skeleton-stat-row, .skeleton-text {
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
  border-radius: 8px;
}
.skeleton-line { height: 14px; margin-bottom: 10px; border-radius: 6px; }
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-beads { height: 22px; border-radius: 999px; }
.skeleton-stat-row { height: 76px; border-radius: var(--radius-md); }
.streak-number.skeleton-text {
  -webkit-background-clip: initial;
  background-clip: initial;
  color: transparent;
  width: 140px;
  height: 74px;
  border-radius: 16px;
  background-image: none !important;
}

.skeleton-line::after, .skeleton-beads::after, .skeleton-stat-row::after, .streak-number.skeleton-text::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(242, 181, 68, 0.14), transparent);
  animation: shimmer 1.6s infinite;
}

/* ============================================================================
   ANIMATIONS
   ============================================================================ */
@keyframes flame-flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.04, 0.97) rotate(-1.5deg); }
  50% { transform: scale(0.97, 1.05) rotate(1deg); }
  75% { transform: scale(1.02, 0.98) rotate(-0.5deg); }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}
@keyframes bead-pulse {
  0%, 100% { box-shadow: 0 0 10px 1px rgba(242, 181, 68, 0.55); }
  50% { box-shadow: 0 0 16px 4px rgba(242, 181, 68, 0.85); }
}
@keyframes streak-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.18); }
  60% { transform: scale(0.96); }
  100% { transform: scale(1); }
}
@keyframes ember-float {
  0% { opacity: 0; transform: translate(-50%, -50%) translate(0, 0) scale(0.6); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--dx), var(--dy)) scale(1); }
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Staggered section entrance on first dashboard paint */
.dashboard-view.is-entering > * {
  animation: view-in 0.5s var(--ease-standard) both;
}
.dashboard-view.is-entering > *:nth-child(1) { animation-delay: 0.02s; }
.dashboard-view.is-entering > *:nth-child(2) { animation-delay: 0.06s; }
.dashboard-view.is-entering > *:nth-child(3) { animation-delay: 0.12s; }
.dashboard-view.is-entering > *:nth-child(4) { animation-delay: 0.18s; }
.dashboard-view.is-entering > *:nth-child(5) { animation-delay: 0.24s; }
.dashboard-view.is-entering > *:nth-child(6) { animation-delay: 0.30s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Focus visibility everywhere (accessibility) */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ------------------------------- Responsive -------------------------------- */
@media (min-width: 640px) {
  .app-shell { padding-top: 40px; }
  .onboarding-title { font-size: 3.4rem; }
}
