/* Combat presentation. Load after style.css; coordinates are local to board-shell.
   Ghost: left/top = top-left. Projectile/impact: left/top = effect centre.
   Trail: left/top = origin; --trail-length and --angle describe its direction. */

/* Spatial actions stay visually distinct from damage and ordinary walking. */
.motion-ghost.motion-evade {
  box-shadow: 0 0 0 2px #b7f6e3aa, -12px 0 16px #81dfc04d, 0 0 32px #81dfc070;
}
.motion-ghost.motion-push {
  box-shadow: 0 0 0 2px #f5c6a6aa, 0 8px 20px #0008;
}
.motion-impact.evade::before,
.motion-impact.miss::before {
  border: 2px dashed #b2eed8;
  background: transparent;
  box-shadow: 0 0 22px #81dfc040;
}
.motion-impact.evade::after,
.motion-impact.miss::after { opacity: 0; }
.motion-number.miss {
  color: #c3ffe9;
  font-size: 18px;
  letter-spacing: .04em;
  padding: 7px 10px;
  background: #0a2826ed;
  border: 1px solid #81dfc078;
  border-radius: 7px;
}
.motion-number.dot {
  font-size: 20px;
  color: #d3c1ff;
  letter-spacing: .02em;
  text-shadow: 0 2px 3px #111421, 0 0 16px #ae8be980;
}
.motion-impact.dot::before {
  border: 2px solid #b79bdf;
  background: radial-gradient(circle, #b79bdf50, transparent 65%);
  box-shadow: 0 0 24px #ae8be970;
}
.motion-impact.dot::after {
  border-color: #c8adee;
  box-shadow: none;
}

.board-shell {
  isolation: isolate;
  --motion-color: #81dfc0;
  --motion-rgb: 129, 223, 192;
}

.combat-cue,
.motion-layer,
.motion-ghost,
.motion-trail,
.motion-projectile,
.motion-impact,
.round-overlay,
.action-ribbon {
  --motion-color: #81dfc0;
  --motion-rgb: 129, 223, 192;
}

:is(.combat-cue, .motion-layer, .motion-ghost, .motion-trail, .motion-projectile, .motion-impact, .round-overlay, .action-ribbon)[data-side="enemy"] {
  --motion-color: #f1a384;
  --motion-rgb: 241, 163, 132;
}

:is(.combat-cue, .motion-layer, .motion-ghost, .motion-trail, .motion-projectile, .motion-impact, .round-overlay, .action-ribbon)[data-side="neutral"] {
  --motion-color: #d9bd7d;
  --motion-rgb: 217, 189, 125;
}

/* Brief, readable action announcement. */
.combat-cue {
  position: absolute;
  z-index: 40;
  left: 50%;
  top: 9px;
  width: max-content;
  max-width: calc(100% - 20px);
  min-width: 190px;
  padding: 10px 22px 11px;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
  pointer-events: none;
  color: var(--text, #e9f0e9);
  background: linear-gradient(110deg, #0c2022ee, #122b2af7 48%, #0c2022ee);
  border: 1px solid rgba(var(--motion-rgb), .48);
  border-top-color: rgba(var(--motion-rgb), .8);
  border-radius: 12px;
  box-shadow: 0 8px 30px #0007, 0 0 25px rgba(var(--motion-rgb), .09);
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -8px);
  transition: opacity var(--cue-enter-duration, 190ms) ease, transform var(--cue-enter-duration, 190ms) ease, visibility var(--cue-enter-duration, 190ms);
}

.combat-cue.enter,
.combat-cue.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.combat-cue.center,
.combat-cue[data-placement="center"] {
  top: 50%;
  transform: translate(-50%, calc(-50% + 7px));
}

.combat-cue.center.enter,
.combat-cue.center.visible,
.combat-cue[data-placement="center"].enter,
.combat-cue[data-placement="center"].visible {
  transform: translate(-50%, -50%);
}

.cue-side {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--motion-color);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .14em;
  line-height: 1.25;
}

.cue-side::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 9px currentColor;
}

.cue-title {
  font-size: clamp(18px, 2.1vw, 25px);
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: .06em;
  text-shadow: 0 2px 12px #0007;
}

.cue-subtitle {
  color: #b2c7c2;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* Effects sit above units and below announcements. Nothing intercepts input. */
.motion-layer {
  position: absolute;
  z-index: 22;
  inset: 0;
  overflow: visible;
  pointer-events: none;
}

.motion-ghost {
  position: absolute;
  z-index: 3;
  width: var(--pawn-size, 48px);
  height: var(--pawn-size, 48px);
  max-width: none;
  margin: 0;
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform, opacity;
}

.motion-ghost.pawn {
  margin: 0;
  max-width: none;
  filter: none;
  outline: none;
  transition: none;
  box-shadow: 0 8px 15px #0006, 0 0 0 2px rgba(var(--motion-rgb), .25), 0 0 20px rgba(var(--motion-rgb), .3);
}

.motion-ghost.fixed,
.motion-ghost[data-position="fixed"] { position: fixed; }
.motion-ghost.enemy { --motion-color: #f1a384; --motion-rgb: 241, 163, 132; }
.motion-ghost :is(.pawn-health, .pawn-hp-text, .pawn-badge) { display: none; }
.motion-ghost.spent::after { display: none; }

.motion-trail {
  position: absolute;
  z-index: 0;
  height: var(--trail-width, 3px);
  width: var(--trail-length, 50px);
  border-radius: 999px;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: translateY(-50%) rotate(var(--angle, 0deg));
  background: linear-gradient(90deg, transparent, rgba(var(--motion-rgb), .25) 32%, rgba(var(--motion-rgb), .8));
  box-shadow: 0 0 10px rgba(var(--motion-rgb), .3);
  opacity: .8;
}

/* Zero-size anchors let JS animate transform without overwriting effect rotation. */
.motion-projectile,
.motion-impact {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  transform-origin: 0 0;
}

.motion-projectile { z-index: 2; will-change: transform; }
.motion-projectile::before,
.motion-projectile::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.motion-projectile::before {
  width: var(--projectile-size, 15px);
  height: var(--projectile-size, 15px);
  border: 1px solid #ecfff7d9;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f2fff6 0 12%, var(--motion-color) 30%, rgba(var(--motion-rgb), .25) 78%);
  box-shadow: 0 0 10px var(--motion-color), 0 0 25px rgba(var(--motion-rgb), .45);
  transform: translate(-50%, -50%) rotate(var(--angle, 0deg));
}

.motion-projectile::after {
  width: 33px;
  height: 5px;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, rgba(var(--motion-rgb), .75));
  transform-origin: 100% 50%;
  transform: translate(-100%, -50%) rotate(var(--angle, 0deg));
  filter: blur(1px);
}

.motion-projectile.heal,
.motion-projectile[data-kind="heal"] { --motion-color: #a9edc7; --motion-rgb: 169, 237, 199; }
.motion-projectile.heal::before,
.motion-projectile[data-kind="heal"]::before {
  width: 21px;
  height: 10px;
  border-radius: 2px 90% 2px 90%;
  background: linear-gradient(135deg, #edffe0, #9be5b7 48%, #2d9b77);
  border-color: #d8ffd4b3;
}
.motion-projectile.heal::after,
.motion-projectile[data-kind="heal"]::after { height: 2px; width: 28px; }

.motion-projectile.seal::before,
.motion-projectile[data-kind="seal"]::before {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  border: 2px solid #e3ecc4;
  background: linear-gradient(90deg, transparent 40%, #e3ecc499 40% 60%, transparent 60%), #284642cc;
  transform: translate(-50%, -50%) rotate(calc(var(--angle, 0deg) + 45deg));
}

.motion-projectile.breach::before,
.motion-projectile[data-kind="breach"]::before {
  width: 24px;
  height: 8px;
  border-radius: 1px 65% 65% 1px;
  background: linear-gradient(90deg, rgba(var(--motion-rgb), .3), var(--motion-color) 60%, #fff2d2);
  border-color: #fff0d8b3;
  box-shadow: 0 0 12px rgba(var(--motion-rgb), .8);
}

.motion-projectile.burst { --motion-color: #ffba73; --motion-rgb: 255, 186, 115; --projectile-size: 21px; }
.motion-projectile.burst::before { border-color: #ffe7b3; box-shadow: 0 0 15px #ffbb79, 0 0 29px #f088505f; }
.motion-projectile.burst::after { width: 42px; height: 8px; }
.motion-projectile.cleanse { --motion-color: #c5f3e9; --motion-rgb: 197, 243, 233; }
.motion-projectile.cleanse::before {
  width: 22px; height: 22px; border: 0; border-radius: 0;
  background: #e1fff7;
  clip-path: polygon(50% 0, 61% 37%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 37%);
  filter: drop-shadow(0 0 6px #a5dfdc);
}

/* Impact types; JS may set --impact-size and --effect-duration per action. */
.motion-impact { z-index: 4; --impact-size: 66px; --effect-duration: 650ms; }
.motion-impact::before,
.motion-impact::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--impact-size);
  height: var(--impact-size);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.motion-impact::before {
  border: 2px solid rgba(var(--motion-rgb), .9);
  box-shadow: 0 0 18px rgba(var(--motion-rgb), .3), inset 0 0 15px rgba(var(--motion-rgb), .15);
  animation: motion-ring var(--effect-duration) ease-out both;
}

.motion-impact::after {
  width: calc(var(--impact-size) * .6);
  height: calc(var(--impact-size) * .6);
  background: radial-gradient(circle, rgba(var(--motion-rgb), .45), transparent 65%);
  animation: motion-glow var(--effect-duration) ease-out both;
}

.motion-impact.slash::before {
  height: 5px;
  width: calc(var(--impact-size) * 1.16);
  border: 0;
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, #fff6de 28%, #fff 50%, var(--motion-color) 74%, transparent);
  box-shadow: 0 0 9px rgba(var(--motion-rgb), .8);
  animation: motion-slash var(--effect-duration) ease-out both;
}
.motion-impact.slash::after {
  height: 2px;
  width: calc(var(--impact-size) * .85);
  border-radius: 50%;
  background: linear-gradient(90deg, transparent, var(--motion-color), transparent);
  animation: motion-cross-slash var(--effect-duration) ease-out both;
}

.motion-impact.burst::after {
  width: calc(var(--impact-size) * 1.2);
  height: calc(var(--impact-size) * 1.2);
  background: repeating-conic-gradient(from 15deg, transparent 0 36deg, rgba(var(--motion-rgb), .8) 38deg 42deg, transparent 44deg 45deg);
  -webkit-mask-image: radial-gradient(circle, transparent 18%, #000 30% 47%, transparent 66%);
  mask-image: radial-gradient(circle, transparent 18%, #000 30% 47%, transparent 66%);
  animation: motion-rays var(--effect-duration) ease-out both;
}

.motion-impact.heal { --motion-color: #a9edc7; --motion-rgb: 169, 237, 199; }
.motion-impact.heal::before {
  border-width: 1px;
  border-color: #b1f4c78c;
  background: radial-gradient(circle, #b9f0ac29, transparent 65%);
}
.motion-impact.heal::after {
  width: 21px;
  height: 21px;
  border-radius: 0;
  background: linear-gradient(90deg, transparent 36%, #ddffd7 36% 64%, transparent 64%), linear-gradient(0deg, transparent 36%, #ddffd7 36% 64%, transparent 64%);
  filter: drop-shadow(0 0 6px #91e4b8);
  animation: motion-heal-rise var(--effect-duration) ease-out both;
}

.motion-impact.shield,
.motion-impact.guard { --motion-color: #e3cc8d; --motion-rgb: 227, 204, 141; }
.motion-impact.shield::before,
.motion-impact.guard::before {
  width: calc(var(--impact-size) * .8);
  height: var(--impact-size);
  border: 2px solid #f4dfa6;
  border-radius: 45% 45% 48% 48% / 24% 24% 70% 70%;
  background: linear-gradient(125deg, #ffe8a521, #ffe8a508 45%, #ffe8a52b);
  box-shadow: inset 0 0 18px #d9bd7d33, 0 0 22px #d9bd7d55;
  animation: motion-shield var(--effect-duration) ease-out both;
}
.motion-impact.shield::after,
.motion-impact.guard::after {
  width: calc(var(--impact-size) * 1.16);
  height: calc(var(--impact-size) * 1.16);
  background: none;
  border: 1px solid #e3cc8d80;
  animation: motion-ring var(--effect-duration) ease-out both;
}

.motion-impact.seal::before {
  border-radius: 20%;
  border: 2px solid #d8e6c6;
  background: linear-gradient(90deg, transparent 48%, #d8e6c655 48% 52%, transparent 52%), linear-gradient(0deg, transparent 48%, #d8e6c655 48% 52%, transparent 52%);
  animation: motion-seal var(--effect-duration) ease-out both;
}
.motion-impact.breach::before { border-style: dashed; border-width: 3px; }
.motion-impact.breach::after { background: radial-gradient(circle, #fff1d28c, rgba(var(--motion-rgb), .5) 20%, transparent 67%); }

/* Wind-ups collect toward the actor, then the projectile/strike starts separately. */
.motion-impact.charge { z-index: 3; --impact-size: 72px; }
.motion-impact.charge::before {
  border: 1px solid rgba(var(--motion-rgb), .8);
  border-radius: 50%;
  background: radial-gradient(circle, transparent 40%, rgba(var(--motion-rgb), .14) 70%, transparent 73%);
  animation: motion-charge-in var(--effect-duration) ease-in both;
}
.motion-impact.charge::after {
  width: calc(var(--impact-size) * .4); height: calc(var(--impact-size) * .4);
  border: 0; border-radius: 50%; -webkit-mask-image: none; mask-image: none;
  background: radial-gradient(circle, #fff5d8d9, rgba(var(--motion-rgb), .6) 28%, transparent 68%);
  animation: motion-charge-core var(--effect-duration) ease-in both;
}
.motion-impact.charge.burst { --motion-color: #ffba73; --motion-rgb: 255, 186, 115; }
.motion-impact.charge.heavy { --motion-color: #e8d5a5; --motion-rgb: 232, 213, 165; }
.motion-impact.charge.seal::before { border-radius: 15%; border-style: dashed; }
.motion-impact.charge.cleanse { --motion-color: #c5f3e9; --motion-rgb: 197, 243, 233; }
.motion-impact.heal.cleanse::before { border: 1px dashed #d8fff4; animation: motion-cleanse-open var(--effect-duration) ease-out both; }
.motion-impact.heal.cleanse::after { animation: motion-heal-rise var(--effect-duration) ease-out both; }
.motion-impact.slash.heavy::before,
.motion-impact.slash.weighty::before { height: 8px; box-shadow: 0 0 14px rgba(var(--motion-rgb), .95); }
.motion-impact.slash.heavy::after,
.motion-impact.slash.weighty::after { height: 3px; }
.motion-impact.burst.weighty { --impact-size: 80px; --motion-color: #ffd091; --motion-rgb: 255, 208, 145; }
.motion-impact.burst.weighty::after { animation: motion-heavy-burst var(--effect-duration) ease-out both; }
.motion-impact.complete::before { width: calc(var(--impact-size) * .65); height: calc(var(--impact-size) * .65); border: 1px solid #bad1c566; box-shadow: none; }
.motion-impact.complete::after { display: none; }
.motion-impact.status::before { border-width: 1px; }
/* The melee slash starts at contact; its delay is also scaled by the speed control. */
.motion-impact::before, .motion-impact::after { animation-delay: var(--effect-delay, 0ms); }

/* Live actor/target state survives across individual particles. */
.pawn.actor-active {
  z-index: 9;
  filter: saturate(1.1) brightness(1.15);
  transform: translateY(-2px) scale(1.045);
  box-shadow: 0 0 0 3px #81dfc038, 0 0 22px #81dfc064, 0 6px 9px #0005;
}
.pawn.enemy.actor-active { box-shadow: 0 0 0 3px #f1a38438, 0 0 22px #f1a38464, 0 6px 9px #0005; }
.pawn.target-active {
  z-index: 8;
  outline: 2px solid #f6c5a7;
  outline-offset: 4px;
  box-shadow: 0 0 24px #f1a3845c;
}
.pawn.player.target-active { outline-color: #b5f0d0; box-shadow: 0 0 24px #81dfc05c; }
.pawn.actor-active.target-active { outline-color: var(--gold, #d9bd7d); }
.cell.acting-cell {
  z-index: 5;
  border-color: #81dfc077;
  background: radial-gradient(circle, #81dfc02d, #81dfc00c 72%);
  box-shadow: inset 0 0 14px #81dfc01f;
}
.cell.acting-cell.enemy,
.cell.acting-cell[data-side="enemy"],
.cell.acting-cell:has(.pawn.enemy) {
  border-color: #f1a38477;
  background: radial-gradient(circle, #f1a3842d, #f1a3840c 72%);
  box-shadow: inset 0 0 14px #f1a3841f;
}
.cell.target-cell { z-index: 4; border-color: #e2bd7a99; box-shadow: inset 0 0 0 1px #e2bd7a66, 0 0 12px #e2bd7a22; }

/* A clear reset between rounds, kept local to the board. */
.round-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px;
  pointer-events: none;
  text-align: center;
  border-radius: 12px;
  color: #f5edda;
  background: radial-gradient(ellipse at center, #07191bf5 0%, #0b1e20e6 38%, #0b1e2080 70%, #0b1e203d);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms ease, visibility 220ms;
}
.round-overlay::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 50%;
  height: min(170px, 72%);
  transform: translateY(-50%);
  border-block: 1px solid #d9bd7d47;
  pointer-events: none;
}
.round-overlay.enter,
.round-overlay.visible,
.round-overlay:not([hidden]) { opacity: 1; visibility: visible; }
.round-kicker {
  color: #d9bd7d;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: .24em;
}
.round-title {
  font-family: "Songti SC", SimSun, serif;
  color: #f4ead0;
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: .12em;
  text-shadow: 0 0 28px #d9bd7d36;
}
.round-title strong { color: #e9cb87; font-weight: inherit; }
.round-subtitle { max-width: 290px; color: #bdcdc3; font-size: 13px; line-height: 1.65; }

/* Persistent context between cue flashes. Can live below field-caption or in a header. */
.action-ribbon {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
  min-height: 25px;
  padding: 4px 8px;
  margin: 0 0 10px;
  border: 1px solid rgba(var(--motion-rgb), .2);
  border-left: 3px solid var(--motion-color);
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(var(--motion-rgb), .08), #0d2024b3 72%);
  color: #d5e4dd;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.action-ribbon:empty { display: none; }
.action-ribbon[data-side]::before {
  content: "战局";
  flex-shrink: 0;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(var(--motion-rgb), .12);
  color: var(--motion-color);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.3;
}
.action-ribbon[data-side="player"]::before { content: "我方"; }
.action-ribbon[data-side="enemy"]::before { content: "敌方"; }
.action-ribbon:has(.ribbon-side, .ribbon-tag, .ribbon-label)::before { display: none; }
.action-ribbon :is(.ribbon-side, .ribbon-tag, .ribbon-label) {
  flex-shrink: 0;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(var(--motion-rgb), .12);
  color: var(--motion-color);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: .04em;
}
.action-ribbon :is(strong, .ribbon-text) { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; }
.action-ribbon .ribbon-subtitle { margin-left: auto; color: #92aaa5; font-size: 11px; }
.arena-topbar .action-ribbon { margin: 0; flex: 1; min-width: 0; }

.action-panel.is-resolving :is(.action-header, .skill-list, .action-hint, .target-preview) {
  opacity: .28;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.action-panel.is-resolving::after {
  content: "招式结算中 · 观察双方行动";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: calc(100% - 28px);
  padding: 12px 18px;
  border: 1px solid #45665b;
  border-radius: 9px;
  background: #102723f2;
  color: #c8e6d7;
  box-shadow: 0 6px 25px #0003;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  pointer-events: none;
  z-index: 6;
}
.action-panel.is-resolving[data-resolving-text]::after { content: attr(data-resolving-text); }
.activation-dot.current:not(.dead) {
  --dot-rgb: 129, 223, 192;
  opacity: 1;
  border-color: #b4efda;
  background: #81dfc026;
  color: #d8ffed;
  font-weight: 700;
  animation: motion-activation 1.15s ease-in-out infinite;
}
.activation-dot.enemy.current:not(.dead) {
  --dot-rgb: 241, 163, 132;
  border-color: #f8c5ad;
  background: #f1a38426;
  color: #ffe4d5;
}

/* Numbers remain legible over pawns, trails, and protection rings. */
.floating-effects { z-index: 32; }
.float-number,
.motion-number {
  font-size: clamp(24px, 2.8vw, 32px);
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.035em;
  color: #ffd3ba;
  text-shadow: 0 2px 2px #061316, 1px 0 2px #061316, -1px 0 2px #061316, 0 0 12px #1a1714, 0 0 18px #f1a38444;
  -webkit-text-stroke: .35px #1a2322;
  white-space: nowrap;
  animation: motion-number var(--number-duration, 1.1s) cubic-bezier(.15, .65, .3, 1) both;
}
.motion-number {
  position: absolute;
  z-index: 8;
  width: max-content;
  max-width: 160px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  text-align: center;
  animation: none;
  will-change: transform, opacity;
}
.float-number.heal,
.motion-number.heal,
.motion-number[data-kind="heal"] { color: #b8ffd0; text-shadow: 0 2px 3px #071a16, 0 0 9px #071a16, 0 0 18px #81dfc066; }
.float-number.shield,
.float-number.guard,
.float-number.block,
.motion-number.shield,
.motion-number.guard,
.motion-number.block,
.motion-number[data-kind="shield"],
.motion-number[data-kind="guard"],
.motion-number[data-kind="block"] { color: #f4dfa4; }
.float-number.control,
.float-number.status,
.motion-number.control,
.motion-number.status,
.motion-number[data-kind="control"],
.motion-number[data-kind="status"] { color: #e3edcc; font-size: 16px; letter-spacing: .02em; }
.motion-number.weighty { font-size: clamp(28px, 3.1vw, 36px); }
.motion-number.complete { color: #bfd4c7; font-size: 15px; font-weight: 550; letter-spacing: .03em; padding: 4px 7px; background: #0b2021d9; border-radius: 5px; text-shadow: 0 1px 4px #071715; }

@keyframes motion-ring {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); }
  18% { opacity: .95; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.32); }
}
@keyframes motion-glow {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.5); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
}
@keyframes motion-slash {
  0% { opacity: 0; transform: translate(-65%, -35%) rotate(calc(var(--angle, 0deg) - 35deg)) scaleX(.2); }
  22% { opacity: 1; transform: translate(-50%, -50%) rotate(calc(var(--angle, 0deg) - 35deg)) scaleX(1); }
  100% { opacity: 0; transform: translate(-35%, -65%) rotate(calc(var(--angle, 0deg) - 35deg)) scaleX(1.15); }
}
@keyframes motion-cross-slash {
  0%, 14% { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--angle, 0deg) + 28deg)) scaleX(.3); }
  36% { opacity: .85; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(calc(var(--angle, 0deg) + 28deg)) scaleX(1.15); }
}
@keyframes motion-rays {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-12deg); }
  20% { opacity: .95; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55) rotate(10deg); }
}
@keyframes motion-charge-in {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.3) rotate(-25deg); }
  35% { opacity: .5; }
  85%, 100% { opacity: 1; transform: translate(-50%, -50%) scale(.75) rotate(0deg); }
}
@keyframes motion-charge-core {
  0% { opacity: .1; transform: translate(-50%, -50%) scale(.3); }
  65% { opacity: .65; transform: translate(-50%, -50%) scale(.6); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes motion-heavy-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-12deg); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-6deg); }
  48% { opacity: .9; transform: translate(-50%, -50%) scale(1.12) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.55) rotate(10deg); }
}
@keyframes motion-cleanse-open {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.65) rotate(-20deg); }
  28% { opacity: .95; transform: translate(-50%, -50%) scale(.95) rotate(0deg); }
  68% { opacity: .75; transform: translate(-50%, -50%) scale(1.08) rotate(18deg); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3) rotate(35deg); }
}
@keyframes motion-heal-rise {
  0% { opacity: 0; transform: translate(-50%, -10%) scale(.7); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1.05); }
}
@keyframes motion-shield {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.72); }
  24% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); }
  78% { opacity: .9; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes motion-seal {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-20deg) scale(1.25); }
  26%, 55% { opacity: .9; transform: translate(-50%, -50%) rotate(0deg) scale(.85); }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(8deg) scale(.88); }
}
@keyframes motion-activation {
  0%, 100% { box-shadow: 0 0 0 2px rgba(var(--dot-rgb), .06), 0 0 7px rgba(var(--dot-rgb), .14); }
  50% { box-shadow: 0 0 0 4px rgba(var(--dot-rgb), .13), 0 0 13px rgba(var(--dot-rgb), .4); }
}
@keyframes motion-number {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.76); }
  16% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  35% { opacity: 1; transform: translate(-50%, -70%) scale(1); }
  78% { opacity: .95; }
  100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}

@media (max-width: 600px) {
  .combat-cue { top: 4px; min-width: 150px; padding: 8px 14px; max-width: calc(100% - 10px); border-radius: 9px; gap: 3px; }
  .cue-side { font-size: 9px; }
  .cue-title { font-size: 18px; }
  .cue-subtitle { font-size: 10px; }
  .motion-ghost { --pawn-size: 30px; }
  .motion-projectile { --projectile-size: 11px; }
  .motion-projectile.burst { --projectile-size: 16px; }
  .motion-projectile.burst::after { width: 29px; height: 6px; }
  .motion-projectile.heal::before, .motion-projectile[data-kind="heal"]::before { width: 16px; height: 8px; }
  .motion-projectile.seal::before, .motion-projectile[data-kind="seal"]::before { width: 13px; height: 13px; }
  .motion-projectile.heal.cleanse::before { width: 17px; height: 17px; }
  .motion-impact { --impact-size: 44px; }
  .motion-impact.charge { --impact-size: 48px; }
  .motion-impact.burst.weighty { --impact-size: 54px; }
  .motion-impact.heal::after { width: 16px; height: 16px; }
  .pawn.target-active { outline-width: 1px; outline-offset: 3px; }
  .pawn.actor-active { transform: translateY(-1px) scale(1.04); }
  .round-overlay { gap: 6px; padding: 16px; border-radius: 7px; }
  .round-overlay::before { left: 8%; right: 8%; height: min(140px, 76%); }
  .round-kicker { font-size: 10px; }
  .round-title { font-size: 34px; }
  .round-subtitle { max-width: 230px; font-size: 11px; }
  .action-ribbon { min-height: 25px; padding: 4px 7px; margin-bottom: 9px; gap: 4px 7px; font-size: 12px; }
  .action-ribbon :is(strong, .ribbon-text) { font-size: 12px; }
  .action-ribbon :is(.ribbon-side, .ribbon-tag, .ribbon-label) { font-size: 9px; }
  .action-ribbon .ribbon-subtitle { font-size: 10px; }
  .action-panel.is-resolving::after { padding: 11px 13px; font-size: 12px; }
  .float-number, .motion-number { font-size: 23px; }
  .motion-number.weighty { font-size: 27px; }
  .motion-number.complete { font-size: 13px; }
  .float-number.control, .float-number.status,
  .motion-number.control, .motion-number.status,
  .motion-number[data-kind="control"], .motion-number[data-kind="status"] { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .combat-cue, .round-overlay, .pawn.actor-active, .pawn.target-active,
  .action-panel.is-resolving :is(.action-header, .skill-list, .action-hint, .target-preview) { transition: none !important; }
  .motion-impact::before, .motion-impact::after, .float-number, .motion-number,
  .activation-dot.current:not(.dead) { animation: none !important; }
  .motion-trail, .motion-projectile::after { display: none; }
  .motion-impact::before { opacity: .7; }
  .motion-impact::after { opacity: .45; }
  .pawn.actor-active { transform: none; }
  .float-number { opacity: 1; transform: translate(-50%, -80%); }
  .activation-dot.current:not(.dead) { box-shadow: 0 0 0 2px rgba(var(--dot-rgb), .28); }
}

/* Small flashes and falling fragments remain below readable result numbers. */
.motion-mote {
  position: absolute;
  z-index: 5;
  width: var(--mote-size, 4px);
  height: calc(var(--mote-size, 4px) * 1.8);
  margin: -2px 0 0 -2px;
  color: var(--motion-color, #d7f3e8);
  background: linear-gradient(160deg, #fff9e7, var(--motion-color, #9ae2cf));
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  filter: drop-shadow(0 0 3px rgba(var(--motion-rgb, 129,223,192), .7));
  pointer-events: none;
  transform-origin: center;
  will-change: transform, opacity;
}
.motion-mote.heal {
  height: calc(var(--mote-size, 5px) * 1.5);
  clip-path: none;
  border-radius: 1px 90% 1px 90%;
  background: linear-gradient(140deg, #fff4e9, var(--motion-color, #a3e7c6));
}
.motion-mote.rescue {
  height: calc(var(--mote-size, 7px) * 1.6);
  clip-path: none;
  border-radius: 60% 0 60% 10%;
  background: linear-gradient(140deg, #fffbe3, var(--motion-color, #a3e7c6));
  filter: drop-shadow(0 0 4px rgba(var(--motion-rgb, 163,231,198), .8));
}
.motion-mote.dot {
  width: 4px;
  height: 4px;
  clip-path: none;
  border-radius: 50% 50% 50% 0;
  background: #a97ed2;
  filter: drop-shadow(0 0 3px #b388d9);
}
.motion-mote.consume { height: 13px; width: 3px; }
.motion-mote.dispel { height: 8px; width: 3px; clip-path: none; border-radius: 1px; }
.motion-mote.guard, .motion-mote.reflect { background: linear-gradient(160deg, #fff7d3, #e8ba63); }

.motion-projectile[data-school="zixia"]::before,
.motion-projectile[data-school="taixu"]::before {
  width: 27px;
  height: 7px;
  border: 0;
  border-radius: 0;
  clip-path: polygon(0 20%, 67% 0, 100% 50%, 67% 100%, 0 80%, 20% 50%);
  background: linear-gradient(90deg, var(--motion-color), #f4fffb 70%, #fff);
}
.motion-projectile[data-school="huajian"]::before {
  width: 18px;
  height: 11px;
  border-radius: 70% 10% 70% 10%;
  background: linear-gradient(100deg, #765295, #b48ade 60%, #f4deff);
}
.motion-projectile[data-school="bingxin"]::before {
  width: 23px;
  height: 7px;
  border: 0;
  border-radius: 0;
  clip-path: polygon(0 42%, 68% 0, 100% 50%, 68% 100%, 0 58%);
  background: linear-gradient(90deg, #c677a1, #ffd9ec 75%, #fff8f2);
}
.motion-impact.slash[data-school="aoxue"]::before { height: 4px; width: calc(var(--impact-size) * 1.35); }
.motion-impact.slash[data-school="yijin"]::before { height: 8px; width: calc(var(--impact-size) * .95); }
.motion-impact.reflect::before {
  border: 3px double #f5dc9e;
  background: none;
  box-shadow: 0 0 12px #f1cb6c55;
}
.motion-impact.reflect::after {
  background: repeating-conic-gradient(from 12deg, #ffe8abbb 0 5deg, transparent 5deg 60deg);
  -webkit-mask-image: radial-gradient(circle, transparent 40%, #000 45% 65%, transparent 70%);
  mask-image: radial-gradient(circle, transparent 40%, #000 45% 65%, transparent 70%);
}
.motion-impact.dispel::before { border-style: dashed; border-width: 2px; box-shadow: 0 0 14px #8adcea44; }
.motion-impact.dispel::after {
  border-radius: 0;
  width: 19px;
  height: 19px;
  background: #c5f1f4;
  clip-path: polygon(50% 0, 60% 38%, 100% 50%, 60% 61%, 50% 100%, 39% 61%, 0 50%, 39% 38%);
}
.motion-impact.cleanse:not(.heal)::before { border: 1px solid #d3ecdd; }
.motion-impact.field-charge { --impact-size: 44px; }
.motion-impact.over-scene { --impact-size: 35px; }
.motion-impact.over-scene::before { box-shadow: 0 0 10px rgba(var(--motion-rgb), .2); }
.motion-impact.over-scene.weighty { --impact-size: 49px; }
.motion-impact.over-scene.dot { --impact-size: 29px; }
.motion-impact.burst-echo { --impact-size: 72px; }
.motion-impact.burst-echo::before {
  border: 2px solid rgba(var(--motion-rgb), .9);
  background: transparent;
  box-shadow: 0 0 16px rgba(var(--motion-rgb), .25);
}
.motion-impact.burst-echo::after {
  border: 1px dashed rgba(var(--motion-rgb), .65);
  background: none;
}
.motion-projectile.heal.burst-cast::before { width: 27px; height: 15px; box-shadow: 0 0 13px rgba(var(--motion-rgb), .65); }
.motion-projectile.heal.burst-cast::after { width: 36px; height: 4px; }
.motion-impact.heal.rescue::before {
  border: 3px double rgba(var(--motion-rgb), .95);
  background: radial-gradient(circle, transparent 44%, rgba(var(--motion-rgb), .1) 63%, transparent 70%);
  box-shadow: 0 0 16px rgba(var(--motion-rgb), .35);
}
.motion-impact.heal.rescue::after {
  width: calc(var(--impact-size) * .7);
  height: calc(var(--impact-size) * .7);
  border: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(from 22deg, #f6ffe7dd 0deg 15deg, rgba(var(--motion-rgb), .8) 16deg 27deg, transparent 28deg 45deg);
  -webkit-mask-image: radial-gradient(circle, transparent 18%, #000 24% 58%, transparent 66%);
  mask-image: radial-gradient(circle, transparent 18%, #000 24% 58%, transparent 66%);
  animation: motion-rescue-bloom var(--effect-duration) ease-out both;
}
@keyframes motion-rescue-bloom {
  0% { opacity: 0; transform: translate(-50%, -35%) rotate(-18deg) scale(.5); }
  22% { opacity: 1; transform: translate(-50%, -48%) rotate(-5deg) scale(.9); }
  65% { opacity: .85; transform: translate(-50%, -65%) rotate(12deg) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -85%) rotate(22deg) scale(1.15); }
}

.motion-number .motion-value { display: block; }
.motion-number .motion-detail {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.15;
  letter-spacing: .02em;
  font-weight: 650;
  -webkit-text-stroke: 0;
}
.motion-number.reflect { color: #ffe3a3; }
.motion-number.weighty { color: #fff0d0; }
.motion-number.heal.weighty { color: #c6ffe5; text-shadow: 0 2px 3px #102a24, 1px 0 #102a24, -1px 0 #102a24, 0 0 12px #88e3bd66; }
.scene-active .motion-number.weighty { font-size: 34px; font-weight: 850; }
.scene-active .motion-number.heal { font-size: 27px; }
.scene-active .motion-number.heal.weighty { font-size: 34px; }
.scene-active .motion-number.dot { font-size: 21px; }
.scene-active .motion-number.status,
.scene-active .motion-number.guard,
.scene-active .motion-number.shield { font-size: 17px; }

/* Projected circles use the board's local cell axes, including a skewed board. */
.motion-field {
  position: absolute;
  z-index: 1;
  width: 1px;
  height: 1px;
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform, opacity;
}
.motion-field *, .motion-field::before, .motion-field::after,
.motion-mote::before, .motion-mote::after { pointer-events: none; }
.motion-field-lines { position: absolute; overflow: visible; }
.motion-field-lines path {
  stroke: var(--motion-color, #a7e7db);
  stroke-width: 2;
  fill: rgba(var(--motion-rgb, 167,231,219), .035);
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
}
.motion-field-lines .field-script { stroke-width: 1; stroke-dasharray: 6 9; fill: none; opacity: .75; }
.motion-field.consume .field-edge { stroke-width: 3; }
.motion-field.consume .field-script { stroke-dasharray: 2 10; }
.motion-field.expire .field-edge { stroke-width: 1; fill: none; }
.motion-field-core {
  position: absolute;
  left: -12px;
  top: -12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid rgba(var(--motion-rgb, 167,231,219), .6);
  background: radial-gradient(circle, #fff7dcaa, rgba(var(--motion-rgb, 167,231,219), .2) 36%, transparent 70%);
  box-shadow: 0 0 14px rgba(var(--motion-rgb, 167,231,219), .3);
}
.motion-field[data-field="zixia_zhenshanhe"] .field-edge { stroke-width: 3; stroke: #eacb8c; }
.motion-field[data-field="taixu_tunriyue"] .field-script { stroke-dasharray: 16 14; stroke-width: 2; }

@media (max-width: 600px) {
  .scene-active .motion-number.weighty { font-size: 29px; }
  .scene-active .motion-number.heal { font-size: 24px; }
  .scene-active .motion-number.heal.weighty { font-size: 29px; }
  .scene-active .motion-number.dot { font-size: 18px; }
  .scene-active .motion-number.status,
  .scene-active .motion-number.guard,
  .scene-active .motion-number.shield { font-size: 14px; }
  .motion-number .motion-detail { font-size: 10px; margin-top: 3px; }
  .motion-impact.over-scene { --impact-size: 29px; }
  .motion-impact.over-scene.weighty { --impact-size: 40px; }
  .motion-impact.over-scene.dot { --impact-size: 24px; }
  .motion-impact.burst-echo { --impact-size: 54px; }
  .motion-projectile.heal.burst-cast::before { width: 22px; height: 12px; }
  .motion-field-lines path { stroke-width: 1.5; }
}

@media (prefers-reduced-motion: reduce) {
  .motion-mote { display: none; }
  .motion-field-lines .field-script { display: none; }
  .motion-field-core { box-shadow: none; }
}
