/* ==========================================================================
   nba-search-card.css — the NBA phone Search screen's own rules
   (/nba/search: static/js/nba/nbaSearch.js + nbaSearchCard.js, and the
   defence panel host for nbaSearchDefense.js, §4).

   Linked ONLY on NBA documents, and only while PHONE_SEARCH_ENABLED and
   NBA_SEARCH_ENABLED are both on (templates/index.html, NBA block), after
   core/search.css, whose tokens (--pbs-*, declared on .pb-search) every rule
   here reads. Authored in 980-canvas px like search.css, with no media
   query for the same reason: the view never mounts above 1000px.

   Hand-written, not generated. The NFL and MLB card sheets are generated
   (scripts/gen_search_card_css.py) because those cards ARE the game pages'
   cards, re-scoped; the NBA card is Search's own markup (nbs-*), sized off
   the NFL card's phone band (nfl-search-card.css ≤1000px: 34px card radius,
   112px rows, 128px pills, 8x26 last-5 bars; the box list's 86px avatars,
   32/40 row padding and right-aligned mono numbers) so the sports read as
   one screen. The score card, the line cards and the team tabs are
   core/search.css's own classes and are not restyled here.
   ========================================================================== */

/* ── 0. the shell ───────────────────────────────────────────────────────
   The NBA workbench still boots underneath the view on this route
   (nbaWorkbenchUI.js), and its boot calls NBAUI.showLoader(), which would
   put the full-screen loader over the Search screen for the length of the
   board fetch. The view's body class holds it down; it goes with the class
   when the view is torn down. NBA documents only (this sheet). */
body.pb-search-active #loading-animation { display: none !important; }

/* four pills (All · G · F · C), not NFL's five */
.pb-search--nba .pb-search-posrow { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ── 1. the host ─────────────────────────────────────────────────────── */
#nba-search-card.pb-search-cardhost {
  padding: 0 var(--pbs-gut);
  font-family: var(--pbs-sans);
  color: var(--pbs-fg);
}
#nba-search-card.pb-search-teamcards { padding-top: 30px; }
#nba-search-card.is-loading > * {
  filter: blur(7px);
  opacity: .5;
  pointer-events: none;
}
#nba-search-card button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── 2. the player card ──────────────────────────────────────────────── */
#nba-search-card .nbs-card {
  background: var(--pbs-ink-050);
  border: 1px solid var(--pbs-line-soft);
  border-radius: 34px;
  min-width: 0;
  overflow: hidden;
}
#nba-search-card .nbs-card + .nbs-card { margin-top: 20px; }

#nba-search-card .nbs-card-h {
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 112px;
  padding: 24px 28px;
}
#nba-search-card .nbs-ava,
#nba-search-card .nbs-bx-ava {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: var(--pbs-ink-150);
}
#nba-search-card .nbs-ava { width: 108px; height: 108px; }
#nba-search-card .nbs-ava img,
#nba-search-card .nbs-bx-ava img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: var(--pbs-ink-150);
}
#nba-search-card .nbs-ava i,
#nba-search-card .nbs-bx-ava i {
  font-style: normal;
  font-size: 30px;
  font-weight: 700;
  color: var(--pbs-fg-mute);
}
#nba-search-card .nbs-card-id {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#nba-search-card .nbs-card-n {
  display: block;
  font-size: 35px;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#nba-search-card .nbs-card-m {
  margin-top: 6px;
  font-size: 27px;
  color: var(--pbs-fg-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#nba-search-card .nbs-inj {
  margin-left: 8px;
  padding: 2px 12px;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  background: rgba(245, 181, 68, .12);
  color: var(--pbs-amber);
}

#nba-search-card .nbs-mkts { border-top: 1px solid var(--pbs-line-soft); }
#nba-search-card .nbs-mrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 26px;
  border-bottom: 1px solid var(--pbs-line-soft);
}
#nba-search-card .nbs-mrow:last-child { border-bottom: 0; }
#nba-search-card .nbs-mrow-l {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  min-height: 112px;
  padding: 4px 0;
}
#nba-search-card .nbs-mrow-n {
  font-size: 30px;
  font-weight: 600;
  color: var(--pbs-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#nba-search-card .nbs-mrow-sub {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 7px;
  font-size: 25px;
  color: var(--pbs-fg-mute);
  white-space: nowrap;
}
#nba-search-card .nbs-l5 {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  height: 26px;
}
#nba-search-card .nbs-l5-lab { line-height: 1; margin-right: 7px; white-space: nowrap; }
#nba-search-card .nbs-l5 i {
  width: 8px;
  height: 26px;
  border-radius: 3px;
  background: var(--pbs-line-hi);
}
#nba-search-card .nbs-l5 i.is-hit { background: #22c55e; }
#nba-search-card .nbs-l5 i.is-miss { background: #ef4444; }
#nba-search-card .nbs-hit { font-family: var(--pbs-mono); font-variant-numeric: tabular-nums; }

#nba-search-card .nbs-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 420px;
}
#nba-search-card .nbs-pills > .nbs-pill:only-child { grid-column: 1 / -1; }
#nba-search-card .nbs-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 128px;
  padding: 12px 14px;
  border: 1px solid var(--pbs-line-hi);
  border-radius: 20px;
  text-align: center;
}
#nba-search-card .nbs-pill:active { background: var(--pbs-ink-150); }
#nba-search-card .nbs-pill b {
  font-size: 31px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#nba-search-card .nbs-pill em {
  font-style: normal;
  font-family: var(--pbs-mono);
  font-size: 26px;
  line-height: 1.15;
  color: var(--pbs-fg-dim);
}
/* on the slip (the NFL search card's .ngd-pill.is-on); busy while the first
   add builds the board */
#nba-search-card .nbs-pill.is-on {
  background: var(--pbs-accent);
  border-color: var(--pbs-accent);
  color: #04211d;
}
#nba-search-card .nbs-pill.is-on em { color: #04211d; opacity: .78; }
#nba-search-card .nbs-pill.is-busy { opacity: .55; pointer-events: none; }

/* the NFL card's opponent chip (nfl-search-card.css .ngd-oppchip, phone
   band): "NO 13th", toned on MatchupRank */
#nba-search-card .nbs-oppchip {
  flex: none;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 7px 16px;
  border-radius: 12px;
  border: 1px solid #1F2323;
  color: var(--pbs-fg-dim);
  white-space: nowrap;
}
#nba-search-card .nbs-oppchip.is-soft {
  border-color: rgba(var(--theme-accent-rgb, 0, 211, 189), .28);
  background: rgba(var(--theme-accent-rgb, 0, 211, 189), .08);
  color: var(--pbs-accent);
}
#nba-search-card .nbs-oppchip.is-tough {
  border-color: rgba(255, 92, 92, .30);
  background: rgba(255, 92, 92, .13);
  color: var(--pbs-red);
}

/* the team list's combo fold: one row the height of a market row's label,
   the four combos behind it (.nbs-combos, [hidden] until tapped) */
#nba-search-card .nbs-combo {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 96px;
  padding: 16px 28px 16px 26px;
  border-top: 1px solid var(--pbs-line-soft);
}
#nba-search-card .nbs-combo-n {
  flex: none;
  font-size: 28px;
  font-weight: 600;
  color: var(--pbs-fg-dim);
}
#nba-search-card .nbs-combo-s {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 23px;
  color: var(--pbs-fg-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* the chevron: a right-pointing caret, turned down while open */
#nba-search-card .nbs-combo-c {
  flex: none;
  width: 16px;
  height: 16px;
  margin-right: 6px;
  border-right: 3px solid var(--pbs-fg-mute);
  border-bottom: 3px solid var(--pbs-fg-mute);
  transform: rotate(-45deg);
  transition: transform .15s ease;
}
#nba-search-card .nbs-combo[aria-expanded="true"] .nbs-combo-c { transform: rotate(45deg); }
#nba-search-card .nbs-combo:active { background: rgba(255, 255, 255, .04); }
/* LOAD-BEARING: .nbs-mkts is display:block, but [hidden] must win */
#nba-search-card .nbs-combos[hidden] { display: none; }

/* the team list's position groups (nfl-search-card.css .ngd-pgroup, phone
   band: 44px between groups, 20px between cards) */
#nba-search-card .nbs-pgroup + .nbs-pgroup { margin-top: 44px; }
#nba-search-card .nbs-pgroup-h {
  margin: 0 0 20px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--pbs-fg-mute);
}

/* the cross-season footnote */
#nba-search-card .nbs-note {
  margin: 0;
  padding: 0 28px 22px;
  font-size: 22px;
  color: var(--pbs-fg-mute);
}

/* ── 3. a game in play, or done ──────────────────────────────────────── */
#nba-search-card.pb-search-livehost .pb-search-lv--card { margin-bottom: 26px; }

#nba-search-card .nbs-bxs { display: flex; flex-direction: column; gap: 34px; }
/* LOAD-BEARING: [hidden]'s display comes from the UA sheet, and the flex
   above would otherwise show both teams at once. */
#nba-search-card .nbs-bxs[hidden] { display: none; }
#nba-search-card .nbs-bx-empty {
  padding: 36px 40px;
  font-size: 30px;
  color: var(--pbs-fg-dim);
}
#nba-search-card .nbs-bx-h,
#nba-search-card .nbs-bx-row {
  display: flex;
  align-items: center;
  gap: 20px;
}
/* 41 against the rows' 40: the rows card's 1px border, so a label and its
   numbers share one right edge (the NFL box's rule) */
#nba-search-card .nbs-bx-h { padding: 0 41px 14px 33px; }
#nba-search-card .nbs-bx-h > b {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 30px;
  font-weight: 700;
  color: var(--pbs-fg);
}
/* MIN · PTS · RBS · AST · 3PM: each track its widest value plus the air
   that keeps two flush-right numbers apart */
#nba-search-card .nbs-bx-st {
  flex: none;
  display: grid;
  grid-template-columns: 72px 76px 76px 76px 76px;
  align-items: center;
}
#nba-search-card .nbs-bx-st > i { font-style: normal; text-align: right; }
#nba-search-card .nbs-bx-h .nbs-bx-st > i {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .1em;
  margin-right: -.1em;
  color: var(--pbs-fg-mute);
}
#nba-search-card .nbs-bx-h .nbs-bx-st > i:last-child { margin-right: -12px; }
#nba-search-card .nbs-bx-row .nbs-bx-st > i {
  font-family: var(--pbs-mono);
  font-size: 28px;
  color: var(--pbs-fg-dim);
  font-variant-numeric: tabular-nums;
}
#nba-search-card .nbs-bx-row .nbs-bx-st > i.is-hi { color: var(--pbs-fg); font-weight: 600; }
#nba-search-card .nbs-bx-rows {
  background: var(--pbs-ink-050);
  border: 1px solid var(--pbs-line-soft);
  border-radius: 34px;
  overflow: hidden;
}
/* id-qualified: the host's own button reset above is (1,0,1) */
#nba-search-card .nbs-bx-row {
  width: 100%;
  min-height: 118px;
  padding: 12px 40px 12px 32px;
  border-bottom: 1px solid var(--pbs-line-soft);
}
#nba-search-card .nbs-bx-row:last-child { border-bottom: 0; }
#nba-search-card .nbs-bx-row:active { background: rgba(255, 255, 255, .05); }
#nba-search-card .nbs-bx-ava { width: 86px; height: 86px; }
#nba-search-card .nbs-bx-ava i { font-size: 26px; }
#nba-search-card .nbs-bx-id {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
#nba-search-card .nbs-bx-id > b {
  font-size: 34px;
  font-weight: 600;
  color: var(--pbs-fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#nba-search-card .nbs-bx-id > small {
  margin-top: 6px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--pbs-fg-mute);
}
#nba-search-card .nbs-bx-id em { font-style: normal; color: var(--pbs-fg-dim); }
#nba-search-card .nbs-bx-id em[data-pos="G"] { color: #5AA9FF; }
#nba-search-card .nbs-bx-id em[data-pos="F"] { color: var(--pbs-green); }
#nba-search-card .nbs-bx-id em[data-pos="C"] { color: var(--pbs-amber); }

/* ── 4. the defence panel under the player card ──────────────────────────
   nbaSearchDefense.js, in the view's panel host. Its rows are the NFL
   panel's markup, drawn by the .dr-* sheet NFLDefenseView.injectStyles()
   appends (the Defensive Rankings page's own). These are the host rules that
   sheet cannot supply, re-scoped from nfl-search-defense.css (read its
   header for the why of each): the --dr-* tokens (declared on the page's
   container there), the gutter this host already owns, the card ink of the
   card above, and the panel chrome. Written #nba-search-panel .dr-x (1-1-0)
   because the injected sheet lands after this one at (0-1-0). */
#nba-search-panel {
  --dr-line: #1F2323;
  --dr-soft: #171A1A;
  --dr-ink: #EAF7F4;
  --dr-ink2: rgba(203, 234, 228, .62);
  --dr-ink3: rgba(203, 234, 228, .38);
  --dr-teal: rgb(var(--theme-accent-rgb, 0, 211, 189));
  --dr-mint: #2DE0BA;
  --dr-amber: #FFD36A;
  --dr-rose: #FF6577;
  --dr-num: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --dr-accent: rgb(var(--theme-accent-rgb, 0, 211, 189));
  --dr-accent-soft: rgba(var(--theme-accent-rgb, 0, 211, 189), .22);
  --dr-pin: rgba(var(--theme-accent-rgb, 0, 211, 189), .40);

  display: block;
  padding-top: 8px;
  color: var(--dr-ink);
}
#nba-search-panel:empty { display: none; }
#nba-search-panel .dr-msort {
  padding: 18px var(--pbs-gut, 35px) 22px;
  margin: 0 calc(-1 * var(--pbs-gut, 35px));
}
#nba-search-panel .dr-mlist { padding: 0; }
#nba-search-panel .dr-munit {
  padding: 0 0 20px;
  text-align: center;
  color: #F2F5F4;
}
#nba-search-panel .dr-msg {
  padding: 60px 0;
  font-size: 27px;
  line-height: 1.45;
  text-align: center;
  color: var(--dr-ink2);
}
#nba-search-panel .dr-mcard {
  background: #0B0C0C;
  border-color: #171A1A;
}
#nba-search-panel .pbdef-pin .dr-mcard,
#nba-search-panel .pbdef-pin .dr-mcard.open { border-color: var(--dr-pin); }
#nba-search-panel .dr-mrow.open,
#nba-search-panel .dr-mexp { background: transparent; }
#nba-search-panel .pbdef-hd { margin: 44px 0 26px; text-align: center; }
#nba-search-panel .pbdef-t {
  margin: 0;
  font-size: 33px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: #F2F5F4;
}
#nba-search-panel .pbdef-s {
  margin: 8px 0 0;
  font-size: 26px;
  line-height: 1.45;
  color: #59615F;
}
#nba-search-panel .pbdef-note {
  margin: 26px 0 0;
  font-size: 26px;
  line-height: 1.5;
  color: #59615F;
}
#nba-search-panel > * { transition: filter .28s ease, opacity .28s ease; }
#nba-search-panel.is-loading > * {
  filter: blur(7px);
  opacity: .5;
  pointer-events: none;
}
#nba-search-panel.is-loading { min-height: 480px; }
