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

body {
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

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

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

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  color: #fff;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  z-index: 2;
}

#score-display, #highscore-display {
  font-weight: bold;
}

#lives-display {
  display: flex;
  gap: 4px;
}

.life-icon {
  width: 16px;
  height: 16px;
  background: #00ddff;
  clip-path: polygon(50% 0%, 0% 100%, 50% 75%, 100% 100%);
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 10;
  transition: opacity 0.3s;
}

#overlay:not(.active) {
  opacity: 0;
  pointer-events: none;
}

.screen {
  text-align: center;
  color: #fff;
}

.screen.hidden {
  display: none;
}

h1 {
  font-size: 48px;
  color: #00ddff;
  text-shadow: 0 0 20px rgba(0, 221, 255, 0.5);
  margin-bottom: 4px;
  letter-spacing: 8px;
}

h2 {
  font-size: 36px;
  color: #ff6644;
  text-shadow: 0 0 15px rgba(255, 102, 68, 0.5);
  margin-bottom: 20px;
}

.subtitle {
  font-size: 16px;
  color: #888;
  letter-spacing: 12px;
  margin-bottom: 30px;
}

.controls-info {
  margin: 20px 0 30px;
  color: #aaa;
  font-size: 14px;
  line-height: 1.8;
}

button {
  background: linear-gradient(135deg, #0088cc, #00bbff);
  color: #fff;
  border: none;
  padding: 14px 48px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  letter-spacing: 2px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 15px rgba(0, 136, 204, 0.4);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 136, 204, 0.6);
}

button:active {
  transform: translateY(0);
}

#gameover-screen p {
  font-size: 20px;
  margin: 8px 0;
  color: #ddd;
}

#final-score {
  color: #ffdd00;
  font-weight: bold;
  font-size: 24px;
}

#final-highscore {
  color: #00ddff;
  font-weight: bold;
}

@media (max-width: 500px) {
  #game-container {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
  canvas {
    border-radius: 0;
  }
  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  button { padding: 12px 36px; font-size: 16px; }
}
