/* Bảng thống kê: header nền xám, chữ đậm, căn giữa */
/* Bảng thống kê: header nền xám, chữ đậm, căn giữa */
table.vietlott-stat-table th,
table.vietlott-stat-table thead th,
table.stat-table th,
table.stat-table thead th {
  background: #eaeaea !important;
  color: #222 !important;
  font-weight: bold !important;
  text-align: center !important;
}
table.vietlott-stat-table td,
table.stat-table td {
  text-align: center !important;
}
/* Đảm bảo bóng số trong panel tool giống bóng số ở tab kết quả */
.vietlott-tool-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
  margin-bottom: 10px;
  margin-top: 8px;
}

/* Số chính: nền xám, chữ đen. Khi chọn: nền đỏ, chữ trắng */
.vietlott-tool-numbers .vietlott-number-ball {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin: 0 4.5px 8px 0;
  border-radius: 50%;
  background: #eaeaea;
  color: #222;
  border: 2px solid #ccc;
  font-size: 1.15rem;
  font-weight: bold;
  text-align: center;
  line-height: 38px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}
.vietlott-tool-numbers .vietlott-number-ball.selected {
  background: #E63946;
  color: #fff;
  border-color: #E63946;
}
/* Số bonus: nền vàng, chữ đen. Khi chọn thêm viền đỏ */
.vietlott-tool-numbers .vietlott-number-ball[data-type="bonus"] {
  background: #ffe259;
  color: #222;
  border: 2px solid #ffd700;
}
.vietlott-tool-numbers .vietlott-number-ball[data-type="bonus"].selected {
  border: 2.5px solid #E63946;
  box-shadow: 0 0 0 2px #ffd700;
}
html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  min-height: 100vh; /* hoặc 100dvh cũng được */
  font-family: 'Inter', 'Roboto', 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1; /* Đảm bảo main đẩy footer xuống cuối */
}

body {
  display: flex;
  flex-direction: column;
}

*, *::before, *::after {
  box-sizing: inherit;
}

/* BG */
body.bg-gradient {
  background: linear-gradient(135deg, #0f2027 0%, #2c5364 50%, #ff512f 100%);
  color: #222;
}

body.dark-mode {
  background: linear-gradient(135deg, #141e30 0%, #243b55 100%);
  color: #b3d1ff;
}

/* Header/Footer */
header, footer {
  background: #E63946;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  text-align: center;
}

footer {
  padding: 1rem 0;
}

.text-gradient {
  background: linear-gradient(90deg, #00c6ff, #ff512f);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.5rem;
}

/* Ball */
.ball-3d, .vietlott-balls {
  display: inline-block;
  width: 42px;
  height: 42px;
  margin: 0 4.5px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff512f 60%, #c31432 100%);
  box-shadow: 0 1.5px 6px rgba(80,0,0,0.18), 0 1.125px 0 #fff2 inset;
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  text-align: center;
  line-height: 42px;
  position: relative;
  overflow: hidden;
}

.ball-3d::before, .vietlott-balls::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 10.5px;
  width: 21px;
  height: 9px;
  background: linear-gradient(90deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.08) 100%);
  border-radius: 50%;
  filter: blur(0.5px);
  opacity: 0.85;
  pointer-events: none;
}

/* Dark Mode */
body.dark-mode .container {
  background: rgba(20,30,48,0.98);
  box-shadow: 0 2px 24px #0005;
  border-radius: 18px;
}

body.dark-mode .nav-tabs,
body.dark-mode .nav-pills {
  background: #1a2940;
  border-radius: 12px;
}

body.dark-mode .nav-tabs .nav-link.active,
body.dark-mode .nav-pills .nav-link.active {
  background: #223a5e;
  color: #6ec6ff;
  border-color: #223a5e #223a5e #1a2940;
}

body.dark-mode .nav-tabs .nav-link,
body.dark-mode .nav-pills .nav-link {
  color: #b3d1ff;
}

body.dark-mode .tab-content {
  background: #18243a;
  border-radius: 12px;
  box-shadow: 0 2px 12px #0002;
}

body.dark-mode .ball-3d {
  background: linear-gradient(145deg, #223a5e 60%, #0a192f 100%);
  color: #6ec6ff;
  box-shadow: 0 2px 8px rgba(30,60,120,0.18), 0 1.5px 0 #fff2 inset;
}

body.dark-mode .ball-3d::before {
  background: linear-gradient(90deg, rgba(110,198,255,0.25) 0%, rgba(110,198,255,0.08) 100%);
}
/* phần dark-mode giữ nguyên */

/* Commons */
footer .container { border-radius: 0 0 18px 18px; }

.vietlott-label {
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.vietlott-label .ball-3d { vertical-align: middle; margin-bottom: 0; }

.tab-pane { margin: 1.5rem 0; }

.footer-bar {
  background: #E63946;
  color: #fff;
  text-align: center;
  padding: 0.5rem 0 0.5rem 0;
  margin-top: auto;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 0 #b80000, 0 0 2px #fff;
}

.footer-bar .container {
  text-align: center; /* Thêm dòng này */
  border-radius: 0 0 18px 18px;
}

.vietlott-number-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 8px;
}

.vietlott-number-ball {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 2px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  background: #f8f8f8;
  transition: all 0.2s;
  font-weight: bold;
}

.vietlott-number-ball.selected {
  background: #E63946;
  color: #fff;
  border-color: #E63946;
}


.vietlott-tool-form {
  margin-top: 1.5rem;
  width: 100%;
}

.vietlott-tool-form .btn-analyze {
  display: inline-block;
  margin-top: 1.2rem;
  background: #E63946;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.vietlott-tool-form .btn-analyze:hover {
  background: #c5303d;
}

.btn-analyze {
  display: inline-block;
  margin-top: 1.2rem;
  background: #E63946;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-analyze:hover {
  background: #c5303d;
}

/* ... giữ nguyên các style còn lại ... */

/* Layout containers */

.container {
  max-width: 900px;  /* cùng max-width với main */
  margin: 0;
  overflow-x: hidden;
  padding: 0.25rem 0.25rem;
  text-align: left;
}


.main-container {
  flex: 1 0 auto;
  max-width: 900px;
  margin: 0;
  padding: 0.25rem 0.25rem;
  overflow-x: hidden;
  text-align: left;
}

/* Header và Footer luôn center */
.header-bar,
.footer-bar {
  text-align: center;
  flex: 0 0 auto; /* Không bị flex co giãn */
}

.header-bar .container,
.footer-bar .container {
  text-align: center;
  padding: 0.25rem 0.25rem;
}

/* Bỏ canh giữa content cho các container/tab/pill/grid */
.vietlott-tab-content-inner-container,
.vietlott-tab-inner,
.vietlott-pill-content,
.vietlott-number-grid {
  text-align: left !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.header-bar .brand {
  display: inline-block; /* Đảm bảo thẻ inline center được */
  margin: 0 auto;
  padding: 0.25rem 0.25rem;
}

.header-bar .brand a {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}


/* Breakpoint gộp */
@media (max-width: 700px) {
  .ball-3d, .vietlott-balls {
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    line-height: 36px;
    margin: 0 3px;
  }
  .ball-3d::before, .vietlott-balls::before {
    top: 5px;
    left: 9px;
    width: 15px;
    height: 6px;
  }
  .footer-bar .container {
    text-align: center;  /* Giữ center khi mobile */
  }
  .main-container { padding: 0.25rem 0.25rem; }
  .header-bar .brand { font-size: 1.2rem; }
  /* Header + Footer luôn center */
  .header-bar,
  .footer-bar {
    text-align: center;
  }

  .header-bar,
  .header-bar .container,
  .footer-bar,
  .footer-bar .container {
    text-align: center;
  }

}
