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

html, body {
  height: 100%;
  background: #05060f;
  overflow: hidden;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #e8f0ff;
}

#wrap {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

canvas {
  display: block;
  background: #060719;
  /* the JS sets an explicit width/height in CSS pixels */
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

#hud-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.hud-block { flex: 1; }
.hud-block.center { text-align: center; }
.hud-block.right { text-align: right; }

.label {
  font-size: 10px;
  letter-spacing: 3px;
  color: #7fa8ff;
  opacity: .8;
  display: block;
  text-transform: uppercase;
}

#score, #stage, #high {
  font-size: 22px;
  font-weight: 700;
  color: #dff0ff;
  text-shadow: 0 0 8px rgba(120,180,255,.5);
}

#mute, #pausebtn {
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#mute {
  position: absolute;
  top: 40px;
  right: 18px;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #8be3ff;
  opacity: .9;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(20,25,40,.55);
  border: 1px solid rgba(255,255,255,.18);
}
#mute.off { color: #ff6d8a; }

#pausebtn {
  position: absolute;
  top: 66px;
  right: 18px;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #b9a7ff;
  opacity: .9;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(20,25,40,.55);
  border: 1px solid rgba(255,255,255,.18);
  font-family: "Segoe UI", system-ui, sans-serif;
}

#version {
  position: absolute;
  left: 18px;
  bottom: 10px;
  font-size: 10px;
  letter-spacing: 1px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: #5a7fbf;
  opacity: .6;
  pointer-events: none;
}

#bossbar-wrap {
  position: absolute;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, 70%);
  text-align: center;
  opacity: 0;
  transition: opacity .25s;
}

#bossbar-wrap.visible { opacity: 1; }

#bossbar {
  height: 8px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 4px;
  background: rgba(20,25,40,.8);
  overflow: hidden;
}

#bossfill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff4d6d, #ffa62b);
  transition: width .08s linear;
}

#bossname {
  margin-top: 3px;
  font-size: 13px;
  letter-spacing: 4px;
  color: #ffc8d0;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255,90,120,.8);
}

#hud-bottom {
  display: flex;
  align-items: flex-end;
  gap: 20px;
}

#hpHUD {
  width: min(360px, 45%);
  height: 12px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 6px;
  background: rgba(20,25,40,.8);
  overflow: hidden;
}

#hpfill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #2bd6a8, #7effc8);
  transition: width .15s linear;
}

.hud-meta { display: flex; gap: 18px; align-items: center; }
.hud-meta .label { display: inline; margin-right: 4px; }
#lives, #bombs, #weapon {
  font-size: 17px;
  font-weight: 700;
  color: #dff0ff;
  min-width: 30px;
}

@media (max-width: 640px) {
  #hud { padding: 8px 10px; }
  #score, #stage, #high { font-size: 16px; }
}
