.site-top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: var(--header-h);
  padding: 10px clamp(14px, 3vw, 28px);
  background: rgba(5, 5, 10, 0.96);
  border-bottom: 1px solid var(--border-purple);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  justify-self: start;
}

.brand:hover {
  text-decoration: none;
  color: var(--text);
}

.brand__mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, var(--cyan), transparent 55%),
    linear-gradient(145deg, #2a1850, #0c1024);
  border: 1px solid rgba(62, 203, 255, 0.45);
  box-shadow: var(--glow-purple);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand__mark svg {
  width: 24px;
  height: 24px;
}

.brand__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(0.92rem, 2vw, 1.1rem);
  letter-spacing: -0.02em;
  line-height: 1;
}

.brand__tag {
  display: block;
  margin-top: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top-credits {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(30, 20, 60, 0.95), rgba(12, 10, 28, 0.98));
  border: 1px solid var(--border);
  box-shadow: var(--glow-cyan);
}

.top-credits img {
  width: 22px;
  height: 22px;
}

.top-credits__label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.top-credits__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--cyan);
}

.top-credits__value.balance-pulse {
  animation: creditPulse 0.55s ease;
}

@keyframes creditPulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.08);
    color: #fff;
  }
  100% {
    transform: scale(1);
  }
}

.nav {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: flex-end;
}

.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--purple);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--border-purple);
  background: linear-gradient(145deg, rgba(42, 24, 80, 0.95), rgba(12, 16, 36, 0.98));
  color: var(--text);
  cursor: pointer;
  justify-self: end;
}

.nav-toggle__bars {
  display: grid;
  gap: 5px;
  width: 18px;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-top.is-nav-open .nav-toggle__bars span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-top.is-nav-open .nav-toggle__bars span:nth-child(2) {
  opacity: 0;
}

.site-top.is-nav-open .nav-toggle__bars span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 35;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(5, 5, 10, 0.62);
  cursor: pointer;
}

body.nav-open {
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-coral {
  background: linear-gradient(180deg, #ff5a78, var(--accent));
  color: #fff;
  border-color: #ff7a94;
  box-shadow: 0 0 22px rgba(255, 59, 92, 0.35);
}

.btn-coral:hover {
  color: #fff;
  box-shadow: 0 0 30px rgba(255, 59, 92, 0.5);
}

.btn-teal {
  background: linear-gradient(180deg, #63d8ff, #1ea8e0);
  color: #041018;
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan);
}

.btn-teal:hover {
  color: #041018;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-purple);
}

.btn-ghost:hover {
  background: rgba(177, 76, 255, 0.12);
  color: var(--text);
}

.btn-on-dark {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-color: rgba(62, 203, 255, 0.45);
}

.btn-on-dark:hover {
  background: rgba(62, 203, 255, 0.12);
  color: #fff;
}

.site-foot {
  margin-top: 64px;
  padding: 48px clamp(16px, 4vw, 32px) 36px;
  background: linear-gradient(180deg, #0c0c1a, #05050a);
  border-top: 1px solid var(--border-purple);
  color: var(--text-muted);
}

.site-foot__inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.site-foot a {
  color: var(--text);
}

.site-foot__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.site-foot__nav a {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.site-foot__nav a:hover {
  color: var(--cyan);
}

.site-foot__legal,
.site-foot__copy {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
}

.site-foot__warn {
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  background: rgba(255, 59, 92, 0.08);
  font-size: 0.9rem;
  color: var(--text);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  z-index: 80;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 12px;
  background: #16162a;
  border: 1px solid var(--border);
  color: #fff;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  border-color: var(--cyan);
}

.toast.error {
  border-color: var(--accent);
}

.age-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

@media (max-width: 860px) {
  .site-top {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "brand credits toggle";
  }

  .brand {
    grid-area: brand;
  }

  .top-credits {
    grid-area: credits;
    justify-self: end;
  }

  .nav-toggle {
    display: grid;
    grid-area: toggle;
  }

  .nav-backdrop:not([hidden]) {
    display: block;
  }

  .nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    z-index: 45;
    width: min(82vw, 300px);
    margin: 0;
    padding: 18px 16px 28px;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    justify-self: auto;
    justify-content: flex-start;
    background:
      linear-gradient(165deg, rgba(26, 16, 56, 0.98), rgba(8, 8, 18, 0.98));
    border-left: 1px solid var(--border-purple);
    box-shadow: -18px 0 40px rgba(0, 0, 0, 0.45);
    transform: translateX(104%);
    transition: transform 0.24s ease;
    overflow-y: auto;
  }

  .site-top.is-nav-open .nav {
    transform: translateX(0);
  }

  .nav a {
    padding: 14px 12px;
    border-bottom: 0;
    border-radius: 12px;
    font-size: 1rem;
  }

  .nav a:hover,
  .nav a[aria-current="page"] {
    background: rgba(177, 76, 255, 0.16);
    border-bottom-color: transparent;
    color: var(--text);
  }
}

@media (max-width: 520px) {
  .brand__tag {
    display: none;
  }

  .top-credits__label {
    display: none;
  }
}
