<style>
table.smallText tr td { font-size: 10px; }
table.smallText {
  border-collapse: collapse;
}
table.smallText th,
table.smallText td {
  border: 1px solid #000;
}
/*
 *  Bracket Layout Specifics
*/
.bracket {
  display: flex;
  font-size: 10.5px;
  gap: 2px;
}
.game {
  min-width: 150px;
  min-height: 58px;
  /*background-color: #ddd;*/
  border: 1.5px solid #000; /* Dark border so boxes stay visible when printed */
  margin: 4px;
}

/*.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:1.5px solid #000;
  padding: 3px 4px;
  min-height: 16px;
}

.bout-number {
  text-align: center;
  line-height: 1.35;
  padding: 1px 2px;
}

/* 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:1.5px solid #000;
  padding: 3px 4px;
  min-height: 16px;
}

.game-bottom {
  border-top:1.5px solid #000;
  padding: 3px 4px;
  min-height: 16px;
}

@media print {
  .game,
  .game-top,
  .game-bottom,
  .bracket-winner,
  table.smallText,
  table.smallText th,
  table.smallText td {
    border-color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
</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;">
            <% @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 %>
        
