* { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
}
body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#5ecbff, #0077b6);
  font-family: "Press Start 2P", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: #042a2b;
}

/* Ensure taps go to the game and overlay, not to browser scrolling/zooming */
#game, #overlay {
  touch-action: none;
}

#game-container {
  position: relative;
  width: 480px;
  height: 720px;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(#59c1ff 0%, #1c8fd1 60%, #0a6ea1 100%);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

#hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

#title {
  font-size: 14px;
  color: #e1f5fe;
  text-shadow: 0 2px 0 rgba(0,0,0,0.4);
}

#score {
  font-size: 18px;
  color: #ffffff;
  text-shadow: 0 2px 0 rgba(0,0,0,0.5);
}

#overlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 24px;
  color: #e1f5fe;
}
#overlay.show {
  display: flex;
}
#overlay h1 {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: 1px;
  text-shadow:
    -2px 0 0 #000,
     2px 0 0 #000,
     0 -2px 0 #000,
     0  2px 0 #000,
    -2px -2px 0 #000,
     2px  2px 0 #000,
    -2px  2px 0 #000,
     2px -2px 0 #000,
     0  3px 6px rgba(0,0,0,0.6);
}
#overlay p { margin: 6px 0; }
#overlay .version {
  position: absolute;
  right: 12px;
  bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.5px;
  padding: 4px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #e1f5fe;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  text-shadow:
    -1px 0 0 #000,
     1px 0 0 #000,
     0 -1px 0 #000,
     0  1px 0 #000;
}
#overlay p, #overlay ul, #overlay li, #overlay .hint {
  text-shadow:
    -1.5px 0 0 #000,
     1.5px 0 0 #000,
     0 -1.5px 0 #000,
     0  1.5px 0 #000,
    -1.5px -1.5px 0 #000,
     1.5px  1.5px 0 #000,
    -1.5px  1.5px 0 #000,
     1.5px -1.5px 0 #000,
     0  2px 5px rgba(0,0,0,0.5);
}
#overlay ul { margin: 8px 0 12px; padding-left: 16px; text-align: left; }
#overlay .hint { opacity: 0.85; font-size: 12px; }

/* Mobile sizing */
@media (max-width: 520px) {
  #game-container { width: 92vw; height: calc(92vw * 1.5); }
}
