:root {
  --bg: #070b14;
  --panel: #0f1626;
  --ink: #eaf0ff;
  --muted: #8a96b4;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}

.hidden { display: none !important; }

/* ---- in-game HUD ---- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#back {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  pointer-events: auto;
  background: rgba(15, 22, 38, .8);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
#back:active { transform: scale(.96); }

/* ---- menu ---- */
#menu {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  padding: clamp(20px, 5vw, 56px);
  display: flex;
  flex-direction: column;
  gap: 28px;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(34, 211, 238, .12), transparent),
    radial-gradient(1000px 600px at 90% 10%, rgba(244, 63, 94, .12), transparent),
    var(--bg);
}

header h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 64px);
  letter-spacing: -1px;
  font-weight: 900;
}
header h1 span { color: var(--muted); }
.tagline { margin: 8px 0 0; color: var(--muted); font-size: clamp(14px, 2.6vw, 18px); }
.tagline span { color: var(--ink); font-weight: 600; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  --accent: #22d3ee;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  min-height: 150px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(160deg, var(--panel), #0a0f1c);
  color: var(--ink);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .12s ease, border-color .12s ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 5px;
  background: var(--accent);
}
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.card:active { transform: translateY(0) scale(.99); }
.card-title { font-size: 22px; font-weight: 800; }
.card-blurb { color: var(--muted); font-size: 14px; line-height: 1.4; flex: 1; }
.card-hint {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  border-radius: 999px;
  padding: 4px 10px;
}

footer { color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 720px; }
