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

body {
  font-family: 'Space Grotesk', 'Arial Black', sans-serif;
  background: #f5f0e8;
  color: #000;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 16px 48px;
}

#app {
  width: 100%;
  max-width: 1200px;
}

/* ── Header ── */
header {
  margin-bottom: 24px;
}

.title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: -1px;
  color: #000;
  text-transform: uppercase;
  line-height: 1;
  /* neo-brutalist offset shadow */
  text-shadow: 4px 4px 0 #ffdd00;
}

.subtitle {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-top: 8px;
  color: #444;
  text-transform: uppercase;
}

/* ── Layout ── */
#layout {
  display: grid;
  grid-template-columns: 200px 800px 200px;
  gap: 16px;
  align-items: start;
  justify-content: center;
}

/* ── Side panels ── */
.panel {
  border: 3px solid #000;
  background: #fff;
  box-shadow: 5px 5px 0 #000;
  padding: 0;
}

.panel-title {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 8px 12px;
  background: #000;
  color: #ffdd00;
  text-transform: uppercase;
}

.legend {
  list-style: none;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legend li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.78rem;
  line-height: 1.4;
}

.swatch {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border: 2px solid #000;
  display: inline-block;
  margin-top: 2px;
}

.legend strong {
  font-weight: 900;
  font-size: 0.8rem;
  display: block;
}

.tip-box {
  margin: 0 12px 12px;
  border: 2px solid #000;
  background: #ffdd00;
  padding: 8px 10px;
  font-size: 0.75rem;
  line-height: 1.5;
}

.tip-box strong {
  display: block;
  font-weight: 900;
  font-size: 0.8rem;
  letter-spacing: 1px;
}

/* ── Canvas stage ── */
#stage {
  position: relative;
  display: inline-block;
  border: 3px solid #000;
  box-shadow: 6px 6px 0 #000;
}

#game {
  background: #1a1a2e;
  display: block;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

/* ── HUD ── */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-family: 'Space Grotesk', 'Arial Black', sans-serif;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 1px;
}

#score {
  color: #ffdd00;
  text-shadow: 2px 2px 0 #000;
}

#powerup {
  color: #44ddff;
  text-shadow: 2px 2px 0 #000;
  min-height: 1em;
}

#health {
  color: #ff4455;
  text-shadow: 2px 2px 0 #000;
}

/* ── Game Over Modal ── */
#gameover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 4px solid #000;
  box-shadow: 8px 8px 0 #000;
  padding: 32px 40px;
  text-align: center;
  z-index: 100;
  min-width: 280px;
}

#gameover h2 {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 4px;
  color: #000;
  text-shadow: 3px 3px 0 #ffdd00;
}

#gameover p {
  font-size: 1rem;
  font-weight: 700;
  margin: 6px 0;
  color: #000;
}

#restart {
  margin-top: 20px;
  padding: 12px 28px;
  font-size: 0.9rem;
  font-family: 'Space Grotesk', 'Arial Black', sans-serif;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: #ffdd00;
  color: #000;
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
}

#restart:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #000;
}

#restart:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

.hidden {
  display: none !important;
}
