/* ===========================================================================
   JustAscend — dark looksmaxxing community theme
   =========================================================================== */
:root {
  /* Deep night-blue palette — near-black with an icy blue glow */
  --bg: #04060c;
  --bg-2: #060912;
  --surface: #0a0e18;
  --surface-2: #0e131f;
  --surface-3: #141a29;
  --border: #182032;
  --border-strong: #243049;

  --text: #e8edf7;
  --text-dim: #93a0bb;
  --text-faint: #586483;

  --accent: #38a8ff;
  --accent-2: #8fd4ff;
  --accent-soft: rgba(56, 168, 255, 0.14);
  --accent-glow: rgba(70, 175, 255, 0.65);

  --danger: #ef4444;
  --success: #22c55e;
  --gold: #f5b942;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 22px 60px -24px rgba(0, 0, 0, 0.92);
  --shadow-glow: 0 0 0 1px rgba(63, 130, 255, 0.28), 0 20px 70px -16px rgba(63, 130, 255, 0.4);

  --maxw: 1140px;
  --nav-h: 68px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Ambient background ------------------------------------------------------ */
#bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    /* heavy vignette: edges fade to pure black for a mysterious mood */
    radial-gradient(120% 100% at 50% 38%, transparent 30%, rgba(0, 0, 0, 0.55) 78%, #000 100%),
    radial-gradient(900px 520px at 80% -12%, rgba(56, 168, 255, 0.18), transparent 60%),
    radial-gradient(720px 520px at -5% 8%, rgba(40, 110, 220, 0.12), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 55%, #010205);
}
#bg-grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.022) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: radial-gradient(circle at 50% 0%, #000 0%, transparent 78%);
}

/* Slow drifting blue fog/smoke */
#bg-fog {
  position: fixed;
  inset: -25%;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(42% 36% at 22% 28%, rgba(56, 168, 255, 0.22), transparent 60%),
    radial-gradient(46% 40% at 78% 62%, rgba(48, 110, 230, 0.18), transparent 60%),
    radial-gradient(38% 32% at 52% 90%, rgba(70, 150, 255, 0.16), transparent 60%);
  filter: blur(55px);
  opacity: 1;
  animation: fogDrift 26s ease-in-out infinite alternate;
}
@keyframes fogDrift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(3%, -2.5%) scale(1.12); }
  100% { transform: translate(-3%, 2%) scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { #bg-fog { animation: none; } }

/* --- Night-blue neon glow & heading impact ------------------------------- */
.hero h1 .grad { filter: drop-shadow(0 0 26px rgba(63, 130, 255, 0.4)); }
.hero .eyebrow { text-transform: uppercase; letter-spacing: 0.16em; }
.page-head h1 { text-shadow: 0 0 26px rgba(63, 130, 255, 0.16); }
.section-head h2 { text-shadow: 0 0 26px rgba(63, 130, 255, 0.18); }
.brand .accent { text-shadow: 0 0 16px rgba(63, 130, 255, 0.55); }
.nav-links a.active { text-shadow: 0 0 14px rgba(63, 130, 255, 0.6); }
.btn-primary { box-shadow: 0 0 0 1px rgba(63, 130, 255, 0.32), 0 8px 30px -8px var(--accent-glow); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(63, 130, 255, 0.55), 0 12px 44px -6px var(--accent-glow); }
.feature:hover, .role-card:hover, .transform-card:hover, .course-card:hover, .wiki-card:hover { box-shadow: var(--shadow-glow); }
.stat .num, .lb-score strong, .big-points { text-shadow: 0 0 22px rgba(63, 130, 255, 0.35); }
#navbar { box-shadow: 0 1px 0 rgba(63, 130, 255, 0.08), 0 8px 30px -20px rgba(0, 0, 0, 0.9); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }

::selection { background: var(--accent); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 3px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: #3a3a55; }

/* ===========================================================================
   Navbar
   =========================================================================== */
#navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  background: rgba(10, 10, 15, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: 100%;
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 26px;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 1.18rem; letter-spacing: -0.02em; }
.brand-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, var(--accent), #2563eb);
  color: #fff; font-size: 0.85rem; font-weight: 900;
  box-shadow: 0 6px 18px -6px var(--accent-glow);
}
.brand-mark video { width: 100%; height: 100%; object-fit: cover; }
.brand .accent { color: var(--accent-2); }

.nav-links { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.nav-links a {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.94rem;
  position: relative;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
}
.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--accent-2); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-user { display: flex; align-items: center; gap: 10px; }
.nav-user .avatar { width: 34px; height: 34px; }

.nav-burger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; }
.nav-burger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.25s var(--ease); }

/* ===========================================================================
   Buttons & form controls
   =========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600; font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: linear-gradient(135deg, var(--accent), #2563eb); color: #fff; box-shadow: 0 8px 22px -10px var(--accent-glow); }
.btn-primary:hover { box-shadow: 0 12px 30px -8px var(--accent-glow); transform: translateY(-1px); }
.btn-ghost { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-outline { background: transparent; color: var(--text-dim); border-color: var(--border-strong); }
.btn-outline:hover { color: var(--text); border-color: var(--accent); }
.btn-danger { background: rgba(239, 68, 68, 0.12); color: #fca5a5; border-color: rgba(239, 68, 68, 0.3); }
.btn-danger:hover { background: rgba(239, 68, 68, 0.2); }
.btn-sm { padding: 6px 12px; font-size: 0.84rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: 7px; font-weight: 500; }
.input, .textarea, select.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus, select.input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

/* ===========================================================================
   Layout primitives
   =========================================================================== */
#app { flex: 1; width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 38px 22px 70px; }

.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -0.025em; }
.page-head p { color: var(--text-dim); margin-top: 6px; max-width: 60ch; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.breadcrumb { display: flex; gap: 8px; align-items: center; font-size: 0.9rem; color: var(--text-faint); margin-bottom: 16px; }
.breadcrumb a:hover { color: var(--accent-2); }
.breadcrumb .sep { opacity: 0.5; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-member { background: var(--surface-3); color: var(--text-dim); }
.badge-admin { background: rgba(245, 185, 66, 0.16); color: var(--gold); }
.badge-soon { background: var(--accent-soft); color: var(--accent-2); }

/* Moderator — gentle green pulse */
.badge-moderator {
  background: rgba(34, 197, 94, 0.14); color: #6ee7a8;
  animation: modPulse 2.4s ease-in-out infinite;
}
@keyframes modPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
  50%      { box-shadow: 0 0 11px -1px rgba(34, 197, 94, 0.6); }
}

/* Owner — animated gradient glow with a sweeping shine */
.badge-owner {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(245, 185, 66, 0.28), rgba(168, 85, 247, 0.28));
  color: #fcd34d; border: 1px solid rgba(245, 185, 66, 0.45);
  animation: ownerGlow 2.8s ease-in-out infinite;
}
.badge-owner::after {
  content: ''; position: absolute; top: 0; left: -60%;
  width: 45%; height: 100%; transform: skewX(-20deg);
  background: linear-gradient(110deg, transparent, rgba(255, 255, 255, 0.65), transparent);
  animation: ownerShine 3.4s ease-in-out infinite;
}
@keyframes ownerGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(245, 185, 66, 0.35), 0 0 6px -1px rgba(245, 185, 66, 0.45); }
  50%      { box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.55), 0 0 16px 1px rgba(168, 85, 247, 0.55); }
}
@keyframes ownerShine {
  0%        { left: -60%; }
  40%, 100% { left: 160%; }
}

@media (prefers-reduced-motion: reduce) {
  .badge-moderator, .badge-owner { animation: none; }
  .badge-owner::after { display: none; }
}

/* Looksmaxxing tier badge (community-rated) */
.tier-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase;
  color: var(--tc, var(--accent-2));
  background: color-mix(in srgb, var(--tc, var(--accent)) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--tc, var(--accent)) 45%, transparent);
}

.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 0.95rem; color: #fff;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-img img, .avatar-img video { width: 100%; height: 100%; object-fit: cover; }

.hero-logo {
  width: 92px; height: 92px; border-radius: 20px; object-fit: cover;
  margin: 0 auto 18px; display: block; overflow: hidden;
  box-shadow: 0 12px 40px -10px var(--accent-glow);
  border: 1px solid var(--border-strong);
}

.ulink { color: inherit; font-weight: 600; transition: color 0.15s var(--ease); }
.ulink:hover { color: var(--accent-2); }

/* Role-based animated names (replaces inline role badges) */
.uname-tag { font-weight: 600; }
.uname-moderator { color: #6ee7a8; font-weight: 700; text-shadow: 0 0 9px rgba(34, 197, 94, 0.4); }
.uname-admin { color: var(--gold); font-weight: 700; text-shadow: 0 0 9px rgba(245, 185, 66, 0.45); }
.uname-founder { color: #22d3ee; font-weight: 700; text-shadow: 0 0 10px rgba(34, 211, 238, 0.45); }
.badge-founder {
  background: rgba(34, 211, 238, 0.16); color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.4);
}
.uname-owner {
  font-weight: 800;
  background: linear-gradient(90deg, #f5b942, #fcd34d, #a78bfa, #f5b942);
  background-size: 300% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  animation: nameShine 3.2s linear infinite;
}
@keyframes nameShine { to { background-position: 300% center; } }
/* Keep the gradient visible even inside hover-colored links */
.ulink:hover .uname-owner { -webkit-text-fill-color: transparent; }
@media (prefers-reduced-motion: reduce) {
  .uname-owner { animation: none; }
}

/* Hover profile card */
.hovercard {
  position: absolute; z-index: 300; width: 300px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  animation: fadeIn 0.14s var(--ease);
}
.hc-banner { height: 52px; background: linear-gradient(120deg, var(--accent-soft), rgba(168, 85, 247, 0.18)); }
.hc-head { display: flex; justify-content: space-between; align-items: flex-end; padding: 0 16px; margin-top: -26px; }
.hc-head .avatar { border: 3px solid var(--surface-2); }
.hc-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; justify-content: flex-end; }
.hc-name { display: inline-block; font-size: 1.12rem; font-weight: 700; padding: 9px 16px 0; }
.hc-bio { padding: 5px 16px 0; color: var(--text-dim); font-size: 0.85rem; line-height: 1.45; }
.hc-joined { padding: 7px 16px 0; color: var(--text-faint); font-size: 0.78rem; }
.hc-stats { display: flex; padding: 14px 12px; margin-top: 10px; border-top: 1px solid var(--border); }
.hc-stats > div { flex: 1; text-align: center; }
.hc-stats b { display: block; font-size: 1.05rem; color: var(--text); }
.hc-stats span { font-size: 0.7rem; color: var(--text-faint); }
.nav-user-link { display: flex; align-items: center; gap: 10px; }
.nav-user-link:hover { color: var(--accent-2); }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-faint);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty .emoji { font-size: 2.4rem; display: block; margin-bottom: 10px; }

.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 60px auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================================================================
   Hero / landing
   =========================================================================== */
.hero { text-align: center; padding: 48px 0 30px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 0.82rem; font-weight: 600; margin-bottom: 22px;
  border: 1px solid rgba(59, 130, 246, 0.22);
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 900; letter-spacing: -0.04em; line-height: 1.02;
}
.hero h1 .grad {
  background: linear-gradient(120deg, #fff 10%, var(--accent-2) 55%, var(--accent) 90%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { color: var(--text-dim); font-size: clamp(1rem, 2vw, 1.18rem); max-width: 56ch; margin: 22px auto 30px; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.stats-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 46px; }
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 30px; min-width: 150px;
}
.stat .num { font-size: 1.9rem; font-weight: 800; color: var(--accent-2); }
.stat .label { color: var(--text-faint); font-size: 0.86rem; }

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px; margin-top: 56px;
}
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.feature:hover { transform: translateY(-5px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.feature .ico {
  width: 50px; height: 50px; border-radius: 13px; display: grid; place-items: center;
  font-size: 1.5rem; background: var(--accent-soft); margin-bottom: 16px;
}
.feature h3 { font-size: 1.1rem; margin-bottom: 7px; }
.feature p { color: var(--text-dim); font-size: 0.92rem; }

/* ===========================================================================
   Forum / categories
   =========================================================================== */
.cat-list { display: flex; flex-direction: column; gap: 12px; }
.cat-row {
  display: flex; align-items: center; gap: 18px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 22px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.cat-row:hover { transform: translateX(4px); border-color: var(--border-strong); background: var(--surface-2); }
.cat-icon {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent-soft), rgba(99, 102, 241, 0.12));
  border: 1px solid var(--border);
}
.cat-row .meta { flex: 1; min-width: 0; }
.cat-row .meta h3 { font-size: 1.08rem; }
.cat-row .meta p { color: var(--text-dim); font-size: 0.9rem; margin-top: 3px; }
.cat-row .nums { text-align: right; color: var(--text-faint); font-size: 0.82rem; flex-shrink: 0; }
.cat-row .nums strong { color: var(--text); display: block; font-size: 1.1rem; }

/* Forum index (XenForo-style) */
.forum-layout { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.forum-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.forum-section-head {
  background: linear-gradient(180deg, var(--surface-3), var(--surface-2));
  padding: 13px 20px; font-weight: 700; border-bottom: 1px solid var(--border);
}
.forum-row {
  display: grid; grid-template-columns: 48px 1fr auto 230px auto; align-items: center; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--border); cursor: pointer;
  transition: background 0.18s var(--ease);
}
.forum-row:last-child { border-bottom: none; }
.forum-row:hover { background: var(--surface-2); }
.forum-icon {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem;
  background: linear-gradient(135deg, var(--accent-soft), rgba(99, 102, 241, 0.12)); border: 1px solid var(--border);
}
.forum-meta h3 { font-size: 1.04rem; display: flex; align-items: center; gap: 8px; }
.forum-meta p { color: var(--text-dim); font-size: 0.86rem; margin-top: 3px; }
.forum-counts { text-align: right; color: var(--text-faint); font-size: 0.8rem; white-space: nowrap; }
.forum-counts strong { color: var(--text); }
.forum-lastpost { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lp-info { min-width: 0; }
.lp-title { display: block; font-size: 0.86rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-title:hover { color: var(--accent-2); }
.lp-sub { font-size: 0.76rem; color: var(--text-faint); }

.forum-aside { display: flex; flex-direction: column; gap: 16px; }
.side-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.side-head { background: var(--surface-2); padding: 12px 16px; font-weight: 700; font-size: 0.92rem; border-bottom: 1px solid var(--border); }
.side-body { padding: 8px 16px 14px; }
.side-thread { display: block; padding: 9px 0; border-bottom: 1px solid var(--border); }
.side-thread:last-child { border-bottom: none; }
.st-title { font-size: 0.88rem; font-weight: 600; line-height: 1.3; }
.side-thread:hover .st-title { color: var(--accent-2); }
.st-sub { font-size: 0.74rem; color: var(--text-faint); margin-top: 2px; }
.stat-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 0.86rem; color: var(--text-dim); }
.stat-row:last-child { border-bottom: none; }
.stat-row strong { color: var(--text); }

@media (max-width: 880px) {
  .forum-layout { grid-template-columns: 1fr; }
  .forum-row { grid-template-columns: 44px 1fr auto; }
  .forum-row .forum-lastpost { display: none; }
}

/* Threads list */
.thread-list { display: flex; flex-direction: column; gap: 10px; }
.thread-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 15px 18px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.thread-row:hover { border-color: var(--accent); background: var(--surface-2); transform: translateX(3px); }
.thread-row .t-main { flex: 1; min-width: 0; }
.thread-row .t-title { font-weight: 600; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; }
.thread-row .t-sub { color: var(--text-faint); font-size: 0.83rem; margin-top: 4px; }
.thread-row .t-stats { text-align: right; color: var(--text-faint); font-size: 0.82rem; flex-shrink: 0; }
.thread-row .t-stats strong { color: var(--accent-2); }
.pin-tag { color: var(--gold); font-size: 0.78rem; font-weight: 700; }

/* Thread detail / posts */
.post {
  display: flex; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 14px;
  animation: fadeUp 0.4s var(--ease) both;
}
.post.op { border-color: var(--border-strong); box-shadow: inset 3px 0 0 var(--accent); }
.post .p-side { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 96px; flex-shrink: 0; text-align: center; }
.post .p-side .uname { font-weight: 600; font-size: 0.86rem; word-break: break-word; }
.post .p-body { flex: 1; min-width: 0; }
.post .p-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--text-faint); font-size: 0.82rem; }
.post .p-content { white-space: pre-wrap; word-wrap: break-word; line-height: 1.7; color: var(--text); }

/* ===========================================================================
   Transformations (before / after)
   =========================================================================== */
.transform-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.transform-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  animation: fadeUp 0.45s var(--ease) both;
}
.transform-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--border-strong); }
.ba-wrap { position: relative; display: grid; grid-template-columns: 1fr 1fr; aspect-ratio: 2 / 1.3; background: var(--bg-2); }
.ba-wrap .ba-img { width: 100%; height: 100%; object-fit: cover; }
.ba-wrap .ba-tag {
  position: absolute; top: 10px; padding: 4px 10px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  backdrop-filter: blur(6px); background: rgba(0, 0, 0, 0.5);
}
.ba-tag.before { left: 10px; color: #fca5a5; }
.ba-tag.after { right: 10px; color: #6ee7a8; }
.ba-wrap .divider { position: absolute; inset: 0 auto 0 50%; width: 2px; background: linear-gradient(var(--accent), transparent); transform: translateX(-50%); }
.transform-card .tc-body { padding: 16px 18px; }
.transform-card .tc-body h3 { font-size: 1.06rem; }
.transform-card .tc-body p { color: var(--text-dim); font-size: 0.9rem; margin-top: 6px; }
.transform-card .tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; font-size: 0.82rem; color: var(--text-faint); }

/* Image upload preview */
.upload-box {
  display: block; width: 100%;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-sm);
  padding: 16px; text-align: center; cursor: pointer; transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  background: var(--bg-2);
}
.upload-box:hover { border-color: var(--accent); background: var(--surface); }
.upload-box img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.upload-box .ph { color: var(--text-faint); font-size: 0.88rem; padding: 24px 0; }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===========================================================================
   Courses
   =========================================================================== */
.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.course-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
  animation: fadeUp 0.45s var(--ease) both;
}
.course-card:hover { transform: translateY(-5px); border-color: var(--accent); }
.course-card::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 130px; height: 130px; border-radius: 50%;
  background: var(--accent-soft); filter: blur(10px);
}
.course-card .lvl { display: flex; gap: 8px; margin-bottom: 14px; position: relative; }
.course-card h3 { font-size: 1.2rem; position: relative; }
.course-card p { color: var(--text-dim); font-size: 0.92rem; margin: 10px 0 18px; position: relative; }
.course-card .c-foot { display: flex; justify-content: space-between; align-items: center; position: relative; }

.pill { padding: 3px 10px; border-radius: 99px; font-size: 0.76rem; font-weight: 600; background: var(--surface-3); color: var(--text-dim); }

/* ===========================================================================
   Auth pages
   =========================================================================== */
.auth-wrap { max-width: 420px; margin: 30px auto; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 1.6rem; text-align: center; }
.auth-card .sub { text-align: center; color: var(--text-dim); margin: 6px 0 26px; font-size: 0.94rem; }
.auth-switch { text-align: center; margin-top: 18px; color: var(--text-dim); font-size: 0.9rem; }
.auth-switch a { color: var(--accent-2); font-weight: 600; }
.form-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: #fca5a5; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 16px; }
.hint { font-size: 0.78rem; color: var(--text-faint); margin-top: 6px; }
.verify-box { text-align: center; color: var(--text-dim); }
.verify-box .verify-emoji { font-size: 2.6rem; margin-bottom: 10px; }
.verify-box p { line-height: 1.6; }

/* ===========================================================================
   Admin
   =========================================================================== */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; min-width: 560px; }
table.data th, table.data td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
table.data th { color: var(--text-faint); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; background: var(--bg-2); }
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--surface-2); }
select.role-select { padding: 6px 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; }

.tab-bar { display: flex; gap: 6px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.tab-bar button { background: none; border: none; padding: 12px 16px; color: var(--text-dim); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; transition: 0.2s var(--ease); }
.tab-bar button:hover { color: var(--text); }
.tab-bar button.active { color: var(--accent-2); border-bottom-color: var(--accent); }

/* ===========================================================================
   Toast & modal
   =========================================================================== */
#toast-stack { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent); border-radius: var(--radius-sm);
  padding: 13px 18px; min-width: 240px; max-width: 340px;
  box-shadow: var(--shadow); font-size: 0.9rem;
  animation: toastIn 0.35s var(--ease);
}
.toast.error { border-left-color: var(--danger); }
.toast.success { border-left-color: var(--success); }
.toast.leaving { animation: toastOut 0.3s var(--ease) forwards; }

#modal-root:empty { display: none; }
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(4, 4, 9, 0.7); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}
.modal {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg); padding: 28px; width: 100%; max-width: 560px;
  box-shadow: var(--shadow); animation: modalIn 0.3s var(--ease);
  max-height: 90vh; overflow-y: auto;
}
.modal h2 { font-size: 1.3rem; margin-bottom: 4px; }
.modal .modal-sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ===========================================================================
   Animations
   =========================================================================== */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }

.view-enter { animation: viewEnter 0.4s var(--ease); }
@keyframes viewEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Stagger helper for lists */
.stagger > * { animation: fadeUp 0.45s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.1s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.3s; }

/* Welcome / announcement banner (homepage) */
.welcome-banner {
  display: flex; align-items: flex-start; gap: 14px;
  background: linear-gradient(100deg, var(--accent-soft), rgba(34, 211, 238, 0.08) 70%);
  border: 1px solid rgba(63, 130, 255, 0.3); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 24px;
  box-shadow: var(--shadow-glow);
  animation: fadeUp 0.5s var(--ease);
}
.welcome-banner .wb-icon { font-size: 1.5rem; line-height: 1.2; }
.welcome-banner .wb-body { flex: 1; }
.welcome-banner .wb-body strong { color: var(--text); }
.welcome-banner .wb-body p { color: var(--text-dim); font-size: 0.9rem; margin-top: 4px; line-height: 1.5; }
.welcome-banner .wb-close { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 1rem; padding: 2px 6px; border-radius: 6px; }
.welcome-banner .wb-close:hover { background: var(--surface-3); color: var(--text); }

/* ===========================================================================
   Hero particles + scroll reveal + animated counters
   =========================================================================== */
.hero { position: relative; }
#hero-particles {
  position: absolute; inset: -10% -5% 0 -5%;
  width: 110%; height: 120%;
  z-index: 0; pointer-events: none;
  opacity: 0.9;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, transparent 72%);
}
.hero-content { position: relative; z-index: 1; }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ===========================================================================
   Roles showcase (homepage)
   =========================================================================== */
.section-head { text-align: center; margin: 70px 0 30px; }
.section-head h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; }
.section-head h2 .accent { color: var(--accent-2); }
.section-head p { color: var(--text-dim); margin-top: 8px; }

.roles-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.roles-grid .role-card:nth-child(2) { transition-delay: 0.08s; }
.roles-grid .role-card:nth-child(3) { transition-delay: 0.16s; }
.role-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), opacity 0.6s var(--ease);
}
.role-card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow-glow); }
.role-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.role-icon { font-size: 1.8rem; }
.role-perks { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.role-perks li { position: relative; padding-left: 26px; color: var(--text-dim); font-size: 0.92rem; }
.role-perks li::before {
  content: '✓'; position: absolute; left: 0; top: 0;
  color: var(--accent-2); font-weight: 800;
}

/* ===========================================================================
   Transformation voting
   =========================================================================== */
.vote-bar { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.vote-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-weight: 600; font-size: 0.85rem;
  transition: transform 0.12s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.vote-btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.vote-btn .vi { font-size: 0.7rem; }
.vote-btn.up.active { background: rgba(34, 197, 94, 0.16); color: #6ee7a8; border-color: rgba(34, 197, 94, 0.4); }
.vote-btn.down.active { background: rgba(239, 68, 68, 0.14); color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
.vote-score { font-weight: 800; min-width: 28px; text-align: center; color: var(--text-faint); }
.vote-score.pos { color: #6ee7a8; }
.vote-score.neg { color: #fca5a5; }

/* ===========================================================================
   Rich-text composer + markdown rendering
   =========================================================================== */
.composer { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); overflow: hidden; }
.composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.composer-toolbar { display: flex; align-items: center; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; }
.md-btn {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 32px; height: 32px; padding: 0 9px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-dim); cursor: pointer; font-size: 0.86rem;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.md-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--border-strong); }
.md-btn.mono { font-family: ui-monospace, monospace; font-size: 0.78rem; }
.composer-spacer { flex: 1; }
.composer-hint { color: var(--text-faint); font-size: 0.74rem; }
.composer .textarea { border: none; border-radius: 0; background: transparent; }
.composer .textarea:focus { box-shadow: none; }

.p-content.md code, .md code {
  background: var(--bg-2); border: 1px solid var(--border);
  padding: 1px 6px; border-radius: 6px; font-family: ui-monospace, monospace; font-size: 0.88em;
}
.p-content.md a, .md a { color: var(--accent-2); text-decoration: underline; }
.md-img {
  max-width: 100%; max-height: 420px; width: auto;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  margin: 10px 0; display: block;
}
.md h3, .md h4 { margin: 16px 0 8px; line-height: 1.3; }
.md h3 { font-size: 1.2rem; }
.md h4 { font-size: 1.05rem; }
.md ul { margin: 8px 0 8px 4px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md > div { min-height: 1px; }

/* ===========================================================================
   Profile pages
   =========================================================================== */
.profile-edit-grid { display: grid; grid-template-columns: 1fr 300px; gap: 18px; align-items: start; }
.avatar-edit { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 20px; }
.avatar-edit > div { flex: 1; }
.profile-stats-card .stat-line,
.stat-line { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--border); color: var(--text-dim); }
.stat-line:last-child { border-bottom: none; }
.stat-line strong { color: var(--text); }

.profile-hero { position: relative; display: flex; align-items: center; gap: 22px; overflow: hidden; }
.profile-hero-bg {
  position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(600px 200px at 0% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.profile-hero > * { position: relative; z-index: 1; }
.profile-hero h1 { font-size: 1.7rem; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-bio { color: var(--text-dim); margin-top: 8px; max-width: 60ch; }
.profile-bio.muted { color: var(--text-faint); font-style: italic; }
.profile-meta { color: var(--text-faint); font-size: 0.84rem; margin-top: 8px; }
.profile-stats-row { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.profile-stats-row .stat { flex: 1; min-width: 120px; text-align: center; }

/* ===========================================================================
   Community tier rating widget
   =========================================================================== */
.tier-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.tier-card-head h3 { font-size: 1.1rem; }
.tier-summary { color: var(--text-dim); font-size: 0.9rem; }
.tier-official {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 10px 14px;
  background: linear-gradient(100deg, rgba(245,185,66,0.12), transparent 70%);
  border: 1px solid rgba(245,185,66,0.3); border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem;
}
.tier-override-box {
  margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border-strong);
}
.tier-rate { margin-top: 14px; }
.tier-rate-label { color: var(--text-dim); font-size: 0.86rem; margin-bottom: 10px; }
.tier-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.tier-pill {
  padding: 7px 14px; border-radius: 99px; cursor: pointer;
  font-weight: 700; font-size: 0.82rem;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  transition: transform 0.12s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.tier-pill:hover { transform: translateY(-2px); color: var(--text); border-color: var(--tc); }
.tier-pill.active {
  color: #fff; border-color: var(--tc);
  background: color-mix(in srgb, var(--tc) 60%, transparent);
  box-shadow: 0 6px 18px -8px var(--tc);
}

/* ===========================================================================
   Admin moderation
   =========================================================================== */
/* Responsive admin cards (replaces the wide table that overflowed) */
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-card {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 20px;
}
.admin-card .ac-user { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; min-width: 0; }
.ac-id { min-width: 0; }
.ac-name { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-weight: 600; }
.ac-email { font-size: 0.76rem; color: var(--text-faint); word-break: break-all; }
.ac-stats { display: flex; gap: 16px; flex-wrap: wrap; color: var(--text-faint); font-size: 0.82rem; flex: 1 1 200px; }
.ac-stats strong { color: var(--text); }
.ac-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ac-role { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; color: var(--text-dim); }
.ac-role select { padding: 7px 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; }
.ac-grants { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border-strong); }
.grant-label { font-size: 0.8rem; color: var(--text-dim); }
.mute-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Cosmetics inventory */
.cos-preview { padding: 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 1.1rem; }
.cos-item { margin-bottom: 14px; }
.cos-label { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.cos-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.cos-swatch { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; display: grid; place-items: center; padding: 0; background: var(--surface-3); color: var(--text-dim); transition: transform 0.12s var(--ease); }
.cos-swatch:hover { transform: scale(1.1); }
.cos-swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.cos-swatch.cos-custom { position: relative; overflow: hidden; background: conic-gradient(red, orange, yellow, lime, cyan, blue, magenta, red); font-size: 0.8rem; }
.cos-swatch.cos-custom input[type="color"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cos-toggle { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: var(--text-dim); cursor: pointer; }
.cos-toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.mod-actions { display: flex; gap: 6px; }
.mod-flags { display: flex; gap: 6px; margin-top: 3px; }
.flag { font-size: 0.66rem; font-weight: 700; text-transform: uppercase; padding: 1px 6px; border-radius: 5px; letter-spacing: 0.03em; }
.flag.banned { background: rgba(239, 68, 68, 0.16); color: #fca5a5; }
.flag.muted { background: rgba(245, 185, 66, 0.16); color: var(--gold); }
tr.row-banned td { opacity: 0.55; }

/* ===========================================================================
   Premium badge, tags, share
   =========================================================================== */
.premium-badge {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 99px;
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.03em;
  color: #1a1206;
  background: linear-gradient(135deg, #fcd34d, #f5b942);
  box-shadow: 0 2px 10px -3px rgba(245, 185, 66, 0.6);
}

/* Premium: little syringes flying around the username */
.uname-premium {
  position: relative;
  display: inline-block;
  padding: 0 14px; /* room for the flyers on each side */
}
.uname-premium .fx {
  position: absolute;
  top: 50%;
  font-size: 0.72em;
  line-height: 1;
  pointer-events: none;
  /* flyers must not inherit gradient/transparent text clipping from the name */
  -webkit-text-fill-color: initial;
  color: initial;
  background: none;
  filter: drop-shadow(0 0 4px rgba(245, 185, 66, 0.5));
}
.uname-premium .fx1 { animation: flyA 3.4s ease-in-out infinite; }
.uname-premium .fx2 { animation: flyB 3.8s ease-in-out infinite; animation-delay: -1.3s; }
@keyframes flyA {
  0%   { left: -6px;  transform: translateY(-50%) translateY(2px)  rotate(-15deg); opacity: 0; }
  12%  { opacity: 1; }
  35%  { transform: translateY(-50%) translateY(-12px) rotate(12deg) scaleX(-1); }
  60%  { transform: translateY(-50%) translateY(-4px)  rotate(-8deg); }
  88%  { opacity: 1; }
  100% { left: calc(100% - 8px); transform: translateY(-50%) translateY(2px) rotate(-15deg); opacity: 0; }
}
@keyframes flyB {
  0%   { left: calc(100% - 8px); transform: translateY(-50%) translateY(-2px) rotate(15deg) scaleX(-1); opacity: 0; }
  12%  { opacity: 1; }
  40%  { transform: translateY(-50%) translateY(-14px) rotate(-10deg); }
  65%  { transform: translateY(-50%) translateY(-2px)  rotate(8deg) scaleX(-1); }
  88%  { opacity: 1; }
  100% { left: -6px; transform: translateY(-50%) translateY(-2px) rotate(15deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .uname-premium .fx { display: none; } }

/* Premium pill (labeled fields only, e.g. profile settings) */
.premium-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 0.72rem; font-weight: 800; color: #1a1206;
  background: linear-gradient(135deg, #fcd34d, #f5b942);
}

.lock-tag { font-size: 0.7rem; font-weight: 700; color: var(--text-faint); background: var(--surface-3); padding: 3px 9px; border-radius: 99px; vertical-align: middle; }

.tag-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; vertical-align: middle; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 99px;
  font-size: 0.74rem; font-weight: 600;
  background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border);
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
a.tag-chip:hover { color: var(--accent-2); border-color: var(--accent); background: var(--accent-soft); }

.tag-select { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-opt {
  padding: 6px 12px; border-radius: 99px; cursor: pointer; font-size: 0.82rem; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text-dim);
  transition: 0.15s var(--ease);
}
.tag-opt:hover { color: var(--text); border-color: var(--border-strong); }
.tag-opt.active { background: var(--accent-soft); color: var(--accent-2); border-color: var(--accent); }

.share-x {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 99px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  font-weight: 600; font-size: 0.82rem; transition: 0.15s var(--ease);
}
.share-x:hover { background: #fff; color: #000; border-color: #fff; transform: translateY(-1px); }

/* ===========================================================================
   Notifications
   =========================================================================== */
.notif-bell {
  position: relative; display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: 10px; font-size: 1.1rem;
  background: var(--surface-2); border: 1px solid var(--border);
  transition: 0.18s var(--ease);
}
.notif-bell:hover { background: var(--surface-3); border-color: var(--border-strong); }
.notif-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  background: var(--danger); color: #fff; font-size: 0.66rem; font-weight: 800;
  display: grid; place-items: center; border: 2px solid var(--bg);
}
.notif-count[hidden] { display: none; }
.notif-list { display: flex; flex-direction: column; gap: 10px; }
.notif-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 18px; cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.notif-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.notif-row.unread { border-left: 3px solid var(--accent); }
.notif-icon { font-size: 1.3rem; }
.notif-body { flex: 1; }
.notif-time { color: var(--text-faint); font-size: 0.8rem; margin-top: 2px; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* ===========================================================================
   Leaderboard
   =========================================================================== */
.lb-list { display: flex; flex-direction: column; gap: 10px; }
.lb-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 20px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.lb-row:hover { transform: translateX(3px); border-color: var(--border-strong); }
.lb-row.top { border-color: var(--border-strong); }
.lb-row.premium { background: linear-gradient(100deg, rgba(245, 185, 66, 0.08), var(--surface) 40%); border-color: rgba(245, 185, 66, 0.35); }
.lb-rank { font-size: 1.3rem; font-weight: 800; width: 44px; text-align: center; color: var(--text-dim); }
.lb-main { flex: 1; min-width: 0; }
.lb-name { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lb-sub { color: var(--text-faint); font-size: 0.82rem; margin-top: 3px; }
.lb-score { text-align: center; }
.lb-score strong { display: block; font-size: 1.3rem; color: var(--accent-2); }
.lb-score span { font-size: 0.72rem; color: var(--text-faint); }

/* ===========================================================================
   Referral + Premium
   =========================================================================== */
.referral-grid { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
.copy-row { display: flex; gap: 10px; margin: 12px 0 4px; }
.copy-row .input { font-family: ui-monospace, monospace; font-size: 0.86rem; }
.referral-points { text-align: center; }
.big-points { font-size: 3rem; font-weight: 900; color: var(--accent-2); line-height: 1; }
.big-points span { font-size: 1rem; color: var(--text-faint); margin-left: 4px; }

.premium-card { max-width: 480px; margin: 0 auto; text-align: center; }
.premium-active { background: rgba(34, 197, 94, 0.14); color: #6ee7a8; padding: 10px; border-radius: var(--radius-sm); font-weight: 700; margin-bottom: 18px; }
.premium-price { font-size: 2.6rem; font-weight: 900; background: linear-gradient(120deg, #fcd34d, var(--accent-2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.premium-perks { list-style: none; text-align: left; max-width: 320px; margin: 20px auto 24px; display: flex; flex-direction: column; gap: 12px; }
.premium-perks li { color: var(--text-dim); }
.premium-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 24px; border-color: rgba(245, 185, 66, 0.3); background: linear-gradient(100deg, rgba(245, 185, 66, 0.08), var(--surface) 50%); flex-wrap: wrap; }
.ref-note { background: var(--accent-soft); border: 1px solid rgba(59,130,246,0.25); color: var(--accent-2); padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.86rem; margin-bottom: 16px; }

.course-card.locked { opacity: 0.85; }
.course-card.locked h3, .course-card.locked p { filter: blur(0.4px); }
.course-lock { position: absolute; top: 16px; right: 16px; font-size: 1.2rem; z-index: 2; }

/* ===========================================================================
   Wiki
   =========================================================================== */
.wiki-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.wiki-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; transition: transform 0.25s var(--ease), border-color 0.25s var(--ease);
}
.wiki-card:hover { transform: translateY(-4px); border-color: var(--accent); }
.wiki-card h3 { font-size: 1.1rem; }
.wiki-meta { color: var(--text-faint); font-size: 0.82rem; margin-top: 8px; }
.wiki-content { line-height: 1.75; }
.wiki-content h1, .wiki-content h2, .wiki-content h3 { margin: 18px 0 10px; }

/* ===========================================================================
   Search
   =========================================================================== */
.search-box { margin-bottom: 22px; }
.search-box .input { font-size: 1.05rem; padding: 14px 18px; }
.search-section { margin-bottom: 28px; }
.search-section h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.search-section .count { font-size: 0.78rem; color: var(--text-faint); background: var(--surface-3); padding: 2px 8px; border-radius: 99px; }
.search-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.search-user { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.search-user:hover { border-color: var(--accent); transform: translateX(3px); }
.su-name { font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.su-bio { font-size: 0.8rem; color: var(--text-faint); margin-top: 2px; }

/* ===========================================================================
   Rules & partnerships & mod apply
   =========================================================================== */
.rules-card { display: flex; flex-direction: column; gap: 18px; }
.rule-item h3 { font-size: 1.05rem; color: var(--accent-2); margin-bottom: 4px; }
.rule-item p { color: var(--text-dim); font-size: 0.94rem; }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }

/* ===========================================================================
   Footer
   =========================================================================== */
#footer { border-top: 1px solid var(--border); background: var(--bg-2); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-faint); font-size: 0.86rem; align-items: center; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-faint); transition: color 0.15s var(--ease); }
.footer-links a:hover { color: var(--accent-2); }

/* ===========================================================================
   Responsive
   =========================================================================== */
@media (max-width: 820px) {
  .nav-links, .nav-actions .desktop-only { display: none; }
  .nav-burger { display: flex; }
  #navbar.open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--bg-2); border-bottom: 1px solid var(--border); padding: 12px; gap: 4px;
  }
  #navbar.open .nav-links a { width: 100%; }
  .post { flex-direction: column; }
  .post .p-side { flex-direction: row; width: auto; align-self: flex-start; }
  .ba-wrap { aspect-ratio: 2 / 1.5; }
  .profile-edit-grid { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; text-align: center; }
  .referral-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .cat-row .nums { display: none; }
  .upload-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; }
}
