/* CordList v3 — clean purple theme, performance-first */

:root {
  --bg: #070b14;
  --bg-elevated: #0f1626;
  --bg-card: #0d1322;
  --bg-input: #0b111e;
  --border: rgba(120, 160, 255, 0.09);
  --border-strong: rgba(120, 160, 255, 0.16);
  --border-hover: rgba(59, 130, 246, 0.45);
  --text: #eef3fb;
  --text-muted: #9fb2cc;
  --text-dim: #61748f;
  --purple: #3b82f6;
  --purple-light: #60a5fa;
  --indigo: #2563eb;
  --blue: #3b82f6;
  --blue-light: #60a5fa;
  --cyan: #22d3ee;
  --nav-bg: rgba(7, 11, 20, 0.82);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.45);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 14px 40px rgba(59, 130, 246, 0.22), 0 1px 2px rgba(0, 0, 0, 0.45);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
  letter-spacing: -0.011em;
  font-feature-settings: "kern", "liga";
}

h1, h2, h3, h4, h5 {
  letter-spacing: -0.025em;
  line-height: 1.15;
}

a { text-decoration: none; color: inherit; }

/* ========== BACKGROUND (animated blue grid + drifting aurora) ========== */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(59, 130, 246, 0.16), transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 15%, rgba(34, 211, 238, 0.08), transparent 55%),
    radial-gradient(ellipse 50% 45% at 0% 85%, rgba(37, 99, 235, 0.1), transparent 55%),
    var(--bg);
}

/* Animated grid lines */
.site-bg::before {
  content: '';
  position: absolute;
  inset: -2px;
  background-image: linear-gradient(rgba(96, 165, 250, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, 0.07) 1px, transparent 1px);
  background-size: 50px 50px;
  -webkit-mask-image: radial-gradient(ellipse 110% 85% at 50% 0%, #000 35%, transparent 92%);
  mask-image: radial-gradient(ellipse 110% 85% at 50% 0%, #000 35%, transparent 92%);
  animation: gridPan 24s linear infinite;
}

/* Drifting aurora glow for depth */
.site-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 45% 32% at 30% 30%, rgba(59, 130, 246, 0.12), transparent 60%),
    radial-gradient(ellipse 40% 30% at 75% 60%, rgba(34, 211, 238, 0.08), transparent 60%);
  animation: auroraDrift 20s ease-in-out infinite;
}

@keyframes gridPan {
  from { background-position: 0 0, 0 0; }
  to   { background-position: 50px 50px, 50px 50px; }
}

@keyframes auroraDrift {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.9; }
  50%      { transform: translate3d(4%, -3%, 0) scale(1.08); opacity: 1; }
}

/* Animate the standalone grid overlay used on some pages too */
.grid-overlay {
  animation: gridPan 24s linear infinite;
}

/* ========== NAV ========== */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  transition: box-shadow 0.25s var(--ease), border-color 0.25s var(--ease);
}

.nav-bar.scrolled {
  box-shadow: 0 1px 0 var(--border), 0 8px 30px rgba(0, 0, 0, 0.4);
  border-bottom-color: var(--border-strong);
}

.nav-link-active {
  color: var(--text) !important;
  background: rgba(59, 130, 246, 0.1) !important;
  border: 1px solid rgba(59, 130, 246, 0.15);
}

/* ========== BUTTONS ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(59, 130, 246, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.16);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), filter 0.18s var(--ease);
}

/* Sweeping shine on hover */
.btn-primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -130%;
  width: 60%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-18deg);
  transition: left 0.6s var(--ease);
}

.btn-primary:hover::after {
  left: 130%;
}

.btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(59, 130, 246, 0.06);
}

.cta-btn { /* nav CTA — inherits btn-primary look via Tailwind classes */ }

/* ========== SEARCH ========== */
.search-wrap { position: relative; }

.search-wrap input,
.search-field {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-wrap:focus-within input,
.search-field:focus {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ========== SERVER CARDS ========== */
.srv-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
  contain: layout style;
}

.srv-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.tier-pro {
  border-color: rgba(59, 130, 246, 0.35) !important;
}

.tier-pro:hover {
  border-color: rgba(59, 130, 246, 0.55) !important;
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.14);
}

.tier-sponsored {
  border-color: rgba(37, 99, 235, 0.4) !important;
}

.tier-sponsored:hover {
  border-color: rgba(37, 99, 235, 0.6) !important;
  box-shadow: 0 12px 40px rgba(37, 99, 235, 0.16);
}

/* Featured / Boosted cards — refined premium treatment (subtle, not flashy) */
@keyframes featuredEntrance {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.srv-card.featured {
  border-color: rgba(59, 130, 246, 0.4) !important;
  opacity: 1 !important;
  animation: featuredEntrance 0.35s var(--ease) forwards;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22), 0 10px 34px rgba(59, 130, 246, 0.2);
  position: relative;
  z-index: 2;
}

/* Subtle inner glow layer for depth */
.srv-card.featured::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(59, 130, 246, 0.1), transparent 60%);
  pointer-events: none;
  z-index: 1;
}

.srv-card.featured:hover {
  border-color: rgba(59, 130, 246, 0.6) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4), 0 16px 48px rgba(59, 130, 246, 0.32) !important;
  transform: translateY(-4px);
}

/* Register custom property kept for backward compatibility */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* Legacy feat-wrap styles (for compatibility) — refined premium border */
.feat-wrap {
  position: relative;
  border-radius: calc(var(--radius-lg) + 2px);
  padding: 1.5px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.6), rgba(34, 211, 238, 0.6));
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.14);
  z-index: 1;
}

.feat-wrap:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(59, 130, 246, 0.3), 0 0 0 1px rgba(59, 130, 246, 0.35) !important;
}

.feat-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-card) !important;
  border-radius: calc(var(--radius-lg) - 1px);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  opacity: 1 !important;
  visibility: visible !important;
}

.feat-wrap:hover .feat-inner {
  transform: translateY(-2px);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(59, 130, 246, 0.15);
}

.card-banner {
  height: 130px;
  position: relative;
  background-color: var(--bg-elevated);
  background-size: cover;
  background-position: center;
}

.card-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(8, 8, 14, 0.55));
  pointer-events: none;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 3px solid var(--bg-card);
  object-fit: cover;
  margin-top: -32px;
  position: relative;
  z-index: 2;
  background: var(--bg-card);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.card-icon-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  border: 3px solid var(--bg-card);
  margin-top: -32px;
  position: relative;
  z-index: 2;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

/* ===== Discadia-style card internals ===== */
.card-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 16px 16px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.card-head-meta {
  min-width: 0;
  flex: 1;
  padding-top: 8px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.02em;
}

.card-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 3px;
}

.srv-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.srv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.srv-dot-online {
  background: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.18);
}

.srv-dot-members {
  background: var(--text-dim);
}

.card-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.55;
  margin-top: 12px;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  min-height: 22px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Bump-time pill on the banner */
.card-bump {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  background: rgba(8, 8, 14, 0.7);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card-bump svg {
  width: 11px;
  height: 11px;
  color: var(--purple-light);
}

/* Boosted badge — compact pill in top-right, doesn't cover card content */
.tier-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 700;
  z-index: 3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-boosted {
  background: rgba(59, 130, 246,.8);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246,.4);
  backdrop-filter: blur(4px);
}

.badge-sponsored {
  background: linear-gradient(135deg, rgba(59, 130, 246,.9), rgba(34, 211, 238,.9));
  color: #fff;
  box-shadow: 0 2px 10px rgba(59, 130, 246,.4);
  font-size: 9px;
  padding: 2px 8px;
  letter-spacing: .03em;
}
.badge-pro { background: rgba(59, 130, 246, 0.88); color: #ede9fe; }
.badge-featured { background: rgba(234, 179, 8, 0.9); color: #fff; }

.join-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 700;
  background: #22c55e;
  color: #fff;
  transition: background 0.15s ease, transform 0.15s ease;
}

.join-btn:hover {
  background: #16a34a;
  transform: translateY(-1px);
}

/* ========== CATEGORY / FILTER PILLS ========== */
.cat-pill,
.cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease), transform 0.18s var(--ease);
}

.cat-pill:hover,
.cat-btn:hover {
  border-color: var(--border-hover);
  color: var(--purple-light);
  background: rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

.cat-btn.active {
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--purple-light);
  background: rgba(59, 130, 246, 0.12);
}

/* ========== TAGS ========== */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--purple-light);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.12);
}

/* ========== PANELS & CARDS ========== */
.glass-panel,
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.glass-panel:hover,
.glass-card:hover {
  border-color: var(--border-strong);
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.stat-val,
.stat-gradient,
.gradient-text {
  font-weight: 800;
  background: linear-gradient(135deg, #60a5fa, #3b82f6, #22d3ee, #60a5fa);
  background-size: 220% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% center; }
  50% { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* Banner fallbacks when no Discord banner */
.ban-gaming { background: linear-gradient(135deg, #1a1040, #2d1b69); }
.ban-programming { background: linear-gradient(135deg, #0a1628, #152a52); }
.ban-anime { background: linear-gradient(135deg, #200a30, #3d1650); }
.ban-music { background: linear-gradient(135deg, #180e28, #2e1750); }
.ban-social { background: linear-gradient(135deg, #0c1018, #1a2538); }
.ban-default { background: linear-gradient(135deg, #0f1020, #1a1535); }

/* ========== SECTIONS ========== */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--purple-light);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.14);
}

.page-header {
  padding: 2.5rem 0 1.75rem;
  border-bottom: 1px solid var(--border);
}

/* How it works */
.how-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  text-align: center;
  transition: border-color 0.2s ease;
}

.how-step:hover {
  border-color: var(--border-hover);
}

.how-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.18);
  font-size: 13px;
  font-weight: 800;
  color: var(--purple-light);
  margin-bottom: 1rem;
}

.how-step-connector { display: none; }

/* ========== FOOTER ========== */
.footer-pro {
  background: var(--bg);
  border-top: 1px solid var(--border);
  position: relative;
}

.footer-link {
  color: var(--text-dim);
  font-size: 12px;
  transition: color 0.15s ease;
}

.footer-link:hover { color: var(--purple-light); }

.footer-social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.footer-social:hover {
  border-color: var(--border-hover);
  color: var(--purple-light);
  background: rgba(59, 130, 246, 0.08);
}

/* ========== ANIMATIONS (lightweight) ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-anim {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.ha-1 { animation-delay: 0.05s; }
.ha-2 { animation-delay: 0.1s; }
.ha-3 { animation-delay: 0.15s; }
.ha-4 { animation-delay: 0.2s; }
.ha-5 { animation-delay: 0.25s; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.card-pop {
  opacity: 0;
  animation: fadeIn 0.35s ease forwards;
}

.fade-up {
  opacity: 0;
  animation: fadeIn 0.4s ease forwards;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  flex-shrink: 0;
  position: relative;
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #34d399;
  animation: livePulse 2s ease-out infinite;
}

@keyframes livePulse {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(3); opacity: 0; }
}

/* ========== UTILITIES ========== */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

#m-menu { display: none; }
#m-menu.open { display: flex; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(59, 130, 246, 0.18); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: rgba(59, 130, 246, 0.3); }

::selection { background: rgba(59, 130, 246, 0.28); color: #fff; }

:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 2px;
}

/* Error states */
.load-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  grid-column: 1 / -1;
}

.load-error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.load-error-icon svg { width: 24px; height: 24px; color: #f87171; }
.load-error-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.load-error-msg { font-size: 12px; color: var(--text-dim); max-width: 320px; line-height: 1.5; }

.load-error-retry {
  margin-top: 1rem;
  padding: 8px 20px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--purple-light);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.18);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.load-error-retry:hover {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.3);
}

/* Back to top */
#back-to-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9998;
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, border-color 0.15s ease, color 0.15s ease;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  border-color: var(--border-hover);
  color: var(--purple-light);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slideUp { animation: slideUp 0.3s ease forwards; }

/* ========== MOBILE CARD OPTIMIZATION ========== */
@media (max-width: 639px) {
  .srv-card .card-banner { height: 104px; }
  .srv-card .card-icon, .card-icon-placeholder { width: 48px; height: 48px; margin-top: -26px; font-size: 17px; border-radius: 14px; }
  .card-body { padding: 0 13px 13px; }
  .srv-card .join-btn, .srv-card .btn-ghost { padding: 7px 12px; font-size: 11px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal { opacity: 1; transform: none; }
  .hero-anim, .card-pop, .fade-up { opacity: 1; animation: none; }
}

/* ========== BROWSE (Discadia-style layout) ========== */
.browse-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .browse-layout {
    grid-template-columns: 236px 1fr;
    gap: 30px;
    align-items: start;
  }
  .cat-sidebar { position: sticky; top: 80px; }
}

.cat-sidebar-inner { padding: 16px; }

.cat-sidebar-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding: 0 4px;
}

.cat-list { display: flex; gap: 8px; }

@media (max-width: 1023px) {
  .cat-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .cat-list::-webkit-scrollbar { height: 0; }
}

@media (min-width: 1024px) {
  .cat-list { flex-direction: column; }
  .cat-sidebar .cat-btn {
    width: 100%;
    justify-content: flex-start;
    border-radius: 10px;
  }
}

.cat-sidebar .cat-btn { white-space: nowrap; }

.browse-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.sort-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sort-tab {
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.sort-tab:hover { color: var(--text); }

.sort-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--indigo), var(--purple));
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.trending-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.trending-row > .trending-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

/* ========== EXTRA MOTION POLISH ========== */
/* Pulsing cyan dot inside the brand logo */
.logo-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: logoDotPulse 2.6s ease-in-out infinite;
}

@keyframes logoDotPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

/* Soft lift + glow for category / link tiles built with Tailwind */
.glass-panel {
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.glass-panel:hover {
  box-shadow: 0 12px 34px rgba(59, 130, 246, 0.12);
}

/* Gentle entrance used by reveal-less pages via Tailwind animate utilities */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.float-soft { animation: floatY 5s ease-in-out infinite; }

/* Nav brand tile subtle glow pulse */
.nav-bar .group:hover .logo-dot { animation-duration: 1.2s; }
