.win {
  --bracket: 3px solid rgba(39, 214, 255, 1);
}

.tournament-bracket {
  overflow-x: auto;
  min-width: auto;
  width: 100%;
  max-width: 100%;
  min-height: calc(var(--bracket-height, 160px) * 2);
}

/* 패자부활전 헤더 스타일 */
.repechage-bracket-header {
  text-align: center;
  margin: 2rem 0 1.5rem 0;
  padding: 0;
}

.repechage-bracket-header h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin: 0;
  padding: 0;
  text-align: center;
  letter-spacing: -0.02rem;
}

.tournament-bracket #round-1-left .player {
  align-items: center;
}

.tournament-bracket #round-1-right .player {
  align-items: center;
}

.tournament-bracket #round-1-left .player,
.tournament-bracket #round-1-right .player {
  flex-direction: column;
  justify-content: center;
  gap: 0.4rem;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 0.7rem;
  padding: 0.6rem 1rem;
}

.tournament-bracket .player .player-text {
  font-size: 1.4rem;
  font-weight: 600;
  color: #000;
  text-align: center;
}

.tournament-bracket .player .team-text {
  font-size: 1.2rem;
  font-weight: 400;
  color: #666;
  text-align: center;
}

.round-container-container {
  margin: 0;
}

.match,
.no-match {
  pointer-events: none;
}

#round-1-left .match[data-is-left="true"]::before,
#round-container-right #round-1-right .match[data-is-left="true"]::before,
.match[data-is-left="true"]::before {
  display: flex;
  justify-content: center;
  align-items: center;
  content: attr(data-match-number);
  position: absolute;
  color: #fff;
  background: #999;
  font-weight: 700;
  transform: translate(0, 50%);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.7rem;
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: -0.03rem;
}

#round-container-left #round-1-left .match[data-is-left="true"]::before {
  left: revert;
  right: calc(var(--bracket-width) / -8);
  bottom: 0;
  transform: translate(-25%, 50%);
}

#round-1-left
  .match[data-is-left="true"][data-match-result-exists="true"]::before,
#round-container-right
  #round-1-right
  .match[data-is-left="true"][data-match-result-exists="true"]::before,
.match[data-is-left="true"][data-match-result-exists="true"]::before {
  background: #2846c3;
  pointer-events: all;
}

#round-container-left .match[data-is-left="true"]::before {
  left: calc(var(--bracket-width) / 8);
  bottom: 0;
  transform: translate(-125%, 50%);
}

#round-container-right .match[data-is-left="true"]::before {
  left: calc(var(--bracket-width) / -4);
  bottom: 0;
  transform: translate(25%, 50%);
}

#round-container-right #round-1-right .match[data-is-left="true"]::before {
  left: calc(var(--bracket-width) / -8);
  bottom: 0;
  transform: translate(25%, 50%);
}

#round-container-left .round:last-child .match[data-is-left="true"]::before {
  bottom: revert;
  left: revert;
  right: 0;
  transform: translate(50%, 85%);
}

#rcc-with-one-player,
#rcc-with-two-player {
  width: 100%;
  min-height: calc(var(--bracket-height, 160px) * 2);
}

#rcc-with-two-player
  #round-container-left
  #round-1-left
  .match[data-is-left="true"]::before {
  right: calc(var(--bracket-width) / -8);
  bottom: 0;
  transform: translate(50%, 0);
}

@media (max-width: 650px) {
  .tournament-bracket .player .player-text {
    font-size: 1.1rem;
  }

  .tournament-bracket .player .team-text {
    font-size: 0.9rem;
  }

  .repechage-bracket-header h2 {
    font-size: 1.6rem;
  }
}

/* 경기 카드 Footer */
.schedule-footer {
  display: flex;
  gap: 0.8rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-top: 1px solid #e9ecef;
  border-radius: 0 0 0.5rem 0.5rem;
}

.schedule-footer .btn-blue.btn.navy,
.schedule-footer .youtube-external-link {
  flex: 1;
  text-align: center;
  padding: 0.8rem 1rem !important;
  font-size: 1.4rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.schedule-footer .youtube-external-link {
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  border-color: #ff0000;
  color: #fff;
}

.schedule-footer .youtube-external-link:hover {
  background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 0, 0, 0.3);
}

.schedule-footer .btn-blue.btn.navy:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(40, 70, 195, 0.3);
}

@media (max-width: 768px) {
  .schedule-footer {
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.8rem;
  }

  .schedule-footer .btn-blue.btn.navy,
  .schedule-footer .youtube-external-link {
    width: 100%;
    padding: 0.7rem 1rem !important;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .schedule-footer {
    padding: 0.6rem;
    gap: 0.5rem;
  }

  .schedule-footer .btn-blue.btn.navy,
  .schedule-footer .youtube-external-link {
    padding: 0.6rem 0.8rem !important;
    font-size: 1.2rem;
  }
}

/* 경기장 목록 YouTube 링크 스타일 */
#youtube-links-list-view .youtube-external-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 12px 20px !important;
  background: #fff !important;
  color: #333 !important;
  border: 2px solid #ff0000 !important;
  border-radius: 8px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(255, 0, 0, 0.15) !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
}

#youtube-links-list-view .youtube-external-link:hover {
  background: #fff5f5 !important;
  border-color: #cc0000 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.25) !important;
}

#youtube-links-list-view .youtube-external-link img {
  height: 15px !important;
  width: auto !important;
  vertical-align: middle !important;
}

/* 개별 경기 YouTube 버튼 스타일 개선 */
.schedule-footer .youtube-external-link {
  background: #fff !important;
  border: 2px solid #ff0000 !important;
  color: #333 !important;
}

.schedule-footer .youtube-external-link:hover {
  background: #fff5f5 !important;
  border-color: #cc0000 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(255, 0, 0, 0.25) !important;
}

.schedule-footer .youtube-external-link img {
  height: 15px !important;
  width: auto !important;
  vertical-align: middle !important;
}

/* 팀(소속)정보 카드 */
.CON-04-05-teamInfo-th,
.CON-04-05-applicantList-th {
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: background-color 0.2s ease;
}

.CON-04-05-teamInfo-th.foldable:hover,
.CON-04-05-applicantList-th.foldable:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

.CON-04-05-teamInfo-th.foldable::after,
.CON-04-05-applicantList-th.foldable::after {
  content: "▼";
  position: absolute;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
  font-size: 1.2rem;
  color: #666;
}

.CON-04-05-teamInfo-th.foldable.folded::after,
.CON-04-05-applicantList-th.foldable.folded::after {
  transform: translateY(-50%) rotate(-90deg);
}

.CON-04-05-teamInfo-content,
.CON-04-05-applicantList-content {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 2000px;
  opacity: 1;
}

.CON-04-05-teamInfo-content.folded,
.CON-04-05-applicantList-content.folded {
  max-height: 0;
  opacity: 0;
}

.CON-04-05-teamInfo-th:not(.foldable),
.CON-04-05-applicantList-th:not(.foldable) {
  cursor: default;
}

.CON-04-05-teamInfo-th:not(.foldable)::after,
.CON-04-05-applicantList-th:not(.foldable)::after {
  display: none;
}

#popup-match .schedule.highlight {
  outline: 2px solid #ff9800;
  border-radius: 0.5rem;
}

/* 경기장 선택 버튼 스타일 */
.stadium-button-container {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: left;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border_normal, #ddd) transparent;
  margin-bottom: 1rem;
}

.stadium-button-container::-webkit-scrollbar {
  height: 6px;
}

.stadium-button-container::-webkit-scrollbar-track {
  background: transparent;
}

.stadium-button-container::-webkit-scrollbar-thumb {
  background: var(--border_normal, #ddd);
  border-radius: 3px;
}

.stadium-button-container::-webkit-scrollbar-thumb:hover {
  background: #bbb;
}

.stadium-button {
  flex-shrink: 0;
  min-width: 100px;
  height: 4.2rem;
  padding: 1rem 2rem;
  border: 1px solid var(--border_normal, #ddd);
  background: var(--white, #fff);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--txt_Bk, #232323);
  white-space: nowrap;
  letter-spacing: -0.03rem;
}

.stadium-button:hover {
  border-color: var(--navy, #243786);
  background: var(--bg_lightSky, #f8fbff);
}

.stadium-button.active {
  background: var(--navy, #243786);
  color: var(--white, #fff);
  border-color: var(--navy, #243786);
  font-weight: 500;
}

.stadium-button:active {
  transform: scale(0.98);
}

/* 모바일: 여러 줄로 배치 */
@media (max-width: 768px) {
  .stadium-button-container {
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: left;
  }

  .stadium-button {
    min-width: 90px;
    padding: 1rem 1.5rem;
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .stadium-button {
    min-width: 80px;
    padding: 1rem 1.2rem;
    font-size: 1.2rem;
  }
}
