/* Basic page */
html, body {
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #111;
  overflow: hidden;
}
canvas { display:block; }

/* UI wrapper */
#ui {
  position: fixed;
  inset: 0;
  pointer-events: none; /* allow overlays to opt-in with pointer-events:auto */
  z-index: 100;          /* ensure it sits above the WebGL canvas */
}

/* Score in the corner (non-interactive) */
#score {
  position: absolute;
  left: 16px;
  top: 12px;
  color: #fff;
  font-size: 20px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  pointer-events: none;
}

/* FULLSCREEN overlay card — now fixed and centered reliably */
.overlay {
  position: fixed;             /* KEY: fixed to viewport */
  inset: 0;                    /* top:0; right:0; bottom:0; left:0 */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(rgba(0,0,0,0.30), rgba(0,0,0,0.55));
  color: #fff;
  z-index: 1000;               /* very high so it overlays everything */
  pointer-events: auto;        /* overlays capture clicks */
  text-align: center;
}

/* Hidden explicitly */
.overlay.hidden {
  display: none !important;
}

/* Game over card styling (centers content within overlay) */
.game-over-card {
  min-width: 320px;
  max-width: 90%;
  padding: 28px;
  border-radius: 12px;
  background: rgba(18, 18, 18, 0.9);
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  pointer-events: auto;
}

/* Heading */
.overlay h1 {
  margin: 0 0 6px 0;
  font-size: 48px;
  letter-spacing: 1px;
  text-shadow: 0 6px 18px rgba(0,0,0,0.6);
}

/* Score text below title */
#gameOver p, #startScreen p {
  margin: 0 0 14px 0;
  font-size: 18px;
  color: #ddd;
}

/* Buttons */
button {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(180deg,#3aa0ff,#1e73d1);
  color: white;
  font-size: 16px;
  cursor: pointer;
  pointer-events: auto; /* allow click */
}
button:active { transform: translateY(1px); }

/* Touch controls (mobile) */
#touchControls {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display:flex;
  gap: 12px;
  pointer-events: auto;
  z-index: 1100;
}
#touchControls button {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(4px);
}

/* Hide touch controls on desktop */
@media (min-width: 900px) {
  #touchControls { display: none; }
}
