.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 22px;
  min-height: 80px;
  padding: 0 36px;
  background: rgba(7, 8, 10, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: min-height 180ms ease, background 180ms ease;
}

.site-header.is-scrolled {
  min-height: 68px;
  background: rgba(7, 8, 10, 0.985);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  background: #111217;
  cursor: pointer;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 188px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  background: linear-gradient(145deg, var(--gold-soft), var(--orange) 55%, #7a3d10);
  border: 1px solid #ffe3a8;
  color: #170b04;
  font-weight: 900;
  box-shadow: 0 0 26px rgba(255, 116, 24, 0.32);
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 21px;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.main-nav,
.account-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
}

.account-actions {
  justify-self: end;
  position: relative;
}

.main-nav {
  justify-content: center;
}

.main-nav a,
.account-actions a:not(.charge-button) {
  color: #dedede;
}

.player-id {
  max-width: 160px;
  overflow: hidden;
  color: var(--gold-soft);
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-actions .player-id {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(219, 169, 84, 0.42);
  background: rgba(219, 169, 84, 0.08);
}

.player-id[hidden] {
  display: none !important;
}

.account-logout {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(219, 169, 84, 0.42);
  background: #111217;
  color: var(--gold-soft);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.account-logout[hidden] {
  display: none !important;
}

.account-actions .account-logout {
  position: absolute;
  top: calc(100% - 1px);
  left: 0;
  z-index: 80;
  min-width: 132px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.account-actions.is-logged-in:hover .account-logout,
.account-actions .account-logout:focus {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.main-nav a {
  position: relative;
  padding: 12px 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  height: 2px;
  background: var(--gold-soft);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.main-nav a:hover,
.account-actions a:hover,
.account-logout:hover {
  color: var(--gold-soft);
}

.main-nav a.is-current {
  color: var(--gold-soft);
}

.main-nav a.is-current::after {
  transform: scaleX(1);
}

.charge-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 24px;
  background: linear-gradient(135deg, var(--gold), var(--orange));
  color: #160b04;
  font-weight: 800;
}

.download-mini {
  display: none;
  min-height: 38px;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(241, 163, 41, 0.56);
  color: var(--gold-soft);
  font-weight: 800;
}

.site-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: min(390px, 86vw);
  padding: 28px;
  background: #101116;
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(-104%);
  transition: transform 220ms ease;
}

.drawer-open .site-drawer {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.drawer-head strong {
  font-size: 24px;
}

.drawer-head button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  font-size: 24px;
}

.site-drawer nav {
  display: grid;
  gap: 10px;
}

.site-drawer a {
  display: grid;
  gap: 6px;
  padding: 18px;
  background: #17181d;
  border: 1px solid var(--line);
  font-weight: 800;
}

.site-drawer a.is-current {
  border-color: rgba(219, 169, 84, 0.65);
  color: var(--gold-soft);
}

.site-drawer span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

.drawer-account {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.drawer-account a {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  background: rgba(240, 161, 42, 0.1);
  border-color: rgba(240, 161, 42, 0.34);
  color: var(--gold-soft);
}

.drawer-account .player-id {
  display: flex;
  grid-column: 1 / -1;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(219, 169, 84, 0.42);
  background: rgba(219, 169, 84, 0.08);
}

.drawer-account .account-logout {
  grid-column: 1 / -1;
  width: 100%;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.58);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.drawer-open .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.site-footer {
  display: grid;
  gap: 24px;
  padding: 48px max(36px, calc((100vw - var(--max)) / 2));
  background:
    linear-gradient(180deg, rgba(11, 11, 13, 0.94), #08080a),
    radial-gradient(circle at 50% 0%, rgba(240, 161, 42, 0.1), transparent 32%);
  color: var(--muted);
}

.site-footer strong {
  color: var(--text);
  font-size: 24px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 2fr;
  gap: 34px;
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 12px;
}

.footer-brand p,
.footer-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 18px 28px;
}

.site-footer nav a:hover {
  color: var(--gold-soft);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: #858892;
  font-size: 13px;
}

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(16, 17, 22, 0.86);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.qq-modal-open {
  overflow: hidden;
}

.qq-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
}

.qq-modal-backdrop[hidden] {
  display: none !important;
}

.qq-modal {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(260px, 360px);
  gap: 24px;
  width: min(820px, 100%);
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(28, 29, 34, 0.98), rgba(10, 10, 12, 0.98)),
    radial-gradient(circle at 12% 8%, rgba(240, 161, 42, 0.18), transparent 36%);
  border: 1px solid rgba(241, 163, 41, 0.42);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.62);
}

.qq-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.qq-modal-close,
.qq-float-close {
  display: grid;
  place-items: center;
  border: 1px solid rgba(241, 163, 41, 0.36);
  background: rgba(7, 8, 10, 0.82);
  color: var(--gold-soft);
  cursor: pointer;
}

.qq-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  font-size: 24px;
}

.qq-modal-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  min-height: 360px;
  padding: 8px 4px;
}

.qq-modal-copy p {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.qq-modal-copy h2 {
  margin: 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.04;
}

.qq-modal-copy strong {
  font-size: 28px;
}

.qq-modal-copy span {
  color: var(--muted-strong);
  font-size: 18px;
  font-weight: 800;
}

.qq-modal-copy .primary-button {
  width: fit-content;
  margin-top: 8px;
}

.qq-modal-qr {
  display: block;
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border: 1px solid rgba(241, 163, 41, 0.28);
  background: #191919;
}

.qq-float {
  position: fixed;
  right: 20px;
  top: 168px;
  z-index: 38;
  width: 168px;
  background: rgba(16, 17, 22, 0.94);
  border: 1px solid rgba(241, 163, 41, 0.42);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
}

.qq-float[hidden] {
  display: none !important;
}

.qq-float-close {
  position: absolute;
  top: -12px;
  right: -12px;
  z-index: 2;
  width: 28px;
  height: 28px;
  font-size: 18px;
}

.qq-float-card {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 14px;
  text-align: center;
}

.qq-float-card span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
}

.qq-float-card strong {
  font-size: 15px;
}

.qq-float-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #191919;
}

.qq-float-card small {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 960px) {
  .site-header {
    grid-template-columns: auto 1fr auto;
  }

  .menu-button {
    display: grid;
  }

  .main-nav {
    display: none;
  }

  .account-actions {
    display: none;
  }

  .download-mini {
    display: inline-flex;
  }

  .footer-top {
    grid-template-columns: 1fr;
  }

  .site-footer nav {
    justify-content: flex-start;
  }

  .qq-modal {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .qq-modal-copy {
    min-height: 0;
    padding-right: 42px;
  }

  .qq-float {
    top: auto;
    right: 14px;
    bottom: 78px;
    width: 136px;
  }
}

@media (max-width: 680px) {
  .site-header {
    min-height: 70px;
    padding: 0 16px;
    gap: 12px;
  }

  .brand {
    min-width: 0;
  }

  .brand-copy small {
    display: none;
  }

  .brand-copy strong {
    font-size: 18px;
  }

  .download-mini {
    font-size: 13px;
  }

  .site-footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .footer-bottom {
    display: grid;
  }

  .qq-modal-backdrop {
    padding: 14px;
  }

  .qq-modal {
    padding: 18px;
  }

  .qq-modal-copy h2 {
    font-size: 34px;
  }

  .qq-modal-copy strong {
    font-size: 22px;
  }

  .qq-modal-copy span {
    font-size: 16px;
  }

  .qq-modal-copy .primary-button {
    width: 100%;
  }

  .qq-modal-qr {
    max-height: 420px;
  }

  .qq-float {
    right: 10px;
    bottom: 70px;
    width: 118px;
  }

  .qq-float-card {
    padding: 10px;
  }

  .qq-float-card strong {
    font-size: 13px;
  }
}
