/* ── ChicaCharmer personal dashboard + level-up ─────────
   Additive stylesheet, namespaced .dash-* / .levelup-*.
   Uses the existing tokens from style.css (--bg, --surface, --surface2,
   --accent, --accent2, --text, --text-muted, --success, fonts). */

html.cc-ob-active #levelup-overlay { display: none !important; }

#dashboard-screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
#dashboard-screen.dash-in { animation: dash-in 0.3s ease both; }
@keyframes dash-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#dash-content { display: flex; flex-direction: column; gap: 1.1rem; }

/* ── Top bar (obvious way home) ─────────────────────── */
.dash-topbar { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding-top: 0.25rem; }
.dash-back-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  min-height: 44px; padding: 0 1rem 0 0.7rem;
  background: var(--surface); color: var(--text); font: inherit; font-size: 0.9rem; font-weight: 600;
  border: 1px solid var(--surface2); border-radius: 999px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.dash-back-btn svg { width: 18px; height: 18px; }
.dash-back-btn:hover, .dash-back-btn:focus-visible { background: var(--surface2); border-color: var(--accent); }
.dash-back-btn:active { transform: scale(0.96); }
.dash-topbar-title { font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-muted); }

/* ── Profile header ─────────────────────────────────── */
.dash-hero { text-align: center; padding: 0.6rem 0.4rem 0.2rem; }
.dash-hello { font-family: var(--font-display); font-size: 1.15rem; font-weight: 350; color: var(--text-muted); }
.dash-level-chip {
  display: inline-block; margin-top: 0.7rem; padding: 0.22rem 0.8rem;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); border-radius: 999px;
}
.dash-level-name {
  margin-top: 0.55rem; font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.7rem, 8.4vw, 2.3rem); line-height: 1.1; letter-spacing: 0.01em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-wrap: balance;
}
.dash-level-desc { margin: 0.8rem auto 0; max-width: 34ch; font-size: 0.92rem; line-height: 1.5; color: var(--text); font-style: italic; opacity: 0.9; text-wrap: pretty; }

/* ── Cards ──────────────────────────────────────────── */
.dash-card { background: var(--surface); border: 1px solid var(--surface2); border-radius: 14px; padding: 1.1rem 1.1rem 1rem; }
.dash-eyebrow { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.14em; color: var(--text-muted); }

.dash-xp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem 1rem; margin-bottom: 1rem; }
.dash-xp-grid-wide { grid-column: 1 / -1; }
.dash-xp-val { margin-top: 0.2rem; font-size: 1rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.02em; overflow-wrap: anywhere; }
.dash-xp-val--accent { color: var(--accent); }

.dash-bar-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.45rem; }
.dash-bar-count { font-size: 1.05rem; font-weight: 700; }
.dash-bar-togo { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; color: var(--accent2); }
.dash-bar { height: 14px; border-radius: 999px; background: var(--bg); border: 1px solid var(--surface2); overflow: hidden; }
.dash-bar-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.9s cubic-bezier(.16,.84,.44,1);
  min-width: 0;
}
.dash-bar-ends { display: flex; justify-content: space-between; margin-top: 0.3rem; font-size: 0.68rem; color: var(--text-muted); }
.dash-next-hint { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px solid var(--surface2); font-size: 0.85rem; line-height: 1.5; color: var(--text-muted); }
.dash-next-hint b { color: var(--text); font-weight: 650; }

/* max-level state */
.dash-xp--max { text-align: center; border-color: var(--accent2); background: var(--surface); }
.dash-xp-max-title { margin-top: 0.3rem; font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--accent2); }
.dash-xp-total { margin: 0.2rem 0 0.9rem; font-size: 0.95rem; color: var(--text-muted); }
.dash-xp-total b { color: var(--text); font-size: 1.6rem; }
.dash-xp-note { margin-top: 0.8rem; font-size: 0.85rem; color: var(--text-muted); }

/* ── Stats ──────────────────────────────────────────── */
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.dash-stat { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 0.35rem; padding: 0.9rem 0.4rem 0.8rem; text-align: center; background: var(--surface); border: 1px solid var(--surface2); border-radius: 12px; }
.dash-stat-num { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.dash-stat--xp .dash-stat-num { color: var(--accent); }
.dash-stat-label { font-size: 0.58rem; font-weight: 600; letter-spacing: 0.08em; line-height: 1.25; color: var(--text-muted); text-wrap: balance; }
.dash-earn { text-align: center; font-size: 0.75rem; color: var(--text-muted); }

/* ── Your journey ───────────────────────────────────── */
.dash-journey { margin-top: 0.4rem; }
.dash-section-title { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.2em; color: var(--text-muted); margin-bottom: 0.9rem; }
.dash-lvl-list { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; position: relative; }
.dash-lvl { position: relative; display: flex; gap: 0.85rem; padding: 0.95rem 0.95rem 0.95rem 0.8rem; background: var(--surface); border: 1px solid var(--surface2); border-radius: 12px; }
.dash-lvl-dot {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%;
  font-size: 0.8rem; font-weight: 700; color: var(--text-muted); background: var(--bg); border: 1px solid var(--surface2);
}
.dash-lvl-body { min-width: 0; flex: 1; }
.dash-lvl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }
.dash-lvl-title { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.05em; overflow-wrap: anywhere; }
.dash-lvl-pill { flex: none; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.06em; padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--surface2); color: var(--text-muted); white-space: nowrap; }
.dash-lvl-xp { margin-top: 0.15rem; font-size: 0.78rem; font-weight: 600; color: var(--accent2); }
.dash-lvl-desc { margin-top: 0.5rem; font-size: 0.85rem; line-height: 1.5; color: var(--text-muted); text-wrap: pretty; }

.dash-lvl--done .dash-lvl-dot { color: #0f0f1a; background: var(--success); border-color: var(--success); }
.dash-lvl--done .dash-lvl-pill { color: var(--success); border-color: rgba(74, 222, 128, 0.35); }
.dash-lvl--current { border-color: var(--accent); background: var(--surface2); }
.dash-lvl--current .dash-lvl-dot { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; }
.dash-lvl--current .dash-lvl-pill { color: #fff; background: var(--accent); border-color: var(--accent); }
.dash-lvl--current .dash-lvl-desc { color: var(--text); }
.dash-lvl--locked { background: transparent; border-style: dashed; }
.dash-lvl--locked .dash-lvl-title { color: var(--text-muted); }
.dash-lvl--locked .dash-lvl-dot { font-size: 0.7rem; }

/* ── Level-up overlay ───────────────────────────────── */
.levelup-overlay {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(15, 15, 26, 0.78);
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.levelup-overlay.hidden { display: none; }
.levelup-overlay--show { opacity: 1; pointer-events: auto; }
.levelup-card {
  position: relative; width: min(400px, 100%); max-height: 100%; overflow: auto;
  padding: 1.9rem 1.5rem 1.6rem; text-align: center;
  background: var(--surface);
  border: 1px solid var(--surface2); border-radius: 1.3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.82) translateY(14px); opacity: 0;
  transition: transform 0.55s cubic-bezier(.2,.9,.3,1.25), opacity 0.3s ease;
}
.levelup-overlay--show .levelup-card { transform: none; opacity: 1; }
.levelup-kicker {
  font-family: var(--font-display); font-size: clamp(1.9rem, 9vw, 2.4rem); font-weight: 800; letter-spacing: 0.04em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.levelup-badge { display: inline-block; margin-top: 0.7rem; padding: 0.2rem 0.8rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; color: #fff; background: var(--accent); border-radius: 999px; }
.levelup-name { margin-top: 0.7rem; font-family: var(--font-display); font-size: 1.45rem; font-weight: 700; color: var(--accent2); text-wrap: balance; }
.levelup-welcome { margin-top: 0.25rem; font-size: 0.95rem; font-weight: 600; }
.levelup-desc { margin: 0.9rem 0 0; font-size: 0.88rem; line-height: 1.5; font-style: italic; color: var(--text-muted); text-wrap: pretty; }
.levelup-sub { margin-top: 0.9rem; font-size: 0.85rem; color: var(--text); }
.levelup-close-btn {
  margin-top: 1.3rem; padding: 0.75rem 2rem; font: inherit; font-size: 0.95rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent2)); border: none; border-radius: 14px; cursor: pointer;
  transition: opacity 0.15s, transform 0.1s; -webkit-tap-highlight-color: transparent;
}
.levelup-close-btn:hover { opacity: 0.92; }
.levelup-close-btn:active { transform: scale(0.97); }

@media (max-width: 480px) {
  .dash-card { padding: 1rem 0.95rem 0.9rem; }
  .levelup-card { padding: 1.6rem 1.2rem 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  #dashboard-screen.dash-in { animation: none; }
  .dash-bar-fill { transition: none; }
  .dash-bar--max .dash-bar-fill, .levelup-kicker { animation: none; }
  .levelup-card { transition: opacity 0.2s ease; transform: none; }
}

/* ── Reset your Caliente (moved here from the old Learn screen) ── */
.dash-reset { display: flex; justify-content: center; padding: 0.6rem 0 1.4rem; }
.dash-reset-btn {
  min-height: 44px; padding: 0 1.2rem; font: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--text-muted); background: transparent; border: 1px dashed var(--surface2); border-radius: 999px;
  cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s; -webkit-tap-highlight-color: transparent;
}
.dash-reset-btn:hover, .dash-reset-btn:focus-visible { color: var(--text); border-color: var(--accent); background: var(--surface); }
