/* Chaos Barricade — feature panels (More hub, sub-panels, HUD rail). Mobile-first, 375px. */
:root {
  --pn-wood: linear-gradient(#3a2a17, #241808);
  --pn-gold: #f0b43c; --pn-gold2: #c8912a; --pn-gold-dark: #7a4f10;
  --pn-r: 14px;
}
#panel { padding-bottom: 0; }
#panel .pn-wrap { padding-bottom: calc(24px + var(--safe-bottom)); }

/* ---------- title bar ---------- */
.pn-title { position: sticky; top: -12px; z-index: 5; margin: -12px -12px 12px; padding: 8px 8px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; background: var(--pn-wood); border-bottom: 2px solid var(--pn-gold2); box-shadow: 0 4px 14px rgba(0,0,0,.45); }
.pn-title h2 { margin: 0; text-align: center; font-size: 18px; color: var(--pn-gold); letter-spacing: .02em; text-shadow: 0 1px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-title .pn-back { width: 44px; height: 44px; padding: 0; border-radius: 12px; background: rgba(0,0,0,.35); border: 1px solid #5a3f20; color: var(--pn-gold); font-size: 26px; line-height: 1; }
.pn-title .pn-right { display: flex; justify-content: flex-end; }
.pn-title .pn-right button { padding: 6px 8px; font-size: 13px; }

/* ---------- hub ---------- */
.pn-hub-head { position: relative; overflow: hidden; display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; background: radial-gradient(120% 140% at 0% 0%, rgba(240,180,60,.22), transparent 55%), linear-gradient(135deg, #2c3d30, #141d17 75%); border: 1px solid var(--pn-gold2); border-radius: 18px; padding: 12px; margin-bottom: 14px; box-shadow: 0 6px 18px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,230,160,.18); cursor: pointer; }
.pn-hub-head::after { content: '›'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 26px; color: var(--pn-gold); opacity: .7; }
.pn-hub-head:active { transform: scale(.99); }
.pn-hub-head .pn-portrait { width: 64px !important; height: 64px !important; border-radius: 50%; border: 3px solid var(--pn-gold); box-shadow: 0 0 0 3px rgba(0,0,0,.45), 0 0 16px rgba(240,180,60,.45); object-position: top; }
.pn-hub-head .name { font-weight: 800; font-size: 18px; letter-spacing: .01em; text-shadow: 0 1px 2px #000; padding-right: 18px; }
.pn-hub-head .chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; padding-right: 18px; }
.pn-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; background: var(--c-ink); border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.pn-chip.gold { border-color: var(--pn-gold2); color: var(--pn-gold); }
.pn-chip.vip { background: linear-gradient(#5a3f0c, #3a2a0a); border-color: var(--pn-gold); color: var(--c-amber-pale); font-weight: 700; }
.pn-hub { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pn-hub-card { position: relative; display: grid; justify-items: center; align-content: start; gap: 7px; padding: 14px 6px 10px; background: radial-gradient(90% 60% at 50% 0%, rgba(255,255,255,.07), transparent 70%), linear-gradient(#24332a, #18221c); border: 1px solid #3a5042; border-radius: 16px; min-height: 104px; cursor: pointer; box-shadow: 0 4px 0 var(--c-ink), 0 6px 12px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08); transition: transform .08s, box-shadow .08s; user-select: none; }
.pn-hub-card:active { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 var(--c-ink), 0 2px 6px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08); }
.pn-hub-card .pn-ico { position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; border: 2px solid rgba(255,230,170,.55); box-shadow: 0 0 0 3px var(--c-ink), 0 0 0 4px rgba(240,180,60,.35), 0 5px 10px rgba(0,0,0,.5), inset 0 -6px 10px rgba(0,0,0,.35), inset 0 4px 6px rgba(255,255,255,.25); text-shadow: 0 2px 3px rgba(0,0,0,.45); overflow: hidden; }
.pn-hub-card .pn-ico::before { content: ''; position: absolute; left: 12%; right: 12%; top: 4%; height: 44%; border-radius: 50% 50% 45% 45%; background: linear-gradient(rgba(255,255,255,.45), rgba(255,255,255,0)); pointer-events: none; }
.pn-hub-card .lb { font-size: 12.5px; font-weight: 700; text-align: center; letter-spacing: .02em; text-shadow: 0 1px 0 #000; }
.pn-bdg { position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: linear-gradient(#ff6a5c, #c8392e); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 1.5px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.5); animation: pnBdg 2.4s ease-in-out infinite; }
.pn-bdg.gold { background: linear-gradient(#ffe08a, var(--pn-gold2)); color: var(--c-amber-ink); border-color: #fff6d8; }
@keyframes pnBdg { 0%, 85%, 100% { transform: scale(1); } 92% { transform: scale(1.18); } }

/* ---------- generic ---------- */
.pn-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pn-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pn-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pn-gold { background: linear-gradient(#1f2a22, #16201a); border: 1px solid var(--pn-gold2); border-radius: var(--pn-r); padding: 10px 12px; margin-bottom: 10px; box-shadow: inset 0 1px 0 rgba(255,220,140,.12); }
.pn-gold h3, .pn-section { margin: 0 0 6px; font-size: 14px; color: var(--pn-gold); text-transform: uppercase; letter-spacing: .05em; }
.pn-section { margin: 14px 0 8px; }
.pn-bar { height: 8px; background: var(--c-ink); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin-top: 4px; }
.pn-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--good), #8fe09a); transition: width .3s; }
.pn-bar.gold i { background: linear-gradient(90deg, var(--pn-gold2), #ffd97a); }
.pn-bar.blue i { background: linear-gradient(90deg, #2f6fa8, var(--blue)); }
.pn-btn-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pn-btn-row button { flex: 1; min-height: 44px; }
.pn-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pn-menu button { min-height: 60px; display: grid; justify-items: center; gap: 2px; font-size: 13px; padding: 8px 4px; }
.pn-menu button .ic { font-size: 22px; }
.pn-tabs { display: flex; gap: 4px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.pn-tabs button { position: relative; flex: 1 0 auto; min-height: 40px; padding: 6px 10px; font-size: 13px; border-radius: 10px; white-space: nowrap; }
.pn-tabs button.active { background: var(--pn-gold); color: var(--c-amber-ink); border-color: var(--pn-gold2); font-weight: 700; }
.pn-tabs .pn-bdg { top: -6px; right: -4px; }
.pn-empty { color: var(--muted); text-align: center; padding: 18px 8px; }
.pn-loading { color: var(--muted); text-align: center; padding: 14px; }
.pn-bottom { position: sticky; bottom: 0; z-index: 4; margin: 10px -12px 0; padding: 8px 12px calc(8px + var(--safe-bottom)); background: linear-gradient(transparent, var(--bg) 25%); }
.pn-bottom .pn-bottom-card { background: var(--panel); border: 1px solid var(--pn-gold2); border-radius: var(--pn-r); padding: 8px 10px; display: flex; align-items: center; gap: 8px; }
.pn-bottom .pn-bottom-card button { min-height: 44px; }
.pn-bottom .grow { flex: 1; min-width: 0; }
.pn-bottom .primary { width: 100%; min-height: 48px; font-size: 16px; }
.pn-row-btn { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); min-height: 44px; }
.pn-row-btn:last-child { border-bottom: 0; }
.pn-row-btn button { min-height: 40px; }
.pn-rank { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pn-rank .no { font-weight: 700; color: var(--muted); text-align: center; }
.pn-rank .no.top { font-size: 20px; }
.pn-rank .v { font-weight: 700; color: var(--pn-gold); }
.pn-rank.me { background: #2a2410; border: 1px solid var(--pn-gold2); border-radius: 10px; padding: 8px; }
.pn-me-pin { position: sticky; bottom: 0; background: var(--bg); padding: 6px 0 calc(6px + var(--safe-bottom)); }
textarea.pn-ta { width: 100%; font: inherit; color: inherit; background: var(--c-ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; resize: vertical; }
.pn-input { width: 100%; }
.pn-form { display: grid; gap: 8px; }
.pn-stat { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.pn-stat:last-child { border-bottom: 0; }
.pn-stat b { color: var(--pn-gold); }
.pn-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.pn-note { font-size: 12px; color: var(--muted); }
.pn-ok { color: var(--good); }

/* ---------- portraits / heroes ---------- */
.pn-portrait { position: relative; overflow: hidden; background: var(--c-ink); display: grid; place-items: center; }
.pn-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.pn-portrait.fb { font-size: 28px; background: radial-gradient(circle at 50% 35%, #2a3a2e, var(--c-ink)); }
.pn-hero { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; border: 2px solid var(--pn-gold2); background: var(--c-ink); overflow: hidden; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.5), inset 0 0 0 1px rgba(255,220,140,.25); }
.pn-hero .pn-portrait { position: absolute; inset: 0; }
.pn-hero .pn-portrait.fb { font-size: 34px; }
.pn-hero .fac { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.65); border: 1px solid var(--pn-gold2); font-size: 11px; display: grid; place-items: center; }
.pn-hero .srank { position: absolute; top: 3px; right: 3px; font-size: 10px; font-weight: 800; background: var(--pn-gold); color: var(--c-amber-ink); border-radius: 6px; padding: 1px 4px; }
.pn-hero .lv { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000; background: linear-gradient(transparent, rgba(0,0,0,.75)); padding: 10px 0 1px; }
.pn-hero .stars { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font-size: 9px; letter-spacing: -1px; color: var(--pn-gold); background: rgba(0,0,0,.75); }
.pn-hero .stars .off { color: #555; }
.pn-hero.locked { border-color: var(--line); filter: grayscale(1) brightness(.55); }
.pn-hero.locked .frag { position: absolute; left: 3px; right: 3px; bottom: 3px; font-size: 10px; color: #fff; text-align: center; filter: none; }
.pn-hero.locked .frag .pn-bar { height: 5px; }
.pn-hero-big { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: start; }
.pn-hero-big .pn-portrait { width: 96px; height: 128px; border-radius: 12px; border: 2px solid var(--pn-gold2); }
.pn-rarity { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-ink); }
.pn-results { display: grid; gap: 6px; margin-top: 10px; }
.pn-result { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; opacity: 0; transform: translateY(8px) scale(.96); animation: pnPop .35s ease-out forwards; }
.pn-result.new { border-color: var(--pn-gold); box-shadow: 0 0 12px rgba(240,180,60,.35); }
.pn-result .pn-portrait { width: 44px; height: 44px; border-radius: 8px; }
@keyframes pnPop { to { opacity: 1; transform: none; } }
.pn-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pn-pick .pn-hero.sel { outline: 3px solid var(--good); }

/* ---------- technologies ---------- */
.pn-cat { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 2px solid var(--pn-gold2); cursor: pointer; background: var(--c-ink); display: grid; place-items: center; font-size: 34px; }
.pn-cat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pn-cat .nm { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 4px 4px; font-size: 11px; font-weight: 700; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.85)); text-shadow: 0 1px 2px #000; }
.pn-cat .pct { position: absolute; top: 4px; right: 4px; font-size: 10px; font-weight: 700; background: rgba(0,0,0,.6); border-radius: 6px; padding: 1px 5px; color: var(--pn-gold); }
.pn-tech { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pn-tech:last-child { border-bottom: 0; }
.pn-tech button { min-height: 40px; }

/* ---------- mail ---------- */
.pn-mail { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.pn-mail:last-child { border-bottom: 0; }
.pn-mail .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--panel2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 20px; position: relative; }
.pn-mail .ic .dot { position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); border: 2px solid var(--panel); }
.pn-mail .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-mail.read .t { font-weight: 400; color: var(--muted); }
.pn-mail .p { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn-mail .meta { font-size: 11px; color: var(--muted); text-align: right; display: grid; gap: 2px; }
.pn-mail-body { white-space: pre-wrap; font-size: 14px; line-height: 1.45; }

/* ---------- arena ---------- */
.pn-podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; align-items: end; margin: 6px 0 10px; }
.pn-podium .p { display: grid; justify-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px 12px 4px 4px; padding: 8px 4px 6px; font-size: 12px; text-align: center; }
.pn-podium .p .pn-portrait { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--pn-gold2); }
.pn-podium .p.first { border-color: var(--pn-gold); padding-top: 14px; min-height: 120px; background: linear-gradient(#2a2410, var(--panel)); }
.pn-podium .p.first .pn-portrait { width: 56px; height: 56px; }
.pn-podium .p .nm { font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-podium .p .pt { color: var(--pn-gold); }
.pn-opp { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pn-opp .hs { display: flex; gap: 3px; margin-top: 3px; }
.pn-opp .hs .pn-portrait { width: 26px; height: 26px; border-radius: 6px; font-size: 14px; }

/* ---------- store / passes / vip ---------- */
.pn-bundle { position: relative; background: linear-gradient(160deg, #2a2410, var(--c-panel) 60%); border: 1px solid var(--pn-gold2); border-radius: var(--pn-r); padding: 10px 12px; margin-bottom: 10px; }
.pn-bundle .tag { position: absolute; top: -8px; left: 10px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; border: 1px solid #fff3; }
.pn-bundle .big { font-size: 22px; font-weight: 800; color: var(--pn-gold); }
.pn-bundle .cont { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.pn-bundle.done { opacity: .6; }
.pn-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 8px; }
.pn-days .d { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: var(--c-ink); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--muted); cursor: default; position: relative; }
.pn-days .d.avail { border-color: var(--pn-gold); background: #2a2410; color: var(--pn-gold); cursor: pointer; box-shadow: 0 0 8px rgba(240,180,60,.35); }
.pn-days .d.done { background: #1f4a2a; border-color: var(--good); color: #fff; }
.pn-days .d.done::after { content: '✓'; position: absolute; right: 2px; bottom: 0; font-size: 9px; }
.pn-vip-lv { display: grid; grid-template-columns: 64px 1fr; gap: 10px; align-items: center; }
.pn-vip-lv .crown { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, var(--c-amber-pale), var(--pn-gold2) 70%); display: grid; place-items: center; font-size: 22px; font-weight: 900; color: var(--c-amber-ink); border: 2px solid #fff3; box-shadow: 0 3px 10px rgba(0,0,0,.4); }
.pn-chest { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; }
.pn-chest .ic { font-size: 40px; text-align: center; }
.pn-stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pn-stepper button { border: 0; border-radius: 0; padding: 6px 10px; min-width: 40px; }
.pn-stepper span { display: grid; place-items: center; min-width: 32px; background: var(--c-ink); }

/* ---------- radar ---------- */
.pn-mission { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pn-mission:last-child { border-bottom: 0; }
.pn-mission .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; background: var(--panel2); border: 1px solid var(--line); }
.pn-mission.done { opacity: .5; }
.pn-mission .acts { display: grid; gap: 4px; }
.pn-mission .acts button { min-height: 36px; padding: 4px 10px; font-size: 13px; }

/* ---------- clan ---------- */
.pn-clan-banner { background: linear-gradient(135deg, #2b2a40, #16201a 70%); border: 1px solid var(--pn-gold2); border-radius: var(--pn-r); padding: 12px; margin-bottom: 10px; }
.pn-clan-banner .tag { display: inline-block; background: var(--pn-gold); color: var(--c-amber-ink); font-weight: 800; border-radius: 6px; padding: 1px 6px; margin-right: 6px; }
.pn-clan-banner .nm { font-size: 18px; font-weight: 700; }
.pn-clan-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pn-clan-row:last-child { border-bottom: 0; }
.pn-role { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--pn-gold); }

/* ---------- HUD rail (base view only) ---------- */
#pn-rail { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); display: grid; gap: 10px; z-index: 3; }
#pn-rail .pn-rail-btn { position: relative; width: 50px; height: 50px; padding: 0; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #2e3f33, #141d17 75%); border: 2px solid var(--pn-gold2); box-shadow: 0 3px 8px rgba(0,0,0,.5); display: grid; justify-items: center; align-content: center; gap: 0; color: var(--text); }
#pn-rail .pn-rail-btn .ic { font-size: 20px; line-height: 1; }
#pn-rail .pn-rail-btn .lb { font-size: 9px; line-height: 1; color: var(--pn-gold); margin-top: 2px; }
#pn-rail .pn-rail-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; font-style: normal; display: grid; place-items: center; border: 1px solid #fff3; }
#panel:not(.hidden) ~ #pn-rail, #map-ui:not(.hidden) ~ #pn-rail { display: none; }

/* ---------- shared (panels-core.js) ---------- */
.pn-portrait-fallback { border-radius: 50%; background: radial-gradient(circle at 50% 35%, #2a3a2e, var(--c-ink)); border: 2px solid var(--pn-gold2); color: var(--pn-gold); font-weight: 800; display: grid; place-items: center; }
img.pn-portrait { border-radius: 50%; border: 2px solid var(--pn-gold2); background: var(--c-ink); }

/* =================== Heroes, Recruit, Profile, Settings (panels.js) =================== */
.pn-bar.gold i { background: linear-gradient(90deg, var(--c-amber-lo), #ffd27a); }
.pn-bar.blue i { background: linear-gradient(90deg, #2f86d8, #7fd4ff); }
.pn-chip.vip b { color: var(--c-amber-pale); }
.pn-ta { width: 100%; resize: none; font: inherit; color: inherit; background: var(--c-ink); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.hd-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pn-btn-row { display: flex; gap: 8px; margin-top: 10px; } .pn-btn-row > button { flex: 1; min-height: 42px; font-weight: 700; }
.pn-note { font-size: 12px; color: var(--muted); }

/* --- hero portrait fallback: faction-tinted card art instead of a giant circle --- */
.hc-art { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(circle at 50% 28%, color-mix(in srgb, var(--rc, var(--c-blue)) 45%, #0b0f0c), #070a08 78%); }
.hc-art .pn-portrait { width: 100% !important; height: 100% !important; border: 0 !important; border-radius: 0 !important; background: none !important; object-fit: cover; object-position: top; }
.hc-art .pn-portrait-fallback { font-size: 0 !important; display: block; }
.hc-art .pn-portrait-fallback::before { content: ''; position: absolute; left: 50%; top: 18%; width: 40%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: linear-gradient(#2a2f2c, #121614); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc, #888) 50%, transparent); }
.hc-art .pn-portrait-fallback::after { content: ''; position: absolute; left: 50%; bottom: -8%; width: 78%; height: 42%; transform: translateX(-50%); border-radius: 50% 50% 0 0; background: linear-gradient(#262b28, #0f1311); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc, #888) 50%, transparent); }

/* --- Heroes collection --- */
.hx-strip { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; margin-bottom: 10px; }
.hx-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.hx-stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; background: linear-gradient(#1f2a22, #141c17); border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; }
.hx-stat .ic { grid-row: 1 / 3; font-size: 20px; } .hx-stat b { font-size: 15px; line-height: 1.1; } .hx-stat small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hx-recruit { width: 112px; border: 0; border-radius: 14px; display: grid; place-content: center; gap: 4px; text-align: center; color: var(--c-amber-ink); padding: 8px;
  background: linear-gradient(160deg, var(--c-amber-pale), var(--c-amber) 45%, #c8712a); box-shadow: 0 0 0 2px var(--c-amber-deep), 0 6px 16px rgba(240,180,60,.35), inset 0 2px 0 rgba(255,255,255,.5); animation: hx-pulse 2.4s ease-in-out infinite; }
.hx-recruit .big { font: 900 17px/1 system-ui; } .hx-recruit .sub { font: 700 10px/1.2 system-ui; opacity: .85; }
@keyframes hx-pulse { 50% { box-shadow: 0 0 0 2px var(--c-amber-deep), 0 6px 26px rgba(255,200,80,.6), inset 0 2px 0 rgba(255,255,255,.5); transform: translateY(-1px); } }
/* three cards per row on a phone (four or more where the screen is wider); the big art lives on the hero screen */
.hx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.hx-grid .hc { border-radius: 12px; }
.hx-grid .hc-top { left: 4px; right: 4px; top: 4px; gap: 3px; }
.hx-grid .hc-fac, .hx-grid .hc-role { width: 22px; height: 22px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(0,0,0,.65); }
.hx-grid .hc-fac { border: 1px solid var(--rc); }
.hx-grid .hc-gem { min-width: 24px; font-size: 10px; padding: 3px 4px; }
.hx-grid .hc-up { right: 4px; top: 30px; width: 20px; height: 20px; }
.hx-grid .hc-foot { padding: 20px 6px 5px; }
.hx-grid .hc-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hx-grid .hc-stars { font-size: 11px; margin: 2px 0; }
.hx-grid .hc-meta { font-size: 11px; white-space: nowrap; }
.hx-grid .hc-lock { font-size: 10px; margin-top: 2px; white-space: nowrap; }
.hc { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; cursor: pointer; border: 2px solid var(--rc); background: #0b0f0c;
  box-shadow: 0 0 0 1px #000, 0 6px 14px rgba(0,0,0,.5), inset 0 0 18px color-mix(in srgb, var(--rc) 35%, transparent); transition: transform .1s; }
.hc:active { transform: scale(.97); }
.hc.r-legendary { box-shadow: 0 0 0 1px #000, 0 0 18px rgba(240,180,60,.45), inset 0 0 24px rgba(240,180,60,.35); }
.hc.locked .hc-art { filter: grayscale(1) brightness(.45); }
.hc-shine { position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, rgba(255,240,190,.35) 50%, transparent 60%); animation: hc-shine 3s linear infinite; pointer-events: none; }
@keyframes hc-shine { from { transform: translateX(-60%); } to { transform: translateX(60%); } }
.hc-top { position: absolute; left: 6px; right: 6px; top: 6px; display: flex; gap: 4px; align-items: center; }
.hc-fac { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; background: rgba(0,0,0,.65); border: 1px solid var(--rc); }
.hc-role { font: 700 10px/1 system-ui; padding: 4px 6px; border-radius: 999px; background: rgba(0,0,0,.6); color: #dfe8e1; }
.hc-role.development { color: #8fe09a; }
.hc-gem { margin-left: auto; min-width: 30px; text-align: center; font: 900 11px/1 system-ui; padding: 4px 6px; border-radius: 6px; color: #fff; background: var(--rc); box-shadow: 0 2px 0 rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.4); text-shadow: 0 1px 0 rgba(0,0,0,.5); }
.hc-up { position: absolute; right: 6px; top: 38px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--good); color: #062; font: 900 12px/1 system-ui; animation: hx-pulse 1.4s infinite; }
.hc-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 8px 7px; background: linear-gradient(transparent, rgba(0,0,0,.85) 45%); }
.hc-name { font: 900 16px/1.1 system-ui; color: #fff; text-shadow: 0 2px 0 #000; }
.hc-stars { display: flex; gap: 1px; font-size: 12px; line-height: 1; margin: 3px 0; } .hc-stars i { color: #39413c; font-style: normal; } .hc-stars i.on { color: #ffd23a; text-shadow: 0 0 4px rgba(255,210,58,.6); }
.hc-stars.sm { font-size: 10px; }
.hc-meta { display: flex; justify-content: space-between; font-size: 12px; color: #cfd8d2; } .hc-meta b { color: #fff; } .hc-meta .cp b { color: var(--pn-gold); }
.hc-lock { display: flex; justify-content: space-between; font-size: 11px; color: #cfd8d2; margin-top: 3px; }
.hc-fbar { margin-top: 4px; height: 6px; }

/* --- Hero detail --- */
.hd-banner { position: relative; height: 380px; margin: 0 -12px 12px; overflow: hidden; border-bottom: 2px solid var(--rc); }
.hd-banner.locked .hc-art { filter: grayscale(1) brightness(.5); }
.hd-fade { position: absolute; inset: 0; background: linear-gradient(transparent 40%, rgba(11,17,13,.6) 65%, var(--bg)); }
.hd-info { position: absolute; left: 14px; right: 14px; bottom: 12px; display: grid; gap: 4px; }
.hd-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.hd-rar { font: 900 11px/1 system-ui; letter-spacing: .08em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: var(--rc); color: #fff; box-shadow: 0 0 12px color-mix(in srgb, var(--rc) 60%, transparent); }
.hd-name { margin: 2px 0 0; font: 900 34px/1 system-ui; color: #fff; text-shadow: 0 3px 0 #000, 0 0 18px color-mix(in srgb, var(--rc) 60%, transparent); letter-spacing: .01em; }
.hd-stars { display: flex; gap: 2px; font-size: 20px; } .hd-stars i { color: #39413c; font-style: normal; } .hd-stars i.on { color: #ffd23a; text-shadow: 0 0 6px rgba(255,210,58,.7); }
.hd-stars.sm { font-size: 15px; }
.hd-cp { display: flex; align-items: baseline; gap: 8px; } .hd-cp small { font: 800 10px/1 system-ui; letter-spacing: .1em; color: var(--muted); } .hd-cp b { font: 900 24px/1 system-ui; color: var(--pn-gold); }
.hd-burst { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); font: 900 36px/1 system-ui; color: var(--c-amber-pale); text-shadow: 0 3px 0 var(--c-amber-deep), 0 0 30px var(--c-amber); animation: hd-burst 1.4s ease-out forwards; pointer-events: none; }
@keyframes hd-burst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); } 25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); } }
.hd-card { background: linear-gradient(#1f2a22, #16201a); border: 1px solid var(--line); border-radius: var(--pn-r); padding: 10px 12px; margin-bottom: 10px; }
.hd-card.fx { animation: hd-flash 1s ease-out; } @keyframes hd-flash { 0% { box-shadow: 0 0 0 2px #ffd27a, 0 0 30px rgba(255,210,122,.6); } }
.hd-card h3 { margin: 0; font-size: 14px; color: var(--pn-gold); text-transform: uppercase; letter-spacing: .05em; }
.hd-lv { font-size: 13px; color: var(--muted); } .hd-lv b { font-size: 22px; color: #fff; }
.hd-xpbar { height: 10px; margin: 6px 0 4px; }
.hd-btn { min-height: 42px; font-weight: 800; } .hd-btn.glow:not(:disabled) { animation: hx-pulse 1.6s infinite; }
.hd-buffs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hd-buff { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; background: linear-gradient(#1f2a22, #141c17); border: 1px solid var(--line); }
.hd-buff .ic { font-size: 22px; } .hd-buff b { font: 900 18px/1 system-ui; color: var(--good); } .hd-buff small { font-size: 11px; color: var(--muted); }
.hd-skill { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding: 10px; border-radius: 12px; background: linear-gradient(135deg, #2a2236, #161a1f); border: 1px solid #5a3f7a; }
.hd-skill .ic { width: 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 26px; background: radial-gradient(circle at 40% 30%, #8e5cd0, #3a2160); box-shadow: inset 0 0 0 2px #c9a2ff55; }
.hd-skill .nm { font: 900 16px/1.2 system-ui; color: #e8d6ff; } .hd-skill .ds { font-size: 13px; color: #c2c9c4; margin-top: 2px; }
.hd-skill.passive { background: linear-gradient(135deg, #1f3324, #161d18); border-color: #2f6b3a; } .hd-skill.passive .ic { background: radial-gradient(circle at 40% 30%, var(--c-good), #1c4a24); } .hd-skill.passive .nm { color: #b9f0c0; }

/* --- Recruit --- */
.rc-stage { position: relative; height: 300px; margin: 0 -12px 12px; overflow: hidden; display: grid; place-items: center; }
.rc-sky { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 60%, #3a2a5a, #140f20 55%, #07060b); }
.rc-beam { position: absolute; left: 50%; top: -10%; width: 120px; height: 120%; transform: translateX(-50%); background: linear-gradient(transparent, rgba(255,214,120,.22) 40%, rgba(255,214,120,.05)); filter: blur(6px); animation: rc-beam 2.6s ease-in-out infinite; }
@keyframes rc-beam { 50% { opacity: .5; width: 160px; } }
.rc-portal { position: relative; width: 170px; height: 170px; display: grid; place-items: center; margin-top: 40px; }
.rc-portal .ring { position: absolute; inset: 0; border-radius: 50%; border: 3px dashed rgba(255,214,120,.55); animation: rc-spin 9s linear infinite; }
.rc-portal .r2 { inset: 18px; border: 2px solid rgba(181,110,224,.6); border-top-color: transparent; animation-duration: 6s; animation-direction: reverse; }
.rc-portal .r3 { inset: -14px; border: 1px dotted rgba(255,255,255,.3); animation-duration: 14s; }
.rc-portal .core { position: absolute; inset: 40px; border-radius: 50%; background: radial-gradient(circle, #fff6d8, var(--c-amber) 40%, rgba(181,110,224,.4) 70%, transparent 72%); animation: rc-core 2.6s ease-in-out infinite; }
.rc-portal .sym { position: relative; font-size: 42px; color: #3a2108; text-shadow: 0 0 10px #fff; }
@keyframes rc-spin { to { transform: rotate(360deg); } } @keyframes rc-core { 50% { transform: scale(1.12); filter: brightness(1.25); } }
.rc-stage .spark { position: absolute; left: var(--x); bottom: -10px; width: 4px; height: 4px; border-radius: 50%; background: #ffd27a; box-shadow: 0 0 6px #ffd27a; animation: rc-spark var(--t) linear infinite; animation-delay: var(--dl); }
@keyframes rc-spark { to { transform: translateY(-320px); opacity: 0; } }
.rc-head { position: absolute; left: 0; right: 0; top: 14px; text-align: center; padding: 0 16px; }
.rc-head small { font: 800 10px/1 system-ui; letter-spacing: .2em; color: #c9a2ff; } .rc-head h1 { margin: 4px 0; font: 900 24px/1.1 system-ui; color: #fff; text-shadow: 0 2px 0 #000; } .rc-head p { margin: 0; font-size: 12px; color: #c2bcd0; }
.rc-pity { background: linear-gradient(#1f2a22, #16201a); border: 1px solid var(--pn-gold2); border-radius: var(--pn-r); padding: 10px 12px; margin-bottom: 10px; } .rc-pity .gold { color: var(--pn-gold); } .rc-pbar { height: 10px; margin: 6px 0; }
.rc-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rc-btn { min-height: 64px; display: grid; place-content: center; gap: 3px; border-radius: 14px; border: 0; color: #fff; background: linear-gradient(#5a7fab, #2f4f78); box-shadow: 0 0 0 2px #1d3352, 0 5px 0 #1d3352, inset 0 2px 0 rgba(255,255,255,.3); }
.rc-btn.ten { color: var(--c-amber-ink); background: linear-gradient(var(--c-amber-pale), var(--c-amber) 50%, #c8712a); box-shadow: 0 0 0 2px var(--c-amber-deep), 0 5px 0 var(--c-amber-deep), inset 0 2px 0 rgba(255,255,255,.5); animation: hx-pulse 2.4s infinite; }
.rc-btn:active { transform: translateY(3px); } .rc-btn .big { font: 900 17px/1 system-ui; } .rc-btn .sub { font: 700 12px/1 system-ui; opacity: .9; }
.rc-rates { display: grid; gap: 6px; }
.rc-rate { display: grid; grid-template-columns: auto 1fr auto auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 12px; background: #141c17; border: 1px solid color-mix(in srgb, var(--rc) 45%, var(--line)); }
.rc-rate .mini { display: flex; } .rc-rate .mini > * { margin-left: -6px; border-radius: 50%; border: 1px solid var(--rc); } .rc-rate .pc { font-size: 16px; color: var(--rc); }

/* --- Reveal overlay --- */
.rv { position: fixed; inset: 0; z-index: 40; display: grid; align-content: center; justify-items: center; gap: 14px; padding: 20px 12px; background: radial-gradient(circle at 50% 45%, rgba(40,30,60,.92), rgba(0,0,0,.96)); overflow: hidden; }
.rv-rays { position: absolute; left: 50%; top: 45%; width: 900px; height: 900px; margin: -450px 0 0 -450px; background: repeating-conic-gradient(rgba(255,255,255,.06) 0 8deg, transparent 8deg 20deg); animation: rc-spin 30s linear infinite; pointer-events: none; }
.rv.best-legendary .rv-rays { background: repeating-conic-gradient(rgba(255,210,120,.16) 0 8deg, transparent 8deg 20deg); }
.rv.best-epic .rv-rays { background: repeating-conic-gradient(rgba(181,110,224,.14) 0 8deg, transparent 8deg 20deg); }
.rv-title { position: relative; text-align: center; font: 900 30px/1 system-ui; color: var(--c-amber-pale); text-shadow: 0 3px 0 var(--c-amber-deep), 0 0 20px rgba(240,180,60,.6); } .rv-title small { display: block; font: 800 11px/1 system-ui; letter-spacing: .2em; color: #c9a2ff; margin-bottom: 6px; text-shadow: none; }
.rv-grid { position: relative; display: grid; gap: 8px; } .rv-row { display: flex; justify-content: center; gap: 8px; }
.rv-card { width: 84px; aspect-ratio: 3 / 4; perspective: 600px; cursor: pointer; }
.rv.one .rv-card { width: 170px; }
.rv-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(180deg); animation: rv-flip .5s ease-out forwards; animation-delay: var(--d); }
.rv.skip .rv-in { animation-delay: 0s; animation-duration: .2s; }
@keyframes rv-flip { to { transform: rotateY(0); } }
.rv-back, .rv-front { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; overflow: hidden; }
.rv-back { transform: rotateY(180deg); display: grid; place-items: center; font-size: 30px; color: #c9a2ff; background: linear-gradient(135deg, #2a1f3a, #120c1c); border: 2px solid #5a3f7a; }
.rv-front { border: 2px solid var(--rc); box-shadow: 0 0 16px color-mix(in srgb, var(--rc) 60%, transparent); background: #0b0f0c; }
.rv-front .hc-gem { position: absolute; top: 4px; right: 4px; font-size: 9px; padding: 3px 4px; min-width: 0; }
.rv-new { position: absolute; top: 6px; left: -18px; transform: rotate(-35deg); background: var(--c-blood); color: #fff; font: 900 9px/1 system-ui; padding: 3px 20px; box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.rv-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 4px 4px; text-align: center; background: linear-gradient(transparent, rgba(0,0,0,.85) 50%); }
.rv-nm { font: 900 12px/1.1 system-ui; color: #fff; } .rv-fr { font: 700 10px/1.1 system-ui; color: var(--pn-gold); } .rv-xp { margin-top: 2px; color: #9fd0ff; }
.rv-hint { position: relative; font-size: 12px; color: var(--muted); animation: hx-pulse 1.4s infinite; } .rv.done .rv-hint { display: none; }
.rv-acts { position: relative; display: flex; gap: 10px; width: min(320px, 100%); opacity: 0; pointer-events: none; transition: opacity .3s; } .rv.done .rv-acts { opacity: 1; pointer-events: auto; }
.rv-acts button { flex: 1; min-height: 46px; font-weight: 800; }

/* --- Profile --- */
.pf-card { position: relative; display: grid; grid-template-columns: 104px 1fr; gap: 12px; align-items: center; padding: 14px 12px; margin-bottom: 10px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 15% 50%, rgba(240,180,60,.18), transparent 55%), linear-gradient(135deg, #2a3a2e, #121a15); border: 1px solid var(--pn-gold2); box-shadow: 0 6px 18px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,220,140,.15); }
.pf-ava { position: relative; width: 104px; height: 104px; border-radius: 50%; padding: 4px; background: conic-gradient(from 200deg, var(--rc, var(--c-amber)), var(--c-amber-deep), var(--rc, var(--c-amber)), var(--c-amber-pale), var(--rc, var(--c-amber))); box-shadow: 0 0 18px rgba(240,180,60,.35); }
.pf-ava > .pn-portrait, .pf-ava > img { width: 96px !important; height: 96px !important; border-radius: 50%; border: 2px solid #0b0f0c !important; object-fit: cover; object-position: top; }
.pf-ava.edit { cursor: pointer; }
.pf-ava .pen, .pf-bio .pen { position: absolute; right: 2px; bottom: 4px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; background: var(--pn-gold); color: var(--c-amber-ink); box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.pf-main { min-width: 0; display: grid; gap: 6px; }
.pf-name { display: flex; align-items: center; gap: 6px; font: 900 22px/1.1 system-ui; color: #fff; text-shadow: 0 2px 0 #000; } .pf-name > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-tag { font: 800 12px/1 system-ui; padding: 4px 6px; border-radius: 6px; background: #1d3f6e; color: #bfe0ff; }
.pf-pow { display: flex; align-items: baseline; gap: 8px; } .pf-pow small { font: 800 10px/1 system-ui; letter-spacing: .12em; color: var(--muted); } .pf-pow b { font: 900 22px/1 system-ui; color: var(--pn-gold); }
.pf-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-mini { padding: 4px 9px; font: 700 12px/1.2 system-ui; border-radius: 999px; background: var(--c-ink); border: 1px solid var(--line); } .pf-mini .cp { opacity: .7; }
.pf-bio { position: relative; padding: 10px 40px 10px 30px; margin-bottom: 12px; border-radius: 12px; background: #141c17; border: 1px dashed #3a4a3e; font-size: 14px; font-style: italic; color: #dfe8e1; cursor: pointer; }
.pf-bio.ro { cursor: default; } .pf-bio.editing { cursor: default; padding: 10px; font-style: normal; border-style: solid; }
.pf-bio .q { position: absolute; left: 8px; top: 2px; font: 900 32px/1 Georgia, serif; color: var(--pn-gold); opacity: .6; } .pf-bio .pen { top: 50%; bottom: auto; right: 8px; transform: translateY(-50%); }
.pf-bio-acts { display: flex; gap: 6px; }
.pf-sec { margin-bottom: 14px; } .pf-sec > h3 { margin: 0 0 8px; font-size: 14px; color: var(--pn-gold); text-transform: uppercase; letter-spacing: .05em; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-stat { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; background: linear-gradient(#1f2a22, #141c17); border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.pf-stat .ic { font-size: 20px; } .pf-stat b { font: 900 18px/1 system-ui; color: #fff; } .pf-stat small { font-size: 11px; color: var(--muted); }
.pf-stat.wide { grid-column: span 3; grid-template-columns: auto auto 1fr; justify-items: start; align-items: center; column-gap: 8px; padding: 10px 12px; }
.pf-stat.wide small { order: -1; } .pf-wr { justify-self: stretch; height: 8px; border-radius: 4px; background: #3a1f1f; overflow: hidden; } .pf-wr i { display: block; height: 100%; background: linear-gradient(90deg, var(--c-good), #8fe09a); }
.pf-break { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; background: #141c17; border: 1px solid var(--line); }
.pf-donut { position: relative; width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 3px #0b0f0c, 0 4px 14px rgba(0,0,0,.5); }
.pf-donut .hole { width: 84px; height: 84px; border-radius: 50%; background: #141c17; display: grid; place-content: center; text-align: center; } .pf-donut .hole small { font: 800 9px/1 system-ui; letter-spacing: .12em; color: var(--muted); } .pf-donut .hole b { font: 900 16px/1.2 system-ui; color: var(--pn-gold); }
.pf-legend { display: grid; gap: 6px; } .pf-legend .it { display: grid; grid-template-columns: 10px 1fr auto auto; gap: 6px; align-items: center; font-size: 12px; }
.pf-legend .it i { width: 10px; height: 10px; border-radius: 3px; } .pf-legend .it b { font-weight: 800; } .pf-legend .it small { color: var(--muted); min-width: 30px; text-align: right; }
.pf-trio { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 8px; margin-bottom: 8px; }
.pf-trio > div { display: grid; justify-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: linear-gradient(#1f2a22, #141c17); border: 1px solid var(--line); text-align: center; }
.pf-trio b { font: 900 17px/1.1 system-ui; } .pf-trio small { font-size: 11px; color: var(--muted); }
.pf-blds { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .pf-blds .b { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; padding: 6px 8px; border-radius: 10px; background: #141c17; border: 1px solid var(--line); font-size: 12px; }
.pf-blds .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pf-blds b { color: var(--pn-gold); }
.pf-res { margin-bottom: 8px; font-size: 13px; } .pf-res .pn-bar { height: 8px; }
.pf-tier { display: grid; grid-template-columns: 30px 1fr 56px; gap: 8px; align-items: center; margin: 4px 0; font-size: 13px; } .pf-tier .tg { font: 900 12px/1 system-ui; padding: 3px 0; text-align: center; border-radius: 6px; background: #2a3a2e; color: var(--pn-gold); } .pf-tier .pn-bar { height: 8px; margin: 0; } .pf-tier b { text-align: right; }
.pf-heroes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pf-hero { display: grid; justify-items: center; gap: 3px; padding: 10px 4px; border-radius: 12px; background: linear-gradient(#1f2a22, #141c17); border: 1px solid color-mix(in srgb, var(--rc) 60%, var(--line)); cursor: pointer; text-align: center; }
.pf-hero > .pn-portrait, .pf-hero > img { border-radius: 50%; border: 2px solid var(--rc) !important; object-fit: cover; object-position: top; } .pf-hero b { font-size: 13px; } .pf-hero small { font-size: 11px; color: var(--muted); }
.pf-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pf-pick-it { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; font-size: 12px; } .pf-pick-it.sel { border-color: var(--rc); background: #141c17; }
.pf-pick-it > .pn-portrait, .pf-pick-it > img { border-radius: 50%; border: 2px solid var(--rc) !important; object-fit: cover; object-position: top; }

/* --- Settings --- */
.st-group { margin-bottom: 14px; padding: 4px 12px; border-radius: 14px; background: linear-gradient(var(--c-panel), #141c17); border: 1px solid var(--line); }
.st-group > h3 { margin: 8px 0 2px; font-size: 12px; color: var(--pn-gold); text-transform: uppercase; letter-spacing: .08em; }
.st-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid rgba(255,255,255,.05); }
.st-group > h3 + .st-row { border-top: 0; }
.st-row .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--c-ink); border: 1px solid var(--line); }
.st-row .lb { display: grid; gap: 1px; min-width: 0; } .st-row .lb b { font-size: 15px; } .st-row .lb small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-clock { display: grid; justify-items: end; } .st-clock b { font: 800 16px/1.1 ui-monospace, Menlo, monospace; color: var(--pn-gold); } .st-clock small { font-size: 11px; color: var(--muted); }
.st-switch { position: relative; width: 52px; height: 30px; padding: 0; border-radius: 999px; background: #2a332d; border: 1px solid var(--line); transition: background .2s; }
.st-switch i { position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #cfd8d2; box-shadow: 0 2px 4px rgba(0,0,0,.4); transition: transform .2s; }
.st-switch.on { background: var(--good); } .st-switch.on i { transform: translateX(22px); background: #fff; }
.st-sel { padding: 6px 10px; border-radius: 10px; background: var(--c-ink); border: 1px solid var(--line); color: inherit; font: inherit; }
.st-about { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; padding: 10px 0 12px; }
.st-about .logo { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-size: 30px; color: var(--c-amber-ink); background: linear-gradient(135deg, var(--c-amber-pale), var(--c-amber) 50%, #c8712a); box-shadow: 0 0 0 2px var(--c-amber-deep); }
.st-about b { font-size: 17px; } .st-about .ver { color: var(--pn-gold); font-weight: 700; font-size: 13px; margin: 1px 0 3px; } .st-about small { font-size: 12px; color: var(--muted); line-height: 1.35; display: block; }
/* stat grid: 4 across, win-rate full width, trailing pair stretches so no tile is left alone */
.pf-stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pf-stat.wide { grid-column: 1 / -1; }
.pf-stats > .wide ~ .pf-stat:not(.wide) { grid-column: span 2; }
.pf-stat b { font-size: 16px; } .pf-stat small { font-size: 10px; }
.pf-stat.wide { grid-template-columns: auto auto auto 1fr; }

.hero-fb { display: grid !important; place-content: center; justify-items: center; gap: 2px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--fc) 55%, #1a1a1a), #0b0f0c 75%) !important; color: #fff; }
.hero-fb b { font-weight: 900; text-shadow: 0 1px 0 #000; line-height: 1; max-width: 92%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Large recruit batches summarize each hero instead of overflowing with 100 animated cards. */
.rv.bulk { align-content: stretch; grid-template-rows: auto minmax(0, 1fr) auto; padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.rv.bulk .rv-title { font-size: 26px; }
.rv-total { margin-top: 10px; font: 600 13px/1.4 system-ui; color: #c9a2ff; }
.rv.bulk .rv-grid { width: min(540px, 100%); min-width: 0; min-height: 0; overflow-y: auto; align-content: start; overscroll-behavior: contain; }
.rv-summary { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--rc); border-radius: 10px; background: #121a16; text-align: left; }
.rv-summary-name, .rv-summary-reward { display: grid; gap: 4px; min-width: 0; }
.rv-summary-name b { overflow-wrap: anywhere; font-size: 13px; }
.rv-summary small { font-size: 11px; color: var(--muted); }
.rv-summary-reward { text-align: right; font-size: 13px; }
.rv.bulk .rv-acts button small { display: block; margin-top: 4px; font-size: 11px; }
