.container {
  width: min(1140px, calc(100% - 2rem));
  margin: 0 auto;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  overflow: visible;
  background: #050505;
  border-bottom: 1px solid var(--border);
  transition:
    background 180ms ease,
    box-shadow 180ms ease;
}

.site-header.is-scrolled {
  background: #050505;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto minmax(130px, 1fr);
  gap: 1rem;
  align-items: center;
  min-height: 72px;
  overflow: visible;
}

.dashboard-logo {
  display: inline-flex;
  min-width: 0;
  gap: 0.6rem;
  align-items: center;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: normal;
  letter-spacing: 0;
  transition: transform 0.2s ease;
}

.dashboard-logo:hover {
  transform: scale(1.02);
}

.dashboard-logo-avatar {
  display: block;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid rgba(225, 29, 46, 0.35);
  border-radius: 0.65rem;
  object-fit: cover;
  box-shadow: 0 0 20px rgba(225, 29, 46, 0.2);
}

.dashboard-logo > .animated-brand {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.animated-brand {
  display: inline-flex;
  min-width: 0;
  align-items: baseline;
  letter-spacing: 0;
  white-space: nowrap;
}

.animated-brand > span {
  display: inline-flex;
  align-items: baseline;
}

.brand-letter {
  display: inline-block;
  position: relative;
  animation: brand-letter-in 420ms ease-out backwards;
  animation-delay: calc(var(--letter-index, 0) * 24ms);
  transition: color 180ms ease;
}

.brand-space {
  width: 0.32em;
}

.animated-brand:hover .brand-letter {
  color: var(--primary);
}

.brand-hero-title {
  width: max-content;
  margin: 0;
  max-width: none;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  white-space: nowrap;
}

.masked-brand {
  display: inline-block;
  color: transparent;
  background-image: linear-gradient(
    110deg,
    #7d101b 0%,
    #e11d2e 24%,
    #fff 48%,
    #c7192b 70%,
    #570914 100%
  );
  background-size: 220% 100%;
  background-position: 0 50%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: default;
  transform: translateZ(0);
}

.ghost-title-animation {
  --title-ghost-fill: #e11d2e;
  position: relative;
  display: inline-block;
  isolation: isolate;
}

.title-ghost {
  position: absolute;
  top: 50%;
  left: calc(100% + 0.8em);
  z-index: 2;
  width: 0.48em;
  height: 0.72em;
  border-radius: 100% / 70% 70% 0 0;
  background-color: var(--title-ghost-fill);
  background-image:
    radial-gradient(ellipse at 35% 40%, #050505 8%, transparent 9%),
    radial-gradient(ellipse at 65% 40%, #050505 8%, transparent 9%),
    radial-gradient(ellipse at 50% 60%, #050505 8%, transparent 9%);
  mix-blend-mode: exclusion;
  opacity: 0.92;
  pointer-events: none;
  transform: translate3d(0, -50%, 0) rotate(-90deg);
  will-change: transform;
}

.title-ghost i {
  position: absolute;
  bottom: -42%;
  width: 20%;
  height: 50%;
  background: var(--title-ghost-fill);
}

.title-ghost i:nth-child(1) {
  left: 0;
  height: 63%;
  border-radius: 0 0 50% 50%;
}

.title-ghost i:nth-child(2),
.title-ghost i:nth-child(4) {
  bottom: -25%;
  height: 38%;
  background: transparent;
  border-radius: 50% 50% 0 0;
}

.title-ghost i:nth-child(2) {
  left: 20%;
}

.title-ghost i:nth-child(3) {
  left: 40%;
  border-radius: 0 0 60% 60%;
}

.title-ghost i:nth-child(4) {
  left: 60%;
}

.title-ghost i:nth-child(5) {
  left: 80%;
  height: 36%;
  border-radius: 0 0 70% 70%;
}

@keyframes title-ghost-sweep {
  0% {
    left: calc(100% + 0.8em);
    transform: translate3d(0, -50%, 0) rotate(-90deg);
  }
  100% {
    left: -1.2em;
    transform: translate3d(0, -50%, 0) rotate(-90deg);
  }
}

@keyframes brand-letter-in {
  from {
    opacity: 0;
    transform: translateY(0.3em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .brand-hero-title {
    font-size: clamp(2rem, 10vw, 2.7rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brand-letter {
    animation: none;
    transition: none;
  }

  .title-ghost {
    display: none;
  }
}

.primary-nav,
.account-area,
.profile-link {
  display: flex;
  align-items: center;
}

.primary-nav {
  justify-content: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.primary-nav a {
  position: relative;
  z-index: 0;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  padding: 0.52rem 0.9rem;
  border-radius: 999px;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  overflow: hidden;
  transition:
    color 200ms ease,
    transform 200ms ease;
}

.primary-nav a::before,
.primary-nav a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.primary-nav a::before {
  z-index: 1;
  border-top: 2px solid var(--secondary);
  border-bottom: 2px solid var(--secondary);
  opacity: 0;
  transform: scaleY(1.7);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.primary-nav a::after {
  z-index: -1;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  opacity: 0;
  transform: scaleY(0);
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}

.primary-nav a:hover,
.primary-nav a:focus-visible {
  background: transparent;
  color: var(--secondary);
  outline: none;
}

.primary-nav a:hover::before,
.primary-nav a:focus-visible::before {
  opacity: 1;
  transform: scaleY(1);
}

.primary-nav a:hover::after,
.primary-nav a:focus-visible::after {
  opacity: 1;
  transform: scaleY(1);
}

@media (prefers-reduced-motion: reduce) {
  .primary-nav a,
  .primary-nav a::before,
  .primary-nav a::after {
    transition: none;
  }
}

.account-area {
  position: relative;
  z-index: 210;
  justify-content: flex-end;
  gap: 0.65rem;
}

.account-menu {
  position: relative;
  z-index: 220;
}

/* Dismissible menus without JavaScript: a hidden checkbox toggle; a label
   trigger; and a full-screen label backdrop shown only while checked.
   Clicking anywhere outside the menu hits the backdrop label, which
   unchecks the toggle and closes the menu. */
.menu-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
  pointer-events: none;
}

.menu-backdrop {
  display: none;
}

.menu-toggle:checked ~ .menu-backdrop {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 990;
  cursor: default;
}

.profile-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(225, 29, 46, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  list-style: none;
}

.menu-toggle:focus-visible ~ .profile-trigger {
  outline: 2px solid #e11d2e;
  outline-offset: 2px;
}

.profile-trigger img,
.avatar-fallback {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.account-menu .menu-toggle:checked ~ .profile-trigger,
.profile-trigger:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border);
}

.profile-trigger:hover img,
.profile-trigger:hover .avatar-fallback {
  transform: scale(1.08);
}

.account-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  z-index: 1000;
  grid-gap: 0.35rem;
  min-width: 230px;
  padding: 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: rgba(16, 16, 16, 0.98);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
}

.account-menu .menu-toggle:checked ~ .account-dropdown {
  display: grid;
}

.account-dropdown strong {
  overflow: hidden;
  padding: 0.45rem 0.55rem;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dropdown a,
.account-dropdown button {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 2.25rem;
  padding: 0.55rem;
  border-radius: 0.45rem;
  color: var(--muted);
  font-weight: 400;
  text-align: left;
  white-space: nowrap;
}

.account-dropdown a > i,
.account-dropdown button > i {
  width: 1.15rem;
  flex: 0 0 1.15rem;
  color: var(--primary);
  text-align: center;
}

.account-dropdown form {
  margin: 0;
}

.account-dropdown .custom-bot-link {
  display: flex;
}

.account-dropdown button {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.account-dropdown a:hover,
.account-dropdown button:hover {
  background: rgba(225, 29, 46, 0.13);
  color: var(--ink);
}

.avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-weight: 900;
}

.page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.dashboard-content {
  flex: 1;
  padding: 2.5rem 0;
}

.dashboard-content > .container > section,
.dashboard-content > .container > .home-grid,
.dashboard-content > .container > .command-browser {
  content-visibility: visible;
}

.server-card,
.tournament-panel,
.feature-panel,
.tournament-ad-card,
.moderation-card {
  contain: layout style;
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition:
    opacity 650ms ease,
    transform 650ms ease;
}

@media (prefers-reduced-motion: reduce), (max-width: 760px) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
}

@media (prefers-reduced-motion: reduce), (max-width: 760px) {
  .stagger-children > * {
    opacity: 1;
    transform: none;
    animation: none !important;
  }
}

.stagger-children.is-visible > * {
  animation: staggerIn 0.6s ease forwards;
}

.stagger-children.is-visible > *:nth-child(1) {
  animation-delay: 0s;
}
.stagger-children.is-visible > *:nth-child(2) {
  animation-delay: 0.08s;
}
.stagger-children.is-visible > *:nth-child(3) {
  animation-delay: 0.16s;
}
.stagger-children.is-visible > *:nth-child(4) {
  animation-delay: 0.24s;
}
.stagger-children.is-visible > *:nth-child(5) {
  animation-delay: 0.32s;
}
.stagger-children.is-visible > *:nth-child(6) {
  animation-delay: 0.4s;
}
