/* W1: additions attach to existing controls; their hit boxes stay unchanged. */
.skills .wuxia-chain::before {
  content:'';position:absolute;inset:-4px;pointer-events:none;
  background:url('../assets/ui5-wuxia-ring.png') center/100% 100% no-repeat;
  mask:conic-gradient(#000 calc(var(--chain,0)*360deg),transparent 0);
  image-rendering:pixelated;
}
.skills .skill .wuxia-chip {
  top:-14px;bottom:auto;left:50%;transform:translateX(-50%);z-index:5;
  border-radius:0;min-width:38px;height:22px;padding:0 3px;line-height:22px;
  background:url('../assets/ui5-wuxia-chip.png') center/100% 100% no-repeat;
  color:#fff5bd;font-size:12px;pointer-events:none;image-rendering:pixelated;
}
.skills .cooling .wuxia-chip {color:#aaa19c;filter:grayscale(1);}
.skills .attack.wuxia-context>img {visibility:hidden;}
.wuxia-context-face {position:absolute;inset:8px;display:grid;justify-items:center;align-content:center;pointer-events:none;}
.skills .attack .wuxia-context-face img {width:40px;height:40px;image-rendering:pixelated;}
.wuxia-context-face b {font-size:13px;line-height:16px;color:#fff5bd;text-shadow:0 2px #421016;}
.skills .attack.wuxia-context {animation:wuxia-pulse .65s steps(2) infinite;}
.wuxia-strip {
  position:absolute;right:0;bottom:calc(100% + 10px);width:100%;min-height:30px;padding:5px 7px;
  box-sizing:border-box;text-align:center;font-size:10px;line-height:16px;color:#c7bba3;
  background:url('../assets/ui5-wuxia-strip.png') center/100% 100% no-repeat;image-rendering:pixelated;
  pointer-events:none;
}
.wuxia-strip.wuxia-next {color:#fff2ab;}
.wuxia-strip .active {color:#fffbe0;text-decoration:underline;text-decoration-color:#f2c23a;}
.wuxia-combo {display:flex;align-items:center;justify-content:center;gap:1px;pointer-events:none;color:#ffe680;
  white-space:nowrap;text-shadow:0 2px #29121b;font-size:13px;}
.target>.wuxia-combo {position:absolute;right:6px;bottom:-29px;flex:none;}
.skills>.wuxia-combo {position:absolute;right:0;bottom:calc(100% + 44px);}
.wuxia-digit {display:inline-block;width:16px;height:24px;background:url('../assets/ui5-wuxia-digits.png') no-repeat;
  background-size:160px 24px;image-rendering:pixelated;}
.wuxia-state {display:inline-flex;align-items:center;gap:3px;color:#ffe680;background:#291e30;
  border:1px solid #9c6428;border-radius:3px;padding:0 4px;font-size:10px;white-space:nowrap;}
.mobtag .wuxia-state {position:absolute;left:50%;top:-23px;transform:translateX(-50%);}
.wuxia-state img {width:18px;height:18px;image-rendering:pixelated;}
.wuxia-word {color:#ffe680;font-weight:700;text-shadow:0 2px #2b1420;}
@keyframes wuxia-pulse {50%{filter:brightness(1.2);box-shadow:0 0 10px #d85f2a;}}
@media (prefers-reduced-motion:reduce) {.skills .attack.wuxia-context{animation:none;}}
.wuxia-strip[hidden],.wuxia-combo[hidden],.wuxia-state[hidden] {display:none;}

/* W2 follows the live ui5 sockets and mirrors with the thumb stick. */
.skills .wuxia-guard {
  width:56px;height:56px;right:184px;bottom:76px;border:0;
  background:url('../assets/ui5-bash.png') center/100% 100% no-repeat;
  touch-action:none;
}
.skills .wuxia-guard small {position:absolute;bottom:1px;left:0;right:0;font-size:10px;color:#ffe9b3;}
.skills.wuxia-pvp .pvp-bash {right:196px;bottom:144px;}
body.stick-right .skills .wuxia-guard {right:auto;left:184px;}
body.stick-right .skills.wuxia-pvp .pvp-bash {right:auto;left:196px;}
.wuxia-qi-arc {
  position:absolute;inset:-3px;border-radius:50%;pointer-events:none;
  background:conic-gradient(#8bf6df calc(var(--qi,1)*360deg),#183d41 0);
  mask:radial-gradient(circle,transparent 63%,#000 65%,#000 70%,transparent 72%);
}
.skills .wuxia-escape {background-image:url('../assets/ui5-attack.png');}
.wuxia-qi-bar {height:4px;border:1px solid #355459;background:#142b35;position:relative;margin-top:2px;}
.wuxia-qi-bar i {display:block;height:100%;width:calc(var(--qi,1)*100%);background:#8bf6df;}
.wuxia-tell {color:#ffe277;font-weight:bold;text-shadow:0 2px #34212d;}
@media (pointer:coarse) {.wuxia-qi-bar {display:none;}}
@media (max-width:560px) {
  .skills .wuxia-guard {width:50px;height:50px;right:160px;bottom:68px;}
  .skills.wuxia-pvp .pvp-bash {right:172px;bottom:128px;}
  body.stick-right .skills .wuxia-guard {left:160px;}
  body.stick-right .skills.wuxia-pvp .pvp-bash {left:172px;}
}
@media (max-width:380px) {
  .skills .wuxia-guard {width:46px;height:46px;right:136px;bottom:126px;}
  .skills.wuxia-pvp .pvp-bash {right:144px;bottom:182px;}
  body.stick-right .skills .wuxia-guard {left:144px;}
  body.stick-right .skills.wuxia-pvp .pvp-bash {left:144px;}
}

/* W2 rolls outside PvP too, where the potion bar shows: on a phone held sideways (short screens) the roll's corner
   spot lay on the bar's left end (overlapcheck, 667x375 and 740x360). Above the guard button there instead, clear of
   the skill arc; in a duel (no bar) it stays in its corner. */
@media (orientation: landscape) and (max-height: 420px) {
  .skills:not(.wuxia-pvp) .pvp-dodge {
    bottom: 140px;
  }
}
