/* =============================================
   BASKETBALL.CSS — 籃球麥迪第二波共用樣式（index.html 常駐載入、放在 components.css 之後）
   規格：docs/basketball-plan.md §10
   ★ 各區塊由不同負責人追加、用「斜線星號 ── 區塊名（負責人）── 星號斜線」註解分隔；只動自己的區塊。
   ★ 顏色只准用變數（var(--accent)、var(--accent-bg)、var(--bg-card)…）——主題色集中在 css/site-nav.css
     的 html[data-sport="basketball"]，用戶之後可能換色。唯一例外：客隊色 #7aa7d6。
   ============================================= */

/* ── 足球｜籃球切換膠囊＋手機頂欄讓位 sport-fit-* → 已搬到 css/site-nav.css（首頁與獨立頁共用；膠囊由 js/site-nav.js 畫）── */

/* 籃球模式：賽程頁 sticky chips 列的底色跟著主題（components.css 寫死深藍） */
html[data-sport="basketball"] #schedule-league-chips { background: var(--bg-primary); }

/* ── 籃球賽程卡（D1）── 外框沿用 .match-card（三欄 grid），下面幾段跨整列 */
.match-card.hoop-card .match-team-flag .flag-img { width: 34px; height: 34px; object-fit: contain; }
.hoop-card .hoop-score-row { color: var(--text-primary); }
.hoop-card .hoop-score-row .hoop-win { color: var(--accent); }
.hoop-card.match-finished { border-color: var(--border); background: var(--bg-card); }
.hoop-card .hoop-final-tag {
  display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .5px;
  padding: 2px 8px; border-radius: 999px; margin-bottom: 4px;
  color: var(--text-secondary); border: 1px solid var(--border);
}
.hoop-card .hoop-postponed { font-size: 12px; font-weight: 700; color: var(--text-muted); }

/* 兩段勝率條（主 accent、客 #7aa7d6） */
.hoop-prob { grid-column: 1 / -1; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.hoop-prob-line {
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  font-size: 12px; color: var(--text-secondary); margin-bottom: 6px;
}
.hoop-prob-line b { font-size: 14px; font-weight: 900; }
.hoop-prob-line .h b { color: var(--accent); }
.hoop-prob-line .a b { color: #7aa7d6; }
.hoop-prob-line .mid { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.hoop-prob-track { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--border); }
.hoop-prob-track i { display: block; height: 100%; }
.hoop-prob-track i.h { background: var(--accent); }
.hoop-prob-track i.a { background: #7aa7d6; }

/* pills：讓分 / 大小 / 麥迪預測 */
.hoop-pills { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hoop-pill {
  font-size: 11.5px; font-weight: 700; line-height: 1.2;
  padding: 3px 9px; border-radius: 999px;
  color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent-border, var(--border-accent));
  white-space: nowrap;
}
.hoop-pill.muted { color: var(--text-secondary); background: transparent; border-color: var(--border); }

/* 每節比分列 */
.hoop-quarters {
  grid-column: 1 / -1; margin-top: 8px;
  font-size: 11.5px; color: var(--text-muted); text-align: center;
  font-variant-numeric: tabular-nums; line-height: 1.6;
}
.hoop-quarters span { white-space: nowrap; }

@media (max-width: 600px) {
  .match-card.hoop-card .match-team-flag .flag-img { width: 28px; height: 28px; }
  .hoop-prob-line { font-size: 11px; }
  .hoop-prob-line b { font-size: 13px; }
}

/* ── 數據/球隊頁（D2／U1 重刻）── 2026-10-13 起一律套足球零件（.scorer-card / .standings-table / .team-card /
   .modal-team-header / .form-dots / .trm-row / .player-pill，見 docs/basketball-plan.md §13），本區不再有專屬樣式 ── */

/* ── 彈窗（E）── js/pred-modal-basketball.js；前綴 bbm-（bb- 已被 bet-board.css 佔用）；骨架沿用 odds-only-pred.css 的 oo-* ── */
.bbm-modal { padding: 4px 2px 8px; }
.bbm-modal .oo-league-tag { margin-bottom: 12px; }
.bbm-team-link { cursor: pointer; }
.bbm-result { margin-top: 4px; font-size: 13px; font-weight: 800; color: var(--accent); }
.bbm-live-wrap { margin-top: 6px; }
.bbm-chip-pp { color: var(--text-secondary); border: 1px solid var(--border); }

/* 勝率兩卡 + 雙色條 */
.bbm-pred .oo-pred-head .confidence-badge { margin-left: auto; font-size: 11px; padding: 2px 10px; }
.bbm-wp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bbm-wp-card {
  position: relative; min-width: 0; text-align: center; padding: 12px 6px;
  border-radius: 13px; background: var(--bg-card); border: 1px solid var(--border);
}
.bbm-wp-card.is-lead { border-color: var(--bbm-c); box-shadow: 0 0 0 1px var(--bbm-c) inset; }
.bbm-wp-side { position: absolute; top: 6px; left: 8px; font-size: 9px; font-weight: 800; color: var(--text-muted); }
.bbm-wp-badge { height: 28px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.bbm-wp-logo { width: 28px; height: 28px; object-fit: contain; display: block; }
.bbm-wp-nm { font-size: 12px; font-weight: 700; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bbm-wp-pct { margin-top: 6px; font-size: 28px; font-weight: 900; line-height: 1; color: var(--bbm-c); font-variant-numeric: tabular-nums; }
.bbm-wp-pct i { font-style: normal; font-size: 13px; margin-left: 1px; opacity: .6; }
.bbm-wp-bar { display: flex; height: 6px; margin-top: 10px; border-radius: 3px; overflow: hidden; background: var(--border); }
.bbm-wp-bar b { display: block; background: var(--accent); }
.bbm-wp-bar i { display: block; background: #7aa7d6; }
.bbm-score-h, .bbm-score-a { font-size: 12px; color: var(--text-secondary); }

/* 讓分 / 大小分建議 */
.bbm-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.bbm-pick { min-width: 0; padding: 10px; border-radius: 12px; background: var(--accent-bg); border: 1px solid var(--accent-border, var(--border-accent)); text-align: center; }
.bbm-pick-k { font-size: 10.5px; font-weight: 700; color: var(--text-muted); }
.bbm-pick-v { margin-top: 4px; font-size: 15px; font-weight: 900; color: var(--accent); word-break: break-word; }
.bbm-pick-s { margin-top: 4px; font-size: 10.5px; line-height: 1.45; color: var(--text-secondary); }
.bbm-noodds { margin-top: 12px; padding: 9px 11px; border-radius: 10px; border: 1px dashed var(--border); font-size: 12px; line-height: 1.6; color: var(--text-secondary); text-align: center; }
.bbm-mvm { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: var(--bg-card); font-size: 12px; line-height: 1.65; color: var(--text-secondary); }
.bbm-mvm b { color: var(--text-primary); }
.bbm-mvm-k { display: inline-block; margin-right: 6px; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 800; color: var(--accent); background: var(--accent-bg); }
.bbm-sub-head { margin: 14px 0 8px; font-size: 12px; font-weight: 800; color: var(--text-secondary); }

/* 兩隊對比列（近況 / 全隊數據） */
.bbm-cmp { display: flex; flex-direction: column; }
.bbm-cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--border); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bbm-cmp-row:first-child { border-top: 0; }
.bbm-cmp-h { text-align: left; font-weight: 700; }
.bbm-cmp-a { text-align: right; font-weight: 700; }
.bbm-cmp-l { text-align: center; font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.bbm-cmp-hd { font-size: 11.5px; padding-bottom: 6px; }
.bbm-cmp-hd .bbm-cmp-h { color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbm-cmp-hd .bbm-cmp-a { color: #7aa7d6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbm-cmp-h.is-better { color: var(--accent); }
.bbm-cmp-a.is-better { color: #7aa7d6; }

/* 近期賽果（兩欄） */
.bbm-rc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bbm-rc-col { min-width: 0; }
.bbm-rc-hd { font-size: 11.5px; font-weight: 800; color: var(--accent); margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbm-rc-col + .bbm-rc-col .bbm-rc-hd { color: #7aa7d6; }
.bbm-rc-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 4px 0; font-size: 11px; }
.bbm-rc-mid { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.bbm-rc-d { color: var(--text-muted); font-size: 9.5px; }
.bbm-rc-op { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-secondary); }
.bbm-rc-s { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bbm-rc-none { font-size: 11px; color: var(--text-muted); padding: 4px 0; }

/* 每節比分表 */
.bbm-qt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bbm-qt { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.bbm-qt th, .bbm-qt td { padding: 7px 4px; text-align: center; white-space: nowrap; border-top: 1px solid var(--border); }
.bbm-qt thead th { border-top: 0; font-size: 10.5px; font-weight: 700; color: var(--text-muted); }
.bbm-qt tbody th { text-align: left; font-weight: 700; max-width: 110px; }
.bbm-qt tbody th span { display: inline-block; max-width: 84px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.bbm-qt-logo { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; margin-right: 5px; }
.bbm-qt td { color: var(--text-secondary); }
.bbm-qt-home td.is-win { color: var(--accent); font-weight: 800; }
.bbm-qt-away td.is-win { color: #7aa7d6; font-weight: 800; }
.bbm-qt td.bbm-qt-tot { font-size: 14px; font-weight: 900; color: var(--text-primary); }

/* 得分手 */
.bbm-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bbm-top-col { min-width: 0; }
.bbm-top-hd { font-size: 11.5px; font-weight: 800; margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px solid var(--border); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbm-top-home .bbm-top-hd { color: var(--accent); }
.bbm-top-away .bbm-top-hd { color: #7aa7d6; }
.bbm-top-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 6px; padding: 5px 0; }
.bbm-top-nm { min-width: 0; font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbm-top-pts { font-size: 14px; font-weight: 900; font-variant-numeric: tabular-nums; }
.bbm-top-pts i { font-style: normal; font-size: 10px; font-weight: 700; margin-left: 1px; color: var(--text-muted); }
.bbm-top-sub { grid-column: 1 / -1; font-size: 10.5px; color: var(--text-muted); }
.bbm-top-home .bbm-top-row.is-lead .bbm-top-pts { color: var(--accent); }
.bbm-top-away .bbm-top-row.is-lead .bbm-top-pts { color: #7aa7d6; }

.bbm-empty { text-align: center; font-size: 12.5px; color: var(--text-muted); }
.bbm-foot { margin-top: 14px; text-align: center; font-size: 10.5px; color: var(--text-muted); }

@media (max-width: 400px) {
  .bbm-wp-pct { font-size: 24px; }
  .bbm-pick-v { font-size: 14px; }
  .bbm-cmp-row { font-size: 11.5px; }
  .bbm-qt { font-size: 11px; }
  .bbm-qt tbody th span { max-width: 60px; }
}

/* ── 主頁（D3）── js/basketball-home.js；前綴 bbh-（足球首頁入口 .bb-entry 已移除、改頂欄膠囊）── */
.bbh { display: flex; flex-direction: column; gap: 10px; max-width: 880px; margin: 0 auto; padding: 12px 16px 40px; }
/* 焦點區：木地板紋理 */
.bbh-hero {
  position: relative; overflow: hidden; border-radius: 16px; padding: 16px;
  background: repeating-linear-gradient(90deg, rgba(201,138,75,.10) 0 28px, rgba(201,138,75,.04) 28px 56px),
              linear-gradient(135deg, var(--bg-secondary), var(--bg-primary));
  border: 1px solid var(--border);
}
.bbh-kicker { font-size: 12px; letter-spacing: 3px; color: var(--accent-2); font-weight: 700; }
.bbh-title { font-size: 22px; font-weight: 900; line-height: 1.3; margin: 4px 0 0; max-width: 62%; color: var(--text-primary); }
.bbh-title em { font-style: normal; color: var(--accent); }
.bbh-sub { font-size: 12.5px; color: var(--text-secondary); max-width: 60%; margin-top: 6px; }
.bbh-cta {
  margin-top: 12px; padding: 8px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: var(--bg-primary); font: inherit; font-size: 13.5px; font-weight: 900;
}
.bbh-maddy { position: absolute; right: -6px; bottom: -12px; width: 40%; max-width: 190px; height: auto; pointer-events: none; }

/* 聯賽 chips */
.bbh-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.bbh-chips::-webkit-scrollbar { display: none; }
.bbh-chip {
  flex: none; white-space: nowrap; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
  padding: 5px 12px; border-radius: 14px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
}
.bbh-chip.on { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }

.bbh-days, .bbh-list { display: flex; flex-direction: column; gap: 8px; }
.bbh-lbl { font-size: 12.5px; color: var(--text-secondary); font-weight: 700; margin-top: 6px; display: flex; justify-content: space-between; }
.bbh-lbl-n { font-weight: 400; color: var(--text-muted); }
.bbh-empty { font-size: 13px; color: var(--text-muted); padding: 10px 2px; }
.bbh-more { align-self: flex-start; background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 12.5px; color: var(--accent); cursor: pointer; }

/* 備援賽程卡（D1 的 cardHtml 沒載時用） */
.bbh-mini { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; cursor: pointer; }
.bbh-mini-tg { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); }
.bbh-mini-vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: center; font-size: 14px; font-weight: 900; margin-top: 4px; }
.bbh-mini-vs span:last-child { text-align: right; }
.bbh-mini-vs em { font-style: normal; color: var(--accent-2); font-size: 13px; }

/* 麥迪籃球日選 */
.bbh-pick {
  display: flex; flex-direction: column; gap: 2px; border-radius: 14px; padding: 12px; margin-top: 6px; cursor: pointer;
  background: linear-gradient(135deg, var(--accent-bg), var(--accent-bg-deep)); border: 1px solid var(--accent-border);
}
.bbh-pick-empty { cursor: default; }
.bbh-pick-k { font-size: 11.5px; font-weight: 900; letter-spacing: 1px; color: var(--accent-2); }
.bbh-pick-b { font-size: 19px; font-weight: 900; color: var(--accent); }
.bbh-pick-s { font-size: 12px; color: var(--text-secondary); }

/* 排名 */
.bbh-rank[hidden] { display: none; }
.bbh-tbl { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 14px; padding: 6px 12px; font-size: 12.5px; }
.bbh-tbl > div { display: grid; grid-template-columns: 22px 1fr 50px; padding: 5px 0; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.bbh-tbl > div:last-child { border-bottom: 0; }
.bbh-tbl b { color: var(--accent-2); text-align: right; }

/* ── 球員（P2）── 球員榜／球隊名單已改用足球 .scorer-card / .player-pill；這裡只留足球沒有的：頭像圓形小圖、傷兵小標（比賽彈窗用）── */
.bbp-av { border-radius: 50%; object-fit: cover; background: var(--border); flex: none; }
.bbp-av-empty { display: inline-block; }
.player-pill .bbp-av { display: inline-block; width: 24px; height: 24px; vertical-align: middle; margin: -3px 6px -2px -6px; }
.bbp-inj { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: var(--radius-pill); font-size: 10px; font-weight: 800; line-height: 16px; color: #fff; vertical-align: 1px; flex: none; }
.bbp-inj.out { background: var(--danger); }
.bbp-inj.dtd { background: var(--warning); }
/* 比賽彈窗：缺陣／傷兵 */
.bbp-mi-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.bbp-mi-col { min-width: 0; }
.bbp-mi { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 12px; min-width: 0; }
.bbp-mi .bbp-inj { margin-left: 0; }
.bbp-mi-n { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbp-mi-s { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }
@media (max-width: 420px) { .bbp-mi { flex-wrap: wrap; row-gap: 0; } .bbp-mi-s { flex-basis: 100%; padding-left: 0; } }
