:root {
  --bg: #05010d;
  --surface: #17102b;
  --border: #3b2a5c;
  --text: #f3e8ff;
  --muted: #9d8bb8;
  --accent: #c084fc;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  background:
    radial-gradient(ellipse 45% 65% at 0% 50%, rgba(168, 85, 247, 0.28), transparent 70%),
    radial-gradient(ellipse 45% 65% at 100% 50%, rgba(168, 85, 247, 0.28), transparent 70%),
    #000;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

.game-page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 16px;
  text-align: center;
}

.game-box {
  position: relative;
  width: min(92vw, 560px, calc((100vh - 240px) * 0.75));
  aspect-ratio: 480 / 640;
  overflow: hidden;
  background: #0b0416;
  box-shadow: 0 0 50px 18px rgba(0, 0, 0, 0.9);
}

/* Inner black glow: fades the edges to solid black so only the road stands out */
.game-box::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, #000 0%, #000 4%, rgba(0, 0, 0, 0.35) 10%, transparent 18%, transparent 82%, rgba(0, 0, 0, 0.35) 90%, #000 96%, #000 100%),
    linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.7) 3%, transparent 10%, transparent 88%, rgba(0, 0, 0, 0.7) 97%, #000 100%);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #0b0416;
  touch-action: none; /* we handle touch ourselves; no scroll/zoom gestures */
}

.game-header {
  text-shadow: 0 0 18px rgba(192, 132, 252, 0.55);
}

.game-header .logo {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.about {
  max-width: 46ch;
  text-align: center;
}

.about h2 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.about p {
  color: var(--muted);
  font-size: 0.95rem;
}

.about a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about a:hover {
  color: #d8b4fe;
}

.controls {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: center;
  color: var(--muted);
  font-size: 0.9rem;
}

kbd {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  margin: 0 2px;
}

.footer {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Touch devices: swap keyboard hints for touch hints */
.hints-touch {
  display: none;
}

@media (hover: none) and (pointer: coarse) {
  .hints-kbd {
    display: none;
  }
  .hints-touch {
    display: inline;
  }
}

@media (max-width: 600px) {
  .game-page {
    gap: 14px;
    padding: 16px 10px;
  }
  .game-box {
    width: min(94vw, calc((100vh - 200px) * 0.75));
  }
  .controls {
    gap: 16px;
  }
  .about {
    max-width: 100%;
  }
}
