/* ═══════════════════════════════════════════════════════════
   Marche Vanilla — Marketplace Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Tokens ────────────────────────────────────────────── */
:root {
  --bg: #0F172A;
  --bg-card: #1E293B;
  --bg-input: #0F172A;
  --border: #334155;
  --border-hover: #475569;
  --text: #F8FAFC;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --primary: #1F6FEB;
  --primary-hover: #1A5EC7;
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;
  --purple: #8B5CF6;
  --pink: #EC4899;
  --amber: #F59E0B;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section { padding: 48px 0; }
.section-title { font-size: 24px; font-weight: 700; margin-bottom: 24px; }
.section-subtitle { font-size: 16px; color: var(--text-muted); margin-bottom: 32px; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.loading { text-align: center; padding: 40px; color: var(--text-muted); }

/* ── Navbar ────────────────────────────────────────────── */
#navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; height: 60px; gap: 24px;
}
.nav-brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.nav-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: var(--primary); color: #fff;
  border-radius: 8px; font-size: 13px; font-weight: 800;
}
.nav-links { display: flex; gap: 20px; flex: 1; }
.nav-links a { color: var(--text-muted); font-size: 14px; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text); }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; cursor: pointer; }
.lang-select {
  background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 8px; font-size: 12px; font-family: var(--font); cursor: pointer;
}
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff;
}
.btn-nav {
  padding: 6px 16px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  background: var(--primary); color: #fff; border: none; cursor: pointer; transition: background 0.2s;
}
.btn-nav:hover { background: var(--primary-hover); }
.btn-logout { background: transparent; color: var(--text-muted); font-size: 16px; padding: 6px 8px; }
.btn-logout:hover { color: var(--error); background: transparent; }

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  padding: 80px 0 60px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(31,111,235,0.15), transparent 70%);
}
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; margin-bottom: 16px; }
.hero-subtitle { font-size: 18px; color: var(--text-muted); margin-bottom: 32px; }
.search-bar {
  display: flex; max-width: 600px; margin: 0 auto; gap: 8px;
}
.search-bar input {
  flex: 1; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  font-size: 15px; font-family: var(--font); outline: none; transition: border-color 0.2s;
}
.search-bar input:focus { border-color: var(--primary); }

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff; font-size: 14px; font-weight: 600;
  border: none; cursor: pointer; transition: background 0.2s; font-family: var(--font);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 24px; border-radius: var(--radius-sm);
  background: transparent; color: var(--text); font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); cursor: pointer; transition: all 0.2s; font-family: var(--font);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-secondary.liked { border-color: var(--error); color: var(--error); }

/* ── Stats Row ─────────────────────────────────────────── */
.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.stat-card {
  flex: 1; min-width: 140px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.stat-number { font-size: 32px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

/* ── Category Grid ─────────────────────────────────────── */
.category-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.category-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 16px; text-align: center; transition: all 0.2s; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.category-card:hover { border-color: var(--primary); transform: translateY(-2px); }
.category-icon { font-size: 36px; }

/* ── Listing Grid & Cards ──────────────────────────────── */
.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.listing-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: all 0.2s; display: block;
}
.listing-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.card-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-thumb-placeholder {
  width: 100%; aspect-ratio: 16/9; display: flex; align-items: center; justify-content: center;
  background: var(--bg); font-size: 48px;
}
.card-body { padding: 16px; }
.card-type-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.badge-application { background: rgba(31,111,235,0.15); color: var(--primary); }
.badge-template { background: rgba(139,92,246,0.15); color: var(--purple); }
.badge-service { background: rgba(16,185,129,0.15); color: var(--success); }
.badge-portfolio { background: rgba(245,158,11,0.15); color: var(--amber); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-author { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.card-rating { color: var(--warning); }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.card-stats { display: flex; gap: 16px; font-size: 13px; color: var(--text-dim); }

/* ── Tags ──────────────────────────────────────────────── */
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  background: rgba(100,116,139,0.2); color: var(--text-muted); font-size: 11px;
}

/* ── Filter Bar & Tabs ─────────────────────────────────── */
.filter-bar { margin-bottom: 32px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: var(--font);
}
.tab-btn:hover { border-color: var(--primary); color: var(--text); }
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.filter-controls { display: flex; gap: 12px; flex-wrap: wrap; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-family: var(--font); outline: none; transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--primary); }
.form-textarea { resize: vertical; }
.form-select { cursor: pointer; }

/* ── Publish Form ──────────────────────────────────────── */
.publish-form { max-width: 700px; }
.type-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.type-option { cursor: pointer; }
.type-option input { display: none; }
.type-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 8px; border-radius: var(--radius); border: 2px solid var(--border);
  transition: all 0.2s; text-align: center;
}
.type-option input:checked + .type-card { border-color: var(--primary); background: rgba(31,111,235,0.1); }
.type-card:hover { border-color: var(--border-hover); }
.type-icon { font-size: 28px; }
.screenshot-preview { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.screenshot-thumb { width: 100px; height: 60px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); }

/* ── Listing Detail ────────────────────────────────────── */
.listing-detail { margin-bottom: 40px; }
.screenshot-gallery { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 24px; }
.screenshot-img { height: 300px; border-radius: var(--radius); object-fit: cover; }
.listing-header { margin-bottom: 24px; }
.listing-header h1 { font-size: 28px; font-weight: 700; margin: 8px 0; }
.listing-meta { display: flex; gap: 20px; font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.listing-rating { color: var(--warning); }
.listing-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.listing-body-grid { display: grid; grid-template-columns: 1fr 300px; gap: 32px; }
.listing-description h2 { font-size: 18px; margin-bottom: 12px; }
.listing-description p { color: var(--text-muted); line-height: 1.7; margin-bottom: 16px; }
.service-rate { font-size: 20px; font-weight: 700; color: var(--success); }
.listing-sidebar { display: flex; flex-direction: column; gap: 16px; }
.author-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; align-items: center; gap: 12px;
}
.author-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.author-name a { font-weight: 600; transition: color 0.2s; }
.author-name a:hover { color: var(--primary); }
.listing-actions { display: flex; flex-direction: column; gap: 8px; }

/* ── Reviews ───────────────────────────────────────────── */
.review-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px;
}
.review-header { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.review-author { font-weight: 600; font-size: 14px; }
.review-stars { color: var(--warning); font-size: 14px; }
.review-date { font-size: 12px; color: var(--text-dim); margin-left: auto; }
.review-comment { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
.star-input { display: flex; gap: 4px; margin-bottom: 8px; }
.star-input .star { font-size: 28px; cursor: pointer; color: var(--text-dim); transition: color 0.15s; }
.star-input .star:hover, .star-input .star.active { color: var(--warning); }

/* ── Profile ───────────────────────────────────────────── */
.profile-header {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; display: flex; align-items: center; gap: 24px; margin-bottom: 32px;
}
.profile-header.compact { padding: 20px; }
.profile-avatar {
  width: 80px; height: 80px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.profile-info h1, .profile-info h2 { margin-bottom: 4px; }
.profile-username { color: var(--text-muted); font-size: 14px; }
.profile-title { color: var(--primary); font-weight: 600; margin: 4px 0 8px; }
/* ── Badges (RPG style) ───────────────────────────────── */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; margin-bottom: 32px; }
.badge-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 12px; border-radius: var(--radius);
  background: var(--bg-card); border: 2px solid var(--border); transition: all 0.3s;
  position: relative; overflow: hidden; cursor: default;
}
.badge-item::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, color-mix(in srgb, var(--badge-color, #1F6FEB) 10%, transparent) 0%, transparent 70%);
  pointer-events: none;
}
.badge-item:hover { transform: translateY(-4px); }

/* Badge icon */
.badge-icon-wrap { position: relative; z-index: 1; }
.badge-icon { width: 36px; height: 36px; color: var(--badge-color, var(--primary)); filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3)); }
.badge-icon svg { width: 100%; height: 100%; }
.badge-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; position: relative; z-index: 1; color: var(--text); }
.badge-date { font-size: 10px; color: var(--text-dim); position: relative; z-index: 1; }

/* Rarity label */
.badge-rarity-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; position: relative; z-index: 1; }
.badge-rarity-common    { color: #94A3B8; }
.badge-rarity-rare      { color: #3B82F6; }
.badge-rarity-epic      { color: #A855F7; }
.badge-rarity-legendary { color: #FBBF24; }
.badge-rarity-mythic    { color: #FF6B35; }

/* Rarity borders & glows */
.badge-common    { border-color: var(--border); }
.badge-common:hover { border-color: #94A3B8; box-shadow: 0 4px 16px rgba(148,163,184,0.15); }
.badge-rare      { border-color: rgba(59,130,246,0.3); }
.badge-rare:hover { border-color: #3B82F6; box-shadow: 0 4px 20px rgba(59,130,246,0.25); }
.badge-epic      { border-color: rgba(168,85,247,0.3); }
.badge-epic:hover { border-color: #A855F7; box-shadow: 0 4px 24px rgba(168,85,247,0.3); }
.badge-legendary { border-color: rgba(251,191,36,0.3); background: linear-gradient(135deg, var(--bg-card) 0%, rgba(251,191,36,0.05) 100%); }
.badge-legendary:hover { border-color: #FBBF24; box-shadow: 0 4px 28px rgba(251,191,36,0.3); }
.badge-mythic    { border-color: rgba(255,107,53,0.4); background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255,107,53,0.08) 100%); animation: mythicPulse 3s ease infinite; }
.badge-mythic:hover { border-color: #FF6B35; box-shadow: 0 4px 36px rgba(255,107,53,0.4); }
@keyframes mythicPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(255,107,53,0.1); }
  50% { box-shadow: 0 0 20px rgba(255,107,53,0.2); }
}

/* Locked badges */
.badge-locked { opacity: 0.4; filter: grayscale(0.8); }
.badge-locked:hover { opacity: 0.6; transform: translateY(-2px); filter: grayscale(0.5); }
.badge-locked .badge-icon { color: var(--text-dim) !important; }

/* ── Level ring & Title (RPG) ─────────────────────────── */
.rpg-level-ring {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--primary), #8B5CF6, var(--primary));
  box-shadow: 0 0 16px rgba(31,111,235,0.4);
  animation: levelRingSpin 8s linear infinite;
}
@keyframes levelRingSpin {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}
.rpg-level {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg); color: #fff; font-size: 16px; font-weight: 800;
}
.rpg-title-section { display: flex; flex-direction: column; gap: 4px; }
.rpg-title-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(31,111,235,0.12), rgba(139,92,246,0.12));
  border: 1px solid rgba(31,111,235,0.25);
  font-size: 15px; font-weight: 700; color: var(--primary);
}
.rpg-title-icon { width: 18px; height: 18px; display: inline-flex; color: inherit; }
.rpg-title-icon svg { width: 100%; height: 100%; }
.rpg-next-title { font-size: 11px; color: var(--text-dim); font-weight: 500; }

/* Title color variants */
.rpg-title-wanderer   { color: #94A3B8; border-color: rgba(148,163,184,0.3); background: linear-gradient(135deg, rgba(148,163,184,0.1), rgba(148,163,184,0.05)); }
.rpg-title-apprentice { color: #10B981; border-color: rgba(16,185,129,0.3); background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(16,185,129,0.05)); }
.rpg-title-initiate   { color: #3B82F6; border-color: rgba(59,130,246,0.3); background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(59,130,246,0.05)); }
.rpg-title-developer  { color: #1F6FEB; border-color: rgba(31,111,235,0.3); background: linear-gradient(135deg, rgba(31,111,235,0.12), rgba(139,92,246,0.12)); }
.rpg-title-artisan    { color: #8B5CF6; border-color: rgba(139,92,246,0.3); background: linear-gradient(135deg, rgba(139,92,246,0.1), rgba(139,92,246,0.05)); }
.rpg-title-expert     { color: #A855F7; border-color: rgba(168,85,247,0.3); background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(168,85,247,0.05)); }
.rpg-title-master     { color: #EC4899; border-color: rgba(236,72,153,0.3); background: linear-gradient(135deg, rgba(236,72,153,0.1), rgba(236,72,153,0.05)); }
.rpg-title-grandmaster{ color: #F97316; border-color: rgba(249,115,22,0.3); background: linear-gradient(135deg, rgba(249,115,22,0.1), rgba(249,115,22,0.05)); }
.rpg-title-champion   { color: #FBBF24; border-color: rgba(251,191,36,0.3); background: linear-gradient(135deg, rgba(251,191,36,0.1), rgba(251,191,36,0.05)); }
.rpg-title-legend     { color: #FBBF24; border-color: rgba(251,191,36,0.4); background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(249,115,22,0.08)); text-shadow: 0 0 8px rgba(251,191,36,0.3); }
.rpg-title-mythic     { color: #FF6B35; border-color: rgba(255,107,53,0.5); background: linear-gradient(135deg, rgba(255,107,53,0.15), rgba(236,72,153,0.08)); text-shadow: 0 0 12px rgba(255,107,53,0.4); animation: mythicTitleGlow 2s ease infinite; }
@keyframes mythicTitleGlow {
  0%, 100% { box-shadow: 0 0 4px rgba(255,107,53,0.2); }
  50% { box-shadow: 0 0 12px rgba(255,107,53,0.4); }
}

/* ── XP Bar ───────────────────────────────────────────── */
.xp-bar-container { width: 100%; max-width: 340px; margin: 8px 0; }
.xp-bar-label { font-size: 11px; color: var(--text-dim); margin-bottom: 3px; display: flex; justify-content: space-between; }
.xp-bar {
  width: 100%; max-width: 340px; height: 12px; background: var(--border); border-radius: 6px;
  overflow: hidden; position: relative;
}
.xp-fill {
  height: 100%; border-radius: 6px; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, var(--primary), #8B5CF6, #EC4899);
  background-size: 200% 100%; animation: xpShimmer 3s ease infinite;
  position: relative;
}
.xp-fill::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2));
  border-radius: 0 6px 6px 0;
}
@keyframes xpShimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* ── Gamification card ────────────────────────────────── */
.gami-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(31,111,235,0.05) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; margin-bottom: 32px; position: relative; overflow: hidden;
}
.gami-card::before {
  content: ''; position: absolute; top: -100px; right: -100px; width: 250px; height: 250px;
  background: radial-gradient(circle, rgba(139,92,246,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.gami-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; position: relative; z-index: 1; }
.gami-stats { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }

/* ── Achievements panel ───────────────────────────────── */
.achievements-container { margin-bottom: 32px; }
.achievements-progress { margin-bottom: 24px; }
.achievements-progress-text { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; font-weight: 600; }
.achievements-bar { width: 100%; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.achievements-bar-fill {
  height: 100%; border-radius: 4px; transition: width 1s ease;
  background: linear-gradient(90deg, var(--primary), #8B5CF6, #EC4899);
}
.achievement-category { margin-bottom: 24px; }
.achievement-category-title {
  font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--text-muted); margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

/* ── Leaderboard ──────────────────────────────────────── */
.leaderboard { display: flex; flex-direction: column; gap: 6px; }
.leaderboard-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; color: inherit; transition: all 0.2s;
}
.leaderboard-row:hover { border-color: var(--primary); transform: translateX(4px); }
.leaderboard-top1 { border-color: rgba(251,191,36,0.4); background: linear-gradient(90deg, var(--bg-card), rgba(251,191,36,0.06)); }
.leaderboard-top2 { border-color: rgba(148,163,184,0.4); background: linear-gradient(90deg, var(--bg-card), rgba(148,163,184,0.04)); }
.leaderboard-top3 { border-color: rgba(180,83,9,0.3); background: linear-gradient(90deg, var(--bg-card), rgba(180,83,9,0.04)); }
.leaderboard-rank {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: var(--text-muted); flex-shrink: 0;
}
.leaderboard-top1 .leaderboard-rank { color: #FBBF24; }
.leaderboard-top2 .leaderboard-rank { color: #94A3B8; }
.leaderboard-top3 .leaderboard-rank { color: #B45309; }
.leaderboard-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name { font-weight: 600; font-size: 14px; display: block; }
.leaderboard-title { font-size: 12px; color: var(--primary); font-weight: 500; }
.leaderboard-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.leaderboard-level { font-weight: 700; color: var(--text); }
.leaderboard-xp { color: var(--primary); font-weight: 600; }

/* ── Dashboard ─────────────────────────────────────────── */
.dashboard-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }

/* ── Pagination ────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; }
.page-btn {
  width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: transparent; color: var(--text-muted); font-size: 13px; cursor: pointer;
  font-family: var(--font); transition: all 0.2s;
}
.page-btn:hover { border-color: var(--primary); color: var(--text); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── Empty State ───────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-icon { font-size: 48px; display: block; margin-bottom: 12px; }
.empty-state .btn-primary { margin-top: 16px; }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  padding: 32px 0; text-align: center; color: var(--text-dim);
  border-top: 1px solid var(--border); font-size: 13px; margin-top: 48px;
}
.footer a { color: var(--primary); }
.footer a:hover { text-decoration: underline; }

/* ── Spinner ───────────────────────────────────────────── */
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.7s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); flex-direction: column; padding: 16px 20px; gap: 12px; }
  .nav-links.open { display: flex; }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .listing-grid { grid-template-columns: 1fr; }
  .listing-body-grid { grid-template-columns: 1fr; }
  .stats-row { flex-direction: column; }
  .type-selector { grid-template-columns: repeat(2, 1fr); }
  .filter-controls { flex-direction: column; }
  .profile-header { flex-direction: column; text-align: center; }
  .search-bar { flex-direction: column; }
  .dashboard-header { flex-direction: column; align-items: stretch; }
  .showcase-grid { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
  .rpg-level-ring { width: 40px; height: 40px; }
  .rpg-level { width: 34px; height: 34px; font-size: 14px; }
  .leaderboard-stats { flex-direction: column; gap: 2px; }
  .gami-stats { gap: 8px; }
  .gami-stats .stat-card { min-width: 100px; padding: 12px; }
}

/* ── Profile extras ────────────────────────────────────── */
.profile-bio { background: var(--bg-card); border-radius: 12px; padding: 20px; margin-bottom: 24px; color: var(--text-secondary); line-height: 1.6; }
.profile-skills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.profile-contact { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.contact-link { color: var(--text-muted); font-size: 14px; text-decoration: none; transition: color 0.2s; }
.contact-link:hover { color: var(--accent); }
.showcase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 32px; }
.showcase-card { background: var(--bg-card); border-radius: 12px; padding: 16px; text-align: center; border: 1px solid var(--border); }
.showcase-icon { font-size: 32px; margin-bottom: 8px; }
.showcase-name { font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.showcase-desc { font-size: 13px; color: var(--text-muted); }

/* ── Community members ─────────────────────────────────── */
.community-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.member-card { display: flex; gap: 16px; background: var(--bg-card); border-radius: 12px; padding: 20px; border: 1px solid var(--border); text-decoration: none; color: inherit; transition: transform 0.2s, box-shadow 0.2s; }
.member-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.member-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--accent, #1F6FEB); color: white; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.member-info { flex: 1; min-width: 0; }
.member-name { font-weight: 600; font-size: 16px; color: var(--text-primary); }
.member-username { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.member-title { font-size: 13px; color: var(--accent, #1F6FEB); font-weight: 500; margin-bottom: 6px; }
.member-bio { font-size: 13px; color: var(--text-secondary); line-height: 1.4; margin-bottom: 8px; }
.member-skills { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tag-small { font-size: 11px; padding: 2px 8px; }
.member-projects { display: flex; flex-wrap: wrap; gap: 6px; }
.showcase-chip { font-size: 12px; background: var(--bg-secondary, #1E293B); border-radius: 6px; padding: 3px 8px; color: var(--text-secondary); }
