<%= h(game.title) %>
<% if game.memo.present? %>
<%= h(game.memo) %>
<% end %>
<%= game.solo_mode? ? 'ソロモード' : 'マルチプレイヤーモード' %>
<% if game.administrator %>
管理者: <%= h(game.administrator.username) %>
<% end %>
状態: <%= game.status %>
<% if game.year_limit.present? || game.victory_sc_count != 18 || game.scoring_system != "none" || game.auto_turn? %>
ハウスルール:
<% if game.auto_turn? %>
<%= game.schedule_display %>
<% end %>
<% if game.year_limit.present? %>
<%= game.year_limit %>年制限
<% end %>
<% if game.victory_sc_count != 18 %>
目標SC: <%= game.victory_sc_count %>
<% end %>
<% if game.scoring_system != "none" %>
<%= game.scoring_system_name %>
<% end %>
<% end %>
<% if game.auto_turn? && game.next_deadline_at.present? && game.status == "in_progress" %>
次のターン締切: <%= game.next_deadline_at.in_time_zone("Asia/Tokyo").strftime("%Y-%m-%d %H:%M") %>
<% end %>
<% unless local_assigns[:hide_controls] %>
<% if current_user&.admin? || game.administrator == current_user %>
<%= link_to "設定", edit_game_path(game), class: "inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" %>
<%= button_to "削除", game, method: :delete, class: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500", data: { turbo_confirm: "本当に削除しますか?" } %>
<% end %>
<% end %>
<% # ゲーム画面(games/show)と統一されたデザインでターン情報を表示 %>
<%
target_turn = defined?(display_turn) && display_turn ? display_turn : game.latest_turn
%>
<% if target_turn && target_turn.phase.present? %>
<%
# フェーズ名パース (例: S1901M)
phase = target_turn.phase
year = phase[1..4]
season_code = phase[0]
type_code = phase[-1]
season = case season_code
when 'S' then '春'
when 'F' then '秋'
when 'W' then '冬'
else ''
end
type = case type_code
when 'M' then '移動'
when 'R' then '撤退'
when 'A' then '調整'
else ''
end
display_date = "#{year}年 #{season} (#{type})"
%>