/* ===== Reset & Global ===== */
* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%
}

/* Preloader overlay */
#preloader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #0b0b0f;
  /* พื้นหลังมืด */
  z-index: 9999;
  font-family: 'Kanit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

#preloader i {
  font-size: 130px;
  color: #00e7ff;
  text-shadow: 0 0 12px rgba(0, 231, 255, .8);
  margin-bottom: 18px;
}

.pre-msg {
  font-size: 1.2rem;
  font-weight: 700;
  color: #00ffd5;
  text-shadow: 0 0 10px rgba(0, 255, 180, .6);
}

/* ลด/ปิดอนิเมชันสำหรับผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว */
@media (prefers-reduced-motion: reduce) {
  #preloader i {
    animation: none !important;
  }
}



/* ===== Background แบบเสถียร ไม่เกิดเส้นคั่น ===== */
body {
  margin: 0;
  font-family: 'Kanit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: #eaf1ff;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  background: #0a1415;
  /* สีฐานทึบ */
  overflow-x: hidden;
  position: relative;
}

/* ชั้นเดียว ครอบทั้ง viewport แบบ fixed */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 700px at 70% -10%, rgba(0, 195, 255, 0.18), transparent 60%),
    radial-gradient(1000px 600px at 5% 120%, rgba(0, 229, 255, 0.12), transparent 60%),
    linear-gradient(180deg, #810000 0%, #ca0000 50%, #960000 100%);
  background-repeat: no-repeat;
  will-change: transform;
}

/* ปิดเลเยอร์ตกแต่งที่ทำให้เกิดเส้นคั่น */
body::after {
  display: none !important;
}

/* ===== Mobile container (ล็อกเป็นมือถือเสมอ) ===== */
.phone {
  width: 414px;
  max-width: 100vw;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: 35px;
}

/* ===== THEME ===== */
:root {
  --panel: #0f1126;
  --glass: rgba(17, 19, 42, .55);
  --border: #252b52;
  --text-muted: #9aa3c6;
  --accent1: #7a5cff;
  --accent2: #00e7ff;
  /* default */
}

body[data-theme="pg"] {
  --accent1: #00ffd5;
  --accent2: #a9ff2f;
}

body[data-theme="pp"] {
  --accent1: #00ffd5;
  --accent2: #a9ff2f;
}

/* ===== Header ===== */
.logo-top {
  display: block;
  margin: 32px auto 8px;
  width: 250px;
  height: auto;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .35));
  animation: floatLogo 2s ease-in-out infinite;
}

@keyframes floatLogo {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

header {
  text-align: center;
  padding: 0 14px
}

header h1 {
  margin: 0;
  font-weight: 800;
  font-size: 22px;

  /* Gradient text */
  background: linear-gradient(90deg,
      #ffee00 0%,
      #fffb00 50%,
      #ffe600 100%);
  -webkit-background-clip: text;
  background-clip: text;

  /* Transparent text to show gradient */
  -webkit-text-fill-color: transparent;
  color: transparent;

  /* Glow effect */
  text-shadow:
    0 0 12px rgba(0, 255, 76, 0.4),
    0 0 20px rgba(9, 255, 0, 0.25);
}

.online-bar {
  width: min(640px, 92%);
  margin: 8px auto 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #11142a, #0f1b35);
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05);
  color: #dfe7ff;
  text-align: center;
  font-weight: 700;
  letter-spacing: .2px;
  position: relative;
}

.online-bar strong {
  color: #21ffc3;
  text-shadow: 0 0 10px rgba(33, 255, 195, .5);
  font-weight: 800;
}

.ping-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #21ffc3;
  box-shadow: 0 0 12px rgba(33, 255, 195, .9);
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  animation: pulse 1.4s infinite ease-in-out;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(.9);
    opacity: .9
  }

  50% {
    transform: scale(1.15);
    opacity: 1
  }
}


.promo-slider-wrapper{
  margin:16px auto;
  padding:0 10px;
}

/* กล่องสไลด์: ให้เต็มความกว้างที่มี แล้วคุมอัตราส่วน */
.slider{
  width:100%;
  max-width: 100%;      /* <-- ยกเลิก 414px */
  aspect-ratio: 7/4;
  margin:12px auto 0;
  overflow:hidden;
  border-radius:14px;
  position:relative;
  box-shadow:0 6px 18px rgba(0,0,0,.35);
}

/* ถ้าต้องการจำกัดแค่บนเดสก์ท็อป ค่อยคุมด้วย media query */
@media (min-width: 768px){
  .slider{ max-width: 900px; } /* ปรับตามต้องการ */
}

/* แถบสไลด์ */
.slides{ display:flex; height:100%; width:100%; animation:slider-autoplay 20s infinite; }
.slide{ flex:0 0 100%; height:100%; }
.slides img{ width:100%; height: 260px;; object-fit:cover; display:block; }


/* เลื่อนทีละรูป (0, -100, -200, -300, -400%) */
@keyframes slider-autoplay {
  0% {
    transform: translateX(0%);
  }

  16% {
    transform: translateX(0%);
  }

  20% {
    transform: translateX(-100%);
  }

  36% {
    transform: translateX(-100%);
  }

  40% {
    transform: translateX(-200%);
  }

  56% {
    transform: translateX(-200%);
  }

  60% {
    transform: translateX(-300%);
  }

  76% {
    transform: translateX(-300%);
  }

  80% {
    transform: translateX(-400%);
  }

  100% {
    transform: translateX(-400%);
  }
}



/* ===== Sticky CTA ปุ่มลอย ===== */
.sticky-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 20px;
  /* ยกขึ้นจากขอบเล็กน้อย */
  z-index: 9999;
  display: flex;
  justify-content: center;
  pointer-events: none;
  /* กันไม่ให้ container block การคลิกนอกปุ่ม */
}

.sticky-cta .cta-btn {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  width: min(410px, 90vw);
  min-height: 60px;
  padding: 10px 20px;
  border-radius: 20px;
  text-decoration: none;

  background: linear-gradient(90deg, #389900 0%, #00a708 50%, #00721d 100%);
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.6);

  color: #ffffff;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-weight: 800;
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .2s ease;
}

/* แสงไฮไลต์วิ่ง */
.sticky-cta .cta-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
      rgba(136, 255, 0, 0) 0%,
      rgba(136, 255, 0, 0.3) 40%,
      rgba(0, 255, 100, 0.6) 50%,
      rgba(136, 255, 0, 0.3) 60%,
      rgba(136, 255, 0, 0) 100%);
  filter: blur(12px);
  /* เบลอให้ฟุ้ง */
  transform: translateX(-120%) skewX(-15deg);
  opacity: 0;
  animation: sweepSmooth 4s ease-in-out infinite;
}

@keyframes sweepSmooth {
  0% {
    transform: translateX(-120%) skewX(-15deg);
    opacity: 0;
  }

  15% {
    opacity: 1;
  }

  50% {
    transform: translateX(120%) skewX(-15deg);
    opacity: 1;
  }

  85% {
    opacity: 0.6;
  }

  100% {
    transform: translateX(120%) skewX(-15deg);
    opacity: 0;
  }
}


/* ข้อความหลัก/รอง */
.sticky-cta .cta-btn .main-text {
  font-size: 18px;
  line-height: 1.2;
}

.sticky-cta .cta-btn .sub-text {
  font-size: 16px;
  font-weight: 700;
  color: #ff0000;
  /* ข้อความแดง */
  margin-top: 2px;
}

/* Hover / Active */
.sticky-cta .cta-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 10px 28px rgba(94, 255, 0, 0.75),

}

.sticky-cta .cta-btn:active {
  transform: translateY(0) scale(0.98);
}


/* ===== PG slider (auto-loop) ===== */
.pg-slider-wrapper {
  margin: 14px auto 6px;
  padding: 0 8px;
}

.pg-slider {
  width: 100%;
  max-width: 414px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

.pg-track {
  display: flex;
  align-items: stretch;
  gap: 10px;
  will-change: transform;
}

.pg-card {
  flex: 0 0 140px;
  /* ความกว้างการ์ด */
  background: #111426;
  border: 1px solid #2a2f4f;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
  position: relative;
}

.pg-card .pg-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

/* ป้าย % ที่มุมภาพ (เห็นชัด) */
.pct-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
  color: #0b0f17;
  border-radius: 999px;
  background: #9ad1ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.pg-card.hot .pct-badge {
  background: #20ff93;
  color: #00170f;
}

.pg-card.warm .pct-badge {
  background: #ffd257;
  color: #2a1b00;
}

.pg-card.cold .pct-badge {
  background: #ff7aa5;
  color: #2a0010;
}

/* หลอดใต้ภาพ */
.pg-card .meter {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  height: 18px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .6);
  border: 1px solid rgba(255, 255, 255, .15);
  overflow: hidden;
  box-shadow: 0 0 10px rgba(0, 0, 0, .7), inset 0 1px 2px rgba(0, 0, 0, .5);
}

.pg-card .meter-fill {
  height: 100%;
  width: 0%;
  transition: width .25s linear;
}

.pg-card .meter-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 6px rgba(0, 0, 0, .9);
  pointer-events: none;
}

/* สีหลอด */
.pg-card .meter-fill.hot {
  background: linear-gradient(90deg, #20ff93, #00d2ff);
  box-shadow: 0 0 20px rgba(0, 255, 180, .9);
}

.pg-card .meter-fill.warm {
  background: linear-gradient(90deg, #ffd257, #ff9f3f);
  box-shadow: 0 0 20px rgba(255, 175, 50, .9);
}

.pg-card .meter-fill.cold {
  background: linear-gradient(90deg, #ff7aa5, #ff3b70);
  box-shadow: 0 0 20px rgba(255, 60, 120, .9);
}

/* HOT = กรอบ RGB วน */
/* เมื่อการ์ดร้อน ≥70% ให้ไฟ RGB วนรอบกรอบ */
.pg-card.hot {
  animation: rgbBorder 3s linear infinite;
  border-radius: 12px;
  box-shadow: 0 0 18px #ff0040, 0 0 36px #ff0080, 0 0 56px #ff00ff;
}

@keyframes rgbBorder {
  0% {
    box-shadow: 0 0 2px #ff0040, 0 0 4px #ff0080, 0 0 6px #ff00ff;
    border: 2px solid #ff0040;
  }

  25% {
    box-shadow: 0 0 2px #ff6600, 0 0 5px #ff9900, 0 0 7px #ffff00;
    border: 2px solid #ff9900;
  }

  50% {
    box-shadow: 0 0 2px #20ff93, 0 0 5px #00ffcc, 0 0 7px #00ff88;
    border: 2px solid #20ff93;
  }

  75% {
    box-shadow: 0 0 25x #00aaff, 0 0 5px #0066ff, 0 0 7px #00ffff;
    border: 2px solid #00aaff;
  }

  100% {
    box-shadow: 0 0 2px #ff0040, 0 0 4px #ff0080, 0 0 6px #ff00ff;
    border: 2px solid #ff0040;
  }
}



/* ====== กล่องแจ้งเตือนล่าสุด ====== */
.notifications-wrapper {
  width: 100%;
  max-width: 370px;
  margin: 20px auto;
  border-radius: 14px;
  overflow: hidden;
  background: #101522;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
}

/* ขอบ gradient ด้านล่าง */
.notifications-wrapper::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 12px;
  /* ความหนาเหมือนด้านบน */
  background: linear-gradient(90deg, #ff2d2d, #6e1600);
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
}


/* หัวข้อ */
.notifications-header {
  text-align: center;
  padding: 10px;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
  /* ข้อความขาวชัด */
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #6e1600, #ff0000);
}


/* พื้นหลังของ list */
#notifications {
  background: #1a1c2b;
  padding: 12px;
}

/* การ์ดแจ้งเตือนแต่ละอัน */
.notification {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #23263d;
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: fadeInUp 0.45s ease;
}

/* ไอคอนธนาคาร */
.notification img.icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ข้อความ */
.notification p {
  margin: 2px 0;
  font-size: 13px;
  color: #cfd5f0;
  line-height: 1.4;
}

/* ไฮไลต์ข้อความ */
.notification .highlight {
  color: #f50000;
  font-weight: 700;
}

.status {
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.status.pending {
  color: #ffc107;
  background: rgba(255, 193, 7, .15);
}

.status.success {
  color: #00ff00;
  background: rgba(32, 227, 162, .15);
}


/* แอนิเมชันเลื่อนขึ้น */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ===== Footer ===== */
footer {
  text-align: center;
  margin-top: 50px;
  color: #7f8ba4;
  font-size: 12px
}