body {
  margin: 0;
  height: 100vh;
  background: #f5f5f5;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

#container {
  position: relative;
  display: inline-block;
}

img {
  max-width: 90vw;
  max-height: 90vh;
  border: 5px solid #333;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

#damageText {
  position: fixed;
  font-size: 40px;
  font-weight: bold;
  color: red;
  text-shadow: 2px 2px 4px #000;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  z-index: 9999;
}

@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.5s;
}

@keyframes damage {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-50px);
  }
}

.show-damage {
  animation: damage 1s ease-out forwards;
}

#hp-bar {
  position: fixed;
  top: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 25px;
  background: #ccc;
  border: 2px solid #333;
  border-radius: 10px;
  overflow: hidden;
  z-index: 9999;
}

#hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, #ff0000, #aa0000);
  transition: width 0.3s ease;
}

#randomImage {
 

  transition: transform 0.05s linear;
}

#guardImage {
  position: absolute;
  width: 100px;
  height: 100px;
  cursor: grab;
  display: none;
  z-index: 9999;
}

#guardImage.dragging {
  cursor: grabbing;
}

.dragging {
  touch-action: none; /* タッチ中にスクロールしないように */
}