html, body {
  height: 100%;
  padding: 0;
  margin: 0;
}
body {
  background: #e1f7fa;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
}

#gameContainer {
  position: relative;
  width: 100vw;
  max-width: 420px;
  height: 100vh;
  max-height: 92vh;
  margin: auto;
  background: #c4f0c5;
  border: 2px solid #333;
  border-radius: 12px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: stretch;
  overflow: hidden;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #c4f0c5;
  border: none;
  outline: none;
  max-width: 420px;
  max-height: 92vh;
  min-width: 240px;
  min-height: 320px;
}

/* Responsive touch controls bar at bottom */
#touchControls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  width: 100%;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 10;
}

.touch-btn {
  pointer-events: auto;
  background: rgba(0,0,0,0.48);
  border-radius: 50%;
  font-size: 34px;
  width: 70px;
  height: 70px;
  margin: 0 40px;
  color: white;
  border: none;
  user-select: none;
  box-shadow: 0 2px 14px rgba(80,80,80,0.08);
  transition: background 0.2s;
}
.touch-btn:active {
  background: rgba(0,0,0,0.88);
}

.hidden {
  display: none;
}

#gameOverScreen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.85);
  color: white;
  padding: 30px 40px;
  border-radius: 15px;
  text-align: center;
  font-size: 24px;
  width: 300px;
  z-index: 100;
}

#restartBtn {
  margin-top: 20px;
  padding: 10px 20px;
  font-size: 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background-color: #f3b63c;
  color: #222;
  font-weight: bold;
  transition: background-color 0.3s ease;
}
#restartBtn:hover {
  background-color: #e6a31c;
}

@media (max-width: 600px) {
  #gameContainer {
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border-width: 0;
  }
  #gameCanvas {
    max-width: 100vw;
    max-height: 100vh;
    min-width: 0;
    min-height: 0;
    border: none;
  }
  #touchControls { display: flex !important; }
}
@media (min-width: 601px) {
  #touchControls { display: none !important; }
}
