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

:root {
  --bg: #080812;
  --text: #fcb024;
  --accent: #f6543a;
}

body {
  min-height: 100vh;
  background: url("assets/background_stars.svg") #000000;
  color: var(--text);
  font-family: "Tiny5", "Courier New", monospace;
  display: grid;
  place-items: center;
  padding: 20px 12px;
}

.shell {
  width: min(100%, 1220px);
  background: rgba(4, 5, 15, 0.7);
  border: 4px solid #0f0f18;
  box-shadow: 0 18px 80px rgba(0, 0, 0, 0.55);
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  font-size: clamp(16px, 2vw, 26px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-shadow: -4px 4px #672400;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent);
}

.hud__stats {
  display: flex;
  gap: 12px;
  align-items: center;
}

.hud__lives {
  display: inline-flex;
  gap: 12px;
}

.life-icon {
  width: 32px;
  height: 32px;
  display: inline-block;
  background: url("assets/space_ship.svg") center/contain no-repeat;
}

.life-icon--lost {
  background-image: url("assets/Boom.svg");
}

.viewport {
  position: relative;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  background: transparent;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 5, 15, 0.92);
  text-align: center;
}

.panel {
  display: grid;
  gap: 26px;
  justify-items: center;
}

.start-panel {
  padding: 24px 32px;
}

.logo {
  width: min(720px, 90vw);
  height: auto;
}

.legend {
  list-style: none;
  display: grid;
  gap: 18px;
  width: 100%;
  max-width: 520px;
}

.legend li {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 18px;
  color: var(--accent);
  font-size: clamp(18px, 3vw, 28px);
  letter-spacing: 0.08em;
  text-shadow: -3px 3px #2b0000;
}

.legend img {
  width: 58px;
  height: auto;
}

.legend-bullets {
  display: block;
  width: 120px;
  height: 28px;
  background: url("assets/bullets.svg") repeat-x center/22px 28px;
}

.legend-text {
  justify-self: end;
}

.start-btn {
  background: none;
  border: none;
  cursor: pointer;
}

.start-btn img {
  width: 240px;
  filter: drop-shadow(-6px 6px #2b0000);
  transition: transform 120ms ease;
}

.start-btn img:hover {
  transform: translateY(-2px);
}

.gameover {
  color: var(--accent);
}

.gameover-panel {
  gap: 20px;
}

.gameover-img {
  width: min(760px, 92vw);
  height: auto;
  image-rendering: pixelated;
}

.restart-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: clamp(18px, 3vw, 30px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  text-shadow: -3px 3px #2b0000;
  transition: transform 120ms ease;
}

.restart-btn:hover {
  transform: translateY(-2px);
}

.pause {
  color: var(--text);
}

.pause-panel {
  gap: 12px;
}

.pause-text {
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: -4px 4px #2b0000;
}

.pause-hint {
  font-size: clamp(14px, 3vw, 20px);
  letter-spacing: 0.08em;
  color: #d7d7d7;
}

.hidden {
  display: none;
}

@media (max-width: 720px) {
  .hud {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .hud__stats {
    justify-content: center;
  }

  .legend img {
    width: 46px;
  }

  .legend-bullets {
    width: 90px;
  }
}
