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

:root {
  --bg: #080b10;
  --panel: #10151d;
  --panel-2: #161d28;
  --line: rgba(255, 255, 255, 0.07);
  --text: #eef2f7;
  --muted: #8b97a8;
  --accent: #3b9eff;
  --accent-2: #ff4d6d;
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

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

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(59, 158, 255, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(255, 77, 109, 0.08), transparent);
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(8, 11, 16, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding: 1.25rem 1.5rem 1rem;
}

.header-top {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #6c5ce7);
  font-size: 0.9rem;
  color: #fff;
  box-shadow: 0 8px 24px rgba(59, 158, 255, 0.25);
}

.brand h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  font-size: 0.8rem;
  color: var(--muted);
}

.search {
  flex: 1;
  min-width: 200px;
  max-width: 340px;
  padding: 0.65rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search:focus { border-color: rgba(59, 158, 255, 0.5); }
.search::placeholder { color: var(--muted); }

.site-nav {
  max-width: 1100px;
  margin: 0.75rem auto 0;
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}

.nav-link:hover { color: var(--text); border-color: rgba(59, 158, 255, 0.4); }

.nav-link.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), #6c5ce7);
}

.filters {
  max-width: 1100px;
  margin: 0.85rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-btn {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.15); }
.filter-btn.active {
  background: rgba(59, 158, 255, 0.15);
  border-color: rgba(59, 158, 255, 0.4);
  color: var(--accent);
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
}

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.stat-pill {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.8rem;
  color: var(--muted);
}

.stat-pill strong {
  color: var(--text);
  font-weight: 600;
}

.sections {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.category-section {}

.category-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.category-heading h2 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.category-count {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.75rem;
}

.channel-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  text-decoration: none;
  color: inherit;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.channel-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 158, 255, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.channel-body {
  flex: 1;
  min-width: 0;
}

.channel-name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-handle {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.channel-arrow {
  flex-shrink: 0;
  font-size: 0.9rem;
  color: var(--muted);
  opacity: 0;
  transition: opacity 0.2s, color 0.2s;
}

.channel-card:hover .channel-arrow {
  opacity: 1;
  color: var(--accent);
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 3rem 1rem;
}

.footer {
  text-align: center;
  padding: 1.25rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

@media (max-width: 640px) {
  .channel-grid { grid-template-columns: 1fr; }
  .search { max-width: none; width: 100%; }
  .category-heading { flex-direction: column; gap: 0.25rem; }
}