/* Chuyển động kiểu Animate UI (mức "subtle") cho các trang cổ điển.
   Giá trị lấy từ token của @animate-ui/react (đường cong spring xuất bằng
   css-timing.mjs): spring.entrance cho khối vào trang, spring.press cho nút bấm,
   ease.out / ease.soft cho tween. anim.js gắn class; trang không có JS vẫn hiện bình thường. */
:root {
  --xa-spring-entrance: linear(0, 0.0097, 0.036, 0.0756, 0.1251, 0.1819, 0.2435, 0.3079, 0.3734, 0.4385, 0.5021, 0.5634, 0.6215, 0.676, 0.7265, 0.7728, 0.8149, 0.8526, 0.8862, 0.9157, 0.9414, 0.9634, 0.9821, 0.9977, 1.0104, 1.0206, 1.0285, 1.0345, 1.0387, 1.0414, 1.0428, 1.0432, 1.0427, 1.0415, 1.0397, 1.0376, 1.0351, 1.0324, 1.0296, 1.0268, 1.024, 1.0212, 1.0186, 1.0161, 1.0138, 1.0116, 1.0096, 1.0078, 1.0062, 1.0048, 1.0035, 1.0024, 1.0015, 1.0007, 1, 0.9995, 0.9991, 0.9987, 0.9985, 1);
  --xa-spring-press: linear(0, 0.0261, 0.0935, 0.188, 0.2977, 0.4132, 0.5271, 0.6343, 0.7313, 0.8159, 0.8872, 0.9452, 0.9906, 1.0244, 1.048, 1.063, 1.0709, 1.0732, 1.0713, 1.0663, 1.0594, 1.0514, 1.0429, 1.0346, 1.0267, 1.0196, 1.0134, 1.0082, 1.004, 1.0007, 0.9982, 0.9965, 1, 0.9948, 0.9946, 0.9948, 1, 1, 1, 1);
  --xa-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --xa-ease-soft: cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* Chặn nháy: .wrap ẩn từ lúc tải tới khi anim.js chuẩn bị xong (tối đa 1,5 giây rồi tự hiện). */
html.xa-wait .wrap { opacity: 0; }

/* Trạng thái đầu của khối sắp vào trang — anim.js bỏ class này khi khối chạy xong. */
.xa-t { opacity: 0; translate: 0 10px; }

/* Nút bấm: scale 0,97 trên spring.press (thay cú nảy 0,94 cũ), hover chỉ đổi màu, không phóng to. */
.lg-pressable { transition: transform 400ms var(--xa-spring-press); }
.lg-press { transform: scale(0.97) !important; transition-duration: 0.12s !important; transition-timing-function: var(--xa-ease-out) !important; }

/* Đổi tab: nội dung mới hiện dần (transition.reveal 0,3s ease-out); không chạy lúc mới tải trang. */
@keyframes xaPanelIn { from { opacity: 0; } }
html.xa-ready .tab-panel.active,
html.xa-ready .sigtab-panel.active { animation: xaPanelIn 0.3s var(--xa-ease-out) both; }

/* Thanh xác suất lớn dần tới giá trị thật (width lấy từ style sẵn của thanh). */
@keyframes xaGrow { from { width: 0; } }
.prob-fill { animation: xaGrow 0.7s var(--xa-ease-soft) 0.1s both; }
/* Chấm vị trí trên thanh Hỗ trợ–Kháng cự / CFTC trượt từ giữa ra vị trí thật. */
@keyframes xaDot { from { left: 50% !important; } }
.briefing-bar .dot { animation: xaDot 0.8s var(--xa-ease-soft) 0.2s both; }

@media (prefers-reduced-motion: reduce) {
  .xa-t { translate: none; }
  .lg-pressable { transition: none; }
  .lg-press { transform: none !important; }
  .prob-fill, .briefing-bar .dot { animation: none; }
}
