/* ===========================
   CSS chung cho toàn ứng dụng
   =========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body {
  background: radial-gradient(circle at top, #1f2933 0, #111827 55%, #020617 100%);
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px;
}

.app-container {
  width: 100%;
  max-width: 1100px;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 16px;
  padding: 24px 24px 32px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.app-header {
  text-align: center;
  margin-bottom: 20px;
}

.app-header h1 {
  font-size: 28px;
  margin-bottom: 8px;
  background: linear-gradient(120deg, #f97316, #facc15);
  -webkit-background-clip: text;
  color: transparent;
}

.app-header p {
  color: #9ca3af;
  font-size: 14px;
}

.upload-section,
.table-section,
.lottery-section {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(17, 24, 39, 0.9));
  border: 1px solid rgba(55, 65, 81, 0.9);
}

.upload-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Nút upload file đẹp hơn */
.file-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: linear-gradient(120deg, #1d4ed8, #22c55e);
  color: #f9fafb;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  align-self: flex-start;
  box-shadow: 0 10px 25px rgba(34, 197, 94, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.file-label:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(59, 130, 246, 0.4);
}

.file-label:active {
  transform: translateY(0);
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.25);
}

.file-label input[type="file"] {
  display: none;
}

.file-info {
  font-size: 13px;
  color: #9ca3af;
}

.table-section h2,
.lottery-section h2,
.results-section h3 {
  font-size: 18px;
  margin-bottom: 10px;
  color: #e5e7eb;
}

.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.table-wrapper {
  max-height: 260px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid rgba(55, 65, 81, 0.9);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead {
  background: linear-gradient(135deg, #0f172a, #020617);
  position: sticky;
  top: 0;
  z-index: 1;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(55, 65, 81, 0.7);
  text-align: left;
}

tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.9);
}

tbody tr:nth-child(odd) {
  background: rgba(17, 24, 39, 0.9);
}

.stats {
  margin-top: 8px;
  font-size: 13px;
  color: #9ca3af;
}

.lottery-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lottery-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: radial-gradient(circle at top, #1d4ed8 0, #020617 60%);
  border-radius: 20px;
  /* Tăng kích thước tổng thể khung hiển thị lên ~3 lần */
  padding: 32px 40px;
  border: 1px solid rgba(59, 130, 246, 0.9);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.5);
}

.lottery-label {
  /* Tăng cỡ chữ nhãn "Đang quay:" lên ~3 lần */
  font-size: 42px;
  color: #e5e7eb;
}

.lottery-code {
  flex: 1;
  /* Tăng cỡ chữ mã hiển thị lên ~3 lần */
  font-size: 96px;
  font-weight: 700;
  letter-spacing: 2px;
  text-align: center;
  color: #facc15;
  text-shadow: 0 0 15px rgba(250, 204, 21, 0.9);
}

.btn-primary {
  align-self: center;
  /* Tăng kích thước nút lên ~3 lần */
  padding: 24px 72px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(120deg, #f97316, #facc15);
  color: #111827;
  font-weight: 700;
  /* Tăng kích thước chữ lên ~3 lần */
  font-size: 45px;
  cursor: pointer;
  box-shadow: 0 16px 35px rgba(248, 153, 33, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.1s ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 20px 40px rgba(251, 191, 36, 0.7);
  filter: brightness(1.05);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 10px 25px rgba(234, 88, 12, 0.6);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-secondary {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.8);
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    transform 0.1s ease;
}

.btn-secondary:hover {
  background: rgba(30, 64, 175, 0.8);
  border-color: rgba(59, 130, 246, 0.9);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

.note {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

.results-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(55, 65, 81, 0.8);
}

.prize-group {
  margin-top: 8px;
}

.prize-group h4 {
  font-size: 14px;
  margin-bottom: 4px;
  color: #e5e7eb;
}

.winners-list {
  margin-top: 6px;
  padding-left: 0;
  max-height: 220px;
  overflow: auto;
  font-size: 14px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* "Quả bóng" kết quả trúng thưởng */
.winners-list li {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #0f172a;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(15, 23, 42, 0.9);
  text-align: center;
  padding: 4px;
}

/* Mỗi bóng 1 màu khác nhau (lặp lại theo chu kỳ) */
.winners-list li:nth-child(6n + 1) {
  background: radial-gradient(circle at 30% 30%, #facc15, #f97316);
}

.winners-list li:nth-child(6n + 2) {
  background: radial-gradient(circle at 30% 30%, #4ade80, #16a34a);
}

.winners-list li:nth-child(6n + 3) {
  background: radial-gradient(circle at 30% 30%, #60a5fa, #2563eb);
}

.winners-list li:nth-child(6n + 4) {
  background: radial-gradient(circle at 30% 30%, #a855f7, #7c3aed);
}

.winners-list li:nth-child(6n + 5) {
  background: radial-gradient(circle at 30% 30%, #fb7185, #e11d48);
}

.winners-list li:nth-child(6n) {
  background: radial-gradient(circle at 30% 30%, #2dd4bf, #0f766e);
}

/* Hiệu ứng khi đang quay: rung + nhấp nháy nhẹ */
.lottery-code.spinning {
  animation: spinPulse 0.15s linear infinite;
}

@keyframes spinPulse {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}

/* Responsive cho màn hình nhỏ */
@media (max-width: 768px) {
  .app-container {
    padding: 16px 14px 22px;
  }

  .app-header h1 {
    font-size: 22px;
  }

  .lottery-code {
    font-size: 26px;
  }
}


