/* Cursor temático e resposta visual das ferramentas da fazenda. */
.farm-tool-cursor {
  --cursor-x: -100px;
  --cursor-y: -100px;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 48px;
  height: 48px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(calc(var(--cursor-x) - 9px), calc(var(--cursor-y) - 9px), 0) rotate(-8deg) scale(.82);
  transform-origin: 9px 9px;
  transition: opacity 80ms ease;
  will-change: transform;
}
.farm-tool-cursor.is-visible { opacity: 1; }
.farm-tool-cursor img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px #1b2a1877);
  user-select: none;
}
.farm-tool-cursor span {
  position: absolute;
  right: -3px;
  bottom: -1px;
  width: 22px;
  height: 22px;
  border: 2px solid #fff6b8;
  border-radius: 50%;
  background: #4b6838;
  box-shadow: 0 2px 3px #1d2d1c77;
  font-size: 14px;
  line-height: 18px;
  text-align: center;
}

@media (hover: hover) and (pointer: fine) {
  .farm.has-farm-tool-cursor,
  .farm.has-farm-tool-cursor * { cursor: none !important; }
}

.tool-action-effect {
  position: absolute;
  z-index: 20;
  left: 50%;
  top: 50%;
  width: 72px;
  height: 72px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: tool-effect-pop 720ms cubic-bezier(.18,.8,.25,1) both;
}
.tool-action-effect::before,
.tool-action-effect::after {
  content: '';
  position: absolute;
  inset: 9px;
  border: 4px solid #fff5a8;
  border-radius: 50%;
  opacity: 0;
  animation: tool-effect-ring 650ms ease-out both;
}
.tool-action-effect::after { inset: 18px; border-width: 2px; animation-delay: 90ms; }
.tool-action-effect > img {
  position: absolute;
  z-index: 2;
  left: 14px;
  top: 10px;
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 3px 2px #24311988);
  animation: tool-icon-bounce 620ms ease-out both;
}
.tool-action-effect > b {
  position: absolute;
  z-index: 3;
  right: 5px;
  bottom: 7px;
  font-size: 22px;
  filter: drop-shadow(0 2px 1px white);
  animation: tool-seed-rise 700ms ease-out both;
}
.tool-action-effect > i {
  --angle: calc(var(--particle) * 60deg);
  position: absolute;
  z-index: 1;
  left: 33px;
  top: 33px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffe05d;
  box-shadow: inset 0 1px #fffbd2;
  animation: tool-particle 680ms ease-out both;
}
.effect-water::before, .effect-water::after { border-color: #b8f4ff; }
.effect-water > i { width: 7px; height: 11px; border-radius: 60% 40% 65% 45%; background: #54c9ff; }
.effect-clear::before, .effect-clear::after { border-color: #f3dcc0; }
.effect-clear > i { width: 12px; height: 12px; background: #ead5b5; filter: blur(.4px); }
.effect-harvest::before, .effect-harvest::after { border-color: #ffe25e; }
.effect-harvest > i { border-radius: 1px 70% 1px 70%; background: #8ed148; }
.effect-plant::before, .effect-plant::after { border-color: #a9e36d; }
.effect-plant > i { border-radius: 70% 2px 70% 2px; background: #73bd47; }
.effect-inspect::before, .effect-inspect::after { border-color: #eaf7cb; }

@keyframes tool-effect-pop {
  0% { opacity: 0; }
  12%, 74% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes tool-effect-ring {
  0% { opacity: .9; transform: scale(.2); }
  100% { opacity: 0; transform: scale(1.45); }
}
@keyframes tool-icon-bounce {
  0% { opacity: 0; transform: translateY(12px) rotate(-15deg) scale(.5); }
  42% { opacity: 1; transform: translateY(-7px) rotate(7deg) scale(1.12); }
  100% { opacity: 0; transform: translateY(-13px) rotate(0) scale(.92); }
}
@keyframes tool-particle {
  0% { opacity: 0; transform: rotate(var(--angle)) translateX(2px) scale(.2); }
  24% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--angle)) translateX(37px) scale(.85); }
}
@keyframes tool-seed-rise {
  0% { opacity: 0; transform: translateY(8px) scale(.5); }
  35% { opacity: 1; transform: translateY(-2px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-16px) scale(.9); }
}

@media (prefers-reduced-motion: reduce) {
  .tool-action-effect,
  .tool-action-effect::before,
  .tool-action-effect::after,
  .tool-action-effect > img,
  .tool-action-effect > b,
  .tool-action-effect > i { animation-duration: 1ms !important; }
}
