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

body {
  background: #0C0D14;
  color: #e0e0e0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
}

#hud {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 8px 16px;
  font-size: 1.1rem;
  font-weight: 600;
}

#level-display {
  color: #60a5fa;
}

#time-display {
  color: #facc15;
}

#score-display {
  color: #4ade80;
}

#game-canvas {
  border: 2px solid #2a2d3a;
  border-radius: 4px;
  max-width: 90vw;
  max-height: 75vh;
  display: block;
}

#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(12, 13, 20, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

#overlay.hidden {
  display: none;
}

#overlay-box {
  background: #161822;
  border: 1px solid #2a2d3a;
  border-radius: 12px;
  padding: 40px 48px;
  text-align: center;
  max-width: 90vw;
}

#overlay-box h1 {
  font-size: 2rem;
  margin-bottom: 16px;
}

#overlay-box p {
  font-size: 1.1rem;
  margin-bottom: 10px;
  color: #b0b0b0;
}

#screen-start h1 {
  color: #60a5fa;
}

#screen-levelcomplete h1 {
  color: #4ade80;
}

#screen-gameover h1 {
  color: #ff5555;
}

.controls-hint {
  color: #888 !important;
  font-size: 0.95rem !important;
}

.action-hint {
  color: #e0e0e0 !important;
  animation: pulse 1.8s ease-in-out infinite;
  margin-top: 8px !important;
}

.hidden {
  display: none !important;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (max-width: 600px) {
  #hud {
    font-size: 0.95rem;
    padding: 6px 10px;
  }

  #overlay-box {
    padding: 28px 24px;
  }

  #overlay-box h1 {
    font-size: 1.5rem;
  }

  #overlay-box p {
    font-size: 0.95rem;
  }
}
