# IceGlass

NHL game situational awareness for macOS (menu bar) and iPhone (single-page app).

## Key Features

### macOS menu bar app
- NHL shield icon in the menu bar with game count
- Shows games from yesterday, today, and tomorrow grouped by date (configurable)
- Regular-season rows show league-wide game number (`#547 NYR @ WAS …`)
- During playoffs, ROUND sections list every round played so far (Round 1 through the current round) and each round's series with its series score, next game-in-series number, and upcoming tip-off time
- Game format: `NYR @ WAS 0:2 (FINAL)` / `DAL @ TOR Today @ 7:30 PM`
- Click a game to open NHL GameCenter; option-click for NHL Videocast
- Goal scored notifications with scoring team logo
- Game start / game ended notifications
- Dynamic polling: 7s during live games, scales back when idle
- Display Options: choose which days to show (yesterday/today/tomorrow)
- Refresh Now (⌘R) for immediate updates
- Launch at Login support
- About window via IndieAbout

### iPhone app
- Single scrollable page mirroring the macOS menu's content
- "Updated …" header showing relative + absolute ET timestamps; turns orange after 5 min, red after 30 min
- Persistent JSON cache in Application Support so cold launches paint last-known data instantly
- Pull-to-refresh, plus auto-refresh on scene activation and foreground polling timer
- Settings sheet (gear, top-right): display option picker + IndieAbout (license + changelog)
- Tap a game to open NHL GameCenter; tap a series to open the NHL series page

## Building

Requires XcodeGen to generate the project:

```bash
xcodegen generate
xcodebuild -scheme IceGlass -configuration Debug build                                                    # macOS
xcodebuild -scheme IceGlass-iOS -configuration Debug -destination 'platform=iOS Simulator,name=iPhone 17 Pro' build
```

## Architecture

Two targets sharing a common data layer (`Shared/`) and platform-specific UI:

- **Shared/** — `MainService`, `ApiService`, `AppSettings`, `NHLDataCache`, models, Date/Time/Logger helpers
- **IceGlass/** — macOS-only managers (MenuManager, StatusItemManager, NotificationManager, AboutWindow)
- **IceGlass-iOS/** — SwiftUI views, ScoreboardViewModel (`@Observable`)

`MainService` exposes a `MainServiceObserver` protocol; each platform installs its own adapter to bridge data updates into AppKit (macOS) or `@Observable` invalidation (iOS). Data is fetched from the NHL Web API (`api-web.nhle.com/v1/scoreboard/now`, `/standings/{date}`, `/playoff-bracket/{year}`).
