/* 选择战友（helpers-ui.mjs）：电脑和手机共用的对话框、手机工具栏「战友」按钮、电脑出战准备战友卡上的「换战友」与朋友名牌、
   「我的资料」里的「助战角色」一格、旧编队窗口里的「战友」一行。只放大不超过原图像素的规则不涉及（这里没有大图）。 */
.hp-dialog{width:min(760px,calc(100vw - 16px));max-width:calc(100vw - 16px);max-height:min(92dvh,920px);padding:0;border:1px solid #d0ad7677;border-radius:8px;background:#0f181d;color:#eee2c7;overflow:auto;overscroll-behavior:contain;box-shadow:0 18px 60px #000b}
.hp-dialog::backdrop{background:#020508cc}
.hp-card{--pg-u:8px;padding:16px 18px 14px;font-family:var(--sans,inherit)}
.hp-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.hp-head h2{margin:0;font:600 20px/1.3 var(--serif,serif);color:#f1d79c;letter-spacing:.06em}
.hp-stage{margin:2px 0 0;font-size:12px;color:#b6c5bd}
.hp-close{flex:none;width:40px;height:40px;border:1px solid #d0ad7655;border-radius:50%;background:#162125;color:#f1d79c;font-size:22px;line-height:1;cursor:pointer}
.hp-rules{margin:10px 0 4px;font-size:12px;line-height:1.7;color:#aebbb4}
.hp-group{margin-top:12px}
.hp-group h3{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;margin:0 0 2px;font:600 14px/1.4 var(--serif,serif);color:#e9c98a}
.hp-group h3 small{font:400 11px/1.4 var(--sans,inherit);color:#8fa39c}
.hp-note,.hp-empty{margin:6px 0 0;padding:8px 10px;border-left:2px solid #d0ad7688;background:#151e22;font-size:12px;line-height:1.6;color:#d5c5a4}
.hp-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;margin-top:8px;padding:8px 10px;border:1px solid #52606066;border-radius:6px;background:#152027}
.hp-row.is-picked{border-color:#e9c98a;background:#1d2a2c;box-shadow:inset 0 0 0 1px #e9c98a55}
.hp-row.is-blocked{opacity:.62}
.hp-row .uk-card{--uk-cw:58px}
/* 手机（没有 body.desktop-game）：ui-kit 角色卡的样式不生效，换成旧版同款立绘小方块 */
.hp-thumb{display:none;position:relative;width:56px;height:72px;border:1px solid #d0ad7666;border-radius:4px;background-color:#0b1218;overflow:hidden}
.hp-thumb b{position:absolute;left:0;right:0;bottom:0;padding:1px 0;background:#000a;color:#f1d79c;font:600 10px/1.4 var(--sans,inherit);text-align:center}
.hp-thumb.fire{border-color:#e0794f99}.hp-thumb.water{border-color:#5aa7e099}.hp-thumb.wood{border-color:#6fbf6a99}.hp-thumb.light{border-color:#e8cf6a99}.hp-thumb.dark{border-color:#a07ad899}
body:not(.desktop-game) .hp-row .uk-card,body:not(.desktop-game) .hp-lend-row .uk-card{display:none}
body:not(.desktop-game) .hp-row .hp-thumb,body:not(.desktop-game) .hp-lend-row .hp-thumb{display:block}
.hp-info{display:flex;min-width:0;flex-direction:column;gap:2px}
.hp-name{font:600 14px/1.35 var(--serif,serif);color:#f3e6c6;overflow-wrap:anywhere}
.hp-stats{font-size:12px;color:#e9c98a}
.hp-leader{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:11px;line-height:1.5;color:#9fb0aa}
.hp-block{font-style:normal;font-size:11px;color:#f09a8a}
.hp-owner{display:flex;align-items:center;gap:6px;min-width:0;font-size:12px;color:#cfe3ff}
.hp-owner b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.hp-owner small{flex:none;color:#8fa39c;font-size:11px}
.hp-ava{flex:none;width:24px;height:24px;border-radius:50%;object-fit:cover;border:1px solid #9cc1ff88;background:#0b1218}
.hp-own-pick{display:flex;align-items:center;gap:6px;margin-top:4px;font-size:11px;color:#b6c5bd}
.hp-own-pick select,.hp-lend-pick select{min-width:0;max-width:100%;min-height:34px;padding:4px 8px;border:1px solid #b49b6755;border-radius:4px;background:#1c282e;color:#eee2c7;font:inherit;font-size:12px}
.hp-pick{min-width:64px;min-height:40px;padding:6px 12px;border:1px solid #d0ad7688;border-radius:4px;background:#162125;color:#f1d79c;font-size:13px;cursor:pointer}
.hp-pick.is-picked{background:#d0ad76;color:#1b1408;border-color:#f1d79c;font-weight:700}
.hp-pick:disabled{cursor:not-allowed;color:#8a8f88;border-color:#52606066}
.hp-pick:focus-visible,.hp-close:focus-visible,.hp-chip:focus-visible,.hp-prep-swap:focus-visible,.hp-team-helper:focus-visible{outline:2px solid #ffe2a0;outline-offset:2px}
.hp-foot{margin-top:12px;font-size:12px;color:#8fa39c;display:flex;justify-content:flex-end;align-items:center;gap:10px}
.hp-foot p{margin:0;margin-right:auto}
.hp-changes{margin:8px 0 0;padding-left:20px;font-size:13px;line-height:1.8;color:#eee2c7}

/* 手机工具栏「战友」按钮（.campaign-toolbar 在电脑上整条隐藏） */
.hp-chip{max-width:48vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* 旧编队窗口（手机）里的「战友」一行 */
.hp-team-row{display:flex;min-width:0;flex-direction:column;gap:8px;font-size:12px;color:var(--gold,#d0ad76)}
.hp-team-helper{min-height:38px;padding:8px 10px;border:1px solid #b49b6755;border-radius:4px;background:#1c282e;color:#eee2c7;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hp-warn{color:#f09a8a!important}

/* 电脑出战准备：战友卡上的「换战友」和朋友名牌（只在卡的范围内，不改卡片排版） */
.hp-prep-friend{position:relative}
.hp-prep-swap{position:absolute;left:50%;top:46%;z-index:6;transform:translateX(-50%);padding:3px 10px;border:1px solid #9cc1ffaa;border-radius:999px;background:#0b1a2ccc;color:#e6f0ff;font-size:12px;line-height:1.4;white-space:nowrap;cursor:pointer;opacity:.92}
.hp-prep-swap:hover{opacity:1;background:#12304fe6}
.hp-prep-owner{position:absolute;left:50%;top:12%;z-index:6;transform:translateX(-50%);display:flex;align-items:center;gap:4px;max-width:110%;padding:2px 6px 2px 2px;border-radius:999px;background:#08121ecc;color:#e6f0ff;font-size:12px;line-height:1.3;pointer-events:none;white-space:nowrap}
.hp-prep-owner img{width:18px;height:18px;border-radius:50%;object-fit:cover}
.hp-prep-owner b{overflow:hidden;text-overflow:ellipsis;font-weight:600}

/* 「我的资料」里的「助战角色」 */
.hp-lend-row{display:flex;align-items:center;gap:10px}
.hp-lend-row .uk-card{--uk-cw:52px}
.hp-lend-text{display:flex;min-width:0;flex-direction:column;gap:3px}
.hp-lend-text b{font-weight:600}
.hp-lend-text small{color:#b6c5bd;font-size:12px}
.hp-lend-pick{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;font-size:12px;color:#b6c5bd}
.hp-lend-pick span{white-space:nowrap}
.hp-lend-pick select{flex:1 1 160px}

@media (max-width:650px){
  .hp-dialog{width:calc(100vw - 12px);max-width:calc(100vw - 12px);max-height:94dvh}
  .hp-card{padding:12px 10px 12px}
  .hp-head h2{font-size:18px}
  .hp-row{gap:8px;padding:7px 8px}
  .hp-pick{min-width:56px;padding:6px 8px}
  .hp-own-pick{flex-wrap:wrap}
  .hp-own-pick select{flex:1 1 140px}
}
@media (prefers-reduced-motion:reduce){.hp-prep-swap,.hp-pick{transition:none}}
html[lang="en"] .hp-head h2,html[lang="en"] .hp-group h3{letter-spacing:0}

/* riftshop 10/19：朋友助战卡上的头像框（框外径 34px，头像按圆洞缩）与称号牌。 */
.hp-look>.hp-ava{width:calc(34px * var(--lk-hole));height:calc(34px * var(--lk-hole))}
.hp-look{margin:0 calc(34px * (1 - var(--lk-hole)) / 2)}
.hp-prep-owner .hp-look>img:first-child{width:calc(30px * var(--lk-hole));height:calc(30px * var(--lk-hole));border-radius:50%;object-fit:cover}
.hp-title{flex:none;max-width:48%}

/* mobile16pm A3：手机（iPhone 16 Pro Max）选择战友——字 ≥12px、按钮 ≥44px、让出刘海 / 底部横条；「换一名」换成可横滑的头像条（helpers-ui.mjs phone）。电脑不受影响。 */
@media (max-width:999.98px){
  body:not(.desktop-game) .hp-dialog{max-height:calc(100dvh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 12px)}
  body:not(.desktop-game) .hp-card{padding:14px 14px 16px}
  body:not(.desktop-game) .hp-close{width:44px;height:44px}
  body:not(.desktop-game) .hp-rules{font-size:12.5px}
  body:not(.desktop-game) .hp-group h3{font-size:15px}
  body:not(.desktop-game) .hp-group h3 small,body:not(.desktop-game) .hp-owner small,body:not(.desktop-game) .hp-block{font-size:12px}
  body:not(.desktop-game) .hp-name{font-size:15px}
  body:not(.desktop-game) .hp-stats{font-size:12.5px}
  body:not(.desktop-game) .hp-leader{font-size:12.5px;line-height:1.55}
  body:not(.desktop-game) .hp-note,body:not(.desktop-game) .hp-empty{font-size:12.5px}
  body:not(.desktop-game) .hp-thumb{width:60px;height:80px}
  body:not(.desktop-game) .hp-thumb b{font-size:12px}
  body:not(.desktop-game) .hp-pick{min-width:64px;min-height:44px;font-size:14px}
  body:not(.desktop-game) .hp-foot{font-size:12.5px}
  body:not(.desktop-game) .hp-own-strip{margin:8px 0 0;padding:10px 0 4px;border-top:1px dashed #d0ad7644}
  body:not(.desktop-game) .hp-own-head{display:flex;align-items:baseline;gap:8px;margin:0 0 8px;font:600 14px/1.4 var(--serif,serif);color:#e9c98a}
  body:not(.desktop-game) .hp-own-head small{font:400 12px/1.4 var(--sans,inherit);color:#8fa39c}
  body:not(.desktop-game) .hp-own-list{display:flex;gap:8px;margin:0 -14px;padding:2px 14px 8px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  body:not(.desktop-game) .hp-own-list::-webkit-scrollbar{display:none}
  body:not(.desktop-game) .hp-own-opt{flex:none;display:flex;flex-direction:column;align-items:center;gap:3px;width:64px;padding:0;border:0;background:none;color:#eee2c7;scroll-snap-align:start}
  body:not(.desktop-game) .hp-own-opt>span{display:block;width:64px;height:80px;border:2px solid color-mix(in srgb,var(--element,#d0ad76) 65%,#000);border-radius:6px;background-size:var(--hero-size,500% auto);background-position:calc(var(--portrait,0)*25%) 18%}
  body:not(.desktop-game) .hp-own-opt>span[style*="--hero-art"]{background-position:center 18%} /* mobile16pm verify (Codex #7): the 5 starters stay on their heroes.png sprite cell; single portraits are cover */
  body:not(.desktop-game) .hp-own-opt>b{max-width:100%;overflow:hidden;font:500 12px/1.35 var(--serif,serif);text-overflow:ellipsis;white-space:nowrap}
  body:not(.desktop-game) .hp-own-opt.is-on>span{border-color:#f6d68a;box-shadow:0 0 0 2px #f6d68a99}
  body:not(.desktop-game) .hp-own-opt:disabled{opacity:.4}
}
