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

body {
  background: #08040f;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  overflow: hidden;
}

.back-link {
  position: fixed;
  top: 16px;
  left: 16px;
  color: rgba(200, 140, 255, 0.6);
  font-size: 0.7rem;
  text-decoration: none;
  letter-spacing: 0.05em;
  z-index: 100;
  transition: color 0.2s;
}

.back-link:hover {
  color: #e879f9;
}

#game-container {
  position: relative;
  width: min(100vw, 440px);
  aspect-ratio: 11 / 16;
  max-height: 92vh;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(180, 100, 255, 0.25);
  box-shadow:
    0 0 50px rgba(168, 85, 247, 0.2),
    0 0 90px rgba(236, 72, 153, 0.1);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #0f0618;
  cursor: none;
  touch-action: none;
}

#hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
  pointer-events: none;
  z-index: 10;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hud-label {
  font-size: 0.5rem;
  letter-spacing: 0.15em;
  color: rgba(180, 140, 220, 0.55);
}

#score, #level {
  font-size: 1rem;
  font-weight: 700;
  color: #f0abfc;
  text-shadow: 0 0 10px rgba(232, 121, 249, 0.7);
}

#lives {
  font-size: 0.85rem;
  color: #f472b6;
  text-shadow: 0 0 8px rgba(244, 114, 182, 0.6);
  letter-spacing: 0.15em;
}

#power-status {
  position: absolute;
  top: 52px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  color: #fde68a;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
  pointer-events: none;
  z-index: 10;
  min-height: 14px;
}

.controls-hint strong {
  color: #e9d5ff;
  font-weight: 700;
}

#overlay, #gameover {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(8, 4, 16, 0.88);
  backdrop-filter: blur(6px);
  z-index: 20;
  text-align: center;
  padding: 24px;
  transition: opacity 0.35s ease;
}

#overlay.hidden, #gameover.hidden {
  opacity: 0;
  pointer-events: none;
}

#overlay.visible {
  opacity: 1;
}

h1 {
  font-size: clamp(1.2rem, 4.5vw, 1.6rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #e879f9, #818cf8, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
  letter-spacing: 0.1em;
}

h2.lose {
  color: #f87171;
  text-shadow: 0 0 18px rgba(248, 113, 113, 0.5);
}

h2.win {
  color: #4ade80;
  text-shadow: 0 0 18px rgba(74, 222, 128, 0.5);
}

.subtitle {
  color: rgba(200, 170, 230, 0.65);
  font-size: 0.68rem;
  margin-bottom: 20px;
  line-height: 1.5;
}

.controls-hint {
  color: rgba(160, 140, 200, 0.55);
  font-size: 0.6rem;
  line-height: 2;
  margin-bottom: 26px;
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  background: rgba(100, 60, 140, 0.25);
  border: 1px solid rgba(180, 100, 255, 0.25);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.55rem;
}

button {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 14px 40px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: white;
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}

button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 38px rgba(168, 85, 247, 0.6);
}

button:active {
  transform: scale(0.97);
}

#gameover p {
  color: rgba(200, 190, 230, 0.75);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

#final-score {
  color: #e879f9;
  font-weight: 700;
}
