import SwiftUI struct ContentView: View { @Environment(GamesViewModel.self) private var viewModel @State private var selectedSection: AppSection = .today private var showsTicker: Bool { selectedSection != .multiView && !viewModel.games.isEmpty } var body: some View { ZStack { BroadcastBackground() .ignoresSafeArea() VStack(spacing: shellSpacing) { CategoryPillBar( selected: $selectedSection, streamCount: viewModel.activeStreams.count, totalGames: viewModel.games.count, liveGames: viewModel.liveGames.count ) .padding(.horizontal, DS.Spacing.edgeInset) .padding(.top, navPadTop) .platformFocusSection() if showsTicker { ScoresTickerView() .padding(.horizontal, DS.Spacing.edgeInset) } Group { switch selectedSection { case .today: DashboardView() case .intel: LeagueCenterView() case .highlights: FeedView() case .multiView: MultiStreamView() case .settings: SettingsView() } } .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top) .platformFocusSection() } } .task { await viewModel.loadGames() } } #if os(tvOS) private var navPadTop: CGFloat { 26 } private var shellSpacing: CGFloat { 18 } #else private var navPadTop: CGFloat { 14 } private var shellSpacing: CGFloat { 14 } #endif }