.move-fx {
  position: absolute;
  inset: 0;
  z-index: 7;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  container-type: inline-size;
}
.fx-concealed { visibility: hidden; }
.fx-piece-square, .fx-wave {
  position: absolute;
  display: grid;
  place-items: center;
  width: calc(100% / 7);
  height: calc(100% / 7);
}
.fx-piece-square { z-index: 2; }
.fx-drop { animation: fx-drop 330ms both; }
@keyframes fx-drop {
  0% { opacity: 0; transform: translateY(-42%) scale(1.16); }
  43% { opacity: 1; transform: translateY(3%) scale(1.08,.91); }
  66% { transform: translateY(-5%) scale(.97,1.04); }
  100% { transform: none; }
}
.fx-wall {
  position: absolute;
  transform: translate(-50%,-50%);
  z-index: 3;
  background: #826042;
  border: 1px solid #6e5039;
  border-radius: 2px;
  box-shadow: inset 1px 1px #cca777, 1px 2px 2px #6e47274d;
  animation: fx-wall-in 310ms var(--fx-delay) both;
}
.fx-wall.vertical { width: 1.6%; height: calc(100% / 7); }
.fx-wall.horizontal { width: calc(100% / 7); height: 1.6%; }
@keyframes fx-wall-in {
  0% { opacity: 0; scale: 1.18; filter: brightness(1.7); }
  34% { opacity: 1; scale: 1; filter: brightness(1.32); }
  62% { scale: 1.045; }
  100% { opacity: 1; scale: 1; filter: none; }
}
.fx-burst {
  position: absolute;
  z-index: 4;
  width: 0;
  height: 0;
  font-size: clamp(8px,1.85cqw,13px);
}
.fx-old-wall {
  position: absolute;
  transform: translate(-50%,-50%);
  border: 1px solid #704b35;
  background: linear-gradient(95deg,#dbac74,#956642 55%,#6b4935);
  border-radius: 2px;
  animation: fx-old-break 115ms var(--fx-delay) both;
}
.fx-old-wall.vertical { width: 1.6cqw; height: 14.28cqw; }
.fx-old-wall.horizontal { width: 14.28cqw; height: 1.6cqw; }
@keyframes fx-old-break {
  from { opacity: 1; }
  48% { opacity: 1; filter: brightness(1.8); }
  to { opacity: 0; }
}
.fx-shock, .fx-shard, .fx-break-label { position: absolute; }
.fx-shock {
  inset: -1.1em auto auto -1.1em;
  box-sizing: border-box;
  width: 2.2em;
  height: 2.2em;
  border: .31em solid #fff3b5;
  border-radius: 50%;
  box-shadow: 0 0 0 .14em #bf5b2e;
  animation: fx-impact 370ms var(--fx-delay) both;
}
@keyframes fx-impact {
  0% { opacity: 0; transform: scale(.2); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: scale(2.3); }
}
.fx-shard {
  inset: -.37em auto auto -.24em;
  width: .58em;
  height: 1.24em;
  background: linear-gradient(90deg,#f8d888,#b77940 53%,#6c442e 60%);
  clip-path: polygon(30% 0,100% 15%,61% 100%,0 71%);
  animation: fx-splinter 510ms var(--fx-delay) cubic-bezier(.11,.6,.37,.99) both;
}
.fx-shard:nth-child(3n) { width: .42em; height: .88em; }
@keyframes fx-splinter {
  0% { opacity: 0; transform: scale(.15); }
  9% { opacity: 1; }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--fx-x),var(--fx-y)) rotate(var(--fx-spin)) scale(.65); }
}
.fx-break-label {
  top: -1.5em;
  left: 0;
  padding: .13em .47em .2em;
  border: 1px solid #fbd87b;
  border-radius: 4px;
  background: #65351f;
  color: #fff2b5;
  font: 900 clamp(10px,2.35cqw,16px)/1.2 var(--sans,sans-serif);
  white-space: nowrap;
  box-shadow: 2px 2px #5b3925;
  animation: fx-break-label 680ms var(--fx-delay) both;
}
@keyframes fx-break-label {
  0% { opacity: 0; transform: translate(-50%,20%) rotate(-8deg) scale(.75); }
  21% { opacity: 1; transform: translate(-50%,-22%) rotate(-5deg) scale(1.1); }
  37%, 73% { opacity: 1; transform: translate(-50%,-23%) rotate(-5deg); }
  100% { opacity: 0; transform: translate(-50%,-70%) rotate(-3deg); }
}
.fx-finish { position: absolute; inset: 0; z-index: 5; }
.fx-owner0 { --territory-shine: #b4ffb7; }
.fx-owner1 { --territory-shine: #ffd29a; }
.fx-owner2 { --territory-shine: #ffefaa; }
.fx-wave {
  border: 2px solid var(--territory-shine);
  box-shadow: inset 0 0 1.5em var(--territory-shine);
  animation: fx-territory 620ms var(--fx-delay) both;
}
@keyframes fx-territory {
  0% { opacity: 0; transform: scale(.75); }
  40% { opacity: .85; transform: scale(1); }
  100% { opacity: 0; }
}
.fx-frame {
  position: absolute;
  inset: 0;
  border: 2px solid #fce7ab;
  box-shadow: inset 0 0 17px #f8db7c;
  animation: fx-finish-glow 920ms var(--fx-delay) both;
}
.fx-won .fx-frame { border-width: 3px; box-shadow: inset 0 0 25px 2px #ffe088; }
@keyframes fx-finish-glow {
  0%, 100% { opacity: 0; }
  30%, 52% { opacity: .85; }
}
.fx-ribbon {
  position: absolute;
  top: -3%;
  width: 1.1%;
  height: 2.8%;
  border-radius: 1px;
  background: #f8d56f;
  animation: fx-confetti 1270ms var(--fx-delay) cubic-bezier(.15,.45,.55,.9) both;
}
.fx-ribbon:nth-child(3n+1) { background: #e78965; }
.fx-ribbon:nth-child(3n+2) { background: #95c7a5; }
@keyframes fx-confetti {
  0% { opacity: 0; transform: translate(0,-2cqw) rotate(0); }
  12% { opacity: 1; }
  78% { opacity: .92; }
  100% { opacity: 0; transform: translate(var(--fx-lean),95cqw) rotate(var(--fx-spin)); }
}
@media (prefers-reduced-motion: reduce) {
  .move-fx { display: none; }
  .fx-concealed { visibility: visible; }
}
