/* topup.css — หน้าต่างเติมเพชร + หน้าจ่ายเงิน Stripe (Code/TopUp/topup.js) · กรอบใช้ .st-box ของชุด UI ซากุระ (พื้นครีม ขอบทอง)
   จอเกมเป็นแนวนอน → แพ็กเรียงแถวเดียว 5 ช่อง · ตัวหนังสือมีขั้นต่ำเป็น px แบบเดียวกับหน้าอื่น (Beta 0.21.1) */
.tu-box {
  width: min(94vw, 150vh) !important;
  max-height: 90vh;
  display: flex !important; /* .st-box บางหน้าตั้งเป็น grid — หน้านี้เรียงลงล่างคอลัมน์เดียว */
  flex-direction: column;
}
.tu-h {
  display: flex;
  align-items: center;
  gap: 1.6vh;
  margin: 0 0 1.2vh;
  font-size: max(17px, 3.4vh);
  color: #3b4255;
}
.tu-have {
  display: inline-flex;
  align-items: center;
  gap: 0.6vh;
  padding: 0.3vh 1.4vh 0.3vh 0.6vh;
  border-radius: 99px;
  background: #eef6ff;
  border: 0.2vh solid #b9d8f2;
  font-size: max(13px, 2.2vh);
  color: #1c6fa8;
}
.tu-have img {
  width: max(16px, 3vh);
  height: max(16px, 3vh);
  object-fit: contain;
}
.tu-empty {
  text-align: center;
  font-size: max(13px, 2.2vh);
  color: #6b6f80;
  padding: 4vh 0;
}

/* ---------- แพ็ก ---------- */
.tu-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1.4vh;
  overflow-y: auto;
  padding: 1.6vh 0.4vh 0.6vh; /* เผื่อที่ให้ป้าย "คุ้มสุด" ที่ยื่นขึ้นด้านบน */
}
.tu-pack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6vh;
  padding: 2vh 1vh 1.4vh;
  border-radius: 1.6vh;
  border: 0.25vh solid #efe1c2;
  background: linear-gradient(180deg, #fffdf7, #fff1d8);
  box-shadow: 0 0.5vh 0 #e2cfa4;
  font-family: inherit;
  cursor: pointer;
}
.tu-pack:last-child {
  border-color: #f0659a;
  background: linear-gradient(180deg, #fff6fa, #ffe0ec);
  box-shadow: 0 0.5vh 0 #e69ab8;
}
.tu-tag {
  position: absolute;
  top: -1.4vh;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.2vh 1.4vh;
  border-radius: 99px;
  background: linear-gradient(#ff7aa8, #e64d86);
  color: #fff;
  font-style: normal;
  font-weight: 800;
  font-size: max(11px, 1.7vh);
  white-space: nowrap;
}
.tu-gem {
  width: max(56px, 18vh);
  height: max(56px, 18vh);
  object-fit: contain;
  filter: drop-shadow(0 0.6vh 0.8vh #3a8fd055);
}
.tu-amt {
  font-size: max(16px, 3.2vh);
  font-weight: 800;
  color: #1c6fa8;
}
.tu-promo {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 1.2em;
  font-size: max(11px, 1.6vh);
  font-weight: 800;
  color: #e64d86;
  line-height: 1.25;
}
.tu-promo i {
  font-style: normal;
  font-weight: 400;
  color: #b0587a;
}
.tu-price {
  width: 100%;
  margin-top: auto; /* ดันลงล่างสุด — การ์ดที่มีโปรโมชันสูงกว่า ปุ่มราคายังตรงแนวกัน */
  padding: 0.7vh 0;
  border-radius: 1vh;
  background: linear-gradient(#ffd66b, #f0a92c);
  box-shadow: 0 0.35vh 0 #b97a14;
  color: #5a3a00;
  font-weight: 800;
  font-size: max(14px, 2.4vh);
}

/* ---------- ช่องทางชำระเงิน ---------- */
.tu-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1vh;
  margin-top: 1.4vh;
  font-size: max(12px, 1.8vh);
  color: #6b6f80;
}
.tu-ch {
  padding: 0.3vh 1.2vh;
  border-radius: 99px;
  background: #fff;
  border: 0.2vh solid #e3d6b8;
  color: #3b4255;
  font-weight: 700;
}
.tu-soon {
  font-style: normal;
  font-weight: 800;
  color: #e64d86;
}

/* ---------- หน้าจ่ายเงิน (Stripe Embedded Checkout อยู่ใน iframe — พื้นขาวให้ฟอร์มของ Stripe อ่านง่าย) ---------- */
.tu-back {
  margin-right: 0.6vh;
  padding: 0.3vh 1.4vh;
  border: 0.2vh solid #e3d6b8;
  border-radius: 99px;
  background: #fff;
  color: #3b4255;
  font-family: inherit;
  font-weight: 700;
  font-size: max(12px, 1.9vh);
  cursor: pointer;
}
.tu-baht {
  margin-left: auto;
  margin-right: max(44px, 10vh); /* เว้นที่ให้ปุ่มปิด ✕ มุมขวาบน */
  color: #b97a14;
  font-size: max(14px, 2.4vh);
}
.tu-pay {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-radius: 1.4vh;
  background: #fff;
  padding: 1vh;
  -webkit-overflow-scrolling: touch;
}
/* แบบฟอร์มจ่ายเงิน: ซ้ายสรุปแพ็ก · ขวาอีเมล + ช่องทางชำระ + ปุ่มจ่าย — ออกแบบให้จบในจอเดียวบนมือถือแนวนอน */
.tu-paygrid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1.6vh;
  min-height: 0;
}
.tu-sum {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6vh;
  padding: 1.4vh 1vh;
  border-radius: 1.6vh;
  border: 0.25vh solid #efe1c2;
  background: linear-gradient(180deg, #fffdf7, #fff1d8);
  text-align: center;
}
.tu-sum-art {
  width: max(56px, 19vh);
  height: max(56px, 19vh);
  object-fit: contain;
}
.tu-sum-head {
  align-self: flex-start;
  font-size: max(11px, 1.6vh);
  font-weight: 700;
  color: #8a8e9c;
}
/* รายการที่ได้: ไอคอน · ชื่อ · ป้าย (เช่น "โบนัสครั้งแรก") · จำนวน */
.tu-sum-list {
  display: flex;
  flex-direction: column;
  gap: 0.5vh;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tu-sum-list li {
  display: flex;
  flex-wrap: wrap; /* ชื่อยาว + ป้าย ไม่พอบรรทัดเดียว ให้ป้ายลงบรรทัดใหม่ทั้งก้อน ไม่หักคำ */
  align-items: center;
  gap: 0.6vh;
  padding: 0.5vh 1vh;
  border-radius: 1vh;
  background: #fff;
  font-size: max(12px, 2vh);
  color: #3b4255;
}
.tu-sum-list img {
  width: max(16px, 2.8vh);
  height: max(16px, 2.8vh);
  object-fit: contain;
}
.tu-sum-list span {
  white-space: nowrap;
}
.tu-sum-list em {
  white-space: nowrap;
  padding: 0 0.8vh;
  border-radius: 99px;
  background: #ffe0ec;
  color: #e64d86;
  font-style: normal;
  font-weight: 800;
  font-size: max(10px, 1.5vh);
}
.tu-sum-list b {
  margin-left: auto;
  color: #1c6fa8;
  font-weight: 800;
}
.tu-sum-price {
  margin-top: 0.4vh;
  font-weight: 800;
  font-size: max(16px, 3.2vh);
  color: #b97a14;
}
.tu-form {
  display: flex;
  flex-direction: column;
  gap: 1vh;
  min-width: 0;
  padding: 1.2vh 1.4vh;
  border-radius: 1.6vh;
  background: #fff;
}
.tu-email {
  display: flex;
  flex-direction: column;
  gap: 0.4vh;
  font-size: max(12px, 1.9vh);
  font-weight: 700;
  color: #3b4255;
}
.tu-email small {
  font-weight: 400;
  color: #8a8e9c;
}
.tu-email input {
  padding: 0.9vh 1.2vh;
  border: 1px solid #e0e0e6;
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px; /* ต่ำกว่า 16px มือถือ iOS จะซูมหน้าจอตอนแตะ */
  color: #3b4255;
}
.tu-email input:focus {
  outline: 2px solid #f6a8c6;
  border-color: #e64d86;
}
#tu-pe {
  min-height: 6vh;
}
.tu-err {
  min-height: 1.2em;
  margin: 0;
  font-size: max(12px, 1.8vh);
  color: #d33a6a;
}
.tu-err:empty {
  min-height: 0;
}
.tu-paybtn {
  padding: 1vh 0;
  border: 0;
  border-radius: 1vh;
  background: linear-gradient(#ff7aa8, #e64d86);
  box-shadow: 0 0.35vh 0 #b23a68;
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: max(15px, 2.6vh);
  cursor: pointer;
}
.tu-paybtn:disabled {
  opacity: 0.55;
  cursor: default;
}

.tu-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vh;
  padding: 3vh 0 1vh;
  text-align: center;
}
.tu-done img {
  width: max(56px, 14vh);
  height: max(56px, 14vh);
  object-fit: contain;
}
.tu-done b {
  font-size: max(18px, 3.4vh);
  color: #1c6fa8;
}
.tu-done small {
  font-size: max(12px, 1.9vh);
  color: #6b6f80;
}
.tu-ok {
  margin-top: 1vh;
  padding: 0.8vh 5vh;
  border: 0;
  border-radius: 1vh;
  background: linear-gradient(#ffd66b, #f0a92c);
  box-shadow: 0 0.35vh 0 #b97a14;
  color: #5a3a00;
  font-family: inherit;
  font-weight: 800;
  font-size: max(14px, 2.4vh);
  cursor: pointer;
}

/* แถบเพชรบน HUD กดได้ (เดิม cursor: default ใน hud.css) */
.hud .mc-pill.tu-hud {
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .tu-pack {
    transition: transform 0.12s ease;
  }
  .tu-pack:active {
    transform: translateY(0.4vh);
  }
}
