/* =====================================================================
 * GoPower · Web PC 版 联赛页（league）样式 (web/css/league.css)
 * ---------------------------------------------------------------------
 * 独立于 web.css / train.css；沿用 :root 设计变量。
 * 覆盖：页头、段位卡 + 晋级进度、本周赛程 7 对手卡
 * （≤1520→4 列换行、>1520→7 列）、战绩榜、段位榜三区（跃升/保级/降级）、
 * 历史赛况头、对战 modal（方案 A 轻量对弈）、三视口断点。
 * ===================================================================== */

.league-page{display:flex;flex-direction:column;gap:16px;max-width:1120px;margin:0 auto;min-width:0}

/* ---------- 页头 ---------- */
.league-header{
  display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap;
  padding:20px 24px;background:linear-gradient(120deg,#ffffff 55%,var(--brand-soft));
  border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);
}
.league-header-main{display:flex;align-items:center;gap:14px;min-width:0}
.league-header-icon{
  width:52px;height:52px;border-radius:16px;display:grid;place-items:center;flex:0 0 auto;
  background:linear-gradient(135deg,var(--brand),#9b7bff);color:#fff;
  box-shadow:0 8px 18px rgba(116,89,239,.35);
}
.league-header-icon .ui-icon{width:28px;height:28px}
.league-header-copy{min-width:0}
.league-header-copy h2{margin:0;font-size:20px;line-height:1.25}
.league-header-copy p{margin:4px 0 0;font-size:13px;color:var(--ink-2);line-height:1.5}
.league-history-btn[hidden]{display:none}
.league-header-actions{display:flex;align-items:center;gap:10px;flex:0 0 auto}
.league-exp-btn{white-space:nowrap}

/* ---------- 段位卡 + 晋级进度 ---------- */
.league-progress{padding:18px 22px;min-width:0}
.league-progress-row{display:flex;align-items:center;gap:22px;flex-wrap:wrap}
.league-rank-chip{display:flex;align-items:center;gap:12px;flex:0 0 auto}
.league-rank-icon{
  width:46px;height:46px;border-radius:14px;display:grid;place-items:center;
  background:linear-gradient(135deg,var(--brand),#9b7bff);color:#fff;
  box-shadow:0 8px 16px rgba(116,89,239,.32);
}
.league-rank-icon .ui-icon{width:24px;height:24px}
.league-rank-chip div{display:flex;flex-direction:column;gap:2px}
.league-rank-chip small{font-size:11px;color:var(--ink-2)}
.league-rank-chip b{font-size:20px;line-height:1.1}
.league-fought,.league-promotion{display:flex;align-items:center;gap:12px;min-width:160px;flex:1 1 180px}
.league-kpi-icon{width:40px;height:40px;flex:0 0 auto;border-radius:12px;display:grid;place-items:center}
.league-kpi-icon .ui-icon{width:20px;height:20px}
.league-kpi-icon.fought{background:var(--brand-soft);color:var(--brand)}
.league-kpi-icon.promotion{background:#fdf3dc;color:#e9a13b}
.league-kpi-body{display:flex;flex-direction:column;gap:5px;min-width:0;flex:1 1 auto}
.league-fought small,.league-promotion small{font-size:11px;color:var(--ink-2)}
.league-fought b,.league-promotion b{font-size:16px}
.league-fought .progress,.league-promotion .progress{height:8px;width:100%}
.league-promotion-hint{display:flex;align-items:center;gap:12px;flex:1 1 220px;min-width:200px}
.league-hint-icon{flex:0 0 auto;color:var(--brand);display:grid;place-items:center}
.league-hint-icon .ui-icon{width:22px;height:22px}
.league-hint-body{display:flex;flex-direction:column;gap:3px;min-width:0}
.league-promotion-hint b{font-size:14px;color:var(--brand)}
.league-promotion-hint small{font-size:11px;color:var(--ink-2)}

/* ---------- 区块标题 ---------- */
.league-section-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:0 4px}
.league-section-head h3{margin:0;font-size:17px}
.league-section-head small{font-size:12px;color:var(--ink-2)}

/* ---------- 本周赛程（7 对手卡） ---------- */
.league-week{display:flex;flex-direction:column;gap:12px;padding:18px 20px;min-width:0}
.league-opponents{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;min-width:0}
@media (min-width:1521px){
  .league-opponents{grid-template-columns:repeat(7,minmax(0,1fr))}
}
.league-opponent{
  display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;padding:14px 8px;
  border-radius:16px;background:var(--card);border:1px solid var(--line);
  box-shadow:var(--shadow-sm);transition:.16s;
}
.league-opponent:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:var(--brand)}
.league-opponent.win{border-color:#d8f0e1;background:linear-gradient(160deg,#ffffff,#eefaf3)}
.league-opponent.done{border-color:#f0e3e3;background:linear-gradient(160deg,#ffffff,#faf1f1)}
.league-opponent-avatar-v4{
  position:relative;width:56px;height:56px;border-radius:50%;display:grid;place-items:center;
  background:var(--bg);border:2px solid var(--line);overflow:visible;
}
.league-opponent-avatar-v4 img{width:100%;height:100%;border-radius:50%;object-fit:cover}
.league-opponent-avatar-v4 .mentor-portrait{width:100%;height:100%;border-radius:50%}
.league-opponent-result{
  position:absolute;right:-4px;bottom:-4px;width:22px;height:22px;border-radius:50%;
  display:grid;place-items:center;color:#fff;font-style:normal;
}
.league-opponent-result.win{background:#2f9e5c}
.league-opponent-result.done{background:#c96a6a}
.league-opponent-result .ui-icon{width:13px;height:13px}
.league-opponent b{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.league-opponent small{font-size:11px;color:var(--ink-2);white-space:nowrap}

/* ---------- 战绩榜（R1：league-lower 单列，经验联赛迁入 modal） ---------- */
.league-lower{display:flex;flex-direction:column;gap:16px;min-width:0}
.league-battle{display:flex;flex-direction:column;gap:12px;padding:18px 20px;min-width:0;width:100%}

/* 战绩榜行 */
.weekly-battle-rank-row-v8{
  display:flex;align-items:center;gap:10px;min-width:0;padding:10px 12px;
  border-radius:12px;background:var(--card);border:1px solid var(--line);
}
.weekly-battle-rank-row-v8 + .weekly-battle-rank-row-v8{margin-top:8px}
.weekly-battle-rank-row-v8.self{background:var(--brand-soft);border-color:var(--brand)}
.weekly-battle-rank-row-v8 > b{width:34px;font-size:15px;text-align:center;flex:0 0 auto}
.weekly-battle-rank-row-v8 > span{display:flex;align-items:center;gap:6px;flex:1 1 auto;min-width:0;font-size:13px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.weekly-battle-rank-row-v8 > span em{font-style:normal;padding:1px 7px;border-radius:999px;background:var(--brand);color:#fff;font-size:10px;font-weight:900}
.weekly-battle-rank-row-v8 > small{font-size:12px;color:var(--ink-2);flex:0 0 auto}
.weekly-battle-rank-row-v8 > strong{font-size:13px;color:var(--ink);flex:0 0 auto}
.weekly-history-head{display:flex;flex-direction:column;gap:3px;padding:4px 2px 10px}
.weekly-history-head b{font-size:15px}
.weekly-history-head small{font-size:12px;color:var(--ink-2)}

/* ---------- 段位榜三区（跃升/保级/降级） ---------- */
.experience-hero{display:flex;align-items:center;gap:10px;padding:2px 2px 10px}
.experience-rank-pill{
  display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:999px;
  background:linear-gradient(135deg,var(--brand),#9b7bff);color:#fff;font-size:14px;font-weight:900;
  box-shadow:0 8px 16px rgba(116,89,239,.28);
}
.experience-rank-pill b{font-size:16px}
.experience-self-card{
  display:flex;align-items:center;gap:16px;padding:12px 14px;margin-bottom:10px;
  border-radius:14px;background:var(--bg);border:1px solid var(--line);
}
.experience-self-avatar{
  width:44px;height:44px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;
  background:var(--brand-soft);color:var(--brand);font-weight:900;font-size:16px;overflow:hidden;
}
.experience-self-avatar img{width:100%;height:100%;object-fit:cover}
.experience-self-rank{display:flex;flex-direction:column;gap:2px;flex:0 0 auto}
.experience-self-rank small{font-size:11px;color:var(--ink-2)}
.experience-self-rank b{font-size:18px;line-height:1.1}
.experience-self-rank em{font-style:normal;font-size:12px;color:var(--ink-2)}
.experience-self-xp{display:flex;flex-direction:column;gap:5px;flex:1 1 auto;min-width:120px}
.experience-self-xp small{font-size:11px;color:var(--ink-2)}
.experience-self-xp div{display:flex;align-items:center;gap:8px}
.experience-self-xp i{flex:1;height:8px;border-radius:999px;background:var(--line);overflow:hidden}
.experience-self-xp i span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--brand),#9b7bff)}
.experience-self-xp b{font-size:14px}
.experience-board{display:flex;flex-direction:column;gap:10px;min-width:0}
.experience-zone{border-radius:14px;padding:10px 12px;border:1px solid var(--line)}
.experience-zone.up{background:linear-gradient(160deg,#ffffff,#f3fbf6);border-color:#d8f0e1}
.experience-zone.safe{background:linear-gradient(160deg,#ffffff,#f6f5ff);border-color:#e5e1fb}
.experience-zone.down{background:linear-gradient(160deg,#ffffff,#fdf4f2);border-color:#f6deda}
.experience-zone > header{display:flex;align-items:center;justify-content:space-between;padding:2px 2px 8px}
.experience-zone > header div{display:flex;align-items:center;gap:6px}
.experience-zone > header b{font-size:13px}
.experience-zone > header small{font-size:11px;color:var(--ink-2)}
.experience-zone-flag{width:18px;height:18px}
.experience-rank-row{
  display:flex;align-items:center;gap:8px;min-width:0;padding:7px 8px;border-radius:10px;
}
.experience-rank-row.self{background:var(--brand-soft)}
.experience-medal,.experience-rank-number{
  width:24px;height:24px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;
  font-size:12px;font-weight:900;
}
.experience-medal.gold{background:linear-gradient(135deg,#ffd86b,#f0a83a);color:#fff}
.experience-medal.silver{background:linear-gradient(135deg,#dfe6ee,#aebac9);color:#fff}
.experience-medal.bronze{background:linear-gradient(135deg,#e3a878,#b8783f);color:#fff}
.experience-rank-number{background:var(--bg);color:var(--ink-2)}
.experience-player-avatar{
  width:30px;height:30px;border-radius:50%;display:grid;place-items:center;flex:0 0 auto;
  background:var(--card);color:var(--ink-2);font-weight:800;font-size:12px;overflow:hidden;
  border:1px solid var(--line);
}
.experience-player-avatar img{width:100%;height:100%;object-fit:cover}
.experience-player-copy{display:flex;flex-direction:column;gap:1px;flex:1 1 auto;min-width:0}
.experience-player-copy b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:flex;align-items:center;gap:5px}
.experience-player-copy b em{font-style:normal;padding:0 6px;border-radius:999px;background:var(--brand);color:#fff;font-size:9px;font-weight:900}
.experience-player-copy small{font-size:10px;color:var(--ink-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.experience-xp-track{flex:1 1 70px;min-width:46px;height:6px;border-radius:999px;background:var(--line);overflow:hidden}
.experience-xp-track span{display:block;height:100%;border-radius:999px;background:linear-gradient(90deg,var(--brand),#9b7bff)}
.experience-rank-row > strong{font-size:12px;flex:0 0 auto;min-width:30px;text-align:right}

/* ---------- 对战 modal ---------- */
.lq-play-mask{z-index:60}
.lq-play-card{max-width:min(92vw,540px);display:flex;flex-direction:column;gap:14px;padding:22px}
.lq-play-head{display:flex;flex-direction:column;gap:4px;min-width:0;padding-right:28px}
.lq-play-head b{font-size:17px}
.lq-play-head small{font-size:12px;color:var(--ink-2)}
.lq-play-board-wrap{
  width:min(56vh,440px);max-width:100%;aspect-ratio:1/1;margin:0 auto;position:relative;
  padding:10px;background:linear-gradient(145deg,#c18b48,#9f682d);border-radius:20px;
  box-shadow:0 16px 34px rgba(77,47,18,.2),inset 0 0 0 1px rgba(77,42,12,.2);
}
.lq-board{cursor:pointer}
.lq-play-controls{display:flex;align-items:center;justify-content:center;gap:10px;flex-wrap:wrap}
.lq-stat{font-size:12px;font-weight:800;color:var(--ink-2)}
.lq-play-controls button{
  padding:8px 18px;border-radius:999px;font-size:13px;font-weight:800;
  background:var(--bg);border:1px solid var(--line);color:var(--ink);transition:.15s;
}
.lq-play-controls button:hover{border-color:var(--brand);color:var(--brand);background:var(--brand-soft)}
.lq-play-controls button.lq-danger{background:#fdeeea;border-color:#e0533d;color:#d5452f}
.lq-play-controls button.lq-danger:hover{background:#e0533d;color:#fff}
.lq-play-status{min-height:20px;text-align:center;font-size:12px;font-weight:800;color:var(--ink-2)}
/* 选手卡读秒时钟 + 工具道具余量徽标（对齐 APP challenge 屏） */
.lq-player-clock{font-style:normal;font-size:10px;font-weight:800;color:var(--ink-2);letter-spacing:.02em}
.lq-duel-actions button em{font-style:normal;padding:1px 6px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:9.5px;font-weight:900}
.lq-duel-actions button:disabled em{opacity:.55}

/* ---------- 经验联赛 modal（R1） ---------- */
.lq-exp-mask{z-index:60}
.lq-exp-card{
  max-width:min(92vw,760px);max-height:min(84vh,760px);display:flex;flex-direction:column;gap:14px;padding:22px;
}
.lq-exp-head{display:flex;flex-direction:column;gap:4px;min-width:0;padding-right:28px}
.lq-exp-head b{font-size:17px}
.lq-exp-head small{font-size:12px;color:var(--ink-2)}
.lq-exp-body{display:flex;flex-direction:column;gap:12px;min-width:0;overflow-y:auto;max-height:min(70vh,660px);padding-right:4px}

/* ---------- 加载 / 空态 ---------- */
.league-loading{display:flex;align-items:center;gap:10px;justify-content:center;padding:26px 18px;color:var(--ink-2);font-size:13px}
.league-loading .spinner{width:20px;height:20px;border-width:2px}

.lq-board-wait{
  position:absolute;inset:10px;z-index:20;border-radius:14px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px;
  background:rgba(20,20,29,.58);backdrop-filter:blur(2px);color:#fff;text-align:center;
}
.lq-board-wait b{font-size:13px}
#lqRetryAiBtn{background:#fff3e8;border-color:#f0cda6;color:#9a5a13}
#lqRetryAiBtn:hover{background:#ffe8cd;color:#824706}
/* 形势券为 0：不禁用，改为可点击的「缺券待购」态，点击后引导用魂珀购买 */
#lqSituationBtn.is-situation-empty{background:#fff8f0;border-color:#f0cda6;color:#9a5a13}
#lqSituationBtn.is-situation-empty:hover:not(:disabled){background:#ffe8cd;color:#824706}

.lq-result-mask{z-index:76}
.lq-result-card{width:min(92vw,620px);padding:22px;border-radius:22px;overflow:hidden}
.lq-result-hero{margin:-22px -22px 0;padding:34px 26px 24px;text-align:center;background:linear-gradient(145deg,#2e2948,#4b4279);color:#fff}
.lq-result-hero.win{background:linear-gradient(145deg,#2f5940,#447c57)}
.lq-result-hero>span{width:54px;height:54px;margin:0 auto 12px;display:grid;place-items:center;border-radius:17px;background:rgba(255,255,255,.12)}
.lq-result-hero>span .ui-icon{width:28px;height:28px}.lq-result-hero small{display:block;color:rgba(255,255,255,.7);font-weight:700}.lq-result-hero h2{margin:5px 0 0;font-size:28px}.lq-result-hero p{margin:5px 0 0;color:rgba(255,255,255,.82);font-weight:800}
.lq-result-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-top:16px}.lq-result-metrics article{padding:13px;border-radius:14px;background:#f5f3fa;text-align:center}.lq-result-metrics small{display:block;color:#858092;font-size:10px}.lq-result-metrics b{display:block;margin-top:4px;color:#312c49;font-size:20px}.lq-result-metrics em{font-size:11px;color:#918b9c;font-style:normal}
.lq-result-promotion{margin-top:12px;padding:13px 14px;border:1px solid #e7e3ef;border-radius:14px;background:#fff}.lq-result-promotion.promoted{background:#f2faf4;border-color:#d7eadb}.lq-result-promotion header{display:flex;align-items:end;justify-content:space-between;gap:12px}.lq-result-promotion small{display:block;color:#858092;font-size:10px}.lq-result-promotion b{display:block;margin-top:3px;color:#383248;font-size:12px}.lq-result-promotion header>span{font-size:11px;color:#777083;font-weight:800}.lq-result-promotion>i{display:block;height:6px;margin-top:9px;border-radius:99px;background:#ece9f1;overflow:hidden}.lq-result-promotion>i em{display:block;height:100%;border-radius:inherit;background:#6e63e7}.lq-result-promotion.promoted>i em{background:#4ea267}
.lq-result-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:16px}.lq-result-actions button{border:1px solid #ded9e8;border-radius:11px;background:#fff;padding:10px 14px;color:#514b61;font-weight:800;cursor:pointer}.lq-result-actions button.primary{border-color:#6b60df;background:#6b60df;color:#fff}
@media(max-width:760px){.lq-result-metrics{grid-template-columns:1fr}.lq-result-actions{flex-direction:column}.lq-result-actions button{width:100%}}
