/* 阵容球场:场地标线、球员点、悬浮评分卡、替补席。README《Projected lineups》。
 * 由 match.css 拆出 —— 合在一起 900 行,超出仓库编码规范的 800 行上限,而且球场是一个
 * 自成一体的部件(js/view/pitch.js 单独渲染并挂 hover 委托),拆开后两边都好读。 */

/* ===== 阵容球场 ===== */
.pitch-wrap {
  padding: 16px 18px 6px;
}
.pitch {
  position: relative;
  width: 100%;
  padding-top: 47%;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(
    90deg,
    var(--pitch-a) 0%,
    var(--pitch-b) 50%,
    var(--pitch-a) 100%
  );
}
.pitch__line {
  position: absolute;
  border: 1.5px solid var(--pitch-line);
}
.pitch__touch {
  inset: 9px;
  border-radius: 2px;
}
/* 中线是实心细条不是描边,所以不复用 .pitch__line —— 那条规则带 border,
 * 这里要自己声明 position:absolute(漏掉它会塌成 static、高度 0,线直接消失)。 */
.pitch__half {
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 50%;
  width: 1.5px;
  background: var(--pitch-line);
}
.pitch__circle {
  left: 50%;
  top: 50%;
  width: 17%;
  padding-top: 17%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}
.pitch__box {
  top: 22%;
  bottom: 22%;
  width: 13%;
}
.pitch__box--l {
  left: 9px;
  border-left: none;
}
.pitch__box--r {
  right: 9px;
  border-right: none;
}
.pitch__six {
  top: 36%;
  bottom: 36%;
  width: 5%;
}
.pitch__six--l {
  left: 9px;
  border-left: none;
}
.pitch__six--r {
  right: 9px;
  border-right: none;
}

/* 🔴 命名:球员点叫 .pitch__player,**不叫 .chip**。
 * screens.css 的 .chip 是筛选/排序用的小药丸(静态流内元素);这里是绝对定位、固定 74px 宽的
 * 球场标记。两者同名时后加载的一方会整体覆盖另一方 —— 曾经就这么坏过一次:
 * 积分榜的分区 chip 被当成球员点,脱离文档流跑到栏外去了。 */
.pitch__player {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 74px;
  cursor: default;
}
.pitch__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  font-size: 9.5px;
  font-weight: 600;
}
.pitch__num--home {
  background: var(--lime);
  color: var(--on-lime);
}
.pitch__num--away {
  background: var(--blue);
  color: #fff;
}
/* text-shadow 而不是加底色块:球场是渐变的,底色块会在半场交界处显出一排方框。 */
.pitch__name {
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 74px;
  text-shadow: 0 1px 3px var(--pitch-halo);
}

/* 悬浮卡:clamp 把它夹在球场内,边线附近的球员不会把卡片推出画布外;
 * 上半场的球员卡片朝下开,下半场朝上开,永远不遮住被指的那个人。 */
.tip {
  position: absolute;
  z-index: 12;
  min-width: 196px;
  padding: 11px 13px 12px;
  background: var(--modal);
  border: 1px solid var(--border-str);
  border-radius: 8px;
  box-shadow: 0 12px 30px var(--shadow2);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.tip__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tip__dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex: none;
}
.tip__dot--home {
  background: var(--lime);
}
.tip__dot--away {
  background: var(--blue);
}
.tip__name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.tip__num {
  font-size: 10px;
  color: var(--muted2);
}
.tip__avgrow {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.tip__avg {
  font-size: 19px;
  font-weight: 600;
}
.tip__avglabel {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted2);
}
.tip__ratings {
  display: flex;
  gap: 4px;
}
.tip__rating {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 6px;
  border-radius: 4px;
  background: var(--card2);
}

.bench {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border-soft);
  margin-top: 10px;
  border-top: 1px solid var(--border-soft);
}
.bench__col {
  background: var(--card);
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bench__head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bench__dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: none;
}
.bench__dot--home {
  background: var(--lime);
}
.bench__dot--away {
  background: var(--blue);
}
.bench__team {
  font-size: 11.5px;
  font-weight: 600;
}
.bench__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bench__item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  background: var(--card2);
  border: 1px solid var(--border-soft);
  border-radius: 5px;
}
.bench__num {
  font-size: 9.5px;
  color: var(--muted2);
}
.bench__name {
  font-size: 11px;
  color: var(--text2);
}

