/* =============================================
   DAILY-STARS.CSS — 今日之星橫向卡片列（js/daily-stars.js）
   類名前綴 dstar-；顏色只吃 css/site-nav.css 的色票變數（--accent 外圈、--gold 膠囊，三運動自動換色）
   背景透明、融進賽程頁；只有 .dstar-row 自己可以左右捲，整頁不能橫向溢出
   ============================================= */
#daily-stars-host,
[data-ds-host] { min-width: 0; max-width: 100%; }

/* 賽程頁：容器滿版、內部左右 16px gutter（捲動列滑到邊時卡片可貼齊螢幕邊，像 App 故事列）；桌機跟賽程列表同寬置中 */
/* 賽程頁：吸頂、疊在聯賽選擇列上面（2026-11-09 用戶）；高度量進 --ds-h 給聯賽列／時段列的 top 用 */
#daily-stars-host {
  position: sticky;
  top: var(--sched-bar-top, var(--header-h, 64px));
  z-index: 52;
  background: rgb(7, 9, 26);   /* 全實色：底下賽程卡的字不能透上來（這排面積大、透一點就髒） */
  transition: transform 0.22s ease, opacity 0.18s ease;
  will-change: transform;
}
body.sched-chips-collapsed #daily-stars-host {
  transform: translateY(calc(-1 * var(--ds-h, 0px)));
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) { #daily-stars-host { transition: none; } }
#daily-stars-host .dstar-wrap { margin: 0 auto; padding-top: 8px; }
#daily-stars-host .dstar-row { padding-bottom: 2px; }

.dstar-wrap { margin: 12px auto 0; min-width: 0; max-width: 1400px; }
@media (min-width: 769px) { .dstar-wrap { padding: 0 8px; } }

.dstar-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 0 0 4px; padding: 0 16px;
}
.dstar-title { font-size: 15px; font-weight: 800; color: var(--text-primary); letter-spacing: .3px; }
.dstar-sub { font-size: 11px; color: var(--text-secondary); white-space: nowrap; }

/* 橫向捲動列：隱藏捲軸、scroll-snap */
.dstar-row {
  display: flex; gap: 6px;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  padding: 10px 16px 4px;   /* 上方留空間給頭像上方的 tag 膠囊；左右 16px gutter */
  scroll-padding: 0 16px;
  min-width: 0; max-width: 100%;
}
.dstar-row::-webkit-scrollbar { display: none; }

.dstar-card {
  flex: 0 0 84px; width: 84px; min-width: 0;
  display: flex; flex-direction: column; align-items: center;
  scroll-snap-align: start;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.dstar-card.is-click { cursor: pointer; }
.dstar-card.is-click:active .dstar-av { transform: scale(.94); }
.dstar-card.is-click:focus-visible .dstar-av { box-shadow: 0 0 0 3px var(--accent-glow); }

/* 頭像：56px 圓、外圈 2px 強調色環（環與頭像間留 2px 底色縫，像故事列） */
.dstar-av-wrap { position: relative; width: 64px; height: 64px; margin-bottom: 6px; }
.dstar-av {
  width: 64px; height: 64px; border-radius: 50%;   /* 64 = 56 頭像 + 2 縫 + 2 環（兩側）；探索頁完整版 */
  border: 2px solid var(--accent);
  padding: 2px; box-sizing: border-box;
  overflow: hidden;
  background: var(--bg-secondary);
  transition: transform .15s ease;
}
.dstar-av-img {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; object-position: center top;
  background: var(--bg-secondary);
}
.dstar-av.is-txt { display: flex; align-items: center; justify-content: center; }
.dstar-av-txt {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; border-radius: 50%;
  background: var(--bg-primary);
  color: var(--text-primary); font-size: 22px; font-weight: 800; line-height: 1;
}

/* 右上角隊徽 20px */
.dstar-logo {
  position: absolute; top: -2px; right: -4px;
  width: 20px; height: 20px; object-fit: contain;
  border-radius: 50%;
  background: var(--bg-secondary);
  padding: 1px; box-sizing: border-box;
  box-shadow: 0 0 0 1.5px var(--bg-primary);
}

/* 頭像上方 tag 膠囊（大三元／帽子戲法…） */
.dstar-tag {
  position: absolute; left: 50%; top: -9px; z-index: 1;
  transform: translateX(-50%);
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 10px; font-weight: 800; line-height: 1;
  padding: 3px 6px; border-radius: var(--radius-pill);
  background: var(--accent-2, var(--gold)); color: var(--bg-primary);   /* 副強調色：籃球淡金 #ffc46b、跟橘色外圈分得開；足球沒定義 --accent-2 → 金色 --gold */
  box-shadow: 0 0 0 1.5px var(--bg-primary);
}

.dstar-name {
  width: 100%; font-size: 12px; font-weight: 800; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.dstar-line {
  width: 100%; margin-top: 2px;
  font-size: 10.5px; color: var(--text-secondary); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 探索頁（籃球／棒球主頁）上方那排：.xp-wrap 自帶 12px（桌機 24px）內距 → 負邊距抵掉、讓內部 16px gutter 生效 */
.xp-wrap > [data-ds-host] { margin: 0 -12px 14px; max-width: none; }
.xp-wrap > [data-ds-host] .dstar-wrap { margin: 0; }
@media (min-width: 769px) { .xp-wrap > [data-ds-host] { margin: 0 -24px 18px; } }

/* ── 賽程頁吸頂區縮小版（2026-11-09 用戶拍板：進吸頂區、但「今日之星」標題與數據行不能省）
   標題改成列首一塊直排小標（不佔獨立一列）、頭像 33、名字 10px、數據 9.5px → 整排約 90px；探索頁維持上面的完整版 ── */
#daily-stars-host .dstar-head { display: none; }
#daily-stars-host .dstar-wrap { padding-top: 0; }
#daily-stars-host .dstar-row { gap: 4px; padding: 9px 12px 5px; scroll-padding: 0 12px; align-items: flex-start; }
#daily-stars-host .dstar-row::before {
  content: '今日\A之星';
  white-space: pre; text-align: center;
  flex: 0 0 auto; align-self: center;
  margin: 0 4px 0 0; padding: 6px 7px;
  border-radius: 10px; border: 1px solid rgba(255, 255, 255, .12);
  font-size: 12px; font-weight: 800; line-height: 1.25; letter-spacing: 1px;
  color: var(--accent);
}
#daily-stars-host .dstar-card { flex-basis: 64px; width: 64px; }
#daily-stars-host .dstar-av-wrap { width: 40px; height: 40px; margin-bottom: 3px; }
#daily-stars-host .dstar-av { width: 40px; height: 40px; border-width: 2px; padding: 1.5px; }   /* 40 = 33 頭像 + 1.5 縫 + 2 環（兩側） */
#daily-stars-host .dstar-av-txt { font-size: 15px; }
#daily-stars-host .dstar-logo { width: 15px; height: 15px; top: -2px; right: -3px; }
#daily-stars-host .dstar-tag { top: -8px; max-width: 62px; font-size: 9px; padding: 2px 5px; }
#daily-stars-host .dstar-name { font-size: 10px; font-weight: 700; }
#daily-stars-host .dstar-line { font-size: 9.5px; margin-top: 1px; }
#daily-stars-host .dstar-row::before { scroll-snap-align: start; }   /* 沒這行會被 snap 捲過去、進站只看到卡片看不到小標 */

/* ── 桌機（≥769px）：吸頂區縮小版放大一號（2026-11-09 用戶：手機剛好、電腦可以再大一點）；手機維持上面的尺寸 ── */
@media (min-width: 769px) {
  #daily-stars-host .dstar-row { gap: 8px; padding: 12px 16px 8px; }
  #daily-stars-host .dstar-row::before { font-size: 14px; padding: 8px 10px; margin-right: 8px; }
  #daily-stars-host .dstar-card { flex-basis: 118px; width: 118px; }   /* 桌機夠寬：讓「43 分・5 籃板・4 助攻」整行顯示 */
  #daily-stars-host .dstar-av-wrap { width: 52px; height: 52px; margin-bottom: 5px; }
  #daily-stars-host .dstar-av { width: 52px; height: 52px; padding: 2px; }   /* 52 = 44 頭像 + 2 縫 + 2 環（兩側） */
  #daily-stars-host .dstar-av-txt { font-size: 19px; }
  #daily-stars-host .dstar-logo { width: 18px; height: 18px; }
  #daily-stars-host .dstar-tag { font-size: 10px; padding: 3px 6px; top: -9px; max-width: 80px; }
  #daily-stars-host .dstar-name { font-size: 12px; }
  #daily-stars-host .dstar-line { font-size: 11px; }
}
