:root {
  --bg: #070b16;
  --bg2: #101a33;
  --panel: #111a2cd9;
  --line: #3fd2ff44;
  --text: #e8f2ff;
  --muted: #9eb6d7;
  --accent: #34d8ff;
  --accent2: #8b5cf6;
  --danger: #ff4f7b;
}

* { box-sizing: border-box; }
html, body { width: 100%; }
body {
  margin: 0;
  font-family: Inter, Segoe UI, Roboto, system-ui, sans-serif;
  background: radial-gradient(circle at top, var(--bg2), var(--bg));
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

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

header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
  background: #0a1322cc;
}

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 0;
}

.brand {
  font-weight: 800;
  letter-spacing: .04em;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  padding: .45rem .7rem;
  border-radius: .6rem;
  transition: .15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: #17253f;
}

main { flex: 1; padding: 1.4rem 0 2rem; }

h1, h2, h3 { margin-top: 0; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1.2rem;
}

.hero h1 { line-height: 1.2; }

.muted { color: var(--muted); }

.hero-card,
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 0 24px #35d7ff22;
}

.cta-row,
.controls-row {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  color: white;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  transition: transform .12s ease, filter .2s ease;
}

.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-secondary { background: #223252; }

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .8rem;
}

.page { display: flex; flex-direction: column; gap: .8rem; }

.hud {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-bottom: .8rem;
}

.pill {
  background: #0d1426;
  border: 1px solid #2c3a5b;
  border-radius: 999px;
  padding: .45rem .8rem;
}

.game-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: start;
}

canvas#game {
  width: 100%;
  max-width: 560px;
  image-rendering: pixelated;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 18px #000, 0 0 20px #4cc6ff44;
  background: #000;
}

.touch {
  display: grid;
  grid-template-columns: repeat(3, 56px);
  grid-template-rows: repeat(3, 44px);
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
}

.touch button { border: none; border-radius: 10px; }

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: .9rem 0 1.4rem;
}

@media (max-width: 980px) {
  .hero, .game-wrap { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .nav { flex-direction: column; align-items: flex-start; }
  canvas#game { max-width: 100%; }
}
