:root {
  --bg0: #050a18;
  --bg1: #06142b;
  --panel: rgba(10, 20, 45, 0.62);
  --panel2: rgba(10, 20, 45, 0.8);
  --stroke: rgba(130, 195, 255, 0.22);
  --stroke2: rgba(130, 195, 255, 0.38);
  --text: rgba(235, 246, 255, 0.92);
  --muted: rgba(235, 246, 255, 0.72);
  --blue: #56b3ff;
  --blue2: #1b7fe6;
  --yellow: #ffd341;
  --yellow2: #ffe88e;
  --danger: #ff4a6e;
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --mono: "Rubik Mono One", ui-sans-serif, system-ui;
  --sans: "Space Grotesk", ui-sans-serif, system-ui;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: radial-gradient(
      1200px 700px at 15% 20%,
      rgba(86, 179, 255, 0.18),
      transparent 60%
    ),
    radial-gradient(
      900px 600px at 70% 55%,
      rgba(255, 211, 65, 0.14),
      transparent 62%
    ),
    linear-gradient(160deg, var(--bg0), var(--bg1));
  overflow-x: hidden;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 2px solid rgba(255, 211, 65, 0.75);
  outline-offset: 3px;
}

.skipLink {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--stroke2);
  border-radius: 12px;
  color: white;
  transform: translateY(-140%);
  transition: transform 160ms ease;
  z-index: 30;
}
.skipLink:focus {
  transform: translateY(0);
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
.bgCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
}
.bgGlow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(
      800px 500px at 25% 30%,
      rgba(86, 179, 255, 0.09),
      transparent 70%
    ),
    radial-gradient(
      780px 520px at 80% 70%,
      rgba(255, 211, 65, 0.07),
      transparent 72%
    );
  filter: blur(12px);
  opacity: 0.9;
}

.topBar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
  background: linear-gradient(
    to bottom,
    rgba(5, 10, 24, 0.65),
    rgba(5, 10, 24, 0.28)
  );
  border-bottom: 1px solid rgba(130, 195, 255, 0.14);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  max-width: 1120px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brandMark {
  color: var(--yellow);
  text-shadow: 0 0 16px rgba(255, 211, 65, 0.55);
}
.brandText {
  font-family: var(--mono);
  letter-spacing: 0.04em;
  font-size: 14px;
  text-transform: uppercase;
}

.navLinks {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.navLink {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease,
    transform 160ms ease;
}
.navLink:hover {
  background: rgba(86, 179, 255, 0.08);
  border-color: rgba(86, 179, 255, 0.22);
  color: var(--text);
  transform: translateY(-1px);
}
.navLink.isActive {
  background: rgba(255, 211, 65, 0.09);
  border-color: rgba(255, 211, 65, 0.28);
  color: var(--text);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 30px 18px 46px;
}

.hero {
  padding: 26px 0 10px;
  position: relative;
}
.heroKicker {
  display: inline-flex;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(130, 195, 255, 0.18);
  background: rgba(10, 20, 45, 0.42);
  color: rgba(235, 246, 255, 0.82);
}
.heroTitle {
  font-family: var(--mono);
  font-size: clamp(30px, 4.4vw, 56px);
  line-height: 1.04;
  margin: 16px 0 10px;
  letter-spacing: 0.02em;
}
.heroTitleAccent {
  color: var(--yellow);
  text-shadow: 0 0 22px rgba(255, 211, 65, 0.5);
}
.heroSub {
  max-width: 68ch;
  margin: 0;
  color: rgba(235, 246, 255, 0.78);
  font-size: 18px;
}

.heroCtas {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  padding: 12px 16px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--sans);
  background: transparent;
  color: var(--text);
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease, filter 160ms ease;
  user-select: none;
}
.btn:focus-visible {
  outline-offset: 4px;
}
.btn:active {
  transform: translateY(1px);
}
.btnIcon {
  opacity: 0.9;
}
.btnPrimary {
  background: linear-gradient(
    135deg,
    rgba(255, 211, 65, 0.95),
    rgba(86, 179, 255, 0.92)
  );
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(5, 10, 24, 0.92);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}
.btnPrimary:hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
}
.btnGhost {
  background: rgba(10, 20, 45, 0.5);
  border-color: rgba(130, 195, 255, 0.22);
}
.btnGhost:hover {
  background: rgba(10, 20, 45, 0.65);
  border-color: rgba(130, 195, 255, 0.35);
  transform: translateY(-1px);
}

.heroCardGrid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  margin-top: 22px;
}

.heroFancy {
  overflow: clip;
}

.heroOrbs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.75;
  animation: orbDrift 9s ease-in-out infinite;
}

.orbA {
  width: 260px;
  height: 260px;
  right: -40px;
  top: -30px;
  background: radial-gradient(circle at 30% 30%, rgba(86, 179, 255, 0.5), rgba(86, 179, 255, 0.02));
}

.orbB {
  width: 180px;
  height: 180px;
  right: 30%;
  top: 20px;
  background: radial-gradient(circle at 40% 35%, rgba(255, 211, 65, 0.45), rgba(255, 211, 65, 0.02));
  animation-delay: 1.2s;
}

.orbC {
  width: 220px;
  height: 220px;
  left: -60px;
  bottom: 20px;
  background: radial-gradient(circle at 45% 35%, rgba(86, 179, 255, 0.35), rgba(86, 179, 255, 0.01));
  animation-delay: 2.1s;
}

.btnPulse {
  animation: pulseGlow 2.7s ease-in-out infinite;
}

.fxEnter {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
  animation: fadeInUp 0.8s ease forwards;
}
.fxDelay1 { animation-delay: 0.05s; }
.fxDelay2 { animation-delay: 0.14s; }
.fxDelay3 { animation-delay: 0.25s; }
.fxDelay4 { animation-delay: 0.34s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes orbDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -12px, 0) scale(1.03);
  }
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2), 0 0 0 rgba(255, 211, 65, 0.18);
  }
  50% {
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28), 0 0 26px rgba(255, 211, 65, 0.28);
  }
}

.card {
  grid-column: span 4;
  border-radius: var(--radius);
  background: var(--panel);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 16px 16px 14px;
}
.cardTitle {
  font-weight: 700;
  letter-spacing: 0.01em;
}
.cardBody {
  margin-top: 8px;
  color: rgba(235, 246, 255, 0.78);
  line-height: 1.45;
}

.footer {
  border-top: 1px solid rgba(130, 195, 255, 0.14);
  padding: 20px 18px;
  background: rgba(5, 10, 24, 0.22);
  backdrop-filter: blur(10px);
}
.footerInner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(235, 246, 255, 0.75);
}
.footerLink,
.footerLinkLike {
  color: rgba(235, 246, 255, 0.86);
  text-decoration: none;
  background: transparent;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.footerLink:hover,
.footerLinkLike:hover {
  color: white;
}
.dot {
  opacity: 0.55;
}
.footerCompact .footerInner {
  justify-content: center;
}

/* Pages */
.pageTitle {
  font-family: var(--mono);
  letter-spacing: 0.03em;
  margin: 10px 0 18px;
}
.pageGrid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}
.pageGridWide .card {
  grid-column: span 6;
}
.pageGrid .card {
  grid-column: span 6;
}

/* Play layout */
.containerPlay {
  padding-top: 8px;
  padding-bottom: 10px;
  max-width: 1500px;
}
.playLayout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.playHud {
  border-radius: var(--radius);
  background: var(--panel2);
  border: 1px solid var(--stroke2);
  box-shadow: var(--shadow);
  padding: 14px;
}
.hudRow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.hudStat {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(130, 195, 255, 0.16);
  background: rgba(0, 0, 0, 0.18);
}
.hudLabel {
  font-size: 12px;
  color: rgba(235, 246, 255, 0.7);
  letter-spacing: 0.02em;
}
.hudValue {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
}
.hudButtons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.gameWrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(130, 195, 255, 0.22);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: var(--shadow);
  height: min(78vh, 980px);
  min-height: 540px;
}
.gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  outline: none;
}

.gameCanvas:focus-visible {
  outline: 2px solid rgba(86, 179, 255, 0.75);
  outline-offset: -2px;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: radial-gradient(
      900px 600px at 20% 10%,
      rgba(86, 179, 255, 0.18),
      transparent 60%
    ),
    rgba(0, 0, 0, 0.55);
}

/* Make absolutely sure hidden overlays cannot block input */
.overlay[hidden] {
  display: none !important;
}
.overlayPanel {
  width: min(640px, 100%);
  border-radius: calc(var(--radius) + 6px);
  padding: 18px;
  background: rgba(10, 20, 45, 0.78);
  border: 1px solid rgba(130, 195, 255, 0.22);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.overlayTitle {
  font-family: var(--mono);
  letter-spacing: 0.04em;
}
.overlayText {
  margin-top: 10px;
  color: rgba(235, 246, 255, 0.8);
  line-height: 1.5;
}
.overlayControls {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 211, 65, 0.24);
  background: rgba(255, 211, 65, 0.06);
  color: rgba(235, 246, 255, 0.86);
}
.overlayCtas {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.playSide {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 10px;
}
.playSide .card {
  grid-column: span 3;
  padding: 12px 12px 11px;
}

/* Reduced motion */
html[data-motion="off"] .bgGlow {
  opacity: 0.55;
}
@media (prefers-reduced-motion: reduce) {
  .navLink,
  .btn {
    transition: none;
  }
  .orb,
  .btnPulse,
  .fxEnter {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Responsive */
@media (min-width: 980px) {
  .container.containerPlay {
    max-width: 1500px;
  }
  .playSide {
    grid-template-columns: repeat(12, 1fr);
  }
}

@media (max-width: 900px) {
  .card {
    grid-column: span 12;
  }
  .pageGrid .card {
    grid-column: span 12;
  }
  .pageGridWide .card {
    grid-column: span 12;
  }
  .hudRow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .playSide .card {
    grid-column: span 6;
  }
}

@media (max-width: 640px) {
  .gameWrap {
    min-height: 62vh;
    height: 62vh;
  }
  .playSide .card {
    grid-column: span 12;
  }
}
