/* XP, ranks, achievements, challenges, sharing, support. Owner: brooktype-b8.
   Flat surfaces, hairlines, brand tokens only. */

.xp-gain { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; align-items: baseline; margin: 0.6rem 0; font-size: 0.85rem; color: var(--ink-soft); }
.xp-gain-n { font-weight: 600; color: var(--sky); font-variant-numeric: tabular-nums; }
.xp-gain-lvl { margin-left: auto; color: var(--ink-faint); }

.xp-card { padding: 1.1rem 1.2rem; border-radius: 18px; background: var(--surface); box-shadow: 0 0 0 1px rgba(var(--shade), 0.12); }
.xp-card h3 { margin: 1rem 0 0.5rem; font-size: 1rem; font-weight: 600; }
.xp-head { display: flex; align-items: center; gap: 0.8rem; }
.xp-head h3 { margin: 0; font-size: 1.25rem; }
.rank-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--ice); color: var(--sky); }
.rank-icon svg { width: 1.5rem; height: 1.5rem; }
.xp-sub { margin: 0; font-size: 0.82rem; color: var(--ink-faint); font-weight: 400; font-variant-numeric: tabular-nums; }
.rank-note { margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.xp-bar { height: 6px; margin: 0.8rem 0 0.4rem; border-radius: 99px; background: var(--ice); overflow: hidden; }
.xp-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-gradient); transition: width 0.6s var(--ease-out); }

.badge-wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.6rem; }
.badge { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 0.8rem; border-radius: 14px; box-shadow: 0 0 0 1px rgba(var(--shade), 0.1); }
.badge-title { font-weight: 600; font-size: 0.9rem; }
.badge-text { font-size: 0.78rem; color: var(--ink-soft); }
.badge-state { margin-top: 0.2rem; font-size: 0.7rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-faint); }
.badge-on { background: var(--ice); box-shadow: 0 0 0 1px rgba(23, 101, 196, 0.35); }
.badge-on .badge-state { color: var(--sky); }
.badge-off { opacity: 0.6; }

.chal-compact { margin: 0 0 0.5rem; font-size: 0.8rem; color: var(--ink-faint); text-align: center; }
.chal-results { margin: 0.8rem 0; }
.chal-h { margin: 0 0 0.4rem; font-size: 0.95rem; font-weight: 600; }
.chal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.chal { display: flex; justify-content: space-between; gap: 1rem; padding: 0.55rem 0.8rem; border-radius: 12px; font-size: 0.85rem; box-shadow: 0 0 0 1px rgba(var(--shade), 0.1); }
.chal-prog { color: var(--ink-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chal-done { background: var(--ice); box-shadow: 0 0 0 1px rgba(30, 154, 82, 0.4); }
.chal-done .chal-prog { color: var(--leaf); }

.friend-result { margin: 0.8rem 0; display: grid; gap: 0.6rem; justify-items: start; }
.friend-verdict { margin: 0; font-size: 0.95rem; }
.friend-card h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.friend-count { margin: 0; font-size: 0.9rem; }

.support-dialog { width: min(30rem, calc(100vw - 2rem)); }
.support-lead { margin: 0.2rem 0 0.8rem; font-size: 0.9rem; color: var(--ink-soft); }
.support-donate { display: inline-flex; text-decoration: none; }
.support-form { display: grid; gap: 0.35rem; }
.support-form h3 { margin: 0.6rem 0 0.2rem; font-size: 1rem; font-weight: 600; }
.support-label { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.4rem; }
.support-form select, .support-form textarea, .support-form input { font: inherit; color: var(--ink); background: var(--field); border: 0; border-radius: 12px; padding: 0.55rem 0.75rem; box-shadow: 0 0 0 1px rgba(var(--shade), 0.16); }
.support-form select:focus-visible, .support-form textarea:focus-visible, .support-form input:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--sky); }
.support-form textarea { resize: vertical; min-height: 6rem; }
.support-actions { display: flex; align-items: center; gap: 0.8rem; margin-top: 0.6rem; }

@media (prefers-reduced-motion: reduce) {
  .xp-bar > span { transition: none; }
}
