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

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

#game-container {
  position: relative;
  width: 480px;
  height: 640px;
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: linear-gradient(180deg, #0d1b4b 0%, #1a0d3b 100%);
  box-shadow: 0 0 40px rgba(100, 60, 220, 0.4);
}

/* HUD */
#hud {
  position: absolute;
  top: 12px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}

/* Screens */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  border-radius: 12px;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: blur(4px);
  text-align: center;
  padding: 32px;
}

.screen.hidden {
  display: none;
}

.screen h1 {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #a78bfa, #60a5fa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.screen h2 {
  font-size: 42px;
  font-weight: 800;
  background: linear-gradient(135deg, #f87171, #fb923c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#high-score-display,
#final-score {
  font-size: 20px;
  color: #c4b5fd;
}

#new-high-score {
  font-size: 18px;
  font-weight: 700;
  color: #fbbf24;
  animation: pulse 0.8s ease-in-out infinite alternate;
}

#new-high-score.hidden {
  display: none;
}

.instructions {
  font-size: 15px;
  color: #94a3b8;
  max-width: 280px;
}

button {
  margin-top: 8px;
  padding: 14px 48px;
  font-size: 18px;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
  transition: transform 0.1s, box-shadow 0.1s;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.65);
}

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

@keyframes pulse {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}
