/* Shared look for the home page and every game. */
:root {
  --bg: #0a0b0d;
  --surface: #121418;
  --panel: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.09);
  --text: #f2f3f5;
  --muted: #9097a1;
  --accent: #e8b04a;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Game pages: a canvas centered on a dark background. */
.game-body {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  background: #000;
}
canvas.game { display: block; touch-action: none; }

/* Back-to-home button, top-left of every game. */
.kit-home {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 40;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--text);
  background: rgba(12, 14, 18, 0.55);
  border: 1px solid var(--line);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  transition: background 0.15s, transform 0.15s;
}
.kit-home:hover { background: rgba(30, 33, 40, 0.8); transform: translateY(-1px); }
.kit-home svg { width: 20px; height: 20px; }
.kit-music { left: 68px; padding: 0; font: inherit; cursor: pointer; }

/* Small notification that slides in near the top ("Wave 2", "Double"). */
.kit-toast {
  position: fixed;
  left: 50%;
  top: 92px;
  z-index: 60;
  padding: 12px 22px;
  text-align: center;
  pointer-events: none;
  background: rgba(12, 14, 18, 0.7);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  animation: kit-toast 2.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.kit-toast b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.kit-toast span { display: block; margin-top: 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
@keyframes kit-toast {
  0%   { transform: translate(-50%, -12px); opacity: 0; }
  12%  { transform: translate(-50%, 0); opacity: 1; }
  82%  { transform: translate(-50%, 0); opacity: 1; }
  100% { transform: translate(-50%, -8px); opacity: 0; }
}

/* Used by Kit.celebrate (kept for future learning games). */
.kit-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }
.kit-banner {
  position: fixed;
  left: 50%;
  top: 38%;
  z-index: 60;
  pointer-events: none;
  white-space: nowrap;
  font-size: clamp(40px, 7vw, 96px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: kit-pop 2.3s ease forwards;
}
@keyframes kit-pop {
  0%   { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translate(-50%, -56%); opacity: 0; }
}
