dialog::backdrop {
  background: rgba(0, 0, 0, 0.425);
}

dialog {
  padding: 0px;
  border-radius: 22px;
  border: 0 solid #211e25; 
  background-color: transparent;
}

/* Background overlay - only opacity animation */
.popup-bot {
  opacity: 0;
  background: rgba(0, 0, 0, 0.425);
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Material Design standard easing */
}

.popup-bot.opening {
  opacity: 1;
}

/* Dialog content - opacity and slide animation */
.pufb, .puf {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.4s ease-out, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); /* Overshoot and settle */
}

.opening .pufb, .opening .puf {
  opacity: 1;
  transform: translateY(0);
}

/* Dialog max-height - จำกัดไม่ให้ชนขอบบน */
.pufb,
.puf {
  max-height: calc(100% - 8px) !important;
}

/* iOS Telegram safe area - จำกัด max-height ให้ไม่ชนขอบบน */
html.tg-ios-fullscreen .pufb,
html.tg-ios-fullscreen .puf {
  max-height: calc(100% - var(--tg-content-safe-top, 90px) - 8px) !important;
}

/* Footer spacing - ปรับระยะซ้าย ขวา ล่าง */
@media screen and (max-width: 767px) {
  .ftbar {
    left: 16px !important;
    right: 16px !important;
    bottom: 16px !important;
  }
}

@media screen and (max-width: 479px) {
  .ftbar {
    left: 16px !important;
    right: 16px !important;
  }
}

.gdo {
  background: linear-gradient(to right, white, #ffab59);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}


select.select {
  
  height: 48px; /* ปรับขนาดตามที่ต้องการ */
  line-height: 48px; /* ให้เท่ากับ height เพื่อจัดกลางแนวตั้ง */

  text-align: center;
  text-align-last: center;

  padding-bottom: 8px;
}

/* Announcements container padding - desktop only */
@media (min-width: 768px) {
  .announcements-container {
    padding-bottom: 34px !important;
  }
}

/* Custom scrollbar styles for dialog content */
.pufb,
.puf {
  /* Standard scrollbar behavior */
  overflow-y: auto;
  scroll-behavior: smooth;
}

/* Webkit browsers scrollbar - make it minimal */
.pufb::-webkit-scrollbar,
.puf::-webkit-scrollbar {
  width: 6px;
}

.pufb::-webkit-scrollbar-track,
.puf::-webkit-scrollbar-track {
  background: transparent;
}

.pufb::-webkit-scrollbar-thumb,
.puf::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  transition: background 0.2s ease;
}

.pufb::-webkit-scrollbar-thumb:hover,
.puf::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Hide scrollbar by default, show on hover - Edge compatible */
.pufb:not(:hover)::-webkit-scrollbar-thumb,
.puf:not(:hover)::-webkit-scrollbar-thumb {
  background: transparent;
}

.pufb:hover::-webkit-scrollbar-thumb,
.puf:hover::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

/* Firefox scrollbar styles */
.pufb,
.puf {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* ==================== Step Indicator - Version 22 ==================== */

/* วงกลมสีเขียว - step active หรือ complete */
.btmceg22 {
  color: hsla(124, 70.26%, 59.64%, 1.00);
  width: 21px;
  height: 21px;
  position: relative;
}

/* วงกลมสีเทา - step ยังไม่ถึง */
.btmceg22g {
  color: #999;
  width: 21px;
  height: 21px;
  position: relative;
}

/* เส้นสีเขียว - เชื่อม step ที่ผ่านแล้ว */
.line-r-g22 {
  background-color: hsla(124, 70.26%, 59.64%, 1.00);
  justify-content: flex-end;
  align-items: center;
  width: 33%;
  height: 3px;
  display: flex;
  position: absolute;
  inset: 9.5px 0% 0% auto;
}

.line-l-g22 {
  background-color: hsla(124, 70.26%, 59.64%, 1.00);
  justify-content: flex-end;
  align-items: center;
  width: 33%;
  height: 3px;
  display: flex;
  position: absolute;
  inset: 9.5px auto 0% 0%;
}

/* เส้นสีเทา - step ที่ยังไม่ถึง */
.line-r-g222 {
  background-color: #999;
  border-top-left-radius: 3px;
  border-bottom-left-radius: 3px;
  justify-content: flex-end;
  align-items: center;
  width: 33%;
  height: 3px;
  display: flex;
  position: absolute;
  inset: 9.5px 0% 0% auto;
}

.line-l-g222 {
  background-color: #999;
  border-top-right-radius: 3px;
  border-bottom-right-radius: 3px;
  justify-content: flex-end;
  align-items: center;
  width: 33%;
  height: 3px;
  display: flex;
  position: absolute;
  inset: 9.5px auto 0% 0%;
}

/* ข้อความ */
.sstttg {
  color: #e7e7e7;
}

.sstttgg {
  color: hsla(124, 70.26%, 59.64%, 1.00);
}

.ssttt {
  color: #e7e7e7;
}

/* Step ที่คลิกได้ - เพิ่ม cursor pointer */
.step-clickable {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.step-clickable:hover {
  opacity: 0.8;
}

.step-clickable:active {
  opacity: 0.6;
}

@media screen and (max-width: 767px) {
  .line-r-g22, .line-l-g22, .line-r-g222, .line-l-g222 {
    width: 38%;
  }
}

/* Game tabs - glassmorphism effect */
.tab {
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
  transition: all 0.2s ease !important;
}

.tab.select {
  backdrop-filter: blur(10px) brightness(200%) !important;
  -webkit-backdrop-filter: blur(10px) brightness(200%) !important;
}

.tab:not(.provider-tab):hover {
  transform: translateY(-2px) !important;
}

/* Promotion status box - default style */
.promotion-box-style {
  background-color: rgba(12, 15, 20, 0.34) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* Transaction rows - default border */
.rowstate {
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

/* ============================================
   Telegram iOS Fullscreen Safe Area
   ============================================
   CSS Variables (set by JavaScript):
   --tg-safe-top: Notch/Dynamic Island height
   --tg-content-safe-top: Notch + Telegram close button
   --tg-safe-bottom: Bottom safe area
   --tg-content-safe-bottom: Bottom content safe area
   ============================================ */

/* Default values (will be overridden by JavaScript) */
:root {
  --tg-safe-top: 0px;
  --tg-safe-bottom: 0px;
  --tg-content-safe-top: 0px;
  --tg-content-safe-bottom: 0px;
}

/* ===== iOS Telegram Fullscreen Safe Area ===== */

/* 1. Header - เลื่อนลงจากบนตาม safe area */
html.tg-ios-fullscreen .tpbar {
  top: var(--tg-content-safe-top, 90px) !important;
}

/* 2. Body - เว้นระยะบนตาม safe area */
html.tg-ios-fullscreen body {
  padding-top: var(--tg-content-safe-top, 90px) !important;
}

/* 3. Landscape mode - เว้นระยะซ้ายขวาสำหรับ notch */
@media screen and (orientation: landscape) {
  /* Header content */
  html.tg-ios-fullscreen .tpbar .bftp {
    padding-left: calc(var(--tg-content-safe-left, 0px) + 24px) !important;
    padding-right: calc(var(--tg-content-safe-right, 0px) + 24px) !important;
  }

  /* Main content */
  html.tg-ios-fullscreen .ctf {
    margin-left: var(--tg-content-safe-left, 0px) !important;
    margin-right: var(--tg-content-safe-right, 0px) !important;
  }

  /* Footer content - ซ่อนเมื่อเป็น Telegram iOS fullscreen เพราะใช้ BackButton แทน */
  html.tg-ios-fullscreen .ftbar {
    display: none !important;
  }
}

/* 4. Dialog - เว้นระยะบนสำหรับ safe area */
html.tg-ios-fullscreen .popup-bot,
html.tg-ios-fullscreen .popup-bot.opening {
  padding-top: 90px !important;
  align-items: flex-start !important;
}

html.tg-ios-fullscreen .popup-bot .pufb,
html.tg-ios-fullscreen .popup-bot .puf {
  margin-top: 20px !important;
}

/* Wrapper ครอบ safe-area-bar และ header - สำหรับ Telegram iOS */
/* z-index ต้องน้อยกว่า dialog (20-25), popup (900+), game-dialog (9999) */
#tg-header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  background: #1a1a1a;
}

/* แถบ safe area ด้านบน */
#tg-header-wrapper #tg-safe-area-bar {
  height: var(--tg-content-safe-top, 90px);
  flex-shrink: 0;
  pointer-events: none;
}

/* Header ใน wrapper ต้องไม่เป็น fixed และไม่มี background */
#tg-header-wrapper .tpbar {
  position: relative !important;
  top: auto !important;
  background: transparent !important;
}

/* ซ่อน wrapper เมื่อ game dialog เปิด */
body:has(.game-dialog-wrapper) #tg-header-wrapper {
  display: none;
}

/* ==================== Attractive Button Effect ==================== */

/* ย้าย padding จาก container ไปเป็น margin ของ child */
.f-b-l {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: visible !important;
}

.f-b-l > .row-center-input:first-child {
  margin-top: 34px;
}

.f-b-l > .row-center-spt {
  margin-top: 8px;
}

/* ให้ parent elements ทั้งหมดไม่ตัด overflow */
.row-center-input,
.row-center-spt,
.form-wrapper,
.row-info-clean,
.fm40,
.fmb,
.fform {
  overflow: visible !important;
}

/* ====================
   Button Style - Luxury Iridescent
   ==================== */

/* ปุ่มหลัก */
.btn-form {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.25),
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  transition: filter 0.2s ease, box-shadow 0.3s ease;
  -webkit-text-stroke: 0.3px rgba(0, 0, 0, 0.3);
}

/* Luxury Pearl - แสงมุกหรูหรา */
.btn-form::before {
  content: '';
  position: absolute;
  inset: -50%;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    rgba(255, 250, 245, 0.3),
    rgba(255, 220, 200, 0.25),
    rgba(255, 200, 180, 0.2),
    rgba(230, 210, 255, 0.2),
    rgba(200, 220, 255, 0.2),
    rgba(255, 245, 220, 0.25),
    rgba(255, 250, 245, 0.3)
  );
  animation: rainbow-rotate 10s linear infinite;
  filter: blur(20px);
  pointer-events: none;
  z-index: 1;
}

/* Highlight ด้านบน - แสง glass */
.btn-form::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 45%;
  border-radius: inherit;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.18) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

@keyframes rainbow-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Hover */
.btn-form:hover {
  filter: brightness(1.12);
  box-shadow:
    0 4px 25px rgba(0, 0, 0, 0.3),
    0 0 20px rgba(var(--btn-glow-rgb, 138, 92, 246), 0.15),
    0 1px 0 rgba(255, 255, 255, 0.15) inset;
}

.btn-form:hover::before {
  animation: rainbow-rotate 4s linear infinite;
}

/* ปุ่มรอง */
.btn-form-ot {
  position: relative;
  overflow: hidden;
  transition: filter 0.2s ease;
}

.btn-form-ot::before {
  content: '';
  position: absolute;
  inset: -50%;
  border-radius: inherit;
  background: conic-gradient(
    from 0deg,
    rgba(255, 250, 245, 0.15),
    rgba(255, 220, 200, 0.12),
    rgba(230, 210, 255, 0.1),
    rgba(200, 220, 255, 0.1),
    rgba(255, 245, 220, 0.12),
    rgba(255, 250, 245, 0.15)
  );
  animation: rainbow-rotate 14s linear infinite;
  filter: blur(20px);
  pointer-events: none;
}

.btn-form-ot:hover {
  filter: brightness(1.1);
}

.btn-form-ot:hover::before {
  animation: rainbow-rotate 6s linear infinite;
}

/* ปุ่ม Header - ยังไม่เปลี่ยน รอดูผลปุ่ม form ก่อน */
.btnft2-hl:hover,
.btnft2:hover {
  filter: brightness(1.1);
}

