/* Banner quảng cáo challenge: PC (>=1600px) 2 dọc 160x600 hai bên; còn lại 1 ngang 360x100 phía dưới. */
.stv-qc[hidden] { display: none !important; }
.stv-qc [data-p] { display: none; }
.stv-qc[data-phase='a'] [data-p='a'], .stv-qc[data-phase='b'] [data-p='b'] { display: block; }
.stv-qc__link { display: block; line-height: 0; border-radius: 12px; overflow: hidden; box-shadow: 0 6px 20px rgba(11, 14, 17, 0.28); }
.stv-qc__link img { display: block; max-width: 100%; height: auto; }
.stv-qc__x {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(11, 14, 17, 0.72); color: #fff; font: 700 13px/26px system-ui, sans-serif; text-align: center; cursor: pointer;
}
.stv-qc__x:hover, .stv-qc__x:focus-visible { background: #000; outline: 2px solid #fff; }

/* Ngang (mặc định): trên thanh menu dưới (JS đặt --stv-qc-nav), không che menu. */
.stv-qc__pc { display: none !important; }
.stv-qc__mb {
  position: fixed; z-index: 49; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--stv-qc-nav, 0px) + 8px + env(safe-area-inset-bottom, 0px));
  width: min(360px, calc(100vw - 16px));
}
.stv-qc__mb .stv-qc__link img { width: 100%; }
/* Banner ngang chỉ trượt vào sau khi cuộn ~300px (hoặc đợi 12 giây) để màn đầu sạch. */
.stv-qc:not(.is-in) .stv-qc__mb { opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, 24px); }
.stv-qc .stv-qc__mb { transition: opacity .35s ease, transform .35s ease, visibility .35s; }
/* Chừa chỗ cuối trang bằng chiều cao banner để không nội dung nào bị che; bỏ khi đóng. */
@media (max-width: 1599px) { body.stv-qc-pad { padding-bottom: 116px; background-color: var(--ink, #0b0e11); } }
.stv-qc__mb .stv-qc__x { top: 3px; right: 3px; }
/* Có thanh menu dưới (<768px) đã tính safe-area trong chiều cao thanh, nên bỏ cộng lần hai. */
.stv-qc.has-nav .stv-qc__mb { bottom: calc(var(--stv-qc-nav, 0px) + 8px); }

@media (min-width: 1600px) {
  .stv-qc .stv-qc__mb { display: none !important; }
  .stv-qc[data-phase='a'] .stv-qc__pc[data-p='a'], .stv-qc[data-phase='b'] .stv-qc__pc[data-p='b'] { display: block !important; }
  .stv-qc__pc { position: fixed; z-index: 40; top: calc(50% + 32px); transform: translateY(-50%); width: 160px; }
  /* khung nội dung tối đa 1200px (theme --wide); chừa 12px mỗi bên */
  .stv-qc__pc--l { left: calc(50% - 600px - 172px); }
  .stv-qc__pc--r { right: calc(50% - 600px - 172px); }
}
@media print { .stv-qc { display: none !important; } }
