:root {
  --penguin-shadow: rgba(31, 39, 51, 0.22);
}

.penguin-helper {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 80;
  width: 132px;
  cursor: pointer;
  transform-origin: 50% 100%;
  animation: penguin-idle 3.8s ease-in-out infinite;
}

.penguin-helper::before {
  content: "クリックで案内";
  position: absolute;
  left: 50%;
  bottom: -30px;
  z-index: 2;
  min-width: 92px;
  padding: 3px 8px;
  color: #0f6b50;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dbe8e1;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(31, 39, 51, 0.12);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
}

.penguin-helper::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -5px;
  height: 14px;
  background: var(--penguin-shadow);
  border-radius: 50%;
  filter: blur(2px);
  animation: penguin-shadow 3.8s ease-in-out infinite;
}

.penguin-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 132px;
  height: auto;
  border-radius: 18px;
  filter: drop-shadow(0 12px 18px rgba(31, 39, 51, 0.22));
  transition: transform 0.22s ease;
}

.penguin-helper:hover .penguin-image {
  transform: rotate(-3deg) scale(1.04);
}

.penguin-bubble {
  position: absolute;
  right: 112px;
  bottom: 92px;
  width: 220px;
  padding: 12px 14px;
  color: #27313d;
  background: #fff;
  border: 1px solid #e8e3dc;
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(31, 39, 51, 0.14);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.penguin-bubble::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: 22px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 1px solid #e8e3dc;
  border-bottom: 1px solid #e8e3dc;
  transform: rotate(-45deg);
}

.penguin-helper.is-speaking .penguin-bubble,
.penguin-helper:hover .penguin-bubble {
  opacity: 1;
  transform: translateY(0);
}

.penguin-helper.is-waving .penguin-image {
  animation: penguin-wave-image 0.55s ease-in-out 3;
}

.penguin-helper.is-jumping {
  animation: penguin-jump 0.62s ease;
}

.penguin-focus {
  animation: penguin-section-focus 1.4s ease;
}

@keyframes penguin-idle {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-5px) rotate(1deg); }
}

@keyframes penguin-shadow {
  0%, 100% { transform: scaleX(1); opacity: 0.8; }
  50% { transform: scaleX(0.82); opacity: 0.48; }
}

@keyframes penguin-wave-image {
  0%, 100% { transform: rotate(0) scale(1); }
  35% { transform: rotate(-8deg) scale(1.04); }
  70% { transform: rotate(7deg) scale(1.04); }
}

@keyframes penguin-jump {
  0%, 100% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-28px) scale(1.04); }
  65% { transform: translateY(2px) scale(0.98); }
}

@keyframes penguin-section-focus {
  0%, 100% { box-shadow: none; }
  35% { box-shadow: inset 0 0 0 9999px rgba(15, 107, 80, 0.05); }
}

@media (max-width: 560px) {
  .penguin-helper {
    right: 10px;
    bottom: 74px;
    width: 104px;
  }

  .penguin-image {
    width: 104px;
  }

  .penguin-bubble {
    right: 84px;
    bottom: 84px;
    width: min(210px, calc(100vw - 126px));
  }

  .penguin-helper::before {
    bottom: -26px;
    min-width: 84px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .penguin-helper,
  .penguin-helper::after,
  .penguin-helper.is-waving .penguin-image,
  .penguin-helper.is-jumping {
    animation: none !important;
  }
}
