/* ============================================================
 *  英雄篮球 · MVP 样式
 *  主题：深色背景 + 红蓝配色
 * ============================================================ */
:root {
  --bg:        #0d1117;
  --bg-soft:   #161c25;
  --bg-card:   #1b222d;
  --line:      #2a3340;
  --text:      #e7ecf3;
  --muted:     #8a96a8;
  --accent:    #c8102e;   /* 主色 */
  --accent-2:  #1d428a;   /* 辅助色 */
  --gold:      #f0b827;
  --good:      #3ec97c;
  --bad:       #e44c4c;
  --shadow:    0 6px 18px rgba(0,0,0,.35);
  --radius:    10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #0a0f17 0%, #11161f 100%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ================ 顶栏 ================ */
.topbar {
  display: flex; align-items: center;
  padding: 12px 22px;
  background: linear-gradient(90deg, var(--accent-2), #1f2a4d);
  border-bottom: 3px solid var(--accent);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.logo { font-size: 22px; }
.brand-text .muted { font-weight: 400; font-size: 13px; }

.nav { display: flex; gap: 6px; margin-left: auto; }

/* ============ 经费 pill（顶栏右侧） ============ */
.budget-pill {
  margin-left: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--gold), #d49b13);
  color: #1a1a1a;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(240,184,39,.3);
}
.budget-pill .budget-icon { font-size: 16px; }
.budget-pill .budget-value { font-size: 16px; }
.budget-pill .budget-cap { font-size: 12px; opacity: .7; font-weight: 500; }
.budget-pill.low { background: linear-gradient(135deg, var(--bad), #b73a3a); color: #fff; }

.nav-btn {
  background: transparent; color: var(--text);
  border: 1px solid transparent;
  padding: 8px 14px; border-radius: 999px;
  cursor: pointer; font-size: 14px; font-weight: 500;
  transition: .15s;
}
.nav-btn:hover { background: rgba(255,255,255,.08); }
.nav-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.saved-indicator { margin-left: 18px; font-size: 12px; }

/* ================ 主区 ================ */
.main {
  flex: 1;
  padding: 10px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}
.view h1 {
  margin: 0 0 6px;
  font-size: 26px;
  letter-spacing: 1px;
}
.view .lead { color: var(--muted); margin: 0 0 22px; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 16px; }

.tips { margin: 0; padding-left: 20px; color: var(--muted); line-height: 1.7; }

/* ================ 表单元素 ================ */
input[type="text"] {
  width: 100%;
  background: #0e131b;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
input[type="text"]:focus { outline: none; border-color: var(--accent-2); }

.team-name-card { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: end; }
.team-name-card label { font-size: 14px; color: var(--muted); }

/* ================ 按钮 ================ */
.btn {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--line);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: #4a5568; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #a8091f; }
.btn.accent { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.btn.accent:hover:not(:disabled) { background: #17327a; }
.btn.ghost { background: transparent; }
.btn.big { padding: 14px 26px; font-size: 16px; }

/* ================ 阵容视图 ================ */
.roster-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.lineup-panel, .pool-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.team-name-display {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.positions { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.position-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: linear-gradient(180deg, #131b26, #0f151d);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 10px 12px;
  cursor: pointer;
  transition: .15s;
}
.position-slot:hover { border-color: var(--accent-2); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.position-slot.filled { background: linear-gradient(180deg, #16324b, #122739); border-color: #24455f; }
.position-slot.need-fill { border-color: var(--accent); }

.pos-tag {
  background: linear-gradient(135deg, var(--accent-2), #2b4bb5);
  color: #fff;
  padding: 4px 16px;
  border-radius: 999px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 1px;
  box-shadow: 0 2px 6px rgba(43,75,181,.35);
}
.pos-tag.empty { background: #2a3340; color: var(--muted); }
.slot-main { padding: 0 10px; }
.slot-main .pname { font-weight: 600; font-size: 14px; }
.slot-main .pmeta { font-size: 12px; color: var(--muted); }
.slot-mini-rating {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 8px;
  font-weight: 700;
  color: var(--gold);
}
.slot-remove {
  background: transparent;
  border: 0;
  color: var(--bad);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
}

.bench { margin-top: 18px; }
.bench h4 { margin: 0 0 8px; font-size: 14px; }
.bench-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
}
.bench-slot {
  position: relative;
  background: linear-gradient(180deg, #131b26, #0f151d);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  min-height: 70px;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  transition: .15s;
}
.bench-slot:hover { border-color: var(--accent-2); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.35); }
.bench-slot.filled { background: #14283d; }
.bench-slot .pname { font-weight: 600; font-size: 13px; }
.bench-slot .pmeta { color: var(--muted); margin-top: 2px; }

.team-rating {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(240,184,39,.16), rgba(240,184,39,.04));
  border: 1px solid rgba(240,184,39,.45);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}
.team-rating strong {
  font-size: 20px;
  color: var(--gold);
}

.actions { display: flex; gap: 10px; margin-top: 14px; }
.actions.center { justify-content: center; }

/* ================ 球员�? ================ */
.pool-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.pool-header h3 { margin: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.player-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 6px;
}
.player-card {
  background: #11181f;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: .15s;
  position: relative;
}
.player-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.player-card.selected { opacity: .35; pointer-events: none; }
.player-card .row1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.player-card .row1 .pname { flex: 1; }
.player-card .pname { font-weight: 700; font-size: 14px; }
.player-card .ovr {
  background: linear-gradient(135deg, var(--gold), #d49b13);
  color: #1a1a1a;
  border-radius: 6px;
  padding: 3px 8px;
  font-weight: 800;
  font-size: 13px;
}
.player-card .pmeta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.player-card .attrs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 8px;
}
.player-card .attr {
  background: #0a0f17;
  border-radius: 4px;
  text-align: center;
  padding: 3px 0;
  font-size: 11px;
}
.player-card .attr .v { font-weight: 700; color: var(--text); }
.player-card .attr .k { color: var(--muted); font-size: 10px; }

/* 球员卡的"选中标记" */
.player-card.selected::after {
  content: '\2713 \5df2 \9009';
  position: absolute; top: 8px; right: 8px;
  background: var(--good); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}

/* ================ 匹配视图 ================ */
.match-summary { padding: 28px; }
.vs-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}
.team-block {
  background: #11181f;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
}
.team-block.home { border-top: 3px solid var(--accent); }
.team-block.away { border-top: 3px solid var(--accent-2); }
.team-cap { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.team-display-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.team-display-rating { color: var(--gold); font-weight: 600; margin-bottom: 12px; }
.lineup-mini {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  font-size: 12px;
}
.lineup-mini .slot {
  background: #0a0f17;
  border-radius: 4px;
  padding: 4px 2px;
}
.lineup-mini .slot .ovr { color: var(--gold); font-weight: 700; }
.lineup-mini .lm-placeholder {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1.5px dashed rgba(255,215,0,.35);
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, rgba(255,215,0,.03) 0 8px, transparent 8px 16px);
  color: var(--muted);
  font-size: 12.5px;
}
.lineup-mini .lm-placeholder i {
  font-style: normal;
  font-size: 16px;
  animation: lmPhSpin 2.4s ease-in-out infinite;
}
@keyframes lmPhSpin {
  0%, 100% { transform: rotate(-12deg) scale(1); }
  50% { transform: rotate(12deg) scale(1.12); }
}
.vs-sign {
  font-size: 32px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 2px;
}

/* ================ 比赛视图 ================ */
.scoreboard {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: linear-gradient(135deg, #152137, #0e131b);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin: 0 -12px 14px;   /* 撑满弹层内容区宽度，避免吸附后两侧露�? */
  box-shadow: var(--shadow);
}
.sb-team { padding: 0 20px; }
.sb-team.home { text-align: left; border-right: 1px solid var(--line); }
.sb-team.away { text-align: right; }
.sb-name { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.sb-rating { font-size: 12px; color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.sb-score { font-size: 56px; font-weight: 900; color: var(--gold); line-height: 1; }
.sb-team.home .sb-score { color: var(--accent); }
.sb-team.away .sb-score { color: var(--accent-2); }
.sb-mid { text-align: center; padding: 0 24px; }
.sb-quarter { font-size: 18px; font-weight: 700; }
.sb-clock { font-size: 24px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.sb-clock.ended { color: var(--bad); font-weight: 800; letter-spacing: .12em; }

.playbyplay {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.playbyplay h3 { margin: 0 0 10px; }
.pbp-log {
  height: 360px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.7;
}
.pbp-log .entry {
  padding: 4px 8px;
  border-left: 3px solid transparent;
  border-radius: 4px;
  margin-bottom: 2px;
}
.pbp-log .entry.fade-in { animation: fadeIn .3s; }
.pbp-log .entry.home { border-left-color: var(--accent); }
.pbp-log .entry.away { border-left-color: var(--accent-2); }
.pbp-log .entry.highlight { background: #1f2734; }
.pbp-log .entry.qbreak { background: #0a0f17; color: var(--gold); text-align: center; font-weight: 700; }
.pbp-log .entry.miss { opacity: .7; }
.pbp-log .entry .pts { font-weight: 700; margin-left: 6px; }
.pbp-log .entry.home .pts { color: var(--accent); }
.pbp-log .entry.away .pts { color: var(--accent-2); }

@keyframes fadeIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: translateX(0); } }

/* ================ �?术统计表 ================ */
.boxscore-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 10px;
}
.boxscore-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.boxscore-table th, .boxscore-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px dashed var(--line);
}
.boxscore-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.boxscore-table .pn { font-weight: 600; }
.boxscore-table .ovr { color: var(--gold); font-weight: 700; }
/* 正在场上打球的球员整行标绿，下场后恢复白�? */
.boxscore-table tr.oncourt td { color: var(--good); }
/* ================ Boxscore player name tiers (font color only) ================ */
.boxscore-table .pn.tier-D { color: #b9c0cb; background: transparent; border: none; }
.boxscore-table .pn.tier-C { color: #ffffff; background: transparent; border: none; }
.boxscore-table .pn.tier-B { color: #7ddea0; background: transparent; border: none; }
.boxscore-table .pn.tier-A { color: #8ecdff; background: transparent; border: none; }
.boxscore-table .pn.tier-S { color: #9333ea; background: transparent; border: none; }
.boxscore-table .pn.tier-SS { color: #ffd700; background: transparent; border: none; }
.boxscore-table .pn.tier-SSS { color: #ffe066; background: transparent; border: none; }
.boxscore-table .pn.tier-X { color: #ff9f43; background: transparent; border: none; }
.boxscore-table .pn.tier-XX { color: #ffd700; background: transparent; border: none; }
.boxscore-table .pn.tier-XXX { color: #ff5eb8; background: transparent; border: none; }

/* ================ Toast ================ */
.toast {
  position: fixed;
  top: calc(100vh - 56px);
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  opacity: 0;
  transition: top .5s ease, opacity .3s;
  pointer-events: none;
  box-shadow: var(--shadow);
  z-index: 11000;
}
.toast.show { opacity: 1; top: 50%; }

/* ================ 价格表（建队页） ================ */
.price-table-wrap { display: grid; gap: 10px; }
.price-table {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.price-table th, .price-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px dashed var(--line);
}
.price-table th { color: var(--muted); font-weight: 500; }
.price-table td:nth-child(2) { color: var(--gold); font-weight: 700; }
.price-table td:nth-child(1) { font-weight: 600; }
.small { font-size: 12px; }

/* ================ 阵容视图：经费条 ================ */
.roster-budget {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: linear-gradient(135deg, rgba(240,184,39,.15), transparent);
  border: 1px solid rgba(240,184,39,.4);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.roster-budget #rosterBudget { color: var(--gold); }
.roster-budget .muted { color: var(--muted); font-weight: 400; }
.roster-budget.low {
  border-color: var(--bad);
  background: linear-gradient(135deg, rgba(228,76,76,.15), transparent);
}
.roster-budget.low #rosterBudget { color: var(--bad); }

/* ================ 球员卡：购买按钮 / 已拥�? / 买不�? ================ */
.player-card .price-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.player-card .price-tag {
  background: rgba(240,184,39,.15);
  color: var(--gold);
  border: 1px solid rgba(240,184,39,.4);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}
.player-card.owned {
  border-color: var(--good);
  background: rgba(62,201,124,.05);
}
.player-card.owned .price-tag { background: rgba(62,201,124,.2); color: var(--good); border-color: var(--good); }
.player-card.unaffordable {
  opacity: .55;
  cursor: not-allowed !important;
  transform: none !important;
}
.player-card.unaffordable:hover { border-color: var(--line); }

.buy-btn, .sell-btn {
  padding: 4px 10px; font-size: 12px; border-radius: 6px; cursor: pointer;
  font-weight: 600;
}
.buy-btn {
  background: var(--gold); color: #1a1a1a; border: 1px solid var(--gold);
}
.buy-btn:hover { background: #d49b13; }
.buy-btn:disabled {
  background: #444; color: var(--muted); border-color: #444; cursor: not-allowed;
}
.sell-btn {
  background: transparent; color: var(--bad); border: 1px solid var(--bad);
  padding: 3px 8px;
  font-size: 11px;
  margin-left: 6px;
}
.sell-btn:hover { background: rgba(228,76,76,.1); }

/* 阵容槽位的删�?/卖出 */
.slot-actions { display: flex; gap: 4px; align-items: center; }

/* ================ 认证（登�?/注册�? ================ */
.auth-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: min(420px, 100%);
  margin: 0 auto;
  text-align: center;
  padding: 28px 26px;
}
.auth-logo { font-size: 42px; margin-bottom: 6px; }
.auth-card h2 { margin: 0 0 4px; }
.auth-card .auth-tabs {
  display: flex; gap: 8px; justify-content: center; margin: 18px 0 6px;
}
.auth-form { text-align: left; margin-top: 14px; }
.auth-form label {
  display: block; font-size: 12px; color: var(--muted); margin: 12px 0 4px;
}
.auth-form input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  box-sizing: border-box;
}
.auth-form input:focus { outline: none; border-color: var(--gold); }
.auth-form .btn.big { width: 100%; margin-top: 18px; }
.auth-error {
  margin: 12px 0 0;
  padding: 8px 10px;
  background: rgba(228,76,76,.12);
  border: 1px solid var(--bad);
  border-radius: 8px;
  color: var(--bad);
  font-size: 13px;
  text-align: center;
}

/* 顶栏经理�? */
.manager-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.05);
  font-size: 13px;
}
.manager-pill .manager-icon { font-size: 14px; }
.logout-btn {
  background: transparent; color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 10px; font-size: 12px;
  border-radius: 999px; cursor: pointer;
}
.logout-btn:hover { color: var(--bad); border-color: var(--bad); }

/* 未登录时隐藏导航 */
.topbar.no-auth .nav { display: none; }

/* ================ 首页可视化阵�? ================ */
.visual-roster-wrapper {
  display: grid;
  position: relative;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

.starters-pentagon {
  position: relative;
  width: 480px;
  height: 480px;
  margin: 0 auto;
  background: radial-gradient(circle at center, rgba(29,66,138,0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.starter-node {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 130px;
  text-align: center;
  transition: transform 0.2s;
  background: none;
  border: none;
  padding: 0;
}
.starter-node.filled:hover {
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 10;
}
.starter-node.empty {
  opacity: 0.4;
}
.node-avatar { margin: 0 auto 6px; }
.node-pos {
  font-size: 12px; font-weight: 700; color: var(--accent-2);
  margin-bottom: 4px; text-transform: uppercase;
}
.node-pos.empty { color: var(--muted); }
.node-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-ovr { font-size: 11px; color: var(--gold); font-weight: 700; margin-top: 2px; }
.node-salary { font-size: 11px; color: var(--gold); font-weight: 600; margin-top: 1px; }
.node-value { font-size: 10px; color: var(--accent-2); font-weight: 600; margin-top: 1px; }

.bench-visual {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  height: fit-content;
}
.bench-visual h4 { margin: 0 0 12px; font-size: 14px; color: var(--gold); text-align: center; }
.bench-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bench-card {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: .15s;
  cursor: grab;
  min-width: 0;
}
.bench-card.filled:hover { border-color: var(--accent); transform: translateY(-1px); }
.bench-card.dragging { opacity: 0.5; border-color: var(--gold); }
.bench-card.drag-over { border-color: var(--gold); box-shadow: 0 0 12px rgba(240,184,39,0.4); }
.bench-card.empty { opacity: 0.4; cursor: default; }
.bench-avatar { flex-shrink: 0; }
.bench-info { flex: 1; min-width: 0; }
.bench-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bench-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.bench-salary { font-size: 10px; color: var(--gold); font-weight: 600; }
.bench-value { font-size: 10px; color: var(--accent-2); font-weight: 600; }
.bench-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 20px; }

@media (max-width: 900px) {
  .visual-roster-wrapper { grid-template-columns: 1fr; }
  .bench-visual { order: -1; }
}

/* ================ 球员等级标签 ================ */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 20px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-right: 6px;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.tier-XXX { background: linear-gradient(135deg, #1a0505, #3a0a08); color: #ff5eb8; border: 1px solid #ff3b1f; }  /* black + red ember - eternal */
.tier-XX { background: linear-gradient(135deg, #140a02, #2b1503); color: #ffd700; border: 1px solid #ff7a00; }  /* black + ember - mythic */
.tier-SS { background: linear-gradient(135deg, #080808, #12100a); color: #ffd700; border: 1px solid #ffd700; }
.tier-SSS { background: linear-gradient(135deg, #0a0a0a, #1a1508); color: #ffe066; border: 1px solid #ffc800; }
.tier-X { background: linear-gradient(135deg, #0a0a0a, #1a1206); color: #ffd700; border: 1px solid #ffd700; }  /* �ڵ׽�� - ���� */
.tier-S { background: linear-gradient(135deg, #ff9a1f, #ffb347); color: #1a1206; }   /* �Ƚ� - ���� */
.tier-A { background: linear-gradient(135deg, #6b21a8, #d946ef); color: #fff; }   /* ������� - ���� */
.tier-B { background: linear-gradient(135deg, #4f9cf0, #8ec8f5); color: #0b1e33; }   /* ���� - ȫ���� */
.tier-C { background: linear-gradient(135deg, #5fd48a, #b4f5c8); color: #0d2416; } /* ���� - ���� */
.tier-D { background: linear-gradient(135deg, #9ca3af, #6b7280); color: #fff; }   /* ��ɫ - ��ɫ */

/* ================ 排序下拉�? ================ */
.sort-select {
  background: var(--bg-card) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
}
.sort-select:focus { outline: none; border-color: var(--accent) !important; }
.sort-select option { background: var(--bg-card); color: var(--text); }

/* ================ 头像左上角等级标�? ================ */
.avatar {
  position: relative;
}
.avatar::before {
  content: attr(data-tier);
  position: absolute;
  top: -4px;
  left: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
  border: 2px solid var(--bg);
  z-index: 10;
}
/* ===== Player tier cards: D / C / B / A / S / X / XX / XXX ===== */
/* Covers: .player-card (market)  .bench-card (visual bench) */
/*         .position-slot / .bench-slot (my lineup)  .starter-node (visual lineup) */

/* tier chips always carry their own solid background, so label text never sits bare on the card face */
.starter-node.tier-D.filled,
.starter-node.tier-C.filled,
.starter-node.tier-B.filled,
.starter-node.tier-A.filled,
.starter-node.tier-S.filled,
.starter-node.tier-SS.filled,
.starter-node.tier-SSS.filled,
.starter-node.tier-XXX.filled,
.starter-node.tier-XX.filled,
.starter-node.tier-X.filled {
  border-radius: 10px;
  padding: 8px 6px;
}

/* --- D: light gray face, thin gray border, NO effects --- */
.player-card.tier-D,
.bench-card.tier-D.filled,
.position-slot.tier-D.filled,
.bench-slot.tier-D.filled,
.starter-node.tier-D.filled {
  background: linear-gradient(165deg, #eef1f5, #dfe4ea);
  border: 1px solid #9aa4b0;
  box-shadow: none;
  animation: none;
}

/* D: bare text on the light face flips dark (chips/badges keep their own colors) */
.position-slot.tier-D.filled .pmeta,
.bench-slot.tier-D.filled .pmeta,
.player-card.tier-D .pmeta { color: #566070; }
.bench-card.tier-D.filled .bench-meta { color: #566070; }
.bench-card.tier-D.filled .bench-salary,
.starter-node.tier-D.filled .node-ovr,
.starter-node.tier-D.filled .node-salary { color: #8a6a05; }
.player-card.tier-D .price-tag { color: #8a6510; border-color: #d0a52e; }
.player-card.tier-D .sell-btn,
.position-slot.tier-D.filled .sell-btn,
.bench-slot.tier-D.filled .sell-btn { color: #c02626; border-color: #c02626; }
.position-slot.tier-D.filled .slot-mini-rating { background: #f3f6f9; border-color: #c7ced7; color: #8a6510; }

/* --- C: light green gradient border, soft highlight --- */
.player-card.tier-C,
.bench-card.tier-C.filled,
.position-slot.tier-C.filled,
.bench-slot.tier-C.filled,
.starter-node.tier-C.filled {
  border: 1px solid transparent;
  background:
    linear-gradient(#141b23, #17202a) padding-box,
    linear-gradient(135deg, #5fd48a, #b4f5c8, #5fd48a) border-box;
  box-shadow: 0 0 7px rgba(95,212,138,.20), inset 0 0 14px rgba(95,212,138,.06);
  animation: none;
}

/* --- B: light blue gradient border, subtle moving glint --- */
.player-card.tier-B,
.bench-card.tier-B.filled,
.position-slot.tier-B.filled,
.bench-slot.tier-B.filled,
.starter-node.tier-B.filled {
  border: 1px solid transparent;
  background:
    linear-gradient(#15161b, #17181d) padding-box,
    linear-gradient(135deg, #4f9cf0, #8ec8f5, #e3f3ff, #8ec8f5, #4f9cf0) border-box;
  background-size: 260% 260%;
  box-shadow: 0 0 9px rgba(79,156,240,.24), inset 0 0 14px rgba(79,156,240,.05);
  animation: tierShine 3.4s linear infinite;
}

/* --- A: deep purple + magenta gradient, flowing edge light --- */
.player-card.tier-A,
.bench-card.tier-A.filled,
.position-slot.tier-A.filled,
.bench-slot.tier-A.filled,
.starter-node.tier-A.filled {
  border: 1px solid transparent;
  background:
    linear-gradient(#140b1d, #180f24) padding-box,
    linear-gradient(120deg, #6b21a8, #d946ef, #f0abfc, #d946ef, #6b21a8) border-box;
  background-size: 300% 100%;
  box-shadow: 0 0 12px rgba(217,70,239,.32);
  animation: tierFlow 2.4s linear infinite;
}

/* --- S: orange-gold flame flow, outer glow --- */
.player-card.tier-S,
.bench-card.tier-S.filled,
.position-slot.tier-S.filled,
.bench-slot.tier-S.filled,
.starter-node.tier-S.filled {
  border: 1px solid transparent;
  background:
    linear-gradient(#1c1306, #221808) padding-box,
    linear-gradient(135deg, #ff9a1f, #ffb347, #fff1d6, #ff9a1f, #d97706) border-box;
  background-size: 300% 300%;
  box-shadow: 0 0 16px rgba(255,154,31,.42), 0 0 34px rgba(255,107,0,.18);
  animation: tierFlame 2.1s linear infinite;
}

/* --- SS (150-199): black face + gold border, star particles, dynamic halo --- */
.player-card.tier-SS,
.bench-card.tier-SS.filled,
.position-slot.tier-SS.filled,
.bench-slot.tier-SS.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(#040404, #0a0a0b) padding-box,
    linear-gradient(135deg, #ffd700, #8a6a00, #ffd700, #fff3b0, #ffd700) border-box;
  background-size: 100% 100%, 300% 300%;
  animation: tierHalo 2.4s ease-in-out infinite;
}
.starter-node.tier-SS.filled {
  border: 1px solid transparent;
  isolation: isolate;
  background:
    linear-gradient(#040404, #0a0a0b) padding-box,
    linear-gradient(135deg, #ffd700, #8a6a00, #ffd700, #fff3b0, #ffd700) border-box;
  background-size: 100% 100%, 300% 300%;
  animation: tierHalo 2.4s ease-in-out infinite;
}
/* SS star particles */
.player-card.tier-SS::before,
.bench-card.tier-SS.filled::before,
.position-slot.tier-SS.filled::before,
.bench-slot.tier-SS.filled::before,
.starter-node.tier-SS.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 1.6px at 14% 28%, rgba(255,255,255,.95), transparent 62%),
    radial-gradient(1.4px 1.4px at 68% 18%, rgba(255,236,160,.92), transparent 62%),
    radial-gradient(1.2px 1.2px at 42% 74%, rgba(255,255,255,.88), transparent 62%),
    radial-gradient(1.6px 1.6px at 86% 62%, rgba(255,215,0,.95), transparent 62%),
    radial-gradient(1.2px 1.2px at 24% 86%, rgba(255,255,255,.85), transparent 62%),
    radial-gradient(1.4px 1.4px at 56% 44%, rgba(255,248,205,.92), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 3.6s linear infinite;
}
/* SS gold OVR text */
.player-card.tier-SS .ovr { color: #ffd700; text-shadow: 0 0 6px rgba(255,200,0,.5); }
.position-slot.tier-SS.filled .slot-mini-rating,
.starter-node.tier-SS.filled .node-ovr { color: #ffd700; text-shadow: 0 0 6px rgba(255,200,0,.5); }

/* --- SSS (200-249): black texture + gold border, foil OVR, star particles, dynamic glow --- */
.player-card.tier-SSS,
.bench-card.tier-SSS.filled,
.position-slot.tier-SSS.filled,
.bench-slot.tier-SSS.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,215,0,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#040404, #0a0a0b) padding-box,
    linear-gradient(135deg, #ffd700, #ff9a1f, #fff3b0, #ffc800, #ffd700) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierHalo 2.4s ease-in-out infinite;
}
.starter-node.tier-SSS.filled {
  border: 1px solid transparent;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,215,0,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#040404, #0a0a0b) padding-box,
    linear-gradient(135deg, #ffd700, #ff9a1f, #fff3b0, #ffc800, #ffd700) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierHalo 2.4s ease-in-out infinite;
}
/* SSS star particles */
.player-card.tier-SSS::before,
.bench-card.tier-SSS.filled::before,
.position-slot.tier-SSS.filled::before,
.bench-slot.tier-SSS.filled::before,
.starter-node.tier-SSS.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 1.6px at 14% 28%, rgba(255,255,255,.95), transparent 62%),
    radial-gradient(1.4px 1.4px at 68% 18%, rgba(255,236,160,.92), transparent 62%),
    radial-gradient(1.2px 1.2px at 42% 74%, rgba(255,255,255,.88), transparent 62%),
    radial-gradient(1.6px 1.6px at 86% 62%, rgba(255,215,0,.95), transparent 62%),
    radial-gradient(1.2px 1.2px at 24% 86%, rgba(255,255,255,.85), transparent 62%),
    radial-gradient(1.4px 1.4px at 56% 44%, rgba(255,248,205,.92), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 3.2s linear infinite;
}
/* SSS foil OVR text */
.player-card.tier-SSS .ovr {
  background: linear-gradient(110deg, #ffd700, #ff9a1f 40%, #fff3b0 50%, #ff9a1f 60%, #ffd700);
  background-size: 280% 100%;
  color: #1a1200;
  animation: tierXOvrFoil 2.6s linear infinite;
}
.position-slot.tier-SSS.filled .slot-mini-rating,
.starter-node.tier-SSS.filled .node-ovr {
  color: #ffe066;
  text-shadow: 0 0 8px rgba(255,200,0,.6);
}

/* --- X (250-299): black texture, flame border glow, foil OVR, flame particles, dynamic glow --- */
.player-card.tier-X,
.bench-card.tier-X.filled,
.position-slot.tier-X.filled,
.bench-slot.tier-X.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,215,0,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#040404, #0a0a0b) padding-box,
    linear-gradient(135deg, #ffd700, #ff9a1f, #fff3b0, #ff7a00, #ffd700) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierXFlame 1.8s linear infinite, tierXGlow 2.4s ease-in-out infinite;
}
.starter-node.tier-X.filled {
  border: 1px solid transparent;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,215,0,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#040404, #0a0a0b) padding-box,
    linear-gradient(135deg, #ffd700, #ff9a1f, #fff3b0, #ff7a00, #ffd700) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierXFlame 1.8s linear infinite, tierXGlow 2.4s ease-in-out infinite;
}
/* X rising embers */
.player-card.tier-X::before,
.bench-card.tier-X.filled::before,
.position-slot.tier-X.filled::before,
.bench-slot.tier-X.filled::before,
.starter-node.tier-X.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 2.4px at 14% 86%, rgba(255,170,40,.95), transparent 62%),
    radial-gradient(1.4px 2px at 68% 78%, rgba(255,215,80,.9), transparent 62%),
    radial-gradient(1.3px 2.2px at 42% 90%, rgba(255,120,20,.88), transparent 62%),
    radial-gradient(1.5px 2.2px at 86% 82%, rgba(255,200,60,.92), transparent 62%),
    radial-gradient(1.2px 1.8px at 24% 94%, rgba(255,240,160,.85), transparent 62%),
    radial-gradient(1.4px 2px at 56% 76%, rgba(255,185,50,.9), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 2.8s linear infinite;
}
/* X gold foil OVR text */
.player-card.tier-X .ovr {
  background: linear-gradient(110deg, #ffd700, #ff9a1f 40%, #fff3b0 50%, #ff9a1f 60%, #ffd700);
  background-size: 280% 100%;
  color: #1a1200;
  animation: tierXOvrFoil 2.4s linear infinite;
}
.position-slot.tier-X.filled .slot-mini-rating,
.starter-node.tier-X.filled .node-ovr {
  color: #ffd76a;
  text-shadow: 0 0 6px rgba(255,200,60,.55);
}

/* --- XX mythic: black texture face, flame edge, gold foil, rays, laser sheen, 3D tilt --- */
.player-card.tier-XX,
.bench-card.tier-XX.filled,
.position-slot.tier-XX.filled,
.bench-slot.tier-XX.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  overflow: visible;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#060403, #0d0906) padding-box,
    linear-gradient(135deg, #ff7a00, #ffd700, #ff4d00, #ffe9a8, #ffb300) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierXXFlame 1.7s linear infinite, tierXXGlow 2.4s ease-in-out infinite;
}
/* visual-lineup node keeps position:absolute, so no position override here */
.starter-node.tier-XX.filled {
  border: 1px solid transparent;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#060403, #0d0906) padding-box,
    linear-gradient(135deg, #ff7a00, #ffd700, #ff4d00, #ffe9a8, #ffb300) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierXXFlame 1.7s linear infinite, tierXXGlow 2.4s ease-in-out infinite;
}

/* XX rotating background rays + rising embers (painted under content) */
.player-card.tier-XX::before,
.bench-card.tier-XX.filled::before,
.position-slot.tier-XX.filled::before,
.bench-slot.tier-XX.filled::before {
  content: '';
  position: absolute;
  inset: -40%;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,170,40,.055) 0deg 6deg, transparent 6deg 22deg, rgba(255,220,100,.045) 22deg 28deg, transparent 28deg 45deg),
    radial-gradient(1.6px 2.4px at 12% 86%, rgba(255,160,40,.95), transparent 62%),
    radial-gradient(1.4px 2px at 34% 74%, rgba(255,220,120,.9), transparent 62%),
    radial-gradient(1.6px 2.6px at 58% 90%, rgba(255,90,10,.9), transparent 62%),
    radial-gradient(1.3px 2px at 76% 72%, rgba(255,240,180,.9), transparent 62%),
    radial-gradient(1.5px 2.2px at 90% 84%, rgba(255,150,30,.92), transparent 62%),
    radial-gradient(1.2px 1.8px at 46% 62%, rgba(255,255,210,.85), transparent 62%);
  background-size: 100% 100%, 210% 210%, 210% 210%, 210% 210%, 210% 210%, 210% 210%, 210% 210%;
  animation: tierXXRays 16s linear infinite, tierSpark 3s linear infinite;
}

/* visual-lineup node keeps embers only (no rotating rays; avatar halo stays unclipped) */
.starter-node.tier-XX.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 2.4px at 12% 86%, rgba(255,160,40,.95), transparent 62%),
    radial-gradient(1.4px 2px at 34% 74%, rgba(255,220,120,.9), transparent 62%),
    radial-gradient(1.6px 2.6px at 58% 90%, rgba(255,90,10,.9), transparent 62%),
    radial-gradient(1.3px 2px at 76% 72%, rgba(255,240,180,.9), transparent 62%),
    radial-gradient(1.5px 2.2px at 90% 84%, rgba(255,150,30,.92), transparent 62%),
    radial-gradient(1.2px 1.8px at 46% 62%, rgba(255,255,210,.85), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 3s linear infinite;
}

/* XX diagonal laser sheen sweeping across the face */
.player-card.tier-XX::after,
.bench-card.tier-XX.filled::after,
.position-slot.tier-XX.filled::after,
.bench-slot.tier-XX.filled::after,
.starter-node.tier-XX.filled::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.06) 45%, rgba(255,244,190,.16) 50%, rgba(255,255,255,.06) 55%, transparent 68%);
  background-size: 280% 100%;
  animation: tierXXSheen 3.8s linear infinite;
}

/* XX gilded OVR text + gold foil shimmer on market OVR pill */
.position-slot.tier-XX.filled .slot-mini-rating,
.starter-node.tier-XX.filled .node-ovr {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255,140,0,.6);
}
.player-card.tier-XX .ovr {
  background: linear-gradient(110deg, #b8860b, #ffd700 40%, #fff6c8 50%, #ffd700 60%, #b8860b);
  background-size: 260% 100%;
  color: #1a1206;
  animation: tierXXFoil 2.6s linear infinite;
}

/* XX avatar breathing halo */
.player-card.tier-XX .avatar,
.bench-card.tier-XX.filled .avatar,
.position-slot.tier-XX.filled .avatar,
.bench-slot.tier-XX.filled .avatar {
  animation: tierXXBreathe 2.8s ease-in-out infinite;
}

/* --- XXX eternal: black texture face, RED flame edge, gold-magenta foil, rays, laser sheen, 3D tilt --- */
.player-card.tier-XXX,
.bench-card.tier-XXX.filled,
.position-slot.tier-XXX.filled,
.bench-slot.tier-XXX.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  overflow: visible;
  background:
    repeating-linear-gradient(45deg, rgba(255,40,0,.04) 0 3px, transparent 3px 9px),
    linear-gradient(#0d0303, #1a0606) padding-box,
    linear-gradient(135deg, #ff2d00, #ffb347, #ff1a00, #ff7a3d, #ff4d00) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierXXFlame 1.6s linear infinite, tierXXXGlow 2.2s ease-in-out infinite;
}
/* visual-lineup node keeps position:absolute, so no position override here */
.starter-node.tier-XXX.filled {
  border: 1px solid transparent;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,40,0,.04) 0 3px, transparent 3px 9px),
    linear-gradient(#0d0303, #1a0606) padding-box,
    linear-gradient(135deg, #ff2d00, #ffb347, #ff1a00, #ff7a3d, #ff4d00) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierXXFlame 1.6s linear infinite, tierXXXGlow 2.2s ease-in-out infinite;
}

/* XXX rotating red rays + rising red embers (painted under content) */
.player-card.tier-XXX::before,
.bench-card.tier-XXX.filled::before,
.position-slot.tier-XXX.filled::before,
.bench-slot.tier-XXX.filled::before {
  content: '';
  position: absolute;
  inset: -40%;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background:
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(255,60,20,.06) 0deg 6deg, transparent 6deg 22deg, rgba(255,140,40,.05) 22deg 28deg, transparent 28deg 45deg),
    radial-gradient(1.6px 2.4px at 12% 86%, rgba(255,70,30,.95), transparent 62%),
    radial-gradient(1.4px 2px at 34% 74%, rgba(255,160,60,.9), transparent 62%),
    radial-gradient(1.6px 2.6px at 58% 90%, rgba(255,30,10,.9), transparent 62%),
    radial-gradient(1.3px 2px at 76% 72%, rgba(255,200,120,.9), transparent 62%),
    radial-gradient(1.5px 2.2px at 90% 84%, rgba(255,80,20,.92), transparent 62%),
    radial-gradient(1.2px 1.8px at 46% 62%, rgba(255,240,180,.85), transparent 62%);
  background-size: 100% 100%, 210% 210%, 210% 210%, 210% 210%, 210% 210%, 210% 210%, 210% 210%;
  animation: tierXXRays 14s linear infinite, tierSpark 2.8s linear infinite;
}

/* visual-lineup node keeps red embers only (no rotating rays; avatar halo stays unclipped) */
.starter-node.tier-XXX.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 2.4px at 12% 86%, rgba(255,70,30,.95), transparent 62%),
    radial-gradient(1.4px 2px at 34% 74%, rgba(255,160,60,.9), transparent 62%),
    radial-gradient(1.6px 2.6px at 58% 90%, rgba(255,30,10,.9), transparent 62%),
    radial-gradient(1.3px 2px at 76% 72%, rgba(255,200,120,.9), transparent 62%),
    radial-gradient(1.5px 2.2px at 90% 84%, rgba(255,80,20,.92), transparent 62%),
    radial-gradient(1.2px 1.8px at 46% 62%, rgba(255,240,180,.85), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 2.8s linear infinite;
}

/* XXX diagonal laser sheen sweeping across the face */
.player-card.tier-XXX::after,
.bench-card.tier-XXX.filled::after,
.position-slot.tier-XXX.filled::after,
.bench-slot.tier-XXX.filled::after,
.starter-node.tier-XXX.filled::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(115deg, transparent 32%, rgba(255,80,60,.07) 45%, rgba(255,180,150,.18) 50%, rgba(255,80,60,.07) 55%, transparent 68%);
  background-size: 280% 100%;
  animation: tierXXSheen 3.6s linear infinite;
}

/* XXX gold+magenta OVR text + foil shimmer on market OVR pill */
.position-slot.tier-XXX.filled .slot-mini-rating,
.starter-node.tier-XXX.filled .node-ovr {
  color: #ff5eb8;
  text-shadow: 0 0 8px rgba(255,45,149,.7), 0 0 14px rgba(255,140,0,.35);
}
.player-card.tier-XXX .ovr {
  background: linear-gradient(110deg, #ffd700, #ff2d95 38%, #fff6c8 50%, #ff2d95 62%, #ffd700);
  background-size: 280% 100%;
  color: #1a0a12;
  animation: tierXXXFoil 2.4s linear infinite;
}

/* XXX avatar breathing halo (red) */
.player-card.tier-XXX .avatar,
.bench-card.tier-XXX.filled .avatar,
.position-slot.tier-XXX.filled .avatar,
.bench-slot.tier-XXX.filled .avatar {
  animation: tierXXXBreathe 2.6s ease-in-out infinite;
}

/* hover keeps the gradient border intact (cards keep their tier glow while lifted) */
.player-card.tier-C:hover,
.player-card.tier-B:hover,
.player-card.tier-A:hover,
.player-card.tier-S:hover,
.player-card.tier-SS:hover,
.player-card.tier-SSS:hover,
.player-card.tier-X:hover,
.bench-card.tier-C.filled:hover,
.bench-card.tier-B.filled:hover,
.bench-card.tier-A.filled:hover,
.bench-card.tier-S.filled:hover,
.bench-card.tier-SS.filled:hover,
.bench-card.tier-SSS.filled:hover,
.bench-card.tier-X.filled:hover,
.position-slot.tier-C.filled:hover,
.position-slot.tier-B.filled:hover,
.position-slot.tier-A.filled:hover,
.position-slot.tier-S.filled:hover,
.position-slot.tier-SS.filled:hover,
.position-slot.tier-SSS.filled:hover,
.position-slot.tier-X.filled:hover,
.bench-slot.tier-C.filled:hover,
.bench-slot.tier-B.filled:hover,
.bench-slot.tier-A.filled:hover,
.bench-slot.tier-S.filled:hover,
.bench-slot.tier-SS.filled:hover,
.bench-slot.tier-SSS.filled:hover,
.bench-slot.tier-X.filled:hover { border-color: transparent; }
.player-card.tier-XX:hover,
.bench-card.tier-XX.filled:hover,
.position-slot.tier-XX.filled:hover,
.bench-slot.tier-XX.filled:hover { border-color: transparent; }
.player-card.tier-XXX:hover,
.bench-card.tier-XXX.filled:hover,
.position-slot.tier-XXX.filled:hover,
.bench-slot.tier-XXX.filled:hover { border-color: transparent; }

/* owned market cards keep the green outline (works on every tier face) */
.player-card.owned { outline: 2px solid rgba(62,201,124,.75); outline-offset: -4px; }

/* avatar corner chip per tier */
.avatar[data-tier="XXX"]::before { background: linear-gradient(135deg, #1a0505, #3a0a08); color: #ff5eb8; border-color: #ff3b1f; }
.avatar[data-tier="XX"]::before { background: linear-gradient(135deg, #140a02, #2b1503); color: #ffd700; border-color: #ff7a00; }
.avatar[data-tier="SS"]::before { background: linear-gradient(135deg, #080808, #12100a); color: #ffd700; border-color: #ffd700; }
.avatar[data-tier="SSS"]::before { background: linear-gradient(135deg, #0a0a0a, #1a1508); color: #ffe066; border-color: #ffc800; }
.avatar[data-tier="X"]::before { background: linear-gradient(135deg, #0a0a0a, #1a1206); color: #ffd700; border-color: #ffd700; }
.avatar[data-tier="S"]::before { background: linear-gradient(135deg, #ff9a1f, #ffb347); color: #1a1206; }
.avatar[data-tier="A"]::before { background: linear-gradient(135deg, #6b21a8, #d946ef); color: #fff; }
.avatar[data-tier="B"]::before { background: linear-gradient(135deg, #4f9cf0, #8ec8f5); color: #0b1e33; }
.avatar[data-tier="C"]::before { background: linear-gradient(135deg, #5fd48a, #b4f5c8); color: #0d2416; }
.avatar[data-tier="D"]::before { background: linear-gradient(135deg, #9ca3af, #6b7280); color: #fff; }

/* visual-lineup avatar halo (D has no effect) */
.starter-node.tier-XXX .node-avatar .avatar { animation: tierXXXBreathe 2.6s ease-in-out infinite; }
.starter-node.tier-XX .node-avatar .avatar { animation: tierXXBreathe 2.8s ease-in-out infinite; }
.starter-node.tier-SS .node-avatar .avatar { box-shadow: 0 0 14px rgba(255,215,0,.70); }
.starter-node.tier-SSS .node-avatar .avatar { animation: tierXOvrBreathe 2.6s ease-in-out infinite; }
.starter-node.tier-X .node-avatar .avatar { animation: tierXOvrBreathe 2.4s ease-in-out infinite; }
.starter-node.tier-S .node-avatar .avatar { box-shadow: 0 0 12px rgba(255,154,31,.62); }
.starter-node.tier-A .node-avatar .avatar { box-shadow: 0 0 11px rgba(217,70,239,.58); }
.starter-node.tier-B .node-avatar .avatar { box-shadow: 0 0 10px rgba(79,156,240,.50); }
.starter-node.tier-C .node-avatar .avatar { box-shadow: 0 0 8px rgba(95,212,138,.40); }

/* tier effect keyframes */
@keyframes tierShine { 0% { background-position: 0% 0%; } 100% { background-position: 260% 0%; } }
@keyframes tierFlow { 0% { background-position: 0% 50%; } 100% { background-position: 300% 50%; } }
@keyframes tierFlame { 0% { background-position: 0% 0%; } 100% { background-position: 300% 300%; } }
@keyframes tierHalo {
  0%, 100% { box-shadow: 0 0 14px rgba(255,215,0,.32), 0 0 34px rgba(255,215,0,.16); }
  50% { box-shadow: 0 0 24px rgba(255,215,0,.58), 0 0 52px rgba(255,215,0,.30); }
}
@keyframes tierXFlame { 0% { background-position: 0 0, 0 0, 0% 50%; } 100% { background-position: 0 0, 0 0, 300% 50%; } }
@keyframes tierXGlow {
  0%, 100% { box-shadow: 0 0 12px rgba(255,170,30,.36), 0 0 30px rgba(255,120,10,.16), inset 0 -10px 18px -12px rgba(255,150,20,.45); }
  50% { box-shadow: 0 0 22px rgba(255,200,60,.62), 0 0 48px rgba(255,140,20,.28), inset 0 -14px 24px -8px rgba(255,170,30,.75); }
}
@keyframes tierXOvrFoil { 0% { background-position: 0% 50%; } 100% { background-position: 280% 50%; } }
@keyframes tierXOvrBreathe {
  0%, 100% { box-shadow: 0 0 12px rgba(255,190,50,.55); }
  50% { box-shadow: 0 0 22px rgba(255,210,80,.9), 0 0 34px rgba(255,150,20,.35); }
}
@keyframes tierSpark { 0% { background-position: 0% 0%; } 100% { background-position: 210% 210%; } }
@keyframes tierXXFlame {
  0% { background-position: 0 0, 0 0, 0% 0%; }
  100% { background-position: 0 0, 0 0, 300% 300%; }
}
@keyframes tierXXGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(255,120,0,.35), 0 0 26px rgba(255,60,0,.18), inset 0 -14px 24px -12px rgba(255,90,0,.55); }
  50% { box-shadow: 0 0 20px rgba(255,150,20,.6), 0 0 44px rgba(255,70,0,.3), inset 0 -18px 30px -8px rgba(255,120,10,.9); }
}
@keyframes tierXXRays { to { transform: rotate(360deg); } }
@keyframes tierXXSheen { 0% { background-position: 0% 50%; } 100% { background-position: 280% 50%; } }
@keyframes tierXXFoil { 0% { background-position: 0% 50%; } 100% { background-position: 260% 50%; } }
@keyframes tierXXBreathe {
  0%, 100% { box-shadow: 0 0 10px rgba(255,140,0,.5); }
  50% { box-shadow: 0 0 22px rgba(255,180,20,.95), 0 0 36px rgba(255,80,0,.4); }
}
@keyframes tierXXXGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(255,40,10,.4), 0 0 28px rgba(255,10,0,.2), inset 0 -14px 24px -12px rgba(255,30,0,.65); }
  50% { box-shadow: 0 0 22px rgba(255,70,20,.7), 0 0 50px rgba(255,20,0,.35), inset 0 -18px 30px -8px rgba(255,50,0,1); }
}
@keyframes tierXXXFoil { 0% { background-position: 0% 50%; } 100% { background-position: 280% 50%; } }
@keyframes tierXXXBreathe {
  0%, 100% { box-shadow: 0 0 10px rgba(255,50,20,.55); }
  50% { box-shadow: 0 0 24px rgba(255,70,30,1), 0 0 40px rgba(255,20,0,.45); }
}

.position-slot.filled { grid-template-columns: 56px 52px 1fr auto; }
.slot-avatar { width: 44px; height: 44px; margin-left: 4px; }
.bench-slot .bench-avatar-row { display: flex; align-items: center; gap: 8px; text-align: left; }
.bench-slot .bench-avatar-row .bmeta { flex: 1; min-width: 0; }

/* ================ 主力/替补互换按钮 ================ */
.swap-btn {
  background: transparent; color: var(--accent-2);
  border: 1px solid var(--accent-2);
  padding: 3px 8px; font-size: 11px; border-radius: 6px;
  cursor: pointer; font-weight: 600;
  margin-left: 6px;
}
.swap-btn:hover { background: rgba(64,148,255,.12); }

/* ================ 任务中心 ================ */
.task-list { display: grid; gap: 12px; max-width: 720px; }
.task-card {
  display: flex; align-items: center; gap: 14px;
  background: #11181f;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.task-card.done { opacity: .6; border-color: var(--good); }
.task-card.locked { opacity: .75; }
.task-icon {
  font-size: 26px; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05);
  border-radius: 10px; flex: none;
}
.task-body { flex: 1; min-width: 0; }
.task-body .tname { font-weight: 700; font-size: 15px; }
.task-body .tdesc { color: var(--muted); font-size: 12px; margin-top: 2px; }
.task-reward {
  color: var(--gold); font-weight: 800; font-size: 15px; flex: none;
}
.task-reward.zero { color: var(--muted); font-weight: 600; font-size: 12px; }
.task-status {
  flex: none; font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted);
}
.task-status.claim {
  background: var(--gold); color: #1a1a1a; border-color: var(--gold);
  cursor: pointer;
}
.task-status.claim:hover { background: #d49b13; }

/* ================ 加载遮罩 ================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 17, 23, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s, visibility 0.3s;
}
.loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-text {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

/* ================ 背包/商城 ================ */
.inv-list, .shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.inv-item, .shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #11181f;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  transition: .15s;
}
.inv-item:hover, .shop-item:hover { border-color: var(--accent); transform: translateY(-1px); }

.inv-item-icon, .shop-item-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: rgba(255,255,255,.05);
  border-radius: 8px;
  flex-shrink: 0;
}

.inv-item-info, .shop-item-info { flex: 1; min-width: 0; }
.inv-item-name, .shop-item-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.inv-item-desc, .shop-item-desc { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.inv-item-qty { color: var(--gold); font-weight: 700; font-size: 12px; }
.shop-item-price { color: var(--gold); font-weight: 800; font-size: 14px; }

.inv-item .btn, .shop-item .btn {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 12px;
}

/* 道具�?次用多张：数量�?�择�? */
.inv-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.inv-use-count { display: flex; align-items: center; gap: 4px; }
.qty-btn {
  width: 26px; height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-size: 15px; line-height: 1;
  cursor: pointer;
  transition: .15s;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.qty-input {
  width: 48px; height: 26px;
  text-align: center;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--gold);
  font-weight: 700;
  font-size: 13px;
}
.qty-input:focus { outline: none; border-color: var(--accent); }


/* ================ 工资帽卡�? ================ */
.salary-cap-card {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(240,184,39,0.15);
}
.salary-cap-card h3 {
  margin: 0 0 16px;
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
}
.cap-bar-wrap {
  margin-bottom: 12px;
}
.cap-bar-bg {
  height: 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}
.cap-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #ffaa00);
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 0 8px var(--gold);
}
.cap-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.cap-labels span { font-weight: 600; }
.cap-used { color: var(--gold); }
.cap-limit { color: var(--text); }
.cap-remaining { color: var(--good); }
.cap-detail {
  font-size: 13px;
  color: var(--muted);
}
.cap-detail strong { color: var(--gold); }

/* ================ 降薪球员选择弹窗 ================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.salary-reduce-modal {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.salary-reduce-modal h3 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 16px;
}
.modal-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 16px;
}

/* ================ 比赛弹层 ================ */
.game-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}
.game-overlay.hidden { display: none; }
.game-modal {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 26px 0;
  width: 96%;
  max-width: 920px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0,0,0,0.6);
}
/* 内容区独立滚动，底部关闭栏固定不随内容滚�? */
.game-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 22px;   /* 左右留白，比分栏吸附时用负边距拉回全�? */
}
.game-modal-footer {
  flex: 0 0 auto;
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 14px 0 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--line);
}
.game-modal h1 { margin: 0 0 14px; font-size: 20px; flex: 0 0 auto; }
.game-modal .playbyplay { margin-top: 14px; }
.game-modal .pbp-log { height: 30vh; max-height: 30vh; }
.game-modal .boxscore { margin-top: 14px; }

/* ================ 比赛内动画（三分/盖帽/抢断/攻击波） ================ */
.game-fx-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;   /* 不挡点击 */
  z-index: 30;
  overflow: hidden;
  border-radius: 14px;
}
.game-fx {
  pointer-events: none;
  padding: 16px 34px;
  border-radius: 16px;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: .04em;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 10px rgba(0,0,0,.55);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  animation: gameFx 1.4s cubic-bezier(.2,.9,.3,1) forwards;
}
.game-fx .fx-sub {
  display: block;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .12em;
  opacity: .92;
  margin-top: 6px;
}
/* 通用：进场放�? + 停留 + �?场缩小上�? */
@keyframes gameFx {
  0%   { opacity: 0; transform: scale(.55) translateY(18px); }
  14%  { opacity: 1; transform: scale(1.1) translateY(0); }
  22%  { transform: scale(1) translateY(0); }
  76%  { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(1.18) translateY(-22px); }
}
/* 8-0 攻击波：红橙，略�? */
.fx-run {
  background: linear-gradient(135deg, #e44c4c 0%, #b31d1d 100%);
  color: #fff0f0;
  border: 2px solid #ff9a9a;
  font-size: 34px;
  padding: 20px 40px;
}
.player-select-list {
  max-height: 400px;
  overflow-y: auto;
}
.player-select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: .15s;
}
.player-select-row:hover:not(.disabled) { border-color: var(--accent); }
.player-select-row.disabled { opacity: 0.5; }
.ps-info { flex: 1; min-width: 0; }
.ps-name { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.ps-stats { font-size: 11px; color: var(--muted); }
.pos-tag {
  font-size: 10px; padding: 1px 5px; border-radius: 3px;
  background: var(--accent-2); color: #fff; margin-right: 6px;
}
.player-select-row .btn {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 11px;
}
.salary-reduce-modal .btn.ghost {
  margin-top: 16px;
  width: 100%;
}


/* ================ 赛事模式 / 战绩�? ================ */
.mode-card { margin-bottom: 14px; }
.mode-card h3 { margin-bottom: 10px; }
.mode-card .chip:disabled { opacity: .55; cursor: not-allowed; text-decoration: line-through; }
.mode-card .chip:disabled:hover { background: var(--bg-soft); }

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.mode-summary-card {
  background: #11181f;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.mode-summary-card.active { border-color: var(--accent); box-shadow: inset 0 0 0 1px rgba(200,16,46,.35); }
.mode-summary-card.disabled { opacity: .55; }
.ms-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.ms-record { font-size: 20px; font-weight: 800; color: var(--gold); }
.ms-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

.table-scroll { overflow-x: auto; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 660px; }
.stats-table th, .stats-table td {
  padding: 7px 8px;
  text-align: left;
  border-bottom: 1px dashed var(--line);
  white-space: nowrap;
}
.stats-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  background: #0e131b;
  position: sticky;
  top: 0;
}
.stats-table .pn { font-weight: 600; }
.stats-table .ovr { color: var(--gold); font-weight: 700; }
.stats-table tbody tr:hover { background: #131b26; }
.stats-table.compact { min-width: 560px; font-size: 12px; }
.stats-table tr.left-team { opacity: .7; }
.tag-left {
  font-size: 10px; background: #333b47; color: var(--muted);
  border-radius: 4px; padding: 1px 5px; margin-left: 4px;
}
#playerAvgEmpty { margin-top: 8px; }

.match-history { display: grid; gap: 8px; }
.history-item {
  background: #11181f;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.history-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; cursor: pointer; flex-wrap: wrap;
}
.history-head:hover { background: #141c27; }
.hi-result {
  font-weight: 800; padding: 2px 9px; border-radius: 999px; font-size: 12px;
}
.hi-result.win { background: rgba(62,201,124,.16); color: var(--good); }
.hi-result.lose { background: rgba(228,76,76,.16); color: var(--bad); }
.hi-score { font-weight: 800; font-size: 16px; color: var(--gold); }
.hi-opp { font-size: 13px; }
.hi-mode {
  font-size: 11px; background: var(--bg-soft); border: 1px solid var(--line);
  padding: 2px 8px; border-radius: 999px; color: var(--muted);
}
.hi-date { color: var(--muted); font-size: 12px; margin-left: auto; }
.hi-toggle { color: var(--muted); font-size: 12px; }
.history-detail { padding: 6px 12px 12px; border-top: 1px dashed var(--line); }

/* �?术统计表（比赛结束页）横向滚�? */
.boxscore-card-scroll { overflow-x: auto; }


/* 首发位拖拽换人：能放 �? 金色高亮，不能放 �? 变暗 + 位置标红 */
.starter-node.drag-over .node-pos { color: var(--gold); }
.starter-node.drag-over .node-name { color: var(--gold); }
.starter-node.no-drop { opacity: 0.3; }
.starter-node.no-drop .node-pos { color: var(--bad); }
/* ================ ����ҳ�����²�����ǿ ================ */
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 16px;
}
.panel-head h3 { margin: 0; border-left: 4px solid var(--gold); padding-left: 10px; }
.pool-panel .pool-header h3 { border-left: 4px solid var(--accent-2); padding-left: 10px; }
.lineup-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lineup-panel { border-top: 3px solid var(--gold); }
.pool-panel { border-top: 3px solid var(--accent-2); }
.position-slot .slot-avatar { order: -1; margin-left: 0; }
.position-slot.need-fill { border-style: dashed; }
.pos-tag.empty { box-shadow: none; }
.bench h4 { font-weight: 700; letter-spacing: .5px; color: var(--gold); }
.player-list::-webkit-scrollbar { width: 8px; }
.player-list::-webkit-scrollbar-track { background: transparent; }
.player-list::-webkit-scrollbar-thumb { background: #2f3a4a; border-radius: 4px; }
.player-list::-webkit-scrollbar-thumb:hover { background: #3d4a5e; }



/* ================ Match court scene (tactical board, L/R symmetric) ================ */
.court-scene {
  position: relative;
  height: 300px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(240,184,39,.10), transparent 55%),
    repeating-linear-gradient(90deg, #2a1f16 0 34px, #31251a 34px 68px);
}
.court-mid {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}
.court-mid::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  border-left: 2px dashed rgba(240,184,39,.38);
}
.court-circle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 88px;
  margin-left: -44px;
  margin-top: -44px;
  border: 2px solid rgba(240,184,39,.38);
  border-radius: 50%;
}
.court-key {
  position: absolute;
  top: 50%;
  width: 13%;
  height: 46%;
  margin-top: -23%;
  border: 2px solid rgba(240,184,39,.28);
}
.court-key.home {
  left: 0;
  border-left: none;
}
.court-key.away {
  right: 0;
  border-right: none;
}
.court-team {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
}

/* ---- ͳһ�ߴ��ս������Ա����80x96�� ---- */
.court-player {
  position: absolute;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
  width: 80px;
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 4px 5px;
  border-radius: 10px;
  border: 1px solid #354052;
  background: rgba(13,17,23,.85);
  text-align: center;
  pointer-events: auto;
  overflow: hidden;
  isolation: isolate;
  transition: transform .15s ease;
}
.court-player:hover { transform: translate(-50%, -50%) scale(1.06); z-index: 8; }
.cp-avatar {
  position: relative;
  z-index: 1;
}
.cp-name {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  color: inherit;
  width: 100%;
  padding: 0 2px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cp-pos {
  position: relative;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .5px;
}

/* ---- �ȼ���ۣ�����ҳ�ȼ�����ͬ��񣬰�С�����ţ� ---- */
/* D��ǳ�ҵס�ϸ�ұߡ�����Ч */
.court-player.tier-D {
  background: linear-gradient(180deg, #f0f1f5, #dfe3ea);
  border: 1px solid #c5cad3;
  color: #1e2632;
}
/* C�����̽���߿� + ΢���߹� */
.court-player.tier-C {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, #dff6e7, #bfe9cf) padding-box,
    linear-gradient(160deg, #9fd8b0, #cfeedd, #9fd8b0) border-box;
  color: #1b3a27;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
/* B����������߿� + ΢������ */
.court-player.tier-B {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, #dceefc, #bcdcf5) padding-box,
    linear-gradient(160deg, #8ab4e0, #c9def5, #8ab4e0) border-box;
  color: #16324f;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.court-player.tier-C::after,
.court-player.tier-B::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.45) 50%, transparent 60%);
  opacity: .5;
  pointer-events: none;
  z-index: 0;
}
/* A������ + ��콥�䣬��Ե���� */
.court-player.tier-A {
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, #341a5e, #6d2489) padding-box,
    linear-gradient(120deg, #7b2d8e, #e040fb, #7b2d8e) border-box;
  background-size: 100% 100%, 220% 220%;
  color: #fff;
  animation: tierCourtFlow 2.6s linear infinite;
  box-shadow: 0 0 6px rgba(190,60,230,.35);
}
/* S���Ƚ�������� + �ⷢ�� */
.court-player.tier-S {
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, #6e2a08, #b4560e) padding-box,
    linear-gradient(120deg, #c4560f, #ffc14d, #c4560f) border-box;
  background-size: 100% 100%, 220% 220%;
  color: #ffefc9;
  animation: tierCourtFlow 1.8s linear infinite;
  box-shadow: 0 0 10px rgba(255,165,40,.5);
}
/* SS: black + gold border, star spark, pulsing gold halo */
.court-player.tier-SS {
  border: 1px solid #d4af37;
  background: #0b0e14;
  color: #f5d76e;
  animation: tierCourtHalo 2.2s ease-in-out infinite;
}
.court-player.tier-SS::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
  border-radius: inherit;
  z-index: -1;
  background:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(255,215,100,.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(255,215,100,.7), transparent 60%),
    radial-gradient(1px 1px at 40% 70%, rgba(255,215,100,.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 80% 65%, rgba(255,215,100,.6), transparent 60%),
    radial-gradient(1px 1px at 55% 45%, rgba(255,215,100,.7), transparent 60%);
  animation: tierCourtSpark 2.4s ease-in-out infinite;
}
/* SSS: black texture + gold border, brighter spark, pulsing halo */
.court-player.tier-SSS {
  border: 1px solid #ffc800;
  background: linear-gradient(#0b0a05, #141008);
  color: #ffe066;
  animation: tierCourtHalo 2.0s ease-in-out infinite;
}
.court-player.tier-SSS::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
  border-radius: inherit;
  z-index: -1;
  background:
    radial-gradient(1.5px 2px at 20% 30%, rgba(255,200,50,.95), transparent 60%),
    radial-gradient(1.4px 1.8px at 70% 20%, rgba(255,230,80,.85), transparent 60%),
    radial-gradient(1.2px 2px at 40% 70%, rgba(255,180,30,.9), transparent 60%),
    radial-gradient(1.5px 2px at 80% 65%, rgba(255,215,80,.75), transparent 60%),
    radial-gradient(1.2px 1.8px at 55% 45%, rgba(255,240,120,.8), transparent 60%);
  animation: tierSpark 2.2s linear infinite;
}/* X: black + gold FLAME edge, ember spark, pulsing gold-orange halo */
.court-player.tier-X {
  border: 1px solid #ffd700;
  background: linear-gradient(#0b0a05, #141008);
  color: #f5d76e;
  animation: tierCourtXHalo 2.0s ease-in-out infinite;
}
.court-player.tier-X::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
  border-radius: inherit;
  z-index: -1;
  background:
    radial-gradient(1.5px 2.2px at 20% 30%, rgba(255,170,40,.95), transparent 60%),
    radial-gradient(1.4px 1.8px at 70% 20%, rgba(255,215,80,.85), transparent 60%),
    radial-gradient(1.2px 2px at 40% 70%, rgba(255,120,20,.9), transparent 60%),
    radial-gradient(1.5px 2px at 80% 65%, rgba(255,200,60,.75), transparent 60%),
    radial-gradient(1.2px 1.8px at 55% 45%, rgba(255,230,120,.8), transparent 60%);
  animation: tierSpark 2.2s linear infinite;
}
@keyframes tierCourtXHalo {
  0%, 100% { box-shadow: 0 0 6px 1px rgba(255,190,50,.4); }
  50% { box-shadow: 0 0 14px 3px rgba(255,215,80,.75); }
}
/* XX: black ember court chip, flame border, pulsing halo */
.court-player.tier-XX {
  border: 1px solid #ff9a00;
  background: linear-gradient(#0a0602, #140a02);
  color: #ffe9c4;
  animation: tierCourtXXHalo 1.8s ease-in-out infinite;
}
.court-player.tier-XX::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
  border-radius: inherit;
  z-index: -1;
  background:
    radial-gradient(1.5px 2.4px at 20% 30%, rgba(255,160,40,.95), transparent 60%),
    radial-gradient(1.2px 1.8px at 70% 20%, rgba(255,220,120,.85), transparent 60%),
    radial-gradient(1.5px 2.2px at 40% 70%, rgba(255,90,10,.9), transparent 60%),
    radial-gradient(1.3px 2px at 80% 65%, rgba(255,240,180,.8), transparent 60%),
    radial-gradient(1.4px 2.1px at 55% 45%, rgba(255,150,30,.9), transparent 60%);
  animation: tierCourtSpark 2.2s ease-in-out infinite;
}
@keyframes tierCourtXXHalo {
  0%, 100% { box-shadow: 0 0 5px 1px rgba(255,140,0,.4); }
  50% { box-shadow: 0 0 14px 3px rgba(255,170,20,.75); }
}
/* XXX: black-red court chip, RED flame border, pulsing red halo */
.court-player.tier-XXX {
  border: 1px solid #ff3b1f;
  background: linear-gradient(#0d0303, #1a0606);
  color: #ffd4c4;
  animation: tierCourtXXXHalo 1.7s ease-in-out infinite;
}
.court-player.tier-XXX::before {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  bottom: -2px;
  left: -2px;
  border-radius: inherit;
  z-index: -1;
  background:
    radial-gradient(1.5px 2.4px at 20% 30%, rgba(255,70,30,.95), transparent 60%),
    radial-gradient(1.2px 1.8px at 70% 20%, rgba(255,160,60,.85), transparent 60%),
    radial-gradient(1.5px 2.2px at 40% 70%, rgba(255,30,10,.9), transparent 60%),
    radial-gradient(1.3px 2px at 80% 65%, rgba(255,200,120,.8), transparent 60%),
    radial-gradient(1.4px 2.1px at 55% 45%, rgba(255,80,20,.9), transparent 60%);
  animation: tierCourtSpark 2.1s ease-in-out infinite;
}
@keyframes tierCourtXXXHalo {
  0%, 100% { box-shadow: 0 0 5px 1px rgba(255,40,10,.45); }
  50% { box-shadow: 0 0 16px 3px rgba(255,60,20,.8); }
}
.tier-A .cp-pos, .tier-S .cp-pos, .tier-SS .cp-pos, .tier-SSS .cp-pos, .tier-X .cp-pos, .tier-XX .cp-pos, .tier-XXX .cp-pos { color: rgba(255,255,255,.72); }
.tier-C .cp-pos, .tier-B .cp-pos { color: rgba(27,42,60,.6); }
.tier-D .cp-pos { color: #566070; }
@keyframes tierCourtFlow {
  0% { background-position: 0 0, 0% 50%; }
  100% { background-position: 0 0, 220% 50%; }
}
@keyframes tierCourtHalo {
  0%, 100% { box-shadow: 0 0 4px 1px rgba(212,175,55,.35); }
  50% { box-shadow: 0 0 12px 3px rgba(212,175,55,.7); }
}
@keyframes tierCourtSpark {
  0%, 100% { opacity: .35; }
  50% { opacity: 1; }
}

.stat-float {
  position: absolute;
  left: 50%;
  top: -2px;
  transform: translateX(-50%);
  font-size: 15px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 1px 2px rgba(0,0,0,.85);
  pointer-events: none;
  white-space: nowrap;
  z-index: 6;
  animation: statFloatUp 1.2s ease-out forwards;
}
.stat-float.f3 { color: #ff6a3d; }
@keyframes statFloatUp {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.6); }
  18% { opacity: 1; transform: translate(-50%, 0) scale(1.25); }
  100% { opacity: 0; transform: translate(-50%, -36px) scale(1); }
}
@media (max-width: 900px) {
  .court-scene { height: 240px; }
}


.stat-float.f-stl { color: #4ade80; }
.stat-float.f-blk { color: #60a5fa; }
.stat-float.f-pf { color: #f87171; }
.stat-float.f-tov { color: #fb923c; }
.stat-float.f-reb { color: #a3e635; }
.stat-float.f-ast { color: #e879f9; }



/* ================ Stats page player name tiers (font color only) ================ */
.stats-table .pn.tier-D { color: #b9c0cb; background: transparent; border: none; }
.stats-table .pn.tier-C { color: #5fd48a; background: transparent; border: none; }
.stats-table .pn.tier-B { color: #8ecdff; background: transparent; border: none; }
.stats-table .pn.tier-A { color: #e879f9; background: transparent; border: none; }
.stats-table .pn.tier-S { color: #ffb347; background: transparent; border: none; }
.stats-table .pn.tier-SS { color: #ffd700; background: transparent; border: none; text-shadow: 0 0 6px rgba(255,200,0,.35); }
.stats-table .pn.tier-SSS { color: #ffe066; background: transparent; border: none; text-shadow: 0 0 8px rgba(255,200,0,.45); }
.stats-table .pn.tier-X { color: #ff9f43; background: transparent; border: none; text-shadow: 0 0 8px rgba(255,140,0,.4); }
.stats-table .pn.tier-XX { color: #ffd700; background: transparent; border: none; text-shadow: 0 0 10px rgba(255,200,0,.5); }
.stats-table .pn.tier-XXX { color: #ff5eb8; background: transparent; border: none; text-shadow: 0 0 10px rgba(255,40,100,.45); }
/* ================ Stats avg table sortable headers ================ */
.stats-table th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.stats-table th.sortable:hover { color: var(--text); }
.stats-table th.sortable.active { color: var(--gold); }

/* ================ Ladder panel (inside match view) ================ */
.ladder-my {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.ladder-my .lm-rank {
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
}
.ladder-my .lm-chances {
  font-weight: 700;
  margin-left: auto;
}
.ladder-my .lm-chances.none { color: var(--muted); }
.ladder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg-soft);
}
.ladder-row .lr-rank {
  min-width: 48px;
  font-weight: 800;
  color: var(--gold);
}
.ladder-row .lr-name {
  flex: 1;
  font-weight: 600;
}
.ladder-row .lr-sub {
  color: var(--muted);
  font-size: 12px;
}
.ladder-row .lr-result {
  min-width: 28px;
  text-align: center;
  font-weight: 800;
  border-radius: 4px;
  padding: 2px 0;
}
.ladder-row .lr-result.win { color: var(--good); }
.ladder-row .lr-result.lose { color: #e06c6c; }
.ladder-row.me { border-color: var(--gold); }

/* ================ Court player OVR badge ================ */
.cp-ovr {
  position: absolute;
  top: 3px;
  right: 4px;
  z-index: 2;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0,0,0,.45);
  color: #ffd76a;
  pointer-events: none;
}
.tier-D .cp-ovr { color: #c8cdd6; }
.tier-C .cp-ovr { color: #8fe0a8; }
.tier-B .cp-ovr { color: #8ecdff; }
.tier-A .cp-ovr { color: #e0a3ff; }
.tier-S .cp-ovr { color: #ffb347; }
.tier-SS .cp-ovr { color: #ffd700; }
.tier-SSS .cp-ovr { color: #ffe066; }
.tier-X .cp-ovr { color: #ffd76a; }
.tier-XX .cp-ovr { color: #ffd700; text-shadow: 0 0 6px rgba(255,140,0,.6); }
.tier-XXX .cp-ovr { color: #ff5eb8; text-shadow: 0 0 6px rgba(255,45,149,.65); }

/* stamina bar in boxscore */
.stam-wrap { display:inline-flex; align-items:center; gap:4px; min-width:52px; }
.stam-bar { display:inline-block; height:8px; border-radius:4px; background:#4caf50; min-width:2px; max-width:34px; }
.stam-num { font-size:11px; color:#999; min-width:28px; }

/* task section grouping */
.task-section { margin-bottom:18px; }
.task-section-head { display:flex; align-items:baseline; gap:10px; margin:14px 0 10px; }
.task-section-title { font-size:15px; font-weight:800; color:var(--gold); }
.task-section-hint { font-size:12px; color:var(--muted); }
/* ===== item rarity tiers ===== */
.inv-item, .shop-item { position:relative; overflow:hidden; }

/* basic: light gray bg, thin gray border, no fx */
.item-tier-basic {
  background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
  border: 1px solid #c0c0c0;
  border-radius: 8px;
}

/* common: pale green gradient border, subtle highlight */
.item-tier-initial {
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, #a5d6a7, #66bb6a, #a5d6a7) 1;
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(102,187,106,0.25), inset 0 1px 0 rgba(255,255,255,0.3);
  background: linear-gradient(180deg, #f1f8f1 0%, #e8f5e9 100%);
}

/* initial: pale blue gradient border, subtle shimmer */
.item-tier-mid {
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, #90caf9, #42a5f5, #90caf9) 1;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(66,165,245,0.3);
  background: linear-gradient(180deg, #f0f7ff 0%, #e3f2fd 100%);
}
.item-tier-mid::after {
  content:''; position:absolute; inset:0; pointer-events:none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.45) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: itemShimmer 2.8s ease-in-out infinite;
}
@keyframes itemShimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* advanced: deep purple + magenta gradient, edge flow */
.item-tier-advanced {
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, #7b1fa2, #e040fb, #7b1fa2) 1;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(224,64,251,0.4), 0 0 4px rgba(123,31,162,0.5);
  background: linear-gradient(180deg, #faf0fd 0%, #f3e5f5 100%);
}
.item-tier-advanced::after {
  content:''; position:absolute; inset:-2px; pointer-events:none; border-radius:8px;
  background: linear-gradient(90deg, transparent, rgba(224,64,251,0.35), transparent);
  background-size: 200% 100%;
  animation: itemFlow 2.2s linear infinite;
  mix-blend-mode: screen;
}
@keyframes itemFlow { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* special: orange-gold flame flow, outer glow */
.item-tier-special {
  border: 2px solid transparent;
  border-image: linear-gradient(135deg, #ff6f00, #ffd54f, #ff6f00) 1;
  border-radius: 8px;
  box-shadow: 0 0 16px rgba(255,171,64,0.55), 0 0 6px rgba(255,111,0,0.4);
  background: linear-gradient(180deg, #fff8f0 0%, #fff3e0 100%);
}
.item-tier-special::after {
  content:''; position:absolute; inset:-2px; pointer-events:none; border-radius:8px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,171,64,0.4) 30%, rgba(255,213,79,0.5) 50%, rgba(255,171,64,0.4) 70%, transparent 100%);
  background-size: 200% 100%;
  animation: itemFlame 1.6s linear infinite;
  mix-blend-mode: screen;
}
@keyframes itemFlame { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* top: black bg + gold border, particle stars, dynamic halo */
.item-tier-top {
  border: 2px solid #d4af37;
  border-radius: 8px;
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  box-shadow: 0 0 20px rgba(212,175,55,0.5), 0 0 8px rgba(212,175,55,0.35), inset 0 0 30px rgba(212,175,55,0.08);
  color: #e8d48b;
}
.item-tier-top .inv-item-name, .item-tier-top .shop-item-name { color: #ffd700; }
.item-tier-top .inv-item-desc, .item-tier-top .shop-item-desc { color: #c0a850; }
.item-tier-top .inv-item-qty { color: #d4af37; }
.item-tier-top .shop-item-price { color: #ffd700; }
.item-tier-top::before {
  content:''; position:absolute; inset:0; pointer-events:none; border-radius:8px;
  background:
    radial-gradient(1.5px 1.5px at 20% 30%, #ffd700 50%, transparent 51%),
    radial-gradient(1px 1px at 60% 20%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 80% 60%, #ffd700 50%, transparent 51%),
    radial-gradient(1px 1px at 40% 80%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 75%, #ffd700 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 30% 55%, #fff 50%, transparent 51%);
  background-size: 100% 100%;
  animation: itemStars 2.4s ease-in-out infinite alternate;
}
.item-tier-top::after {
  content:''; position:absolute; inset:-3px; pointer-events:none; border-radius:10px;
  background: conic-gradient(from 0deg, transparent 0%, rgba(255,215,0,0.25) 15%, transparent 30%, rgba(255,215,0,0.2) 55%, transparent 70%, rgba(255,215,0,0.3) 85%, transparent 100%);
  animation: itemHalo 3.5s linear infinite;
  mix-blend-mode: screen;
}
@keyframes itemStars { 0%{opacity:0.5} 50%{opacity:1} 100%{opacity:0.7} }
@keyframes itemHalo { 0%{transform:rotate(0deg)} 100%{transform:rotate(360deg)} }/* ===== tier text readability fixes ===== */
.item-tier-basic { color:#333; }
.item-tier-basic .inv-item-name, .item-tier-basic .shop-item-name { color:#222; }
.item-tier-basic .inv-item-desc, .item-tier-basic .shop-item-desc { color:#666; }

.item-tier-initial { color:#2e3b2e; }
.item-tier-initial .inv-item-name, .item-tier-initial .shop-item-name { color:#1b4d1b; }
.item-tier-initial .inv-item-desc, .item-tier-initial .shop-item-desc { color:#4a6b4a; }

.item-tier-mid { color:#1e3a5f; }
.item-tier-mid .inv-item-name, .item-tier-mid .shop-item-name { color:#0d47a1; }
.item-tier-mid .inv-item-desc, .item-tier-mid .shop-item-desc { color:#4a6a8f; }

.item-tier-advanced { color:#4a148c; }
.item-tier-advanced .inv-item-name, .item-tier-advanced .shop-item-name { color:#6a1b9a; }
.item-tier-advanced .inv-item-desc, .item-tier-advanced .shop-item-desc { color:#7e57c2; }

.item-tier-special { color:#5d3a00; }
.item-tier-special .inv-item-name, .item-tier-special .shop-item-name { color:#e65100; }
.item-tier-special .inv-item-desc, .item-tier-special .shop-item-desc { color:#8d6e2f; }

/* top: black bg -> light text everywhere incl buttons/inputs */
.item-tier-top { color:#e8d48b; }
.item-tier-top .inv-item-name, .item-tier-top .shop-item-name { color:#ffd700; }
.item-tier-top .inv-item-desc, .item-tier-top .shop-item-desc { color:#d8c070; }
.item-tier-top .inv-item-qty { color:#ffd700; }
.item-tier-top .shop-item-price { color:#ffd700; }
.item-tier-top .btn { background:linear-gradient(180deg,#3a2f10,#241c08); color:#ffd700; border:1px solid #d4af37; }
.item-tier-top .btn:hover { background:linear-gradient(180deg,#4d3f15,#31260c); border-color:#ffd700; }
.item-tier-top .btn:disabled { opacity:0.7; color:#c0a850; }
.item-tier-top .qty-input { background:#111; color:#ffd700; border-color:#8a7430; }
.item-tier-top .qty-btn { background:#241c08; color:#ffd700; border-color:#8a7430; }
.item-tier-top .qty-btn:hover { background:#3a2f10; }

/* tinted tiers: make sure buttons stay readable */
.item-tier-advanced .btn, .item-tier-special .btn { color:#fff; }
.item-tier-advanced .qty-input, .item-tier-special .qty-input { color:#222; }/* ===== ticket pill (topbar) ===== */
.ticket-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  background: linear-gradient(135deg, #1a237e, #283593);
  color: #e3f2fd; font-weight: 700; font-size: 14px;
  border: 1px solid #5c6bc0;
}
.ticket-pill .ticket-icon { font-size: 15px; }
.ticket-pill .ticket-cap { font-size: 12px; opacity: .75; font-weight: 500; }

/* ===== recharge packs ===== */
.recharge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.my-tickets {
  grid-column: 1 / -1;
  font-size: 14px; color: var(--muted);
}
.my-tickets b { color: #ffd54f; font-size: 18px; margin-left: 4px; }
.recharge-pack {
  border: 1px solid #3949ab; border-radius: 10px;
  background: linear-gradient(180deg, #e8eaf6, #c5cae9);
  padding: 14px 12px; text-align: center;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.recharge-pack .rp-price { font-size: 22px; font-weight: 900; color: #1a237e; }
.recharge-pack .rp-tickets { font-size: 14px; font-weight: 700; color: #283593; }
.recharge-pack .rp-bonus {
  font-size: 12px; font-weight: 700; color: #fff;
  background: #ff6f00; border-radius: 999px; padding: 1px 10px;
}/* ===== qty stepper beautify (overrides plain boxes above) ===== */
.inv-use-count {
  gap: 0;
  background: rgba(0,0,0,.25);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.35);
}
.inv-use-count .qty-btn {
  width: 28px; height: 28px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
  color: var(--gold);
  font-size: 17px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
  transition: transform .1s, background .15s, color .15s;
}
.inv-use-count .qty-btn:hover {
  background: linear-gradient(180deg, var(--gold), #b8860b);
  color: #141414;
  transform: scale(1.08);
}
.inv-use-count .qty-btn:active { transform: scale(.92); }
.inv-use-count .qty-input {
  width: 46px; height: 28px;
  border: none;
  background: transparent;
  color: var(--gold);
  font-size: 15px; font-weight: 900;
  border-radius: 0;
  text-shadow: 0 0 8px rgba(212,175,55,.45);
}
.inv-use-count .qty-input:focus { outline: none; }
.inv-use-count .qty-input::-webkit-outer-spin-button,
.inv-use-count .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.inv-use-count .qty-input[type=number] { -moz-appearance: textfield; appearance: textfield; }/* ===== item assign picker (training / salary_reduce) ===== */
.assign-qty { flex-shrink: 0; }
.assign-qty .qty-btn { user-select: none; }
.assign-num {
  min-width: 34px;
  text-align: center;
  color: var(--gold);
  font-weight: 900;
  font-size: 15px;
  text-shadow: 0 0 8px rgba(212,175,55,.45);
}
.assign-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.assign-summary {
  flex: 1;
  color: var(--text);
  font-weight: 700;
}
.assign-summary::before { content: ''; }
.player-select-list { max-height: 320px; overflow-y: auto; }/* ===== assign picker modal (training / salary reduce) v2 ===== */
.assign-modal {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 92%;
  max-width: 560px;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0,0,0,.6);
  overflow: hidden;
}
.am-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.am-icon {
  font-size: 30px;
  line-height: 1;
  width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212,175,55,.1);
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 10px;
  flex-shrink: 0;
}
.am-titles { flex: 1; min-width: 0; }
.am-title { color: var(--gold); font-size: 15px; font-weight: 700; margin-bottom: 3px; }
.am-tip { color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.am-count {
  flex-shrink: 0;
  background: rgba(212,175,55,.12);
  border: 1px solid rgba(212,175,55,.4);
  color: var(--gold);
  font-size: 12px; font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.am-colhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 18px;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.am-colhead .cc-pos { width: 34px; text-align: center; }
.am-colhead .cc-name { flex: 1; min-width: 0; }
.am-colhead .cc-meta { width: 96px; text-align: right; }
.am-colhead .cc-eff { width: 128px; text-align: right; }
.am-colhead .cc-qty { width: 96px; text-align: center; }

.assign-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 14px;
}
.assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: 8px;
  margin-bottom: 6px;
  background: var(--bg-soft);
  transition: border-color .15s, background .15s;
}
.assign-row.active {
  border-left-color: var(--gold);
  background: rgba(212,175,55,.07);
}
.assign-row.disabled { opacity: .45; }
.ar-pos {
  width: 34px; text-align: center;
  font-size: 10px; font-weight: 700;
  background: var(--accent-2); color: #fff;
  border-radius: 4px;
  padding: 2px 0;
  flex-shrink: 0;
}
.ar-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-bench { font-style: normal; font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.ar-meta { width: 96px; text-align: right; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.ar-meta b { color: var(--gold); font-weight: 700; }
.ar-min { font-style: normal; font-size: 10px; color: var(--bad); }
.ar-eff {
  width: 128px; text-align: right;
  font-size: 11px; font-weight: 700;
  color: var(--good);
  flex-shrink: 0;
}
.ar-stepper {
  width: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
}
.as-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  color: var(--gold);
  font-size: 14px; font-weight: 800;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: .12s;
}
.as-btn:hover { background: var(--gold); color: #141414; border-color: var(--gold); }
.as-btn:active { transform: scale(.9); }
.as-num {
  min-width: 26px;
  text-align: center;
  font-size: 14px; font-weight: 900;
  color: var(--text);
}
.assign-row.active .as-num { color: var(--gold); }
/* assign qty is now a number input: same look as stepper text, hide spinners */
input.as-num {
  width: 44px;
  height: 26px;
  text-align: center;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 6px;
}
input.as-num:focus { outline: none; border-color: var(--gold); }
input.as-num::-webkit-outer-spin-button,
input.as-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.as-num[type=number] { -moz-appearance: textfield; appearance: textfield; }
.assign-row.active input.as-num { color: var(--gold); }

.assign-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding: 10px 18px 14px;
  background: var(--bg-card);
}
.am-progress {
  height: 6px;
  background: rgba(255,255,255,.07);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 10px;
}
.am-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #b8860b, var(--gold));
  border-radius: 999px;
  transition: width .18s ease;
}
.am-foot-row { display: flex; align-items: center; gap: 10px; }
.am-summary { flex: 1; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.am-ok:disabled { opacity: .4; cursor: not-allowed; }
.am-ok:not(:disabled) { box-shadow: 0 0 12px rgba(212,175,55,.25); }/* ===== qty dialog (budget_bonus / salary_cap_up) ===== */
.qd-body { padding: 16px 18px; }
.qd-row { display: flex; align-items: center; gap: 12px; }
.qd-label { color: var(--muted); font-size: 13px; min-width: 64px; }
.qd-stepper { width: auto; }
.qd-num {
  width: 56px; height: 28px;
  text-align: center;
  font-size: 15px; font-weight: 900;
  color: var(--gold);
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.qd-num:focus { outline: none; border-color: var(--gold); }
.qd-num::-webkit-outer-spin-button,
.qd-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qd-num[type=number] { -moz-appearance: textfield; appearance: textfield; }
.qd-preview {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
}
.qd-preview b { font-weight: 800; }
.qd-preview .gold { color: var(--gold); }/* ===== admin pagination bar ===== */
.pager-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 0;
  padding: 8px 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  flex-wrap: wrap;
}
.pager-bar .muted { font-size: 12px; margin-right: auto; }
.pager-bar .btn { min-width: 72px; }
.pager-bar .btn[disabled] { opacity: .35; cursor: not-allowed; }
/* ---------- recharge: contact customer service ---------- */
.rp-tip { margin-top: 8px; font-size: 12px; color: #d4b46a; opacity: .9; }
.contact-service { grid-column: 1 / -1; margin-top: 10px; padding: 14px 16px; background: #1c2130; border: 1px solid #2a3142; border-radius: 10px; text-align: center; }
.cs-title { font-size: 15px; font-weight: 700; color: #d4b46a; margin-bottom: 6px; }
.cs-sub { font-size: 13px; color: #8b93a7; margin-bottom: 12px; line-height: 1.6; }
.cs-qr-row { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.cs-qr { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cs-qr-label { font-size: 13px; font-weight: 600; color: #d4b46a; }
.cs-qr-img { width: 140px; height: 140px; object-fit: contain; background: #ffffff; border-radius: 8px; padding: 6px; border: 1px solid #2a3142; box-sizing: border-box; }
.cs-qr-placeholder { display: flex; align-items: center; justify-content: center; color: #8b93a7; font-size: 13px; background: #141824; white-space: pre-line; text-align: center; }
.cs-qr-id { font-size: 12px; color: #8b93a7; }

/* OVR maxed (400) corner mark: gold-red border, red flame glow */
.ovr-cap-mark {
  position: absolute;
  top: 6px;
  right: 8px;
  z-index: 30;
  font-size: 15px;
  font-weight: 900;
  font-style: normal;
  padding: 1px 6px;
  border-radius: 6px;
  line-height: 1.35;
  pointer-events: none;
  color: #ffef9a;
  border: 1.5px solid transparent;
  background:
    linear-gradient(160deg, #3a0a08, #1a0505) padding-box,
    linear-gradient(135deg, #ffd700, #ff4d00, #ff2a00, #ffd700) border-box;
  box-shadow:
    0 0 8px rgba(255,60,20,.7),
    0 0 16px rgba(255,20,0,.4),
    inset 0 -4px 10px -4px rgba(255,40,0,.8);
  text-shadow:
    0 0 6px rgba(255,80,30,.9),
    0 0 12px rgba(255,30,0,.5);
  animation: ovrCapFlame 1.6s ease-in-out infinite;
}
/* high-tier ::before/::after must not paint over the corner mark */
.player-card.tier-XX::before,
.player-card.tier-XXX::before,
.player-card.tier-XX::after,
.player-card.tier-XXX::after { z-index: -1; }
.bench-card.tier-XX.filled::before,
.bench-card.tier-XXX.filled::before,
.bench-card.tier-XX.filled::after,
.bench-card.tier-XXX.filled::after { z-index: -1; }
.position-slot.tier-XX.filled::before,
.position-slot.tier-XXX.filled::before,
.position-slot.tier-XX.filled::after,
.position-slot.tier-XXX.filled::after { z-index: -1; }
.bench-slot.tier-XX.filled::before,
.bench-slot.tier-XXX.filled::before,
.bench-slot.tier-XX.filled::after,
.bench-slot.tier-XXX.filled::after { z-index: -1; }
@keyframes ovrCapFlame {
  0%, 100% {
    box-shadow:
      0 0 8px rgba(255,60,20,.7),
      0 0 16px rgba(255,20,0,.4),
      inset 0 -4px 10px -4px rgba(255,40,0,.8);
  }
  50% {
    box-shadow:
      0 0 14px rgba(255,90,30,1),
      0 0 28px rgba(255,40,0,.6),
      0 0 40px rgba(255,20,0,.3),
      inset 0 -6px 14px -2px rgba(255,60,10,1);
  }
}
/* ---- Ladder team preview (click avatar) ---- */
.lop-clickable { cursor: pointer; }
.lop-clickable:hover { opacity: 0.85; }
.ladder-preview-modal { max-width: 1140px; width: 98vw; }
.lp-body { padding: 16px 20px 20px; overflow-y: auto; }

/* Visual roster: team header at top-left */


/* Visual roster: team header overlays top-left, no layout space taken */

.vr-team-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  text-align: center;
}
.vr-team-rating {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
/* Visual roster: team header overlays top-left, logo left + info right */
.vr-team-header {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.vr-team-header .vr-team-logo {
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  object-fit: contain;
  border-radius: 8px;
  margin-left: 0;
  flex-shrink: 0;
}
.vr-team-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
/* Visual roster team rating tier colors (name + rating) */
.vr-team-header.vr-rt-r1 .vr-team-name,
.vr-team-header.vr-rt-r1 .vr-team-rating { color: #b9c0cb; }
.vr-team-header.vr-rt-r2 .vr-team-name,
.vr-team-header.vr-rt-r2 .vr-team-rating { color: #5fd48a; }
.vr-team-header.vr-rt-r3 .vr-team-name,
.vr-team-header.vr-rt-r3 .vr-team-rating { color: #8ecdff; }
.vr-team-header.vr-rt-r4 .vr-team-name,
.vr-team-header.vr-rt-r4 .vr-team-rating { color: #e879f9; }
.vr-team-header.vr-rt-r5 .vr-team-name,
.vr-team-header.vr-rt-r5 .vr-team-rating { color: #ffb347; }
.vr-team-header.vr-rt-r6 .vr-team-name,
.vr-team-header.vr-rt-r6 .vr-team-rating { color: #ffd700; text-shadow: 0 0 6px rgba(255,200,0,.5); }
.vr-team-header.vr-rt-r7 .vr-team-name,
.vr-team-header.vr-rt-r7 .vr-team-rating { color: #ffe066; text-shadow: 0 0 8px rgba(255,200,0,.5); }
.vr-team-header.vr-rt-r8 .vr-team-name,
.vr-team-header.vr-rt-r8 .vr-team-rating { color: #ffe066; text-shadow: 0 0 10px rgba(255,200,0,.5); }
.vr-team-header.vr-rt-r9 .vr-team-name,
.vr-team-header.vr-rt-r9 .vr-team-rating { color: #ff5eb8; text-shadow: 0 0 10px rgba(255,40,100,.45), 0 0 10px rgba(255,140,0,.35); }
/* ===== recharge pack card beautify (ascii only) ===== */
.my-tickets {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,213,79,.12), rgba(255,213,79,.03) 60%, transparent);
  border: 1px solid rgba(255,213,79,.28);
  color: #e8d9a0; font-size: 14px; font-weight: 600;
}
.my-tickets b { color: #ffd54f; font-size: 20px; font-weight: 900; margin-left: 2px; text-shadow: 0 2px 6px rgba(0,0,0,.45); }
.recharge-pack {
  position: relative; overflow: hidden;
  border: 1px solid #2e3a55;
  border-radius: 14px;
  background: linear-gradient(165deg, #202941 0%, #181f30 55%, #141a28 100%);
  padding: 16px 12px 13px;
  box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.05);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.recharge-pack::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #8a6a1f, #ffd54f, #8a6a1f);
  opacity: .9;
}
.recharge-pack:hover {
  transform: translateY(-4px);
  border-color: #6d5a2c;
  box-shadow: 0 14px 28px rgba(0,0,0,.55), 0 0 0 1px rgba(255,213,79,.15);
}
.recharge-pack .rp-price { font-size: 27px; font-weight: 900; color: #ffd54f; line-height: 1.1; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.recharge-pack .rp-tickets { font-size: 13px; font-weight: 600; color: #b8c1d9; letter-spacing: .4px; }
.recharge-pack .rp-tickets b { font-size: 19px; font-weight: 900; color: #eef1fa; vertical-align: -1px; }
.recharge-pack .rp-bonus {
  font-size: 11.5px; font-weight: 800; color: #fff;
  background: linear-gradient(180deg, #ff9d2e, #f45100);
  border-radius: 999px; padding: 2px 11px; letter-spacing: .5px;
  box-shadow: 0 3px 10px rgba(255,111,0,.45);
}
.rp-meta { width: 100%; margin-top: 4px; text-align: left; }
.rp-meta-row { display: flex; align-items: baseline; justify-content: space-between; font-size: 10.5px; color: #8b93a7; margin-bottom: 4px; }
.rp-meta-row b { font-size: 12px; font-weight: 800; color: #dfe5f5; font-variant-numeric: tabular-nums; }
.rp-bar { width: 100%; height: 5px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.45); }
.rp-bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5c6bc0, #9fa8da); transition: width .35s ease; }
.rp-bar-gold > i { background: linear-gradient(90deg, #ff8f00, #ffd54f); }
.rp-meta-gold .rp-meta-row span { color: #d4b46a; }
.rp-meta-gold .rp-meta-row b { color: #ffd54f; }
.rp-meta-sub { margin-top: 3px; font-size: 10.5px; color: #d4b46a; opacity: .85; }
.rp-claim {
  margin-top: 8px; width: 100%; padding: 8px 10px;
  border: none; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 800; color: #231a00; letter-spacing: .3px;
  background: linear-gradient(180deg, #ffe082, #ffb300);
  box-shadow: 0 3px 10px rgba(255,179,0,.35);
  transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.rp-claim:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.07); box-shadow: 0 6px 14px rgba(255,179,0,.45); }
.rp-claim:active:not(:disabled) { transform: translateY(0); }
.rp-claim:disabled { opacity: 1; cursor: not-allowed; box-shadow: none; background: #2a3145; color: #9aa3b8; font-weight: 700; }
.recharge-pack .rp-tip {
  width: 100%; margin-top: auto; padding-top: 9px;
  font-size: 11.5px; color: #d4b46a; opacity: .85;
  border-top: 1px dashed rgba(212,180,106,.25);
}

/* ===== ladder season & rewards (ascii only) ===== */
.ls-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ls-title { font-size: 16px; font-weight: 800; color: #ffd54f; }
.ls-settle {
  border: 1px solid #2e3a55; border-radius: 12px; padding: 12px 14px;
  background: linear-gradient(160deg, #1d2537, #161c2c);
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  box-shadow: 0 6px 16px rgba(0,0,0,.3);
}
.ls-settle.claimed { border-color: #3c6e3f; }
.ls-settle-title { font-size: 14px; font-weight: 800; color: #eef1fa; }
.ls-settle-stats { font-size: 13px; color: #b8c1d9; font-variant-numeric: tabular-nums; }
.ls-settle-reward { font-size: 13.5px; font-weight: 800; color: #ffd54f; }
.ls-claim {
  margin-top: 5px; padding: 9px 20px; border: none; border-radius: 9px; cursor: pointer;
  font-size: 13px; font-weight: 800; color: #231a00;
  background: linear-gradient(180deg, #ffe082, #ffb300);
  box-shadow: 0 3px 10px rgba(255,179,0,.35);
  transition: transform .15s ease, filter .15s ease;
}
.ls-claim:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.07); }
.ls-claim:disabled { opacity: .55; cursor: not-allowed; }
.ls-claim-ok { font-size: 13px; font-weight: 800; color: #81c784; }
.ls-tiers { margin-top: 12px; }
.ls-tiers-title { font-size: 13px; font-weight: 800; color: #d4b46a; margin-bottom: 6px; }
.ls-tier-rows { display: flex; flex-direction: column; gap: 4px; }
.ls-tier-row {
  display: flex; justify-content: space-between; font-size: 12.5px; color: #b8c1d9;
  padding: 5px 10px; background: rgba(255,255,255,.04); border-radius: 7px;
}
.ls-tier-rank { font-weight: 700; color: #dfe5f5; }
.ls-tier-reward { color: #ffd54f; font-weight: 700; }
#ladderHistoryList { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.ls-hist-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 13px; color: #b8c1d9; padding: 7px 10px;
  background: rgba(255,255,255,.04); border-radius: 8px;
  font-variant-numeric: tabular-nums;
}
.ls-hist-ym { font-weight: 800; color: #dfe5f5; }
.ls-hist-rank { color: #ffd54f; font-weight: 800; }
.ls-hist-reward { color: #d4b46a; font-weight: 700; }
.ls-claim-sm {
  margin-left: auto; padding: 4px 14px; border: none; border-radius: 7px; cursor: pointer;
  font-size: 12px; font-weight: 800; color: #231a00;
  background: linear-gradient(180deg, #ffe082, #ffb300);
  transition: filter .15s ease;
}
.ls-claim-sm:hover:not(:disabled) { filter: brightness(1.07); }
.ls-claim-sm:disabled { opacity: .55; cursor: not-allowed; }


/* ===== pool header two-row layout + scout recall button (ascii only) ===== */
.pool-header { display: block; }
.ph-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-top { margin-bottom: 8px; }
.ph-sub { justify-content: space-between; }
.ph-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.ph-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.scout-info { line-height: 1.5; }
.ph-actions .btn { padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.recall-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 16px;
  background: linear-gradient(135deg, #f0b429, #d97706);
  border: 1px solid #b45309;
  color: #1c1405;
  font-size: 13px; font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(217,119,6,.45);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  letter-spacing: .3px;
}
.recall-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.07);
  box-shadow: 0 4px 14px rgba(217,119,6,.6);
}
.recall-btn:active:not(:disabled) { transform: translateY(0); filter: brightness(.98); }
.recall-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.recall-btn .rb-ic { font-size: 14px; line-height: 1; }
.recall-btn .rb-cost {
  background: rgba(0,0,0,.18);
  border: 1px solid rgba(0,0,0,.25);
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  color: #2a1f08;
}
@media (max-width: 720px) {
  .ph-actions, .ph-right { margin-left: 0; }
  .ph-sub { justify-content: flex-start; }
}

/* 手机竖屏：市场操作按钮只留图标 */
@media (max-width: 960px) and (orientation: portrait),
       (pointer: coarse) and (orientation: portrait) {
  .recall-btn { padding: 8px 12px; gap: 0; }
  .recall-btn .rb-label, .recall-btn .rb-cost { display: none; }
  .recall-btn .rb-ic { font-size: 18px; }
  #fmListBtn .fm-label { display: none; }
  #fmListBtn .fm-ic { font-size: 16px; font-weight: 900; line-height: 1; }
}

/* ===== free market list modal (ascii only) ===== */
.fm-body { padding: 16px 18px 18px; overflow-y: auto; }
.fm-pv-card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(212,175,55,.10), rgba(255,255,255,.03));
  border: 1px solid rgba(212,175,55,.30);
  border-radius: 12px;
  margin-bottom: 14px;
}
.fm-pv-avatar { flex-shrink: 0; width: 52px; height: 52px; }
.fm-pv-info { min-width: 0; flex: 1; }
.fm-pv-name {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  font-size: 15px; font-weight: 800; color: var(--text);
  line-height: 1.3;
}
.fm-pv-pos {
  font-size: 10.5px; font-weight: 800; letter-spacing: .5px;
  color: var(--gold);
  background: rgba(212,175,55,.14);
  border: 1px solid rgba(212,175,55,.4);
  border-radius: 5px;
  padding: 1px 6px;
}
.fm-pv-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.fm-pv-salary { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.fm-pv-salary b { color: var(--gold); font-weight: 800; }
.fm-field { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.fm-label { color: var(--muted); font-size: 13px; min-width: 74px; flex-shrink: 0; }
.fm-select {
  flex: 1; min-width: 0; height: 38px;
  padding: 0 10px; font-size: 13.5px;
  background: var(--bg-card); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
}
.fm-select:focus { outline: none; border-color: var(--gold); }
.fm-price {
  flex: 1; min-width: 0; height: 38px;
  padding: 0 12px; font-size: 15px; font-weight: 700;
  color: var(--gold);
  background: #0e131b;
  border: 1px solid var(--line); border-radius: 8px;
}
.fm-price:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(212,175,55,.15); }
.fm-price::-webkit-outer-spin-button, .fm-price::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fm-price { -moz-appearance: textfield; appearance: textfield; }
.fm-gain {
  align-items: center; justify-content: space-between;
  padding: 11px 14px;
  background: linear-gradient(135deg, rgba(56,199,140,.14), rgba(56,199,140,.04));
  border: 1px solid rgba(56,199,140,.35);
  border-radius: 10px;
  margin-bottom: 12px;
}
.fm-gain-label { display: flex; flex-direction: column; gap: 2px; }
.fm-gain-title { font-size: 12px; color: var(--muted); }
.fm-gain-fee { font-size: 11.5px; color: var(--muted); }
.fm-gain-num { font-size: 20px; font-weight: 900; color: #3ddc97; letter-spacing: .3px; }
.fm-hint {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  background: rgba(255,255,255,.04);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 8px 11px;
}
.fm-actions { display: flex; gap: 10px; margin-top: 14px; }
.fm-actions .btn { flex: 1; padding: 11px 16px; font-size: 14px; font-weight: 700; border-radius: 9px; }
/* ---- ��������۵����������չ��/���� ---- */
.task-section-head { cursor: pointer; user-select: none; }
.fold-caret { display: inline-block; margin-right: 6px; transition: transform .18s; font-size: 12px; }
.task-section.collapsed .fold-caret { transform: rotate(-90deg); }
.task-section.collapsed > *:not(.task-section-head) { display: none; }

/* ---- �����г���Ƭ���� ---- */
.player-card.fm-card .fm-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; margin: 4px 0 6px; }
.player-card.fm-card .fm-seller { color: var(--muted); }
.player-card.fm-card .fm-chip { background: rgba(255,215,0,.08); border: 1px solid rgba(255,215,0,.25); border-radius: 999px; padding: 1px 8px; color: var(--gold); font-weight: 600; }
.player-card.fm-card .buy-row { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; gap: 8px; }
.player-card.fm-card .card-actions { display: flex; flex-shrink: 0; }
.price-tag { font-weight: 700; color: var(--gold); background: rgba(0,0,0,.25); border: 1px solid rgba(255,215,0,.35); border-radius: 8px; padding: 3px 10px; letter-spacing: .5px; }

/* ---- �����г���������Ա ---- */
.bench-listed-tag { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-style: normal; color: #ffd54f; background: rgba(255,215,0,.12); border: 1px solid rgba(255,215,0,.35); }
.bench-card.listed-on-market, .bench-avatar-row.listed-on-market { outline: 1px dashed rgba(255,215,0,.5); outline-offset: 2px; }
.bench-card.listed-on-market { cursor: default; }
/* ===== 我的阵容卡片：薪资/价值显示 + 布局美化 ===== */
.slot-money {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.money-salary, .money-value {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: .3px;
  white-space: nowrap;
  line-height: 1.5;
}
.money-salary {
  color: #ffd166;
  background: rgba(240,184,39,.12);
  border: 1px solid rgba(240,184,39,.38);
  box-shadow: 0 1px 3px rgba(240,184,39,.15);
}
.money-value {
  color: #7ee7a2;
  background: rgba(67,217,140,.10);
  border: 1px solid rgba(67,217,140,.32);
  box-shadow: 0 1px 3px rgba(67,217,140,.12);
}

/* 首发位置卡片 */
.position-slot.filled {
  gap: 6px;
  padding-bottom: 10px;
}
.position-slot .slot-main { width: 100%; padding: 0 4px; }
.position-slot .slot-main .pmeta {
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.position-slot .slot-money { margin-top: 4px; }
.position-slot .slot-actions {
  width: 100%;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

/* 替补卡片 */
.bench-slot.filled { padding-top: 10px; }
.bench-slot .bmeta { min-width: 0; }
.bench-slot .bmeta .pname {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bench-slot .bmeta .slot-money { margin-top: 4px; justify-content: center; }
.bench-slot .bench-avatar-row { gap: 10px; }
.bench-slot .sell-btn, .bench-slot .swap-btn {
  padding: 4px 10px;
  font-size: 12px;
}

/* 按钮防压缩 */
.sell-btn, .swap-btn { flex-shrink: 0; }

/* =====================================================================
 * ===== 手机横屏适配（经理人版前端） =====
 * 触发：横屏 且 视口高度 ≤560px（手机横屏典型 375~432px）
 * 目标：顶栏单行吸顶、留白压缩、记分牌/球场压扁、弹层防裁切、宽表格容器内横滚
 * ==================================================================== */
@media (orientation: landscape) and (max-height: 560px) {

  /* ---- 顶栏：吸顶 + 单行紧凑 + 刘海安全区 ---- */
  .topbar {
    position: sticky;
    top: 0;
    z-index: 500;
    padding: 5px max(10px, env(safe-area-inset-right)) 5px max(10px, env(safe-area-inset-left));
    gap: 4px;
    flex-wrap: nowrap;
  }
  .brand { font-size: 14px; gap: 4px; }
  .logo { font-size: 15px; }
  .brand-text .muted { font-size: 10px; }
  .nav { gap: 2px; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav-btn {
    padding: 6px 9px; font-size: 12px; white-space: nowrap;
    display: inline-flex; align-items: center; min-height: 30px;
  }
  .budget-pill, .ticket-pill { margin-left: 6px; padding: 5px 9px; gap: 4px; font-size: 12px; flex-shrink: 0; }
  .budget-pill .budget-icon, .ticket-pill .ticket-icon { font-size: 13px; }
  .budget-pill .budget-value, .ticket-pill .ticket-value { font-size: 13px; }
  .budget-pill .budget-cap, .ticket-pill .budget-cap { font-size: 10px; }
  .manager-pill { padding: 4px 8px; font-size: 12px; gap: 4px; flex-shrink: 0; white-space: nowrap; }
  .logout-btn { padding: 3px 8px; font-size: 11px; }
  .saved-indicator { margin-left: 8px; font-size: 11px; }

  /* ---- 主区：留白整体压缩 ---- */
  .main { padding: 10px max(12px, env(safe-area-inset-right)) 14px max(12px, env(safe-area-inset-left)); }
  .view h1 { font-size: 18px; margin: 0 0 4px; letter-spacing: .5px; }
  .view .lead { margin: 0 0 10px; font-size: 13px; }
  .card { padding: 12px; margin-bottom: 10px; }
  .card h3 { font-size: 14px; margin-bottom: 8px; }

  /* ---- 登录 / 注册 ---- */
  .auth-wrap { min-height: 0; padding: 4px 0; }
  .auth-card { padding: 11px 14px; }
  .auth-logo { font-size: 28px; margin-bottom: 2px; }
  .auth-card h2 { font-size: 17px; margin-bottom: 3px; }
  .auth-card > p.muted.small { margin: 2px 0 4px; }
  .auth-card .auth-tabs { margin: 6px 0 2px; }
  .auth-form { margin-top: 6px; }
  .auth-form label { margin: 4px 0 1px; }
  .auth-form input { padding: 8px 12px; }
  .auth-form .btn.big { padding: 9px 26px; margin-top: 10px; }

  /* ---- 记分牌（比赛弹层内 sticky 头）：整体压扁 ---- */
  .scoreboard { padding: 8px 10px; margin: 0 -12px 8px; }
  .sb-team { padding: 0 8px; }
  .sb-name { font-size: 12px; margin-bottom: 2px; }
  .sb-rating { font-size: 10px; margin-bottom: 3px; }
  .sb-score { font-size: 34px; }
  .sb-mid { padding: 0 10px; }
  .sb-quarter { font-size: 14px; }
  .sb-clock { font-size: 17px; margin-top: 2px; }

  /* ---- 球场 / 文字直播 ---- */
  .court-scene { height: min(300px, 44vh); }
  .playbyplay { padding: 10px; }
  .pbp-log { font-size: 12px; line-height: 1.55; }

  /* ---- 弹层：矮视口防裁切（可滚 + 居中不裁顶） ---- */
  .modal-overlay, .game-overlay { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-overlay > *, .game-overlay > * { margin: auto; }
  .assign-modal { max-height: 96vh; overflow-y: auto; }
  .am-head { padding: 10px 14px 8px; gap: 9px; }
  .am-icon { width: 36px; height: 36px; font-size: 23px; }
  .am-title { font-size: 14px; }
  .am-tip { font-size: 11px; }
  .am-colhead { padding: 5px 14px; }
  .salary-reduce-modal { max-height: 94vh; padding: 14px; }
  .game-modal { max-height: 97vh; padding: 10px 14px 0; }
  .game-modal h1 { font-size: 15px; margin-bottom: 6px; }
  .game-modal .pbp-log { height: 26vh; max-height: 26vh; }
  .game-modal-footer { padding: 8px 0 9px; gap: 8px; }
  .player-select-list { max-height: 46vh; }

  /* ---- 宽表格：容器内横向滚动，不撑破整页 ---- */
  .view table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
}

/* 全局：禁止移动端按 DPR 自动放大字号 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* =====================================================================
 * ===== 安卓 App 化改造（全局） =====
 * 1) App 外壳：顶栏常驻 + 内容区(.main)独立滚动 + 底部页脚常显
 * 2) 触摸手感：禁双击缩放延迟 / 禁下拉刷新 / 防长按误选 / 触屏隐藏滚动条
 * 3) 按压反馈 + 160ms 视图切换动效 + 底部标签栏（安卓底部导航）
 * ==================================================================== */
html, body { height: 100%; }
body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior-y: none;
}
.main {
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.main::-webkit-scrollbar { width: 6px; height: 6px; }
.main::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); border-radius: 3px; }
.main::-webkit-scrollbar-track { background: transparent; }

/* 触摸目标：去掉双击缩放 300ms 延迟与灰色点击闪层 */
button, a, input, select, textarea, label, .chip, .logo-cell {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(255,255,255,.10);
}
/* 防长按误选文字（顶栏/导航/按钮/比分） */
.topbar, .nav, .btn, .chip, .nav-btn, .brand, .sb-score, .budget-pill, .ticket-pill, .manager-pill {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
img { -webkit-user-drag: none; }

/* 按压反馈：即时手感（pressed 状态像原生控件） */
.btn, .chip, .nav-btn, .logo-cell, .lop-challenge, .task-claim, .fm-buy {
  transition: transform .1s ease, filter .1s ease, background .15s ease, border-color .15s ease;
}
button:not(:disabled):active { transform: scale(.97); }
.btn:active { filter: brightness(.92); }

/* 视图切换动效：160ms，快速不拖沓 */
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.view:not(.hidden) { animation: viewIn .16s ease; }

/* 触屏设备：隐藏滚动条（安卓原生行为） */
@media (pointer: coarse) {
  .main::-webkit-scrollbar, .game-modal-body::-webkit-scrollbar, .assign-list::-webkit-scrollbar,
  .pbp-log::-webkit-scrollbar, .lp-body::-webkit-scrollbar, .fm-body::-webkit-scrollbar,
  .player-select-list::-webkit-scrollbar, .logo-grid::-webkit-scrollbar,
  .modal-overlay::-webkit-scrollbar, .game-overlay::-webkit-scrollbar { width: 0; height: 0; }
  .main, .game-modal-body, .assign-list, .pbp-log, .lp-body, .fm-body, .player-select-list,
  .logo-grid, .modal-overlay, .game-overlay { scrollbar-width: none; }
}

/* ===== 底部标签栏（安卓底部导航样式） ===== */
@media (max-width: 960px), (pointer: coarse) {
  .topbar .nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 900;
    margin: 0;
    gap: 0;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 3px 4px calc(3px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(19,26,40,.97), rgba(14,19,27,.99));
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px rgba(0,0,0,.45);
    overflow: visible;
    scrollbar-width: none;
  }
  .topbar .nav .nav-btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 3px 1px;
    font-size: 10px;
    line-height: 1.1;
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar .nav .nav-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 10px rgba(200,16,46,.45); }
  .topbar.no-auth .nav { display: none; }   /* 未登录不显示底部栏（压过上面的 display:flex） */
  .main { padding-bottom: calc(54px + env(safe-area-inset-bottom)); }

  /* 未登录页没有底部标签栏，还原预留空白：登录表单一屏放下 */
  .topbar.no-auth ~ .main { padding-bottom: 12px; }

  /* 宽表格在内容区内部横向滚动，不撑破整页（含竖屏） */
  .view table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
}

/* ===== 手机版精简：隐藏大段说明 + 字号/卡片/条目再缩一档 ===== */
@media (max-width: 960px), (pointer: coarse) {
  /* 隐藏说明文字，只保留按钮与状态 */
  .view .lead { display: none; }
  .hide-mob { display: none !important; }

  /* 字号再缩一档 */
  .view h1 { font-size: 15.5px; margin: 0 0 4px; letter-spacing: .5px; }
  .btn { padding: 6px 11px; font-size: 12.5px; border-radius: 7px; }
  .chip { padding: 4px 8px; font-size: 11px; }
  .small, .muted.small { font-size: 11px; }
  label { font-size: 12px; }
  input[type="text"], input[type="password"], select { font-size: 13px; padding: 7px 9px; }
  .price-table, .stats-table { font-size: 11.5px; }
  .price-table th, .price-table td { padding: 4px 6px; }
  .stats-table th, .stats-table td { padding: 4px 6px; }
  .brand { font-size: 15.5px; }
  .budget-pill .budget-value, .ticket-pill .ticket-value { font-size: 13px; }
  .budget-pill .budget-cap, .ticket-pill .budget-cap, .ticket-pill .ticket-cap { font-size: 10.5px; }
  .manager-pill { font-size: 12px; }
  .auth-logo { font-size: 24px; }
  .task-section-title { font-size: 13.5px; }
  .task-section-hint { font-size: 11px; }

  /* 卡片整体缩小 */
  .card { padding: 9px 10px; border-radius: 10px; margin-bottom: 8px; font-size: 12.5px; }
  .card h3 { font-size: 12.5px; margin-bottom: 6px; }
  .player-card { padding: 9px; border-radius: 7px; }
  .player-card .pname { font-size: 13px; }
  .player-card .ovr { font-size: 12px; padding: 2px 6px; }
  .player-card .pmeta { font-size: 11px; }
  .player-card .attr { font-size: 10.5px; padding: 2px 0; }
  .player-card .attr .k { font-size: 9.5px; }
  .task-card { padding: 9px 10px; gap: 10px; border-radius: 8px; }
  .task-icon { font-size: 20px; width: 36px; height: 36px; }
  .task-body .tname { font-size: 13.5px; }
  .task-body .tdesc { font-size: 11px; }
  .task-reward { font-size: 13.5px; }
  .task-status { font-size: 11px; padding: 3px 8px; }
  .inv-item, .shop-item { padding: 9px; gap: 9px; border-radius: 8px; }
  .inv-item-icon, .shop-item-icon { width: 40px; height: 40px; font-size: 20px; }
  .inv-item-name, .shop-item-name { font-size: 13px; margin-bottom: 3px; }
  .inv-item-desc, .shop-item-desc { font-size: 11px; margin-bottom: 3px; }
  .inv-item-qty { font-size: 11px; }
  .shop-item-price { font-size: 13px; }
  .mode-summary-card { padding: 10px 11px; }
  .ms-title { font-size: 13.5px; margin-bottom: 4px; }
  .ms-record { font-size: 17px; }
  .ms-sub { font-size: 11px; }
  .recharge-pack .rp-price { font-size: 20px; }
  .recharge-pack .rp-tickets { font-size: 12px; }
  .fm-body { padding: 12px 12px 14px; }
  .fm-pv-avatar { width: 44px; height: 44px; }
  .fm-label { font-size: 12px; min-width: 64px; }
  .fm-gain-num { font-size: 17px; }
  .fm-actions .btn { padding: 9px 12px; font-size: 13px; border-radius: 8px; }

  /* 队徽相对缩小（阵容可视化大徽） */
  .vr-team-header .vr-team-logo { width: 56px; height: 56px; max-width: 56px; max-height: 56px; }
}

/* ===== 竖屏窄屏（≤560px）顶栏压缩：品牌不换行、pill 不裁切 ===== */
@media (max-width: 560px) {
  .topbar { padding: 8px 10px; gap: 6px; }
  .brand { flex-shrink: 0; font-size: 15px; gap: 5px; }
  .brand-text .muted { display: none; }                 /* 隐藏“· 经理人版” */
  .budget-pill, .ticket-pill { flex-shrink: 0; margin-left: 5px; padding: 4px 7px; gap: 3px; font-size: 12px; }
  .budget-pill .budget-icon, .ticket-pill .ticket-icon { font-size: 12px; }
  .budget-pill .budget-value, .ticket-pill .ticket-value { font-size: 12.5px; }
  .budget-pill .budget-cap, .ticket-pill .ticket-cap { font-size: 9.5px; }
  .manager-pill { min-width: 0; margin-left: 5px; padding: 3px 6px 3px 9px; gap: 4px; font-size: 11.5px; }
  .manager-pill #managerName { display: none; }          /* 窄屏隐藏账号名，只留 👤 + 退出 */
  .logout-btn { flex-shrink: 0; padding: 3px 7px; font-size: 11px; }
}


/* ============================================================
 *  移动端游戏风格布局（首页/阵容：顶部球队头 + 首发/替补双面板 + 开始比赛）
 *  桌面隐藏；手机（≤960px 或粗指针）显示；旧的可视化卡/阵容面板同时隐藏
 * ============================================================ */
.mobile-game-layout { display: none; }

@media (max-width: 960px), (pointer: coarse) {
  /* 旧块在移动端隐藏，由 .mobile-game-layout 接管 */
  #view-setup #visualRosterCard,
  #view-setup .price-info-card,        /* 主页：经费与价格框移动端不显示 */
  #view-roster .lineup-panel { display: none !important; }
  .mobile-game-layout { display: block; }

  /* ---- 顶部球队头 ---- */
  .mgl-team-head {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 11px; margin-bottom: 8px;
    background: linear-gradient(135deg, #172233, #111822);
    border: 1px solid var(--line); border-radius: 12px;
  }
  .mgl-team-logo { width: 38px; height: 38px; max-width: 38px; max-height: 38px; object-fit: contain; flex-shrink: 0; }
  .mgl-team-info { flex: 1; min-width: 0; }
  .mgl-team-name { font-size: 15px; font-weight: 800; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mgl-team-sub { font-size: 10.5px; margin-top: 1px; }
  .mgl-team-rating {
    flex-shrink: 0; text-align: right;
    background: rgba(240, 184, 39, .08); border: 1px solid rgba(240, 184, 39, .25);
    border-radius: 9px; padding: 4px 10px;
  }
  .mgl-tr-label { display: block; font-size: 9.5px; letter-spacing: 1px; color: var(--muted); }
  .mgl-tr-num { font-size: 19px; font-weight: 900; color: var(--gold); line-height: 1.1; }

  /* ---- 双面板：竖屏上下堆叠 / 横屏左右并排 ---- */
  .mgl-panels { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .mgl-panel {
    background: linear-gradient(180deg, #16202d, #10161f);
    border: 1px solid var(--line); border-radius: 12px;
    padding: 8px; min-width: 0;
  }
  .mgl-panel-head { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; padding: 3px 4px; }
  .mgl-panel-title { font-size: 13.5px; font-weight: 800; }
  .mgl-panel-gear { color: var(--muted); font-size: 12px; }
  .mgl-panel-head.orange {
    background: linear-gradient(90deg, #f0a020, #d97706);
    border-radius: 8px; padding: 4px 10px; margin: -2px -2px 8px;
    color: #2a1600;
  }
  .mgl-panel-head.orange .mgl-panel-title { color: #2a1600; }
  .mgl-panel-en { font-size: 11px; font-weight: 900; letter-spacing: .12em; color: rgba(42, 22, 0, .75); }
  .mgl-panel-count { margin-left: auto; font-size: 10.5px; color: rgba(42, 22, 0, .65) !important; }

  /* 首发 3+2 网格（窄屏 2 列） */
  .mgl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  /* 替补单行 6 个（不够宽时横向滚动） */
  .mgl-bench {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(96px, 1fr);
    gap: 6px; overflow-x: auto; padding-bottom: 2px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .mgl-bench::-webkit-scrollbar { display: none; }

  /* ---- 球员卡 ---- */
  .mgl-card {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: linear-gradient(180deg, #1a2532, #121a24);
    border: 1px solid var(--line); border-radius: 10px;
    padding: 8px 6px 7px; min-width: 0; text-align: center;
    position: relative;
  }
  .mgl-card.empty { border-style: dashed; opacity: .75; }
  .mgl-card.mini { padding: 6px 5px 6px; gap: 2px; }
  .mgl-avatar { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; flex-shrink: 0; }
  .mgl-card.mini .mgl-avatar { width: 34px; height: 34px; }
  .mgl-avatar .mgl-av, .mgl-avatar .avatar { width: 100% !important; height: 100% !important; border-radius: 50% !important; object-fit: cover; display: block; }
  .mgl-av-placeholder {
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%; border-radius: 50%;
    background: #0d141c; border: 1px dashed var(--line);
    color: var(--muted); font-size: 15px; font-weight: 700;
  }
  .mgl-name-row { display: flex; align-items: center; gap: 4px; max-width: 100%; min-width: 0; }
  .mgl-name {
    font-size: 12px; font-weight: 800; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
  }
  .mgl-card.mini .mgl-name { font-size: 11px; }
  .mgl-pos-badge { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }
  .mgl-tier {
    font-size: 8.5px; font-weight: 800; padding: 1px 4px; border-radius: 4px;
    background: rgba(240, 184, 39, .15); color: var(--gold); line-height: 1.3;
  }
  .mgl-pos {
    font-size: 8.5px; font-weight: 900; padding: 1px 4px; border-radius: 4px;
    color: #fff; line-height: 1.3; letter-spacing: .02em;
  }
  .mgl-pos.pos-PG { background: #3b82f6; }
  .mgl-pos.pos-SG { background: #22c55e; }
  .mgl-pos.pos-SF { background: #eab308; color: #241c00; }
  .mgl-pos.pos-PF { background: #f97316; }
  .mgl-pos.pos-C  { background: #ef4444; }
  .mgl-skill { font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .mgl-ovr { font-size: 11px; color: var(--gold); font-weight: 700; }
  .mgl-card.mini .mgl-ovr { font-size: 10px; }
  .mgl-salary { font-size: 10px; color: var(--gold); font-weight: 600; }
  .mgl-value { font-size: 9.5px; color: var(--accent-2); font-weight: 600; }
  .mgl-card.mini .mgl-salary, .mgl-card.mini .mgl-value { font-size: 8.5px; }

  /* 卡片操作行（阵容页） */
  .mgl-acts { display: flex; gap: 4px; width: 100%; margin-top: 3px; }
  .mgl-act-btn {
    flex: 1; padding: 4px 2px; font-size: 9.5px; font-weight: 700;
    border-radius: 6px; border: 1px solid var(--line);
    background: rgba(255, 255, 255, .04); color: var(--text); cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .mgl-act-btn.sell { color: #f87171; border-color: rgba(248, 113, 113, .35); }
  .mgl-act-btn:disabled { opacity: .45; cursor: not-allowed; }
  .mgl-act-btn:not(:disabled):active { transform: scale(.96); }
}

/* ---- 横屏手机：双面板并排（对齐参考图布局） ---- */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .mgl-panels { grid-template-columns: 1.2fr 1fr; }
  .mgl-grid { grid-template-columns: repeat(3, 1fr); }
  .mgl-bench { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); grid-auto-columns: unset; overflow: visible; }
  .mgl-team-head { padding: 6px 10px; margin-bottom: 6px; }
  .mgl-team-logo { width: 30px; height: 30px; max-width: 30px; max-height: 30px; }
  .mgl-team-name { font-size: 13.5px; }
  .mgl-tr-num { font-size: 16px; }
  .mgl-avatar { width: 42px; height: 42px; }
  .mgl-card { padding: 6px 5px 5px; }
  .mgl-card.mini .mgl-avatar { width: 28px; height: 28px; }
}

/* ===== 顶栏球队信息（横屏手机：队徽/队名/等级/评分并入经费球券栏） ===== */
.top-team { display: none; align-items: center; gap: 6px; min-width: 0; flex-shrink: 1; }
.top-team .tt-info { min-width: 0; line-height: 1.15; }
.top-team .tt-name {
  font-size: 11.5px; font-weight: 800; color: var(--gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px;
}
.top-team .tt-sub { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
.top-team .tt-rating {
  display: inline-flex; align-items: baseline; gap: 3px;
  background: rgba(240,184,39,.10); border: 1px solid rgba(240,184,39,.35);
  border-radius: 999px; padding: 2px 8px; flex-shrink: 0;
}
.top-team .tt-r-label { font-size: 9px; color: var(--muted); }
.top-team .tt-r-num { font-size: 13px; color: var(--gold); font-weight: 900; }

/* ---- 横屏手机：去品牌后缀、去页脚、球队信息上移顶栏（内容区队头隐藏） ---- */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .brand-text .muted { display: none; }
  .mobile-game-layout .mgl-team-head { display: none; }
  body[data-view="setup"] .top-team,
  body[data-view="roster"] .top-team,
  body[data-view="match"] .top-team,
  body[data-view="tasks"] .top-team,
  body[data-view="inventory"] .top-team,
  body[data-view="stats"] .top-team { display: flex; }
}
/* ==================================================================== */
/*  移动端 mgl 球员卡：按 OVR 分档特效（与桌面可视化卡同款，自包含）    */
/*  仅 .filled 生效；空位卡保持虚线样式；关键帧复用全局 tier* 定义       */
/* ==================================================================== */

/* --- D: 浅灰面，无特效；深色文字 --- */
.mgl-card.tier-D.filled {
  background: linear-gradient(165deg, #eef1f5, #dfe4ea);
  border: 1px solid #9aa4b0;
  box-shadow: none;
}
.mgl-card.tier-D.filled .mgl-name { color: #2a3340; }
.mgl-card.tier-D.filled .mgl-skill { color: #566070; }
.mgl-card.tier-D.filled .mgl-ovr { color: #8a6a05; }
.mgl-card.tier-D.filled .mgl-salary { color: #8a6510; }
.mgl-card.tier-D.filled .mgl-value { color: #3a6ea5; }
.mgl-card.tier-D.filled .mgl-act-btn { color: #2a3340; border-color: rgba(0, 0, 0, .25); background: rgba(0, 0, 0, .05); }
.mgl-card.tier-D.filled .mgl-act-btn.sell { color: #c02626; }

/* --- C: 浅绿渐变描边，柔光 --- */
.mgl-card.tier-C.filled {
  border: 1px solid transparent;
  background:
    linear-gradient(#141b23, #17202a) padding-box,
    linear-gradient(135deg, #5fd48a, #b4f5c8, #5fd48a) border-box;
  box-shadow: 0 0 7px rgba(95,212,138,.20), inset 0 0 14px rgba(95,212,138,.06);
}

/* --- B: 浅蓝渐变描边，流光 --- */
.mgl-card.tier-B.filled {
  border: 1px solid transparent;
  background:
    linear-gradient(#15161b, #17181d) padding-box,
    linear-gradient(135deg, #4f9cf0, #8ec8f5, #e3f3ff, #8ec8f5, #4f9cf0) border-box;
  background-size: 260% 260%;
  box-shadow: 0 0 9px rgba(79,156,240,.24), inset 0 0 14px rgba(79,156,240,.05);
  animation: tierShine 3.4s linear infinite;
}

/* --- A: 深紫洋红渐变描边，流动光边 --- */
.mgl-card.tier-A.filled {
  border: 1px solid transparent;
  background:
    linear-gradient(#140b1d, #180f24) padding-box,
    linear-gradient(120deg, #6b21a8, #d946ef, #f0abfc, #d946ef, #6b21a8) border-box;
  background-size: 300% 100%;
  box-shadow: 0 0 12px rgba(217,70,239,.32);
  animation: tierFlow 2.4s linear infinite;
}

/* --- S: 橙金火焰描边，外发光 --- */
.mgl-card.tier-S.filled {
  border: 1px solid transparent;
  background:
    linear-gradient(#1c1306, #221808) padding-box,
    linear-gradient(135deg, #ff9a1f, #ffb347, #fff1d6, #ff9a1f, #d97706) border-box;
  background-size: 300% 300%;
  box-shadow: 0 0 16px rgba(255,154,31,.42), 0 0 34px rgba(255,107,0,.18);
  animation: tierFlame 2.1s linear infinite;
}
.mgl-card.tier-S.filled .mgl-avatar .mgl-av,
.mgl-card.tier-S.filled .mgl-avatar .avatar {
  box-shadow: 0 0 12px rgba(255,154,31,.62);
}

/* --- SS: 黑面金边 + 星粒 + 动态光晕 + 金 OVR + 头像金晕 --- */
.mgl-card.tier-SS.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  background:
    linear-gradient(#040404, #0a0a0b) padding-box,
    linear-gradient(135deg, #ffd700, #8a6a00, #ffd700, #fff3b0, #ffd700) border-box;
  background-size: 100% 100%, 300% 300%;
  animation: tierHalo 2.4s ease-in-out infinite;
}
.mgl-card.tier-SS.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 1.6px at 14% 28%, rgba(255,255,255,.95), transparent 62%),
    radial-gradient(1.4px 1.4px at 68% 18%, rgba(255,236,160,.92), transparent 62%),
    radial-gradient(1.2px 1.2px at 42% 74%, rgba(255,255,255,.88), transparent 62%),
    radial-gradient(1.6px 1.6px at 86% 62%, rgba(255,215,0,.95), transparent 62%),
    radial-gradient(1.2px 1.2px at 24% 86%, rgba(255,255,255,.85), transparent 62%),
    radial-gradient(1.4px 1.4px at 56% 44%, rgba(255,248,205,.92), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 3.6s linear infinite;
}
.mgl-card.tier-SS.filled .mgl-ovr {
  color: #ffd700;
  text-shadow: 0 0 6px rgba(255,200,0,.5);
}
.mgl-card.tier-SS.filled .mgl-avatar .mgl-av,
.mgl-card.tier-SS.filled .mgl-avatar .avatar {
  box-shadow: 0 0 14px rgba(255,215,0,.70);
}

/* --- SSS: 黑面金橙边 + 星粒 + 箔光 OVR + 头像呼吸 --- */
.mgl-card.tier-SSS.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,215,0,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#040404, #0a0a0b) padding-box,
    linear-gradient(135deg, #ffd700, #ff9a1f, #fff3b0, #ffc800, #ffd700) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierHalo 2.4s ease-in-out infinite;
}
.mgl-card.tier-SSS.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 1.6px at 14% 28%, rgba(255,255,255,.95), transparent 62%),
    radial-gradient(1.4px 1.4px at 68% 18%, rgba(255,236,160,.92), transparent 62%),
    radial-gradient(1.2px 1.2px at 42% 74%, rgba(255,255,255,.88), transparent 62%),
    radial-gradient(1.6px 1.6px at 86% 62%, rgba(255,215,0,.95), transparent 62%),
    radial-gradient(1.2px 1.2px at 24% 86%, rgba(255,255,255,.85), transparent 62%),
    radial-gradient(1.4px 1.4px at 56% 44%, rgba(255,248,205,.92), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 3.2s linear infinite;
}
.mgl-card.tier-SSS.filled .mgl-ovr {
  color: #ffe066;
  text-shadow: 0 0 8px rgba(255,200,0,.6);
}
.mgl-card.tier-SSS.filled .mgl-avatar .mgl-av,
.mgl-card.tier-SSS.filled .mgl-avatar .avatar {
  animation: tierXOvrBreathe 2.6s ease-in-out infinite;
}

/* --- X: 黑面火焰金边 + 余烬 + 箔光 OVR + 头像呼吸 --- */
.mgl-card.tier-X.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,215,0,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#040404, #0a0a0b) padding-box,
    linear-gradient(135deg, #ffd700, #ff9a1f, #fff3b0, #ff7a00, #ffd700) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierXFlame 1.8s linear infinite, tierXGlow 2.4s ease-in-out infinite;
}
.mgl-card.tier-X.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 2.4px at 14% 86%, rgba(255,170,40,.95), transparent 62%),
    radial-gradient(1.4px 2px at 68% 78%, rgba(255,215,80,.9), transparent 62%),
    radial-gradient(1.3px 2.2px at 42% 90%, rgba(255,120,20,.88), transparent 62%),
    radial-gradient(1.5px 2.2px at 86% 82%, rgba(255,200,60,.92), transparent 62%),
    radial-gradient(1.2px 1.8px at 24% 94%, rgba(255,240,160,.85), transparent 62%),
    radial-gradient(1.4px 2px at 56% 76%, rgba(255,185,50,.9), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 2.8s linear infinite;
}
.mgl-card.tier-X.filled .mgl-ovr {
  color: #ffd76a;
  text-shadow: 0 0 6px rgba(255,200,60,.55);
}
.mgl-card.tier-X.filled .mgl-avatar .mgl-av,
.mgl-card.tier-X.filled .mgl-avatar .avatar {
  animation: tierXOvrBreathe 2.4s ease-in-out infinite;
}

/* --- XX 不朽：黑面焰边 + 余烬(inset:0 防替补横滚裁切) + 扫光 + 金 OVR + 呼吸 --- */
.mgl-card.tier-XX.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.03) 0 3px, transparent 3px 9px),
    linear-gradient(#060403, #0d0906) padding-box,
    linear-gradient(135deg, #ff7a00, #ffd700, #ff4d00, #ffe9a8, #ffb300) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierXXFlame 1.7s linear infinite, tierXXGlow 2.4s ease-in-out infinite;
}
.mgl-card.tier-XX.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 2.4px at 12% 86%, rgba(255,160,40,.95), transparent 62%),
    radial-gradient(1.4px 2px at 34% 74%, rgba(255,220,120,.9), transparent 62%),
    radial-gradient(1.6px 2.6px at 58% 90%, rgba(255,90,10,.9), transparent 62%),
    radial-gradient(1.3px 2px at 76% 72%, rgba(255,240,180,.9), transparent 62%),
    radial-gradient(1.5px 2.2px at 90% 84%, rgba(255,150,30,.92), transparent 62%),
    radial-gradient(1.2px 1.8px at 46% 62%, rgba(255,255,210,.85), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 3s linear infinite;
}
.mgl-card.tier-XX.filled::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,.06) 45%, rgba(255,244,190,.16) 50%, rgba(255,255,255,.06) 55%, transparent 68%);
  background-size: 280% 100%;
  animation: tierXXSheen 3.8s linear infinite;
}
.mgl-card.tier-XX.filled .mgl-ovr {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255,140,0,.6);
}
.mgl-card.tier-XX.filled .mgl-avatar .mgl-av,
.mgl-card.tier-XX.filled .mgl-avatar .avatar {
  animation: tierXXBreathe 2.8s ease-in-out infinite;
}

/* --- XXX 永恒：黑面红焰边 + 红余烬 + 扫光 + 品红 OVR + 红呼吸 --- */
.mgl-card.tier-XXX.filled {
  border: 1px solid transparent;
  position: relative;
  isolation: isolate;
  background:
    repeating-linear-gradient(45deg, rgba(255,40,0,.04) 0 3px, transparent 3px 9px),
    linear-gradient(#0d0303, #1a0606) padding-box,
    linear-gradient(135deg, #ff2d00, #ffb347, #ff1a00, #ff7a3d, #ff4d00) border-box;
  background-size: 100% 100%, 100% 100%, 300% 300%;
  animation: tierXXFlame 1.6s linear infinite, tierXXXGlow 2.2s ease-in-out infinite;
}
.mgl-card.tier-XXX.filled::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background-image:
    radial-gradient(1.6px 2.4px at 12% 86%, rgba(255,70,30,.95), transparent 62%),
    radial-gradient(1.4px 2px at 34% 74%, rgba(255,160,60,.9), transparent 62%),
    radial-gradient(1.6px 2.6px at 58% 90%, rgba(255,30,10,.9), transparent 62%),
    radial-gradient(1.3px 2px at 76% 72%, rgba(255,200,120,.9), transparent 62%),
    radial-gradient(1.5px 2.2px at 90% 84%, rgba(255,80,20,.92), transparent 62%),
    radial-gradient(1.2px 1.8px at 46% 62%, rgba(255,240,180,.85), transparent 62%);
  background-size: 210% 210%;
  animation: tierSpark 2.8s linear infinite;
}
.mgl-card.tier-XXX.filled::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: -1;
  background: linear-gradient(115deg, transparent 32%, rgba(255,80,60,.07) 45%, rgba(255,180,150,.18) 50%, rgba(255,80,60,.07) 55%, transparent 68%);
  background-size: 280% 100%;
  animation: tierXXSheen 3.6s linear infinite;
}
.mgl-card.tier-XXX.filled .mgl-ovr {
  color: #ff5eb8;
  text-shadow: 0 0 8px rgba(255,45,149,.7), 0 0 14px rgba(255,140,0,.35);
}
.mgl-card.tier-XXX.filled .mgl-avatar .mgl-av,
.mgl-card.tier-XXX.filled .mgl-avatar .avatar {
  animation: tierXXXBreathe 2.6s ease-in-out infinite;
}

/* --- C/B/A 头像光晕（同桌面 visual-lineup） --- */
.mgl-card.tier-C.filled .mgl-avatar .mgl-av,
.mgl-card.tier-C.filled .mgl-avatar .avatar { box-shadow: 0 0 8px rgba(95,212,138,.40); }
.mgl-card.tier-B.filled .mgl-avatar .mgl-av,
.mgl-card.tier-B.filled .mgl-avatar .avatar { box-shadow: 0 0 10px rgba(79,156,240,.50); }
.mgl-card.tier-A.filled .mgl-avatar .mgl-av,
.mgl-card.tier-A.filled .mgl-avatar .avatar { box-shadow: 0 0 11px rgba(217,70,239,.58); }
/* 横屏紧凑工资帽条：注入首发面板顶部（已用左端 / 可用右端） */
.mgl-capbar {
  display: none;
  align-items: center; gap: 6px; width: 100%;
  margin: 2px 0 4px;
}
.mcb-used { font-size: 10px; font-weight: 800; color: var(--gold); flex-shrink: 0; line-height: 1; }
.mcb-rem { font-size: 10px; font-weight: 800; color: var(--good); flex-shrink: 0; line-height: 1; }
.mcb-track {
  flex: 1; height: 8px; min-width: 40px;
  background: #0b111a; border: 1px solid #1e2836; border-radius: 4px; overflow: hidden;
}
.mcb-track i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #f59e0b, #f0b827);
  border-radius: 3px;
}

/* 移动端（横竖屏）：隐藏独立工资帽卡，紧凑条上移到首发面板顶部 */
@media (max-width: 960px), (pointer: coarse) {
  #salaryCapSummaryCard, #rosterSalaryCapCard { display: none; }
  .mgl-capbar { display: flex; }
}

/* 移动端拖拽换首发：跟手残影 + 目标高亮 */
.mgl-drag-ghost {
  position: fixed; z-index: 9999; pointer-events: none; margin: 0 !important;
  opacity: .95; transform: scale(1.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .55);
}
.mgl-card.mgl-drag-src { opacity: .28; }
.mgl-card.mgl-drop-ok { outline: 2px solid #22c55e; outline-offset: -2px; }
.mgl-card.mgl-drop-no { outline: 2px solid #ef4444; outline-offset: -2px; opacity: .55; }
body.mgl-drag-active { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }


@media (max-width: 720px) and (orientation: portrait) {
  .vs-grid { grid-template-columns: 1fr; gap: 10px; }
  .vs-sign { font-size: 22px; letter-spacing: 4px; padding: 2px 0; }
  .lineup-mini { gap: 5px; font-size: 11.5px; }
  .match-summary { padding: 16px 12px; }
}

/* ================ 比赛弹层 X 关闭 + 手机竖屏美化 ================ */
.game-x-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 40;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(15,20,28,.85);
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.game-x-close:hover { color: #fff; border-color: var(--muted); }
.game-x-close:active { transform: scale(.9); }

@media (max-width: 720px) {
  .game-modal-footer { display: none; }
  .game-modal { padding: 12px 12px 0; overflow-x: hidden; }
  .game-modal h1 { font-size: 14px; padding-right: 36px; }
  .game-modal-body { overflow-x: hidden; padding: 0 0 14px; }
  .game-x-close { top: 8px; right: 8px; width: 30px; height: 30px; font-size: 15px; }

  /* 记分牌：压扁 + 防溢出 */
  .scoreboard { margin: 0 0 8px; padding: 8px 6px; overflow: hidden; }
  .sb-team { padding: 0 6px; min-width: 0; }
  .sb-id { min-width: 0; }
  .sb-name { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
  .sb-score { font-size: 30px; }
  .sb-mid { padding: 0 6px; }
  .sb-quarter { font-size: 13px; white-space: nowrap; }
  .sb-clock { font-size: 15px; }

  /* 球场 / 直播 / 技统 间距收紧 */
  .court-scene { height: min(240px, 38vh); margin: 0; }
  .playbyplay { padding: 8px 10px; margin-top: 8px; border-radius: 10px; }
  .playbyplay h3 { font-size: 13px; margin-bottom: 6px; }
  .game-modal .pbp-log { height: 22vh; max-height: 22vh; font-size: 11.5px; }
  .pbp-log .entry { padding: 5px 8px; }
  .game-modal .boxscore { margin-top: 8px; padding: 8px 10px; border-radius: 10px; }
  .game-modal .boxscore h3 { font-size: 13px; margin-bottom: 6px; }
  .boxscore-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .boxscore-table { min-width: 100%; }
  .boxscore-table th, .boxscore-table td { padding: 4px 5px; font-size: 11px; white-space: nowrap; }
}

/* ================ 手机横屏：比赛弹层隐藏底部关闭条（用右上角 X） ================ */
@media (max-width: 960px) and (orientation: landscape), (pointer: coarse) and (orientation: landscape) {
  .game-modal-footer { display: none; }
}

/* ================ 手机端：球场球员卡缩小 ================ */
@media (max-width: 720px), (pointer: coarse) {
  .court-player {
    width: 60px;
    height: 74px;
    padding: 5px 3px 4px;
    gap: 1px;
    border-radius: 8px;
  }
  .court-player .cp-avatar .avatar {
    width: 30px !important;
    height: 30px !important;
    font-size: 13px !important;
  }
  .cp-name { font-size: 9.5px; padding: 0 1px; }
  .cp-pos { font-size: 8.5px; }
  .cp-ovr { font-size: 9.5px; padding: 1px 3px; top: 2px; right: 3px; }
}

/* ================ 手机端：技术统计 球员/位置 两列固定（容器内横滚时） ================ */
@media (max-width: 720px) {
  .boxscore-table { border-collapse: separate; border-spacing: 0; }
  .boxscore-table th,
  .boxscore-table td { background: var(--bg-card); }
  .boxscore-table th:nth-child(1),
  .boxscore-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 64px;
    min-width: 64px;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .boxscore-table th:nth-child(2),
  .boxscore-table td:nth-child(2) {
    position: sticky;
    left: 64px;
    z-index: 2;
    width: 44px;
    min-width: 44px;
    box-shadow: 1px 0 0 var(--line);
  }
  .boxscore-table th:nth-child(1),
  .boxscore-table th:nth-child(2) { z-index: 3; }
}

/* ================ 移动端：技统 球员/位置 两列固定（滚动容器是 .table-scroll） ================ */
@media (max-width: 960px), (pointer: coarse) {
  .table-scroll .boxscore-table { border-collapse: separate; border-spacing: 0; }
  .table-scroll .boxscore-table th:nth-child(1),
  .table-scroll .boxscore-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--bg-card) !important;
  }
  .table-scroll .boxscore-table th:nth-child(2),
  .table-scroll .boxscore-table td:nth-child(2) {
    position: sticky;
    left: 62px;
    z-index: 2;
    width: 40px;
    min-width: 40px;
    white-space: nowrap;
    background: var(--bg-card) !important;
    box-shadow: 1px 0 0 var(--line);
  }
  .table-scroll .boxscore-table th:nth-child(1),
  .table-scroll .boxscore-table th:nth-child(2) { z-index: 3; }
}

/* ================ 横屏手机：比赛弹层全屏，球场撑到屏幕下沿，直播悬浮压球场底 ================ */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .game-overlay { align-items: stretch; justify-content: stretch; }
  .game-modal {
    box-sizing: border-box;
    height: 100%;
    max-height: none;
    width: 100%;
    max-width: none;
    border-radius: 0;
    border: none;
    padding: 6px 10px 0;
  }
  .game-modal h1 { font-size: 13px; margin-bottom: 4px; }
  .game-modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    position: relative;
  }
  .scoreboard { position: static; flex: 0 0 auto; margin: 0 0 6px; padding: 6px 8px; }
  .sb-score { font-size: 30px; }
  .sb-clock { font-size: 15px; }
  .court-scene {
    flex: 1 1 auto;
    height: auto;
    min-height: 110px;
    margin: 0;
  }
  /* 球员卡横屏也缩小，留出更多场地空间 */
  .court-player { width: 60px; height: 74px; padding: 5px 3px 4px; gap: 1px; border-radius: 8px; }
  .court-player .cp-avatar .avatar { width: 30px !important; height: 30px !important; }
  .cp-name { font-size: 9.5px; }
  .cp-pos { font-size: 8.5px; }
  .cp-ovr { font-size: 9.5px; padding: 1px 3px; top: 2px; right: 3px; }
  /* 直播变半透明悬浮条，盖在球场下沿 → 球场底边即屏幕底边 */
  .playbyplay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    margin: 0;
    z-index: 6;
    padding: 4px 8px;
    background: rgba(10,14,20,.88);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    max-height: 96px;
  }
  .playbyplay h3 { display: none; }
  .game-modal .pbp-log { height: 78px; max-height: 78px; font-size: 11px; }
  /* 技统（赛后出现）压缩为可滚小块，不挤走球场 */
  .game-modal .boxscore {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    max-height: 28vh;
    margin-top: 6px;
  }
}

/* ================ 移动端：技统滚动容器修正 + 球员/位置列固定（v2） ================
   原因：.boxscore-grid 是 grid 且 overflow-x:auto，会把内层 .table-scroll 撑宽，
   实际滚动发生在 grid 层，sticky 相对 .table-scroll 无效。
   修法：手机端 grid 改 block、外层不滚，只让 .table-scroll 滚。 */
@media (max-width: 960px), (pointer: coarse) {
  .boxscore-grid {
    display: block;
    overflow-x: visible;
  }
  .boxscore-grid > div {
    min-width: 0;
    max-width: 100%;
  }
  .table-scroll {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }
  .table-scroll .boxscore-table { border-collapse: separate; border-spacing: 0; }
  .table-scroll .boxscore-table th:nth-child(1),
  .table-scroll .boxscore-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    width: 62px;
    min-width: 62px;
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background: var(--bg-card) !important;
  }
  .table-scroll .boxscore-table th:nth-child(2),
  .table-scroll .boxscore-table td:nth-child(2) {
    position: sticky;
    left: 62px;
    z-index: 2;
    width: 40px;
    min-width: 40px;
    white-space: nowrap;
    background: var(--bg-card) !important;
    box-shadow: 1px 0 0 var(--line);
  }
  .table-scroll .boxscore-table th:nth-child(1),
  .table-scroll .boxscore-table th:nth-child(2) { z-index: 3; }
}

/* ================ 手机竖屏：比赛弹层全屏固定，球场不随页面滚动 ================ */
@media (max-width: 720px), (pointer: coarse) and (orientation: portrait) {
  .game-overlay { align-items: stretch; justify-content: stretch; }
  .game-modal {
    box-sizing: border-box;
    height: 100%;
    max-height: none;
    width: 100%;
    max-width: none;
    border-radius: 0;
    border: none;
    padding: 10px 10px 0;
  }
  .game-modal-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
  }
  .scoreboard { position: static; flex: 0 0 auto; }
  .court-scene {
    flex: 1 1 auto;
    height: auto;
    min-height: 130px;
    margin: 0;
  }
  .playbyplay { flex: 0 0 auto; margin-top: 8px; }
  .game-modal .pbp-log { height: 17vh; max-height: 17vh; }
  .game-modal .boxscore {
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    max-height: 24vh;
    margin-top: 8px;
  }

  /* 球员卡再缩小一档 */
  .court-player { width: 52px; height: 64px; padding: 4px 2px 3px; gap: 1px; border-radius: 7px; }
  .court-player .cp-avatar .avatar { width: 26px !important; height: 26px !important; }
  .cp-name { font-size: 8.5px; padding: 0 1px; }
  .cp-pos { font-size: 7.5px; }
  .cp-ovr { font-size: 8.5px; padding: 1px 2px; top: 2px; right: 2px; }
}

/* ================ 直播/技统折叠 + 直播跟随状态 ================ */
.playbyplay h3, .boxscore h3 {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.playbyplay h3::after, .boxscore h3::after {
  content: '▾';
  display: inline-block;
  margin-left: 6px;
  font-size: 12px;
  color: var(--muted);
  transition: transform .18s;
}
.playbyplay.collapsed h3::after, .boxscore.collapsed h3::after { transform: rotate(-90deg); }
.playbyplay.collapsed .pbp-log { display: none; }
.boxscore.collapsed .boxscore-grid { display: none; }

/* ================ 手机竖屏：球场限高 + 直播/技统上贴球场 ================ */
@media (max-width: 720px), (pointer: coarse) and (orientation: portrait) {
  .court-scene {
    flex: 1 1 auto;
    height: auto;
    min-height: 230px;
    max-height: min(54vh, 230px);   /* 最大拉伸值：再高就变形了 */
    margin: 0;
  }
  .playbyplay { flex: 0 0 auto; margin-top: 8px; }
  .game-modal .pbp-log { height: 15vh; max-height: 15vh; }
  .game-modal .boxscore {
    flex: 0 0 auto;
    max-height: 26vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* ================ 手机横屏：球场限高，直播/技统跟在球场后（不再悬浮贴屏底） ================ */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .court-scene {
    flex: 1 1 auto;
    height: auto;
    min-height: 110px;
    max-height: min(46vh, 230px);
    margin: 0;
  }
  .playbyplay {
    position: static;   /* 去掉悬浮：跟在球场正下方 */
    flex: 0 0 auto;
    margin-top: 6px;
    max-height: none;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 4px 2px 0;
  }
  .playbyplay h3 { display: block; font-size: 12px; margin-bottom: 4px; }
  .game-modal .pbp-log { height: 60px; max-height: 60px; }
  .game-modal .boxscore {
    flex: 0 0 auto;
    max-height: 20vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

@media (max-width: 720px), (pointer: coarse) and (orientation: portrait) {
  .playbyplay { margin-top: 2px; }
}
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .playbyplay { margin-top: 2px; }
}

@media (max-width: 720px), (pointer: coarse) and (orientation: portrait) {
  .game-modal .playbyplay { margin-top: 2px; }
  .game-modal .boxscore { margin-top: 4px; }
}
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .game-modal .playbyplay { margin-top: 2px; }
  .game-modal .boxscore { margin-top: 4px; }
}

/* 技术统计：标题行固定，只滚标题下方数据区 */
@media (max-width: 720px), (pointer: coarse) and (orientation: portrait) {
  .game-modal .boxscore { overflow: visible; max-height: none; }
  .game-modal .boxscore .boxscore-grid {
    overflow-y: auto;
    max-height: 21vh;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  .game-modal .boxscore { overflow: visible; max-height: none; }
  .game-modal .boxscore .boxscore-grid {
    overflow-y: auto;
    max-height: 15vh;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* ================ 手机横屏：匹配页保持左右三列 + 字号压缩（小屏不堆叠） ================ */
@media (max-width: 720px) and (orientation: landscape),
       (max-width: 960px) and (orientation: landscape) and (max-height: 560px),
       (orientation: landscape) and (pointer: coarse) {
  .vs-grid { grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .match-summary { padding: 10px 12px; }
  .team-block { padding: 8px 8px; border-radius: 8px; }
  .match-summary .team-logo-slot { flex-basis: 34px; width: 34px; height: 34px; }
  .match-summary .team-home-logo { max-width: 34px; max-height: 34px; }
  .team-home-top { gap: 6px; }
  .team-cap { font-size: 10px; margin-bottom: 2px; }
  .team-display-name { font-size: 14px; margin-bottom: 2px; }
  .team-display-rating { font-size: 11px; margin-bottom: 6px; }
  .vs-sign { font-size: 18px; letter-spacing: 2px; }
  .lineup-mini { gap: 3px; font-size: 10px; }
  .lineup-mini .slot { padding: 3px 1px; }
}

/* 手机横屏：主页/阵容/比赛 三页去掉大标题行（信息已并入顶栏） */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  #view-setup h1,
  #view-roster h1,
  #view-match h1 { display: none; }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  #view-tasks h1,
  #view-inventory h1,
  #view-stats h1 { display: none; }
}

/* ================ 手机横屏：直播/技统互斥折叠（打开一个隐藏球场，全折叠显示球场） ================ */
@media (orientation: landscape) and (max-height: 560px) and (max-width: 960px),
       (orientation: landscape) and (max-height: 560px) and (pointer: coarse) {
  /* 比赛直播标题行与技术统计标题行样式一致（同卡片/同字号/同间距/同折叠箭头） */
  .game-modal .playbyplay {
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    max-height: none;
  }
  .game-modal .boxscore { padding: 8px 10px; }
  .game-modal .playbyplay h3,
  .game-modal .boxscore h3 {
    font-size: 13px;
    font-weight: 700;
    line-height: 20px;
    margin: 0 0 6px;
  }
  .game-modal .playbyplay.collapsed h3,
  .game-modal .boxscore.collapsed h3 { margin-bottom: 0; }
  /* 打开直播或技统 → 隐藏球场，该面板占满剩余空间 */
  .game-modal[data-panel="pbp"] .court-scene,
  .game-modal[data-panel="box"] .court-scene { display: none; }
  .game-modal[data-panel="pbp"] .playbyplay,
  .game-modal[data-panel="box"] .boxscore {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: none !important;
  }
  .game-modal[data-panel="pbp"] .pbp-log,
  .game-modal[data-panel="box"] .boxscore-grid {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* ================ 挂牌自由市场的替补卡：对角线「出售中」+ 蒙层阴影（不影响上场） ================ */
.mgl-card.mgl-selling {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 59, 48, .30) !important;
}
.mgl-card.mgl-selling::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 14, .50);
  border-radius: inherit;
  pointer-events: none;
  z-index: 4;
}
.mgl-sell-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%) rotate(-45deg);
  color: #ff3b30;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 3px;
  text-shadow: 0 0 5px rgba(0, 0, 0, .95), 0 1px 2px rgba(0, 0, 0, .9);
  white-space: nowrap;
  pointer-events: none;
}
.mgl-card.mgl-selling.mini .mgl-sell-banner { font-size: 11px; letter-spacing: 1px; }

/* ================ 首发面板头：「首发阵容」与工资帽进度条同一行（齿轮图标已去掉） ================ */
.mgl-panel-head { flex-wrap: nowrap; }
.mgl-panel-head .mgl-capbar {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0 0 0 8px;
}
@media (max-width: 960px), (pointer: coarse) {
  .mgl-panel-head .mgl-capbar { display: flex; }
}

/* ================ 手机竖屏：技统默认折叠、与直播互斥、高度自适应、紧贴底部10px ================ */
@media (max-width: 960px) and (orientation: portrait),
       (pointer: coarse) and (orientation: portrait) {
  /* 底部留10px：技统（或折叠行）下沿距屏幕底正好10px */
  .game-modal-body { padding-bottom: 10px; }

  /* 打开技统：直播自动折叠（JS互斥），技统占满球场以下剩余高度 */
  .game-modal[data-panel="box"] .court-scene {
    max-height: min(34vh, 300px);   /* 技统打开时压缩球场，保证技统能贴到底部 */
  }
  .game-modal[data-panel="box"] .boxscore {
    flex: 1 1 auto;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: none !important;
  }
  .game-modal[data-panel="box"] .boxscore .boxscore-grid {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  /* 打开直播（默认态）：直播区随屏自适应，技统保持折叠行贴底 */
  .game-modal[data-panel="pbp"] .playbyplay {
    flex: 0 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 42vh;
    overflow: hidden;
  }
  .game-modal[data-panel="pbp"] .pbp-log {
    flex: 1 1 auto;
    min-height: 60px;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
}

/* 竖屏补强：技统/折叠行永远贴底（距屏幕10px），打开直播吃满剩余高度 */
@media (max-width: 960px) and (orientation: portrait),
       (pointer: coarse) and (orientation: portrait) {
  .game-modal .boxscore { margin-bottom: 0; }   /* 去掉 .card 自带的8px底距 */
  .game-modal:not([data-panel="box"]) .playbyplay { margin-top: auto; }  /* 把直播行+技统行整体推到屏幕底 */
  .game-modal[data-panel="pbp"] .playbyplay { flex: 1 1 auto; }
}

/* ================ 手机：确认卖出 / assign 弹框紧凑美化 ================ */
@media (max-width: 960px), (pointer: coarse) {
  .assign-modal {
    border-radius: 12px;
    width: calc(100% - 24px);
    max-height: 88vh;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .65);
  }
  .assign-modal .am-head {
    padding: 8px 12px 7px;
    gap: 8px;
    align-items: center;
    border-bottom-color: rgba(255, 255, 255, .08);
  }
  .assign-modal .am-icon {
    width: 32px;
    height: 32px;
    font-size: 19px;
    border-radius: 8px;
  }
  .assign-modal .am-title { font-size: 13.5px; margin-bottom: 0; }
  .assign-modal .am-tip { font-size: 10.5px; line-height: 1.35; }
  .assign-modal .am-count { padding: 4px 8px; font-size: 13px; }
}

/* ================ 手机（竖屏+横屏）：六个页面大标题行隐藏 ================ */
@media (max-width: 960px), (pointer: coarse) {
  #view-setup h1,
  #view-roster h1,
  #view-match h1,
  #view-tasks h1,
  #view-inventory h1,
  #view-stats h1 { display: none; }
}

/* ================ 手机竖屏：直播紧贴球场、技统紧贴直播（取消上一版贴底10px/底部吸附） ================ */
@media (max-width: 960px) and (orientation: portrait),
       (pointer: coarse) and (orientation: portrait) {
  .game-modal-body { padding-bottom: 0; }
  .game-modal:not([data-panel="box"]) .playbyplay { margin-top: 4px; }
  .game-modal .boxscore { margin-top: 4px; }
}

/* ================ 手机：近十场匹配赛 球员列左右滑动时固定 ================ */
@media (max-width: 960px), (pointer: coarse) {
  #recentMatches .table-scroll .stats-table { border-collapse: separate; border-spacing: 0; }
  #recentMatches .table-scroll .stats-table th:nth-child(1),
  #recentMatches .table-scroll .stats-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 68px;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #11181f;
    border-right: 1px solid var(--line);
  }
  #recentMatches .table-scroll .stats-table th:nth-child(1) { z-index: 3; }
}

/* ================ 修：.view table 移动端 display:block 让表自己成了滚动容器，sticky 失效 ================ */
@media (max-width: 960px), (pointer: coarse) {
  #recentMatches .table-scroll .stats-table {
    display: table;
    overflow-x: visible;
    max-width: none;
  }
}

/* ================ 手机竖屏：弹层内各区块间距统一 4px 紧贴 ================ */
@media (max-width: 960px) and (orientation: portrait),
       (pointer: coarse) and (orientation: portrait) {
  .game-modal .playbyplay { margin-top: 4px; }
}
