/* ปุ่มสกิลจอสัมผัส "กดแล้วรู้สึก" (skill-tap-feel-1103 · client/tap-fx.js · ?tapfx=0 = ไม่มีคลาส html.tapfx → ไม่มีกฎในไฟล์นี้ทำงาน)
 * สถานะบนปุ่มกลม #touch-acts [data-slot] (+ ปุ่มไม้ตายเฉพาะท่ากดอยู่):
 *   .tf-down กดอยู่ (ยุบ + ขอบทอง ทันทีที่นิ้วแตะ ไม่รอเซิร์ฟ) · .tf-sent ส่งแล้ว/รอคิว (วงทองหมุน)
 *   .tf-used ใช้แล้ว (เด้ง + แสงทอง) · .tf-deny ไม่ออก (ส่าย + ขอบแดง + ป้ายเหตุผลสั้น)
 *   .tf-cool คูลดาวน์ (วงกวาดมืด + เลขวินาที · .tf-own = คูลดาวน์ของสกิลเอง เข้มกว่าดีเลย์ร่วม) · .tf-ready พร้อมอีก (แฟลชวงทอง)
 * perf: แอนิเมชันทุกตัวจบเอง (ไม่มี infinite/forwards) · วงกวาดเปลี่ยนค่า --tf-p เฉพาะตอนนับ (tap-fx.js rAF)
 * ไม่ตั้ง z-index — .tf-layer อยู่ก่อนป้ายเลขช่อง (<b>) ใน DOM จึงอยู่ใต้ป้าย/เหนือไอคอน */

html.tapfx.touch-ui #touch-acts > button { -webkit-tap-highlight-color: transparent; touch-action: none; }
html.tapfx.touch-ui #touch-acts .mirror .cd { display: none; }   /* แผ่นมืดภาพนิ่งที่ก๊อปจากช่องลัดคอม — แทนด้วยวงกวาด */

/* ── กดอยู่ ── */
html.tapfx.touch-ui body #hud #touch-acts > button.tf-down,
html.tapfx.touch-ui body #hud #ult-btn.tf-down {
  scale: .88; filter: brightness(1.2);
  box-shadow: 0 0 0 2px #ffe08a, 0 0 12px #e8b64acc; border-radius: 50%;
  transition: scale 50ms ease-out, filter 50ms;
}
html.tapfx.touch-ui body #hud #touch-acts > button { transition: scale 120ms ease-out, filter 120ms; }

/* ── ชั้นภาพบนปุ่ม ── */
html.tapfx #touch-acts .tf-layer {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  display: grid; place-items: center; overflow: visible;
}
html.tapfx #touch-acts .tf-layer > .tf-sweep {
  position: absolute; inset: 9%; border-radius: 50%; opacity: 0;
  background: conic-gradient(rgba(14, 20, 32, .42) calc(var(--tf-p, 0) * 360deg), transparent 0);
}
html.tapfx #touch-acts .tf-cool > .tf-layer > .tf-sweep { opacity: 1; }
html.tapfx #touch-acts .tf-cool.tf-own > .tf-layer > .tf-sweep { background: conic-gradient(rgba(14, 20, 32, .72) calc(var(--tf-p, 0) * 360deg), transparent 0); }
html.tapfx #touch-acts .tf-layer > .tf-num {
  position: relative; font: 800 var(--fs-name, 18px)/1 var(--font-head, system-ui); color: #fff6dc;
  text-shadow: 0 1px 2px #000, 0 0 5px #000c; font-style: normal; pointer-events: none;
}
html.tapfx #touch-acts .tf-layer > .tf-why {
  position: absolute; bottom: calc(100% + 4px); left: 50%; translate: -50% 0; opacity: 0; pointer-events: none;
  font: 700 var(--fs-xs, 12px)/1 var(--font-head, system-ui); font-style: normal; white-space: nowrap; color: #fff;
  padding: 4px 8px; border-radius: 10px; background: #8a2f22ee; border: 1.5px solid #f0a07a; box-shadow: 0 2px 6px #0006;
}
html.tapfx #touch-acts .tf-deny > .tf-layer > .tf-why { animation: tf-why 900ms ease-out; }
@keyframes tf-why { 0% { opacity: 0; translate: -50% 4px; } 12%, 78% { opacity: 1; translate: -50% 0; } 100% { opacity: 0; translate: -50% -2px; } }

/* ── ส่งแล้ว/รอคิว: วงทองหมุนรอบปุ่ม (เต็มที่ ~3 วิ แล้วจบเอง — ปกติเซิร์ฟตอบก่อน) ── */
html.tapfx #touch-acts .tf-sent > .tf-layer::before {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  background: conic-gradient(#ffe08a 0 25%, transparent 0 50%, #ffe08a 0 75%, transparent 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
  animation: tf-spin 600ms linear 5;
}
@keyframes tf-spin { to { rotate: 1turn; } }

/* ── ใช้แล้ว ── */
html.tapfx #touch-acts .tf-used { animation: tf-pop 380ms ease-out; }
html.tapfx #touch-acts .tf-used > .tf-layer { animation: tf-glow 420ms ease-out; }
@keyframes tf-pop { 0% { scale: .9; } 45% { scale: 1.1; } 100% { scale: 1; } }
@keyframes tf-glow { 0% { box-shadow: 0 0 0 0 #ffe08aee, inset 0 0 14px #fff3c0; } 100% { box-shadow: 0 0 0 12px #ffe08a00, inset 0 0 0 #fff3c000; } }

/* ── ไม่ออก ── */
html.tapfx #touch-acts .tf-deny { animation: tf-shake 320ms ease-in-out; }
html.tapfx #touch-acts .tf-deny > .tf-layer { box-shadow: 0 0 0 2px #e8503a, 0 0 10px #e8503a99; transition: box-shadow 300ms 500ms; }
@keyframes tf-shake { 0%, 100% { translate: 0; } 20% { translate: -4px 0; } 40% { translate: 4px 0; } 60% { translate: -3px 0; } 80% { translate: 2px 0; } }

/* ── พร้อมอีก ── */
html.tapfx #touch-acts .tf-ready > .tf-layer { animation: tf-ready 520ms ease-out; }
@keyframes tf-ready { 0% { box-shadow: 0 0 0 0 #ffe08a, inset 0 0 18px #fff3c0cc; } 100% { box-shadow: 0 0 0 14px #ffe08a00, inset 0 0 0 #fff3c000; } }

@media (prefers-reduced-motion: reduce) {
  html.tapfx #touch-acts .tf-used, html.tapfx #touch-acts .tf-deny { animation: none; }
  html.tapfx #touch-acts .tf-sent > .tf-layer::before { animation: none; }
}
