.copy-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #22c55e;
  color: white;
  padding: 14px 28px;
  border-radius: 16px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.copy-toast.show {
  opacity: 1;
}

.my-name-box {
  background: #f0f0f0;
  padding: 16px 14px;
  border-radius: 10px;
  border: 2px solid #00ffff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.my-name-text {
  font-size: 14px;
  line-height: 1.4;
}

.copy-button-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.my-name-box button {
  background: #22c55e;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: background 0.3s ease;
}

.my-name-box button:hover {
  background: #16a34a;
}

/* ✅ เว้นระยะห่างช่องกรอก */
.invite-input-container {
  position: relative; /* ✅ เพื่อให้ toast ตำแหน่งสัมพันธ์กับ input นี้ */
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.invite-input-container input {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  border: 2px solid black;
  border-radius: 12px;
  text-align: center;
}

.toast-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #4ade80;
  color: white;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.toast-message.show {
  opacity: 1;
}

.hidden {
  display: none;
}

.invite-buttons {
  margin-top: 10px;
  display: flex;
  gap: 10px;
}

.invite-buttons button {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 12px;
  border: none;
  cursor: pointer;
}

.invite-buttons button:first-child {
  background: #34d399; /* เขียว */
  color: white;
}

.invite-buttons .cancel {
  background: #f87171; /* แดง */
  color: white;
}

/* 🔘 ปุ่มลอยมุมขวาล่างพร้อมเอฟเฟกต์ */
.floating-invite-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  animation: floatY 3s ease-in-out infinite;
  transition: transform 0.3s ease;
}

.floating-invite-btn:hover {
  transform: scale(1.15) rotate(2deg);
  box-shadow: 0 0 25px rgba(0, 255, 255, 0.9);
}

.floating-invite-btn img {
  width: 50px;
  height: 50px;
  animation: pulseGlow 2s ease-in-out infinite;
}

/* 🔁 ขยับขึ้นลงนิดนึง */
@keyframes floatY {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* 🌟 แสงพุ่งเบา ๆ รอบไอคอน */
@keyframes pulseGlow {
  0%   { filter: drop-shadow(0 0 2px rgba(0,255,255,0.4)); }
  50%  { filter: drop-shadow(0 0 6px rgba(0,255,255,0.8)); }
  100% { filter: drop-shadow(0 0 2px rgba(0,255,255,0.4)); }
}


.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 32, 39, 0.95);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}
.popup-box.error-popup {
  background: #ffffff;
  padding: 30px 20px;
  border-radius: 16px;
  text-align: center;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 0 30px rgba(0,0,0,0.2);
  animation: fadeIn 0.3s ease-out;
}

.popup-icon {
  width: 64px;
  margin-bottom: 16px;
  animation: bounceIn 1s ease;
}

.error-message {
  font-size: 16px;
  color: #d32f2f;
  margin-bottom: 20px;
  font-weight: bold;
}

.btn-error {
  padding: 12px 24px;
  background-color: #4caf50;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-error:hover {
  background-color: #388e3c;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes bounceIn {
  0%   { transform: scale(0.5); opacity: 0; }
  50%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

.popup-box.loader-popup {
  text-align: center;
  position: relative;
  padding: 40px 20px;
  border-radius: 12px;
  width: 90%;
  max-width: 360px;
  background: transparent;
  color: #fff;
}

.loader {
  width: 60px;
  height: 60px;
  border: 8px solid rgba(255,255,255,0.1);
  border-top: 8px solid #00e5ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

.system-name {
  font-size: 16px;
  letter-spacing: 1px;
  color: #00e5ff;
  margin-bottom: 5px;
}

.loading-text {
  font-size: 15px;
  animation: pulse 1.5s infinite;
}

.percent {
  font-size: 20px;
  font-weight: bold;
  margin-top: 8px;
  color: #66ffcc;
}

.energy-lines .line {
  position: absolute;
  bottom: -100px;
  width: 2px;
  height: 100px;
  background: linear-gradient(to top, rgba(0,255,255,0.1), #00ffff, rgba(0,255,255,0));
  animation: energyUp 3s linear infinite;
  opacity: 0.6;
  box-shadow: 0 0 6px rgba(0,255,255,0.5);
}

.energy-lines {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  top: 0; left: 0;
}

.energy-lines .line:nth-child(1) { left: 10%; animation-delay: 0s; }
.energy-lines .line:nth-child(2) { left: 30%; animation-delay: 0.5s; }
.energy-lines .line:nth-child(3) { left: 50%; animation-delay: 1s; }
.energy-lines .line:nth-child(4) { left: 70%; animation-delay: 0.3s; }
.energy-lines .line:nth-child(5) { left: 85%; animation-delay: 0.8s; }
.energy-lines .line:nth-child(6) { left: 95%; animation-delay: 1.2s; }

@keyframes energyUp {
  0% { transform: translateY(0); opacity: 0.1; }
  50% { opacity: 1; }
  100% { transform: translateY(-100vh); opacity: 0; }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.hidden {
  display: none !important;
}

.img {
  width: 300px;
  height: auto;
  border: 3px solid #facc15;     /* สีเหลืองทอง */
  border-radius: 8px;           /* มุมมน */
  padding: 2px;                 /* ระยะห่างในกรอบ */
  background: white;             /* พื้นหลังขาว */
}


.popup-overlay.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
}


/* บังคับ .hidden ซ่อนไว้เสมอ */
.hidden {
  display: none;
  opacity: 0;
  visibility: hidden;
}



#paydayPopup {
  position: fixed;
  inset: 0; /* top: 0; bottom: 0; left: 0; right: 0 */
  background: rgba(0, 0, 0, 0.5);
  display: flex !important;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#paydayPopup .popup-box {
  width: 90%;
  max-width: 400px;
  background: #ffffff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: scaleIn 0.3s ease forwards;
  transform: scale(0.95);
  opacity: 0;
  text-align: center;
}

.coupon-list-popup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 10px 0;
}

.coupon-card-popup {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 10px;
  text-align: center;
  font-size: 12px;
}

.coupon-card-popup img {
  width: 100%;
  max-height: 100px;
  border-radius: 8px;
  object-fit: cover;
}


#confirmPopup {
  z-index: 9999; /* สูงกว่า popup อื่น ๆ */
}


/* ✅ กล่องป็อปอัป สวยขึ้น + มีอนิเมชันขยาย */
.popup-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 20px;
  max-width: 50%;
  width: 300px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: scaleIn 0.3s ease forwards;
  transform: scale(0.95);
  opacity: 0;
}


.popup-box h3 {
  margin-top: 0;
  font-size: 15px;
  color: #333;
}

/* ✅ ปุ่มสวย + เอฟเฟกต์ hover */
.popup-box button {
  margin-top: 16px;
  padding: 12px 24px;
  border: none;
  background: linear-gradient(135deg, #4caf50, #388e3c);
  color: #fff;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
.popup-box button:first-child {
  background-color: #22c55e;
  color: white;
}

.popup-box button.cancel {
  background-color: #ef4444;
  color: white;
}

.popup-box button:hover {
  background: linear-gradient(135deg, #43a047, #2e7d32);
  transform: translateY(-2px);
}

.popup-box button:disabled {
  background: #bdbdbd;
  cursor: not-allowed;
}

/* ✅ Keyframes Animation */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  0% {
    transform: scale(0.9);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}


#claimBtn {
  background-color: #10b981;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  margin-top: 10px;
  cursor: pointer;
}
#claimBtn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

#paydayPopup .popup-box {
  max-width: 300px;
  padding: 20px;
  background: #fff;
  border-radius: 12px;
  text-align: center;
}

.banner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  margin-bottom: 70px; /* ✅ เพิ่มระยะห่างด้านล่าง */
}

.banner-image {
  width: 100%;
  max-width: 380px;
  height: auto;
  border-radius: 20px;
}

.popup-box input {
  width: 100%;
  padding: 10px;
  text-align: center;
  font-size: 12px;
  margin-bottom: 10px;
}


.error {
  color: red;
  margin-top: 10px;
}
/* เมนูหลัก */
.main-menu {
  background: white;
  margin: 16px;
  padding: 16px;
  border-radius: 16px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 16px;
  margin-bottom: 20px;
  animation: fadeIn 0.6s ease-out;
}

/* ไอเท็มแต่ละช่อง */
.menu-item {
  width: 22%;
  text-align: center;
  font-size: 14px;
  color: #333;
  background: #f9f9f9;
  padding: 10px 8px;
  border-radius: 12px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  animation: slideUp 0.6s ease both;
}

/* รูปภาพในเมนู */
.menu-item img {
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  transition: transform 0.3s ease;
}

/* เอฟเฟกต์ Hover */
.menu-item:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  background: #57d725;
}

.menu-item:hover img {
  transform: scale(1.1);
}

/* แอนิเมชัน */
@keyframes fadeIn {
  0% { opacity: 0; transform: scale(0.95); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.marquee {
  width: 100%;
  overflow: hidden;
  padding: 8px 0;
}

.marquee-track {
  display: flex;
  width: fit-content;
  animation: scrollLoop 20s linear infinite;
}

.marquee-content {
  display: flex;
  gap: 12px; /* ✅ ระยะห่างระหว่างรูป */
}

.marquee-content img {
  width: 320px;
  height: 150px;
  object-fit: contain;
}

/* ✅ เคลื่อนจากซ้ายไปขวา (วนลูป) */
@keyframes scrollLoop {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-50%);
  }
}

body {
  background: #ffffff;
  color: #111;
}

body.dark-theme {
  background: #121212;
  color: #e0e0e0;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: white;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #ddd;
  padding: 6px 0;
}

.nav-item {
  text-align: center;
  font-size: 12px;
  color: #666;
}

.nav-item img {
  width: 24px;
  margin-bottom: 4px;
}

.nav-item.active {
  color: #4f46e5;
}
/* กำลังดาวโหลด */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #ffffff;
  border-top: 5px solid #00c853;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ✅ แบนเนอร์ */
.carousel-wrapper {
  overflow: hidden;
  width: 100%;
  border-radius: 12px;
}

.carousel-track {
  display: flex;
  width: max-content;
  animation: scroll-left 30s linear infinite;
}

.carousel-track img {
  width: 100vw;   /* หรือระบุเช่น 320px */
  height: 180px;
  object-fit: cover;
  border-radius: 12px;
  margin-right: 10px;
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}


/* ✅ กรอบคะแนน */
.welcome-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fdffff;
  border: 1px solid #000000;
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px auto;
  max-width: 100%;
  flex-wrap: wrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.left-section {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.logo {
  width: 50px;
  height: auto;
}

.left-section h4 {
  margin: 0;
  font-size: 12px;
  color: #000000;
}

.left-section p {
  font-size: 10px;
  color: #333;
}

.right-section {
  margin-left: auto;
}

.login-btn {
  background-color: #424fde;
  color: rgb(255, 255, 255);
  border: none;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.login-btn:hover {
  background-color: #08bd35;
}

/* ✅ ปุ่ม 2 ปุ่มล่าง */
.two-column-box {
  display: flex;
  background: #2fdfe2;
  padding: 16px;
  border-radius: 50px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  justify-content: space-around;
  align-items: center;
  gap: 16px;
}

.box-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  text-decoration: none; /* ✅ ลบเส้นใต้ */
  color: inherit;         /* ✅ ใช้สีจาก .title/.subtitle ได้ */
}

.box-item img {
  width: 40px;
  height: 40px;
}

.text .title {
  font-weight: bold;
  font-size: 16px;
  color: #111;
}

.text .subtitle {
  font-size: 14px;
  color: #000000;
  margin-top: 2px;
}

.divider {
  width: 1px;
  height: 40px;
  background: #ddd;
}



.popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}


.popup-content {
  background: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
}
.popup-content.large {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 0 10px rgba(0,0,0,0.25);
  width: 100%;
}

/* ช่อง input */
.popup-box input[type="text"] {
  width: 80%; /* ปรับตามต้องการ */
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 12px;
  border: 2px solid #000000;
  margin-bottom: 20px;
  transition: border 0.3s;
  box-sizing: border-box;
}

.popup-box input[type="text"]:focus {
  border-color: #2563eb;
  outline: none;
}

.popup-box .btn-confirm {
  background: linear-gradient(to right, #22c55e, #16a34a);
  color: white;
}

.popup-box .btn-cancel {
  background: #e5e7eb;
  color: #333;
}

.popup-box .btn-confirm:hover {
  background: linear-gradient(to right, #16a34a, #15803d);
}

.popup-box .btn-cancel:hover {
  background: #d1d5db;
}

/* แอนิเมชันเข้า */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
