* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #111827;
  font-family: Arial, sans-serif;
  overflow: hidden;
}

#game {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 500px;
  overflow: hidden;
  background: #6fc1f0;
}

#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#top {
  position: absolute;
  z-index: 5;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.hpbox {
  width: 34%;
  max-width: 330px;
  padding: 8px;
  color: white;
  background: rgba(15,23,42,.85);
  border: 2px solid rgba(255,255,255,.8);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,.25);
}

.hpbox b {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.bar {
  width: 100%;
  height: 14px;
  background: #1f2937;
  border-radius: 8px;
  overflow: hidden;
}

#playerHP,
#enemyHP {
  width: 100%;
  height: 100%;
  transition: width .2s;
}

#playerHP {
  background: #22c55e;
}

#enemyHP {
  background: #ef4444;
}

#round {
  padding: 8px 12px;
  color: white;
  font-weight: bold;
  background: rgba(15,23,42,.8);
  border-radius: 12px;
}

#message {
  position: absolute;
  z-index: 6;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  color: white;
  font-size: 20px;
  font-weight: bold;
  background: rgba(15,23,42,.78);
  border-radius: 20px;
  pointer-events: none;
}

#mobile {
  position: absolute;
  z-index: 10;
  left: 0;
  right: 0;
  bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding: 0 15px;
  pointer-events: none;
}

.movement,
.attacks {
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

button {
  width: 58px;
  height: 58px;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 16px;
  color: white;
  font-size: 23px;
  font-weight: bold;
  background: rgba(15,23,42,.88);
  box-shadow: 0 5px 12px rgba(0,0,0,.3);
  touch-action: none;
}

button:active {
  transform: scale(.9);
}

#jump {
  background: #2563eb;
}

#punch {
  background: #dc2626;
}

#kick {
  background: #ea580c;
}

#special {
  background: #7c3aed;
}

@media (min-width: 800px) {
  button {
    width: 68px;
    height: 68px;
  }

  #mobile {
    padding: 0 30px 25px;
  }
}