.juice-wave {
  --juice-tint: 255 220 147;
  --juice-aura: var(--juice-tile, 191 127 255);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.juice-wave[data-kind="formed"] { --juice-tint: 255 235 166; --juice-aura: 244 163 79; }
.juice-wave[data-kind="chain"] { --juice-tint: 255 174 234; --juice-aura: 255 95 213; }
.juice-wave[data-kind="laser"] { --juice-tint: 183 251 255; --juice-aura: 79 226 255; }
.juice-wave[data-kind="bomb"] { --juice-tint: 255 202 149; --juice-aura: 255 106 148; }
.juice-wave[data-kind="disco"] { --juice-tint: 246 213 255; --juice-aura: 175 144 255; }
.juice-wave:is([data-kind="duo"], [data-kind="legendary"]) { --juice-tint: 255 229 161; --juice-aura: 255 181 86; }

.juice-points {
  position: absolute;
  z-index: 2;
  display: grid;
  justify-items: center;
  align-items: center;
  min-width: 2.1em;
  max-width: 38%;
  padding: .09em .34em .16em;
  border: 1px solid rgb(var(--juice-tint) / .65);
  border-radius: .4em;
  background: linear-gradient(150deg, #2f1a44f5, #110a20f5 90%);
  box-shadow: 0 2px 8px #110820c7, 0 0 20px rgb(var(--juice-aura) / .65), inset 0 1px #fff3;
  color: rgb(var(--juice-tint));
  font: 900 clamp(1.1rem, 4.35vw, 2.15rem)/1 var(--display, 'LM Charte Sans', sans-serif);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgb(var(--juice-aura) / .64);
  transform: translate(-50%, -50%);
  animation: juice-points-rise .68s cubic-bezier(.19,.63,.35,1) both;
}

.juice-amount { white-space: nowrap; }

.juice-caption {
  padding: .18em .05em .05em;
  color: #fff3ff;
  font: 850 clamp(.6rem, 1.9vw, .88rem)/1.1 'LM Charte Sans', sans-serif;
  text-align: center;
  letter-spacing: .025em;
}

.juice-wave:is([data-kind="legendary"], [data-kind="duo"]) .juice-points {
  border-color: #ffe2a0;
  box-shadow: 0 2px 8px #342146, 0 0 26px #ffb95faf, inset 0 1px #fff5;
}

@keyframes juice-points-rise {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.63); }
  18% { opacity: 1; transform: translate(-50%, -65%) scale(1.15); }
  34% { transform: translate(-50%, -58%) scale(1); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -138%) scale(.93); }
}

.juice-flash {
  position: absolute;
  width: calc(var(--tile-size) * .87);
  aspect-ratio: 1;
  border: 1px solid rgb(var(--juice-tint) / .86);
  border-radius: 29%;
  background: radial-gradient(circle, rgb(var(--juice-tint) / .64), transparent 67%);
  box-shadow: 0 0 11px rgb(var(--juice-aura) / .72), inset 0 0 5px rgb(var(--juice-aura) / .64);
  translate: -50% -50%;
  animation: juice-flash-out .32s ease-out both;
}

@keyframes juice-flash-out {
  0% { opacity: 0; scale: .48; }
  29% { opacity: 1; scale: .86; }
  100% { opacity: 0; scale: 1.25; }
}

.juice-power {
  position: absolute;
  width: min(40%, calc(var(--tile-size) * 2.6));
  aspect-ratio: 1;
  border: 2px solid rgb(var(--juice-tint));
  border-radius: 50%;
  box-shadow: 0 0 22px rgb(var(--juice-aura) / .78), inset 0 0 20px rgb(var(--juice-aura) / .8);
  translate: -50% -50%;
  animation: juice-power-ring .47s ease-out both;
}

.juice-power[data-power^="laser"] { width: calc(var(--tile-size) * .88); border-radius: .32rem; }

.juice-power[data-power="formed"] { width: calc(var(--tile-size) * .93); border-radius: 27%; }

.juice-power[data-power="disco"] {
  width: min(65%, calc(var(--tile-size) * 3.1));
  border-color: #edd1ff;
  box-shadow: 0 0 20px #f797fd8c, inset 0 0 25px #9be1ffba;
  background: radial-gradient(circle, #fff7 0, transparent 60%);
}

@keyframes juice-power-ring {
  0% { opacity: 0; scale: .29; }
  23% { opacity: .95; }
  100% { opacity: 0; scale: 1.53; }
}

.juice-beam {
  position: absolute;
  border-radius: 999px;
  background: repeating-linear-gradient(96deg, transparent 0 7px, #fff6 8px 9px, transparent 10px 17px),
    linear-gradient(0deg, transparent, #b6f5ffcc 25%, #fff 50%, #b6f5ffcc 75%, transparent);
  box-shadow: 0 0 9px #83eeff, 0 0 19px #c887f6c2;
  animation: juice-scratch .34s ease-out both;
}

.juice-beam[data-direction="vertical"] {
  background: repeating-linear-gradient(6deg, transparent 0 7px, #fff6 8px 9px, transparent 10px 17px),
    linear-gradient(90deg, transparent, #b6f5ffcc 25%, #fff 50%, #b6f5ffcc 75%, transparent);
}

@keyframes juice-scratch {
  0% { opacity: 0; clip-path: inset(40%); }
  24% { opacity: .95; clip-path: inset(0); }
  100% { opacity: 0; clip-path: inset(0); }
}

.juice-flights {
  position: fixed;
  z-index: 25;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.juice-flight, .juice-fragment {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(var(--juice-rgb));
  filter: drop-shadow(0 0 4px rgb(var(--juice-rgb) / .92));
}

.juice-flight {
  margin: -4px 0 0 -4px;
  animation: juice-fly var(--flight-time) var(--flight-delay) cubic-bezier(.25,.52,.45,1) both;
}

.juice-flight[data-shape="star"] {
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 61%, 50% 100%, 38% 61%, 0 50%, 38% 38%);
  width: 11px;
  height: 11px;
}

.juice-flight[data-shape="paw"] {
  width: 12px;
  height: 12px;
  background: radial-gradient(ellipse at 50% 66%, rgb(var(--juice-rgb)) 0 30%, transparent 36%),
    radial-gradient(circle at 21% 42%, rgb(var(--juice-rgb)) 0 12%, transparent 16%),
    radial-gradient(circle at 45% 25%, rgb(var(--juice-rgb)) 0 13%, transparent 17%),
    radial-gradient(circle at 73% 38%, rgb(var(--juice-rgb)) 0 12%, transparent 16%);
}

@keyframes juice-fly {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scale(.45); }
  16% { opacity: .98; }
  57% { transform: translate3d(var(--arc-x), var(--arc-y), 0) rotate(17deg) scale(1); }
  84% { opacity: .9; }
  100% { opacity: 0; transform: translate3d(var(--land-x), var(--land-y), 0) rotate(18deg) scale(.25); }
}

.juice-announcement {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 50%;
  width: max-content;
  max-width: 87%;
  border: 1px solid #f6ce85;
  border-radius: 999px;
  padding: .4em .76em;
  background: #251237f2;
  box-shadow: 0 2px 10px #311141, 0 0 20px #ee9f5f8c;
  color: #ffe7a6;
  font: 850 clamp(.73rem, 2.6vw, 1rem)/1.1 'LM Charte Sans', sans-serif;
  letter-spacing: .014em;
  text-align: center;
  translate: -50% 0;
  animation: juice-announcement-in 1.08s ease-out both;
}

.juice-announcement[data-kind="win"] { top: 20%; }

.juice-announcement[data-empty] {
  top: 47%;
  width: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  animation: none;
}

@keyframes juice-announcement-in {
  0% { opacity: 0; transform: translateY(-30%) scale(.8); }
  21% { opacity: 1; transform: translateY(0) scale(1.04); }
  40% { transform: translateY(0) scale(1); }
  76% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-45%); }
}

.juice-confetti { position: absolute; inset: 40% 50% auto auto; }

.juice-fragment {
  width: 5px;
  height: 7px;
  border-radius: 2px;
  animation: juice-confetti .77s var(--scatter-delay) ease-out both;
}

@keyframes juice-confetti {
  0% { opacity: 0; transform: translate(0) scale(.25); }
  25% { opacity: .95; }
  100% { opacity: 0; transform: translate3d(var(--scatter-x), var(--scatter-y), 0) rotate(var(--scatter-rotate)); }
}

[data-fx]:not([data-fx="off"]) .crush-cell.is-selected:not(.is-dragging) .chip { scale: 1.05; }
[data-fx="off"] .crush-cell.is-selected .chip { scale: 1; }

[data-fx="low"] .juice-points { animation-duration: .52s; }
[data-fx="low"] .juice-flash { box-shadow: none; }
[data-fx="low"] .effects-layer { opacity: .87; }
[data-fx="spectacular"] .juice-power { border-width: 3px; }

@media (prefers-reduced-motion: reduce) {
  .juice-wave, .juice-flights, .juice-announcement { display: none; }
}
