:root {
  --bg: #050816;
  --bg-soft: #0c1022;
  --surface: rgba(10, 15, 32, 0.72);
  --surface-strong: rgba(16, 23, 45, 0.92);
  --surface-light: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f8fbff;
  --muted: rgba(234, 241, 255, 0.7);
  --primary: #5d00fd;
  --primary-2: #ef4444;
  --gold: #f59e0b;
  --green: #22c55e;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --radius: 26px;
  --container: 1240px;
}

body[data-theme="red"] {
  --primary: #ef4444;
  --primary-2: #f97316;
}

body[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.84);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --surface-light: rgba(0, 0, 0, 0.04);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #0f172a;
  --muted: rgba(15, 23, 42, 0.68);
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.24), transparent 30%),
    radial-gradient(circle at top right, rgba(239, 68, 68, 0.16), transparent 28%),
    radial-gradient(circle at bottom center, rgba(245, 158, 11, 0.12), transparent 28%),
    linear-gradient(160deg, var(--bg-soft) 0%, var(--bg) 100%);
  overflow-x: hidden;
}

body.compact-mode .glass-card,
body.compact-mode .guild-card,
body.compact-mode .leaderboard-card,
body.compact-mode .feature-card {
  padding: 18px;
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation: none !important;
  transition: none !important;
}

img {
  max-width: 100%;
  display: block;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.aurora {
  position: fixed;
  inset: auto;
  width: 42vw;
  height: 42vw;
  border-radius: 999px;
  filter: blur(80px);
  opacity: 0.24;
  pointer-events: none;
  z-index: 0;
}

.aurora-one {
  top: -10vw;
  left: -8vw;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.95), rgba(239, 68, 68, 0.65));
}

.aurora-two {
  bottom: -12vw;
  right: -8vw;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.75), rgba(59, 130, 246, 0.75));
}

.site-body,
main,
header,
footer {
  position: relative;
  z-index: 1;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(5, 8, 22, 0.55);
  border-bottom: 1px solid var(--border);
}

.topbar.static {
  position: relative;
}

.nav-shell {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand img {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.brand strong {
  display: block;
  font-size: 1.02rem;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 0.86rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  transition: 0.22s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.hero-section,
.page-section,
.section-block {
  padding: 42px 0 68px;
}

.compact-top {
  padding-top: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: center;
}

.hero-copy h1,
.page-banner h1,
.section-heading h2,
.consent-card h1 {
  margin: 0 0 14px;
  line-height: 1.06;
}

.hero-copy h1 {
  font-size: clamp(2.45rem, 5vw, 4.7rem);
}

.page-banner h1,
.consent-card h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
}

.hero-copy p,
.page-banner p,
.section-heading p,
.memory-banner p,
.legal-body p,
.legal-body li,
.feature-card p,
.consent-card p,
.empty-state,
.guild-meta,
.leaderboard-meta,
.inline-status,
.card-muted,
.muted {
  color: var(--muted);
  line-height: 1.7;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #f3d0ff;
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions.compact {
  justify-content: flex-end;
}

.hero-actions.full-width {
  width: 100%;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 18px 38px rgba(124, 58, 237, 0.24);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: var(--border);
}

.btn-ghost {
  background: rgba(245, 158, 11, 0.12);
  color: #ffd38a;
  border-color: rgba(245, 158, 11, 0.22);
}

.full-width {
  width: 100%;
}

.glass-card,
.guild-card,
.leaderboard-card,
.feature-card,
.commands-category {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.hero-card,
.page-banner,
.form-card,
.legal-card,
.consent-card {
  padding: 28px;
}

.hero-card.large {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-headline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.card-headline p {
  margin: 0;
  font-weight: 600;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.status-dot.success {
  background: var(--green);
  box-shadow: 0 0 18px rgba(34, 197, 94, 0.7);
}

.hero-stack,
.card-grid,
.feature-grid,
.dashboard-grid,
.settings-grid,
.config-columns,
.switch-grid {
  display: grid;
  gap: 18px;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.dashboard-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-grid,
.config-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-card.wide,
.sticky-bar.wide {
  grid-column: 1 / -1;
}

.mini-card,
.guild-card,
.leaderboard-card,
.feature-card {
  padding: 22px;
}

.mini-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gradient-red {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(124, 58, 237, 0.2));
}

.gradient-violet {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.26), rgba(59, 130, 246, 0.18));
}

.gradient-gold {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(239, 68, 68, 0.18));
}

.mini-label,
.chip,
.mini-pill,
.inline-pill,
.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.mini-label,
.chip {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.mini-pill,
.inline-pill,
.badge.success {
  background: rgba(34, 197, 94, 0.14);
  color: #9af7b0;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge.warning {
  background: rgba(245, 158, 11, 0.14);
  color: #ffd38a;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.hero-stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hero-stats article {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stats strong,
.guild-title,
.leaderboard-title,
.feature-card h3,
.card-top h2,
.card-top h1,
.commands-toggle span,
.command-card strong {
  display: block;
  margin-bottom: 8px;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 24px;
}

.section-heading.small h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border-radius: 18px;
  font-size: 1.45rem;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(239, 68, 68, 0.24));
}

.memory-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.14), rgba(239, 68, 68, 0.12));
}

.memory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.memory-tags span {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
}

.commands-shell {
  display: grid;
  gap: 16px;
}

.commands-category {
  overflow: hidden;
}

.commands-toggle {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
}

.commands-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.commands-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.commands-arrow {
  transition: transform 0.2s ease;
}

.commands-arrow.rotated {
  transform: rotate(180deg);
}

.commands-list {
  padding: 0 18px 18px;
  display: grid;
  gap: 12px;
}

.command-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.command-card p {
  margin: 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.alert {
  margin: 0 0 18px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 700;
}

.alert.success {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.24);
  color: #a5f3b8;
}

.alert.error {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.24);
  color: #ffb4b4;
}

.page-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.panel-section {
  margin-bottom: 22px;
}

.guild-card,
.leaderboard-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.guild-head,
.profile-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.guild-icon,
.profile-avatar {
  width: 62px;
  height: 62px;
  border-radius: 20px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.08);
}

.profile-avatar {
  border-radius: 999px;
}

.guild-title,
.leaderboard-title {
  font-size: 1.08rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px dashed var(--border);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.two-fields,
.three-fields {
  display: grid;
  gap: 16px;
}

.two-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.three-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label {
  font-weight: 700;
}

.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(6, 10, 24, 0.78);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

body[data-theme="light"] .field-group input,
body[data-theme="light"] .field-group select,
body[data-theme="light"] .field-group textarea {
  background: rgba(255, 255, 255, 0.95);
}

.field-group textarea {
  resize: vertical;
  min-height: 120px;
}

.field-group select[multiple] {
  min-height: 170px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.switch-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--primary);
}

.sticky-bar {
  position: sticky;
  bottom: 18px;
  z-index: 4;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.card-top h1,
.card-top h2,
.legal-card h1,
.legal-body h2 {
  margin: 0;
}

.legal-card {
  max-width: 920px;
  margin: 0 auto;
}

.legal-date {
  color: var(--muted);
  margin-top: 10px;
  margin-bottom: 24px;
}

.legal-body h2 {
  margin-top: 24px;
  margin-bottom: 10px;
}

.legal-body ul,
.legal-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.9;
}

.legal-list a {
  text-decoration: underline;
}

.inline-status {
  margin-top: 12px;
}

.centered-page {
  display: grid;
  place-items: center;
}

.consent-shell {
  width: min(720px, calc(100% - 24px));
  margin: 36px auto;
}

.consent-list {
  display: grid;
  gap: 14px;
  margin: 20px 0 24px;
}

.consent-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.consent-item input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
}

.user-chip img {
  width: 36px;
  height: 36px;
  border-radius: 999px;
}

.reveal-up {
  opacity: 0;
  transform: translateY(18px);
  animation: revealUp 0.65s ease forwards;
}

.delay-1 {
  animation-delay: 0.12s;
}

.delay-2 {
  animation-delay: 0.24s;
}

@keyframes revealUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .hero-grid,
  .dashboard-grid.two-columns,
  .memory-banner,
  .settings-grid,
  .config-columns {
    grid-template-columns: 1fr;
  }

  .hero-actions.compact,
  .memory-tags {
    justify-content: flex-start;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .nav-shell,
  .page-banner,
  .card-top,
  .switch-row {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
  }

  .two-fields,
  .three-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .container {
    width: min(var(--container), calc(100% - 20px));
  }

  .hero-card,
  .page-banner,
  .form-card,
  .legal-card,
  .consent-card,
  .guild-card,
  .leaderboard-card,
  .feature-card {
    padding: 20px;
  }

  .btn,
  .hero-actions .btn {
    width: 100%;
  }

  .hero-actions,
  .hero-actions.compact {
    justify-content: stretch;
  }

  .guild-head,
  .profile-box {
    flex-direction: column;
    align-items: flex-start;
  }

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