/* ---------- auth / gate ---------- */
body.gated .topbar, body.gated .tabbar { display: none; }
body.gated { padding-bottom: 0; }
body.gated main { max-width: 1120px; min-height: 100vh; display: flex; align-items: center; }
.splash { width: 100%; min-height: 70vh; display: grid; place-items: center; align-content: center; gap: 10px; }
.splash img { border-radius: 18px; animation: fade .6s both; }
.auth-page { width: 100%; display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; padding: 30px 0; }
.auth-hero img { border-radius: 16px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14), 0 20px 50px rgba(255, 255, 255, .08); margin-bottom: 22px; }
.wordmark.big small { font-size: 12px; letter-spacing: .42em; }
.wordmark.big b { font-size: 52px; letter-spacing: -.05em; line-height: 1; }
.auth-hero p { color: var(--text-2); font-size: 17px; line-height: 1.55; max-width: 470px; margin: 18px 0 26px; }
.auth-feats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 520px; }
.auth-feats li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .02); font-size: 14px; color: var(--text-2); animation: rise .5s var(--ease) both; }
.auth-feats li:nth-child(2) { animation-delay: .06s; }
.auth-feats li:nth-child(3) { animation-delay: .12s; }
.auth-feats li:nth-child(4) { animation-delay: .18s; }
.auth-feats .ic { color: #fff; }
.auth-card { padding: 30px; border-color: var(--line-2); background: radial-gradient(500px 200px at 100% 0%, rgba(255, 255, 255, .06), transparent 70%), var(--panel); }
.auth-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.auth-head img { border-radius: 11px; }
.auth-head h2 { font-size: 22px; margin: 0; padding: 0; }
.auth-head p { margin: 3px 0 0; }
.auth-ic { width: 44px; height: 44px; border-radius: 12px; background: #fff; color: #000; display: grid; place-items: center; flex: none; }
.auth-tabs { width: 100%; margin-bottom: 18px; }
.auth-tabs button { flex: 1; justify-content: center; padding: 8px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.auth-form label small { font-weight: 500; font-size: 11.5px; }
.btn.big { padding: 13px 18px; font-size: 15px; border-radius: 13px; }
.form-err { display: flex; align-items: center; gap: 8px; color: var(--down); background: rgba(248, 113, 113, .08); border: 1px solid rgba(248, 113, 113, .25); padding: 9px 12px; border-radius: 10px; font-size: 13.5px; animation: rise .25s var(--ease); }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { width: 100%; aspect-ratio: 1 / 1.15; text-align: center; font-size: 26px; font-weight: 800; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 12px; outline: none; transition: border-color .2s, box-shadow .2s, transform .15s; }
.otp input:focus { border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .1); transform: translateY(-2px); }
.spin-sm { width: 15px; height: 15px; border: 2px solid rgba(0, 0, 0, .2); border-top-color: #000; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
.choice-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.choice { display: flex; align-items: center; gap: 14px; text-align: left; padding: 13px 14px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--panel-2); transition: all .2s; }
.choice:hover { border-color: #4a4a4a; background: var(--panel-3); }
.choice.on { border-color: #fff; }
.choice > .ic { width: 20px; height: 20px; flex: none; }
.choice div { display: flex; flex-direction: column; }
.choice span { font-size: 12.5px; color: var(--muted); }

/* header account chip */
#acctBtn { position: relative; }
#acctBtn:empty { display: none; }
#acctBtn.primary-chip { background: #fff; color: #000; border-color: #fff; }
#acctBtn.primary-chip .ic { color: #000; }
.avatar { --h: 0; display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; font-weight: 800; font-size: 13px; color: #000;
  background: linear-gradient(135deg, #fff, hsl(var(--h) 0% 72%)); box-shadow: 0 0 0 2px #000, 0 0 0 3px rgba(255, 255, 255, .35); }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; margin: -3px 0; }
.avatar.lg { width: 54px; height: 54px; font-size: 19px; }
.avatar.xl { width: 92px; height: 92px; font-size: 32px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); display: inline-block; flex: none; }
.sync-dot.synced { background: var(--up); box-shadow: 0 0 8px var(--up); }
.sync-dot.syncing, .sync-dot.pending { background: #fff; animation: fade .8s infinite alternate; }
.sync-dot.error, .sync-dot.conflict { background: var(--down); }
.sync-line { display: flex; align-items: center; gap: 7px; margin-top: 6px; color: var(--text-2); }
.acct-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.acct-head h3 { font-size: 18px; }
.nav-card { display: flex; align-items: center; gap: 14px; transition: border-color .2s; }
.nav-card:hover { border-color: #3d3d3d; }
.nav-card > div { flex: 1; display: flex; flex-direction: column; }
.switch { flex-direction: row !important; align-items: center; gap: 12px !important; cursor: pointer; }
.switch input { display: none; }
.switch .sw { width: 42px; height: 24px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line-2); position: relative; flex: none; transition: background .25s; }
.switch .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #777; transition: transform .25s var(--ease), background .25s; }
.switch input:checked + .sw { background: #fff; border-color: #fff; }
.switch input:checked + .sw::after { transform: translateX(18px); background: #000; }
.switch div { display: flex; flex-direction: column; gap: 2px; }
.switch b { color: var(--text); font-size: 14px; }

/* ---------- community ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.person { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); transition: border-color .2s, transform .3s var(--ease); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.person:hover { border-color: #3d3d3d; transform: translateY(-3px); }
.p-top { display: flex; align-items: center; gap: 12px; }
.p-name { display: flex; flex-direction: column; min-width: 0; }
.p-name span { color: var(--muted); font-size: 13px; }
.p-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.p-thumbs img, .p-thumbs span { width: 100%; aspect-ratio: 63 / 88; border-radius: 6px; object-fit: cover; background: var(--panel-3); }
.p-stats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.p-stats div, .ph-stats div { display: flex; flex-direction: column; }
.p-stats span, .ph-stats span { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.p-stats b { font-size: 15px; }
.profile-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding: 26px; border-radius: 22px; border: 1px solid var(--line-2); background: radial-gradient(600px 220px at 0% 0%, rgba(255, 255, 255, .08), transparent 70%), var(--panel); animation: rise .5s var(--ease) both; }
.ph-main { flex: 1; min-width: 200px; }
.ph-main h1 { font-size: 30px; letter-spacing: -.04em; }
.ph-bio { margin: 10px 0 0; color: var(--text-2); }
.ph-stats { display: grid; grid-template-columns: repeat(4, auto); gap: 26px; }
.ph-stats b { font-size: 22px; letter-spacing: -.03em; }

@media (max-width: 900px) {
  .auth-page { grid-template-columns: 1fr; gap: 26px; }
  .auth-hero { text-align: center; }
  .auth-hero img { margin: 0 auto 18px; }
  .auth-hero .wordmark { align-items: center; }
  .auth-hero p { margin: 14px auto 0; }
  .auth-feats { display: none; }
}
@media (max-width: 760px) {
  .wordmark.big b { font-size: 40px; }
  .auth-card { padding: 22px 18px; }
  .ph-stats { grid-template-columns: repeat(2, 1fr); gap: 14px; width: 100%; }
  .profile-hero { padding: 20px; gap: 16px; }
  .avatar.xl { width: 70px; height: 70px; font-size: 25px; }
}

/* username availability */
.uname-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; transition: color .2s; }
.uname-hint.good { color: var(--up); }
.uname-hint.bad { color: var(--down); }
.input.good { border-color: rgba(74, 222, 128, .55); }
.input.bad { border-color: rgba(248, 113, 113, .6); }
.spin-sm.light { width: 11px; height: 11px; border-color: rgba(255, 255, 255, .2); border-top-color: #fff; }

/* ---------- avatar photo + centered settings ---------- */
.avatar { overflow: hidden; background: linear-gradient(135deg, #fff, #9a9a9a); line-height: 1; }
.avatar.has-img { background: #111; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.narrow-page { max-width: 820px; margin: 0 auto; }
.narrow-page .stack { display: grid; gap: 14px; }
.acct-panel { padding: 24px; }
.acct-head { display: flex; align-items: center; gap: 20px; flex-wrap: nowrap; }
.acct-id { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.acct-id h3 { font-size: 22px; letter-spacing: -.02em; }
.acct-id .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-actions { margin-top: 10px; gap: 8px; }
.acct-head > .btn { align-self: flex-start; }
.avatar-edit { position: relative; cursor: pointer; flex: none; border-radius: 50%; }
.avatar-edit .avatar.xl { width: 88px; height: 88px; font-size: 30px; }
.ae-cam {
  position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; color: #000; display: grid; place-items: center; box-shadow: 0 0 0 3px var(--panel);
  transition: transform .2s var(--ease);
}
.ae-cam .ic { width: 15px; height: 15px; }
.avatar-edit:hover .ae-cam { transform: scale(1.12); }
.avatar-edit::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .2s; }
.avatar-edit:hover::after { opacity: 1; }
.avatar-edit.busy::after { opacity: 1; background: rgba(0, 0, 0, .6) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'%3E%3Ccircle cx='25' cy='25' r='18' fill='none' stroke='%23fff' stroke-width='4' stroke-dasharray='80 40'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 25 25' to='360 25 25' dur='.8s' repeatCount='indefinite'/%3E%3C/circle%3E%3C/svg%3E") center / 40% no-repeat; }
.acct-panel .form-grid { margin-top: 22px !important; padding-top: 20px; border-top: 1px solid var(--line); }
#acctBtn .avatar.sm { width: 26px; height: 26px; box-shadow: none; }
@media (max-width: 760px) {
  .acct-head { flex-wrap: wrap; gap: 14px; }
  .acct-head > .btn { order: 3; }
  .avatar-edit .avatar.xl { width: 72px; height: 72px; font-size: 25px; }
  .acct-id h3 { font-size: 19px; }
}

/* ---------- filters, set art, image fallback ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0 6px; }
.filters .search-box { flex: 1 1 260px; }
.filters select.input { width: auto; flex: 0 1 auto; min-width: 0; max-width: 100%; }
.check-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); font-size: 14px; font-weight: 600; cursor: pointer; user-select: none; }
.check-pill input { accent-color: #fff; width: 16px; height: 16px; }
.load-note { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); padding: 10px 14px; border-radius: 10px; border: 1px dashed var(--line-2); margin: 8px 0 14px; }
.set-head-right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.set-logo .logo-img { position: relative; z-index: 1; }
.art-slot { position: absolute; inset: 0; display: grid; place-items: center; }
.set-art { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.set-art img {
  position: absolute; height: 92%; aspect-ratio: 63 / 88; object-fit: cover; border-radius: 6px;
  transform: translateX(calc(var(--k) * 34%)) rotate(calc(var(--k) * 9deg)) translateY(calc(var(--k) * var(--k) * 4%));
  box-shadow: 0 8px 22px rgba(0, 0, 0, .65); transition: transform .45s var(--ease);
}
.set-art img:nth-child(2) { z-index: 1; }
.set-card:hover .set-art img { transform: translateX(calc(var(--k) * 46%)) rotate(calc(var(--k) * 13deg)) translateY(calc(var(--k) * var(--k) * 6%)); }
.set-logo .txt.over { position: absolute; left: 8px; right: 8px; bottom: 10px; z-index: 2; font-size: 13px; text-shadow: 0 2px 8px #000; }
.set-logo .txt.over { background: rgba(0, 0, 0, .55); border-radius: 8px; padding: 4px 8px; backdrop-filter: blur(4px); }
.noimg[data-img-for]:not(.none) { background: linear-gradient(110deg, var(--panel-2) 30%, #222 50%, var(--panel-2) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.noimg[data-img-for]:not(.none) span { opacity: 0; }
.noimg span { padding: 8px; }
@media (max-width: 760px) {
  .filters select.input { flex: 1 1 45%; }
  .set-head-right { align-items: flex-start; text-align: left; width: 100%; }
}
.set-logo .txt { font-size: clamp(13px, 2.2vw, 19px); overflow-wrap: anywhere; text-align: center; line-height: 1.15; padding: 0 6px; }
.set-art img { height: 88%; }

/* graded items without a valuation */
.muted-price { color: var(--muted) !important; font-size: 14px !important; display: flex; align-items: center; gap: 6px; }
.raw-tag { font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line-2); color: var(--muted); }
.set-val { margin-top: 6px; display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 9px; border: 1px dashed rgba(255,255,255,.45); background: transparent; color: #fff; transition: background .2s, color .2s; }
.set-val:hover { background: #fff; color: #000; border-style: solid; }
.warn { color: #fbbf24; font-weight: 600; }
.grade-links { gap: 6px; margin-top: 8px; }

.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; padding: 14px 16px; border: 1px solid rgba(248,113,113,.25); border-radius: 12px; background: rgba(248,113,113,.04); flex-wrap: wrap; }
.danger-zone > div { display: flex; flex-direction: column; gap: 2px; }
