/* Data surfaces: Live match centre, real standings table, form & head-to-head.
   Uses the site's existing CSS custom props (--surface, --line, --brand, etc.).
   Loaded only on pages that need it (live.ejs <link>, and via the partials). */

/* ---------- Live match centre ---------- */
.lcm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.lcm-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  transition: .15s;
  color: var(--text);
}
a.lcm-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.lcm-card-static { cursor: default; }
.lcm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .6rem;
}
.lcm-comp { text-transform: uppercase; letter-spacing: .03em; }
.lcm-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: .5rem;
  margin-bottom: .8rem;
}
.lcm-team { font-weight: 700; font-size: .95rem; }
.lcm-team-a { text-align: right; }
.lcm-goals {
  font-weight: 800;
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  color: var(--brand);
}
.lcm-bars { display: flex; flex-direction: column; gap: .35rem; }
.lcm-bar { display: flex; flex-direction: column; gap: .15rem; }
.lcm-lbl { font-size: .8rem; color: var(--muted); display: flex; justify-content: space-between; }
.lcm-lbl b { color: var(--text); font-variant-numeric: tabular-nums; }
.lcm-track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lcm-track > span { display: block; height: 100%; background: var(--brand); border-radius: 3px; }
.lcm-likely { margin: .6rem 0 0; }
.lcm-more { display: inline-block; margin-top: .6rem; color: var(--brand); font-weight: 600; font-size: .85rem; }

/* ---------- Real standings (partials/standings.ejs) ---------- */
.hl-standings { margin: 1rem 0; }
.hl-standings-table { width: 100%; border-collapse: collapse; }
.hl-standings-table th,
.hl-standings-table td {
  padding: .4rem .5rem;
  font-size: .88rem;
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.hl-standings-table th { color: var(--muted); font-weight: 600; }
.hl-standings-table .hl-team { text-align: left; font-weight: 600; }
.hl-standings-table .hl-pos { color: var(--muted); width: 2rem; }
.hl-standings-table .hl-n,
.hl-standings-table .hl-pts { font-variant-numeric: tabular-nums; }
.hl-standings-table .hl-pts { font-weight: 700; color: var(--text); }

/* ---------- Form & head-to-head (partials/form-h2h.ejs) ---------- */
.form-h2h {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}
.fh-forms { display: flex; flex-direction: column; gap: .6rem; margin-bottom: .8rem; }
.fh-form-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.fh-team { font-weight: 600; min-width: 9rem; }
.fh-pills { display: inline-flex; gap: .3rem; }
.fh-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 5px;
  font-size: .78rem;
  font-weight: 700;
  color: #06231a;
}
.fh-pill.fp-w { background: var(--win); color: #06231a; }
.fh-pill.fp-d { background: var(--surface-2); color: var(--muted); }
.fh-pill.fp-l { background: rgba(242, 95, 92, .18); color: var(--danger); }

.fh-h2h-title { font-size: 1rem; margin: .4rem 0 .5rem; }
.fh-h2h-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.fh-h2h-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  padding: .35rem .5rem;
  border-radius: 8px;
  background: var(--surface-2);
}
.fh-h2h-teams { font-size: .9rem; }
.fh-h2h-score { font-variant-numeric: tabular-nums; color: var(--brand); padding: 0 .25rem; }

/* ===========================================================================
   GOLD-HIGHLIGHT owned players (collection) — pitch dots, lineup cards + the
   advanced owned-player stats panel. Gold = a player in the user's collection.
   =========================================================================== */
/* ONE GOLD: standardise the owned/legendary gold on the shared --warn token
   (#f5b921) so the SwiftSquad owned highlight is identical everywhere (pitch
   dots, lineup cards, swift-match.css). --gold-2 is the agreed lighter sibling
   used only for name text on dark surfaces. The glow uses --warn directly. */
:root { --gold: var(--warn); --gold-2: #ffe08a; }

/* Pitch dot: gold ring + glow on the number badge, gold name. */
.player.is-owned i {
  box-shadow: 0 0 0 2px var(--gold), 0 0 8px 1px rgba(245,185,33,.7);
  outline: 1px solid rgba(0,0,0,.3);
}
.player.is-owned b { color: var(--gold-2); text-shadow: 0 0 4px rgba(245,185,33,.5); }
.own-star { color: var(--gold); margin-left: .1em; font-size: .9em; line-height: 1; }
/* OWNED STAR CLIPPING FIX: on the pitch dot the star is now a SIBLING of the
   ellipsis-clipped <b> player name (see pitch.ejs), so it can never be cut off.
   The .player is already position:absolute (styles.css), so we pin the star to
   the dot's top-right; it can't push the name onto a second line or be clipped. */
.player .own-star{position:absolute;top:-4px;right:6px;margin:0;font-size:.8em;
  text-shadow:0 0 4px rgba(245,185,33,.65),0 1px 1px rgba(0,0,0,.5)}

/* Lineup pcard: gold left edge + faint gold wash. */
.pcard.is-owned {
  border-color: rgba(245,185,33,.55);
  box-shadow: inset 3px 0 0 var(--gold), 0 0 0 1px rgba(245,185,33,.15);
  background: linear-gradient(90deg, rgba(245,185,33,.10), transparent 60%);
}
.pcard.is-owned .pcard-name { color: var(--gold-2); }

/* Owned-player advanced stats panel. */
.owned-stats h2 .own-star { font-size: 1em; margin-right: .15em; }
.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .7rem;
  margin: .6rem 0;
}
.ops-card {
  border: 1px solid rgba(245,185,33,.4);
  border-radius: 10px;
  padding: .7rem .8rem;
  background: linear-gradient(160deg, rgba(245,185,33,.08), rgba(255,255,255,.015));
}
.ops-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.ops-photo {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
  box-shadow: 0 0 0 2px var(--gold), 0 0 8px rgba(245,185,33,.5); background: var(--surface-2);
}
.ops-photo-ph { display: flex; align-items: center; justify-content: center; color: var(--gold); font-size: 1.1rem; }
.ops-id { display: flex; flex-direction: column; min-width: 0; }
.ops-name { font-weight: 700; color: var(--gold-2); line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-rating {
  margin-left: auto; flex: 0 0 auto; font-weight: 800; font-size: .95rem;
  color: #06231a; background: var(--gold); border-radius: 6px; padding: .12rem .4rem;
  font-variant-numeric: tabular-nums;
}
.ops-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem .3rem; }
.ops-stat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.ops-v { font-weight: 800; font-size: 1.05rem; color: var(--text); font-variant-numeric: tabular-nums; }
.ops-l { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }

/* ===========================================================================
   BOTTOM-NAV TAP TARGET (global). live.css is linked from header.ejs on EVERY
   page, so this guarantees >=44px tap targets on ALL pages (not just the
   games/predictor/fantasy pages that load swift-mobile.css). It also makes the
   body padding-bottom clear the fixed nav INCLUDING the iOS home-indicator via
   env(safe-area-inset-bottom). Mirrors the @media(max-width:760px) breakpoint
   that defines .bottom-nav in styles.css. (Ideally this lives in styles.css —
   see integrationNotes — but styles.css is outside this lane.) */
@media (max-width: 760px) {
  .bottom-nav a { min-height: 44px; justify-content: center; }
  /* nav box ≈ 44px tap row + .3rem top pad + safe-area inset; clear all of it */
  body { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
}
