/* Deal chop: the Cleaver (the fair-split rule) chops once over the task pool, then the ghosts pick.
   650ms (CHOP_MS in data.js): appear, raise, strike with a glowing slash and a one-frame flash, fade.
   Transform and opacity only. */
.pool {
  position: relative;
}

.deal-chop {
  /* Chop-only accent: no orange exists in the shared tokens. */
  --color-chop-slash: #FF8A3D;
  --color-chop-glow: rgba(255, 138, 61, 0.65);
  --color-chop-flash: rgba(255, 138, 61, 0.24);
  --size-chop: 160px;
  --chop-ms: 650ms;
  position: absolute;
  inset: 0;
  z-index: 3;
  /* in front of the Unassigned tickets */
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: var(--space-lg);
  border-radius: var(--radius-lg);
  pointer-events: none;
}

.deal-chop svg {
  position: relative;
  z-index: 2;
  display: block;
  width: auto;
  height: var(--size-chop);
  transform-origin: 51% 86%;
  /* the handle base, as in the Chores chop */
  animation: deal-chop var(--chop-ms) var(--ease-out) both;
  filter: drop-shadow(0 10px 16px var(--color-shadow-strong));
}

/* One-frame flash on the pool background at the strike. */
.deal-chop::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-color: var(--color-chop-flash);
  opacity: 0;
  animation: deal-chop-flash var(--chop-ms) linear both;
}

/* The slash: a short bright line across the pool where the blade lands. */
.deal-chop::after {
  content: "";
  position: absolute;
  z-index: 1;
  left: 12%;
  right: 12%;
  top: calc(var(--space-lg) + var(--size-chop) * 0.62);
  height: 4px;
  border-radius: 2px;
  background-color: var(--color-chop-slash);
  box-shadow: 0 0 10px 2px var(--color-chop-glow), 0 0 24px 6px var(--color-chop-glow);
  opacity: 0;
  transform: rotate(-10deg) scaleX(0);
  animation: deal-chop-slash var(--chop-ms) var(--ease-out) both;
}

/* The tickets take the hit. */
.pool.is-chopping .ticket-list {
  animation: deal-chop-impact var(--chop-ms, 650ms) var(--ease-out);
}

/* Appear, raise (like mascot--raise), strike (like mascot--chop), hold, fade. Fully opaque in between. */
@keyframes deal-chop {
  0% {
    opacity: 0;
    transform: translateY(calc(var(--space-lg) * -1)) scale(0.85);
  }

  12% {
    opacity: 1;
    transform: none;
  }

  40% {
    opacity: 1;
    transform: translateY(calc(var(--space-sm) * -2)) rotate(-16deg);
  }

  52% {
    opacity: 1;
    transform: translateY(var(--space-md)) rotate(8deg);
  }

  82% {
    opacity: 1;
    transform: translateY(var(--space-md)) rotate(8deg);
  }

  100% {
    opacity: 0;
    transform: translateY(var(--space-md)) rotate(8deg);
  }
}

@keyframes deal-chop-flash {

  0%,
  51% {
    opacity: 0;
  }

  53% {
    opacity: 1;
  }

  58%,
  100% {
    opacity: 0;
  }
}

@keyframes deal-chop-slash {

  0%,
  50% {
    opacity: 0;
    transform: rotate(-10deg) scaleX(0);
  }

  56% {
    opacity: 1;
    transform: rotate(-10deg) scaleX(1);
  }

  75% {
    opacity: 1;
    transform: rotate(-10deg) scaleX(1);
  }

  100% {
    opacity: 0;
    transform: rotate(-10deg) scaleX(1);
  }
}

@keyframes deal-chop-impact {

  0%,
  50%,
  100% {
    transform: none;
  }

  58% {
    transform: translateY(4px);
  }

  70% {
    transform: translateY(-1px);
  }
}

@media (max-width: 767.98px) {
  .deal-chop {
    --size-chop: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deal-chop {
    display: none;
  }

  .deal-chop svg,
  .deal-chop::before,
  .deal-chop::after,
  .pool.is-chopping .ticket-list {
    animation: none;
  }
}