/**
 * venue.ts — Static venue metadata for HCW (Home Crowd + Weather) insight.
 *
 * Maps team short codes → venue info (indoor/outdoor, lat/lon, capacity, name).
 * Since rm_events has no venue columns, this is a static lookup.
 */

export interface VenueInfo {
  name: string;
  city: string;
  lat: number;
  lon: number;
  indoor: boolean;
  capacity: number;
  surface?: string;        // grass, turf, ice, hardwood, etc.
  altitude?: number;       // feet above sea level (for Denver, Mexico City, etc.)
}

/**
 * Venue database keyed by uppercase team short code.
 * Covers NBA, NHL, NFL, MLB, NCAAB, EPL, La Liga, Bundesliga, Serie A, Ligue 1, Champions League.
 */
const VENUES: Record<string, VenueInfo> = {
  // ── NBA (all indoor) ──
  ATL: { name: 'State Farm Arena', city: 'Atlanta', lat: 33.757, lon: -84.396, indoor: true, capacity: 18118, surface: 'hardwood' },
  BOS: { name: 'TD Garden', city: 'Boston', lat: 42.366, lon: -71.062, indoor: true, capacity: 19580, surface: 'hardwood' },
  BKN: { name: 'Barclays Center', city: 'Brooklyn', lat: 40.682, lon: -73.975, indoor: true, capacity: 17732, surface: 'hardwood' },
  CHA: { name: 'Spectrum Center', city: 'Charlotte', lat: 35.225, lon: -80.839, indoor: true, capacity: 19077, surface: 'hardwood' },
  CHI: { name: 'United Center', city: 'Chicago', lat: 41.881, lon: -87.674, indoor: true, capacity: 20917, surface: 'hardwood' },
  CLE: { name: 'Rocket Mortgage FieldHouse', city: 'Cleveland', lat: 41.496, lon: -81.688, indoor: true, capacity: 19432, surface: 'hardwood' },
  DAL: { name: 'American Airlines Center', city: 'Dallas', lat: 32.790, lon: -96.810, indoor: true, capacity: 19200, surface: 'hardwood' },
  DEN: { name: 'Ball Arena', city: 'Denver', lat: 39.749, lon: -105.008, indoor: true, capacity: 19520, surface: 'hardwood', altitude: 5280 },
  DET: { name: 'Little Caesars Arena', city: 'Detroit', lat: 42.341, lon: -83.055, indoor: true, capacity: 20332, surface: 'hardwood' },
  GSW: { name: 'Chase Center', city: 'San Francisco', lat: 37.768, lon: -122.387, indoor: true, capacity: 18064, surface: 'hardwood' },
  HOU: { name: 'Toyota Center', city: 'Houston', lat: 29.751, lon: -95.362, indoor: true, capacity: 18055, surface: 'hardwood' },
  IND: { name: 'Gainbridge Fieldhouse', city: 'Indianapolis', lat: 39.764, lon: -86.155, indoor: true, capacity: 17923, surface: 'hardwood' },
  LAC: { name: 'Intuit Dome', city: 'Inglewood', lat: 33.955, lon: -118.341, indoor: true, capacity: 18000, surface: 'hardwood' },
  LAL: { name: 'Crypto.com Arena', city: 'Los Angeles', lat: 34.043, lon: -118.267, indoor: true, capacity: 18997, surface: 'hardwood' },
  MEM: { name: 'FedExForum', city: 'Memphis', lat: 35.138, lon: -90.051, indoor: true, capacity: 17794, surface: 'hardwood' },
  MIA: { name: 'Kaseya Center', city: 'Miami', lat: 25.781, lon: -80.187, indoor: true, capacity: 19600, surface: 'hardwood' },
  MIL: { name: 'Fiserv Forum', city: 'Milwaukee', lat: 43.045, lon: -87.917, indoor: true, capacity: 17341, surface: 'hardwood' },
  MIN: { name: 'Target Center', city: 'Minneapolis', lat: 44.980, lon: -93.276, indoor: true, capacity: 18798, surface: 'hardwood' },
  NOP: { name: 'Smoothie King Center', city: 'New Orleans', lat: 29.949, lon: -90.082, indoor: true, capacity: 16867, surface: 'hardwood' },
  NYK: { name: 'Madison Square Garden', city: 'New York', lat: 40.751, lon: -73.994, indoor: true, capacity: 19812, surface: 'hardwood' },
  OKC: { name: 'Paycom Center', city: 'Oklahoma City', lat: 35.463, lon: -97.515, indoor: true, capacity: 18203, surface: 'hardwood' },
  ORL: { name: 'Kia Center', city: 'Orlando', lat: 28.539, lon: -81.384, indoor: true, capacity: 18846, surface: 'hardwood' },
  PHI: { name: 'Wells Fargo Center', city: 'Philadelphia', lat: 39.901, lon: -75.172, indoor: true, capacity: 20478, surface: 'hardwood' },
  PHX: { name: 'Footprint Center', city: 'Phoenix', lat: 33.446, lon: -112.071, indoor: true, capacity: 18422, surface: 'hardwood' },
  POR: { name: 'Moda Center', city: 'Portland', lat: 45.532, lon: -122.667, indoor: true, capacity: 19441, surface: 'hardwood' },
  SAC: { name: 'Golden 1 Center', city: 'Sacramento', lat: 38.580, lon: -121.500, indoor: true, capacity: 17608, surface: 'hardwood' },
  SAS: { name: 'Frost Bank Center', city: 'San Antonio', lat: 29.427, lon: -98.438, indoor: true, capacity: 18581, surface: 'hardwood' },
  TOR: { name: 'Scotiabank Arena', city: 'Toronto', lat: 43.643, lon: -79.379, indoor: true, capacity: 19800, surface: 'hardwood' },
  UTA: { name: 'Delta Center', city: 'Salt Lake City', lat: 40.768, lon: -111.901, indoor: true, capacity: 18306, surface: 'hardwood', altitude: 4226 },
  WAS: { name: 'Capital One Arena', city: 'Washington', lat: 38.898, lon: -77.021, indoor: true, capacity: 20356, surface: 'hardwood' },

  // ── NHL (all indoor) — use same arena as NBA where shared, otherwise specific ──
  // Many NHL teams share arenas with NBA teams (CHI, DAL, DEN, DET, LAL/LAC, MIA, MIN, PHI, TOR, WAS)
  // Add NHL-specific teams
  ANA: { name: 'Honda Center', city: 'Anaheim', lat: 33.808, lon: -117.877, indoor: true, capacity: 17174, surface: 'ice' },
  ARI: { name: 'Mullett Arena', city: 'Tempe', lat: 33.427, lon: -111.933, indoor: true, capacity: 5000, surface: 'ice' },
  BUF: { name: 'KeyBank Center', city: 'Buffalo', lat: 42.875, lon: -78.876, indoor: true, capacity: 19070, surface: 'ice' },
  CGY: { name: 'Scotiabank Saddledome', city: 'Calgary', lat: 51.037, lon: -114.052, indoor: true, capacity: 19289, surface: 'ice' },
  CAR: { name: 'PNC Arena', city: 'Raleigh', lat: 35.803, lon: -78.722, indoor: true, capacity: 18680, surface: 'ice' },
  CBJ: { name: 'Nationwide Arena', city: 'Columbus', lat: 39.969, lon: -83.006, indoor: true, capacity: 18500, surface: 'ice' },
  COL: { name: 'Ball Arena', city: 'Denver', lat: 39.749, lon: -105.008, indoor: true, capacity: 18007, surface: 'ice', altitude: 5280 },
  EDM: { name: 'Rogers Place', city: 'Edmonton', lat: 53.547, lon: -113.498, indoor: true, capacity: 18347, surface: 'ice' },
  FLA: { name: 'Amerant Bank Arena', city: 'Sunrise', lat: 26.158, lon: -80.326, indoor: true, capacity: 19250, surface: 'ice' },
  MTL: { name: 'Bell Centre', city: 'Montreal', lat: 45.496, lon: -73.569, indoor: true, capacity: 21302, surface: 'ice' },
  NJD: { name: 'Prudential Center', city: 'Newark', lat: 40.734, lon: -74.171, indoor: true, capacity: 16514, surface: 'ice' },
  NSH: { name: 'Bridgestone Arena', city: 'Nashville', lat: 36.159, lon: -86.779, indoor: true, capacity: 17159, surface: 'ice' },
  NYI: { name: 'UBS Arena', city: 'Elmont', lat: 40.722, lon: -73.726, indoor: true, capacity: 17255, surface: 'ice' },
  NYR: { name: 'Madison Square Garden', city: 'New York', lat: 40.751, lon: -73.994, indoor: true, capacity: 18006, surface: 'ice' },
  OTT: { name: 'Canadian Tire Centre', city: 'Ottawa', lat: 45.297, lon: -75.927, indoor: true, capacity: 18652, surface: 'ice' },
  PIT: { name: 'PPG Paints Arena', city: 'Pittsburgh', lat: 40.439, lon: -79.989, indoor: true, capacity: 18387, surface: 'ice' },
  SEA: { name: 'Climate Pledge Arena', city: 'Seattle', lat: 47.622, lon: -122.354, indoor: true, capacity: 17100, surface: 'ice' },
  SJS: { name: 'SAP Center', city: 'San Jose', lat: 37.333, lon: -121.901, indoor: true, capacity: 17562, surface: 'ice' },
  STL: { name: 'Enterprise Center', city: 'St. Louis', lat: 38.627, lon: -90.203, indoor: true, capacity: 18096, surface: 'ice' },
  TBL: { name: 'Amalie Arena', city: 'Tampa', lat: 27.943, lon: -82.452, indoor: true, capacity: 19092, surface: 'ice' },
  VAN: { name: 'Rogers Arena', city: 'Vancouver', lat: 49.278, lon: -123.109, indoor: true, capacity: 18910, surface: 'ice' },
  VGK: { name: 'T-Mobile Arena', city: 'Las Vegas', lat: 36.103, lon: -115.178, indoor: true, capacity: 17500, surface: 'ice' },
  WPG: { name: 'Canada Life Centre', city: 'Winnipeg', lat: 49.893, lon: -97.144, indoor: true, capacity: 15321, surface: 'ice' },

  // ── NFL (mostly outdoor) ──
  ARI_NFL: { name: 'State Farm Stadium', city: 'Glendale', lat: 33.528, lon: -112.263, indoor: true, capacity: 63400, surface: 'grass' },
  ATL_NFL: { name: 'Mercedes-Benz Stadium', city: 'Atlanta', lat: 33.755, lon: -84.401, indoor: true, capacity: 71000, surface: 'turf' },
  BAL: { name: 'M&T Bank Stadium', city: 'Baltimore', lat: 39.278, lon: -76.623, indoor: false, capacity: 71008, surface: 'grass' },
  BUF_NFL: { name: 'Highmark Stadium', city: 'Orchard Park', lat: 42.774, lon: -78.787, indoor: false, capacity: 71608, surface: 'turf' },
  CAR_NFL: { name: 'Bank of America Stadium', city: 'Charlotte', lat: 35.226, lon: -80.853, indoor: false, capacity: 74867, surface: 'grass' },
  CIN: { name: 'Paycor Stadium', city: 'Cincinnati', lat: 39.095, lon: -84.516, indoor: false, capacity: 65515, surface: 'turf' },
  CHI_NFL: { name: 'Soldier Field', city: 'Chicago', lat: 41.862, lon: -87.617, indoor: false, capacity: 61500, surface: 'grass' },
  CLE_NFL: { name: 'Cleveland Browns Stadium', city: 'Cleveland', lat: 41.506, lon: -81.700, indoor: false, capacity: 67431, surface: 'grass' },
  DAL_NFL: { name: 'AT&T Stadium', city: 'Arlington', lat: 32.748, lon: -97.093, indoor: true, capacity: 80000, surface: 'turf' },
  DEN_NFL: { name: 'Empower Field at Mile High', city: 'Denver', lat: 39.744, lon: -105.020, indoor: false, capacity: 76125, surface: 'grass', altitude: 5280 },
  DET_NFL: { name: 'Ford Field', city: 'Detroit', lat: 42.340, lon: -83.046, indoor: true, capacity: 65000, surface: 'turf' },
  GB: { name: 'Lambeau Field', city: 'Green Bay', lat: 44.501, lon: -88.062, indoor: false, capacity: 81441, surface: 'grass' },
  HOU_NFL: { name: 'NRG Stadium', city: 'Houston', lat: 29.685, lon: -95.411, indoor: true, capacity: 72220, surface: 'turf' },
  IND_NFL: { name: 'Lucas Oil Stadium', city: 'Indianapolis', lat: 39.760, lon: -86.164, indoor: true, capacity: 67000, surface: 'turf' },
  JAX: { name: 'EverBank Stadium', city: 'Jacksonville', lat: 30.324, lon: -81.637, indoor: false, capacity: 67814, surface: 'grass' },
  KC: { name: 'GEHA Field at Arrowhead Stadium', city: 'Kansas City', lat: 39.049, lon: -94.484, indoor: false, capacity: 76416, surface: 'grass' },
  LV: { name: 'Allegiant Stadium', city: 'Las Vegas', lat: 36.091, lon: -115.184, indoor: true, capacity: 65000, surface: 'turf' },
  LAC_NFL: { name: 'SoFi Stadium', city: 'Inglewood', lat: 33.953, lon: -118.339, indoor: true, capacity: 70240, surface: 'turf' },
  LAR: { name: 'SoFi Stadium', city: 'Inglewood', lat: 33.953, lon: -118.339, indoor: true, capacity: 70240, surface: 'turf' },
  MIA_NFL: { name: 'Hard Rock Stadium', city: 'Miami Gardens', lat: 25.958, lon: -80.239, indoor: false, capacity: 64767, surface: 'grass' },
  MIN_NFL: { name: 'U.S. Bank Stadium', city: 'Minneapolis', lat: 44.974, lon: -93.258, indoor: true, capacity: 66655, surface: 'turf' },
  NE: { name: 'Gillette Stadium', city: 'Foxborough', lat: 42.091, lon: -71.264, indoor: false, capacity: 65878, surface: 'turf' },
  NO: { name: 'Caesars Superdome', city: 'New Orleans', lat: 29.951, lon: -90.081, indoor: true, capacity: 73208, surface: 'turf' },
  NYG: { name: 'MetLife Stadium', city: 'East Rutherford', lat: 40.814, lon: -74.074, indoor: false, capacity: 82500, surface: 'turf' },
  NYJ: { name: 'MetLife Stadium', city: 'East Rutherford', lat: 40.814, lon: -74.074, indoor: false, capacity: 82500, surface: 'turf' },
  PHI_NFL: { name: 'Lincoln Financial Field', city: 'Philadelphia', lat: 39.901, lon: -75.168, indoor: false, capacity: 69176, surface: 'grass' },
  PIT_NFL: { name: 'Acrisure Stadium', city: 'Pittsburgh', lat: 40.447, lon: -80.016, indoor: false, capacity: 68400, surface: 'grass' },
  SF: { name: 'Levi\'s Stadium', city: 'Santa Clara', lat: 37.403, lon: -121.970, indoor: false, capacity: 68500, surface: 'grass' },
  SEA_NFL: { name: 'Lumen Field', city: 'Seattle', lat: 47.595, lon: -122.332, indoor: false, capacity: 68740, surface: 'turf' },
  TB: { name: 'Raymond James Stadium', city: 'Tampa', lat: 27.976, lon: -82.503, indoor: false, capacity: 65618, surface: 'grass' },
  TEN: { name: 'Nissan Stadium', city: 'Nashville', lat: 36.166, lon: -86.771, indoor: false, capacity: 69143, surface: 'turf' },
  WAS_NFL: { name: 'Northwest Stadium', city: 'Landover', lat: 38.908, lon: -76.864, indoor: false, capacity: 65000, surface: 'grass' },

  // ── MLB (mostly outdoor) ──
  ARI_MLB: { name: 'Chase Field', city: 'Phoenix', lat: 33.446, lon: -112.067, indoor: true, capacity: 48519, surface: 'grass' },
  ATL_MLB: { name: 'Truist Park', city: 'Atlanta', lat: 33.891, lon: -84.468, indoor: false, capacity: 41084, surface: 'grass' },
  BAL_MLB: { name: 'Oriole Park at Camden Yards', city: 'Baltimore', lat: 39.284, lon: -76.622, indoor: false, capacity: 45971, surface: 'grass' },
  BOS_MLB: { name: 'Fenway Park', city: 'Boston', lat: 42.346, lon: -71.097, indoor: false, capacity: 37755, surface: 'grass' },
  CHC: { name: 'Wrigley Field', city: 'Chicago', lat: 41.948, lon: -87.656, indoor: false, capacity: 41649, surface: 'grass' },
  CHW: { name: 'Guaranteed Rate Field', city: 'Chicago', lat: 41.830, lon: -87.634, indoor: false, capacity: 40615, surface: 'grass' },
  CIN_MLB: { name: 'Great American Ball Park', city: 'Cincinnati', lat: 39.097, lon: -84.508, indoor: false, capacity: 42319, surface: 'grass' },
  CLE_MLB: { name: 'Progressive Field', city: 'Cleveland', lat: 41.496, lon: -81.685, indoor: false, capacity: 34788, surface: 'grass' },
  COL_MLB: { name: 'Coors Field', city: 'Denver', lat: 39.756, lon: -104.994, indoor: false, capacity: 50398, surface: 'grass', altitude: 5280 },
  DET_MLB: { name: 'Comerica Park', city: 'Detroit', lat: 42.339, lon: -83.049, indoor: false, capacity: 41083, surface: 'grass' },
  HOU_MLB: { name: 'Minute Maid Park', city: 'Houston', lat: 29.757, lon: -95.356, indoor: true, capacity: 41168, surface: 'turf' },
  KC_MLB: { name: 'Kauffman Stadium', city: 'Kansas City', lat: 39.051, lon: -94.481, indoor: false, capacity: 37903, surface: 'grass' },
  LAA: { name: 'Angel Stadium', city: 'Anaheim', lat: 33.800, lon: -117.883, indoor: false, capacity: 45517, surface: 'grass' },
  LAD: { name: 'Dodger Stadium', city: 'Los Angeles', lat: 34.074, lon: -118.240, indoor: false, capacity: 56000, surface: 'grass' },
  MIL_MLB: { name: 'American Family Field', city: 'Milwaukee', lat: 43.028, lon: -87.971, indoor: true, capacity: 41900, surface: 'grass' },
  MIN_MLB: { name: 'Target Field', city: 'Minneapolis', lat: 44.982, lon: -93.278, indoor: false, capacity: 38544, surface: 'grass' },
  NYM: { name: 'Citi Field', city: 'New York', lat: 40.757, lon: -73.846, indoor: false, capacity: 41922, surface: 'grass' },
  NYY: { name: 'Yankee Stadium', city: 'New York', lat: 40.829, lon: -73.926, indoor: false, capacity: 47309, surface: 'grass' },
  OAK: { name: 'Oakland Coliseum', city: 'Oakland', lat: 37.752, lon: -122.201, indoor: false, capacity: 46847, surface: 'grass' },
  PHI_MLB: { name: 'Citizens Bank Park', city: 'Philadelphia', lat: 39.906, lon: -75.166, indoor: false, capacity: 42792, surface: 'grass' },
  PIT_MLB: { name: 'PNC Park', city: 'Pittsburgh', lat: 40.447, lon: -80.006, indoor: false, capacity: 38362, surface: 'grass' },
  SD: { name: 'Petco Park', city: 'San Diego', lat: 32.708, lon: -117.157, indoor: false, capacity: 40209, surface: 'grass' },
  SF_MLB: { name: 'Oracle Park', city: 'San Francisco', lat: 37.779, lon: -122.389, indoor: false, capacity: 41915, surface: 'grass' },
  SEA_MLB: { name: 'T-Mobile Park', city: 'Seattle', lat: 47.591, lon: -122.333, indoor: true, capacity: 47929, surface: 'turf' },
  STL_MLB: { name: 'Busch Stadium', city: 'St. Louis', lat: 38.623, lon: -90.193, indoor: false, capacity: 45494, surface: 'grass' },
  TB_MLB: { name: 'Tropicana Field', city: 'St. Petersburg', lat: 27.768, lon: -82.654, indoor: true, capacity: 42735, surface: 'turf' },
  TEX: { name: 'Globe Life Field', city: 'Arlington', lat: 32.747, lon: -97.084, indoor: true, capacity: 40300, surface: 'turf' },
  TOR_MLB: { name: 'Rogers Centre', city: 'Toronto', lat: 43.641, lon: -79.389, indoor: true, capacity: 49282, surface: 'turf' },
  WAS_MLB: { name: 'Nationals Park', city: 'Washington', lat: 38.873, lon: -77.007, indoor: false, capacity: 41339, surface: 'grass' },

  // ── EPL ──
  ARS: { name: 'Emirates Stadium', city: 'London', lat: 51.555, lon: -0.109, indoor: false, capacity: 60704, surface: 'grass' },
  AVL: { name: 'Villa Park', city: 'Birmingham', lat: 52.509, lon: -1.885, indoor: false, capacity: 42657, surface: 'grass' },
  BOU: { name: 'Vitality Stadium', city: 'Bournemouth', lat: 50.735, lon: -1.838, indoor: false, capacity: 11379, surface: 'grass' },
  BRE: { name: 'Gtech Community Stadium', city: 'London', lat: 51.491, lon: -0.289, indoor: false, capacity: 17250, surface: 'grass' },
  BHA: { name: 'Amex Stadium', city: 'Brighton', lat: 50.862, lon: -0.084, indoor: false, capacity: 31876, surface: 'grass' },
  CHE: { name: 'Stamford Bridge', city: 'London', lat: 51.482, lon: -0.191, indoor: false, capacity: 40341, surface: 'grass' },
  CRY: { name: 'Selhurst Park', city: 'London', lat: 51.398, lon: -0.086, indoor: false, capacity: 26047, surface: 'grass' },
  EVE: { name: 'Goodison Park', city: 'Liverpool', lat: 53.439, lon: -2.966, indoor: false, capacity: 39414, surface: 'grass' },
  FUL: { name: 'Craven Cottage', city: 'London', lat: 51.475, lon: -0.222, indoor: false, capacity: 25700, surface: 'grass' },
  IPS: { name: 'Portman Road', city: 'Ipswich', lat: 52.055, lon: 1.145, indoor: false, capacity: 30311, surface: 'grass' },
  LEI: { name: 'King Power Stadium', city: 'Leicester', lat: 52.620, lon: -1.142, indoor: false, capacity: 32312, surface: 'grass' },
  LIV: { name: 'Anfield', city: 'Liverpool', lat: 53.431, lon: -2.961, indoor: false, capacity: 61276, surface: 'grass' },
  MCI: { name: 'Etihad Stadium', city: 'Manchester', lat: 53.483, lon: -2.200, indoor: false, capacity: 53400, surface: 'grass' },
  MUN: { name: 'Old Trafford', city: 'Manchester', lat: 53.463, lon: -2.291, indoor: false, capacity: 74310, surface: 'grass' },
  NEW: { name: 'St James\' Park', city: 'Newcastle', lat: 54.976, lon: -1.622, indoor: false, capacity: 52305, surface: 'grass' },
  NFO: { name: 'City Ground', city: 'Nottingham', lat: 52.940, lon: -1.133, indoor: false, capacity: 30332, surface: 'grass' },
  SOT: { name: 'St Mary\'s Stadium', city: 'Southampton', lat: 50.906, lon: -1.391, indoor: false, capacity: 32384, surface: 'grass' },
  TOT: { name: 'Tottenham Hotspur Stadium', city: 'London', lat: 51.604, lon: -0.066, indoor: false, capacity: 62850, surface: 'grass' },
  WHU: { name: 'London Stadium', city: 'London', lat: 51.539, lon: -0.017, indoor: false, capacity: 62500, surface: 'grass' },
  WOL: { name: 'Molineux Stadium', city: 'Wolverhampton', lat: 52.590, lon: -2.130, indoor: false, capacity: 32050, surface: 'grass' },
};

/**
 * Look up venue info for a home team.
 * Tries exact short code first, then league-qualified codes (e.g., CHI_NFL, CHI_MLB).
 */
export function getVenue(homeShort: string, league?: string): VenueInfo | null {
  const key = homeShort.toUpperCase();

  // Prefer league-qualified key first for ambiguous abbreviations like MIN/TOR/ATL.
  if (league) {
    const leagueSuffix = league.toUpperCase();
    const qualified = `${key}_${leagueSuffix}`;
    if (VENUES[qualified]) return VENUES[qualified];
  }

  // Direct match fallback
  if (VENUES[key]) return VENUES[key];

  return null;
}

/**
 * Determine if a game is played indoors based on the home team's venue.
 * Returns true for domed/indoor venues (NBA, NHL, some NFL/MLB).
 */
export function isIndoorGame(homeShort: string, league?: string): boolean {
  const venue = getVenue(homeShort, league);
  if (venue) return venue.indoor;

  // Default by league if venue not found
  const lg = (league || '').toLowerCase();
  if (lg === 'nba' || lg === 'nhl' || lg === 'ncaab' || lg === 'wnba') return true;
  return false;
}

/**
 * Check if venue is at high altitude (>4000 ft) — relevant for game performance.
 */
export function isHighAltitude(homeShort: string, league?: string): boolean {
  const venue = getVenue(homeShort, league);
  return (venue?.altitude ?? 0) >= 4000;
}
