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

html, body {
  height: 100%;
  overflow: hidden;
  background: #0f3b57;              /* deep water, in case the canvas ever lets through */
  touch-action: none;              /* no scroll/zoom on touch devices */
  overscroll-behavior: none;       /* no pull-to-refresh */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

#game {
  display: block;
  touch-action: none;
}

/* Start / game-over screen, drawn over the canvas. */
#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 1.25rem 1rem;
  gap: 0.6rem;
  text-align: center;
  background: rgba(6, 24, 36, 0.82);
  color: #eaf2f8;
  user-select: none;
}
#overlay.hidden { display: none; }
#overlay h1 { font-size: 2.6rem; letter-spacing: 0.02em; }
#overlay h2 { font-size: 1.6rem; color: #ffd45e; }
#overlay p { font-size: 1.05rem; opacity: 0.92; max-width: 32rem; line-height: 1.5; }
#overlay .stat { font-size: 1.15rem; opacity: 0.95; }
#overlay .stat b { color: #ffd45e; }
#overlay .hint { margin-top: 0.4rem; opacity: 0.7; font-size: 0.92rem; }

.start-btn {
  font: inherit;
  font-weight: 700;
  font-size: 1.15rem;
  color: #06202f;
  background: #ffd45e;
  border: none;
  border-radius: 12px;
  padding: 0.7rem 1.6rem;
  margin-top: 0.5rem;
  cursor: pointer;
}
.start-btn:hover { background: #ffe08a; }
