html {
  scrollbar-gutter: stable;
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

/* Background nebula */
.nebula {
  position: fixed;
  top: 10%;
  left: -15%;
  width: 55vw;
  height: 55vw;
  max-width: 700px;
  max-height: 700px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 40% 40%,
    rgba(168, 85, 247, 0.35) 0%,
    rgba(59, 130, 246, 0.25) 35%,
    rgba(6, 182, 212, 0.12) 55%,
    transparent 70%
  );
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  animation: nebula-drift 18s ease-in-out infinite alternate;
}

.nebula-secondary {
  position: fixed;
  bottom: 5%;
  right: -10%;
  width: 40vw;
  height: 40vw;
  max-width: 500px;
  max-height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  animation: nebula-drift-alt 22s ease-in-out infinite alternate;
}

.nav-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
  background: rgba(14, 15, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9999px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.625rem 1.25rem;
}

.nav-slot {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 10;
}

.nav-slot-start {
  min-width: 2.5rem;
}

.nav-slot-end {
  gap: 0.625rem;
  margin-left: auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  text-decoration: none;
  transition: opacity 0.15s;
}

.nav-brand:hover {
  opacity: 0.9;
}

.nav-brand img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  flex-shrink: 0;
}

.nav-brand-name,
.nav-brand span {
  font-size: 1.125rem;
  font-weight: 600;
  white-space: nowrap;
}

.nav-brand-center {
  display: none;
}

.nav-avatar-mobile {
  display: none;
}

.nav-hamburger {
  display: none;
}

.nav-hamburger-line {
  display: block;
  width: 1.125rem;
  height: 2px;
  border-radius: 1px;
  background: #e4e4e7;
}

.nav-hamburger-line + .nav-hamburger-line {
  margin-top: 0.3125rem;
}

.mobile-nav-backdrop {
  display: none;
}

.mobile-nav-drawer {
  display: none;
}

.mobile-nav-drawer.hidden {
  display: none !important;
}

.mobile-nav-link {
  display: block;
  padding: 0.875rem 1rem;
  border-radius: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #9494a8;
  transition: background 0.15s, color 0.15s;
}

.mobile-nav-link:hover,
.mobile-nav-link-active {
  color: white;
  background: rgba(255, 255, 255, 0.06);
}

@media (min-width: 640px) {
  .nav-pill {
    padding: 0.625rem 1.5rem;
  }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.nav-links-center .nav-link {
  pointer-events: auto;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #9494a8;
  transition: color 0.15s;
}

.nav-link:hover,
.nav-link-active {
  color: white;
}

.page-container {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

@media (min-width: 640px) {
  .page-container {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Profile menu */
.profile-menu-wrapper {
  position: absolute;
  right: 0;
  top: calc(100% + 0.75rem);
}

.profile-menu-wrapper.hidden {
  display: none;
}

.profile-dropdown {
  position: relative;
  min-width: 14rem;
  padding: 0.5rem;
  background: rgba(18, 19, 26, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.lang-panel {
  position: absolute;
  left: calc(100% + 0.5rem);
  top: 0;
  min-width: 11.5rem;
  padding: 0.5rem;
  background: rgba(18, 19, 26, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.lang-panel.hidden {
  display: none;
}

.lang-panel::-webkit-scrollbar {
  width: 4px;
}

.lang-panel::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 0.875rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #e4e4e7;
  text-align: left;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.menu-item svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: #8b8fa3;
}

.menu-item:hover svg {
  color: #c4c4cc;
}

.menu-item-danger {
  color: #f87171;
}

.menu-item-danger svg {
  color: #f87171;
}

.menu-item-danger:hover {
  background: rgba(248, 113, 113, 0.08);
}

.menu-divider {
  height: 1px;
  margin: 0.375rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
}

.lang-option {
  justify-content: space-between;
}

.lang-option.active {
  background: rgba(255, 255, 255, 0.06);
}

.lang-option .lang-flag-img {
  flex-shrink: 0;
  border-radius: 2px;
  object-fit: cover;
}

.menu-item-lang-trigger .lang-flag-img {
  flex-shrink: 0;
  border-radius: 2px;
  object-fit: cover;
}

.menu-item-lang-trigger .chevron {
  margin-left: auto;
  width: 1rem;
  height: 1rem;
  color: #8b8fa3;
}

/* Navbar language picker */
.nav-lang-trigger {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.5rem;
  border-radius: 0.5rem;
  transition: background 0.15s;
}

.nav-lang-trigger:hover,
.nav-lang-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.06);
}

.nav-lang-flag {
  display: block;
  border-radius: 2px;
  object-fit: cover;
}

.nav-lang-chevron {
  width: 0.875rem;
  height: 0.875rem;
  color: #8b8fa3;
}

.nav-lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 11.5rem;
  padding: 0.5rem;
  background: rgba(18, 19, 26, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
  z-index: 70;
}

.nav-lang-menu.hidden,
.profile-menu-wrapper.hidden,
.lang-panel.hidden {
  display: none !important;
}

.nav-lang-menu:not(.hidden),
.profile-menu-wrapper:not(.hidden),
.lang-panel:not(.hidden) {
  display: block;
}

.nav-lang-menu,
.profile-menu-wrapper,
.lang-panel {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition:
    opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.nav-lang-menu.is-open,
.profile-menu-wrapper.is-open,
.lang-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.lang-panel.is-open {
  transform-origin: top right;
}

.profile-trigger {
  display: flex;
  align-items: center;
  padding: 0.25rem;
  border-radius: 9999px;
  transition: background 0.15s;
}

.profile-trigger:hover,
.profile-trigger[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.06);
}

.profile-trigger img {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
}

.btn-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.5rem;
  padding: 0 1.125rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  background: #5865f2;
  color: white;
  transition: background 0.2s;
}

.btn-login:hover {
  background: #4752c4;
}

/* Botões */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  height: 3.5rem;
  padding: 0 2rem;
  border-radius: 0.625rem;
  font-size: 1rem;
  font-weight: 500;
  background: #5865f2;
  color: white;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  background: #4752c4;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(88, 101, 242, 0.3);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.25);
}

.discord-icon {
  flex-shrink: 0;
  width: auto;
  aspect-ratio: 71 / 55;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  height: 3.5rem;
  padding: 0 2rem;
  border-radius: 0.625rem;
  font-size: 1rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  color: #e4e4e7;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

.btn-secondary:active {
  transform: translateY(0) scale(0.98);
}

/* Footer */
.site-footer {
  position: relative;
  z-index: 10;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 11, 16, 0.8);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.footer-brand-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-brand-row img {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.375rem;
}

.footer-brand-row span {
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
}

.footer-copy {
  font-size: 0.6875rem;
  color: #8b8fa3;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem 2.5rem;
}

.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.375rem;
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.footer-col a {
  font-size: 0.75rem;
  color: #8b8fa3;
  transition: color 0.15s;
}

.footer-col a:hover {
  color: white;
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
  }
}

/* Landing */
.landing-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2.5rem;
}

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

.landing-logo {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.landing-title {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: white;
  line-height: 1;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.landing-actions .btn-primary,
.landing-actions .btn-secondary {
  height: 3rem;
  min-width: 14rem;
  padding: 0 1.5rem;
  font-size: 0.9375rem;
}

/* Notify toast */
.notify {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  animation: notify-in 0.35s ease;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.notify-hide {
  opacity: 0;
  transform: translateY(-0.5rem);
  pointer-events: none;
}

.notify-error {
  background: rgba(18, 14, 16, 0.92);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.notify-error .notify-icon {
  color: #f87171;
}

.notify-success {
  background: rgba(14, 20, 17, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: #bbf7d0;
}

.notify-success .notify-icon {
  color: #34d399;
}

.notify-info {
  background: rgba(14, 16, 22, 0.92);
  border: 1px solid rgba(88, 101, 242, 0.35);
  color: #dbeafe;
}

.notify-info .notify-icon {
  color: #818cf8;
}

.notify-warning {
  background: rgba(22, 18, 12, 0.92);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: #fde68a;
}

.notify-warning .notify-icon {
  color: #fbbf24;
}

.notify-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}

.notify-stack {
  position: fixed;
  top: 5.5rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  max-width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.notify-stack .notify {
  position: relative;
  top: auto;
  right: auto;
  pointer-events: auto;
}

.notify-text {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
}

.notify-close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem;
  border: none;
  background: transparent;
  color: #8b8fa3;
  cursor: pointer;
  border-radius: 0.375rem;
  transition: color 0.15s, background 0.15s;
}

.notify-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.notify-close svg {
  width: 1rem;
  height: 1rem;
}

@keyframes notify-in {
  from {
    opacity: 0;
    transform: translateY(-0.75rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 640px) {
  .notify-stack {
    right: 1.5rem;
  }
}

@media (min-width: 640px) {
  .landing-brand {
    gap: 1.25rem;
  }

  .landing-logo {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.125rem;
  }

  .landing-title {
    font-size: 4.5rem;
  }

  .landing-actions {
    flex-direction: row;
    gap: 1rem;
  }

  .landing-actions .btn-primary,
  .landing-actions .btn-secondary {
    min-width: auto;
  }
}

/* Dashboard cards */
.guild-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 19, 26, 0.8);
  padding: 1.25rem;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
}

.guild-card:hover {
  border-color: rgba(88, 101, 242, 0.3);
  background: rgba(26, 27, 36, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.guild-card-body {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  flex: 1;
}

.guild-card-action {
  margin-top: 1.25rem;
}

.guild-card-action .btn-primary,
.guild-card-action .btn-secondary {
  width: 100%;
}

/* Legal pages */
.legal-page h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
}

.legal-page h3 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: white;
}

.legal-content {
  color: #8b8fa3;
  font-size: 0.9375rem;
  line-height: 1.75;
}

.legal-content p {
  margin-bottom: 1rem;
}

.legal-content ul {
  margin: 0 0 1rem 1.25rem;
  list-style: disc;
}

.legal-content li {
  margin-bottom: 0.375rem;
}

.legal-link {
  color: #5865f2;
  transition: color 0.15s;
}

.legal-link:hover {
  color: #818cf8;
}

.legal-footer-note {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 500;
  color: #a1a1aa;
}

select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%239494a8' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* ── Page reveal (Noctaly-style fade-up + blur) ── */

@keyframes nebula-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(4vw, 3vh) scale(1.04); }
}

@keyframes nebula-drift-alt {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-3vw, -2vh) scale(1.05); }
}

[data-reveal],
[data-reveal-group] > * {
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform, filter;
}

[data-reveal]:not(.is-revealed),
[data-reveal-group]:not(.is-revealed) > * {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  filter: blur(10px);
}

[data-reveal].is-revealed,
[data-reveal-group].is-revealed > * {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  filter: blur(0);
}

[data-reveal-group].is-revealed > *:nth-child(1) { transition-delay: 0ms; }
[data-reveal-group].is-revealed > *:nth-child(2) { transition-delay: 90ms; }
[data-reveal-group].is-revealed > *:nth-child(3) { transition-delay: 180ms; }
[data-reveal-group].is-revealed > *:nth-child(4) { transition-delay: 270ms; }
[data-reveal-group].is-revealed > *:nth-child(5) { transition-delay: 360ms; }
[data-reveal-group].is-revealed > *:nth-child(6) { transition-delay: 450ms; }
[data-reveal-group].is-revealed > *:nth-child(7) { transition-delay: 540ms; }
[data-reveal-group].is-revealed > *:nth-child(8) { transition-delay: 630ms; }
[data-reveal-group].is-revealed > *:nth-child(n + 9) { transition-delay: 720ms; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal],
  [data-reveal-group] > * {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
}

/* ── Layout & mobile ── */

.site-header {
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.page-main {
  padding-top: calc(5.25rem + env(safe-area-inset-top, 0px));
  padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
}

.landing.page-main {
  padding-top: calc(5.5rem + env(safe-area-inset-top, 0px));
  min-height: calc(100dvh - 4rem);
}

@media (min-width: 640px) {
  .site-header {
    padding-top: max(1.25rem, env(safe-area-inset-top, 0px));
  }

  .page-main {
    padding-top: calc(7.5rem + env(safe-area-inset-top, 0px));
    padding-bottom: 3rem;
  }
}

@media (max-width: 767px) {
  .page-container {
    padding-left: max(1.125rem, env(safe-area-inset-left, 0px) + 0.875rem);
    padding-right: max(1.125rem, env(safe-area-inset-right, 0px) + 0.875rem);
  }

  .nav-pill {
    display: grid;
    grid-template-columns: minmax(2.5rem, 1fr) minmax(0, auto) minmax(2.5rem, 1fr);
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    min-height: 3.5rem;
  }

  .nav-slot-start {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
    z-index: 2;
  }

  .nav-brand-center {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    position: static;
    left: auto;
    top: auto;
    transform: none;
    justify-self: center;
    align-items: center;
    gap: 0.375rem;
    max-width: 100%;
    min-width: 0;
    z-index: 1;
    pointer-events: auto;
  }

  .nav-brand-center img {
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 0.4375rem;
    flex-shrink: 0;
  }

  .nav-brand-center span {
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 5.5rem;
  }

  .nav-links-center {
    display: none !important;
  }

  .nav-slot-end {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    margin-left: 0;
    gap: 0.375rem;
    z-index: 2;
    flex-shrink: 0;
  }

  .nav-brand-desktop {
    display: none !important;
  }

  .nav-hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 0.5rem;
  }

  .nav-hamburger:hover,
  .nav-hamburger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.06);
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: transparent;
  }

  .mobile-nav-backdrop.hidden {
    display: none !important;
  }

  .mobile-nav-backdrop.is-open {
    display: block;
    opacity: 1;
  }

  .mobile-nav-backdrop {
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .mobile-nav-drawer {
    position: fixed;
    left: max(1.125rem, env(safe-area-inset-left, 0px) + 0.875rem);
    top: calc(4.25rem + env(safe-area-inset-top, 0px));
    width: min(13rem, calc(100vw - 2.25rem));
    height: auto;
    padding: 0.375rem;
    background: #12131a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    z-index: 60;
    overflow: visible;
    opacity: 0;
    transform: translateX(-10px);
    transition:
      opacity 0.24s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
  }

  .mobile-nav-drawer.is-open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  .mobile-nav-inner {
    position: relative;
    display: flex;
    flex-direction: column;
  }

  .mobile-nav-links {
    padding-bottom: 0.125rem;
  }

  .mobile-nav-footer {
    position: relative;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .mobile-nav-drawer:not(.hidden) {
    display: flex;
    flex-direction: column;
  }

  .mobile-lang-panel.hidden {
    display: none !important;
  }

  .mobile-lang-panel:not(.hidden) {
    display: block;
  }

  .mobile-nav-link {
    padding: 0.6875rem 0.875rem;
  }

  .mobile-lang-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 0.875rem;
    margin-top: 0.25rem;
    border: none;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.04);
    color: #e4e4e7;
    font-size: 0.9375rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
  }

  .mobile-lang-trigger:hover,
  .mobile-lang-trigger[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
  }

  .mobile-lang-trigger .lang-flag-img {
    flex-shrink: 0;
    border-radius: 2px;
    object-fit: cover;
  }

  .mobile-lang-chevron {
    margin-left: auto;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    color: #8b8fa3;
  }

  .mobile-lang-panel {
    position: absolute;
    left: calc(100% + 0.375rem);
    top: 0;
    bottom: auto;
    width: min(11rem, calc(100vw - 2.25rem));
    max-height: 14rem;
    padding: 0.375rem;
    overflow-y: auto;
    background: #12131a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    z-index: 61;
    opacity: 0;
    transform: translateX(-8px);
    transition:
      opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
  }

  .mobile-lang-panel.is-open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
  }

  .mobile-lang-panel .lang-option {
    width: 100%;
  }

  .mobile-lang-panel::-webkit-scrollbar {
    width: 4px;
  }

  .mobile-lang-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
  }

  .nav-avatar-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .nav-avatar-mobile img {
    width: 2.375rem;
    height: 2.375rem;
    border-radius: 9999px;
    object-fit: cover;
  }

  .nav-lang-desktop {
    display: none !important;
  }

  .nav-lang-trigger {
    padding: 0.3125rem 0.375rem;
    flex-shrink: 0;
  }

  .nav-lang-chevron {
    width: 0.75rem;
    height: 0.75rem;
  }

  .btn-login {
    height: 2.25rem;
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 0.5rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .profile-trigger img {
    width: 2.125rem;
    height: 2.125rem;
  }

  .page-main .page-container {
    padding-left: max(1.375rem, env(safe-area-inset-left, 0px) + 1rem);
    padding-right: max(1.375rem, env(safe-area-inset-right, 0px) + 1rem);
  }

  .page-main {
    padding-top: calc(5.75rem + env(safe-area-inset-top, 0px));
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom, 0px));
  }

  .page-main .page-container > header {
    margin-bottom: 1.75rem;
  }

  .page-main .page-container > header h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .page-main .page-container > header p {
    font-size: 1rem;
    line-height: 1.5;
    margin-top: 0.5rem;
  }

  [data-reveal-group] {
    gap: 1.25rem !important;
  }

  .guild-card {
    padding: 1.375rem;
    border-radius: 1.125rem;
  }

  .guild-card-action {
    margin-top: 1.375rem;
  }

  .guild-card-action .btn-primary,
  .guild-card-action .btn-secondary {
    height: 2.875rem;
  }

  .footer-inner {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .btn-login .discord-icon {
    display: none;
  }

  .nav-lang-menu {
    right: 0;
    left: auto;
    min-width: min(11.5rem, calc(100vw - 2rem));
  }

  .profile-menu-wrapper {
    right: 0;
    left: auto;
    width: min(16rem, calc(100vw - 2rem));
  }

  .lang-panel {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: auto;
    bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: 18rem;
    margin-inline: auto;
    z-index: 80;
  }

  .lang-panel.is-open {
    transform-origin: center bottom;
  }

  .landing-title {
    font-size: 2.75rem;
  }

  .landing-brand {
    flex-direction: column;
    gap: 0.75rem;
  }

  .landing-actions {
    width: 100%;
    max-width: 20rem;
  }

  .landing-actions .btn-primary,
  .landing-actions .btn-secondary {
    width: 100%;
    min-width: 0;
  }

  .btn-primary,
  .btn-secondary {
    height: 3rem;
    padding: 0 1.25rem;
    font-size: 0.9375rem;
  }

  .notify-stack {
    top: calc(4.75rem + env(safe-area-inset-top, 0px));
    left: 1rem;
    right: 1rem;
    max-width: none;
  }

  .footer-links {
    gap: 1.5rem 2rem;
  }

  .legal-content {
    font-size: 0.875rem;
  }

  .command-row {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }
}

@media (min-width: 768px) {
  .lang-panel {
    transform-origin: center left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nebula,
  .nebula-secondary {
    animation: none !important;
  }

  .nav-lang-menu,
  .profile-menu-wrapper,
  .lang-panel,
  .mobile-nav-drawer,
  .mobile-lang-panel {
    transition: none !important;
  }
}
