:root {
  --background: #16111e;
  --foreground: #f4effa;
  --card: #20182b;
  --card-2: #261d33;
  --muted: #b9a8cc;
  --border: #3d2f53;
  --primary: #c7a6ff;
  --primary-foreground: #190f24;
  --accent: #e0c8ff;
  --accent-2: #8b5cf6;
  --twitch: #9146ff;
  --discord: #5865f2;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(circle at top right, rgba(139, 92, 246, 0.18), transparent 24%),
    radial-gradient(circle at top left, rgba(88, 101, 242, 0.12), transparent 20%),
    var(--background);
  color: var(--foreground);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

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

code {
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    monospace;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(199, 166, 255, 0.15);
  background: rgba(24, 18, 33, 0.82);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

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

.brand-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-right {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.search-wrap {
  position: relative;
  width: 340px;
  max-width: 100%;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 12px 14px 12px 34px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(35, 28, 47, 0.92);
  color: var(--foreground);
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(199, 166, 255, 0.12);
}

.auth-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.auth-btn {
  border-radius: 14px;
  padding: 11px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: 0.18s ease;
}

.auth-btn:hover {
  transform: translateY(-1px);
}

.auth-btn.twitch {
  background: rgba(145, 70, 255, 0.18);
  border-color: rgba(145, 70, 255, 0.35);
}

.auth-btn.discord {
  background: rgba(88, 101, 242, 0.16);
  border-color: rgba(88, 101, 242, 0.35);
}

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: calc(100vh - 81px);
}

.sidebar {
  border-right: 1px solid rgba(199, 166, 255, 0.1);
  background: rgba(25, 18, 35, 0.6);
  padding: 24px 16px;
  position: sticky;
  top: 81px;
  height: calc(100vh - 81px);
}

.nav-group + .nav-group {
  margin-top: 18px;
}

.section-btn,
.sub-btn {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 0;
}

.section-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--foreground);
  border-radius: 14px;
  padding: 12px 14px;
  font-weight: 700;
  transition: 0.18s ease;
}

.section-btn:hover,
.sub-btn:hover {
  background: rgba(199, 166, 255, 0.08);
}

.section-btn.active {
  background: linear-gradient(135deg, rgba(199, 166, 255, 0.95), rgba(139, 92, 246, 0.95));
  color: var(--primary-foreground);
}

.subnav {
  margin: 10px 0 0 18px;
  padding-left: 14px;
  border-left: 2px solid rgba(224, 200, 255, 0.22);
  display: grid;
  gap: 8px;
}

.sub-btn {
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 10px 12px;
  transition: 0.18s ease;
}

.sub-btn.active {
  background: rgba(224, 200, 255, 0.9);
  color: #1b1228;
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.content {
  padding: 26px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border: 1px solid rgba(199, 166, 255, 0.16);
  background:
    linear-gradient(135deg, rgba(41, 29, 56, 0.98), rgba(25, 18, 36, 0.98));
  border-radius: 24px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.hero-card h2 {
  margin: 0;
  font-size: 2rem;
}

.hero-card p:last-child,
#pageSubtitle {
  margin-top: 8px;
  color: var(--muted);
}

.hero-glow {
  width: 180px;
  min-width: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(199, 166, 255, 0.45), transparent 65%);
  filter: blur(4px);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 26px;
}

.feature-card {
  border: 1px solid rgba(199, 166, 255, 0.12);
  background: rgba(33, 25, 45, 0.9);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.feature-card h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.feature-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.commands-wrap {
  display: grid;
  gap: 14px;
}

.command-card {
  border: 1px solid rgba(199, 166, 255, 0.12);
  background: rgba(31, 24, 43, 0.94);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.command-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
}

.command-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.command-name {
  margin: 0;
  color: var(--primary);
  font-size: 1.05rem;
  font-weight: 800;
}

.alias-badge,
.permission-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.alias-badge {
  background: rgba(224, 200, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(224, 200, 255, 0.18);
}

.permission-badge {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(199, 166, 255, 0.4);
}

.command-desc {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.expand-btn {
  min-width: 42px;
  height: 42px;
  border: 1px solid rgba(199, 166, 255, 0.12);
  border-radius: 12px;
  background: rgba(43, 33, 58, 0.9);
  color: var(--foreground);
  cursor: pointer;
  font-size: 1rem;
}

.command-body {
  display: none;
  padding: 0 18px 18px;
}

.command-card.open .command-body {
  display: block;
}

.meta-label {
  margin: 10px 0 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.usage-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.codebox {
  flex: 1;
  display: block;
  background: rgba(45, 35, 61, 0.92);
  border: 1px solid rgba(199, 166, 255, 0.12);
  color: var(--foreground);
  border-radius: 14px;
  padding: 12px 14px;
  overflow-x: auto;
}

.copy-btn {
  flex-shrink: 0;
  border: 1px solid rgba(199, 166, 255, 0.14);
  background: rgba(43, 33, 58, 0.9);
  color: var(--foreground);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  min-width: 70px;
}

.copy-btn.done {
  color: #8bf0ae;
}

.empty-state {
  margin-top: 16px;
  border-radius: 18px;
  border: 1px solid rgba(199, 166, 255, 0.12);
  background: rgba(31, 24, 43, 0.94);
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(199, 166, 255, 0.1);
  }
}

@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-right {
    width: 100%;
    align-items: stretch;
  }

  .search-wrap {
    width: 100%;
  }

  .auth-buttons {
    width: 100%;
  }

  .auth-btn {
    flex: 1;
    text-align: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    flex-direction: column;
  }

  .hero-glow {
    width: 100%;
    min-width: 0;
    height: 90px;
  }

  .content {
    padding: 18px;
  }
}