<style>
table.smallText tr td { font-size: 10px; }
/*
 *  Bracket Layout Specifics
*/
.bracket {
  display: flex;
  font-size: 10px;
}
.game {
  min-width: 150px;
  min-height: 50px;
  /*background-color: #ddd;*/
  border: 1px solid #ddd;
  margin: 5px;
}

/*.game:after {
  content:'';
  border-color: #4f7a38;
  border-width: 2px;
  position: absolute;
  display: block;
  width: 10px;
  right: -11px;
}

.game:nth-of-type(odd):after {
  border-right-style: solid;
  border-top-style: solid;
  height: 100%;
  top: 50%;
}

.game:nth-of-type(even):after {
  border-right-style: solid;
  border-bottom-style: solid;
  height: 100%;
  top: -50%;
}

.game:before {
  content:'';
  border-top: 2px solid #4f7a38;
  position: absolute;
  height: 2px;
  width: 10px;
  left: -10px;
  top: 50%;
}*/

.round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.game-top {
  border-bottom:1px solid #ddd;
  padding: 2px;
  min-height: 12px;
}

.bout-number {
  text-align: center;
  /*padding-top: 15px;*/
}

/* Style links within bout-number like default links */
.bout-number a {
  color: #007bff; /* Or your preferred link color */
  text-decoration: underline;
}
.bout-number a:hover {
  color: #0056b3; /* Darker color on hover */
  text-decoration: underline;
}

.bracket-winner {
  border-bottom:1px solid #ddd;
  padding: 2px;
  min-height: 12px;
}

.game-bottom {
  border-top:1px solid #ddd;
  padding: 2px;
  min-height: 12px;
}
</style>
<% if @tournament.tournament_type == "Pool to bracket" %>
  <div class="page">
    <div class="bracket-container">
      <h4><%= @tournament.name %> - <%= @weight.max %> Bracket</h4>
      <table class='smallText'>          
        <tr>
          <td valign="top" style="padding: 10px;">
            <% @matches = @tournament.matches.select{|m| m.weight_id == @weight.id} %>
            <% @wrestlers = Wrestler.where(weight_id: @weight.id) %>
            <% @pools = @weight.pool_rounds(@matches) %>
            <%= render 'pool' %>
          </td>      
          <td valign="top" style="padding: 10px;">
            <% if @weight.pool_bracket_type == "twoPoolsToFinal" %>
              <%= render 'twoPoolFinalBracket' %>
            <% end %>
            <% if @weight.pool_bracket_type == "twoPoolsToSemi" %>
              <%= render 'twoPoolSemiBracket' %>
            <% end %>
            <% if @weight.pool_bracket_type == "fourPoolsToQuarter" %>
              <%= render 'fourPoolQuarterBracket' %>
            <% end %>
            <% if @weight.pool_bracket_type == "eightPoolsToQuarter" %>
              <%= render 'fourPoolQuarterBracket' %>
            <% end %>
            <% if @weight.pool_bracket_type == "fourPoolsToSemi" %>
              <%= render 'fourPoolSemiBracket' %>
            <% end %>
          </td>
        </tr>
      </table>
    </div>
  </div>
<% elsif @tournament.tournament_type.include? "Modified 16 Man Double Elimination" %>
  <div class="page">
    <div class="bracket-container">
    <h4><%= @tournament.name %> - <%= @weight.max %> Bracket</h4>
      <%= render 'modified_sixteen_man_double_elimination_bracket' %>
    </div>
  </div>
<% elsif @tournament.tournament_type.include? "Regular Double Elimination" %>
  <%= render 'double_elimination_bracket' %>
<% end %>
        