/* ==========================================================
   GAMES — /<league>/games and /<league>/games/<slug>

   Follows DESIGN_SYSTEM.md on the black + green surface palette the
   simulator and projections pages share. Team colours appear only as
   small accents (logo rings, list dots).
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=optional');

:root {
  --font-display: 'Sora', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SF Mono', monospace;

  --glow-primary: rgba(30, 251, 151, 0.4);
  --tint-primary: rgba(30, 251, 151, 0.12);

  --ng-bg: var(--surface-page);
  --ng-surface: var(--surface-card);
  --ng-elevated: var(--surface-raised);
  --ng-hover: var(--surface-hover);
  --ng-border: var(--surface-border);
  --ng-text: var(--surface-text);
  --ng-text-secondary: var(--surface-text-secondary);
  --ng-text-tertiary: var(--surface-text-tertiary);
  --ng-max-width: 1120px;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.35; transform: scale(0.8); }
}

main:has(.ng-page) {
  background: var(--ng-bg);
}

.ng-page {
  min-height: 100vh;
  padding-bottom: 80px;
  font-family: var(--font-display);
  color: var(--ng-text);
}

/* ===== HEADER ===== */
.ng-header {
  max-width: var(--ng-max-width);
  margin: 0 auto;
  padding: 56px 24px 28px;
  animation: fadeUp 0.5s ease-out;
}

.ng-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.ng-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  background: rgba(30, 251, 151, 0.1);
  border: 1px solid rgba(30, 251, 151, 0.25);
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  line-height: 1;
}

.ng-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
  animation: livePulse 2s ease-in-out infinite;
}

.ng-state {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ng-text-tertiary);
  background: var(--ng-elevated);
  border: 1px solid var(--ng-border);
  padding: 5px 9px;
  border-radius: 6px;
}

.ng-state-upcoming { color: var(--color-primary); background: var(--tint-primary); border-color: rgba(30, 251, 151, 0.3); }
.ng-state-started { color: #F5C451; background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.3); }
.ng-state-postponed,
.ng-state-canceled { color: #FCA5A5; background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); }

.ng-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--color-white);
  margin: 0 0 14px;
}

.ng-subtitle {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ng-text-secondary);
  margin: 0;
  max-width: 680px;
}

.ng-container {
  max-width: var(--ng-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== TEAM MARKS ===== */
.ng-logo {
  position: relative;
  flex: none;
  display: inline-flex;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--ng-elevated);
  border: 2px solid var(--team-color, var(--ng-border));
}

/* The artwork is full-bleed square; it fills the ring. */
.ng-logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.ng-logo-large { width: 64px; height: 64px; }

.ng-at {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ng-text-tertiary);
}

/* ===== BUTTONS ===== */
.ng-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.ng-btn-primary {
  background: var(--color-primary);
  color: var(--color-black);
  box-shadow: 0 2px 12px var(--glow-primary);
}

.ng-btn-primary:hover {
  box-shadow: 0 4px 20px var(--glow-primary);
  transform: translateY(-1px);
}

.ng-btn-ghost {
  background: transparent;
  color: var(--ng-text-secondary);
  border-color: var(--ng-border);
}

.ng-btn-ghost:hover {
  color: var(--color-white);
  background: var(--ng-hover);
}

.ng-btn-large {
  font-size: 0.95rem;
  padding: 14px 24px;
}

/* ===== INDEX: DAYS AND CARDS ===== */
.ng-day {
  margin-bottom: 40px;
  animation: fadeUp 0.5s ease-out 0.1s both;
}

.ng-day-title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ng-text-tertiary);
  margin: 0 0 14px;
}

.ng-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.ng-card {
  display: flex;
  flex-direction: column;
  background: var(--ng-surface);
  border: 1px solid var(--ng-border);
  border-radius: 16px;
  overflow: hidden;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.ng-card:hover {
  border-color: var(--color-primary);
  background: var(--ng-hover);
  transform: translateY(-2px);
}

.ng-card-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px 16px;
  color: inherit;
  text-decoration: none;
}

/* Away over home, scoreboard style, so long nicknames ("Buccaneers") fit. */
.ng-card-teams {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.ng-card-teams .ng-at {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ng-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ng-team-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ng-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--ng-text-tertiary);
}

.ng-time { color: var(--ng-text-secondary); font-weight: 600; }
.ng-time-started { color: #F5C451; }
.ng-time-off { color: #FCA5A5; }

.ng-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  margin-top: auto;
  border-top: 1px solid var(--ng-border);
}

.ng-empty {
  background: var(--ng-surface);
  border: 1px solid var(--ng-border);
  border-radius: 16px;
  padding: 28px;
  animation: fadeUp 0.5s ease-out 0.1s both;
}

.ng-empty h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 8px; color: var(--color-white); }
.ng-empty p { margin: 0; color: var(--ng-text-secondary); line-height: 1.6; }
.ng-empty a { color: var(--color-primary); }

/* ===== GAME PAGE ===== */
.ng-matchup {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.ng-matchup-team {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ng-matchup-copy { display: flex; flex-direction: column; gap: 4px; }

.ng-matchup-name { font-size: 1.05rem; font-weight: 700; color: var(--color-white); }

.ng-matchup-side {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ng-text-tertiary);
}

.ng-at-large { font-size: 0.8rem; }

.ng-game-title { margin-bottom: 10px; }

.ng-game-meta {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ng-text-secondary);
  margin: 0;
}

.ng-intro {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ng-text-secondary);
  margin: 18px 0 0;
  max-width: 760px;
}

.ng-final {
  display: inline-block;
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-white);
  background: var(--ng-elevated);
  border: 1px solid var(--ng-border);
  border-radius: 8px;
  padding: 6px 10px;
}

.ng-sim-cta { margin-top: 22px; }

/* Sections */
.ng-section {
  margin-bottom: 32px;
  animation: fadeUp 0.5s ease-out 0.15s both;
}

.ng-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ng-h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0;
}

.ng-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ng-text-tertiary);
}

/* Top lines: each tile jumps to its comparison below. */
.ng-lines {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 32px;
  animation: fadeUp 0.5s ease-out 0.1s both;
}

.ng-line {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  background: var(--ng-surface);
  border: 1px solid var(--ng-border);
  border-radius: 16px;
  padding: 18px 20px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

a.ng-line:hover {
  border-color: var(--color-primary);
  background: var(--ng-hover);
  transform: translateY(-2px);
}

a.ng-line:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.ng-line-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ng-text-tertiary);
}

.ng-line-value {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-white);
  white-space: nowrap;
}

.ng-line-detail {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ng-text-secondary);
  white-space: nowrap;
}

.ng-line-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--ng-border);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
}

.ng-line-action svg { flex: none; }

.ng-sides {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ng-side {
  background: var(--ng-surface);
  border: 1px solid var(--ng-border);
  border-radius: 16px;
  padding: 18px 20px;
}

.ng-side-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-white);
  margin: 0 0 10px;
}

.ng-side-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--team-color);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.ng-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ng-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-top: 1px solid var(--ng-border);
  font-size: 0.9rem;
}

.ng-row:first-child { border-top: none; }

.ng-row a {
  color: var(--ng-text);
  text-decoration: none;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ng-row a:hover { color: var(--color-primary); }

.ng-pos {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--ng-text-tertiary);
  background: var(--color-gray-700);
  padding: 3px 6px;
  border-radius: 4px;
}

.ng-badge {
  margin-left: auto;
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
}

.ng-badge-out { color: #FCA5A5; background: rgba(239, 68, 68, 0.14); }
.ng-badge-warn { color: #F5C451; background: rgba(245, 158, 11, 0.14); }
.ng-badge-props { color: var(--color-primary); background: var(--tint-primary); }

.ng-side-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ng-text-tertiary);
}

/* Lineups: batting slot, "SP" or "G" ahead of the name. */
.ng-slot {
  flex: none;
  min-width: 26px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-primary);
  background: var(--tint-primary);
  padding: 3px 5px;
  border-radius: 4px;
}

.ng-row-name {
  font-weight: 600;
  color: var(--ng-text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ng-pending {
  margin: 0;
  background: var(--ng-surface);
  border: 1px solid var(--ng-border);
  border-radius: 16px;
  padding: 18px 20px;
  font-size: 0.9rem;
  color: var(--ng-text-secondary);
}

/* ===== ODDS COMPARISON ===== */
.ng-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--ng-surface);
  border: 1px solid var(--ng-border);
  border-radius: 16px;
}

.ng-odds-table,
.ng-box-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ng-odds-table th,
.ng-odds-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--ng-border);
  text-align: center;
  white-space: nowrap;
}

.ng-odds-table thead th {
  border-top: none;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ng-text-tertiary);
  background: var(--ng-elevated);
}

/* Fixed price columns; the sportsbook column takes the rest and long names wrap. */
.ng-odds-table { table-layout: fixed; }

.ng-odds-table thead th[data-side] { width: 28%; letter-spacing: 0.04em; }

.ng-odds-table th[scope="row"],
.ng-odds-table .ng-odds-book-head {
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

.ng-odds-book {
  font-weight: 600;
  color: var(--ng-text);
  line-height: 1.3;
}

.ng-odds-book-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ng-odds-book img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; flex: none; }

.ng-odds-price { font-family: var(--font-mono); font-weight: 600; color: var(--ng-text); }

/* The best price's books, or a book's own line when it doesn't price the selected one. */
.ng-odds-sub {
  display: block;
  margin-top: 3px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--ng-text-tertiary);
}

.ng-odds-none { color: var(--ng-text-tertiary); }

.ng-odds-table td.is-best {
  background: var(--tint-primary);
  box-shadow: inset 0 0 0 1px rgba(30, 251, 151, 0.35);
}

.ng-odds-table td.is-best .ng-odds-price { color: var(--color-primary); }

.ng-odds-best th,
.ng-odds-best td { background: rgba(30, 251, 151, 0.06); }

.ng-odds-best th[scope="row"] { color: var(--color-primary); font-weight: 700; }

.ng-odds-best .ng-odds-price { color: var(--color-primary); }

.ng-odds-table tbody tr:not(.ng-odds-best):hover > * { background: rgba(30, 251, 151, 0.05); }

.ng-odds { scroll-margin-top: calc(var(--site-header-height) + 16px); }

/* A tile's jump lands here; the table flashes so the eye finds it. */
.ng-odds:target .ng-table-scroll { animation: ngTarget 1.6s ease-out; }

@keyframes ngTarget {
  0%, 35% { border-color: var(--color-primary); box-shadow: 0 2px 12px var(--glow-primary); }
}

/* Spread and total line: step through or pick any line a book prices. */
.ng-line-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 440px;
  margin-bottom: 12px;
}

.ng-step {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 44px;
  padding: 0;
  background: var(--ng-elevated);
  border: 1px solid var(--ng-border);
  border-radius: 10px;
  color: var(--ng-text-secondary);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.ng-step:hover:not(:disabled) { color: var(--color-primary); border-color: var(--color-primary); }
.ng-step:disabled { opacity: 0.35; cursor: default; }
.ng-step:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

.ng-select {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 34px 0 12px;
  background: var(--ng-elevated) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231EFB97' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--ng-border);
  border-radius: 10px;
  color: var(--ng-text);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  text-overflow: ellipsis;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.ng-select:focus { outline: none; border-color: var(--color-primary); }

.ng-odds-note {
  margin: -16px 2px 32px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ng-text-tertiary);
}

.ng-about .ng-h2 { margin-bottom: 10px; }
.ng-about .ng-intro { margin: 0; }

/* ===== PROJECTED BOX SCORE ===== */
.ng-box-team { margin-bottom: 20px; }

.ng-box-team .ng-table-scroll { margin-bottom: 12px; }

.ng-box-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.ng-box-table th,
.ng-box-table td {
  padding: 9px 12px;
  border-top: 1px solid var(--ng-border);
  text-align: right;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.ng-box-table thead th {
  border-top: none;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ng-text-tertiary);
  background: var(--ng-elevated);
}

.ng-box-table th[scope="row"],
.ng-box-table thead th:first-child {
  text-align: left;
  font-family: var(--font-display);
  position: sticky;
  left: 0;
  background: var(--ng-surface);
}

.ng-box-table thead th:first-child { background: var(--ng-elevated); color: var(--ng-text-secondary); }

.ng-box-table th[scope="row"] { font-weight: 600; color: var(--ng-text); min-width: 160px; }

.ng-box-table th[scope="row"] a { color: inherit; text-decoration: none; }

.ng-box-table th[scope="row"] a:hover { color: var(--color-primary); }

.ng-box-table td { color: var(--ng-text-secondary); }

.ng-box-table tbody tr:hover td,
.ng-box-table tbody tr:hover th { background: rgba(30, 251, 151, 0.05); }

/* Footer links */
.ng-more {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.ng-more a {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ng-text-secondary);
  text-decoration: none;
  background: var(--ng-surface);
  border: 1px solid var(--ng-border);
  border-radius: 10px;
  padding: 10px 14px;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.ng-more a:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* ===== MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  .ng-header, .ng-day, .ng-empty, .ng-lines, .ng-section { animation: none; }
  .ng-chip-dot, .ng-odds:target .ng-table-scroll { animation: none; }
  .ng-card, .ng-btn, .ng-line, .ng-more a { transition: none; }
  .ng-card:hover, .ng-btn-primary:hover, a.ng-line:hover { transform: none; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .ng-odds-table th,
  .ng-odds-table td { padding: 10px 8px; }
  .ng-odds-table thead th[data-side] { width: 92px; }
  .ng-odds-table th.ng-odds-book { font-size: 0.8rem; }
  .ng-odds-book-inner { gap: 8px; }
}

@media (max-width: 600px) {
  .ng-header { padding: 40px 16px 24px; }
  .ng-container { padding: 0 16px; }
  .ng-grid { grid-template-columns: 1fr; }
  .ng-sides { grid-template-columns: 1fr; }
  .ng-matchup { gap: 12px 16px; }
  .ng-logo-large { width: 48px; height: 48px; }
  .ng-at-large { display: none; }
  .ng-sim-cta { width: 100%; }
  /* The three lines become rows of one card: label, line, other side, jump. */
  .ng-lines {
    grid-template-columns: 1fr;
    gap: 0;
    background: var(--ng-surface);
    border: 1px solid var(--ng-border);
    border-radius: 16px;
    overflow: hidden;
  }
  .ng-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto 14px;
    align-items: baseline;
    gap: 12px;
    border: none;
    border-top: 1px solid var(--ng-border);
    border-radius: 0;
    padding: 14px 16px;
  }
  .ng-line:first-child { border-top: none; }
  a.ng-line:hover { transform: none; }
  .ng-line-value { font-size: 1rem; }
  .ng-line-detail { font-size: 0.72rem; }
  .ng-line-action { margin: 0; padding: 0; border: none; align-self: center; }
  .ng-line-action-text { display: none; }
}
