<h1><%= @tournament.name %> Live Scores</h1>

<% if @mats.any? %>
  <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(520px, 1fr)); gap: 20px; align-items: start;">
    <% @mats.each do |mat| %>
      <% match = mat.selected_scoreboard_match || mat.queue1_match %>
      <%= render "tournaments/live_score_card", mat: mat, match: match, tournament: @tournament %>
    <% end %>
  </div>
<% else %>
  <p>No mats have been created for this tournament.</p>
<% end %>
