/* =========================
   TOURNAMENTS – LIGHT THEME
   ========================= */

.tournaments-page {
  background: #f8fafc;
}

/* Page Header */
.page-header.light {
  background: linear-gradient(180deg, #dbeafe, transparent);
  padding: 24px;
  border-radius: 16px;
  /*margin-bottom: 16px;*/
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  color: #0f172a;
}

.page-header .muted {
  color: #64748b;
  margin-top: 4px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 20px;
  overflow-x: auto;
}

.tab {
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f5f9;
  border: 1px solid #e5e7eb;
  font-size: 14px;
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
}

.tab.active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

/* Grid */
.tournament-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* Cards */
.tournament-card.light {
  background: #ffffff;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tournament-card.light:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.08);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h3 {
  font-size: 18px;
  margin: 0;
  color: #0f172a;
}

/* Status Badges */
.status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.status.active {
  background: #dcfce7;
  color: #166534;
}

.status.upcoming {
  background: #fef9c3;
  color: #854d0e;
}

.status.completed {
  background: #e5e7eb;
  color: #374151;
}

/* Meta */
.metat {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 5px;
}

/* Progress */
.progress {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #2563eb;
}

/* Actions */
.card-actions {
  margin-top: 8px;
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
}
/* Tournament Detail */
.player-list {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}

.player-list li {
  background: #f1f5f9;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: center;
  border: 1px solid #e5e7eb;
}

.match-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.match-round {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
}

.match-players {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

.match-result {
  text-align: center;
  margin-top: 6px;
}
/* =========================
   TOURNAMENT BRACKET
   ========================= */

.bracket {
  display: flex;
  align-items: flex-start;
  gap: 60px;
  overflow-x: auto;
  padding: 30px;
}

.round {
  display: flex;
  flex-direction: column;
  position: relative;
}

.round h4 {
  text-align: center;
  margin-bottom: 20px;
  font-size: 14px;
  color: #aaa;
}

.bracket-match {
  width: 180px;

}

.bracket-player.winner {
  color: #ff9d3c;
  font-weight: bold;
}

.bracket-round {
  min-width: 200px;
}

.bracket-round h4 {
  text-align: center;
  font-size: 14px;
  color: #475569;
  margin-bottom: 12px;
}

.bracket-match {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0,0,0,0.05);
  min-width: 150px;
}

.bracket-match:not(:last-child)::after {
  
  position: absolute;
  top: 120px;
  right: -30px;
  width: 2px;
  height: 40%;
  background: #444;
}
.bracket-match-link {
  text-decoration: none;
  color: inherit;
  display: block;
  font-weight:700;
}

.bracket-match-link:hover .bracket-match {
  background: rgba(255,255,255,0.05);
  border-color: #3b82f6;
  cursor: pointer;
}
.bracket-player {
  padding: 10px 12px;
  font-size: 14px;
  border-top: 1px solid #e5e7eb;
  font-weight: 600;
  width:100%;
}

.bracket-player:first-child {
  border-top: none;
}

.bracket-player.winner {
  background: #dcfce7;
  font-weight: 600;
  color: #166534;
}
/* Bracket Actions */
.bracket-actions {
  padding: 8px;
  text-align: center;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}
.badge.fee {
  background: #fee2e2;
  color: #991b1b;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
}

.badge.free {
  background: #dcfce7;
  color: #166534;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
}
.tournament-prize {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  margin: 16px 0;
  box-shadow: 0 6px 14px rgba(0,0,0,0.05);
}

.tournament-prize h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.tournament-prize p {
  margin: 6px 0;
  font-size: 14px;
}

.prize-total {
  font-size: 18px;
  font-weight: 600;
  color: #166534;
}
.prize-breakdown {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}

.prize-breakdown li {
  font-size: 14px;
  margin: 4px 0;
}
.tournament-rules-link {
  margin-top: 8px;
  font-size: 0.9rem;
}

.tournament-rules-link a {
  text-decoration: underline;
}

.rules-reminder {
  margin-bottom: 10px;
  font-size: 0.85rem;
}
.bracket-match.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}
.team-logo {
    width: 22px;
    height: 22px;
    object-fit: cover;
    border-radius: 6px;
    margin-right: 6px;
    vertical-align: middle;
}
.team-status-box {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.team-member-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.team-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.member-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.member-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.member-name {
    font-weight: 600;
}
.double-layout {
    display: flex;
    gap: 50px;
    align-items: flex-start;
}

.bracket-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bracket-right {

}

.bracket-section {
    overflow-x: auto;
}

.bracket-rounds {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    overflow-x: auto;
}

.bracket-column {
    display: flex;
    flex-direction: column;

}
.team-logo-large {width: 100px;
}
/* =========================
   TEAM MEMBERS (2v2 Header)
   ========================= */

.team-member {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: 0.2s ease;
}

.team-member:hover {
    transform: translateY(-2px);
}

.member-avatar {
    border: 2px solid #2a2a2a;
    transition: 0.2s ease;
}

.team-member:hover .member-avatar {
    border-color: #f5c542; /* subtle gold hover */
}

.member-name {
    font-weight: 500;
    white-space: nowrap;
}
	.team-members {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.meta-icon {
    width: 24px;
    object-fit: contain;
}
.game-mode-display {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mode-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.prize-description {
    margin: 12px;
    padding: 10px;
    background: rgba(255,255,255,0.05);
    border-left: 3px solid gold;
    font-size: 0.95rem;
	white-space: pre-line;
}
.team-profile-link {
    text-decoration: none;
    color: inherit;
    font-weight: 700;
}

.team-profile-link:hover {
    text-decoration: underline;
    color: #3498db;
}
.tournament-results-box {
  border-radius: 12px;
  text-align: center;
  margin-top: 10px;
}
.results-podium {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.podium {
    padding: 15px;
}

.podium .place {
    font-weight: bold;
    margin-bottom: 8px;
}

.podium.first .name {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e79134;
}

.podium.second .name {
    font-size: 1.1rem;
    color: #8a8a8a;
  font-weight: 700;
}

.champion-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    margin: 10px 0;
}
.bracket-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0,0,0,0.85);
}

.bracket-modal-content {
  background: #fff;
  width: 95%;
  height: 95%;
  margin: auto;
  margin-top: 1%;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
}

.bracket-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;

}

.bracket-modal-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.close-btn  {
  background: white;
  border: black;
  color: #ababab;
  font-size: 22px;
  cursor: pointer;
  width: 50px;
  align-self: flex-end;
}

.close-btn:hover {
  color: #f44336;
}
/* Dynamic vertical spacing for rounds */

.round:nth-child(1) .bracket-match {
  margin: 10px 0;
}

.round:nth-child(2) .bracket-match {
  margin: 60px 0;
}

.round:nth-child(3) .bracket-match {
  margin: 160px 0;
}

.round:nth-child(4) .bracket-match {
  margin: 240px 0;
}
/* Round spacing scale */
.round-1 .match-wrapper { margin: 20px 0; }
.round-2 .match-wrapper { margin: 70px 0; }
.round-3 .match-wrapper { margin: 140px 0; }
.round-4 .match-wrapper { margin: 280px 0; }
.round-5 .match-wrapper { margin: 560px 0; }

.bracket-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
}
.bracket-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.bracket-scroll-wrapper::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.bracket-scroll-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
/* Hide tabs on desktop */
.mobile-bracket-tabs {
    display: none;
}

/* Mobile Only */
@media (max-width: 900px) {

    .mobile-bracket-tabs {
        display: flex;
        gap: 10px;
        margin-bottom: 15px;
        overflow-x: auto;
    }

    .tab-btn {
        flex: 1;
        padding: 8px 10px;
        border: none;
        background: #222;
        color: #fff;
        border-radius: 6px;
        cursor: pointer;
    }

    .tab-btn.active {
        background: #444;
    }

    .mobile-tab-content {
        display: none;
    }

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

}
.desktop-bracket-button {
    text-align: right;
    margin-bottom: 10px;
}

/* Hide on mobile */
@media (max-width: 900px) {
    .desktop-bracket-button {
        display: none;
    }
}
.seed {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    margin-right: 6px;
}

.bracket-player.winner .seed {
    color: goldenrod;
}
.player-line{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.player-name{
    display:flex;
    gap:6px;
    align-items:center;
}

.player-score{
    font-weight:700;
    font-size:14px;
    color:#b31a1a;
}