* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: #1a1a2e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  font-family: sans-serif;
  color: #eee;
  padding: 10px;
}
h1 { font-size: 1.4em; margin-bottom: 6px; letter-spacing: 0.05em; }
#hud {
  display: flex;
  gap: 1.5em;
  margin-bottom: 8px;
  font-size: 1.05em;
  flex-wrap: wrap;
  justify-content: center;
}
#hud span { font-weight: bold; }
#powerup-hud { color: #ffb300; }
canvas {
  background: #87ceeb;
  border: 3px solid #444;
  border-radius: 4px;
  display: block;
  cursor: crosshair;
  max-width: 100%;
}
#message {
  font-size: 1.3em;
  font-weight: bold;
  margin-top: 10px;
  min-height: 1.6em;
  color: #ffe082;
  text-align: center;
}
#controls {
  margin-top: 6px;
  font-size: 0.88em;
  color: #aaa;
  text-align: center;
}
button {
  margin-top: 10px;
  padding: 8px 28px;
  font-size: 1em;
  border: none;
  border-radius: 6px;
  background: #4caf50;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}
button:hover { background: #388e3c; }
#difficultySelect {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
}
.diff-btn {
  padding: 7px 16px;
  font-size: 0.9em;
  border: 2px solid #555;
  border-radius: 6px;
  background: #2a2a4e;
  color: #aaa;
  cursor: pointer;
  font-weight: bold;
  margin-top: 0;
}
.diff-btn:hover { border-color: #888; color: #fff; background: #3a3a6e; }
.diff-btn.selected[data-diff="easy"]   { border-color: #64b5f6; color: #fff; background: #0d2a4a; }
.diff-btn.selected[data-diff="normal"] { border-color: #4caf50; color: #fff; background: #1a3a1a; }
.diff-btn.selected[data-diff="hard"]   { border-color: #ef5350; color: #fff; background: #3a0d0d; }
#soundToggle { margin-top: 8px; text-align: center; }
.sound-btn {
  padding: 5px 16px;
  font-size: 0.85em;
  background: #1a3a4a;
  border: 2px solid #4dd0e1;
  color: #4dd0e1;
  border-radius: 20px;
  margin-top: 0;
}
.sound-btn:hover { background: #0d2535; }
.sound-btn.off { border-color: #555; color: #555; background: #1a1a2e; }
#opening-screen {
  cursor: pointer;
  text-align: center;
  width: min(700px, calc(100vw - 20px));
  margin-bottom: 8px;
  user-select: none;
  -webkit-user-select: none;
}
#opening-screen img {
  width: 100%;
  border: 3px solid #444;
  border-radius: 4px;
  display: block;
  transition: opacity 0.1s;
}
#opening-screen:active img { opacity: 0.8; }
#opening-hint {
  color: #ffe082;
  font-size: 0.9em;
  margin-top: 6px;
  animation: hint-blink 1.2s ease-in-out infinite;
}
@keyframes hint-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}
