/* MoveFx — styles for fx.js. Every class is prefixed fx-. No images, no fonts. */

/* ── the overlay a move is drawn into ── */
.fx-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.fx-g { position: absolute; inset: 0; }            /* one group per MoveFx.play call; sets --u */
.fx-tint { position: absolute; inset: 0; opacity: 0; }

/* A particle: fx.js sets its size, --c / --l / --d (base, light, dark) and animates transform
   and opacity. It is invisible outside its animation. The shape is the ::before, so the hard
   pixel shadow on the element follows the clipped outline. */
.fx-p {
  position: absolute; left: 0; top: 0; display: block; opacity: 0; will-change: transform, opacity;
  filter: drop-shadow(calc(var(--u, 4px) * .5) calc(var(--u, 4px) * .5) 0 var(--d));
}
.fx-p::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--l) 0 40%, var(--c) 40%);   /* two flat tones, hard edge */
}

/* ── shapes ── */
.fx-s-dia::before { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.fx-s-oct::before { clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.fx-s-tri::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.fx-s-fang::before { clip-path: polygon(0 0, 100% 0, 50% 100%); }
.fx-s-dart::before { clip-path: polygon(0 20%, 100% 50%, 0 80%, 20% 50%); }
.fx-s-star::before { clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.fx-s-plus::before { clip-path: polygon(34% 0, 66% 0, 66% 34%, 100% 34%, 100% 66%, 66% 66%, 66% 100%, 34% 100%, 34% 66%, 0 66%, 0 34%, 34% 34%); }
.fx-s-x::before { clip-path: polygon(20% 0, 50% 30%, 80% 0, 100% 20%, 70% 50%, 100% 80%, 80% 100%, 50% 70%, 20% 100%, 0 80%, 30% 50%, 0 20%); }
.fx-s-arrow::before { clip-path: polygon(50% 0, 100% 50%, 70% 50%, 70% 100%, 30% 100%, 30% 50%, 0 50%); }
.fx-s-bolt::before { clip-path: polygon(55% 0, 100% 0, 60% 42%, 90% 42%, 20% 100%, 42% 56%, 10% 56%); }
.fx-s-leaf::before { clip-path: polygon(0 50%, 30% 12%, 100% 50%, 30% 88%); }
.fx-s-drop::before { clip-path: polygon(50% 0, 85% 50%, 85% 80%, 65% 100%, 35% 100%, 15% 80%, 15% 50%); }
.fx-s-rock::before { clip-path: polygon(25% 0, 75% 5%, 100% 40%, 85% 90%, 40% 100%, 0 65%, 5% 25%); background: linear-gradient(160deg, var(--l) 0 30%, var(--c) 30% 70%, var(--d) 70%); }
.fx-s-z::before { clip-path: polygon(0 0, 100% 0, 100% 25%, 40% 75%, 100% 75%, 100% 100%, 0 100%, 0 75%, 60% 25%, 0 25%); }
.fx-s-note::before { clip-path: polygon(40% 0, 100% 0, 100% 25%, 60% 25%, 60% 85%, 45% 100%, 15% 100%, 0 85%, 0 70%, 15% 55%, 40% 55%); }
.fx-s-bar::before { inset: 36% 0; }                /* a thin streak in a square box */
.fx-s-line::before { background: var(--l); }       /* lightning segments, ground cracks */
.fx-s-beam::before { background: linear-gradient(var(--c) 0 18%, var(--l) 18% 34%, #fff 34% 66%, var(--l) 66% 82%, var(--c) 82%); }
.fx-s-slash::before {
  clip-path: polygon(0 50%, 18% 0, 82% 0, 100% 50%, 82% 100%, 18% 100%);
  background: linear-gradient(#fff 0 45%, var(--l) 45% 75%, var(--c) 75%);
}
/* hollow ones */
.fx-s-frame::before, .fx-s-round::before {
  background: none; border: var(--u, 4px) solid; border-color: var(--l) var(--c) var(--c) var(--l);
}
.fx-s-round::before { border-radius: 50%; }

/* ── weather (MoveFx.weather): a tint plus a few looping particles, behind the Pokémon ── */
.fx-weather { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; container-type: size; }
.fx-weather::before { content: ""; position: absolute; inset: 0; }
.fx-weather i { position: absolute; display: block; }
/* per particle, set by fx.js: --a 0–1 where along the edge it enters, --k 0–1 variety, --dl phase, --i index */

.fx-w-rain::before { background: rgba(28, 48, 92, .3); }
.fx-w-rain i {
  left: calc(var(--a) * 128% - 2%); top: -16%; width: max(2px, .35cqw); height: calc(5cqh + var(--k) * 4cqh);
  background: #f2f9ff; transform: rotate(14deg);
  animation: fx-w-rain calc(.5s + var(--k) * .25s) steps(9, jump-none) var(--dl) infinite;
}
.fx-w-rain i:nth-child(odd) { background: #b4d6ff; }
@keyframes fx-w-rain { to { translate: -31cqh 126cqh; } }

.fx-w-hail::before { background: rgba(200, 232, 245, .2); }
.fx-w-hail i {
  left: calc(var(--a) * 115% - 2%); top: -8%; width: calc(max(4px, 1cqw) * (1 + var(--k) * .6)); aspect-ratio: 1;
  background: #f6fcff; box-shadow: inset calc(max(1px, .3cqw) * -1) calc(max(1px, .3cqw) * -1) 0 #8cc9d6;
  animation: fx-w-hail calc(.8s + var(--k) * .5s) steps(10, jump-none) var(--dl) infinite;
}
@keyframes fx-w-hail { to { translate: -12cqw 116cqh; } }

.fx-w-sand::before { background: rgba(205, 170, 85, .25); }
.fx-w-sand i {
  left: -6%; top: calc(var(--a) * 112% - 10%); width: calc(1.2cqw + var(--k) * 1.6cqw); height: max(2px, .45cqw);
  background: #f0dc9c;
  animation: fx-w-sand calc(.5s + var(--k) * .4s) steps(10, jump-none) var(--dl) infinite;
}
.fx-w-sand i:nth-child(3n) { background: #a98a42; }
@keyframes fx-w-sand { to { translate: 112cqw 9cqh; } }

.fx-w-sun::before { background: rgba(255, 196, 64, .16); }
.fx-w-sun i {
  left: -4%; top: -6%; width: 150%; height: calc(3cqh + var(--k) * 3cqh); transform-origin: 0 50%;
  transform: rotate(calc(14deg + var(--i) * 13deg)); background: rgba(255, 244, 170, .4);
  animation: fx-w-sun 1.8s steps(2, jump-none) calc(var(--i) * -.45s) infinite;
}
@keyframes fx-w-sun { 50% { opacity: .3; } }

@media (prefers-reduced-motion: reduce) {
  .fx-weather i { animation: none; }
  .fx-w-rain i, .fx-w-hail i, .fx-w-sand i { display: none; }   /* keep the tint (and the sun's rays) only */
}
