/* ==========================================================================
   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-intro {
  margin: 0;
  max-width: 650px;
  font-size: 14px;
  color: var(--hsbd-text-body);
}

.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);
}

.hsbd-pred-disclaimer {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--hsbd-text-muted);
}

/* 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;
  align-items: center;
  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;
}

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

.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 {
  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 {
  margin: 10px 0 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;
  margin: 12px 0 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);
}

/* ==========================================================================
   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 {
    flex: 0 0 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-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-intro {
    font-size: 13px;
  }

  .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;
  }
}
