/* =====================================
   TOURNAMENTS PAGE STYLES
===================================== */

.live-tournaments-section,
.upcoming-tournaments-section,
.past-tournaments-section {
  padding-top: calc(var(--section-space) - 0.5rem);
}

.live-tournaments-section {
  background: linear-gradient(180deg, rgba(255, 46, 99, 0.08), rgba(11, 15, 26, 0));
}

.upcoming-tournaments-section {
  background: linear-gradient(180deg, rgba(0, 240, 255, 0.08), rgba(11, 15, 26, 0));
}

.tournaments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.4rem;
}

.tournament-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: rgba(21, 27, 46, 0.78);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.tournament-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.2),
    0 14px 30px rgba(0, 0, 0, 0.45);
}

.tournament-card--live {
  border-color: rgba(255, 46, 99, 0.65);
  box-shadow:
    0 0 0 1px rgba(255, 46, 99, 0.28),
    0 14px 30px rgba(0, 0, 0, 0.42);
}

.tournament-card--past {
  opacity: 0.9;
}

.tournament-badge {
  position: absolute;
  right: 1rem;
  top: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  text-transform: uppercase;
}

.tournament-card-image {
  height: 250px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.tournament-card-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 15, 26, 0.2), rgba(11, 15, 26, 0.8));
}

.tournament-card-image .status-chip {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
}

.tournament-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tournament-header h3 {
  margin-bottom: 0.35rem;
  padding-right: 3.8rem;
}

.tournament-game {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--primary);
  text-transform: uppercase;
}

.tournament-info {
  margin: 0.8rem 0 1rem;
  padding: 0.8rem;
  background: rgba(11, 15, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.info-label {
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.info-value {
  font-size: 0.95rem;
  font-weight: 700;
}

.player-tournament-board {
  padding-top: calc(var(--section-space) - 0.5rem);
}

.player-hub-section {
  padding-top: calc(var(--section-space) - 0.9rem);
}

.player-hub-card {
  padding: 1.15rem;
}

.section-head-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.section-head-inline h2 {
  margin: 0;
}

.board-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 1.4rem;
}

.stats-panel {
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.stats-panel-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(11, 15, 26, 0.45);
}

.stats-panel-item small {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stats-panel-item strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.2rem;
}

.stats-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.25);
  font-size: 0.8rem;
  font-weight: 700;
}

.table-card h3 {
  margin-bottom: 0.8rem;
}

.table-wrap {
  overflow-x: auto;
}

.tourney-table {
  width: 100%;
  min-width: 640px;
}

.tourney-table th,
.tourney-table td {
  padding: 0.7rem 0.55rem;
}

.status-chip {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-live { background: rgba(255, 46, 99, 0.18); color: #ff9ab8; }
.status-upcoming { background: rgba(0, 240, 255, 0.16); color: #9cf8ff; }
.status-completed { background: rgba(255, 255, 255, 0.14); color: #ddd; }

.unified-tourney-grid .tournament-card h3 {
  margin: 0 0 0.3rem;
}

.progress-line {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
  min-width: 110px;
}

.progress-line span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.progress-cell small {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.upcoming-title {
  margin-top: 1.2rem;
}

.tourney-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.three-col-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tourney-info-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.tourney-info-card.compact {
  padding: 0.95rem;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.card-top h3 {
  margin: 0;
  font-size: 1rem;
}

.card-stats {
  display: grid;
  gap: 0.25rem;
  margin: 0.6rem 0 0.65rem;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.progress-text {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.card-actions {
  margin-top: auto;
  display: flex;
  justify-content: flex-end;
}

.card-actions .btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.knockout-publish-box {
  margin: 0 0 1rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 240, 255, 0.24);
  background: rgba(0, 240, 255, 0.08);
}

.knockout-publish-title {
  margin: 0 0 0.45rem;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9cf8ff;
  font-weight: 700;
}

.knockout-rounds {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.knockout-round-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.74rem;
  line-height: 1.2;
  color: #d9fcff;
  border: 1px solid rgba(0, 240, 255, 0.36);
  background: rgba(8, 24, 34, 0.72);
}

.subsection-title {
  margin: 1rem 0 0.7rem;
}

@media (max-width: 640px) {
  .tournaments-grid {
    grid-template-columns: 1fr;
  }

  .tournament-header h3 {
    padding-right: 0;
    margin-top: 1.6rem;
  }

  .tournament-info {
    grid-template-columns: 1fr;
  }

  .tourney-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .three-col-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-grid {
    grid-template-columns: 1fr;
  }

  .stats-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .three-col-grid {
    grid-template-columns: 1fr;
  }
}
