/* =====================================================================
   PARLAY VIEW PRIMITIVES (pdc-*) — the read-only parts of the Active /
   History parlay card: status pill, summary meta + progress, game-state
   scoreboard, leg rows (identity | market · line | value over bar |
   status chip). Moved verbatim out of /apps/styles.css on 2026-10-01 so
   the public share page and Community (which don't load styles.css) use
   the same rules instead of copies. Load it BEFORE /apps/styles.css on
   pages that also load that file: its later blocks refine these rules.
   Card chrome, toggles, ⋯ menu and Quick View stay in styles.css.
   ===================================================================== */
.pdc-pill {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px;
  border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; white-space: nowrap;
}
.pdc-pill.live { background: rgba(34,197,94,.14); color: #4ade80; }
.pdc-pill.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.pdc-pill.upcoming { background: rgba(59,130,246,.16); color: #93c5fd; }
.pdc-pill.dead { background: rgba(239,68,68,.14); color: #f87171; }
.pdc-pill.final { background: rgba(148,163,184,.14); color: #cbd5e1; }
/* History results (2026-10-01): the same green/red as LIVE/DEAD and the
   hit/missed bars, so a won and a lost parlay never look alike. */
.pdc-pill.won { background: rgba(34,197,94,.14); color: #4ade80; }
.pdc-pill.lost { background: rgba(239,68,68,.14); color: #f87171; }
.pdc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 12.5px; color: var(--muted); }
.pdc-meta strong { color: var(--text); font-weight: 650; }
.pdc-dot { opacity: .45; }
.pdc-progress { display: block; height: 4px; max-width: 420px; margin-top: 3px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.pdc-progress-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s ease; }
.pdc-progress-fill.good { background: linear-gradient(90deg, #16a34a, #4ade80); }
.pdc-progress-fill.dead { background: linear-gradient(90deg, #b91c1c, #f87171); }
.pdc-progress-fill.neutral { background: rgba(148,163,184,.35); }

/* Game heading text + state */
.pdc-game-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.pdc-game-matchup { min-width: 0; font-size: 13.5px; font-weight: 650; overflow-wrap: anywhere; }
.pdc-game-state { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; font-size: 12px; color: var(--muted); }
.pdc-state { font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.pdc-state.live { color: #4ade80; }
.pdc-state.final { color: #cbd5e1; }
.pdc-state.pending { color: #93c5fd; }
.pdc-score { font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }

/* Legs: identity | market · line | value over bar | status */
.pdc-legs { display: flex; flex-direction: column; }
.pdc-legs[hidden] { display: none; }
.pdc-leg {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.15fr) minmax(120px, .9fr) 78px;
  grid-template-areas: "id market val status" "id market bar status";
  column-gap: 16px; row-gap: 5px; align-items: center;
  padding: 9px 10px;
}
.pdc-leg + .pdc-leg { border-top: 1px solid rgba(255,255,255,.045); }
.pdc-leg.is-void { opacity: .6; }
.pdc-leg-id { grid-area: id; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.pdc-jersey {
  padding: 1px 7px; border-radius: 999px; line-height: 1.4;
  font-size: 11px; font-weight: 700; color: #b7d7ff;
  background: rgba(59,130,246,.14); border: 1px solid rgba(59,130,246,.22);
}
.pdc-name { min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.pdc-team { padding: 1px 7px; border-radius: 999px; line-height: 1.4; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; color: var(--muted); background: rgba(255,255,255,.07); }
/* 2026-11-08 (badge spacing polish): in Active / History / Community rows
   the jersey, name and team tag flow like one line of text, so a long name
   wraps word by word with the tag right after its last word, instead of the
   jersey or the tag taking a line of their own. (Tonight's .pdq-item rows
   keep their own layout.) */
.pdc-leg:not(.pdq-item) > .pdc-leg-id { display: block; line-height: 1.45; }
.pdc-leg:not(.pdq-item) > .pdc-leg-id > .pdc-jersey,
.pdc-leg:not(.pdq-item) > .pdc-leg-id > .pdc-team { display: inline-block; line-height: 1.35; vertical-align: 1px; white-space: nowrap; }
.pdc-leg:not(.pdq-item) > .pdc-leg-id > .pdc-name { display: inline; overflow-wrap: break-word; }
.pdc-leg-market { grid-area: market; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; font-size: 13px; }
.pdc-market { font-weight: 500; }
.pdc-line { color: var(--muted); white-space: nowrap; }
.pdc-sub { flex-basis: 100%; font-size: 11px; color: var(--muted); }
.pdc-leg-val { grid-area: val; align-self: end; font-size: 12.5px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pdc-leg-val b { color: var(--text); font-weight: 700; }
.pdc-leg-bar { grid-area: bar; align-self: start; min-height: 6px; }
.pdc-bar { display: block; height: 6px; border-radius: 999px; background: rgba(255,255,255,.07); overflow: hidden; }
.pdc-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .42s ease; }
.pdc-fill.hit { background: linear-gradient(90deg, #16a34a, #4ade80); }
.pdc-fill.missed { background: linear-gradient(90deg, #dc2626, #f87171); }
.pdc-fill.void { background: rgba(148,163,184,.25); }
.pdc-leg-status { grid-area: status; justify-self: end; }
.pdc-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 64px; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .03em; white-space: nowrap;
}
.pdc-chip.hit { background: rgba(34,197,94,.15); color: #4ade80; }
.pdc-chip.missed { background: rgba(239,68,68,.15); color: #f87171; }
.pdc-chip.pending { background: rgba(250,204,21,.12); color: #facc15; }
.pdc-chip.void,
.pdc-chip.push { background: rgba(148,163,184,.12); color: #94a3b8; }
/* Provisional result (2026-10-10): the best current grade of a finished,
   not-yet-reconciled game — same colour, dashed outline, a touch quieter. */
.pdc-chip.is-provisional { outline: 1px dashed currentColor; outline-offset: -1px; opacity: .9; }
.pdc-muted { color: var(--muted); }

@media (max-width: 640px) {
  .pdc-progress { max-width: none; }
  .pdc-leg {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "id status" "market val" "bar bar";
    column-gap: 10px; row-gap: 5px; padding: 10px 6px;
  }
  .pdc-leg-val { align-self: center; justify-self: end; }
  .pdc-leg-status { align-self: start; }
  .pdc-leg-bar { min-height: 0; }
  .pdc-leg-bar:empty { display: none; }
  .pdc-leg:not(.pdq-item) .pdc-team { padding: 1px 6px; }
}

/* ---- Game state: [● LIVE] Q3 · 5:48  NYY 3 – 2 BOS ---- */
.pdc-game-state { gap: 3px 8px; }
.pdc-state {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; white-space: nowrap;
}
.pdc-game-state.is-live .pdc-state,
.pdc-game-state.is-final .pdc-state {
  height: 19px; padding: 0 7px; border-radius: 999px;
}
.pdc-game-state.is-live .pdc-state { background: rgba(34,197,94,.14); color: #4ade80; }
.pdc-game-state.is-live .pdc-state::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: #22c55e;
  animation: pdLivePulse 2s ease-in-out infinite;
}
.pdc-game-state.is-final .pdc-state { background: rgba(148,163,184,.14); color: #e2e8f0; }
.pdc-game-state.is-upcoming .pdc-state { font-weight: 600; letter-spacing: .01em; color: #93c5fd; }
.pdc-clock { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pdc-score {
  display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap;
  font-size: 12.5px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums;
}
.pdc-score-team { font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.pdc-score-n { font-size: 14px; font-weight: 700; color: #cbd5e1; }
.pdc-score-n.is-lead { color: #fff; }
.pdc-score-sep { opacity: .5; }
/* Status · clock | score (2026-11-08): a thin divider keeps the score from
   running into the clock, most visibly on phones. */
.pdc-game-state > .pdc-score { padding-left: 9px; border-left: 1px solid rgba(255,255,255,.14); }
@keyframes pdLivePulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .pdc-game-state.is-live .pdc-state::before { animation: none; }
}
.pdc-game-text { align-items: center; }

/* ---- Community-only leg options (v1.6 2C, opt-in from legHtml) ----
   Context line under the market, the pre-game row (the pick only) and
   ✓/✕/– chip icons. Active/History never pass these options. */
.pdc-ctx { flex-basis: 100%; display: block; margin-top: 1px; font-size: 11.5px; color: var(--muted); }
.pdc-ctx b { color: #facc15; font-weight: 650; }
.pdc-leg.is-missed .pdc-ctx b { color: #f87171; }
.pdc-chip svg { width: 10px; height: 10px; margin-right: 4px; flex: 0 0 auto; }
.pdc-leg.is-pregame { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1.15fr) auto; grid-template-areas: "id market status"; }
.pdc-leg.is-pregame .pdc-leg-aside { justify-self: end; align-self: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
