/* sd-ff.css — Sunday's fantasy layer (sd-ffui.js). Uses sd.css tokens only; team accents
   arrive per element as --c (already contrast-checked against the card surface in JS). */

/* ── your matchup, top of the Scores board ── */
#ff-head:empty { display: none; }
#ff-head { padding: 0 var(--gutter); margin: 8px auto 0; max-width: 760px; box-sizing: border-box; }
/* Scores only: Matchups and Standings hide the board and have their own headers. */
#board-view:has(#board[hidden]) #ff-head { display: none; }
.ffm { display: block; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 12px 14px 10px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.ffm-note { color: var(--muted); font-size: 13px; padding: 10px 14px; }
.ffm-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.ffm-lbl { font: 600 12px/1 var(--cond); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ffm-wp { font: 700 15px/1 var(--display); letter-spacing: 0.04em; color: var(--flag); }
.ffm-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.ffm-vs { font: 600 12px/1 var(--cond); color: var(--faint); text-transform: uppercase; letter-spacing: 0.08em; }
.ffm-team { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ffm-team.opp { flex-direction: row-reverse; text-align: right; }
.ffm-tn { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ffm-tn b { font: 700 15px/1.1 var(--display); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ffm-tn small, .ffm-sc small { font-size: 11px; color: var(--muted); }
.ffm-sc { display: flex; flex-direction: column; align-items: flex-end; }
.ffm-team.opp .ffm-sc { align-items: flex-start; }
.ffm-sc b { font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.ffm-team.me .ffm-sc b { color: var(--ink); }
.ffm-team.opp .ffm-sc b { color: var(--ink-2); }
.ffm-bar { display: flex; height: 5px; border-radius: 3px; overflow: hidden; margin: 10px 0 8px; background: var(--surface-3); }
.ffm-bar i { display: block; height: 100%; }
.ffm-bar i:last-child { flex: 1; }
.ffm-status { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--muted); }
.ffm-live { font: 700 11px/1 var(--cond); letter-spacing: 0.08em; text-transform: uppercase; color: var(--bad-text); }
.ffm-live::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); margin-right: 4px; vertical-align: 1px; }
.ffm-p { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ffm-p.me { color: var(--ink); font-weight: 600; }
.ffm-p + .ffm-p::before { content: "· "; color: var(--faint); }
.ffm-left { margin-left: auto; }
.ffm-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ffm-pickb { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); font: 500 13px/1 var(--body); cursor: pointer; }
.ffm-pickb:hover { border-color: var(--flag); }

/* team crest: monogram underneath, logo on top (removed on error) */
.ff-crest { position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--c); color: var(--ci); font: 700 10px/1 var(--cond); letter-spacing: 0.02em; }
.ff-crest img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--surface-2); }
.ff-crest.cutout img { object-fit: contain; background: var(--c); }

/* ── game cards: GFFL starters in this game ── */
.ff-card { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.lrow .ff-card { margin-top: 4px; padding-top: 4px; border-top: 0; grid-column: 1 / -1; }
.ffc { display: inline-flex; align-items: center; gap: 5px; padding: 2px 7px 2px 3px; border-radius: 999px; font-size: 11.5px; line-height: 1.5; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.ffc b { font-variant-numeric: tabular-nums; color: var(--ink); }
.ffc.me { color: var(--ink); font-weight: 600; background: color-mix(in srgb, var(--c) 18%, var(--surface-2)); }

/* ── play rows: who the play scored for ── */
.ff-play { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
/* In a play row the chips sit under the play text, not across the down-and-distance column. */
.play > .ff-play { grid-column: 2 / -1; margin-top: 0; }
.ffp { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px 2px 3px; border-radius: 999px; font-size: 12px; background: var(--surface-2); color: var(--ink-2); }
.ffp b { font-variant-numeric: tabular-nums; color: var(--ink); }
.ffp.me { background: color-mix(in srgb, var(--c) 20%, var(--surface-2)); color: var(--ink); }
.ffp.me b { color: var(--flag); }
.ffp.bench { opacity: 0.6; }

/* ── Fantasy tab ── */
.ff-tab { padding-bottom: 16px; }
.ff-impact { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; padding: 12px 14px; margin: 4px 0 8px; background: var(--surface-2); border-radius: var(--radius); font-size: 12px; color: var(--muted); }
.ff-impact b { font: 700 22px/1 var(--display); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ff-impact b.me { color: var(--ink); }
.ff-impact em { font-style: normal; margin-right: 8px; }
.ff-impact > span:first-child { font: 600 11px/1 var(--cond); letter-spacing: 0.12em; text-transform: uppercase; margin-right: 6px; }
.ff-net { margin-left: auto; font: 700 13px/1 var(--cond); letter-spacing: 0.04em; }
.ff-net.up { color: var(--good); }
.ff-net.down { color: var(--bad-text); }
.ff-h { display: flex; justify-content: space-between; margin: 16px 2px 6px; font: 600 12px/1 var(--cond); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.ff-h span { color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.ff-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ffr { display: grid; grid-template-columns: 44px 1fr auto 52px; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--line); }
.ffr:first-child { border-top: 0; }
.ffr.me { box-shadow: inset 3px 0 0 var(--flag); }
.ffr.bench { opacity: 0.7; }
.ff-hs { width: 44px; height: 32px; object-fit: cover; object-position: top; border-radius: 4px; background: var(--surface-2); }
img.ff-hs.logo { object-fit: contain; width: 32px; height: 32px; justify-self: center; background: none; }
.ffr-m { min-width: 0; }
.ffr-n { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ffr-n small { font-weight: 400; font-size: 11px; color: var(--muted); margin-left: 2px; }
.ffr-l { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ffr-p { font: 700 20px/1 var(--display); text-align: right; font-variant-numeric: tabular-nums; }
/* owner crest (ffTag): the GFFL logo in place of the team name; BN beside it for a bench man,
   a gold ring around your own crest */
.ff-own { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.ff-own.me .ff-crest { box-shadow: 0 0 0 2px var(--flag); }
.ff-bn { font: 700 10px/1 var(--cond); letter-spacing: 0.06em; color: var(--muted); padding: 2px 4px; border: 1px solid var(--line-2); border-radius: 3px; }
.ffr .ff-own { justify-self: end; }
.ff-tag { font: 600 11px/1 var(--cond); letter-spacing: 0.06em; padding: 3px 6px; border-radius: 3px; border: 1px solid var(--c); color: var(--ink-2); white-space: nowrap; }
.ff-tag.fa { border-color: var(--line-2); color: var(--muted); }
.ff-big { display: grid; gap: 6px; }
.ffb { padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ffb-t { font-size: 13px; color: var(--ink-2); }
.ffb-t small { display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }

/* Settings sheet: "Your GFFL team" */
.set-select { display: block; width: 100%; font: 500 15px var(--body); color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 10px 12px; }
@media (max-width: 420px) {
  .ffm-sc b { font-size: 26px; }
  .ffr { grid-template-columns: 40px 1fr auto 46px; gap: 8px; padding: 8px 10px; }
}

/* Phone: the side-by-side matchup header truncated both names to "Battl…" at 375px. Stack the
   two teams as rows (crest, name, score), the way the Matchups page cards already do. */
@media (max-width: 560px) {
  .ffm-row { grid-template-columns: 1fr; gap: 6px; }
  .ffm-vs { display: none; }
  .ffm-team.opp { flex-direction: row; text-align: left; }
  .ffm-team.opp .ffm-sc { align-items: flex-end; }
  .ffm-sc { flex-direction: row; align-items: baseline; gap: 8px; }
  .ffm-sc small { order: -1; }
  .ffm-sc b { font-size: 26px; }
  .ffm-left { margin-left: 0; }
}
