/* Hero archive and forge. Presentation only; every selector stays inside these two panels. */
:is(#pa-heroes,#pa-forge) {
  --panel:#101b28; --gold:#e8c578; --gold2:#f0dba6; --cyan:#73cabb;
  --purple:#ad95d3; --pink:#d98b96; --text:#e9edf1; --muted:#8fa4b7;
  padding:28px; background:rgba(3,9,16,.88); color:var(--text);
  font-family:"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif;
  font-size:15px; line-height:1.5; z-index:78;
}
:is(#pa-heroes,#pa-forge),:is(#pa-heroes,#pa-forge) * { box-sizing:border-box; }
:is(#pa-heroes,#pa-forge) * { font-family:"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif!important; text-shadow:none; }
:is(#pa-heroes,#pa-forge) .pa240-slab {
  background:#152231; border:0; box-shadow:none;
  clip-path:polygon(5px 0,calc(100% - 5px) 0,100% 5px,100% calc(100% - 5px),calc(100% - 5px) 100%,5px 100%,0 calc(100% - 5px),0 5px);
}
:is(#pa-heroes,#pa-forge) .pa240-slab::before { display:none; }
:is(#pa-heroes,#pa-forge) .pa240-corner { display:none; }
:is(#pa-heroes,#pa-forge) button { font:inherit; cursor:pointer; text-shadow:none; }
:is(#pa-heroes,#pa-forge) button:focus-visible,
#pa-heroes select:focus-visible { outline:2px solid var(--gold); outline-offset:-3px; }
:is(#pa-heroes,#pa-forge) button:disabled { cursor:not-allowed; opacity:.45; }
:is(#pa-heroes,#pa-forge) .pa240-gem { background:var(--gold); box-shadow:none; width:7px; height:7px; }
#pa-heroes .pa243-panel,#pa-forge .pa242-panel {
  width:min(1200px,100%); height:min(780px,calc(100dvh - 56px)); max-height:calc(100dvh - 56px);
  padding:26px 30px 18px; background:#101b28;
  box-shadow:inset 0 2px #786343,inset 0 0 0 1px #283747,0 24px 80px #0008;
  clip-path:polygon(8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px),0 8px);
  isolation:isolate; overflow:hidden;
}
#pa-heroes .pa243-panel .hd,#pa-forge .pa242-panel .hd {
  flex:none; min-height:46px; padding:0 0 18px; gap:14px; align-items:center;
}
#pa-heroes .hd> .pa240-gem,#pa-forge .hd> .pa240-gem { display:none; }
#pa-heroes .hd h2,#pa-forge .hd h2 { font:700 28px/1.2 "Microsoft YaHei","PingFang SC",sans-serif; letter-spacing:2px; color:#f2eee4; white-space:nowrap; }
#pa-heroes .hd small,#pa-forge .hd small { font:600 11px/1.4 "Segoe UI",sans-serif; letter-spacing:2.5px; color:#8499ad; }
#pa-heroes .hd .x,#pa-forge .hd .x { width:42px; height:42px; flex:none; color:#b6c4d0; font-size:20px; background:#1b2a39; }
#pa-forge .hd .x { margin-left:auto; }
#pa-heroes .hd .x:hover,#pa-forge .hd .x:hover { background:#2a3b4c; color:#fff; }
#pa-heroes .hd .shards { gap:10px; padding:0 16px; height:38px; font-size:12px; color:#9db2c2; background:#0b1521; }
#pa-heroes .hd .shards b { color:var(--gold); font-size:20px; font-weight:600; }
#pa-heroes .pa243-tabs,#pa-forge .pa242-tabs {
  flex:none; gap:24px; padding:0; margin:0 0 22px; min-height:42px;
  border-bottom:1px solid #2a3744; overflow-x:auto; scrollbar-width:none;
}
#pa-heroes .pa243-tabs button,#pa-forge .pa242-tabs button {
  flex:none; min-height:42px; height:auto; padding:8px 3px 12px;
  background:transparent; clip-path:none; color:#8fa4b7; font-size:15px; font-weight:600; letter-spacing:0;
  border-bottom:2px solid transparent;
}
#pa-heroes .pa243-tabs button.on,#pa-forge .pa242-tabs button.on { color:var(--gold2); border-bottom-color:var(--gold); }
#pa-heroes .pa243-tabs button:hover,#pa-forge .pa242-tabs button:hover { color:#e9edf1; }
#pa-heroes .pa243-body { grid-template-columns:minmax(0,1fr) 360px; gap:26px; flex:1; min-height:0; }
#pa-heroes .pa243-grid {
  grid-template-columns:repeat(auto-fill,minmax(188px,1fr)); gap:14px; padding:2px 8px 4px 1px;
  scrollbar-color:#435668 transparent; scrollbar-width:thin;
}
#pa-heroes .pa243-card {
  height:166px; padding:20px 18px 16px; background:linear-gradient(145deg,#1b2a3c,#142130);
  box-shadow:inset 0 0 0 1px #ffffff09,inset 3px 0 color-mix(in srgb,var(--q) 48%,#1b2a3c);
  transition:background .15s,box-shadow .15s;
}
#pa-heroes .pa243-card:hover { transform:none; background:#213248; }
#pa-heroes .pa243-card.sel { background:linear-gradient(135deg,#303035,#1e2834); box-shadow:inset 0 0 0 1px #b99a59,inset 3px 0 #e8c578; }
#pa-heroes .pa243-card .top { gap:13px; min-width:0; padding-top:2px; }
#pa-heroes .pa243-card .top>div:last-child { min-width:0; }
#pa-heroes .pa243-card .g { width:42px; height:46px; flex:none; transform:none; background:#0b1521; box-shadow:inset 0 -2px color-mix(in srgb,var(--q) 60%,transparent); font-size:22px; }
#pa-heroes .pa243-card .g span { transform:none; }
#pa-heroes .pa243-card .n { font-size:15px; line-height:1.5; font-weight:650; max-width:140px; color:#edf0f2; }
#pa-heroes .pa243-card .q { font-size:10px; letter-spacing:.6px; opacity:.8; line-height:1.7; font-weight:500; }
#pa-heroes .pa243-card .stars { font-size:12px; letter-spacing:2px; margin-top:10px; color:#c8ae72; }
#pa-heroes .pa243-card .m { font-size:12px; line-height:1.5; color:#94a8ba; }
#pa-heroes .pa243-card .m b { font-size:17px; font-weight:650; color:#e6ded0; padding-left:3px; }
#pa-heroes .pa243-card .tag { right:10px; top:7px; color:#bccdcc; background:#243b40; font:600 10px/1.5 "Microsoft YaHei",sans-serif; padding:1px 6px; letter-spacing:0; }
#pa-heroes .pa243-detail {
  display:flex; padding:22px; background:#0b1521; clip-path:none; gap:12px;
  border:0; border-left:1px solid #31404e; scrollbar-color:#435668 transparent; min-width:0; min-height:0; overflow:auto;
}
#pa-heroes .pa243-detail>* { flex-shrink:0; }
#pa-heroes .pa243-detail h3 { font-size:25px; line-height:1.35; color:#f2eee4; font-weight:650; }
#pa-heroes .pa243-detail .sub { font-size:11px; font-weight:500; letter-spacing:1px; }
#pa-heroes .pa243-detail .kv { grid-template-columns:1fr 1fr; gap:16px 20px; padding:16px 0 18px; margin:3px 0 0; border-top:1px solid #273542; border-bottom:1px solid #273542; }
#pa-heroes .pa243-detail .kv div { padding:0; background:none; box-shadow:none; }
#pa-heroes .pa243-detail .kv .k { font-size:11px; line-height:1.5; color:#8fa4b7; letter-spacing:1px; margin-bottom:4px; }
#pa-heroes .pa243-detail .kv .v { font-size:15px!important; line-height:1.5; font-weight:600; color:#e9edf1; }
#pa-heroes .pa243-detail .kv>div:nth-child(2) .v { font-size:24px!important; line-height:1.1; color:#e8c578; }
#pa-heroes .pa243-detail .kv>div:nth-child(3) .v { font-size:19px!important; }
#pa-heroes .pa243-detail .cards { font-size:12px; line-height:1.8; color:#9aacbb; }
#pa-heroes .pa243-detail .cards em { color:#cbd8e0; }
#pa-heroes .pa243-detail .row { margin-top:0; gap:8px; flex:none; align-items:center; }
#pa-heroes .pa243-detail .row:has([data-pa243="components"]) button,
#pa-heroes .pa243-detail .row:has([data-pa243="train"]) button { width:100%; justify-content:center; }
#pa-heroes .pa243-detail .row:has(#pa-growth-donor) { padding-top:8px; border-top:1px solid #273542; }
#pa-heroes #pa-growth-donor { width:100%; min-height:42px; padding:8px 10px; color:#a8bac9!important; background:#152333!important; border:1px solid #344453; font:12px/1.5 "Microsoft YaHei",sans-serif; border-radius:0; }
#pa-heroes .pa243-btn,#pa-forge .pa242-btn {
  min-height:40px; height:auto; padding:9px 14px; color:#8fd0c5; background:#1b333b;
  font-size:12px; font-weight:600; line-height:1.4; letter-spacing:0; justify-content:center; white-space:normal;
}
#pa-heroes .pa243-btn.gold,#pa-forge .pa242-btn.gold { background:#3b3425; color:#eed49b; }
#pa-heroes [data-pa243="star"].gold,#pa-forge [data-pa242="refine"].gold,
#pa-forge [data-pa242="cap"].gold,#pa-forge [data-pa242="equip"].gold { background:#e8c578; color:#1b2025; }
#pa-heroes .pa243-btn.dim,#pa-forge .pa242-btn.dim { color:#8b9ead; background:#1a2837; }
#pa-heroes .pa243-btn.danger,#pa-forge .pa242-btn.danger { color:#dba2aa; background:#332831; }
#pa-heroes .pa243-btn:hover,#pa-forge .pa242-btn:hover { filter:brightness(1.18); }
#pa-heroes .pa243-foot,#pa-forge .pa242-foot { flex:none; margin-top:14px; padding-top:12px; border-top:1px solid #273542; color:#73899b; font-size:11px; line-height:1.5; letter-spacing:0; text-align:left; }
#pa-heroes .pa243-empty { font-size:15px; padding:48px 26px; line-height:1.9; }
#pa-forge .pa242-wallet { flex:none; flex-wrap:nowrap; gap:22px; padding:0 0 20px; overflow-x:auto; scrollbar-width:none; }
#pa-forge .pa242-wallet .w { flex:none; min-height:30px; height:auto; gap:8px; padding:0; clip-path:none; background:transparent; color:#8fa4b7; font-size:12px; font-weight:400; }
#pa-forge .pa242-wallet .w b { color:#d9e0e5; font-size:17px; font-weight:600; }
#pa-forge .pa242-wallet .w:first-child b { color:#e8c578; }
#pa-forge .pa242-tabs { margin-bottom:18px; }
#pa-forge .pa242-body { flex:1; min-height:0; max-height:none; padding:1px 8px 4px 1px; scrollbar-color:#435668 transparent; }
#pa-forge .pa242-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
#pa-forge .pa242-w { padding:20px; gap:13px; background:#162434; cursor:pointer; border-top:1px solid #2b3b4a; }
#pa-forge .pa242-w.on { background:#212c37; box-shadow:inset 3px 0 #c7a967; border-top-color:#776444; }
#pa-forge .pa242-w .top { gap:14px; }
#pa-forge .pa242-w .s { width:44px; height:44px; flex:none; transform:none; background:#0b1521; box-shadow:inset 0 -2px color-mix(in srgb,var(--wc) 60%,transparent); font-size:23px; }
#pa-forge .pa242-w .s span { transform:none; }
#pa-forge .pa242-w .n { font-size:17px; font-weight:650; color:#e9edf1; }
#pa-forge .pa242-w .lv { font-size:11px; color:#bea56e; letter-spacing:1px; }
#pa-forge .pa242-w .bar { height:3px; background:#0a131e; }
#pa-forge .pa242-w .bar i { background:#73b8ac; }
#pa-forge .pa242-w .m { font-size:12px; line-height:1.7; color:#8fa4b7; }
#pa-forge .pa242-w .m em { color:#c2d0dc; }
#pa-forge .pa242-w .row { gap:10px; margin-top:auto; align-items:flex-start; }
#pa-forge .pa242-cost { font-size:11px; line-height:1.7; color:#8198ad; }
#pa-forge .pa242-cost b { color:#b9cbd7; font-weight:500; }
#pa-forge .pa242-cost .lack { color:#d28d96; }
#pa-forge .pa242-list { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; }
#pa-forge .pa242-card { padding:24px; background:#152332; gap:14px; border-top:1px solid #30404e; }
#pa-forge .pa242-card b.t { font-size:19px; font-weight:650; color:#e9edf1; }
#pa-forge .pa242-card .d { font-size:13px; line-height:1.8; color:#8fa4b7; }
#pa-forge .pa242-card .row { gap:9px!important; }
#pa-forge .pa242-card:has([data-pa242="equip"]) [data-pa242="pick"] { min-height:38px; font-size:12px; background:#1e3041; color:#9eb3c3; }
#pa-forge .pa242-card:has([data-pa242="equip"]) [data-pa242="pick"].gold { color:#edd198; background:#453e2e; }
#pa-forge .pa242-inv { grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
#pa-forge .pa242-item { aspect-ratio:auto; min-height:124px; padding:17px 12px; gap:6px; background:#0c1825; box-shadow:inset 0 -2px color-mix(in srgb,var(--rc) 48%,transparent); }
#pa-forge .pa242-item.sel { outline-color:#e8c578; }
#pa-forge .pa242-item .ic { font-size:24px; }
#pa-forge .pa242-item .n { font-size:13px; font-weight:600; }
#pa-forge .pa242-item .v { font-size:11px; line-height:1.5; text-align:center; color:#8fa4b7; }
#pa-forge .pa242-empty { padding:32px; font-size:14px; line-height:1.8; }
/* Keep every action reachable without scrolling the fixed modal itself. */
#pa-heroes .pa243-grid,#pa-forge .pa242-body { min-width:0; overscroll-behavior:contain; }
#pa-heroes .pa243-detail { overscroll-behavior:contain; }
@media (max-width:1100px) {
  :is(#pa-heroes,#pa-forge) { padding:16px; }
  #pa-heroes .pa243-panel,#pa-forge .pa242-panel { height:calc(100dvh - 32px); max-height:calc(100dvh - 32px); padding:20px; }
  #pa-heroes .pa243-body { grid-template-columns:minmax(0,1fr) minmax(310px,.9fr); gap:18px; }
  #pa-heroes .pa243-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  #pa-heroes .pa243-card { padding:18px 12px 12px; }
  #pa-heroes .pa243-card .top { gap:9px; }
  #pa-heroes .pa243-card .n { font-size:14px; max-width:110px; }
  #pa-forge .pa242-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #pa-forge .pa242-w { padding:18px; }
}
@media (min-width:601px) and (max-width:760px) {
  #pa-heroes .pa243-grid { grid-template-columns:1fr; }
}
@media (max-height:500px) and (min-width:601px) {
  :is(#pa-heroes,#pa-forge) { padding:10px; }
  #pa-heroes .pa243-panel,#pa-forge .pa242-panel { height:calc(100dvh - 20px); max-height:calc(100dvh - 20px); padding:12px 18px 10px; }
  #pa-heroes .pa243-panel .hd,#pa-forge .pa242-panel .hd { min-height:36px; padding-bottom:8px; gap:12px; }
  #pa-heroes .hd h2,#pa-forge .hd h2 { font-size:22px; }
  #pa-heroes .hd .x,#pa-forge .hd .x { width:36px; height:36px; }
  #pa-heroes .pa243-tabs,#pa-forge .pa242-tabs { margin-bottom:10px; gap:22px; min-height:36px; }
  #pa-heroes .pa243-tabs button,#pa-forge .pa242-tabs button { min-height:36px; padding:6px 2px 8px; font-size:13px; }
  #pa-heroes .pa243-body { grid-template-columns:1fr 1.1fr; gap:16px; }
  #pa-heroes .pa243-card { min-height:138px; height:138px; }
  #pa-heroes .pa243-card .g { width:32px; height:38px; font-size:19px; }
  #pa-heroes .pa243-detail { padding:16px 18px; }
  #pa-heroes .pa243-detail h3 { font-size:22px; }
  #pa-heroes .pa243-detail .kv { gap:10px 18px; padding:12px 0; }
  #pa-forge .pa242-wallet { padding-bottom:8px; gap:18px; }
  #pa-forge .pa242-wallet .w { font-size:11px; min-height:25px; }
  #pa-forge .pa242-wallet .w b { font-size:15px; }
  #pa-forge .pa242-w { padding:16px; gap:10px; }
  #pa-heroes .pa243-foot,#pa-forge .pa242-foot { margin-top:8px; padding-top:7px; font-size:10px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}
@media (max-width:600px) {
  :is(#pa-heroes,#pa-forge) { padding:0; }
  #pa-heroes .pa243-panel,#pa-forge .pa242-panel { width:100%; height:100dvh; max-height:100dvh; padding:18px 16px 12px; clip-path:none; }
  #pa-heroes .pa243-panel .hd,#pa-forge .pa242-panel .hd { padding-bottom:16px; gap:10px; }
  #pa-heroes .pa243-panel .hd h2,#pa-forge .pa242-panel .hd h2 { font-size:25px; letter-spacing:1px; }
  #pa-heroes .hd small,#pa-forge .hd small { display:none; }
  #pa-heroes .hd .shards { padding:0 10px; gap:7px; margin-left:auto; height:36px; }
  #pa-heroes .hd .shards .pa240-gem { display:none; }
  #pa-heroes .hd .shards span { font-size:11px; }
  #pa-heroes .hd .shards b { font-size:18px; }
  #pa-heroes .hd .x,#pa-forge .hd .x { width:40px; height:40px; }
  #pa-heroes .pa243-tabs,#pa-forge .pa242-tabs { gap:23px; margin-bottom:16px; }
  #pa-heroes .pa243-tabs button,#pa-forge .pa242-tabs button { font-size:14px; min-height:42px; }
  #pa-heroes .pa243-body { display:flex; flex-direction:column; gap:18px; min-height:0; overflow:hidden; }
  #pa-heroes .pa243-grid { flex:none; height:157px; grid-template-columns:none; grid-auto-flow:column; grid-auto-columns:178px; grid-template-rows:148px; gap:10px; overflow-x:auto; overflow-y:hidden; padding:0 1px 8px; scroll-snap-type:x proximity; }
  #pa-heroes .pa243-card { height:148px; padding:20px 14px 12px; scroll-snap-align:start; }
  #pa-heroes .pa243-card .g { width:33px; height:40px; font-size:20px; }
  #pa-heroes .pa243-card .top { gap:11px; }
  #pa-heroes .pa243-card .n { font-size:14px; max-width:114px; }
  #pa-heroes .pa243-detail { display:flex; flex:1 1 0; min-height:0; padding:20px 17px; border-left:0; border-top:1px solid #34414e; overflow:auto; }
  #pa-heroes .pa243-detail h3 { font-size:25px; }
  #pa-heroes .pa243-detail .kv { gap:16px 22px; }
  #pa-heroes .pa243-btn { min-height:44px; }
  #pa-heroes .pa243-foot { font-size:10px; margin-top:10px; padding-top:8px; line-height:1.6; }
  #pa-forge .pa242-wallet { gap:18px; padding-bottom:16px; }
  #pa-forge .pa242-tabs { gap:19px; margin-bottom:15px; }
  #pa-forge .pa242-body { padding-right:3px; }
  #pa-forge .pa242-grid,#pa-forge .pa242-list { grid-template-columns:1fr; gap:14px; }
  #pa-forge .pa242-w,#pa-forge .pa242-card { padding:22px 20px; }
  #pa-forge .pa242-w .row { align-items:center; }
  #pa-forge .pa242-btn { min-height:44px; }
  #pa-forge .pa242-inv { grid-template-columns:repeat(2,minmax(0,1fr)); }
  #pa-forge .pa242-item { padding:15px 8px; }
  #pa-forge .pa242-card b.t { font-size:18px; }
  #pa-forge .pa242-foot { font-size:10px; margin-top:10px; padding-top:10px; line-height:1.6; }
}
@media (max-width:600px) and (max-height:650px) {
  /* Short windows need one vertical scroll area so the fixed card strip cannot consume the detail. */
  #pa-heroes .pa243-body { overflow-y:auto; overscroll-behavior:contain; }
  #pa-heroes .pa243-grid { overscroll-behavior-y:auto; }
  #pa-heroes .pa243-detail { flex:none; overflow:visible; }
  #pa-heroes .pa243-foot { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}
@media (max-width:600px) and (max-height:400px) {
  #pa-heroes .pa243-panel,#pa-forge .pa242-panel { padding:10px 12px; }
  #pa-heroes .pa243-panel .hd,#pa-forge .pa242-panel .hd { min-height:36px; padding-bottom:6px; }
  #pa-heroes .pa243-panel .hd h2,#pa-forge .pa242-panel .hd h2 { font-size:22px; }
  #pa-heroes .pa243-tabs,#pa-forge .pa242-tabs { min-height:34px; margin-bottom:8px; }
  #pa-heroes .pa243-tabs button,#pa-forge .pa242-tabs button { min-height:34px; padding:4px 2px 8px; font-size:13px; }
  #pa-forge .pa242-wallet { padding-bottom:6px; }
  #pa-heroes .pa243-foot,#pa-forge .pa242-foot { margin-top:6px; padding-top:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}
