:root {
  --bg-top: #1a2a6c;
  --bg-bottom: #0a1340;
  --ink: #f7f9ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 0%, var(--bg-top) 0%, var(--bg-bottom) 70%);
  font-family: "Baloo 2", "Fredoka", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#game {
  display: block;
  max-width: 100vw;
  max-height: 100vh;
  touch-action: none;
}

.back-link {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  z-index: 50;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.18s ease, transform 0.18s ease;
}
.back-link:hover { background: rgba(255, 255, 255, 0.22); transform: translateY(-1px); }
.back-link:active { transform: translateY(0); }
