:root {
  --bracket: 1px solid black;

  --player-container-height-c: 60px;
  --player-container-width-c: 120px;
  --bracket-container-width: 40%;
  --league-container-width: 40%;
  --bracket-first-height: 160px;
  --bracket-second-height: 50px;
}

.win {
  --bracket: 1px solid red;
}

.combined-table .league-table {
  width: var(--league-container-width);
  font-size: 1.2rem;
  border-collapse: collapse;
  text-align: center;
}

.combined-table .league-table th,
.combined-table .league-table td {
  border: 1px solid #ccc;
  padding: 8px;
}

.combined-table .league-table thead {
  background-color: lightgray;
  font-weight: bold;
}

.combined-table .league-table tbody tr:hover {
  background-color: #f0f0f0;
}

.combined-table .league-table th:first-child {
  text-align: center;
  background-color: blue;
  color: white;
  font-weight: bold;
}

.combined-table .league-table td:first-child {
  text-align: center;
  background-color: lightblue;
  font-weight: bold;
}

td.grayed-out {
  background-color: dimgrey;
}


.combined-table .league-table {
  td.league-match-box {
    text-align: center;

    span {
      display: block;
    }

    span.hidden {
      display: none;
    }

    span.score-legend {
      display: inline-flex;
    }

    .match-player {
      font-size: 1.1em;
      font-weight: bold;
    }

    .match-versus {
      font-size: 0.9em;
    }
  }

  thead th {
    font-size: 1.2em;
    font-weight: bold;
  }

  th.playerCell, td.playerCell {
    text-align: center;

    span {
      display: block;
    }

    span.playerName {
      font-size: 1.2em;
      font-weight: bold;
    }

    span.teamName {
      font-size: 0.9em;
      font-weight: normal;
      color: orangered;
    }
  }
}

.score-legend {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  color: white;
  background: #999999;
  /* background: #2846c3; */
  font-weight: bold;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.7rem;
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: -0.03rem;
}

.score-legend[data-match-result-exists="true"] {
  background: #2846c3;
}

.match-indicator {
  color: red;
}

.bracket-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  font-family: sans-serif;
}

.combined-tournament-match {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: var(--bracket-container-width);
}

.combined-tournament-player {
  background-color: #eee;
  padding: 4px 8px;
  border-radius: 4px;
}

.combined-table {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  margin-top: 8rem;
  width: 100%;

  .combined-tournament-match, .league-table {
    flex-direction: row;
    justify-content: space-around;
    align-items: end;

    .combined-tournament-player {
      width: var(--player-container-width-c);
      height: var(--player-container-height-c);
      box-sizing: border-box;
    }
  }

  .combined-connector .left-border {
    position: absolute;
    width: calc(var(--bracket-container-width) / 4);
    height: calc(var(--bracket-first-height));
    left: calc(var(--bracket-container-width) / 4);
    bottom: calc(var(--player-container-height-c));
    border-left: var(--bracket);
    border-top: var(--bracket);
  }

  .combined-connector .right-border {
    position: absolute;
    width: calc(var(--bracket-container-width) / 4);
    height: calc(var(--bracket-first-height));
    left: calc(var(--bracket-container-width) / 2);
    bottom: calc(var(--player-container-height-c));
    border-right: var(--bracket);
    border-top: var(--bracket);
  }

  .combined-connector .top-left-border {
    position: absolute;
    width: calc(50% - var(--bracket-container-width) / 2);
    height: calc(100% - var(--player-container-height-c) - var(--bracket-first-height) + var(--bracket-second-height));
    left: calc(var(--bracket-container-width) / 2);
    bottom: calc(var(--player-container-height-c) + var(--bracket-first-height));
    border-left: var(--bracket);
    border-top: var(--bracket);
  }

  .combined-connector .top-right-border {
    position: absolute;
    width: calc(50% - var(--league-container-width) / 2);
    height: calc(var(--bracket-second-height));
    left: 50%;
    bottom: 100%;
    border-right: var(--bracket);
    border-top: var(--bracket);
  }
}

div.combined-table .playerCell {
  font-size: 1.2em;
  padding: 12px;
  text-align: center;

  span {
    display: block;
  }

  span.playerName {
    font-size: 1.2em;
    font-weight: bold;
  }

  span.teamName {
    font-size: 0.9em;
    font-weight: normal;
    color: orangered;
  }
}

.combined-connector div {
  position: relative;
}

.combined-connector [data-is-left="true"]::before {
  display: flex;
  justify-content: center;
  align-items: center;
  content: attr(data-match-number);
  position: absolute;
  color: white;
  background: #999999;
  /* background: #2846c3; */
  font-weight: bold;
  left: 100%;
  transform: translate(-50%, 35%);
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.7rem;
  cursor: pointer;
  font-size: 1rem;
  letter-spacing: -0.03rem;
}

.combined-connector [data-is-left="true"][data-match-result-exists="true"]::before {
  background: #2846c3;
}
