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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0C0D14;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  color: #e2e8f0;
}

#game-container {
  position: relative;
  width: 400px;
  height: 600px;
  max-width: 100vw;
  max-height: 100vh;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
}

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

#overlay.visible {
  display: flex;
}

.screen {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.overlay-box {
  background: #161822;
  border: 1px solid #2a2d3a;
  border-radius: 12px;
  padding: 32px 28px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}

.overlay-box h1 {
  font-size: 28px;
  font-weight: 700;
  color: #8b5cf6;
  margin-bottom: 12px;
}

.overlay-box p {
  font-size: 14px;
  color: #94a3b8;
  margin-bottom: 8px;
  line-height: 1.5;
}

.overlay-box .controls {
  font-size: 12px;
  color: #64748b;
}

.overlay-box button {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 32px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #7c3aed;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.overlay-box button:hover {
  background: #8b5cf6;
}

.hint {
  font-size: 11px !important;
  color: #475569 !important;
  margin-top: 8px;
}

#final-score {
  font-size: 20px;
  font-weight: 600;
  color: #8b5cf6;
}

#final-highscore {
  font-size: 14px;
  color: #64748b;
}

@media (max-width: 420px) {
  #game-container {
    width: 100vw;
    height: 100vh;
  }
  canvas, #overlay {
    border-radius: 0;
  }
}
