:root {
  --hg-bg: #07111f;
  --hg-panel: #0d1a2d;
  --hg-text: #f3f7ff;
  --hg-muted: #9baac2;
  --hg-line: rgba(158, 185, 220, 0.18);
  --hg-cyan: #45d5f2;
  --hg-pink: #ff6a9a;
  --hg-radius: 8px;
}

.hg-page {
  min-height: 100vh;
  margin: 0;
  background: var(--hg-bg);
  color: var(--hg-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
}

.hg-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  background: rgba(7, 17, 31, 0.72);
  backdrop-filter: blur(18px);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.hg-header.is-scrolled {
  border-color: var(--hg-line);
  background: rgba(7, 17, 31, 0.94);
}

.hg-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1120px, calc(100% - 48px));
  min-height: 72px;
  margin: 0 auto;
}

.hg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hg-text);
  font-weight: 700;
  text-decoration: none;
}

.hg-brand__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(69, 213, 242, 0.48);
  border-radius: var(--hg-radius);
  color: var(--hg-cyan);
}

.hg-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hg-nav__link,
.hg-download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--hg-radius);
  color: var(--hg-muted);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.hg-nav__link:hover,
.hg-nav__link:focus-visible,
.hg-download-link:hover,
.hg-download-link:focus-visible {
  color: var(--hg-text);
}

.hg-download-link {
  margin-left: 8px;
  background: var(--hg-cyan);
  color: var(--hg-bg);
  font-weight: 800;
}

.hg-page[data-page="home"] [data-nav="home"],
.hg-page[data-page="privacy"] [data-nav="privacy"],
.hg-page[data-page="download"] [data-nav="download"] {
  color: var(--hg-text);
  box-shadow: inset 0 -2px 0 var(--hg-cyan);
}

.hg-page[data-page="download"] [data-nav="download"] {
  box-shadow: 0 8px 24px rgba(69, 213, 242, 0.2);
}

.hg-nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  border: 1px solid var(--hg-line);
  border-radius: var(--hg-radius);
  background: transparent;
  color: var(--hg-text);
}

.hg-nav-toggle span {
  display: block;
  height: 2px;
  margin: 4px 0;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hg-nav-toggle.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.hg-nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.hg-nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.hg-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.hg-game-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  grid-template-areas:
    "head qr"
    "actions qr";
  gap: 22px 24px;
  min-height: 300px;
  padding: 28px;
  border: 1px solid var(--hg-line);
  border-radius: var(--hg-radius);
  background: linear-gradient(145deg, #12223a, var(--hg-panel));
}

.hg-game-card__head {
  grid-area: head;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.hg-game-card__icon {
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 16px;
}

.hg-game-card__copy {
  min-width: 0;
}

.hg-game-card__eyebrow {
  color: var(--hg-cyan);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hg-game-card h3 {
  margin: 8px 0 10px;
  color: var(--hg-text);
  font-size: 1.45rem;
}

.hg-game-card p {
  margin: 0;
  color: var(--hg-muted);
  font-size: 0.92rem;
  line-height: 1.7;
}

.hg-game-card__actions {
  grid-area: actions;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.hg-game-card__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--hg-radius);
  background: var(--hg-cyan);
  color: var(--hg-bg);
  font-weight: 800;
  text-decoration: none;
}

.hg-game-card__action.is-disabled {
  border: 1px solid var(--hg-line);
  background: rgba(155, 170, 194, 0.08);
  color: var(--hg-muted);
  cursor: not-allowed;
}

.hg-game-card__qr {
  grid-area: qr;
  align-self: center;
  margin: 0;
  text-align: center;
}

.hg-game-card__qr img {
  display: block;
  width: 120px;
  height: 120px;
  margin: 0 auto 8px;
  border-radius: var(--hg-radius);
  background: #fff;
  object-fit: contain;
  padding: 8px;
}

.hg-game-card__qr figcaption {
  color: var(--hg-muted);
  font-size: 0.72rem;
}

.hg-footer {
  border-top: 1px solid var(--hg-line);
  background: #050c17;
}

.hg-footer__inner,
.hg-footer__bottom {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.hg-footer__inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 44px 0 34px;
}

.hg-footer__brand p {
  margin: 14px 0 0;
  color: var(--hg-muted);
  font-size: 0.82rem;
}

.hg-footer__nav {
  display: flex;
  justify-content: flex-end;
  gap: 14px 22px;
  flex-wrap: wrap;
}

.hg-footer__nav a {
  color: var(--hg-muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.hg-footer__nav a:hover,
.hg-footer__nav a:focus-visible {
  color: var(--hg-text);
}

.hg-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 24px;
  border-top: 1px solid rgba(158, 185, 220, 0.1);
  color: var(--hg-muted);
  font-size: 0.75rem;
}

.hg-footer__bottom p {
  margin: 0;
}

.hg-footer__bottom a {
  color: var(--hg-muted);
  text-decoration: none;
}

@media (max-width: 840px) {
  .hg-header__inner {
    width: min(100% - 32px, 1120px);
  }

  .hg-nav-toggle {
    display: block;
  }

  .hg-nav {
    position: absolute;
    top: 72px;
    right: 16px;
    left: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--hg-line);
    border-radius: var(--hg-radius);
    background: rgba(7, 17, 31, 0.98);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  }

  .hg-nav.is-open {
    display: flex;
  }

  .hg-nav__link,
  .hg-download-link {
    min-height: 46px;
    width: 100%;
  }

  .hg-download-link {
    margin-left: 0;
  }

  .hg-game-grid {
    grid-template-columns: 1fr;
  }

  .hg-footer__inner {
    flex-direction: column;
  }

  .hg-footer__nav {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .hg-header__inner,
  .hg-footer__inner,
  .hg-footer__bottom {
    width: min(100% - 28px, 1120px);
  }

  .hg-brand__text {
    display: none;
  }

  .hg-game-card {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "actions"
      "qr";
    padding: 22px;
  }

  .hg-game-card__head {
    gap: 14px;
  }

  .hg-game-card__icon {
    width: 64px;
    height: 64px;
  }

  .hg-game-card__qr {
    justify-self: start;
    text-align: left;
  }

  .hg-game-card__qr img {
    margin-left: 0;
  }

  .hg-footer__bottom {
    flex-direction: column;
  }
}
