/* チビ桓騎ウォーカー — /dev 専用。本番 style.css には影響しない独立ファイル。 */

.chibi {
  position: fixed;
  left: 0;
  bottom: 8px;
  width: 88px;
  z-index: 9000;
  will-change: transform;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.chibi img {
  display: block;
  width: 88px;
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center bottom;
}

/* 吹き出し — スプライト上に中央寄せで出す */
.chibi-bubble {
  position: absolute;
  /* 水平シフトは left に乗せる（transition 対象外なので即時=測定が正確）。
     transform は中央寄せ(-50%)と縦の出現アニメだけに使う。 */
  left: calc(50% + var(--shift, 0px));
  bottom: calc(100% + 10px);
  transform: translate(-50%, 6px);
  min-width: 120px;
  max-width: min(78vw, 320px);
  width: max-content;
  padding: 10px 14px;
  background: #fbf6ef;
  color: #211016;
  font-family: "Zen Kaku Gothic Antique", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  text-align: center;
  white-space: normal;
  word-break: break-word;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.chibi-bubble::after {
  /* 吹き出しのしっぽ */
  content: "";
  position: absolute;
  /* しっぽはチビ本体を指すよう、吹き出しのシフト分を打ち消す */
  left: calc(50% - var(--shift, 0px));
  top: 100%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: #fbf6ef;
}

.chibi-bubble.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .chibi-bubble { transition: opacity 0.2s ease; }
}
