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