/* Shared hub styles: section headers, sub-navigation, dialogs, gates */
.hub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hub-head .muted { font-size: 13px; }
.hub-head code, .shop-group code, .pf-bio code { background: var(--bg-2); padding: 1px 6px; border-radius: 5px; color: var(--pink); font-size: 12.5px; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: #ff5b6e66; }
.hub-dlg { position: relative; width: min(460px, 100%); max-height: min(86vh, 680px); display: flex; flex-direction: column; gap: 14px; padding: 22px; overflow-y: auto; transform: translateY(12px) scale(.98); transition: transform .2s; }
.modal-backdrop.open .hub-dlg { transform: none; }
.hub-dlg h3 { font-family: var(--font-display); font-size: 20px; padding-right: 40px; }
.hub-dlg-actions { display: flex; gap: 8px; justify-content: flex-end; }
.hub-dlg-actions .btn:last-child { flex: 1; }
.hub-dlg-actions .btn:only-child { flex: 0 0 auto; }
.dlg-item { display: flex; align-items: center; gap: 12px; }
.dlg-item b { display: block; font-size: 15px; }
.dlg-item small { font-size: 13px; color: var(--text-2); }
.dlg-lines { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.dlg-lines div { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 14px; color: var(--text-2); }
.dlg-lines div + div { border-top: 1px solid var(--line); }
.dlg-lines b { color: var(--text); font-variant-numeric: tabular-nums; }
.dlg-price { font-family: var(--font-display); font-size: 28px; font-weight: 800; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.dlg-price small { font-size: 13px; }
.dlg-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin-bottom: -8px; }
.dlg-rewards { list-style: none; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); font-size: 14px; }
.dlg-desc { font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.dlg-desc b { color: var(--text); }
.dlg-note { padding-top: 4px; font-size: 12px; color: var(--text-3); }
@media (max-width: 760px) {
  .hub-dlg { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
.shop-group + .shop-group, .hub-group + .hub-group { margin-top: 32px; }

/* Sub-navigation inside a section (e.g. Battle → Teams / Tower / Raid) */
.subnav { display: flex; gap: 6px; margin: -6px 0 18px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav button { flex-shrink: 0; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.subnav button:hover { color: var(--text); border-color: var(--line-2); }
.subnav button.active { color: var(--text); border-color: var(--pink); background: linear-gradient(180deg, #ff4db31f, var(--panel)); }
.subnav button .i { font-size: 15px; line-height: 1; }
.subnav button .n { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--pink); color: #fff; font-size: 10.5px; font-weight: 800; }

/* Sign-in / create-profile prompt shown in place of auth-only content */
.hub-gate { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; text-align: center; }
.hub-gate .ic { font-size: 40px; }
.hub-gate h3 { font-family: var(--font-display); font-size: 20px; }
.hub-gate p { color: var(--text-2); font-size: 14px; max-width: 460px; }
.hub-gate .btn { margin-top: 6px; }

/* Player picker */
.user-pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.user-pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.user-pick:hover { border-color: var(--pink); }
.user-pick img { width: 32px; height: 32px; border-radius: 50%; }
.user-pick b { font-size: 14px; }
.user-pick small { margin-left: auto; color: var(--text-3); font-size: 12px; }

/* Small shared building blocks */
.hub-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.hub-kv { padding: 12px 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.hub-kv label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.hub-kv b { font-family: var(--font-display); font-size: 20px; }
.hub-kv small { font-size: 12px; color: var(--text-2); }
.hub-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.hub-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.hub-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.hub-table tr:last-child td { border-bottom: none; }
.hub-table tr.me td { background: #ff4db30f; }
.hub-bar { height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.hub-bar > span { display: block; height: 100%; border-radius: inherit; background: var(--brand-grad); transition: width .4s; }
.hub-dlg.wide { width: min(760px, 100%); }
.switch { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line-2); transition: background .2s, border-color .2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-3); transition: transform .2s, background .2s; }
.switch input:checked + i { background: var(--pink); border-color: var(--pink); }
.switch input:checked + i::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + i { box-shadow: 0 0 0 3px #a855f740; }
.hub-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.hub-pad { padding: 18px; }
.hub-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hub-chip { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); font-size: 12px; color: var(--text-2); }
