/* ==========================================================================
   HỒ SƠ BÓNG ĐÁ - TRANG "DỰ ĐOÁN TỶ SỐ" (page-hsbd-du-doan.php)
   Chỉ nạp trên template dự đoán tỷ số. Dùng biến --hsbd-* của hsbd-style.css.
   Component ở root level; media queries gom CUỐI file (guideline #13).
   ========================================================================== */

/* 1. Đầu trang + khung chung --------------------------------------------- */

.hsbd-pred-head {
  margin-bottom: 24px;
}

.hsbd-pred-title {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -0.8px;
  line-height: 1.2;
  color: var(--hsbd-text-title);
}

.hsbd-pred-loading,
.hsbd-pred-empty,
.hsbd-pred-error {
  margin: 0;
  padding: 28px 20px;
  text-align: center;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius);
  color: var(--hsbd-text-muted);
  font-size: 14px;
}

.hsbd-pred-empty {
  color: var(--hsbd-text-body);
}

.hsbd-pred-retry {
  margin: 14px 0 0;
  padding: 10px 22px;
  background: var(--hsbd-primary);
  color: #fff;
  border: 1px solid var(--hsbd-primary);
  border-radius: var(--hsbd-radius-sm);
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.hsbd-pred-retry:hover {
  background: var(--hsbd-primary-hover);
}

/* 2. Chọn trận ------------------------------------------------------------ */

.hsbd-pred-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

/* Reset nút Flatsome đè lên (guideline #2). */
.hsbd-pred .hsbd-pred-choice {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 13px 15px;
  min-height: 96px;
  text-align: left;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius);
  box-shadow: var(--hsbd-shadow-sm);
  font: inherit;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
  cursor: pointer;
  transition: var(--hsbd-transition);
}

.hsbd-pred .hsbd-pred-choice:hover {
  border-color: var(--hsbd-primary);
}

.hsbd-pred .hsbd-pred-choice.is-active {
  border: 2px solid var(--hsbd-primary);
  background: var(--hsbd-primary-light);
}

.hsbd-pred-choice-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-dot {
  font-size: 14px;
  line-height: 1;
  color: var(--hsbd-primary);
}

.hsbd-pred-choice-teams {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.1px;
  color: var(--hsbd-text-title);
}

.hsbd-pred-choice-vs {
  font-weight: 500;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-choice-votes {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: auto;
  font-size: 11px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-choice-votes svg {
  flex: none;
}

/* 3. Thẻ trận -------------------------------------------------------------- */

.hsbd-pred-card {
  overflow: hidden;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-lg);
  box-shadow: var(--hsbd-shadow-md);
}

.hsbd-pred-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 24px 0;
}

.hsbd-pred-comp {
  font-size: 12px;
  font-weight: 700;
  color: var(--hsbd-text-body);
}

.hsbd-pred-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: var(--hsbd-radius-sm);
  background: var(--hsbd-primary-light);
  color: var(--hsbd-primary-hover);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.hsbd-pred-label-star {
  font-size: 11px;
}

.hsbd-pred-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-status.is-open {
  color: var(--hsbd-primary);
}

.hsbd-pred-status.is-closed {
  color: #dc2626;
}

.hsbd-pred-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px minmax(0, 1fr);
  gap: 14px;
  /* Căn từ mép trên, KHÔNG center: tên đội xuống dòng làm cột đội đó cao hơn,
     center sẽ đẩy logo đội bên kia xuống lệch nhau. Cột giữa (VS/giờ) tự căn
     giữa bằng align-self nên vẫn nằm giữa thẻ như trước. */
  align-items: start;
  max-width: 580px;
  margin: 20px auto 14px;
  padding: 0 22px;
}

.hsbd-pred-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}

.hsbd-pred-crest {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
}

.hsbd-pred-crest img {
  position: absolute;
  inset: 2px;
  margin: auto;
  max-width: 100%;
  max-height: 100%;
  width: 60px;
  height: 60px;
  object-fit: contain;
  background: #fff;
}

.hsbd-pred-crest-fallback {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid var(--hsbd-border);
  border-radius: 14px;
  background: var(--hsbd-bg-main);
  font-weight: 800;
  font-size: 13px;
  color: var(--hsbd-text-body);
}

.hsbd-pred-team-name {
  margin-top: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.35;
  color: var(--hsbd-text-title);
}

.hsbd-pred-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  /* Cột giữa vẫn căn giữa chiều cao hàng (hành vi cũ của align-items:center). */
  align-self: center;
}

.hsbd-pred-vs {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 1.3px;
  color: var(--hsbd-text-muted);
}

/* Tỷ số chính thức thay chữ VS ở trận đã kết thúc — to, đậm hơn để đọc ra
   "kết quả" chứ không phải chữ nối. */
.hsbd-pred-vs.is-result {
  font-size: 24px;
  letter-spacing: 0;
  color: var(--hsbd-text-title);
}

.hsbd-pred-when {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--hsbd-text-muted);
}

/* 4. Khung chọn tỷ số ------------------------------------------------------ */

.hsbd-pred-form {
  max-width: 490px;
  margin: 0 auto 24px;
  padding: 0 20px;
  text-align: center;
}

.hsbd-pred-form-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.25;
  color: var(--hsbd-text-title);
}

.hsbd-pred-form-hint {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-steppers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
}

.hsbd-pred .hsbd-pred-stepper {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  width: 132px;
  height: 66px;
  margin: 0;
  padding: 0;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius);
  overflow: hidden;
}

.hsbd-pred .hsbd-pred-step {
  align-self: stretch;
  display: grid;
  place-items: center;
  width: 34px;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--hsbd-bg-main);
  color: var(--hsbd-text-body);
  font: inherit;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
  transition: var(--hsbd-transition);
}

.hsbd-pred .hsbd-pred-step:hover:not(:disabled) {
  background: var(--hsbd-primary-light);
  color: var(--hsbd-primary-hover);
}

.hsbd-pred .hsbd-pred-step:disabled {
  color: var(--hsbd-border);
  cursor: not-allowed;
}

.hsbd-pred-score {
  /* Span bị kéo giãn đủ cao trong stepper (align-items: stretch) nên chữ số
     nằm sát mép trên — dựng lưới để số canh giữa ô theo cả hai chiều. */
  display: grid;
  place-items: center;
  min-width: 34px;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  color: var(--hsbd-text-title);
}

.hsbd-pred-colon {
  font-size: 22px;
  font-weight: 500;
  color: var(--hsbd-text-muted);
}

/* Reset nút chính (Flatsome thêm padding/margin/text-transform mặc định). */
.hsbd-pred .hsbd-pred-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  max-width: 310px;
  margin: 0 auto;
  padding: 12px 16px;
  min-height: 46px;
  background: var(--hsbd-primary);
  color: #fff;
  border: 1px solid var(--hsbd-primary);
  border-radius: var(--hsbd-radius-sm);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  cursor: pointer;
  transition: var(--hsbd-transition);
}

.hsbd-pred .hsbd-pred-submit:hover:not(:disabled) {
  background: var(--hsbd-primary-hover);
}

.hsbd-pred .hsbd-pred-submit:disabled {
  background: var(--hsbd-border);
  border-color: var(--hsbd-border);
  color: var(--hsbd-text-muted);
  cursor: not-allowed;
}

.hsbd-pred-footnote {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-formnote {
  /* Cùng bề rộng với nút gửi (max-width 310px, canh giữa) để hai khối
     full-width trong form có chung mép trái/phải ở mọi bề rộng. */
  max-width: 310px;
  margin: 10px auto 0;
  padding: 9px 12px;
  border-radius: var(--hsbd-radius-sm);
  background: var(--hsbd-bg-main);
  border: 1px solid var(--hsbd-border);
  font-size: 12px;
  font-weight: 600;
  color: var(--hsbd-text-body);
}

.hsbd-pred-formnote[hidden] {
  display: none;
}

.hsbd-pred-notice {
  display: none;
  max-width: 310px;
  margin: 12px auto 0;
  padding: 10px 12px;
  border-radius: var(--hsbd-radius-sm);
  font-size: 12px;
  line-height: 1.5;
}

.hsbd-pred-notice.is-visible {
  display: block;
}

.hsbd-pred-notice.is-success {
  background: var(--hsbd-primary-light);
  border: 1px solid var(--hsbd-primary);
  color: var(--hsbd-primary-hover);
}

.hsbd-pred-notice.is-error {
  background: #fdecea;
  border: 1px solid #f5b7b1;
  color: #b03a2e;
}

.hsbd-pred-captcha {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.hsbd-pred-captcha[hidden] {
  display: none;
}

/* 5. Thống kê cộng đồng ----------------------------------------------------- */

.hsbd-pred-stats {
  padding: 20px 24px 22px;
  border-top: 1px solid var(--hsbd-border);
  background: var(--hsbd-bg-main);
}

.hsbd-pred-stats-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.hsbd-pred-stats-title {
  margin: 0 0 2px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--hsbd-text-title);
}

.hsbd-pred-stats-sub {
  margin: 0;
  font-size: 12px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-total {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: var(--hsbd-radius-sm);
  background: var(--hsbd-primary-light);
  color: var(--hsbd-primary-hover);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.hsbd-pred-outcomes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.hsbd-pred-outcome {
  padding: 10px 4px;
  border-radius: var(--hsbd-radius-sm);
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  text-align: center;
}

.hsbd-pred-outcome-pct {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.hsbd-pred-outcome-kind {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--hsbd-text-body);
}

.hsbd-pred-outcome-n {
  margin-top: 1px;
  font-size: 11px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-outcome.is-home .hsbd-pred-outcome-pct {
  color: var(--hsbd-primary);
}

.hsbd-pred-outcome.is-draw .hsbd-pred-outcome-pct {
  color: var(--hsbd-text-muted);
}

.hsbd-pred-outcome.is-away .hsbd-pred-outcome-pct {
  color: #dc2626;
}

.hsbd-pred-bar {
  display: flex;
  overflow: hidden;
  height: 10px;
  margin: 4px 0 22px;
  border-radius: var(--hsbd-radius-full);
  background: var(--hsbd-border);
}

.hsbd-pred-bar span.is-home {
  background: var(--hsbd-primary);
}

.hsbd-pred-bar span.is-draw {
  background: var(--hsbd-text-muted);
}

.hsbd-pred-bar span.is-away {
  background: #dc2626;
}

.hsbd-pred-top-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.hsbd-pred-top-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--hsbd-text-title);
}

.hsbd-pred-top-note {
  font-size: 11px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-top-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.hsbd-pred-top-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-sm);
  background: var(--hsbd-card-bg);
}

.hsbd-pred-top-score {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
  color: var(--hsbd-text-title);
}

.hsbd-pred-top-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--hsbd-text-body);
}

.hsbd-pred-top-pct {
  font-size: 11px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-top-empty {
  margin: 0;
  font-size: 12px;
  color: var(--hsbd-text-muted);
}

/* 6. Chân thẻ: link CLB + chia sẻ ------------------------------------------- */

.hsbd-pred-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-top: 1px solid var(--hsbd-border);
  background: var(--hsbd-card-bg);
}

.hsbd-pred-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
}

.hsbd-pred-links-label {
  font-size: 11px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-link {
  font-weight: 700;
  color: var(--hsbd-primary-hover);
}

.hsbd-pred-link:hover {
  text-decoration: underline;
}

.hsbd-pred .hsbd-pred-share {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 9px 12px;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-sm);
  color: var(--hsbd-text-body);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  cursor: pointer;
  transition: var(--hsbd-transition);
}

.hsbd-pred .hsbd-pred-share:hover {
  background: var(--hsbd-primary-light);
  border-color: var(--hsbd-primary);
  color: var(--hsbd-primary-hover);
}

/* 7. Thành tích của bạn (biệt danh + điểm theo INTERFACE.md) ---------------- */

.hsbd-pred-me {
  margin-top: 18px;
  padding: 20px 24px 22px;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-lg);
  box-shadow: var(--hsbd-shadow-md);
}

.hsbd-pred-me-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--hsbd-text-title);
}

.hsbd-pred-me-invite {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--hsbd-radius-sm);
  background: var(--hsbd-bg-main);
  font-size: 13px;
  line-height: 1.5;
  color: var(--hsbd-text-body);
}

.hsbd-pred-nick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.hsbd-pred-nick-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--hsbd-text-body);
}

.hsbd-pred-nick-tag {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-nick-row {
  /* Bè rộng vừa đủ ở màn lớn; mobile co lại vẫn full-width nhờ flex. */
  max-width: 420px;
  display: flex;
  gap: 8px;
}

.hsbd-pred-nick-input {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 10px 12px;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-sm);
  font: inherit;
  font-size: 14px;
  color: var(--hsbd-text-title);
}

.hsbd-pred-nick-input:focus {
  border-color: var(--hsbd-primary);
}

.hsbd-pred-nick-input:disabled {
  color: var(--hsbd-text-muted);
}

/* Reset nút Flatsome (guideline #2). */
.hsbd-pred .hsbd-pred-nick-save {
  flex: none;
  margin: 0;
  padding: 10px 18px;
  background: var(--hsbd-primary);
  border: 1px solid var(--hsbd-primary);
  border-radius: var(--hsbd-radius-sm);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
  letter-spacing: normal;
  box-shadow: none;
  cursor: pointer;
  transition: var(--hsbd-transition);
}

.hsbd-pred .hsbd-pred-nick-save:hover:not(:disabled) {
  background: var(--hsbd-primary-hover);
}

.hsbd-pred .hsbd-pred-nick-save:disabled {
  background: var(--hsbd-border);
  border-color: var(--hsbd-border);
  color: var(--hsbd-text-muted);
  cursor: not-allowed;
}

.hsbd-pred-nick-msg {
  display: none;
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: var(--hsbd-radius-sm);
  font-size: 12px;
  line-height: 1.5;
}

.hsbd-pred-nick-msg.is-visible {
  display: block;
}

.hsbd-pred-nick-msg.is-success {
  background: var(--hsbd-primary-light);
  border: 1px solid var(--hsbd-primary);
  color: var(--hsbd-primary-hover);
}

.hsbd-pred-nick-msg.is-error {
  background: #fdecea;
  border: 1px solid #f5b7b1;
  color: #b03a2e;
}

/* 7b. Khối chặn biệt danh trước nút gửi + dòng tên đã có + ô tên chỉ đọc ---- */

.hsbd-pred-nickgate {
  margin: 0 0 18px;
  padding: 20px 24px 22px;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-lg);
  box-shadow: var(--hsbd-shadow-md);
}

.hsbd-pred-nickgate-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--hsbd-text-title);
}

.hsbd-pred-nickgate-hint {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--hsbd-text-muted);
}

/* Dòng "Bạn: <tên>" — khách đã có biệt danh, thay khối nhập ở cùng vị trí
   (ngay trước nút gửi / vùng hành động). Cùng bề rộng với nút gửi để hai
   khối full-width trong form có chung mép ở mọi bề rộng. */
.hsbd-pred-nameline {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  max-width: 310px;
  margin: 2px auto 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-nameline[hidden] {
  display: none;
}

.hsbd-pred-nameline-name {
  font-weight: 800;
  color: var(--hsbd-text-title);
  overflow-wrap: anywhere;
}

/* Biệt danh hiển thị trong "Thành tích của bạn" — chỉ đọc, không ô đổi. */
.hsbd-pred-nick-name {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--hsbd-text-title);
}

/* Khối "Bạn đã dự đoán X – Y" thay khung chọn tỷ số khi trận đã vote. */
.hsbd-pred-voted {
  margin: 14px 0;
  padding: 16px 20px;
  background: var(--hsbd-primary-light);
  border: 1px solid var(--hsbd-primary);
  border-radius: var(--hsbd-radius-sm);
  text-align: center;
}

.hsbd-pred-voted-label {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hsbd-primary-hover);
}

.hsbd-pred-voted-score {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
  color: var(--hsbd-text-title);
}

.hsbd-pred-me-hiddenwarn {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: var(--hsbd-radius-sm);
  background: #fff8e6;
  border: 1px solid #f1d27a;
  color: #8a6100;
  font-size: 12px;
  line-height: 1.5;
}

.hsbd-pred-me-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.hsbd-pred-me-card {
  min-width: 0;
  padding: 12px 14px;
  background: var(--hsbd-bg-main);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-sm);
}

.hsbd-pred-me-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-me-points {
  margin-top: 2px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  color: var(--hsbd-primary-hover);
}

.hsbd-pred-me-points-unit {
  margin-left: 3px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-me-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--hsbd-border);
  font-size: 12px;
}

.hsbd-pred-me-card .hsbd-pred-me-row:first-of-type {
  margin-top: 10px;
}

.hsbd-pred-me-row-label {
  color: var(--hsbd-text-muted);
}

.hsbd-pred-me-row-value {
  font-variant-numeric: tabular-nums;
  color: var(--hsbd-text-title);
}

.hsbd-pred-me-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--hsbd-text-muted);
}

/* 8. Bảng xếp hạng ----------------------------------------------------------- */

.hsbd-pred-lb {
  margin-top: 18px;
  padding: 20px 24px 22px;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-lg);
  box-shadow: var(--hsbd-shadow-md);
}

.hsbd-pred-lb-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--hsbd-text-title);
}

.hsbd-pred-lb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.hsbd-pred .hsbd-pred-lb-tab {
  flex: 1;
  margin: 0;
  padding: 8px 12px;
  background: var(--hsbd-bg-main);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-sm);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  color: var(--hsbd-text-body);
  cursor: pointer;
  transition: var(--hsbd-transition);
}

.hsbd-pred .hsbd-pred-lb-tab:hover {
  border-color: var(--hsbd-primary);
}

.hsbd-pred .hsbd-pred-lb-tab.is-active {
  background: var(--hsbd-primary-light);
  border-color: var(--hsbd-primary);
  color: var(--hsbd-primary-hover);
}

.hsbd-pred-lb-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 8px;
}

.hsbd-pred-lb-period {
  font-size: 13px;
  font-weight: 700;
  color: var(--hsbd-text-title);
}

.hsbd-pred-lb-stamp {
  font-size: 11px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-lb-state {
  margin: 0;
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred .hsbd-pred-lb-retry {
  display: block;
  margin: 8px auto 0;
  padding: 8px 18px;
  background: var(--hsbd-primary);
  border: 1px solid var(--hsbd-primary);
  border-radius: var(--hsbd-radius-sm);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
  cursor: pointer;
  transition: var(--hsbd-transition);
}

.hsbd-pred .hsbd-pred-lb-retry:hover {
  background: var(--hsbd-primary-hover);
}

.hsbd-pred-lb-table {
  /* table-layout auto (không fixed): mỗi cột rộng bằng chữ rộng nhất của chính
     nó. CSS Customizer của site trên production (khối "BDH - TABLE STYLE",
     ngoài repo) ép th font 14px + padding 13/15px bằng !important và Flatsome
     viết HOA th — fixed + cột cứng (38/64px đặt cho chữ 11px) làm chữ tiêu đề
     nowrap tràn đè cột kế bên, bị overflow:hidden của theme cắt mép phải.
     Auto thì tiêu đề chỉ cần tự giãn cột của mình, không bao giờ đè nhau bất
     kể theme style chữ thế nào; ≤600px media cuối file lấy lại cỡ ô. */
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.hsbd-pred-lb-table th {
  padding: 6px 8px;
  border-bottom: 2px solid var(--hsbd-border);
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-lb-table th:nth-child(n+3) {
  text-align: right;
}

.hsbd-pred-lb-table td {
  padding: 8px;
  border-bottom: 1px solid var(--hsbd-border);
  vertical-align: middle;
}

.hsbd-pred-lb-tr:last-child td {
  border-bottom: 0;
}

.hsbd-pred-lb-rank {
  width: 38px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-lb-name {
  /* width 100%: cột tên lấy phần còn lại sau khi các cột kia vừa chữ (auto
     layout); biệt danh dài cắt dấu … chứ không đẩy bảng tràn khung 360px. */
  width: 100%;
  min-width: 0;
}

.hsbd-pred-lb-nickbox {
  display: flex;
  align-items: baseline;
  gap: 5px;
  /* width 0 + min-width 100%: đóng góp intrinsic 0 vào thuật toán auto layout
     (nick nowrap dài không đội cột tên/bảng), hiển thị thì đầy bề rộng ô. */
  width: 0;
  min-width: 100%;
}

.hsbd-pred-lb-nick {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--hsbd-text-title);
}

.hsbd-pred-lb-tag {
  flex: none;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--hsbd-text-muted);
}

.hsbd-pred-lb-you {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  color: var(--hsbd-primary-hover);
}

.hsbd-pred-lb-num {
  /* Sàn 64px màn rộng / 44px dưới 481px: auto layout coi width đặt trên ô là
     tối thiểu — chữ tiêu đề rộng hơn (theme ép font/padding) thì cột tự giãn. */
  width: 64px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--hsbd-text-body);
}

.hsbd-pred-lb-tr.is-me td {
  background: var(--hsbd-primary-light);
}

.hsbd-pred-lb-tr.is-me td:first-child {
  border-radius: var(--hsbd-radius-sm) 0 0 var(--hsbd-radius-sm);
}

.hsbd-pred-lb-tr.is-me td:last-child {
  border-radius: 0 var(--hsbd-radius-sm) var(--hsbd-radius-sm) 0;
}

.hsbd-pred-lb-tr.is-me .hsbd-pred-lb-nick {
  color: var(--hsbd-primary-hover);
}

.hsbd-pred-lb-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

.hsbd-pred-lb-pager[hidden] {
  display: none;
}

.hsbd-pred-lb-pagenote {
  font-size: 11px;
  color: var(--hsbd-text-muted);
}

.hsbd-pred .hsbd-pred-lb-pagebtn {
  margin: 0;
  padding: 7px 12px;
  background: var(--hsbd-card-bg);
  border: 1px solid var(--hsbd-border);
  border-radius: var(--hsbd-radius-sm);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  color: var(--hsbd-text-body);
  cursor: pointer;
  transition: var(--hsbd-transition);
}

.hsbd-pred .hsbd-pred-lb-pagebtn:hover:not(:disabled) {
  border-color: var(--hsbd-primary);
  color: var(--hsbd-primary-hover);
}

.hsbd-pred .hsbd-pred-lb-pagebtn:disabled {
  color: var(--hsbd-border);
  cursor: not-allowed;
}

/* Đầu cột đầy đủ ("Đúng tỷ số", "Số trận") cho màn rộng; dưới 481px chỉ còn
   chữ gọn ("Tỷ số", "Trận") để bảng vừa 360px (đổi ở media cuối file). */
.hsbd-pred-lb-wide {
  display: none;
}

/* ==========================================================================
   RESPONSIVE — gom cuối file, không lồng nhau (guideline #13)
   ========================================================================== */

@media (max-width: 768px) {
  .hsbd-pred-picker {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 9px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .hsbd-pred-picker::-webkit-scrollbar {
    display: none;
  }

  .hsbd-pred .hsbd-pred-choice {
    /* 2 trận: hai thẻ chia đều bề ngang (mép phải thẻ cuối thẳng mép thẻ
       chính); ≥3 trận: vượt hàng thì cuộn ngang như cũ (không co, có snap). */
    flex: 0 0 min(calc((100% - 9px) / 2), 215px);
    scroll-snap-align: start;
  }

  .hsbd-pred-card-top {
    padding: 14px 16px 0;
    flex-wrap: wrap;
  }

  .hsbd-pred-teams {
    margin: 16px auto 12px;
    grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr);
    gap: 8px;
    padding: 0 12px;
  }

  .hsbd-pred-crest,
  .hsbd-pred-crest img {
    width: 54px;
    height: 54px;
  }

  .hsbd-pred-crest-fallback {
    width: 46px;
    height: 46px;
  }

  .hsbd-pred-team-name {
    font-size: 14px;
  }

  .hsbd-pred-stats {
    padding: 18px 16px 20px;
  }

  .hsbd-pred-me,
  .hsbd-pred-lb {
    padding: 18px 16px 20px;
  }

  .hsbd-pred-actions {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
  }

  .hsbd-pred .hsbd-pred-share {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hsbd-pred-title {
    font-size: 24px;
  }

  .hsbd-pred .hsbd-pred-stepper {
    width: 116px;
    height: 62px;
  }

  .hsbd-pred .hsbd-pred-step {
    width: 30px;
  }

  .hsbd-pred-score {
    min-width: 30px;
    font-size: 27px;
  }

  .hsbd-pred-outcome-pct {
    font-size: 18px;
  }

  .hsbd-pred-top-grid {
    gap: 6px;
  }

  .hsbd-pred-top-item {
    padding: 10px 4px;
  }

  .hsbd-pred-top-score {
    font-size: 16px;
  }

  .hsbd-pred-top-count {
    font-size: 10px;
  }

  .hsbd-pred-total {
    font-size: 10px;
  }

  /* Bảng BXH co lại cho vừa khung hẹp; tên dài cắt bằng dấu … (table-layout
     auto, cột tên lấy phần còn lại). Cỡ chữ/padding ô ≤600px do media cuối
     file quyết (phải !important mới đè được theme) — font-size đặt trên table
     chẳng tới ô nào nên bỏ, còn sàn width cho cột Hạng/số. */
  .hsbd-pred-lb-rank {
    width: 30px;
  }

  .hsbd-pred-lb-num {
    width: 44px;
  }

  .hsbd-pred-me-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ≤600px lấy lại cỡ chữ/padding ô (th 10px, td 12px, đệm hẹp) để bảng vừa
   khung hẹp và biệt danh thường hiện đủ — lên đúng biên media 600px của theme
   (dải 481–600 theme vẫn ép th 13px/đệm 10px !important, nhãn đủ "Đúng tỷ số"
   làm min-content bảng ~500px > khung ~430–570px → tràn mép phải). Theme site
   (khối Customizer "BDH - TABLE STYLE", ngoài repo) style MỌI table bằng
   `table th/td … !important` — muốn thắng phải cùng !important với selector
   đặc hiệu hơn (class + element > 2 element); chỉ scope trong bảng BXH, bảng
   khác của site không bị đụng. ≥601px không đè, nhìn theme 14px vừa khung. */
@media (max-width: 600px) {
  .hsbd-pred-lb-table th {
    padding: 5px 4px !important;
    font-size: 10px !important;
  }

  .hsbd-pred-lb-table td {
    padding: 7px 4px !important;
    font-size: 12px !important;
  }
}

@media (min-width: 481px) {
  .hsbd-pred-lb-wide {
    display: inline;
  }

  .hsbd-pred-lb-narrow {
    display: none;
  }
}
