/* ==========================================================================
   AURA — Galaxy dark theme
   Mobile-first. Single stylesheet for the whole app.
   ========================================================================== */

/* ---------- Variables ---------- */
:root {
  --bg: #070510;
  --bg2: #0d0a1a;
  --card: rgba(22, 17, 44, 0.72);
  --card-solid: #141026;
  --border: rgba(139, 124, 255, 0.16);
  --text: #f2efff;
  --muted: #a79fd1;
  --faint: #6f669e;
  --brand: #7c5cff;
  --brand2: #00d1ff;
  --grad: linear-gradient(135deg, #7c5cff 0%, #00d1ff 100%);
  --red: #ff5d7a;
  --green: #3ddc97;
  --amber: #ffc24b;
  --r: 12px;
  --r-lg: 18px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Sora', 'Inter', system-ui, sans-serif;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --glow: 0 0 24px rgba(124, 92, 255, 0.35);
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
svg { max-width: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.55;
  /* Starfield: layered radial gradients over deep-space base */
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 72%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(2px 2px at 58% 12%, rgba(160,200,255,.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 74% 38%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 82%, rgba(255,255,255,.45) 50%, transparent 51%),
    radial-gradient(2px 2px at 44% 44%, rgba(190,160,255,.35) 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 64%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 96% 8%, rgba(255,255,255,.6) 50%, transparent 51%),
    radial-gradient(1200px 700px at 85% -10%, rgba(124, 92, 255, 0.16), transparent 60%),
    radial-gradient(900px 600px at 8% 110%, rgba(0, 209, 255, 0.10), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  background-attachment: fixed;
}
a { color: var(--brand2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.25rem; margin: 0 0 0.6rem; }

/* ---------- Layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.main { padding: 20px 0 110px; } /* bottom padding clears the mobile nav */
@media (min-width: 760px) { .main { padding-bottom: 60px; } }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(7, 5, 16, 0.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo {
  font-family: var(--font-display); font-weight: 800; font-size: 1.35rem;
  letter-spacing: 0.14em; color: var(--text); text-decoration: none !important;
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.top-nav { display: none; gap: 4px; margin-left: auto; }
.top-nav a {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem;
  padding: 8px 14px; border-radius: 10px; display: inline-flex; align-items: center; gap: 8px;
}
.top-nav a svg { width: 18px; height: 18px; }
.top-nav a:hover { color: var(--text); background: rgba(124, 92, 255, 0.12); }
.top-nav a.active { color: var(--text); background: rgba(124, 92, 255, 0.18); box-shadow: inset 0 0 0 1px var(--border); }
.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
@media (min-width: 760px) {
  .top-nav { display: flex; }
  .header-actions { margin-left: 12px; }
}
.menu-btn { background: none; border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 8px; cursor: pointer; display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.menu-btn svg { width: 20px; height: 20px; }
.notif-btn { position: relative; }
.notif-badge { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand2); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Custom achievement promo ---------- */
.custom-promo {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 14px 16px; margin: 12px 0 18px;
  background: linear-gradient(135deg, rgba(124,92,255,.14), rgba(0,229,255,.08));
  color: var(--text); text-decoration: none;
}
.custom-promo:hover { text-decoration: none; border-color: var(--brand); }
.custom-promo-icon {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff;
}
.custom-promo-icon svg { width: 22px; height: 22px; }
.chip-custom { background: rgba(124,92,255,.16); color: var(--brand2); border: 1px solid rgba(124,92,255,.4); }

/* ---------- T-shirt reward promo ---------- */
.shirt-promo { display: flex; gap: 18px; align-items: center; padding: 18px; overflow: hidden; }
.shirt-promo-img { width: 150px; flex-shrink: 0; border-radius: var(--r); }
.shirt-promo-body { flex: 1; min-width: 0; }
.progress { height: 10px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--grad); border-radius: 99px; transition: width .6s ease; }
@media (max-width: 640px) {
  .shirt-promo { flex-direction: column; text-align: center; }
  .shirt-promo-img { width: 100%; max-width: 260px; }
}
@media (min-width: 760px) {
  .menu-btn { display: none; }
  .mobile-menu { display: none !important; }
}
/* Mobile dropdown panel: overlays content with a solid background so it
   never collides with the page underneath. */
.mobile-menu {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0; z-index: 60;
  background: #0d0a1d;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
}
.mobile-menu.open { display: block; animation: menu-in 0.18s ease; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.mobile-menu a {
  display: flex; align-items: center; gap: 12px; padding: 12px 8px;
  color: var(--text); font-weight: 600; text-decoration: none; border-radius: 10px;
}
.mobile-menu a svg { width: 20px; height: 20px; color: var(--brand2); }
.mobile-menu a:hover, .mobile-menu a.active { background: rgba(124, 92, 255, 0.14); }

/* ---------- Bottom nav (mobile) ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; justify-content: space-around;
  background: rgba(10, 7, 24, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--faint); text-decoration: none; font-size: 0.68rem; font-weight: 600;
  padding: 6px 14px; border-radius: 10px; min-width: 60px;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: var(--brand2); }
.bottom-nav .nav-add {
  background: var(--grad); color: #fff; border-radius: 50%;
  width: 52px; height: 52px; margin-top: -22px; justify-content: center;
  box-shadow: var(--glow);
}
.bottom-nav .nav-add svg { width: 26px; height: 26px; }
@media (min-width: 760px) { .bottom-nav { display: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-weight: 700; font-size: 0.95rem;
  padding: 12px 22px; border-radius: var(--r); border: 1px solid transparent;
  cursor: pointer; text-decoration: none !important; line-height: 1.2;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--grad); color: #fff; border: none;
  box-shadow: 0 4px 20px rgba(124, 92, 255, 0.4);
}
.btn-primary:hover { box-shadow: 0 4px 28px rgba(124, 92, 255, 0.6); }
.btn-ghost {
  background: rgba(124, 92, 255, 0.1); color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: rgba(124, 92, 255, 0.2); }
.btn-danger { background: rgba(255, 93, 122, 0.12); color: var(--red); border-color: rgba(255, 93, 122, 0.35); }
.btn-danger:hover { background: rgba(255, 93, 122, 0.22); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; border-radius: 10px; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.card-pad { padding: 20px; }
@media (min-width: 760px) { .card-pad { padding: 28px; } }
.card-glow { box-shadow: var(--glow), var(--shadow); border-color: rgba(124, 92, 255, 0.4); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; font-size: 1rem; font-family: var(--font);
  color: var(--text); background: rgba(7, 5, 16, 0.6);
  border: 1px solid var(--border); border-radius: var(--r);
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.25); }
.input::placeholder { color: var(--faint); }
textarea.input { min-height: 110px; resize: vertical; }
select.input option { background: var(--card-solid); }
.field-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .field-grid { grid-template-columns: 1fr 1fr; } }
.hint { font-size: 0.8rem; color: var(--faint); margin-top: 6px; display: block; }
.form-error {
  background: rgba(255, 93, 122, 0.1); border: 1px solid rgba(255, 93, 122, 0.35);
  color: #ffb3c2; border-radius: var(--r); padding: 10px 14px; font-size: 0.9rem;
}
.inline-form { display: inline; }

/* ---------- Banners & flashes ---------- */
.banner {
  border-radius: var(--r); padding: 12px 16px; margin-bottom: 16px;
  display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem;
  border: 1px solid var(--border);
}
.banner svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.banner-warn { background: rgba(255, 194, 75, 0.08); border-color: rgba(255, 194, 75, 0.35); color: #ffdf9e; }
.banner-info { background: rgba(0, 209, 255, 0.08); border-color: rgba(0, 209, 255, 0.35); color: #aee9ff; }
.banner-error { background: rgba(255, 93, 122, 0.08); border-color: rgba(255, 93, 122, 0.35); color: #ffb3c2; }
.banner-ok { background: rgba(61, 220, 151, 0.08); border-color: rgba(61, 220, 151, 0.35); color: #a9f0cd; }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 440px; margin: 32px auto; }
.auth-card { max-width: 430px; margin: 0 auto; text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 28px; box-shadow: var(--shadow); }
.auth-logo { display: inline-block; margin-bottom: 12px; font-size: 1.6rem; }
.auth-alt { margin-top: 16px; display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; flex-wrap: wrap; gap: 8px; }

/* ---------- Avatars ---------- */
.avatar { border-radius: 50%; object-fit: cover; display: inline-block; flex-shrink: 0; background: var(--grad); }
.avatar-sm { width: 36px; height: 36px; }
.avatar-md { width: 64px; height: 64px; }
.avatar-lg { width: 96px; height: 96px; }
.avatar-xl { width: 128px; height: 128px; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-family: var(--font-display); }

/* ---------- Chips & tabs ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 700; padding: 4px 12px; border-radius: 999px;
  background: rgba(124, 92, 255, 0.14); border: 1px solid var(--border); color: var(--muted);
}
.chip svg { width: 14px; height: 14px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; }
.tabs a {
  padding: 10px 18px; border-radius: 999px; white-space: nowrap; font-weight: 700; font-size: 0.9rem;
  color: var(--muted); text-decoration: none; border: 1px solid var(--border);
  display: inline-flex; align-items: center; gap: 8px;
}
.tabs a svg { width: 16px; height: 16px; }
.tabs a.active { background: var(--grad); color: #fff; border: none; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--card); }
.table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 640px; }
.table th, .table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, 0.02); }
@media (max-width: 640px) {
  .table-stack, .table-stack thead, .table-stack tbody,
  .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack thead { display: none; }
  .table-stack { min-width: 0; }
  .table-stack tr { border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 10px; padding: 6px 4px; }
  .table-stack td { border-bottom: none; padding: 6px 14px; }
  .table-stack td:last-child { padding-bottom: 10px; }
}

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); } }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; backdrop-filter: blur(12px); }
.stat .stat-num { font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat .stat-label { font-size: 0.74rem; color: var(--muted); font-weight: 600; margin-top: 2px; }

/* ---------- Toast ---------- */
#toast-root { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
@media (min-width: 760px) { #toast-root { bottom: 30px; } }
.toast {
  background: rgba(20, 16, 38, 0.95); border: 1px solid var(--border); color: var(--text);
  padding: 12px 20px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  box-shadow: var(--shadow); animation: toast-in 0.25s ease; max-width: 92vw;
  overflow: hidden; text-overflow: ellipsis;
}
.toast-success { border-color: rgba(61, 220, 151, 0.5); }
.toast-error { border-color: rgba(255, 93, 122, 0.5); }
.toast-info { border-color: rgba(0, 209, 255, 0.5); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast-out { opacity: 0; transition: opacity 0.3s ease; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; margin-top: 40px; color: var(--faint); font-size: 0.85rem; }
.site-footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
/* Sticky footer: push to viewport bottom on short pages; clear the fixed mobile nav */
body { display: flex; flex-direction: column; }
.main { flex: 1; width: 100%; }
@media (max-width: 759px) {
  .site-footer { padding-bottom: calc(40px + 88px); }
}

/* ---------- Landing ---------- */
.hero { text-align: center; padding: 56px 0 40px; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.hero-badge svg { width: 16px; height: 16px; }
.hero h1 { font-size: 2.4rem; line-height: 1.12; margin-bottom: 14px; }
@media (min-width: 760px) { .hero h1 { font-size: 3.4rem; } }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p.lead { color: var(--muted); font-size: 1.08rem; max-width: 560px; margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.feature-grid { display: grid; gap: 14px; margin: 36px 0; }
@media (min-width: 760px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature { text-align: left; }
.feature .f-icon {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(124, 92, 255, 0.16); border: 1px solid var(--border); margin-bottom: 12px; color: var(--brand2);
}
.feature .f-icon svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 6px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.steps { display: grid; gap: 14px; margin: 24px 0 36px; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step; content: counter(step);
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; margin-bottom: 10px;
  background: var(--grad); color: #fff; font-weight: 800; font-family: var(--font-display);
}
.step h3 { margin: 0 0 6px; font-size: 1.02rem; }
.step p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.section-title { text-align: center; margin: 12px 0 6px; }
.section-sub { text-align: center; color: var(--muted); max-width: 560px; margin: 0 auto 8px; }

/* Sample card preview on landing */
.card-preview { max-width: 340px; margin: 30px auto; transform: rotate(-2deg); }
.share-card {
  background: linear-gradient(160deg, #171233 0%, #0b0722 70%);
  border: 1px solid rgba(124, 92, 255, 0.35); border-radius: 22px;
  padding: 34px 24px; text-align: center; box-shadow: var(--glow), var(--shadow);
  position: relative; overflow: hidden;
}
.share-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(400px 200px at 50% -40px, rgba(124, 92, 255, 0.3), transparent 70%);
}
.share-brand { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.3em; font-size: 0.8rem; color: var(--faint); margin-bottom: 18px; }
.share-avatar { display: block; width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid rgba(0, 209, 255, 0.6); margin: 0 auto 12px; }
.share-avatar-fallback {
  width: 92px; height: 92px; border-radius: 50%; margin: 0 auto 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff; font-size: 2.4rem; font-weight: 800; font-family: var(--font-display);
  border: 3px solid rgba(0, 209, 255, 0.6);
}
.share-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; overflow-wrap: anywhere; }
.share-username { color: var(--muted); font-size: 0.9rem; margin-bottom: 10px; overflow-wrap: anywhere; }
.share-aura { font-family: var(--font-display); font-weight: 800; font-size: 2.6rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.share-aura-label { letter-spacing: 0.4em; font-size: 0.72rem; color: var(--faint); margin-bottom: 12px; }
.share-meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 16px; }
.share-url {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 0.8rem; font-weight: 700; color: var(--brand2);
  background: rgba(0, 209, 255, 0.1); border: 1px solid rgba(0, 209, 255, 0.35);
  padding: 8px 18px; border-radius: 999px;
}
.action-bar { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.guest-cta { text-align: center; margin-top: 22px; color: var(--muted); }

/* ---------- Profile ---------- */
.profile-head { text-align: center; }
.aura-score { font-family: var(--font-display); font-weight: 800; font-size: 2.8rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; line-height: 1.1; }
.aura-label { letter-spacing: 0.42em; font-size: 0.75rem; color: var(--faint); margin-bottom: 8px; }
.ach-list { display: grid; gap: 12px; }
.ach { display: flex; gap: 14px; align-items: flex-start; }
.ach .ach-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(124, 92, 255, 0.14); border: 1px solid var(--border); color: var(--brand2);
}
.ach .ach-icon svg { width: 22px; height: 22px; }
.ach .ach-body { flex: 1; min-width: 0; }
.ach .ach-points { font-weight: 800; color: var(--brand2); white-space: nowrap; }
.ach .ach-meta { font-size: 0.8rem; color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Wizard ---------- */
.wizard-steps { display: flex; gap: 6px; margin-bottom: 22px; list-style: none; padding: 0; }
.wizard-steps .wstep { flex: 1; height: 6px; border-radius: 3px; background: rgba(124, 92, 255, 0.15); }
.wizard-steps .wstep.done { background: var(--grad); }
.wizard-steps li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--faint); text-align: center; }
.wizard-steps li svg { width: 20px; height: 20px; }
.wizard-steps li.active { color: var(--text); }
.wizard-steps li.active svg { color: var(--brand2); }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
.cat-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  color: var(--text); font-weight: 700; font-size: 0.92rem; cursor: pointer; text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}
.cat-card svg { width: 30px; height: 30px; color: var(--brand2); }
.cat-card:hover { border-color: var(--brand); box-shadow: var(--glow); }
.cat-card:active { transform: scale(0.97); }
.cat-card.selected { border-color: var(--brand2); box-shadow: var(--glow); background: rgba(124, 92, 255, 0.14); }

/* ---------- Search ---------- */
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-row .input { flex: 1; min-width: 200px; }

/* ---------- Leaderboard ---------- */
.lb-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--border); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; width: 40px; text-align: center; color: var(--faint); flex-shrink: 0; }
.lb-rank.r1 { color: #ffd76a; } .lb-rank.r2 { color: #cfd6e4; } .lb-rank.r3 { color: #e0a066; }
.lb-row .grow { flex: 1; min-width: 0; }
.lb-score { font-weight: 800; font-family: var(--font-display); white-space: nowrap; }

/* ---------- Utilities ---------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.row { display: flex; gap: 10px; align-items: center; }
.center { justify-content: center; text-align: center; }
.muted { color: var(--muted); } .small { font-size: 0.85rem; } .faint { color: var(--faint); }
.divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--faint); font-size: 0.8rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 12px; }
.icon { display: inline-flex; vertical-align: -3px; }
.icon svg { width: 18px; height: 18px; }

/* ---------- Error pages ---------- */
.error-wrap { text-align: center; padding: 70px 20px; }
.error-code { font-family: var(--font-display); font-size: 4.5rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ==========================================================================
   AURA components — polish pass (mobile-first, responsive)
   Every class below is used by at least one template/JS module.
   ========================================================================== */

/* ---------- Page wrapper ---------- */
.page { max-width: 880px; margin: 0 auto; }
.page > h1:first-child { margin-top: 4px; }

/* ---------- Wizard ---------- */
.wizard { max-width: 720px; margin: 0 auto; }
.type-list { display: grid; gap: 10px; }
.type-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 16px; text-align: left; cursor: pointer; min-height: 56px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  color: var(--text); font-family: var(--font); font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
}
.type-card:hover { border-color: var(--brand); box-shadow: var(--glow); }
.type-card:active { transform: scale(0.99); }
.type-card .chip { margin-left: auto; flex-shrink: 0; }
.radio {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r);
  margin-bottom: 8px; cursor: pointer; font-weight: 600; min-height: 52px;
}
.radio:hover { border-color: var(--brand); }
.radio input { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.radio svg { width: 18px; height: 18px; color: var(--brand2); flex-shrink: 0; }
.review-list { margin: 0 0 8px; display: grid; gap: 10px; }
.review-row {
  display: flex; gap: 12px; padding: 12px 14px;
  background: rgba(7, 5, 16, 0.5); border: 1px solid var(--border); border-radius: var(--r);
}
.review-row dt { font-weight: 700; color: var(--muted); font-size: 0.85rem; min-width: 92px; flex-shrink: 0; }
.review-row dd { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Auth extras ---------- */
.auth-switch { margin-top: 18px; text-align: center; color: var(--muted); font-size: 0.92rem; }
.verify-ic {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.verify-ic svg { width: 30px; height: 30px; }
.verify-ic.ok { background: rgba(61, 220, 151, 0.14); border: 1px solid rgba(61, 220, 151, 0.4); color: var(--green); }
.verify-ic.err { background: rgba(255, 93, 122, 0.14); border: 1px solid rgba(255, 93, 122, 0.4); color: var(--red); }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 18px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.admin-tabs a {
  padding: 10px 16px; border-radius: 10px; white-space: nowrap; font-weight: 700; font-size: 0.88rem;
  color: var(--muted); text-decoration: none; border: 1px solid transparent; min-height: 44px;
  display: inline-flex; align-items: center;
}
.admin-tabs a:hover { color: var(--text); background: rgba(124, 92, 255, 0.1); text-decoration: none; }
.admin-tabs a.active { color: var(--text); background: rgba(124, 92, 255, 0.16); border-color: var(--border); }
.input-sm { padding: 8px 12px; font-size: 0.88rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.evidence-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.evidence-thumbs a { display: inline-block; }
.evidence-thumbs img {
  width: 120px; height: 90px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--border); display: block; background: var(--card-solid);
}
details > summary { cursor: pointer; list-style: none; display: inline-block; }
details > summary::-webkit-details-marker { display: none; }

/* ---------- Status chips ---------- */
.chip-ok { background: rgba(61, 220, 151, 0.12); border-color: rgba(61, 220, 151, 0.4); color: #a9f0cd; }
.chip-warn { background: rgba(255, 194, 75, 0.12); border-color: rgba(255, 194, 75, 0.4); color: #ffdf9e; }
.chip-danger { background: rgba(255, 93, 122, 0.12); border-color: rgba(255, 93, 122, 0.4); color: #ffb3c2; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty-state svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 12px; }
.empty-state p { margin: 0; }

/* ---------- Notifications ---------- */
.notif-list { display: grid; gap: 10px; }
.notif-row { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--text); }
.notif-row.unread { border-color: rgba(124, 92, 255, 0.45); box-shadow: var(--glow), var(--shadow); }
.notif-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(124, 92, 255, 0.14); border: 1px solid var(--border); color: var(--brand2);
}
.notif-icon svg { width: 20px; height: 20px; }
a.notif {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 4px; border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text);
}
a.notif:last-child { border-bottom: none; }
a.notif:hover { text-decoration: none; }
a.notif strong { display: block; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: transparent; flex-shrink: 0; margin-top: 8px; }
.notif-unread .notif-dot { background: var(--brand2); box-shadow: 0 0 8px var(--brand2); }
.notif-unread strong { color: #fff; }

/* ---------- Achievement cards ---------- */
.ach-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .ach-grid { grid-template-columns: repeat(2, 1fr); } }
.ach-card {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 16px; min-width: 0;
}
.ach-card .ach-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(124, 92, 255, 0.14); border: 1px solid var(--border); color: var(--brand2);
}
.ach-card .ach-icon svg { width: 22px; height: 22px; }

/* ---------- Dashboard hero ---------- */
.hero-card { overflow: hidden; position: relative; }
.hero-card h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .hero-card h1 { font-size: 1.35rem; } }
.score-block { text-align: right; margin-left: auto; flex-shrink: 0; }
@media (max-width: 560px) {
  .score-block { text-align: left; margin-left: 0; width: 100%; }
  .score-block .aura-score { font-size: 2.2rem; }
}

/* ---------- Public profile hero ---------- */
.profile-hero { text-align: center; }
.profile-hero .avatar { margin-bottom: 4px; }
.profile-hero h1 { overflow-wrap: anywhere; }
.vis-toggle { margin-left: auto; flex-shrink: 0; min-width: 44px; min-height: 44px; }

/* ---------- Leaderboard & user rows ---------- */
.board-list, .user-list { display: grid; gap: 10px; }
.board-row, .user-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 12px 16px; text-decoration: none; color: var(--text); min-width: 0;
  transition: border-color 0.2s ease, transform 0.1s ease;
}
a.board-row:hover, a.user-row:hover { border-color: var(--brand); text-decoration: none; }
a.board-row:active, a.user-row:active { transform: scale(0.99); }
.board-rank {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  width: 40px; text-align: center; color: var(--faint); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.board-rank svg { width: 22px; height: 22px; }
.board-row.top1 .board-rank { color: #ffd76a; }
.board-row.top2 .board-rank { color: #cfd6e4; }
.board-row.top3 .board-rank { color: #e0a066; }
.board-user { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.board-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.95rem; }
.board-user .muted { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-score { text-align: right; display: flex; flex-direction: column; flex-shrink: 0; }
.board-score strong { font-family: var(--font-display); font-size: 1.15rem; }
.bio-line { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ---------- Search ---------- */
.search-form { margin-bottom: 18px; }

/* ---------- Share card page ---------- */
.share-page { min-height: 100vh; display: flex; flex-direction: column; }
.share-wrap { max-width: 430px; width: 100%; margin: 0 auto; padding: 32px 16px 64px; flex: 1; }

/* ---------- Large icon ---------- */
.icon-xl { width: 48px; height: 48px; }

/* ---------- Responsive safety nets ---------- */
img, video, canvas { max-width: 100%; }
.table-wrap { -webkit-overflow-scrolling: touch; }
@media (max-width: 560px) {
  .hero { padding: 36px 0 28px; }
  .hero h1 { font-size: 2rem; }
  .auth-wrap { margin: 20px auto; }
  .row { flex-wrap: wrap; }
}
