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

#container {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow-y: scroll;
  background: #f0f0f0;
}

#imageLayer {
  position: relative;
  display: block;
  width: 100%;
}

#pointerLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 10;
}

.image-placeholder {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.image-wrapper {
  /* padding付きでも問題ないように制限しない */
  display: block;
  width: 100%;
}

.comic-image {
  display: block;
  width: 100%;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  opacity: 1;
  transition: opacity 0.7s;
}

.pointer {
  position: absolute;
  left: 10px;
  width: 40px;
  height: 40px;
  background: red;
  border-radius: 50%;
  transform: translateY(-50%);
  z-index: 5;
  pointer-events: auto;
}

#controls {
  position: fixed;
  top: 10px;
  left: 10px;
  background: white;
  padding: 10px;
  z-index: 20;
  border: 1px solid #ccc;
  font-size: 14px;
}

#guide {
  position: fixed;
  top: 10px;
  right: 10px;
  background: white;
  padding: 10px;
  z-index: 20;
  border: 1px solid #ccc;
  font-size: 14px;
  max-width: 280px;
}

input[type="number"] {
  width: 80px;
}

.hidden {
  display: none;
}

.edit-form {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border: 1px solid #ccc;
  padding: 10px;
  z-index: 30;
}

#flashOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 9999;
}
.comic-image.mono {
  filter: grayscale(100%);
  transition: filter 0.5s;
}
/* ズームイン状態 */
.zoomed {
  transform: scale(1.2);
  transition: transform 1s ease;
  z-index: 10;
  position: relative;
}

/* ズームアウト時のアニメーション */
.zoom-out {
  transform: scale(1);
  transition: transform 1s ease;
}

@keyframes shakeAnimation {
  0%   { transform: translate(0px, 0px); }
  20%  { transform: translate(-20px, -10px); }
  40%  { transform: translate(20px, 10px); }
  60%  { transform: translate(-20px, -10px); }
  80%  { transform: translate(20px, 10px); }
  100% { transform: translate(0px, 0px); }
}

.shake {
  animation: shakeAnimation 0.6s ease;
}

@keyframes glitchAnimation {
  0% {
    transform: translate(0, 0);
    filter: hue-rotate(0deg) brightness(1);
  }
  20% {
    transform: translate(-12px, 8px);
    filter: hue-rotate(45deg) brightness(1.4);
  }
  60% {
    transform: translate(10px, -10px);
    filter: hue-rotate(-30deg) brightness(0.6);
  }
  90% {
    transform: translate(8px, 4px);
    filter: hue-rotate(25deg) brightness(1.3);
  }
  100% {
    transform: translate(8px, 4px); /* ← 最終的にズレたまま停止 */
    filter: hue-rotate(25deg) brightness(1.3);
  }
}

.glitch {
  animation: glitchAnimation 1.2s linear forwards; /* ← forwardsでズレ状態を保持 */
}