body {
  background:
    radial-gradient(ellipse at 10% 5%, rgba(167, 139, 250, 0.2), transparent 34%),
    radial-gradient(ellipse at 92% 16%, rgba(96, 165, 250, 0.15), transparent 30%),
    linear-gradient(145deg, #f8faff 0%, #f1f3ff 52%, #f8fafc 100%);
}

.topbar {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 14px max(18px, calc((100% - 1400px) / 2 + 18px));
  border: 0;
  border-bottom: 1px solid rgba(109, 94, 245, 0.12);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 32px rgba(32, 28, 75, 0.07);
}

.brand {
  gap: 10px;
  font-size: 32px;
  letter-spacing: -0.06em;
}

.brand-mark {
  display: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  box-shadow: 0 7px 18px rgba(124, 58, 237, 0.12);
}

.theme-toggle {
  padding: 8px 13px 8px 9px;
  border-color: rgba(109, 94, 245, 0.14);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.07);
}

.theme-toggle-icon {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(96, 165, 250, 0.14));
}

.page-shell {
  width: min(1180px, calc(100% - 36px));
  margin: 20px auto 54px;
  padding: clamp(18px, 3.2vw, 34px);
  border-color: rgba(109, 94, 245, 0.1);
  border-radius: 27px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 24px 70px rgba(38, 35, 81, 0.08);
}

.page-header {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: block;
  margin: 0 0 20px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(192, 132, 252, 0.35), transparent 38%),
    linear-gradient(135deg, #191333 0%, #30205b 56%, #493191 100%);
}

.page-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: 210px;
  height: 210px;
  right: -85px;
  bottom: -145px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 22px rgba(255, 255, 255, 0.035), 0 0 0 46px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.back-link {
  margin-bottom: 14px;
  color: #d8ccff;
}

.back-link:hover {
  color: #fff;
}

.page-title {
  color: #fff;
  font-size: clamp(2rem, 5vw, 3.7rem);
  letter-spacing: -0.07em;
  background: none;
  -webkit-text-fill-color: #fff;
}

.lead {
  max-width: 70ch;
  margin-top: 12px;
  color: rgba(244, 240, 255, 0.78);
}

.hero {
  margin: 0 0 20px;
  padding: clamp(22px, 3.6vw, 32px);
  border-color: rgba(109, 94, 245, 0.14);
  border-radius: 21px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(192, 132, 252, 0.24), transparent 40%),
    linear-gradient(135deg, #f3efff 0%, #f8f7ff 55%, #eff5ff 100%);
  box-shadow: 0 16px 42px rgba(76, 29, 149, 0.08);
}

.eyebrow,
.page-kicker {
  color: #6841c6;
  background: rgba(255, 255, 255, 0.76);
  border-color: rgba(124, 58, 237, 0.16);
}

.hero h1 {
  color: #21183f;
  font-size: clamp(1.9rem, 4vw, 3rem);
  letter-spacing: -0.065em;
}

.intro {
  color: #5f5c72;
}

.sections {
  gap: 14px;
  margin-top: 12px;
}

.section,
.card,
.quick-card,
.category-card,
.invite-card {
  border-color: rgba(109, 94, 245, 0.11);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 34px rgba(38, 35, 81, 0.055);
}

.section {
  padding: clamp(19px, 3vw, 25px);
}

.section::before {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.1), transparent 70%);
}

.section h2,
.faq-item h3,
.card h2,
.card h3,
.quick-card strong,
.category-card h3 {
  color: #211d39;
  letter-spacing: -0.04em;
}

.section p,
.section li,
.card p,
.card li,
.faq-item p,
.quick-card span,
.category-card p,
.invite-card p,
.note,
.lead,
.intro {
  color: #626176;
}

.quick-grid,
.categories-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 13px;
}

#communitySortControls {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}

.quick-card,
.card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 247, 255, 0.9));
  box-shadow: 0 7px 22px rgba(38, 35, 81, 0.04);
}

.faq-item {
  border-left: 3px solid rgba(124, 58, 237, 0.55);
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.055), rgba(255, 255, 255, 0.92) 28%);
}

.invite-card {
  padding: clamp(19px, 3vw, 26px);
  background: linear-gradient(135deg, rgba(237, 233, 254, 0.84), rgba(239, 246, 255, 0.88));
}

.invite-card a {
  background: linear-gradient(135deg, #5865f2 0%, #7c3aed 100%);
  box-shadow: 0 12px 28px rgba(88, 101, 242, 0.2);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.invite-card a:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(88, 101, 242, 0.26);
}

.note {
  border-left-color: #8b5cf6;
  border-radius: 11px;
  background: rgba(124, 58, 237, 0.07);
}

code {
  color: #5733a5;
  background: rgba(124, 58, 237, 0.1);
}

.search-box input {
  border-color: rgba(109, 94, 245, 0.16);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
}

.search-box input:focus {
  border-color: #8b5cf6;
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
}

.category-card {
  background: linear-gradient(145deg, #fff 0%, #f5f1ff 100%);
  box-shadow: 0 10px 26px rgba(76, 29, 149, 0.055);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.category-card:hover,
.quick-card:hover,
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.22);
  box-shadow: 0 16px 34px rgba(76, 29, 149, 0.09);
}

.nav-links a {
  padding: 9px 13px;
  border-color: rgba(124, 58, 237, 0.14);
  background: rgba(255, 255, 255, 0.84);
  color: #6841c6;
  transition: transform 0.18s ease, background 0.18s ease;
}

.nav-links a:hover {
  transform: translateY(-1px);
  background: #fff;
}

.step {
  border-color: rgba(109, 94, 245, 0.11);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
}

html[data-theme="black"] body {
  background:
    radial-gradient(ellipse at 10% 5%, rgba(124, 58, 237, 0.2), transparent 34%),
    radial-gradient(ellipse at 92% 16%, rgba(59, 130, 246, 0.14), transparent 30%),
    linear-gradient(145deg, #090b12 0%, #111426 52%, #0b1020 100%);
}

html[data-theme="black"] .topbar {
  background: rgba(9, 11, 18, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.2);
}

html[data-theme="black"] .page-shell {
  background: rgba(11, 13, 22, 0.72);
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
}

html[data-theme="black"] .page-header {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(124, 58, 237, 0.32), transparent 38%),
    linear-gradient(135deg, #171329 0%, #241b42 56%, #30245a 100%);
  border-color: rgba(196, 181, 253, 0.14);
}

html[data-theme="black"] .page-header .page-title,
html[data-theme="black"] .page-header h1 {
  color: #fff;
  -webkit-text-fill-color: #fff;
}

html[data-theme="black"] .lead {
  color: rgba(244, 240, 255, 0.78);
}

html[data-theme="black"] .hero {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(124, 58, 237, 0.2), transparent 40%),
    linear-gradient(135deg, rgba(28, 23, 47, 0.96), rgba(20, 25, 40, 0.96));
  border-color: rgba(167, 139, 250, 0.14);
}

html[data-theme="black"] .hero h1 {
  color: #fff;
}

html[data-theme="black"] .intro,
html[data-theme="black"] .section p,
html[data-theme="black"] .section li,
html[data-theme="black"] .card p,
html[data-theme="black"] .card li,
html[data-theme="black"] .faq-item p,
html[data-theme="black"] .quick-card span,
html[data-theme="black"] .category-card p,
html[data-theme="black"] .invite-card p,
html[data-theme="black"] .note,
html[data-theme="black"] .step p,
html[data-theme="black"] .list,
html[data-theme="black"] .list li {
  color: rgba(229, 231, 245, 0.76);
}

html[data-theme="black"] .section,
html[data-theme="black"] .card,
html[data-theme="black"] .quick-card,
html[data-theme="black"] .category-card,
html[data-theme="black"] .invite-card,
html[data-theme="black"] .step {
  background: rgba(16, 19, 31, 0.9);
  border-color: rgba(167, 139, 250, 0.13);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
}

html[data-theme="black"] .section h2,
html[data-theme="black"] .faq-item h3,
html[data-theme="black"] .card h2,
html[data-theme="black"] .card h3,
html[data-theme="black"] .quick-card strong,
html[data-theme="black"] .category-card h3,
html[data-theme="black"] .invite-card strong,
html[data-theme="black"] .section strong,
html[data-theme="black"] .step strong {
  color: #fff;
}

html[data-theme="black"] .faq-item {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.1), rgba(16, 19, 31, 0.9) 32%);
}

html[data-theme="black"] .invite-card {
  background: linear-gradient(135deg, rgba(57, 38, 99, 0.72), rgba(29, 43, 77, 0.78));
}

html[data-theme="black"] .note {
  background: rgba(124, 58, 237, 0.12);
  border-left-color: #a78bfa;
}

html[data-theme="black"] code {
  color: #e4dcff;
  background: rgba(167, 139, 250, 0.15);
}

html[data-theme="black"] .nav-links a {
  color: #e4dcff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(167, 139, 250, 0.16);
}

html[data-theme="black"] .page-header .header-btn {
  color: #f1eaff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.17);
  box-shadow: none;
}

html[data-theme="black"] .sort-btn {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="black"] .sort-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #7655e8, #7650aa);
  border-color: transparent;
}

html[data-theme="black"] .search-box input {
  color: #f5f7fb;
  background: #111522;
  border-color: rgba(167, 139, 250, 0.2);
}

html[data-theme="black"] .search-box input::placeholder {
  color: #9da3b8;
}

@media (max-width: 700px) {
  .topbar {
    width: 100%;
    margin: 0;
    padding: 12px 18px;
    border-right: 0;
    border-left: 0;
    border-top: 0;
    border-radius: 0;
  }

  .page-shell {
    width: calc(100% - 24px);
    margin: 14px auto 32px;
    padding: 14px;
    border-radius: 21px;
  }

  .page-header {
    padding: 22px 19px;
    border-radius: 18px;
  }

  .page-title {
    font-size: clamp(2rem, 9vw, 3rem);
  }

  .theme-toggle {
    padding: 7px 9px;
  }

  .theme-toggle-text {
    display: none;
  }

  .page-header-actions {
    gap: 7px;
  }

  .page-header-actions .header-btn {
    padding: 8px 10px;
    font-size: 12px;
  }

  .invite-card {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }

  .invite-card a {
    width: 100%;
  }

  .panel-header + div {
    flex-wrap: wrap !important;
  }

  #communityStatus,
  #communitySortControls {
    flex: 1 1 100%;
  }

  #communitySortControls {
    justify-content: flex-start;
  }

  .grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.forum-page .forum-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.forum-page .forum-card {
  min-width: 0;
  margin: 0;
  padding: clamp(20px, 3vw, 28px);
}

.forum-page .forum-intro,
.forum-page .forum-categories {
  grid-column: 1 / -1;
}

.forum-page .forum-intro {
  position: relative;
  overflow: hidden;
  border-color: rgba(124, 58, 237, 0.18);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(192, 132, 252, 0.2), transparent 38%),
    linear-gradient(135deg, #fff 0%, #f5f1ff 58%, #eff5ff 100%);
}

.forum-page .forum-intro h2 {
  max-width: 25ch;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.forum-page .forum-card-label {
  display: inline-flex;
  margin-bottom: 10px;
  color: #6841c6;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.forum-page .forum-categories .search-box {
  max-width: 560px;
}

.forum-page .categories-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 14px;
}

.forum-page .category-card {
  min-height: 164px;
  padding: 19px;
}

.forum-page .category-card h3 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.forum-page .forum-category-icon {
  display: inline-grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(124, 58, 237, 0.13);
  border-radius: 14px;
  background: rgba(124, 58, 237, 0.08);
  font-size: 1.25rem;
}

.forum-page .forum-info {
  border-top: 3px solid rgba(124, 58, 237, 0.42);
}

html[data-theme="black"] .forum-page .forum-intro {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(124, 58, 237, 0.22), transparent 38%),
    linear-gradient(135deg, rgba(27, 23, 43, 0.98), rgba(17, 23, 39, 0.98));
}

html[data-theme="black"] .forum-page .forum-intro h2 {
  color: #fff;
}

html[data-theme="black"] .forum-page .forum-card-label {
  color: #c4b5fd;
}

html[data-theme="black"] .forum-page .forum-category-icon {
  border-color: rgba(167, 139, 250, 0.18);
  background: rgba(167, 139, 250, 0.12);
}

.forum-category-page .content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: none;
  margin: 0;
  padding: 0 4px 20px;
}

.forum-category-page .category-info-card {
  min-width: 0;
  margin: 0;
  padding: clamp(20px, 3vw, 28px);
  border-color: rgba(109, 94, 245, 0.11);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 34px rgba(38, 35, 81, 0.055);
}

.forum-category-page .category-intro,
.forum-category-page .category-topics {
  grid-column: 1 / -1;
}

.forum-category-page .category-intro {
  position: relative;
  overflow: hidden;
  border-color: rgba(124, 58, 237, 0.18);
  background:
    radial-gradient(ellipse at 100% 0%, rgba(192, 132, 252, 0.2), transparent 38%),
    linear-gradient(135deg, #fff 0%, #f5f1ff 58%, #eff5ff 100%);
}

.forum-category-page .category-intro h2 {
  max-width: 32ch;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
}

.forum-category-page .forum-card-label {
  display: inline-flex;
  margin-bottom: 10px;
  color: #6841c6;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.forum-category-page .category-compose .search-box {
  margin-top: 0;
}

.forum-category-page .category-compose .create-topic-btn,
.forum-category-page .category-compose .topic-form button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #6841c6, #4f6fe8);
  box-shadow: 0 10px 24px rgba(88, 65, 198, 0.18);
}

.forum-category-page .category-compose .create-topic-btn {
  padding: 12px 18px;
}

.forum-category-page .topic-card {
  border-color: rgba(109, 94, 245, 0.11);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(247, 247, 255, 0.9));
  box-shadow: 0 7px 22px rgba(38, 35, 81, 0.04);
}

.forum-category-page .category-info-card h2 {
  color: #211d39;
  letter-spacing: -0.04em;
}

.forum-category-page .category-info-card p,
.forum-category-page .category-info-card li {
  color: #626176;
}

html[data-theme="black"] .forum-category-page .category-info-card {
  background: rgba(16, 19, 31, 0.9);
  border-color: rgba(167, 139, 250, 0.13);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.14);
}

html[data-theme="black"] .forum-category-page .category-intro {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(124, 58, 237, 0.22), transparent 38%),
    linear-gradient(135deg, rgba(27, 23, 43, 0.98), rgba(17, 23, 39, 0.98));
}

html[data-theme="black"] .forum-category-page .category-intro h2,
html[data-theme="black"] .forum-category-page .category-info-card h2 {
  color: #fff;
}

html[data-theme="black"] .forum-category-page .forum-card-label {
  color: #c4b5fd;
}

html[data-theme="black"] .forum-category-page .category-info-card p,
html[data-theme="black"] .forum-category-page .category-info-card li,
html[data-theme="black"] .forum-category-page .topic-card,
html[data-theme="black"] .forum-category-page .topic-date,
html[data-theme="black"] .forum-category-page .reply-count {
  color: rgba(229, 231, 245, 0.76);
}

html[data-theme="black"] .forum-category-page .topic-card {
  background: rgba(16, 19, 31, 0.9);
  border-color: rgba(167, 139, 250, 0.13);
}

html[data-theme="black"] .forum-category-page .category-compose .topic-form .field span {
  color: #e4dcff;
}

@media (max-width: 700px) {
  .forum-page .forum-content {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .forum-page .forum-intro,
  .forum-page .forum-categories {
    grid-column: auto;
  }

  .forum-page .category-card {
    min-height: 0;
  }

  .forum-category-page .content {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
  }

  .forum-category-page .category-intro,
  .forum-category-page .category-topics {
    grid-column: auto;
  }
}
