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

body {
  background: #050507;
  color: #cfc9c0;
  font-family: "Courier New", monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

#stage {
  position: relative;
  width: 960px;
  height: 600px;
  box-shadow: 0 0 80px rgba(120, 0, 0, 0.25);
}

canvas {
  display: block;
  background: #000;
  cursor: crosshair;
}

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 14px 16px;
}

#hp-bar {
  width: 180px; height: 12px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
}
#hp-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #7a0d0d, #d33);
  transition: width .2s;
}

#battery { margin-top: 8px; }
#battery .label { font-size: 11px; opacity: .7; letter-spacing: 2px; }
#bat-bar {
  width: 180px; height: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  margin-top: 3px;
}
#bat-fill {
  height: 100%; width: 100%;
  background: linear-gradient(90deg, #b8860b, #ffd700);
  transition: width .2s;
}

#objective {
  position: absolute;
  top: 14px; right: 16px;
  font-size: 13px;
  letter-spacing: 2px;
  color: #9b8f7d;
  text-shadow: 0 0 6px #000;
}
#pages {
  position: absolute;
  top: 38px; right: 16px;
  font-size: 22px;
  color: #e8dcc0;
  text-shadow: 0 0 8px rgba(255,230,150,.5);
}

#overlay, .overlay {
  position: absolute;
  inset: 0;
  background: rgba(2,2,4,0.93);
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
}
#overlay.visible, .overlay.visible { display: flex; }

#dbg-off {
  position: absolute;
  bottom: 12px;
  left: 12px;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 7px 16px;
  display: none;
  pointer-events: auto;
  background: rgba(20,8,8,0.9);
  border: 1px solid #b33;
  color: #ff8a8a;
}
#dbg-off.visible { display: block; }
#dbg-off:hover { background: #4a0f0f; box-shadow: 0 0 16px rgba(255,60,60,.5); }

#panel h1 {
  font-size: 52px;
  letter-spacing: 10px;
  color: #a80f0f;
  text-shadow: 0 0 24px rgba(200,0,0,.6);
  margin-bottom: 14px;
}
#panel .sub { color: #8f887c; margin-bottom: 18px; }
#panel .keys {
  list-style: none;
  font-size: 14px;
  line-height: 1.9;
  color: #cfc9c0;
  margin-bottom: 16px;
}
#panel .keys b { color: #ffd700; }
#panel .warn {
  font-size: 12.5px;
  color: #7d7466;
  line-height: 1.7;
  max-width: 460px;
  margin: 0 auto 22px;
}

button {
  font-family: inherit;
  font-size: 18px;
  letter-spacing: 4px;
  padding: 12px 42px;
  background: #1a0505;
  color: #e8c9c9;
  border: 1px solid #6e1414;
  cursor: pointer;
  transition: all .2s;
}
button:hover {
  background: #3a0a0a;
  box-shadow: 0 0 24px rgba(200,0,0,.5);
  color: #fff;
}

#best { margin-top: 14px; font-size: 12px; color: #6b6357; }

#end-panel h2 {
  font-size: 42px;
  letter-spacing: 8px;
  margin-bottom: 14px;
}
#end-panel h2.dead { color: #a80f0f; text-shadow: 0 0 24px rgba(200,0,0,.6); }
#end-panel h2.win { color: #7ad07a; text-shadow: 0 0 24px rgba(60,200,60,.4); }
#end-panel p { color: #8f887c; margin-bottom: 22px; white-space: pre-line; }
