/* Стили для экспорта Турнирной сетки */
.export-template-bracket {
  padding: 0;
  background: radial-gradient(circle at center, #1a1a24 0%, #0b0c10 100%);
  flex: 1;
  display: flex;
  flex-direction: column;
  font-family: 'Actay', sans-serif;
  overflow: hidden;
}

.ex-bracket-container {
  display: flex;
  flex: 1;
  justify-content: center;
  align-items: stretch;
  padding: 0 40px 40px;
  z-index: 10;
  gap: 15px;
}

.ex-bracket-round {
  display: flex;
  flex-direction: column;
  flex: 3;
  max-width: 260px;
  height: 100%;
}

.ex-bracket-round-matches {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
}

.ex-bracket-match-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 10px 0;
  position: relative;
  width: 100%;
}

.ex-bracket-match-info {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  justify-content: space-between;
  width: calc(100% - 32px);
  padding: 4px 12px 6px 12px; 
  box-sizing: border-box;
  font-family: 'Bahnschrift', sans-serif;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  position: absolute;
  bottom: calc(100% - 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 1; 
}

.ex-bracket-match {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  width: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.ex-bracket-player {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-family: 'Actay', sans-serif;
  font-size: 18px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.ex-bracket-player:last-child {
  border-bottom: none;
}

.ex-bracket-player::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, var(--pcolor, transparent) 0%, transparent 50%, transparent 100%);
  opacity: 0.15;
  z-index: 0;
  pointer-events: none;
}

.ex-bracket-player.winner::before {
  opacity: 0.2;
  background: linear-gradient(90deg, var(--pcolor, transparent) 0%, transparent 65%, transparent 100%);
}

.ex-bracket-player > * {
  position: relative;
  z-index: 2;
}

.ex-bracket-player-name {
  display: flex;
  align-items: center;
  gap: 15px;
  z-index: 2;
  color:#fff;
  text-shadow: 0 0 15px var(--pcolor, transparent);
}

.ex-bracket-player.winner .ex-bracket-player-name {
  text-shadow: 0 0 25px var(--pcolor, transparent);
}

.ex-bracket-score {
  font-family: 'Heathergreen', sans-serif;
  font-size: 34px;
  line-height: 1;
  z-index: 2;
  color: #ffffff;
}

.ex-bracket-score.winner-score {
  color: #72fd90;
  text-shadow: 0 0 20px #3bba5680;
}

.ex-bracket-score.loser-score {
  color: #555555;
}

.ex-bracket-connectors {
  display: flex;
  flex-direction: column;
  flex: 0.5;
  min-width: 30px;
  max-width: 60px;
}

.ex-conn-c {
  position: relative;
  flex: 1;
}

.ex-conn-c::before {
  content: '';
  position: absolute;
  top: 25%;
  bottom: 25%;
  left: -15px;
  width: 90%;
  border-top: 4px solid rgba(255, 255, 255, 0.15);
  border-bottom: 4px solid rgba(255, 255, 255, 0.15);
  border-right: 4px solid rgba(255, 255, 255, 0.15);
}

.ex-conn-h {
  position: absolute;
  top: 50%;
  left: 72%;
  width: 50%;
  border-top: 4px solid rgba(255, 255, 255, 0.15);
}

/* -------------------------------------
   СТИЛИ ДЛЯ ШВЕЙЦАРСКОЙ СЕТКИ (ГРУППЫ)
   ------------------------------------- */

.ex-swiss-container {
  display: none; /* Переключается из JS */
  flex: 1;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0 40px 40px;
  z-index: 10;
  gap: 40px;
  overflow: hidden;
}

.ex-swiss-round {
  display: flex;
  flex-direction: column;
  gap: 60px;
  min-width: 160px;
  flex: 1;
  height: 100%;
}

.ex-swiss-pool {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ex-swiss-pool-header {
  height: 40px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Bahnschrift', sans-serif;
  font-variation-settings: "wdth" 75;
  font-size: 24px;
  color: #fff;
  letter-spacing: 1px;
  padding: 0px 20px;
}

.ex-swiss-pool-header.pool-advance {
  border-bottom: 2px solid #00ffaa;
  color: #00ffaa;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(0,255,170,0.1) 100%);
}

.ex-swiss-pool-header.pool-eliminate {
  border-bottom: 2px solid #ff0055;
  color: #ff0055;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,0,85,0.1) 100%);
}

.ex-swiss-arrow {
  position: absolute;
  width: 20px;
  height: 20px;
  opacity: 0.8;
  z-index: 10;
  right: -30px;
}

.ex-swiss-arrow svg {
  width: 100%;
  height: 100%;
}

.ex-swiss-arrow-up {
  top: 10px;
}

.ex-swiss-arrow-down {
  bottom: 10px;
}

.ex-swiss-player-placeholder {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  font-family: 'Bahnschrift', sans-serif;
  font-variation-settings: "wdth" 75;
  font-size: 24px;
  color: #fff;
  gap: 15px;
  position: relative;
  overflow: hidden;
}

.ex-swiss-player-placeholder::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, var(--pcolor, transparent) 0%, transparent 100%);
  opacity: 0.2;
  z-index: 0;
  pointer-events: none;
}

.ex-swiss-player-placeholder span {
  position: relative;
  z-index: 2;
  color: var(--pcolor, #fff);
  text-shadow: 0 0 15px var(--pcolor, transparent);
}

.ex-swiss-player-placeholder.advance {
  border-right: 4px solid #00ffaa;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(0,255,170,0.1) 100%);
}

.ex-swiss-player-placeholder.eliminate {
  border-right: 4px solid #ff0055;
  background: linear-gradient(90deg, rgba(255,255,255,0.02) 0%, rgba(255,0,85,0.1) 100%);
}

/* -------------------------------------
   СТИЛИ ДЛЯ КОМПАКТНОГО ВИДА
   ------------------------------------- */

.ex-bracket-match-compact {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: baseline;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  width: 100%;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 2;
  overflow: hidden;
  padding: 6px 12px;
  box-sizing: border-box;
}

.ex-compact-p1 {
  text-align: right;
  font-family: 'Bahnschrift', sans-serif;
  font-variation-settings: "wdth" 75;
  font-size: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-compact-p2 {
  text-align: left;
  font-family: 'Bahnschrift', sans-serif;
  font-variation-settings: "wdth" 75;
  font-size: 28px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-compact-score {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  font-family: 'Heathergreen', sans-serif;
  font-size: 28px;
  line-height: 1;
}

/* Стили-модификаторы для контейнеров в компактном виде */
.compact-mode.ex-swiss-container {
  gap: 20px;
}

.compact-mode .ex-swiss-round {
  gap: 30px;
}

.compact-mode .ex-swiss-pool {
  gap: 10px;
}

.compact-mode .ex-swiss-player-placeholder {
  padding: 8px;
  font-size: 18px;
  height: auto;
  flex: 1;
}

.compact-mode .ex-swiss-player-placeholder::before {
  opacity: 0.1;
}

.compact-mode .ex-swiss-arrow {
  width: 16px;
  height: 16px;
  right: -18px;
}

.compact-mode .ex-swiss-arrow-up {
  top: 5px;
}

.compact-mode .ex-swiss-arrow-down {
  bottom: 5px;
}

.compact-mode .ex-bracket-container {
  gap: 20px;
}

.compact-mode .ex-bracket-match-wrap {
  gap: 20px;
}
