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

body {
  background: #1a1a2e;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

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

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: none;
}

#title-screen, #gameover-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.75);
  color: white;
  text-align: center;
  padding: 20px;
}

#title-screen h1, #gameover-screen h1 {
  font-size: 4rem;
  color: #8B4513;
  text-shadow: 3px 3px 0 #654321, -1px -1px 0 #A0522D, 0 0 20px rgba(139, 69, 19, 0.5);
  margin-bottom: 0.2em;
  letter-spacing: 4px;
}

#gameover-screen h1 {
  color: #ff4444;
  text-shadow: 3px 3px 0 #aa0000, 0 0 20px rgba(255, 0, 0, 0.5);
}

.subtitle {
  font-size: 1.4rem;
  color: #81D4FA;
  margin-bottom: 1.5em;
  font-style: italic;
}

.instructions {
  font-size: 1rem;
  line-height: 1.8;
  max-width: 500px;
  color: #ccc;
}

.instructions strong {
  color: #FFD54F;
}

#start-btn, #restart-btn {
  margin-top: 2em;
  padding: 16px 48px;
  font-size: 1.3rem;
  font-weight: bold;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, #FF6B35, #F7C948);
  color: #1a1a2e;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 2px;
}

#start-btn:hover, #restart-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(247, 201, 72, 0.5);
}

#final-score-display {
  font-size: 2rem;
  color: #FFD54F;
  margin: 0.5em 0;
}

@media (max-width: 820px) {
  #title-screen h1, #gameover-screen h1 {
    font-size: 2.5rem;
  }
  .subtitle {
    font-size: 1rem;
  }
  .instructions {
    font-size: 0.85rem;
  }
  #start-btn, #restart-btn {
    padding: 12px 36px;
    font-size: 1rem;
  }
}
