.body-section {
  margin-top: 82px;
}

.tournament-detail-loading {
  display: flex;
  flex: 1;
  height: 100%;
  justify-content: center;
}

.list-schedules-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 20px;
  transition: all 0.2s ease-in-out;
}

.list-schedules {
  display: flex;
  flex-direction: column;
  min-width: 80%;
  overflow: hidden;
}

.card-schedule {
  min-height: 100px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
  border-radius: 8px;
  overflow: hidden;
  transform: scale(1);
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  cursor: pointer;
  background-color: #f9fafb;
}

.card-schedule:hover {
  transform: scale(0.99);
  box-shadow: 0 0 5px rgba(255, 113, 51, 0.6), 0 0 5px rgba(255, 113, 51, 0.4);
  border-color: #ff7133;
}

.card-overlay {
  background-color: rgba(236, 236, 236, 0.4);
}

#ranking .club-filter__controls {
  margin-bottom: 15px;
}

#ranking .club-filter__controls .club-filter__select {
  padding: 8px;
}

.no-matches {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: #333;
  /* background-color: #f9fafb; */
  border-radius: 12px;
  gap: 16px;
}

.no-matches__image {
  max-width: 100px;
  width: 100%;
  opacity: 0.85;
}

.no-matches__text {
  font-size: 16px;
  font-weight: 500;
  color: #555;
}

.match-sequence {
  min-width: 10%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  background-color: rgba(255, 255, 255, 0.8);
}

.match-sequence-ended {
  background-color: rgba(249, 65, 68, 0.15);
}

.match-sequence-pending {
  background-color: rgba(144, 190, 109, 0.1);
}

.match-sequence-text {
  font-weight: bold;
  font-size: 1.2rem;
}

.schedule-info__status {
  font-size: 0.8rem;
  font-weight: 500;
}

.schedule-info__status_ended {
  color: #f94144;
}
.schedule-info__status_pending {
  color: #32cd32;
}

.card-schedule .player {
  display: flex;
  gap: 8px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  flex: 0 0 35%;
  text-align: center;
  padding: 10px;
  box-sizing: border-box;
}

.player__name {
  font-size: 1.1rem;
  font-weight: 500;
  color: #222;
  text-align: center;
  width: 100%;
  word-break: break-word;
}

.player__rank {
  font-weight: 500;
}

.table-player-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #999;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
}

.table-player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-player-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  white-space: nowrap;
  margin-bottom: -2px;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.table-player-name-text {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tournament-players__row td,
.tournament-players__table__header tr th {
  text-align: center;
}

.tournament-players__table {
  width: 100%;
}

.tournament-players__table tbody tr {
  border-bottom: 1px solid #e0e0e0;
}

.tournament-players__table tbody tr:last-child {
  border-bottom: none;
}

.player-score-winner {
  color: #ffc50f;
}

.player-score-loser {
  color: rgba(169, 169, 169, 0.85);
}

.player img {
  width: 45px;
  height: 30px;
  object-fit: cover;
}

.schedule-content {
  padding: 10px;
  text-align: center;
  flex: 1;
}
.schedule-info {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex: 1;
  padding: 10px;
}

.point-player {
  font-size: 1.8rem;
  font-weight: 500;
}

/* .schedule-info__title {
  }

  .schedule-info__time {
  }

  .schedule-info__location {
  } */

.tab-content {
  display: none;
}
.schedule-info__time {
  white-space: pre-line;
}
.active {
  display: block;
}

.tab-bar {
  display: flex;
  margin-bottom: 20px;
  margin-top: 40px;
  border-bottom: 1px solid #333;
}

.tab-bar .tab {
  border: none;
  border-bottom: 2px solid var(--color-primary);
  text-align: center;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1rem;
  border-radius: 6px 6px 0 0;
}

.tab-bar .active {
  background-color: var(--color-primary);
  color: #fff;
}

#ranking .club-filter__select {
  width: fit-content;
}

.ranking-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: center;
  margin-top: 20px;
  border: 1px solid #333;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 20px;
}

.ranking-table th,
.ranking-table td {
  padding: 10px;
}

.ranking-table thead {
  background-color: #444444;
  color: #fff;
  font-weight: 600;
}

.ranking-table tbody tr:nth-child(even) {
  background-color: #f8fafc;
}

.ranking-table tbody tr {
  transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
}

.ranking-table tbody tr:hover {
  background-color: #efe9e3;
  cursor: pointer;
}

.ranking-table tbody tr:nth-child(even):not(:hover) {
  background-color: #f8fafc;
}

.ranking-empty-state {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: center;
  min-height: auto;
  font-size: 1rem;
}

.bracket-wrapper {
  position: relative;
  width: 100%;
  height: auto;
  min-height: 600px;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0;
  background: #11224e;
  user-select: none;
}

#bracket-container {
  position: relative;
  overflow: visible;
  width: 100%;
  height: 100%;
  min-width: max-content;
  min-height: 600px;
  padding: 20px;
  box-sizing: border-box;
}

#bracket-container:active {
  pointer-events: auto;
}

.pagination-page {
  border: none;
  background: #f2f2f2;
  color: #333;
  margin: 0 4px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.pagination-page.active {
  background-color: #0063af;
  color: white;
  cursor: default;
}

.pagination-page:hover:not(.active) {
  background-color: #e0e0e0;
}

/* Giữ các nút phân trang nằm ngang */
.pagination-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.pagination-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #ccc;
  background-color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.9rem;
  color: #555;
}

/* TOP PLAYER */
.top-3-players {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
}

.top-player-item {
  width: 20%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-weight: 500;
}

.pool-avatar-group {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
  gap: 5px;
}

.pool-player-avatar {
  width: 50px;
  height: 50px;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.pool-player-avatar img {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.top-1-avatar {
  width: 80px;
  height: 80px;
  border: 3px solid rgba(252, 181, 59, 0.8);
  animation: glow 2s infinite alternate;
}

.top-1-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes glow {
  from {
    box-shadow: 0 0 10px 2px rgba(255, 255, 255, 0.1);
  }
  to {
    box-shadow: 0 0 15px 3px rgba(252, 181, 59, 1);
  }
}

.top-2-avatar {
  width: 65px;
  height: 65px;
}

.top-2-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.top-1-icon {
  color: #ffcf19;
}

.top-2-icon {
  color: hsla(0, 0%, 47%, 0.47);
}

.top-3-icon {
  color: #cd8032;
}

.top-player-name {
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  padding: 0 5px;
  font-size: 1.2rem;
  line-height: 1.3;
  margin-bottom: 10px;
}

.top-player-card {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 1.5rem;
}

.player-top-1 {
  background: linear-gradient(rgb(251, 191, 36), rgb(217, 119, 6));
  height: 7rem;
}

.player-top-2 {
  background: linear-gradient(rgb(156, 163, 175), rgb(107, 114, 128));
  height: 6rem;
}

.player-top-3 {
  background: linear-gradient(rgb(245, 158, 11), rgb(180, 83, 9));
  height: 5rem;
}

/* =========================================
    COUNT DOWN TIMER
    ========================================= */

.tournament-countdown {
  display: flex;
  flex-direction: column;
  color: #000;
  margin: 40px 0;
  padding: 0;
}

.tournament-countdown p:first-child {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--color-primary);
}

.countdown-timer {
  display: flex;
  align-items: center;
  font-family: Arial, sans-serif;
}

.countdown-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 5px;
}

.countdown-item span {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-main);
  line-height: 1.1;
  padding: 0 5px;
  font-variant-numeric: tabular-nums;

  display: inline-block;
  text-align: center;
  width: 4rem;
}

.countdown-label {
  position: absolute;
  bottom: -1rem;
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  margin-top: 5px;
}

.countdown-colon {
  font-size: 48px;
  font-weight: 900;
  color: var(--color-main);
  line-height: 1.1;
  margin: 0 2px;
}

/* --- Kiểu cho Modal --- */

/* Lớp phủ toàn màn hình, mặc định bị ẩn */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);

  /* Ẩn modal lúc đầu */
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;

  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 15px;
}

/* Lớp "show" để kích hoạt modal (thêm bằng JS) */
.modal-overlay.show {
  display: flex;
  opacity: 1;
}

/* Nội dung bên trong modal */
.modal-content {
  background: white;
  padding: 25px 30px;
  border-radius: 10px;
  position: relative;
  width: 100%;
  max-width: 500px; /* Giới hạn chiều rộng */
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  color: #333;
}

/* Nút đóng (dấu X) */
.modal-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  background: transparent;
  color: #888;
}
.modal-close:hover {
  color: #000;
}

.modal-content h3 {
  text-align: center;
  margin-top: 0;
  margin-bottom: 20px;
}

/* Header (Trạng thái, thời gian) */
.modal-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: #555;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}
/* (Tái sử dụng class CSS có sẵn của bạn cho trạng thái) */
#modal-match-status {
  font-weight: bold;
}

/* Body (Tên, Tỷ số) */
.modal-match-body {
  display: flex;
  flex-direction: column; /* Sắp xếp theo chiều dọc */
  align-items: center;
  margin-top: 25px;
  width: 100%;
}

.modal-player-info,
.modal-score-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.modal-score-info {
  margin-top: 10px;
}

.modal-player {
  flex: 1;
  text-align: center;
}
.modal-player .player__name {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}
.modal-player .point-player {
  font-size: 2.5rem;
  font-weight: bold;
  margin: 0;
}

.modal-vs {
  font-size: 1.5rem;
  font-weight: bold;
  color: #aaa;
  margin: 0 15px;
}

.modal-vs-label {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
  margin: 0 15px;
  flex-basis: 50px;
  text-align: center;
}

.modal-stats-table {
  width: 100%;
  max-width: 400px;
  margin: 25px auto 0 auto;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

#modal-match-table,
#modal-group {
  text-align: center;
  margin: 10px 0;
}

.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.95rem; /* Điều chỉnh cỡ chữ */
}

.stat-label-center {
  flex-grow: 1;
  text-align: center;
  color: #555;
  font-weight: 600;
  padding: 0 10px;
}

.stat-value-left,
.stat-value-right {
  flex-basis: 40px;
  text-align: center;
  font-weight: 400;
  font-size: 1rem;
  color: #000;
}

.stat-value-left {
  text-align: left;
}
.stat-value-right {
  text-align: right;
}

#match-title {
  font-size: 1.5rem;
  margin-bottom: 0;
}

/* responsive breakpoint */
/* TABLET */
@media (max-width: 1199px) {
  .card-schedule .player {
    flex: 1;
  }
  .schedule-info {
    flex: 1;
  }

  .top-player-item {
    width: 30%;
  }
  .tournament-countdown {
    padding: 0;
  }
}

/* MOBILE0 */
@media (max-width: 767px) {
  .body-section {
    margin-top: 50px;
  }

  .schedule-info__status {
    font-size: 10px;
  }

  .match-sequence {
    padding: 0 5px;
    width: 20%;
  }

  .card-schedule .player {
    flex: 1;
  }

  .player img {
    width: 30px;
    height: 20px;
  }

  .player__name {
    font-size: 0.85rem;
    font-weight: 500;
  }

  .list-schedules {
    padding: 20px 0;
  }

  .top-player-item {
    width: 33.3333%;
  }

  /* .schedule-content {
      padding: 5px;
      flex-grow: 0;
      flex-shrink: 0;
      flex-basis: auto;
    } */

  .tab-bar {
    align-items: flex-start;
    padding: 0 calc(10px);
    justify-content: start;
  }

  .schedule-content .score {
    font-size: 1.2rem;
    font-weight: 700;
  }

  .schedule-content .time {
    font-size: 0.8rem;
    padding: 3px 6px;
  }

  .ranking-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ranking-table th,
  .ranking-table td {
    white-space: nowrap;
    padding: 10px;
  }

  .pagination-container {
    gap: 15px;
  }

  .pagination-pages {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    padding: 0 10px;
  }

  .pagination-page,
  .pagination-btn {
    padding: 5px 10px;
    font-size: 13px;
  }

  .pagination-page {
    min-width: 32px;
    height: 32px;
  }
  .tab-bar .tab {
    font-size: 0.8rem;
  }

  .bracket-wrapper {
    white-space: nowrap;
    overflow-x: auto;
  }

  .tournament-countdown {
    align-items: center;
  }
}

/* LOW TIER MOBILE */
@media (max-width: 400px) {
  .countdown-item span {
    width: 2.8rem;
  }
}

/* ==========================
    RESPONSIVE FONT SCALING
  ========================== */

/* ----- Desktop (≥1200px) ----- */
@media (min-width: 1200px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.5rem;
  }

  p,
  a,
  li,
  span,
  td,
  th {
    font-size: 1rem;
  }

  .player__name {
    font-size: 1.1rem;
  }

  .point-player {
    font-size: 1.8rem;
  }

  .point-player.score-winner {
    color: #fdd813 !important;
  }

  .point-player.score-loser {
    color: #999 !important;
    opacity: 0.8;
  }

  .player__name.score-winner {
    color: #fdd813 !important;
  }

  .player__name.score-loser {
    color: #999 !important;
    opacity: 0.8;
  }

  .tab-bar .tab {
    font-size: 1rem;
  }

  .pagination-info {
    font-size: 0.9rem;
  }
}

/* ----- Tablet (768px–1199px) ----- */
@media (max-width: 1199px) and (min-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2.2rem;
  }
  h2 {
    font-size: 1.8rem;
  }
  h3 {
    font-size: 1.4rem;
  }

  p,
  a,
  li,
  span,
  td,
  th {
    font-size: 0.95rem;
  }

  .player__name {
    font-size: 1rem;
  }

  .point-player {
    font-size: 1.6rem;
  }

  .point-player.score-winner {
    color: #fdd813 !important;
  }

  .point-player.score-loser {
    color: #999 !important;
    opacity: 0.8;
  }

  .player__name.score-winner {
    color: #fdd813 !important;
  }

  .player__name.score-loser {
    color: #999 !important;
    opacity: 0.8;
  }

  .tab-bar .tab {
    font-size: 0.95rem;
  }

  .pagination-info {
    font-size: 0.85rem;
  }

  /* .countdown-item span {
      font-size: 2.5rem;
    } */
}

/* ----- Mobile (<768px) ----- */
@media (max-width: 767px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.4rem;
  }
  h3 {
    font-size: 1.2rem;
  }

  p,
  a,
  li,
  span,
  td,
  th {
    font-size: 0.9rem;
  }

  .player__name {
    font-size: 0.85rem;
  }

  .point-player {
    font-size: 1.2rem;
  }

  .point-player.score-winner {
    color: #fdd813 !important;
  }

  .point-player.score-loser {
    color: #999 !important;
    opacity: 0.8;
  }

  .player__name.score-winner {
    color: #fdd813 !important;
  }

  .player__name.score-loser {
    color: #999 !important;
    opacity: 0.8;
  }
  .tab-bar .tab {
    font-size: 0.8rem;
  }

  .pagination-info {
    font-size: 0.8rem;
  }

  .ranking-table th,
  .ranking-table td {
    font-size: 0.9rem;
  }

  .countdown-item span {
    font-size: 3rem;
  }

  .tournament-countdown p:first-child {
    font-size: 1.2rem;
  }

  .top-player-name {
    font-size: 0.9rem;
  }
}

/* LOW TIER MOBILE */
@media (max-width: 400px) {
  .countdown-item span {
    font-size: 2rem;
  }

  .countdown-colon {
    font-size: 2rem;
  }
}

/* CAROM/LIBRE TOP 5 RANKING */
.carom-ranking-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 20px 0;
}

.carom-rank-card {
  display: flex;
  align-items: center;
  padding: 20px;
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 2px solid transparent;
}

.carom-rank-card:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Màu nền cho từng hạng */
.carom-rank {
  background-color: transparent;
  border-color: #999;
}

.carom-rank-1 {
  background: rgb(255, 207, 25);
  border-color: rgb(217, 119, 6);
}

.carom-rank-2 {
  background: rgb(192, 192, 192);
  border-color: rgb(148, 163, 184);
}

.carom-rank-3 {
  background: rgb(205, 127, 50);
  border-color: rgb(180, 83, 9);
}

.carom-rank-4,
.carom-rank-5 {
  opacity: 0.8;
}

.carom-rank-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  margin-right: 20px;
}

.carom-rank-icon {
  width: 32px;
  height: 32px;
  color: #333;
  margin-bottom: 5px;
}

.carom-rank-number span {
  font-size: 1.8rem;
  font-weight: 900;
  color: #333;
}

.carom-rank-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.carom-player-avatar {
  width: 60px;
  height: 60px;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.carom-player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-icon {
  width: 30px;
  height: 30px;
  color: white;
}

.carom-player-details {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.carom-player-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.carom-player-avg {
  font-size: 1rem;
  font-weight: 500;
  color: #333;
  margin: 0;
}

/* Responsive Mobile */
@media (max-width: 767px) {
  .carom-rank-card {
    padding: 15px;
  }

  .carom-rank-number {
    min-width: 50px;
    margin-right: 15px;
  }

  .carom-rank-icon {
    width: 24px;
    height: 24px;
  }

  .carom-rank-number span {
    font-size: 1.5rem;
  }

  .carom-player-avatar {
    width: 50px;
    height: 50px;
  }

  .carom-player-avatar img {
    width: 50px;
    height: 50px;
  }

  .pool-player-avatar {
    width: 45px;
    height: 45px;
  }

  .pool-player-avatar img {
    width: 45px;
    height: 45px;
  }

  .top-1-avatar {
    width: 60px;
    height: 60px;
  }

  .top-1-avatar img {
    width: 60px;
    height: 60px;
  }

  .top-2-avatar {
    width: 50px;
    height: 50px;
  }

  .top-2-avatar img {
    width: 50px;
    height: 50px;
  }

  .avatar-icon {
    width: 24px;
    height: 24px;
  }

  .carom-player-name {
    font-size: 1.1rem;
  }

  .carom-player-series {
    font-size: 0.9rem;
  }

  .pagination {
    padding: 0;
    flex-direction: row;
    flex: 1;
    width: 100%;
  }
}
