/* =====================================================================
   CHỈ SỐ NHÂN VẬT: chip trên HUD + bảng Phân điểm / Luyện tập / Kỹ năng
   ===================================================================== */

/* Chip chỉ số trên HUD có thể bấm */
.stat-row .stat-chip {
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 2px 4px;
  border-radius: 99px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background .12s, transform .12s;
}
.stat-row .stat-chip:hover { background: rgba(255, 193, 7, .25); transform: translateY(-1px); }
.stat-row .stat-chip:focus-visible, .btn-stats:focus-visible { outline: 2px solid #f59f00; outline-offset: 1px; }

.btn-stats { position: relative; }
.btn-stats.has-points { background: #fff3bf; animation: stat-glow 1.6s ease-in-out infinite; }
.btn-stats .badge-count { top: -9px; right: -9px; min-width: 18px; height: 18px; font-size: 10px; padding: 0 4px; }
@keyframes stat-glow {
  0%, 100% { box-shadow: 0 2px 0 var(--outline), 0 0 0 0 rgba(245, 159, 0, .0); }
  50% { box-shadow: 0 2px 0 var(--outline), 0 0 0 4px rgba(245, 159, 0, .45); }
}

/* ---- Đầu bảng ---- */
.st-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.st-points {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 2px solid var(--outline);
  border-radius: 99px;
  background: #fff;
  flex: 1 1 260px;
}
.st-points.has { background: linear-gradient(90deg, #fff3bf, #fff); }
.stp-num {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #adb5bd; color: #fff;
  font-weight: 900; font-size: 18px;
  border: 2px solid var(--outline);
}
.st-points.has .stp-num { background: linear-gradient(180deg, #ffd43b, #f08c00); }
.stp-text { display: flex; flex-direction: column; line-height: 1.25; }
.stp-text small { color: #666; font-size: 11.5px; }
.st-energy {
  padding: 6px 12px;
  border: 2px solid var(--outline);
  border-radius: 99px;
  background: #ebfbee;
  font-size: 13px;
}

/* ---- Lưới thẻ chỉ số ---- */
.st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.st-card {
  --sc: #f59f00;
  border: 2px solid var(--outline);
  border-top: 6px solid var(--sc);
  border-radius: 14px;
  background: #fffdf6;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .18);
}
.st-top { display: flex; align-items: center; gap: 10px; }
.st-icon {
  width: 42px; height: 42px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  background: color-mix(in srgb, var(--sc) 22%, #fff);
  border: 2px solid var(--outline);
  flex: none;
}
.st-name { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.st-name b { font-size: 15px; }
.st-name small { color: #2b8a3e; font-weight: 700; font-size: 11.5px; }
.st-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--sc);
  -webkit-text-stroke: 1px var(--outline);
  min-width: 44px;
  text-align: right;
}
.st-break { display: flex; flex-wrap: wrap; gap: 4px; }
.st-break span {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: #f1f3f5;
  border: 1px solid #dee2e6;
}
.st-passive { margin: 0; font-size: 12px; color: #555; }

.st-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px dashed #ced4da;
}
.st-row.st-skill { background: color-mix(in srgb, var(--sc) 10%, #fff); border-style: solid; border-color: color-mix(in srgb, var(--sc) 50%, #fff); }
.st-row-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.st-row-info b { font-size: 13px; }
.st-row-info small { font-size: 11px; color: #666; }
.st-row-act { display: flex; gap: 4px; flex: none; }
.st-row-act .btn { white-space: nowrap; }
.st-row-act .btn:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.4); }

/* ---- Điện thoại: chip chỉ số ẩn, chỉ còn nút 📊 + huy hiệu ---- */
@media (max-width: 760px), (max-height: 500px) {
  .stat-row .stat-chip { display: none; }
  .stat-row #stat-pt-badge:not(.hidden) { display: flex; }
  .st-grid { grid-template-columns: 1fr; }
  .st-row { flex-wrap: wrap; }
  .st-row-act { margin-left: auto; }
  .st-value { font-size: 22px; }
}
