@charset "UTF-8";
/* CSS Document */

body.lottery-bg {
  background: linear-gradient(135deg, #1d2671, #CC0000);
  font-family: Arial, sans-serif;
  color: white;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}
body, .main-wrapper {
  position: relative;
}
.container {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  padding: 20px;
  height: calc(100vh); /* 40px trừ padding body nếu có */
  box-sizing: border-box;
  overflow: hidden;
}
.left, .center, .right {
  overflow-y: auto;
  padding: 15px;
  box-sizing: border-box;
}
.left, .right {
  width: 27%;
  padding: 15px;
  background: rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  overflow-y: auto;
}

.center {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: start;
  padding: 30px;
  background: url('../img/spin-bg.jpg') center center/cover no-repeat;
  margin: 0 15px;
  border-radius: 10px;
  text-align: center;
  position: relative;
}

h3 {
  text-align: center;
  font-family: 'Lobster', 'Poppins', cursive, sans-serif;
  font-size: 22px;
  color: #ffffff;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

/* ====== Logo chung của hệ thống ====== */
.logo-container {
  position: absolute;
  top: 30px; /* tuỳ chỉnh khoảng cách từ mép trên */
  left: 430px;
  z-index: 1000; /* đảm bảo nổi trên nền quay */
  pointer-events: none; /* nếu không cần click */
}

.logo {
  display: block;
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 12px;
}

.logo {
  display: block;
  width: 90px;
  height: 90px;
  object-fit: contain;
  border-radius: 12px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  padding: 2px; /* giảm padding nếu cần sát hơn */
  
  /* Sát trên và lệch trái */
  margin-top: 2px; /* đẩy sát hoàn toàn */
  margin-left: 5px; /* lệch trái nhẹ */
  margin-right: auto; /* giữ lệch trái */
}


/* Khi có hiệu ứng như upload logo mới */
.logo.updated {
  animation: pulseLogo 0.5s ease;
}

/* Hiệu ứng rung nhẹ khi update */
@keyframes pulseLogo {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.center .logo {
  position: relative;
  z-index: 10;
  margin-top: 20px;
}

/* ====== Prize Card Chung ====== */
.prize-list {
  background: linear-gradient(135deg, #8e2de2, #4a00e0, #1f1c2c);
  border-radius: 10px;
  min-height: 400px;
  padding: 10px;
  max-height: 100vh;
  overflow-y: auto;
}

.prize-card {
  display: flex;
  align-items: center;
  background: #FFCCCC;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
  color: #333399;
  gap: 10px;
  position: relative;
}

/* ====== Ảnh giải thưởng ====== */
.prize-img-box {
  flex: 0 0 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.3);
}

.prize-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.prize-img:hover {
  transform: scale(1.2);
}

/* ====== Thông tin giải ====== */
.prize-info {
  flex: 1;
  font-size: 14px;
  line-height: 1.8;
  font-family: 'Tahoma', Arial, sans-serif;
}

.prize-info strong {
  font-size: 15px;
  color: #000;
}
.prize-list::-webkit-scrollbar {
  width: 6px;
}
.prize-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 10px;
}

/* Special prize */
.special-prize {
  border: 2px solid gold;
  box-shadow: 0 0 10px gold;
  transition: all 0.3s ease;
}

.special-prize:hover {
  box-shadow: 0 0 18px gold, 0 0 8px #fff;
  transform: scale(1.02);
}

/* Prize hết quà */
.prize-soldout {
  opacity: 0.6;
  pointer-events: none; /* không cho click chọn nữa */
  filter: grayscale(30%); /* tuỳ chọn: hơi làm mờ ảnh nếu thích */
  background: #CCCCCC;
}

/* Optional: Thẻ hết giải có hiệu ứng nhấp nháy nhẹ */
.prize-soldout.blinking {
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.soldout-note {
  color: red;
  font-size: 14px;
  font-weight: bold;
  margin-top: 4px;
}

/* Prize selected *//* Khi được chọn */
.prize-card.selected {
  border: 2px solid #ffd700;
  box-shadow: 0 0 15px #ffd700;
  transform: scale(1.03);
  transition: all 0.3s ease;
}

/* Label Special */
.label-special {
  position: absolute;
  top: 2px;
  left: 2px;
  color: #000;
  font-weight: bold;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 6px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
}

.special-icon {
  font-size: 18px;
}

/* SweetAlert title */
.swal2-title {
  font-family: 'Poppins', 'Lobster', sans-serif;
}

/* Tabs */
.tabs-prize {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 8px;
}

.tab-link {
  flex: 1 1 auto;
  min-width: 80px;
  padding: 6px 10px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: #f1f1f1;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Montserrat', sans-serif;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
}

.tab-link:hover {
  background: rgba(255,255,255,0.3);
  transition: all 0.3s ease;
}

.tab-link.active {
  background: #ffc107;
  color: #222;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(255, 193, 7, 0.8);
}
.tab-link[style*="display: none"] {
  visibility: hidden;
  width: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}
.tab-prize-content {
  display: none;
  margin-top: 10px;
}

.tab-prize-content.active {
  display: block;
}

/* Winner Popup */
.winner-popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.winner-popup-content {
  background: #FFFFCC;
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  font-family: "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  box-shadow: 0 0 12px rgba(0,0,0,0.4);
  animation: popupIn 0.5s ease;
}

@keyframes popupIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* VÙNG LỊCH SỬ QUAY Ở CỘT GIỮA */
.winner-history-box {
  max-height: 230px;
  overflow-y: auto;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-size: 14px;
  margin-top: 8px;
  line-height: 1.5;
  width: 100%; /* 👈 mở rộng tối đa theo vùng cha */
  box-sizing: border-box; /* đảm bảo padding không làm tràn */
  color: #fff;
}

.winner-history-box::-webkit-scrollbar {
  width: 6px;
}
.winner-history-box::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.5);
  border-radius: 4px;
}
/* Giao diện tiêu đề lịch sử */
.winner-history-title {
  color: #fff;
  font-size: 18px;
  margin-bottom: 6px;
  font-weight: bold;
  text-align: center;
  width: 100%; /* 👈 mở rộng tối đa theo vùng*/
}
.history-item {
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255,255,255,0.3);
  font-size: 13px;
  color: #fff;
}

/* BẢNG DANH SÁCH TRÚNG THƯỞNG Ở CỘT PHẢI */
.winner-table-container {
  max-height: 430px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  color: #F3EFEF;
}

.winner-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Montserrat', sans-serif;
}

.winner-table th,
.winner-table td {
  padding: 10px 6px;
  text-align: center;
  border-bottom: 1px solid #ddd;
  background: rgba(255, 255, 255, 0.05); /* 👈 nền mờ giúp phân biệt */
  color: #fff; /* 👈 đảm bảo chữ trắng hiển thị rõ */
}

.winner-table th {
  background: linear-gradient(to right, #6a11cb, #2575fc);
  color: #fff;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 14px;
}

.winner-table tr:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

/* Hiển thị khi đang tải dữ liệu */
.loading-text {
  text-align: center;
  padding: 20px;
  color: gray;
  font-style: italic;
}

/* Hiệu ứng quay QR hoặc icon */
.spin-animate {
  animation: spin 2s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg);}
  100% { transform: rotate(360deg);}
}


/* Fireworks */
.firework {
  width: 8px;
  height: 8px;
  background: red;
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  animation: explode 0.7s forwards;
  z-index: 9999;
}

@keyframes explode {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-overlay.show {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: #fff;
  width: 90%;
  max-width: 900px;
  height: 85%;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.4s ease;
}

.modal-header {
  padding: 10px 20px;
  background: #343a40;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-btn {
  background: transparent;
  color: white;
  font-size: 20px;
  border: none;
  cursor: pointer;
}

/* Bottom Center Button */
.bottom-center {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
}

.btn-config {
  background: #FF0000;
  color: #FFF400;
  padding: 8px 20px;
  font-size: 15px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  width: 130px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.btn-config:hover {
  background: #CC0033;
}

/* Responsive */
@media (max-width: 991px) {
  .container {
    flex-direction: column;
  }
  .left, .right {
    width: 100%;
    margin-bottom: 20px;
  }
}

/* Shiny Text */
.shiny-text {
  background: linear-gradient(90deg, #ffffff, #ffd700, #ffffff);
  background-size: 200% auto;
  color: transparent;
  background-clip: text;
  -webkit-background-clip: text;
  animation: shine 2s linear infinite;
}

@keyframes shine {
  0% { background-position: 200% center; }
  100% { background-position: 0 center; }
}

.spin-control {
  text-align: center;
  margin-top: 20px;
}

#spinBtn {
  background-color: #FF0000;
  color: white;
  font-size: 20px;
  font-weight: bold;
  padding: 14px 25px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0,0,0,0.2);
  transition: background 0.3s, transform 0.2s;
}

#spinBtn:hover {
  background-color: #DD0000;
  transform: scale(1.05);
}

/* Khi nút bị disabled */
#spinBtn:disabled {
  background-color: #6c757d;
  opacity: 0.6;
  cursor: not-allowed;
  transform: scale(0.95); /* Nút thu nhỏ nhẹ khi disable */
}

#spinBtn.loading {
  background-color: #ffc107;
  color: #333;
  transform: none !important; /* ⭐ Không scale khi loading */
  pointer-events: none; /* ⭐ Vô hiệu hover */
}


/* QR Display */
.qr-display {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 65px;
  margin-bottom: 20px;
}

.qr-frame-blue-neon {
  position: relative;
  width: 200px;
  height: 200px;
  padding: 8px;
  border-radius: 16px;
  background: rgba(0, 200, 255, 0.1); /* nền xanh mờ */
  box-shadow:
    0 0 15px rgba(0, 200, 255, 0.6),
    0 0 30px rgba(0, 200, 255, 0.5),
    0 0 60px rgba(0, 200, 255, 0.4),
    0 0 90px rgba(0, 200, 255, 0.3);
  animation: neonPulse 4s ease-in-out infinite;
  overflow: hidden;
}

@keyframes neonPulse {
  0%, 100% {
    box-shadow:
      0 0 15px rgba(0, 200, 255, 0.6),
      0 0 30px rgba(0, 200, 255, 0.5),
      0 0 60px rgba(0, 200, 255, 0.4),
      0 0 90px rgba(0, 200, 255, 0.3);
  }
  50% {
    box-shadow:
      0 0 30px rgba(0, 255, 255, 0.8),
      0 0 60px rgba(0, 255, 255, 0.7),
      0 0 90px rgba(0, 255, 255, 0.6),
      0 0 120px rgba(0, 255, 255, 0.5);
  }
}

.winner-glow {
  animation: neonGlowFast 1.5s ease infinite;
}

@keyframes neonGlowFast {
  0%, 100% {
    box-shadow:
      0 0 20px #00f2fe,
      0 0 40px #4facfe,
      0 0 80px #00f2fe,
      0 0 120px #4facfe;
  }
  50% {
    box-shadow:
      0 0 30px #00f2fe,
      0 0 60px #4facfe,
      0 0 120px #00f2fe,
      0 0 160px #4facfe;
  }
}
/* Winner name spacing */
#winnerName {
  font-size: 28px;
  font-weight: bold;
  margin: 15px 0 5px;
  color: #FFFF00;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Thêm lớp nền mờ xanh cho tên trúng thưởng */
#winnerName::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 128, 255, 0.25); /* màu xanh mờ */
  border-radius: 12px;
  padding: 16px 30px;
  width: 100%;
  max-width: 400px;
  height: 100%;
  z-index: -1;
  box-shadow: 0 0 15px rgba(0, 128, 255, 0.3);
}

#winnerName {
  /* giữ nguyên phần trên */
  text-shadow: 1px 1px 4px #000, 0 0 10px #00ccff;
  animation: winnerGlow 1s ease-in-out infinite alternate;
}

@keyframes winnerGlow {
  0% { text-shadow: 0 0 8px #00ccff, 1px 1px 3px #000; }
  100% { text-shadow: 0 0 16px #00ffff, 2px 2px 5px #000; }
}


#winnerHistory {
flex-shrink: 0;
  flex-grow: 0;
  height: 80px; /* cố định chiều cao */
  overflow-y: auto;
  margin-top: 5px;
  margin-bottom: 8px;
  width: 95%;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  padding: 2px;
}

.history-item {
  padding: 5px 0;
  font-size: 15px;
  color: #66FF00;
}
/* Lịch sử quay hiệu ứng slide */
#winnerHistoryContainer {
  display: none;
  padding-top: 12px;
  opacity: 0;
  transform: translateY(15px);
  transition: all 0.4s ease;
  text-align: center;
  width: 100%; /* hoặc max-width: unset; */
}

#winnerHistoryContainer.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
#winnerHistoryContainer.hidden {
  display: none !important;
}

/* Căn lại phần spin-core hợp lý hơn */
.spin-core {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* 👈 Giữ phần tử gần nhau hơn */
  padding: 15px 0;             /* 👈 Thu nhỏ padding trên/dưới */
  gap: 8px;                    /* 👈 Giảm khoảng cách giữa các phần tử */
}

.no-winner-text {
  color: #777;
  text-align: center;
  margin-top: 20px;
  font-size: 18px;
  font-style: italic;
}
/* Hiệu ứng slide lên từng dòng */
.winner-row {
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.5s forwards;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.winner-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.btn {
  padding: 6px 12px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-toggle {
  background: #17a2b8;
  color: white;
}

.btn-toggle:hover {
  background: #117a8b;
}

.btn-download {
  background: #28a745;
  color: white;
}

.btn-download:hover {
  background: #1e7e34;
}

/* Ramdom Text tên ngươi chơi */
.random-text {
  font-size: 26px;
  font-weight: bold;
  color: #003399; /* Xanh lam */
  -webkit-text-stroke: 0.1px yellow; /* Viền vàng */
  text-stroke: 0.1px yellow; /* Viền vàng (cho các trình duyệt hỗ trợ) */
  text-shadow: 2px 2px 6px rgba(0, 123, 255, 0.7); /* Bóng xanh đậm */
  animation: colorChange 2s infinite alternate ease-in-out;
  text-align: center;
  margin-top: 10px;
}

/* Keyframes để đổi màu nhẹ */
@keyframes colorChange {
  0% {
    color: #2196F3; /* Xanh lam tươi */
    text-shadow: 2px 2px 6px rgba(0, 123, 255, 0.7);
  }
  50% {
    color: #0033CC; /* Xanh lam đậm hơn */
    text-shadow: 2px 2px 8px rgba(0, 86, 179, 0.8);
  }
  100% {
    color: #AA0000;
    text-shadow: 2px 2px 6px rgba(0, 123, 255, 0.7);
  }
}

/* Di chuyển QR */

.qr-scroll-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  display: flex; /* Bắt buộc flex để nối 2 ảnh liên tục */
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-shrink: 0;
  animation: none;
  border-radius: 12px;
}

/* Khi đang quay cực nhanh */
.qr-rolling .qr-image {
  animation: qrSlideLoop 0.03s linear infinite; /* siêu nhanh */
}

/* Băng chuyền loop */
@keyframes qrSlideLoop {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* Khi sắp dừng (thêm 1 state khác nếu cần sau này) */
.qr-slowing .qr-image {
  animation: qrSlideLoop 1.5s linear infinite; /* chạy chậm lại khi sắp trúng */
}

.prize-list, .winner-list {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.spin-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start; /* hoặc center nếu muốn giữ đều */
  height: 100%;
  overflow: hidden;
}

.left::-webkit-scrollbar,
.center::-webkit-scrollbar,
.right::-webkit-scrollbar {
  width: 6px;
}
.left::-webkit-scrollbar-thumb,
.center::-webkit-scrollbar-thumb,
.right::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 6px;
}

/* Đồng hồ đếm giờ */
.countdown-timer.red-alert {
  background: #dc3545 !important; /* Màu đỏ đậm */
  color: #fff;
  font-weight: bold;
  animation: pulseRed 0.5s infinite alternate;
}

/* Hiệu ứng nhấp nháy khi còn 1s */
@keyframes pulseRed {
  from { transform: scale(1); }
  to { transform: scale(1.1); }
}

/* Hiển thị mã để đăng nhập quay thưởng cho mobile */
.mobile-spin-code {
  position: relative;
  background: linear-gradient(135deg, #fffbe6, #fff1cc);
  color: #2c3e50;
  border: 2px dashed #f39c12;
  padding: 16px 12px;
  text-align: center;
  margin: 20px auto;
  border-radius: 12px;
  width: 80%;
  max-width: 320px;
  font-family: 'Poppins', 'Segoe UI', sans-serif;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mobile-spin-code .close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 20px;
  color: #e74c3c;
  cursor: pointer;
  font-weight: bold;
  line-height: 1;
}

.mobile-spin-code .code-label {
  font-weight: 500;
  font-size: 15px;
  margin-bottom: 4px;
}

.code-display {
  font-size: 30px;
  font-weight: 700;
  color: #d35400;
  letter-spacing: 4px;
  font-family: 'Courier New', monospace;
}

/* Thông tin bản quyền */
/* Bản quyền nằm cố định cuối cột trái */
.left {
  position: relative;
}

.left .copyright-note {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 12px;
  color: #3D44DD;
  opacity: 0.7;
  font-style: italic;
}
.left .back-home-btn {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.15);
  padding: 4px 8px;
  border-radius: 6px;
  color: #fff;
  text-decoration: none;
  transition: background 0.3s ease;
}

.left .back-home-btn a {
  color: #BDC510;
  text-decoration: none;
  font-weight: bold;
}

.left .back-home-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

