@breakpoint-xs: 24em;
@breakpoint-sm: 38em;
@breakpoint-md: 52em;
@breakpoint-lg: 72em;

.knockt{
  display: flex;
  flex-direction: row;
 flex-wrap: wrap;

  @media (min-width: @breakpoint-sm) {
    flex-direction: row;
  }
}

.knockout {
  display: block;
  margin-left: -3px;
  flex: 1;background: #f5f5f5;
   padding: 30px;

}

.bracket_title {

  text-align: center;

  margin-bottom: 0.5em;
}

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

  justify-content: center;
  height: 100%;
  min-height: 100%;

  padding-bottom: 2em;
  margin-bottom: 2em;
  transition: padding 0.2s ease-in-out, margin 0.2s ease-in-out;

  @media (max-width: @breakpoint-xs) {
    padding-bottom: 1em;
    margin-bottom: 1em;
  }

  @media (min-width: @breakpoint-sm) {
    margin-bottom: 0;
    padding-bottom: 0;
    border-right: 1px dashed #e5e5e5;
    border-bottom: 0;
  }

  .knockout:last-child & {
    border: 0;
  }
}

.bracket_item {
  display: flex;
  flex: 0 1 auto;
  margin: 0 auto;
  justify-content: center;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  padding: 2% 0;
  width: 95%;
  transition: padding 0.2s linear;

  &:nth-child(odd) {
    margin-right: 2%;
  }

  &:nth-child(even) {
    margin-left: 2%;
  }

  &::after {
    transition: width 0.2s linear;
  }

  @media (max-width: @breakpoint-xs) {
    width: 100%;

    &:nth-child(odd),
    &:nth-child(even) {
      margin-left: 0;
      margin-right: 0;
    }
  }

  @media (min-width: @breakpoint-sm) {
    padding: 0.5em 1em;
    // flex-grow: 2;
    width: 100%;

    &:nth-child(odd),
    &:nth-child(even) {
      margin: 0;
    }

    &::after {
      position: absolute;
      right: 0;
      content: '';
      display: block;
      width: 1em;
      height: 45%;
      border-right: 2px solid #9e9e9e;
    }

    &:nth-child(odd)::after {
      top: 50%;
      border-top: 2px solid #9e9e9e;
      transform: translateY(-1px);

      .tournament-bracket--rounded & {
        border-top-right-radius: 0.6em;
      }
    }

    &:nth-child(even)::after {
      bottom: 50%;
      border-bottom: 2px solid #9e9e9e;
      transform: translateY(1px);

      .tournament-bracket--rounded & {
        border-bottom-right-radius: 0.6em;
      }
    }
    .knockout:first-child & {
       padding-left: 0;
    }
    .knockout:last-child & {
       padding-right: 0;

       &::after {
         display: none;
       }
    }

    .knockout:nth-last-child(2) & {
      &::after {
        border-radius: 0;
        border-right: 0;
      }
    }
  }

  @media (min-width: @breakpoint-lg) {
    padding: 0.5em 1.5em;

    &::after {
      width: 1.5em;
    }
  }
}
.regular {
  width: 100%;
  display: block;
  text-align: center;
  position: absolute;
  bottom: 5px;
  left: 0;
  padding-right: 2%
}

.bracket_match {
position: relative;
  width: 100%;
  background-color: #ffffff;
  padding: 1em;
  border: 1px solid transparent;
  border-radius: 0.1em;
  box-shadow: 0 2px 0 0 #e5e5e5;
  outline: none;

  transition: padding 0.2s ease-in-out, border 0.2s linear;





  }

  @media (min-width: @breakpoint-lg) {
    &::before,
    &::after {
      width: 1.5em;
    }

    &::before {
      transform: translate(0, 1px);
    }

    &::after {
      transform: translate(0, -1px);
    }
  }
}

.knockout:last-child .bracket_match {
  &::before,
  &::after {
    border-left: 0;
  }

  &::before  {
    border-bottom-left-radius: 0;
  }

  &::after  {
    display: none;
  }
}

.knockout:first-child .bracket_match {
  &::before,
  &::after {
    display: none;
  }
}

.knockout table tbody {
  display: flex;

  &::after {
    content: ':';
    width: 1em;
    text-align: center;
    padding: 0.2em 0.1em;

    @media (min-width: @breakpoint-sm) {
       order: 1;
    }
  }

  & .bracket_teams:first-child {
    width: 50%;
    order: 0;
    text-align: right;

    @media (min-width: @breakpoint-sm) and (max-width: @breakpoint-md) {
      align-items: flex-end;
    }

    & .bracket_team {
      order: 2;
      justify-content: flex-end;

      @media (min-width: @breakpoint-xs) {
        order: 0;
      }

      @media (min-width: @breakpoint-sm) and (max-width: @breakpoint-md) {
        flex-direction: column-reverse;
        align-items: stretch;
      }
    }

    & .bracket_score {
      order: 0;

      @media (min-width: @breakpoint-xs) {
         order: 2;
      }
    }
  }

  & .bracket_teams:last-child {
    width: 50%;
    order: 2;
    text-align: left;

    @media (min-width: @breakpoint-sm) and (max-width: @breakpoint-md) {
      align-items: flex-start;
    }

    & .bracket_team {
      @media (min-width: @breakpoint-sm) {
        justify-content: flex-start;
      }

      @media (min-width: @breakpoint-sm) and (max-width: @breakpoint-md) {
        align-items: flex-start;
      }
    }

    .bracket_code {
      order: 1;
    }
  }
}


.knockout table{
  width: 100%;
}

caption {
  font-size: 0.8rem;
  color: #BDBDBD;
  font-weight: 300;
  padding-bottom: 0.75em;
}

.bracket_teams {
  display: flex;
  flex-direction: row;
  justify-content: center;
  width: 49%;
  text-align: center;
  @media (min-width: @breakpoint-xs) {
    flex-direction: column-reverse;
  }

  @media (min-width: @breakpoint-sm) {
    flex-direction: column-reverse;
  }
}

.bracket_team {
  font-size: 0.95rem;
  display: flex;
  margin-top: 0.5em;
  align-items: center;

  @media (max-width: @breakpoint-xs) {
    margin-top: 0;
  }

  @media (min-width: @breakpoint-sm) and (max-width: @breakpoint-md) {
    display: flex;
    flex-direction: column;

    .bracket_code {
      margin-top: 0.2em;
    }
  }
}

.bracket_code {
  padding: 0 0.5em;
  color: #212121;
  font-weight: 600;
  text-transform: uppercase;
  border: 0;
  text-decoration: none;
font-size: 11px;
line-height: 100%;
  transition: padding 0.2s ease-in-out;

  @media (max-width: @breakpoint-xs) {
    padding: 0 0.25em;
  }

  @media (min-width: @breakpoint-sm) and (max-width: @breakpoint-md) {
    padding: 0;
  }
}

.bracket_score {
  display: flex;
  align-items: center;

  .tournament-bracket__team:first-child & {
    flex-direction: row-reverse;
    padding-left: 0.75em;
  }

  .bracket_team:last-child & {
    padding-right: 0.75em;
  }
}

.bracket_number {
  display: inline-block;
  padding: 0.2em 0.4em 0.2em;
  border-bottom: 0.075em solid transparent;
  font-size: 0.95rem;
  background-color: #F5F5F5;
  border-color: spin(shade(#F5F5F5, 10%), -10);


}
.winner .bracket_number{
background:#1D52C0;
color: #fff;
}


.bracket_teams:first-child {
	justify-content: right;
}
.bracket_teams:last-child {
	justify-content: left;
}

@media (max-width: 767px) {
	  .bracket_match tbody{
   flex-direction: column;

	  }
	  .bracket_teams {
		  width: 100%;

	  }
	  .bracket_teams:first-child { justify-content: left;}

	  .bracket_teams:nth-child(2) {
		  flex-direction: row-reverse;
	  }
  }
