/* ส่วนเสริมหน้า home ที่ใช้ร่วมกันทุกธีม (v1–v10)
   hw-* = แจ็กพอต / แถบถอนเงิน / สไลด์โปรโมชั่น · hf-* = footer (views/partials/homefooter.ejs)
   ใช้สีจากตัวแปรของธีม (--primary / --primaroo) และไม่กำหนดความกว้างตายตัว
   เพราะบางธีมวางเนื้อหาในกรอบ 500px (v6/v7) บางธีมเต็มจอ */

/* ===== แจ็กพอต ===== */
.hw-jackpot {
  box-sizing: border-box;
  width: 100%;
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: 16px;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary, #22075e) 0%, #000 100%);
  border: 1px solid var(--primaroo, #946D33);
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(255, 215, 0, 0.08);
}
.hw-jackpot__label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #ffd54a;
}
.hw-jackpot__label i { margin-right: 4px; }
.hw-jackpot__amount {
  font-size: clamp(24px, 7vw, 38px);
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums; /* ตัวเลขกว้างเท่ากัน ไม่สั่นตอนยอดขยับ */
  background: linear-gradient(180deg, #fff6c2 0%, #ffd54a 45%, #e0a100 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 10px rgba(255, 196, 0, 0.25);
  white-space: nowrap;
}
.hw-jackpot__currency { margin-right: 4px; }

/* ===== แถบรายการถอนเงิน (วิ่งขวาไปซ้าย) ===== */
.hw-ticker {
  box-sizing: border-box;
  width: 100%;
  margin: 10px 0 14px;
  color: #fff;
  font-size: 14px;
}
.hw-ticker__label {
  display: inline-flex;
  align-items: center;
  padding: 0 4px 8px;
  font-weight: 700;
  color: #fff;
}
.hw-ticker__label i { margin-right: 6px; color: var(--primaroo, #946D33); }
.hw-ticker__viewport {
  overflow: hidden;
  width: 100%;
}
.hw-ticker__track {
  display: inline-flex;
  gap: 12px;
  padding: 4px 0 8px;
  will-change: transform;
  animation: hw-marquee 60s linear infinite;
}
.hw-ticker:hover .hw-ticker__track { animation-play-state: paused; }

/* card รายการถอนเงิน */
.hw-wcard {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  width: 200px;
  height: 90px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 10px 14px 10px 8px;
  box-sizing: border-box;
  gap: 10px;
  overflow: hidden;
}
.hw-wcard__img {
  flex: 0 0 70px;
  width: 70px;
  height: 70px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.hw-wcard__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* fallback: แสดงชื่อค่ายเมื่อรูปโหลดไม่ขึ้น */
.hw-wcard__game-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}
.hw-wcard__img img + .hw-wcard__game-label { display: none; } /* ซ่อนถ้ารูปขึ้น */
.hw-wcard__info {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hw-wcard__phone {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hw-wcard__time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}
.hw-wcard__amount {
  font-size: 19px;
  font-weight: 800;
  color: #3ef0ff;
  line-height: 1.1;
  text-align: right;
}

@keyframes hw-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ===== สไลด์โปรโมชั่น ===== */
.hw-promo {
  box-sizing: border-box;
  width: 100%;
  margin: 10px 0 14px;
}
.hw-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 8px;
  color: #fff;
}
.hw-section-head__title { font-size: 16px; font-weight: 700; }
.hw-section-head__title i { margin-right: 4px; color: var(--primaroo, #946D33); }
.hw-section-head__more {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}
.hw-section-head__more:hover { color: #fff; text-decoration: none; }
/* Triple Slider — inactive slides โผล่ข้าง + จาง */
.hw-promo__swiper {
  overflow: hidden;
  /* ให้ slide ข้างโผล่ออกมาได้ (Swiper 11 ต้องการ padding เพื่อแสดง overflow) */
  padding: 8px 0 12px !important;
}
.hw-promo__swiper swiper-slide {
  width: 100% !important;
  max-width: 250px !important; /* phone (default) */
  opacity: 0.5;
  transform: scale(0.82);
  transition: opacity 0.35s ease, transform 0.35s ease;
  will-change: opacity, transform;
}
@media (min-width: 481px) {
  .hw-promo__swiper swiper-slide { max-width: 400px !important; } /* tablet */
}
@media (min-width: 769px) {
  .hw-promo__swiper swiper-slide { max-width: 550px !important; } /* desktop */
}
.hw-promo__swiper swiper-slide.swiper-slide-active {
  opacity: 1;
  transform: scale(1);
}
.hw-promo__card { display: block; border-radius: 14px; overflow: hidden; }
.hw-promo__card img {
  display: block;
  width: 100%;
  height: auto;
}

/* ผู้ใช้ตั้งค่าลดการเคลื่อนไหว → หยุดแถบวิ่ง (ยังเลื่อนดูไม่ได้ แต่อ่านรายการแรก ๆ ได้) */
@media (prefers-reduced-motion: reduce) {
  .hw-ticker__track { animation: none; }
}

/* ===== footer ===== */
.hf-footer-container {
  width: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  container-type: inline-size; /* จัดคอลัมน์ตามความกว้างกรอบจริง ไม่ใช่ความกว้างจอ */
}
.hf-footer { max-width: 1140px; margin: 0 auto; padding: 24px 16px 32px; color: #fff; text-align: center; box-sizing: border-box; }
.hf-footer .hf-logo { width: 120px; margin-bottom: 16px; }
.hf-footer .hf-detail { color: rgba(255, 255, 255, 0.75); font-size: 14px; line-height: 1.9; margin-bottom: 24px; }
.hf-footer .hf-title { font-size: 15px; font-weight: 700; letter-spacing: 1px; margin: 20px 0 14px; color: #fff; text-transform: uppercase; }
.hf-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.hf-grid .hf-bank,
.hf-grid .hf-partner { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hf-grid .hf-bank img { width: 70%; height: 70%; object-fit: contain; }
.hf-grid .hf-partner img { width: 100%; height: 100%; object-fit: contain; }
/* แสดง/ซ่อนตามขนาดจอ — mobile ≤ 768px ใช้ marquee / desktop ใช้ grid */
.hf-show-mobile { display: none; }
.hf-show-desktop { display: flex; }
@media (max-width: 768px) {
  .hf-show-mobile { display: block; }
  .hf-show-desktop { display: none !important; }
}

/* Partners marquee — เลื่อนขวา→ซ้ายไม่สิ้นสุด (ใช้ keyframes hw-marquee เดียวกับ ticker) */
.hf-partners-wrap,
.hf-banks-wrap { overflow: hidden; width: 100%; padding: 4px 0; }
.hf-partners-track,
.hf-banks-track {
  display: flex;
  width: max-content;
  animation: hw-marquee 30s linear infinite; /* duration ถูก override ด้วย inline style */
}
.hf-partners-wrap:hover .hf-partners-track,
.hf-banks-wrap:hover .hf-banks-track { animation-play-state: paused; }
.hf-partner-item,
.hf-bank-item {
  flex-shrink: 0;
  width: 44px; height: 44px;
  margin: 0 6px;
  border-radius: 12px;
  overflow: hidden;
}
.hf-partner-item { background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.08); }
.hf-bank-item { display: flex; align-items: center; justify-content: center; }
.hf-partner-item img,
.hf-bank-item img { width: 100%; height: 100%; object-fit: contain; }
.hf-bank-item img { width: 70%; height: 70%; }
.hf-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }
.hf-tags span { font-size: 13px; color: rgba(255, 255, 255, 0.7); }
.hf-copyright { margin-top: 26px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); font-size: 12px; color: rgba(255, 255, 255, 0.55); }

/* กรอบแคบ (default): รายละเอียด / banks / partners / tags / copyright เรียงลงมาทีละแถว */
.hf-middle { display: flex; flex-direction: column; }

/* กรอบกว้าง: banks / partners / tags อยู่แถวเดียวกัน 3 คอลัมน์
   เบราว์เซอร์เก่าที่ไม่รู้จัก @container จะได้แบบเรียงลง ซึ่งยังอ่านได้ปกติ */
@container (min-width: 769px) {
  .hf-footer { padding-left: 24px; padding-right: 24px; }
  .hf-middle { flex-direction: row; align-items: flex-start; justify-content: center; gap: 32px; }
  .hf-middle .hf-col { flex: 1 1 0; min-width: 0; }
}
