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

body {
  background: #1c1c1e;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  font-family: Arial, sans-serif;
  user-select: none;
}

#wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(800px, 98vw);
}

#hud {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.hbar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hbar-wrap.right { flex-direction: row-reverse; }

.hname {
  font-size: 12px;
  font-weight: bold;
  color: #ddd;
  min-width: 28px;
  text-align: center;
  letter-spacing: 1px;
}

.hbg {
  flex: 1;
  height: 14px;
  background: #333;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid #555;
}

.hfill {
  height: 100%;
  border-radius: 7px;
  transition: width 0.07s linear;
}

.hfill.red  { background: linear-gradient(90deg, #a00, #f33); }
.hfill.blue { background: linear-gradient(270deg, #00b, #39f); }

.hvs { font-size: 18px; color: #666; }

canvas {
  display: block;
  border-radius: 4px;
  width: 100%;
  height: auto;
}

#ctrls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  font-size: 11px;
  color: #666;
}

#ctrls b {
  color: #bbb;
  background: #2e2e2e;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid #555;
}

#ov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
}

#ov.hidden { display: none; }

#ov-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

#wt {
  font-size: clamp(32px, 8vw, 56px);
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 40px rgba(255, 200, 50, 0.9);
  letter-spacing: 4px;
}

#rb {
  padding: 10px 32px;
  font-size: 15px;
  font-weight: bold;
  background: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 1px;
}

#rb:hover { background: #eee; }
