/* ===== Reset & Global ===== */
* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%
}

/* ===== Cyber Preloader ===== */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-family: 'Kanit', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  transition: opacity 0.5s ease-out;
  overflow: hidden;
}

#preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Grid Background */
.cyber-grid {
  position: absolute;
  width: 200%;
  height: 200%;
  background-image: 
    linear-gradient(rgba(0, 255, 136, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 136, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: gridMove 20s linear infinite;
  transform: perspective(500px) rotateX(60deg);
  transform-origin: center center;
}

@keyframes gridMove {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}

/* Scanlines */
.scanlines {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    transparent 50%,
    rgba(0, 255, 136, 0.03) 50%
  );
  background-size: 100% 4px;
  animation: scan 8s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  0% { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

/* Neon particles */
.neon-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.neon-particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: #00ff91;
  box-shadow: 0 0 10px #00FF88, 0 0 20px #00FF88;
  animation: floatNeon 15s infinite;
}

@keyframes floatNeon {
  0%, 100% {
    transform: translateY(100vh) translateX(0);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: translateY(-10vh) translateX(100px);
    opacity: 0;
  }
}

/* Main container */
.cyber-container {
  position: relative;
  z-index: 2;
  text-align: center;
}

/* Hexagon frame */
.hex-frame {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 0 auto 40px;
}

.hexagon {
  position: absolute;
  width: 100%;
  height: 100%;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: linear-gradient(135deg, #00ff00, #00FF88);
  animation: rotate3d 4s linear infinite, pulse 2s ease-in-out infinite;
}

.hexagon-inner {
  position: absolute;
  top: 3px;
  left: 3px;
  right: 3px;
  bottom: 3px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes rotate3d {
  0% { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}

@keyframes pulse {
  0%, 100% {
    filter: drop-shadow(0 0 20px #00FF88) drop-shadow(0 0 40px #00ff00);
  }
  50% {
    filter: drop-shadow(0 0 40px #00FF88) drop-shadow(0 0 80px #00ff00);
  }
}

.loader-icon {
  font-size: 60px;
  background: linear-gradient(45deg, #00FF88, #00ff00, #00FF88);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientFlow 3s ease infinite;
}

@keyframes gradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Title with glitch */
.cyber-title {
  position: relative;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 8px;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 20px;
  text-shadow: 
    0 0 10px #00FF88,
    0 0 20px #00FF88,
    0 0 30px #00FF88,
    0 0 40px #00ff00;
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0%, 90%, 100% {
    transform: translate(0);
    text-shadow: 
      0 0 10px #00FF88,
      0 0 20px #00FF88,
      0 0 30px #00FF88,
      0 0 40px #00ff00;
  }
  92% {
    transform: translate(-2px, 2px);
    text-shadow: 
      2px 0 #00ff00,
      -2px 0 #00FF88;
  }
  94% {
    transform: translate(2px, -2px);
    text-shadow: 
      -2px 0 #00ff00,
      2px 0 #00FF88;
  }
}

/* Subtitle */
.cyber-subtitle {
  color: #00FF88;
  font-size: 16px;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 30px;
  animation: flicker 2s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Status text */
.status-text {
  color: #fff;
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 25px;
  opacity: 0.8;
}

/* Progress container */
.cyber-progress {
  width: 400px;
  max-width: 90vw;
  margin: 0 auto;
  position: relative;
}

.progress-outer {
  width: 100%;
  height: 8px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: 
    inset 0 0 10px rgba(0, 255, 136, 0.2),
    0 0 10px rgba(0, 255, 136, 0.2);
}

.progress-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, 
    #00ff00 0%, 
    #00FF88 50%, 
    #00ff00 100%
  );
  background-size: 200% 100%;
  border-radius: 4px;
  animation: neonFlow 2s linear infinite;
  box-shadow: 
    0 0 20px #00FF88,
    0 0 40px #00ff00,
    inset 0 0 10px rgba(255, 255, 255, 0.5);
  transition: width 0.3s ease;
}

@keyframes neonFlow {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.progress-text {
  text-align: center;
  margin-top: 15px;
  color: #00FF88;
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 700;
}

/* Corner decorations */
.corner {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid #00FF88;
  box-shadow: 0 0 10px #00FF88;
}

.corner.top-left {
  top: 20px;
  left: 20px;
  border-right: none;
  border-bottom: none;
}

.corner.top-right {
  top: 20px;
  right: 20px;
  border-left: none;
  border-bottom: none;
}

.corner.bottom-left {
  bottom: 20px;
  left: 20px;
  border-right: none;
  border-top: none;
}

.corner.bottom-right {
  bottom: 20px;
  right: 20px;
  border-left: none;
  border-top: none;
}

/* Responsive */
@media (max-width: 768px) {
  .cyber-title {
    font-size: 32px;
    letter-spacing: 4px;
  }
  .cyber-progress {
    width: 300px;
  }
  .hex-frame {
    width: 140px;
    height: 140px;
  }
  .loader-icon {
    font-size: 45px;
  }
}

/* ลด/ปิดอนิเมชันสำหรับผู้ใช้ที่ตั้งค่าลดการเคลื่อนไหว */
@media (prefers-reduced-motion: reduce) {
  .cyber-grid,
  .scanlines,
  .neon-particle,
  .hexagon,
  .loader-icon,
  .cyber-title,
  .cyber-subtitle,
  .progress-inner {
    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: #120006;

  overflow-x: hidden;
  position: relative;
}

/* เลเยอร์พื้นหลังแบบ fixed (แทนเขียวเป็นแดง) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  /* เน้นแดงเข้ม + แดงสด + เงาดำ */
  background:
    radial-gradient(1200px 700px at 70% -10%, rgba(255, 40, 40, 0.22), transparent 60%),
    radial-gradient(1000px 600px at 5% 120%, rgba(180, 0, 20, 0.18), transparent 62%),
    radial-gradient(900px 520px at 50% 40%, rgba(255, 0, 60, 0.10), transparent 60%),
    linear-gradient(180deg, #2a0008 0%, #120006 45%, #090003 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;
  color: #ffffff;


}

.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: #fce700;
  text-shadow: 0 0 10px rgba(255, 240, 33, 0.5);
  font-weight: 800;
}

.ping-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffde21;
  box-shadow: 0 0 12px rgba(255, 229, 33, 0.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%;
  aspect-ratio: 1536 / 672; 
  margin: 12px auto 0;
  overflow: hidden;
  border-radius: 14px;
  position: relative;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
/* สำหรับจอเล็ก รูปจะเต็มความกว้าง */
@media (min-width: 768px) {
  .slider {
    max-width: 900px; 
  }
}

/* ขยับภาพเป็นสไลด์ */
.slides {
  display: flex;
  width: 100%;
  height: 100%;
  animation: slideShow 24s infinite;
}

/* รูปภาพ */
.slides img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}


/* Animation ใหม่ รองรับ 5 รูป */
@keyframes slideShow {
  0% { transform: translateX(0%); }
  18% { transform: translateX(0%); }

  20% { transform: translateX(-100%); }
  38% { transform: translateX(-100%); }

  40% { transform: translateX(-200%); }
  58% { transform: translateX(-200%); }

  60% { transform: translateX(-300%); }
  78% { 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;
}

.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(200deg, #b00000 0%, #ff2a2a 48%, #ff6a2a 100%);
  box-shadow:
    0 6px 20px rgba(160, 0, 0, 0.55),
    0 0 30px rgba(255, 45, 45, 0.45);

  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, filter .2s ease;
}

/* ✅ แสงไฮไลต์วิ่ง (ปรับเป็นโทนแดง) */
.sticky-cta .cta-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
      rgba(255, 0, 0, 0) 0%,
      rgba(255, 0, 0, 0.25) 40%,
      rgba(255, 170, 120, 0.55) 50%,
      rgba(255, 0, 0, 0.25) 60%,
      rgba(255, 0, 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: 800;
  color: #ffe36a; /* ทอง */
  margin-top: 2px;
}

/* Hover / Active */
.sticky-cta .cta-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 10px 28px rgba(190, 0, 0, 0.75),
    0 0 40px rgba(255, 45, 45, 0.65),
    0 0 60px rgba(255, 120, 80, 0.35);
  filter: brightness(1.06);
}

.sticky-cta .cta-btn:active {
  transform: translateY(0) scale(0.98);
  filter: brightness(0.98);
}


@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: #000000;
  /* ข้อความแดง */
  margin-top: 2px;
}

/* Hover / Active */
.sticky-cta .cta-btn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 10px 28px rgba(128, 0, 0, 0.9),
    0 0 40px rgba(255, 0, 0, 0.7),
    0 0 60px rgba(100, 0, 0, 0.5);
}

.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 #ff0000, 0 0 36px #ff8800, 0 0 56px #ffff00;
}

@keyframes rgbBorder {
  0% {
    box-shadow: 0 0 2px #ff0000, 0 0 4px #ff0000, 0 0 6px #ff0000;
    border: 2px solid #ff0000;
  }

  16.6% {
    box-shadow: 0 0 2px #ff8800, 0 0 5px #ff8800, 0 0 7px #ff8800;
    border: 2px solid #ff8800;
  }

  33.3% {
    box-shadow: 0 0 2px #ffff00, 0 0 5px #ffff00, 0 0 7px #ffff00;
    border: 2px solid #ffff00;
  }

  50% {
    box-shadow: 0 0 2px #00ff00, 0 0 5px #00ff00, 0 0 7px #00ff00;
    border: 2px solid #00ff00;
  }

  66.6% {
    box-shadow: 0 0 2px #0088ff, 0 0 5px #0088ff, 0 0 7px #0088ff;
    border: 2px solid #0088ff;
  }

  83.3% {
    box-shadow: 0 0 2px #8800ff, 0 0 5px #8800ff, 0 0 7px #8800ff;
    border: 2px solid #8800ff;
  }

  100% {
    box-shadow: 0 0 2px #ff0000, 0 0 4px #ff0000, 0 0 6px #ff0000;
    border: 2px solid #ff0000;
  }
}



/* ====== กล่องแจ้งเตือนล่าสุด ====== */
.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, #8c0000, #4d0000);
  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, #8c0000, #4d0000);
}


/* พื้นหลังของ 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: #fff8f8;
  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: #ffea00;
  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
}