:root {
  --bg: hsl(270 25% 6%);
  --bg-2: hsl(270 22% 9%);
  --panel: hsl(270 20% 11% / 0.75);
  --panel-solid: hsl(270 20% 11%);
  --line: hsl(280 20% 100% / 0.08);
  --line-strong: hsl(280 20% 100% / 0.16);
  --text: hsl(300 20% 96%);
  --muted: hsl(280 10% 68%);
  --dim: hsl(280 8% 50%);
  --accent: hsl(330 85% 66%);
  --accent-2: hsl(275 80% 70%);
  --gold: hsl(42 95% 62%);
  --green: hsl(155 60% 55%);
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
  --radius: 14px;
  --sidebar-w: 320px;
  --shadow: 0 10px 40px hsl(280 60% 2% / 0.6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.grid[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 10% -10%, hsl(330 80% 50% / 0.18), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, hsl(270 80% 55% / 0.16), transparent 60%),
    radial-gradient(700px 600px at 50% 120%, hsl(300 70% 40% / 0.12), transparent 60%);
}

button { font-family: inherit; color: inherit; cursor: pointer; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 28px;
  background: hsl(270 25% 6% / 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; }
.brand h1 {
  margin: 0; font-family: "Playfair Display", serif; font-weight: 600;
  font-size: 28px; letter-spacing: 0.04em;
}
.brand h1 em {
  font-style: italic; font-weight: 500;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { color: var(--muted); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }

.stats { display: flex; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.stat {
  padding: 6px 14px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.stat b { color: var(--text); font-weight: 600; margin-right: 4px; }
.stat .bar {
  display: inline-block; vertical-align: middle; width: 70px; height: 5px; margin-left: 8px;
  border-radius: 99px; background: var(--line-strong); overflow: hidden;
}
.stat .bar i { display: block; height: 100%; background: var(--grad); }
.stat-btn { font-family: inherit; cursor: pointer; transition: border-color .15s, color .15s; }
.stat-btn::after { content: " ›"; color: var(--accent); }
.stat-btn:hover { border-color: var(--accent); color: var(--text); }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: calc(100vh - 62px); }

.sidebar {
  position: sticky; top: 62px; align-self: start;
  height: calc(100vh - 62px); overflow-y: auto;
  padding: 20px 18px 40px;
  border-right: 1px solid var(--line);
  background: hsl(270 22% 8% / 0.6);
  scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sidebar-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0.04em; }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 13px; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

.filter-block { margin-bottom: 16px; }
.field-label {
  display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--dim); margin-bottom: 6px;
}
.field-label.inline { display: inline; margin: 0 6px 0 0; }

.input {
  width: 100%; padding: 9px 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
  color: var(--text); font: inherit; font-size: 14px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px hsl(330 85% 66% / 0.18); }
.select { width: auto; padding-right: 28px; cursor: pointer; }

.segmented {
  display: flex; padding: 3px; gap: 3px; border-radius: 11px;
  background: var(--bg-2); border: 1px solid var(--line-strong);
}
.segmented button {
  flex: 1; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px;
  font-size: 13px; color: var(--muted); transition: background .15s, color .15s;
}
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--grad); color: white; font-weight: 500; }

/* ---------- Trait groups ---------- */
.trait-group { border-top: 1px solid var(--line); }
.trait-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: none; border: 0; padding: 12px 4px; text-align: left; font-size: 14px; font-weight: 500;
}
.trait-head:hover { color: var(--accent); }
.trait-head .count { color: var(--dim); font-weight: 400; font-size: 12px; }
.trait-head .sel {
  font-size: 11px; padding: 1px 7px; border-radius: 99px; background: var(--grad); color: white;
}
.trait-head .chev { margin-left: auto; transition: transform .2s; color: var(--dim); }
.trait-group.open .chev { transform: rotate(90deg); }
.trait-values { display: none; padding: 0 0 10px; max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.trait-group.open .trait-values { display: block; }

.tv {
  display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 7px;
  font-size: 13px; cursor: pointer; user-select: none;
}
.tv:hover { background: hsl(0 0% 100% / 0.04); }
.tv input { accent-color: var(--accent); margin: 0; width: 15px; height: 15px; cursor: pointer; }
.tv .tv-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv .tv-count { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 12px; }
.tv.zero { opacity: 0.35; }
.tv.none-val .tv-name { font-style: italic; color: var(--muted); }

/* ---------- Content ---------- */
.content { padding: 20px 28px 60px; min-width: 0; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.result-count { font-size: 15px; color: var(--muted); }
.result-count b { color: var(--text); font-size: 20px; font-weight: 600; margin-right: 4px; }
.size-toggle button { flex: 0; padding: 6px 11px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; min-height: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 12px; border-radius: 999px; font-size: 12.5px;
  background: hsl(330 85% 66% / 0.12); border: 1px solid hsl(330 85% 66% / 0.35);
  animation: pop .18s ease-out;
}
.chip span { color: var(--muted); }
.chip button {
  border: 0; background: hsl(0 0% 100% / 0.1); width: 18px; height: 18px; border-radius: 50%;
  font-size: 12px; line-height: 1; display: grid; place-items: center;
}
.chip button:hover { background: var(--accent); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Grid & cards ---------- */
.grid { display: grid; gap: 16px; }
.grid.size-s { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.grid.size-m { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grid.size-l { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 20px; }

.card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  background: var(--panel-solid); border: 1px solid var(--line);
  cursor: pointer; text-align: left; padding: 0;
  transition: transform .2s ease, border-color .2s, box-shadow .2s;
  animation: fadeUp .35s ease-out both;
}
.card:hover { transform: translateY(-4px); border-color: hsl(330 85% 66% / 0.5); box-shadow: var(--shadow); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card .img-wrap { aspect-ratio: 2 / 3; background: linear-gradient(110deg, var(--bg-2) 30%, hsl(270 20% 14%) 50%, var(--bg-2) 70%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; overflow: hidden; }
.card .img-wrap.loaded { animation: none; background: var(--bg-2); }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .35s, transform .4s; }
.card .img-wrap.loaded img { opacity: 1; }
.card:hover img { transform: scale(1.04); }
@keyframes shimmer { to { background-position: -200% 0; } }

.card-info { padding: 10px 12px 12px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card-id { font-weight: 600; font-size: 15px; }
.card-rank { font-size: 11.5px; color: var(--dim); }
.grid.size-s .card-info { padding: 7px 8px; }
.grid.size-s .card-id { font-size: 13px; }
.grid.size-s .card-rank { display: none; }

.badges { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.badge {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 99px; backdrop-filter: blur(8px);
}
.badge.minted { background: hsl(0 0% 0% / 0.55); color: var(--muted); border: 1px solid var(--line-strong); }
.badge.unminted { background: hsl(155 60% 30% / 0.65); color: hsl(155 80% 88%); border: 1px solid hsl(155 60% 55% / 0.5); }
.badge.oneofone { background: linear-gradient(135deg, var(--gold), hsl(25 95% 60%)); color: hsl(30 60% 12%); margin-left: auto; }
.grid.size-s .badge { font-size: 9px; padding: 2px 6px; }

.card.is-1of1 { border-color: hsl(42 95% 62% / 0.55); box-shadow: 0 0 0 1px hsl(42 95% 62% / 0.2), 0 0 24px hsl(42 95% 62% / 0.12); }

.sentinel { height: 1px; }
.empty { text-align: center; padding: 80px 20px; color: var(--muted); }

.btn {
  border: 0; padding: 10px 18px; border-radius: 10px; background: var(--grad); color: white;
  font-weight: 500; font-size: 14px; transition: filter .15s, transform .15s;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-ghost { background: var(--panel); border: 1px solid var(--line-strong); }

/* ---------- Modal ---------- */
.modal {
  width: min(1080px, 94vw); max-height: 92vh; padding: 0; border: 1px solid var(--line-strong);
  border-radius: 20px; background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow);
  overflow: visible;
}
.modal[open] { animation: modalIn .22s ease-out; }
.modal::backdrop { background: hsl(270 40% 3% / 0.75); backdrop-filter: blur(6px); }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

.modal-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); max-height: 92vh; border-radius: 20px; overflow: hidden; }
.modal-img { background: var(--bg); display: flex; align-items: center; justify-content: center; }
.modal-img img { width: 100%; height: 100%; max-height: 92vh; object-fit: contain; display: block; }
.modal-info { padding: 28px 30px; overflow-y: auto; }
.modal-info h3 { margin: 0 0 4px; font-family: "Playfair Display", serif; font-size: 30px; font-weight: 600; }
.modal-sub { color: var(--muted); font-size: 14px; margin-bottom: 18px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal-sub .badge { position: static; }

.mint-box {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; font-size: 13.5px;
  background: var(--bg-2); border: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
}
.mint-box dt { color: var(--dim); }
.mint-box dd { margin: 0; overflow: hidden; text-overflow: ellipsis; }
.mint-box a { color: var(--accent); text-decoration: none; }
.mint-box a:hover { text-decoration: underline; }

.trait-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trait-cell {
  padding: 9px 11px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line);
  text-align: left; transition: border-color .15s, background .15s;
}
.trait-cell:hover { border-color: var(--accent); background: hsl(330 85% 66% / 0.08); }
.trait-cell.other-trait { cursor: default; }
.trait-cell.other-trait:hover { border-color: var(--line); background: var(--bg-2); }
.trait-cell .tt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
.trait-cell .tv2 { font-size: 14px; font-weight: 500; margin: 2px 0; word-break: break-word; }
.trait-cell .tp { font-size: 11.5px; color: var(--muted); }
.trait-cell .tp.rare { color: var(--gold); }
.modal-desc {
  margin: 0 0 16px; font-size: 13.5px; line-height: 1.55; color: var(--muted);
  white-space: pre-line; max-height: 140px; overflow-y: auto; padding-right: 4px;
}
.modal-actions {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 18px;
  padding-top: 16px; border-top: 1px solid var(--line);
}
.modal-ph {
  width: 100%; min-height: 280px; display: grid; place-content: center; justify-items: center; gap: 8px;
  color: white; text-shadow: 0 1px 6px hsl(0 0% 0% / 0.4); padding: 40px 20px;
}
.modal-ph b { font-size: 48px; font-weight: 700; letter-spacing: .04em; }
.modal-ph span { font-size: 13px; opacity: .85; }
.copy-contract-btn {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 2px 6px; font-size: 11px; margin-left: 6px; cursor: pointer; color: var(--muted);
}
.copy-contract-btn:hover { color: var(--text); border-color: var(--line-strong); }
.modal-hint { margin-top: 14px; font-size: 12px; color: var(--dim); }

.modal-close, .modal-nav {
  position: absolute; z-index: 2; border: 1px solid var(--line-strong);
  background: hsl(270 20% 11% / 0.85); backdrop-filter: blur(8px);
  width: 40px; height: 40px; border-radius: 50%; font-size: 22px; line-height: 1;
  display: grid; place-items: center; transition: background .15s;
}
.modal-close:hover, .modal-nav:hover { background: var(--accent); }
.modal-close { top: 12px; right: 12px; }
.modal-nav { top: 50%; transform: translateY(-50%); }
.modal-nav.prev { left: -56px; }
.modal-nav.next { right: -56px; }

.mobile-only { display: none; }

/* ---------- Live sync ---------- */
.live {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 6px 14px; border-radius: 999px; font-size: 12.5px; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line); transition: border-color .15s;
}
.live:hover { border-color: var(--line-strong); color: var(--text); }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); position: relative; }
.live.ok .dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--green);
  animation: ping 2s ease-out infinite;
}
.live.syncing .dot { background: var(--accent-2); animation: blink .8s ease-in-out infinite alternate; }
.live.error .dot { background: hsl(15 90% 60%); }
@keyframes ping { to { transform: scale(2.6); opacity: 0; } }
@keyframes blink { to { opacity: .3; } }

.badge.fresh {
  background: var(--grad); color: white; border: 1px solid hsl(330 85% 80% / 0.6);
  box-shadow: 0 0 14px hsl(330 85% 66% / 0.6);
}
.card.flash { animation: flash 1.6s ease-out 2; }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 hsl(330 85% 66% / 0.8); }
  100% { box-shadow: 0 0 0 14px hsl(330 85% 66% / 0); }
}

.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: 420px;
  padding: 14px 18px; border-radius: 14px; font-size: 14px;
  background: var(--panel-solid); border: 1px solid hsl(330 85% 66% / 0.5);
  box-shadow: var(--shadow); animation: toastIn .3s ease-out; transition: opacity .5s, transform .5s;
}
.toast b { display: block; margin-bottom: 2px; color: var(--accent); }
.toast.gold { border-color: var(--gold); }
.toast.gold b { color: var(--gold); }
.toast.out { opacity: 0; transform: translateY(10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Mint Button ---------- */
.mint-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--grad); color: white; text-decoration: none;
  font-weight: 600; font-size: 13.5px; white-space: nowrap;
  box-shadow: 0 2px 14px hsl(330 85% 66% / 0.35);
  transition: transform .15s, filter .15s, box-shadow .15s;
}
.mint-btn:hover {
  filter: brightness(1.12); transform: translateY(-1px);
  box-shadow: 0 4px 20px hsl(330 85% 66% / 0.5);
}

/* ---------- Wallet ---------- */
.wallet-btn { padding: 8px 16px; white-space: nowrap; }
.wallet-btn.connected {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 6px 5px 6px;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--line-strong); font-size: 13.5px;
  transition: border-color .15s;
}
.wallet-btn.connected:hover { border-color: var(--accent); }
.wallet-btn.wrong { border-color: hsl(15 90% 60% / 0.7); }
.avatar { display: inline-block; width: 24px; height: 24px; border-radius: 50%; flex: none; }
.avatar.lg { width: 48px; height: 48px; }
.wb-count {
  min-width: 26px; padding: 2px 9px; border-radius: 99px; background: var(--grad); color: white;
  font-weight: 600; font-size: 12px; text-align: center;
}
.wb-count.warn { background: hsl(15 90% 55%); }
.warn { color: hsl(25 95% 65%); }

.card.is-owned { border-color: hsl(275 80% 70% / 0.6); }
.own-tag {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 99px;
  background: hsl(275 80% 70% / 0.18); color: hsl(275 90% 82%); font-weight: 600; font-size: 10.5px;
}

.wallet-modal, .wallet-picker {
  padding: 0; border: 1px solid var(--line-strong); border-radius: 20px;
  background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow);
}
.wallet-modal[open], .wallet-picker[open] { animation: modalIn .22s ease-out; }
.wallet-modal::backdrop, .wallet-picker::backdrop { background: hsl(270 40% 3% / 0.75); backdrop-filter: blur(6px); }
.wallet-modal { width: min(880px, 94vw); max-height: 90vh; }
.wallet-body { padding: 26px 28px 0; max-height: 90vh; overflow-y: auto; }

.wallet-picker { width: min(400px, 92vw); padding: 24px; }
.wallet-picker h3 { margin: 0 0 16px; font-size: 18px; font-weight: 600; }
.wp-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; margin-bottom: 8px;
  border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); text-align: left;
  font-size: 15px; color: var(--text); text-decoration: none; transition: border-color .15s, background .15s;
}
.wp-item:hover { border-color: var(--accent); background: hsl(330 85% 66% / 0.08); }
.wp-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--grad); font-weight: 700; }
.wp-icon.ph { background: hsl(255 80% 70%); }
.wp-icon.mm { background: hsl(28 95% 55%); }
.wp-empty { margin: 0 0 6px; font-weight: 500; }
.wp-hint { color: var(--muted); font-size: 14px; margin: 0 0 14px; }

.wp-header { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-right: 40px; }
.wp-id { flex: 1; min-width: 0; }
.wp-addr { display: flex; align-items: center; gap: 6px; }
.wp-addr code { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wp-meta { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-top: 3px; flex-wrap: wrap; }
.wp-meta img { width: 16px; height: 16px; border-radius: 4px; }
.wp-actions { display: flex; gap: 8px; }
.btn.sm { padding: 7px 12px; font-size: 13px; }
.icon-btn { border: 0; background: none; color: var(--muted); font-size: 15px; padding: 2px 4px; }
.icon-btn:hover { color: var(--accent); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.wtabs { display: flex; gap: 6px; margin: 20px 0 12px; border-bottom: 1px solid var(--line); }
.wtabs button {
  border: 0; background: none; padding: 10px 14px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.wtabs button span { color: var(--dim); margin-left: 4px; font-size: 12px; }
.wtabs button.active { color: var(--text); border-bottom-color: var(--accent); }

.wtoolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 13px; }
.wt-count { color: var(--muted); }
.wtoolbar .right { margin-left: auto; }
.link-btn:disabled { opacity: .4; cursor: default; text-decoration: none; }

.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.wgrid.small { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.wcard {
  position: relative; display: block; padding: 0; border-radius: 12px; overflow: hidden;
  background: var(--bg-2); border: 2px solid var(--line); aspect-ratio: 2 / 3; cursor: pointer;
  transition: border-color .15s, transform .15s; color: var(--text); text-decoration: none;
}
.wcard:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.wcard.sel { border-color: var(--accent); box-shadow: 0 0 0 3px hsl(330 85% 66% / 0.25); }
.wcard.gold { border-color: hsl(42 95% 62% / 0.6); }
.wcard.gold.sel { border-color: var(--accent); }
.wcard.other { aspect-ratio: 1; }
.wcard img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wcard .badge { position: absolute; top: 6px; right: 6px; font-size: 9px; padding: 2px 6px; }
.wcard.gold .badge { top: 6px; left: 38px; right: auto; z-index: 3; }
.wcheck {
  position: absolute; top: 0; left: 0; width: 38px; height: 38px;
  display: grid; place-items: center; z-index: 3;
}
.wcheck::before {
  content: ""; position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 6px;
  background: hsl(0 0% 0% / 0.55); border: 1.5px solid hsl(0 0% 100% / 0.6); backdrop-filter: blur(4px);
  transition: background .15s, border-color .15s;
}
.wcard.sel .wcheck::before { background: var(--accent); border-color: var(--accent); }
.wcheck span { position: relative; z-index: 1; font-size: 13px; font-weight: 700; margin: -2px 0 0 -2px; }
.wcard-info {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px;
  display: flex; justify-content: space-between; align-items: end; gap: 4px; font-size: 11px;
  background: linear-gradient(transparent, hsl(270 30% 4% / 0.9)); color: var(--muted); text-align: left;
}
.wcard-info b { color: var(--text); font-size: 12.5px; font-weight: 600; }
/* Dedicated Open details corner button: large, generous corner target (42x42px) */
.wdetail {
  position: absolute; top: 0; right: 0; width: 42px; height: 42px;
  display: grid; place-items: center; z-index: 4; cursor: pointer;
  opacity: 1 !important; color: var(--text); background: transparent; border: 0; padding: 0;
}
.wdetail::before {
  content: ""; position: absolute; top: 0; right: 0; width: 32px; height: 32px;
  background: hsl(270 30% 9% / 0.88);
  border-bottom-left-radius: 14px;
  border-left: 1px solid hsl(0 0% 100% / 0.35);
  border-bottom: 1px solid hsl(0 0% 100% / 0.35);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: -1px 2px 6px hsl(0 0% 0% / 0.35);
  transition: background .15s, border-color .15s, transform .15s;
}
.wdetail i, .wdetail span {
  position: relative; z-index: 1; font-style: italic; font-weight: 700; font-size: 13.5px;
  transform: translate(2px, -2px); text-shadow: 0 1px 3px rgba(0,0,0,0.6);
  color: #fff;
}
.wdetail:hover::before, .wdetail:active::before {
  background: var(--accent);
  border-color: hsl(330 85% 75%);
  transform: scale(1.08);
}

.wgroup { margin-bottom: 20px; }
.wgroup h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.wgroup h4 span { color: var(--dim); font-weight: 400; margin-left: 0; }
.wgroup h4 .gsel { margin-left: auto; font-size: 12.5px; font-weight: 500; }
.spam-tag {
  font-style: normal; font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 99px;
  background: hsl(15 90% 55% / 0.18); color: hsl(20 95% 70%);
}
.wempty { color: var(--muted); text-align: center; padding: 40px 0; }
.wnote { color: var(--dim); font-size: 12px; margin: 12px 0; }
.wwarn { font-size: 13px; margin: 0 0 12px; }

/* Other NFTs: placeholder until (or instead of) the image */
.wcard.other img { position: absolute; inset: 0; z-index: 1; }
.wph {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 4px;
  opacity: .55; color: white; text-shadow: 0 1px 6px hsl(0 0% 0% / 0.4);
}
.wph b { font-size: 22px; font-weight: 700; letter-spacing: .04em; }
.wph i { font-style: normal; font-size: 10px; opacity: .9; }
.wcard.other:not(.has-img):not(.no-img) .wph { animation: blink 1s ease-in-out infinite alternate; }
.wcard.has-img .wph { display: none; }
.wcard.no-img img { display: none !important; }
.wcard.other .wcheck, .wcard.other .wcard-info, .wcard.other .wdetail { z-index: 3; }
.wstrip-ph {
  width: 52px; height: 78px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--grad); color: white; font-weight: 700; font-size: 13px; padding: 0 !important;
}
.wstrip-ph.sm { width: 34px; height: 50px; font-size: 11px; border-radius: 6px; }

.wfooter {
  position: sticky; bottom: 0; z-index: 5; margin: 16px -28px 0; padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: hsl(270 20% 11% / 0.92); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); transform: none; }
.btn.wide { width: 100%; padding: 13px; font-size: 15px; margin-top: 6px; }

.back { margin-bottom: 8px; padding: 0; }
.wtitle { margin: 4px 0 12px; font-family: "Playfair Display", serif; font-size: 26px; font-weight: 600; }
.wstrip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; align-items: center; }
.wstrip img { width: 52px; height: 78px; object-fit: cover; border-radius: 8px; flex: none; }
.wstrip span { color: var(--muted); font-size: 13px; padding: 0 8px; }
.wids { color: var(--muted); font-size: 12.5px; margin: 6px 0 18px; word-break: break-word; }
.input.mono { font-size: 14px; }
.rcheck { min-height: 22px; margin: 8px 0 14px; font-size: 13px; word-break: break-all; }
.rcheck.ok { color: var(--green); }
.rcheck.bad { color: hsl(5 85% 65%); }
.rinfo { color: hsl(42 95% 66%); margin-top: 6px; word-break: normal; }
.wmode {
  padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--muted); margin-bottom: 14px;
}
.wmode b { color: var(--text); }
.wconfirm { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin-bottom: 12px; cursor: pointer; }
.wconfirm input { accent-color: var(--accent); width: 17px; height: 17px; margin-top: 1px; flex: none; }

.psummary { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pill { padding: 4px 10px; border-radius: 99px; font-size: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.pill.done { color: var(--green); border-color: hsl(155 60% 55% / 0.4); }
.pill.failed { color: hsl(5 85% 65%); border-color: hsl(5 85% 65% / 0.4); }
.pill.pending, .pill.waiting { color: var(--accent-2); }
.plist { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.plist li {
  display: grid; grid-template-columns: 34px 56px 1fr auto auto; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px;
}
.plist img { width: 34px; height: 50px; object-fit: cover; border-radius: 6px; }
.pnote { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist a { color: var(--accent); text-decoration: none; font-size: 12px; }
.pstate { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.plist li.done .pstate { color: var(--green); }
.plist li.failed .pstate { color: hsl(5 85% 65%); }
.plist li.waiting { border-color: var(--accent); }
.plist li.waiting .pstate, .plist li.pending .pstate { color: var(--accent-2); }

/* ---------- Holders ---------- */
.holders-btn { display: none; align-items: center; gap: 6px; padding: 7px 10px 7px 14px; white-space: nowrap; font-size: 13.5px; }
.holders-btn .wb-count:empty { display: none; }
.you-tag {
  display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 10.5px; font-weight: 600;
  background: hsl(275 80% 70% / 0.18); color: hsl(275 90% 82%); vertical-align: middle;
}
.avatar.sm { width: 16px; height: 16px; vertical-align: middle; }
.hb-loading { color: var(--accent-2); animation: blink .9s ease-in-out infinite alternate; }

.holder-banner {
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; padding: 14px 16px;
  border-radius: var(--radius); border: 1px solid hsl(275 80% 70% / 0.35);
  background: linear-gradient(120deg, hsl(330 85% 66% / 0.10), hsl(275 80% 70% / 0.08)), var(--panel);
  animation: pop .2s ease-out;
}
.holder-banner[hidden] { display: none; }
.hb-top { display: flex; align-items: center; gap: 16px; width: 100%; }
.hb-id { flex: 1; min-width: 0; }
.hb-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); margin-bottom: 2px; }
.holder-banner .wp-addr code { font-size: 14.5px; }
.hb-info { color: var(--muted); font-size: 13.5px; margin-top: 3px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hb-info b { color: var(--text); font-size: 15px; }
.hb-info .badge, .hl-addr .badge { position: static; font-size: 10px; padding: 2px 7px; margin: 0; }
.hb-actions { display: flex; align-items: center; gap: 6px; }
.hb-step { font-size: 22px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-strong); line-height: 1; }
.hb-step:disabled { opacity: .3; cursor: default; color: var(--muted); }
.hb-close { font-size: 22px; }
.hb-tabs { display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; width: 100%; flex-wrap: wrap; }
.hb-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--muted);
  font-size: 13.5px; font-weight: 500; cursor: pointer; transition: all .15s ease;
}
.hb-tab span {
  font-size: 11px; padding: 2px 7px; border-radius: 99px; background: var(--line); color: var(--text); font-weight: 600;
}
.hb-tab:hover { background: var(--panel-solid); color: var(--text); border-color: var(--line-strong); }
.hb-tab.active {
  background: linear-gradient(135deg, hsl(330 85% 66% / 0.18), hsl(275 80% 70% / 0.15));
  border-color: var(--accent); color: var(--text); box-shadow: 0 0 16px hsl(330 85% 66% / 0.15);
}
.hb-tab.active span { background: var(--accent); color: white; }
.hb-dot-pulse { display: inline-block; animation: blink .8s ease-in-out infinite alternate; font-style: normal; }
a.icon-btn { text-decoration: none; }
.icon-btn.copied { color: var(--green); }

.holder-other-view {
  display: flex; flex-direction: column; gap: 18px; animation: pop .2s ease-out; margin-bottom: 40px;
}
.holder-other-view[hidden] { display: none; }
.hov-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 4px 2px 10px; border-bottom: 1px solid var(--line);
}
.hov-summary { font-size: 14px; color: var(--muted); }
.hov-summary b { color: var(--text); }
.hov-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hov-tools .input { max-width: 260px; font-size: 13px; }
.hov-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; gap: 12px; color: var(--muted);
}
.hov-spinner {
  width: 38px; height: 38px; border: 3px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .8s linear infinite; margin-bottom: 4px;
}
.hov-loading h3 { font-size: 18px; margin: 0; color: var(--text); font-weight: 600; }
.hov-loading p { margin: 0; font-size: 14px; }
.hov-list { display: flex; flex-direction: column; gap: 18px; }
.hov-group {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 14px;
}
.hov-group-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.hov-group-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hov-group-title h4 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.hov-group-links { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); }
.hov-group-links code { font-size: 12px; }
.hov-expand { align-self: flex-start; margin-top: 4px; font-size: 13px; }
.holder-other-view .wcard .wcheck { display: none; }
.holder-other-view .wcard { cursor: pointer; }
.modal-owner-badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.modal-owner-badge code { font-size: 12.5px; color: var(--text); }
.modal-owner-badge .icon-btn { font-size: 12px; padding: 2px 6px; }
.hl-view-other { margin-left: 4px; font-size: 12px; }

.owner-dd { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.owner-view {
  margin-left: auto; padding: 3px 10px; border-radius: 99px; font-size: 12px;
  background: hsl(330 85% 66% / 0.12); border: 1px solid hsl(330 85% 66% / 0.4); color: var(--accent);
}
.owner-view:hover { background: var(--accent); color: white; }
.owner-view.btn-ghost {
  margin-left: 0; background: transparent; border-color: var(--line); color: var(--dim);
}
.owner-view.btn-ghost:hover { background: var(--line); color: var(--text); }

.holders-modal { width: min(900px, 94vw); }
.holders-modal .wtitle { margin-top: 0; }
.hs { margin-bottom: 14px; }
.hs-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.hs-stats div {
  padding: 10px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.hs-stats b { display: block; font-size: 20px; color: var(--text); font-weight: 600; }
.hs-dist { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-tools {
  position: sticky; top: -26px; z-index: 2; display: flex; gap: 8px; padding: 10px 0;
  background: var(--panel-solid);
}
.hl-tools .input { flex: 1; }
.hl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.hl-row {
  display: grid; grid-template-columns: 34px 28px minmax(0, 1fr) auto 64px auto; align-items: center; gap: 12px;
  padding: 8px 10px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line);
  cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.hl-row:hover, .hl-row:focus-visible { border-color: hsl(330 85% 66% / 0.5); background: hsl(330 85% 66% / 0.06); outline: none; }
.hl-row.is-you { border-color: hsl(275 80% 70% / 0.5); }
.hl-row.current { border-color: var(--accent); box-shadow: 0 0 0 3px hsl(330 85% 66% / 0.2); }
.hl-row.wempty { display: block; cursor: default; }
.hl-rank { color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; font-size: 13px; }
.hl-row:nth-child(-n+3) .hl-rank { color: var(--gold); font-weight: 600; }
.hl-addr { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hl-addr code { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hl-bar { height: 4px; margin-top: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.hl-bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
.hl-row.has-1of1 .hl-bar i { background: linear-gradient(90deg, var(--gold), var(--accent)); }
.hl-thumbs { display: flex; }
.hl-thumbs img {
  width: 26px; height: 39px; object-fit: cover; border-radius: 5px; border: 1.5px solid var(--panel-solid);
  margin-left: -8px; background: var(--bg);
}
.hl-thumbs img:first-child { margin-left: 0; }
.hl-count { text-align: right; line-height: 1.15; }
.hl-count b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.hl-count span { font-size: 11.5px; color: var(--dim); }
.hl-actions { display: flex; align-items: center; gap: 2px; }
.hl-view { margin-left: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .modal-nav.prev { left: 10px; }
  .modal-nav.next { right: 10px; top: auto; bottom: 10px; transform: none; }
  .modal-nav.prev { top: auto; bottom: 10px; transform: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 62px; left: 0; width: min(340px, 88vw); z-index: 30;
    transform: translateX(-105%); transition: transform .25s ease; background: var(--panel-solid);
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow); }
  .mobile-only { display: inline-block; }
  .stats { display: none; }
  .topbar { padding: 12px 16px; }
  .content { padding: 16px; }
  .modal-body { grid-template-columns: 1fr; overflow-y: auto; }
  .modal-img img { max-height: 60vh; }
  .live { margin-left: auto; }
  .holders-btn { display: inline-flex; }
}
@media (max-width: 640px) {
  .topbar { gap: 6px; padding: 10px 12px; }
  .brand-sub { display: none; }
  .brand h1 { font-size: 20px; }
  .live { padding: 6px; }
  .live span { display: none; }
  .holders-btn { padding: 6px 8px; font-size: 12.5px; }
  .mint-btn { padding: 6px 12px; font-size: 12.5px; }
  .wallet-btn { padding: 6px 12px; font-size: 12.5px; }
  .wallet-btn.connected > span:not(.wb-count) { display: none; }
  .toolbar-right { flex-wrap: wrap; }

  .wallet-modal {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0;
    border-radius: 0; border: 0;
  }
  .wallet-body { max-height: 100dvh; height: 100%; padding: 20px 16px 0; }
  .wfooter { margin: 16px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .wp-header { padding-right: 36px; }
  .wp-actions { width: 100%; }
  .wp-actions .btn { flex: 1; }
  .wgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .wgrid.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wtoolbar { flex-wrap: wrap; gap: 10px; }
  .plist li { grid-template-columns: 34px 1fr auto; row-gap: 2px; }
  .plist li img { grid-row: 1 / 3; }
  .plist li .pstate { grid-column: 3; grid-row: 1; }
  .plist li .pnote { grid-column: 2; grid-row: 2; white-space: normal; }
  .plist li a { grid-column: 3; grid-row: 2; }
  .toast { left: 12px; right: 12px; bottom: 12px; max-width: none; }

  .holders-btn { padding: 7px 8px; }
  .holders-btn .hb-txt { display: none; }
  .holders-btn::before { content: "👥"; font-size: 15px; }
  .holders-btn .wb-count { display: none; }
  .holder-banner { gap: 10px; padding: 12px; }
  .hb-top { flex-wrap: wrap; gap: 10px 12px; }
  .holder-banner .avatar.lg { width: 38px; height: 38px; }
  .holder-banner .wp-addr code { font-size: 12px; }
  .hb-tabs { padding-top: 8px; gap: 6px; }
  .hb-tab { padding: 6px 12px; font-size: 12px; }
  .hb-info { display: block; }
  .hb-info .badge { display: inline-block; margin-left: 4px; }
  .hb-actions { width: 100%; }
  .hb-actions .btn { margin-left: auto; }
  .hs-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hl-tools { top: -20px; }
  .hl-row { grid-template-columns: 26px 24px minmax(0, 1fr) auto; gap: 8px; padding: 8px; }
  .hl-row .avatar { width: 22px; height: 22px; }
  .hl-thumbs, .hl-actions { display: none; }
  .hl-addr code { font-size: 12px; }
}

/* ---------- Password Modal & Locked State ---------- */
.password-modal {
  width: min(420px, 92vw); padding: 26px 24px; border: 1px solid var(--line-strong);
  border-radius: 20px; background: var(--panel-solid); color: var(--text); box-shadow: var(--shadow);
}
.password-modal[open] { animation: modalIn .22s ease-out; }
.password-modal::backdrop { background: hsl(270 40% 3% / 0.75); backdrop-filter: blur(6px); }

.pw-box { display: flex; flex-direction: column; align-items: stretch; }
.pw-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-size: 20px; background: hsl(330 85% 66% / 0.12); border: 1px solid hsl(330 85% 66% / 0.3);
  margin-bottom: 14px;
}
.pw-box h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; font-family: "Playfair Display", serif; }
.pw-desc { font-size: 13px; color: var(--muted); margin: 0 0 18px; line-height: 1.45; }
.pw-field { position: relative; display: flex; width: 100%; }
.pw-field .input { width: 100%; padding-right: 40px; font-size: 14px; }
.pw-eye-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; cursor: pointer; color: var(--muted);
  font-size: 14px; padding: 6px; border-radius: 6px; display: grid; place-items: center;
  transition: color .15s;
}
.pw-eye-btn:hover { color: var(--text); }
.pw-msg { margin-top: 8px; font-size: 12.5px; color: hsl(0 80% 65%); }
.pw-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.filter-head-flex { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.filter-head-flex .field-label { margin-bottom: 0; }
.relock-btn {
  font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: hsl(330 85% 66% / 0.12); border: 1px solid hsl(330 85% 66% / 0.25);
  color: var(--accent); cursor: pointer; transition: all .15s;
}
.relock-btn:hover { background: hsl(330 85% 66% / 0.2); border-color: var(--accent); }

.stat-btn.locked-stat { cursor: pointer; }
.stat-btn.locked-stat:hover { border-color: var(--accent); transform: translateY(-1px); }

.count-unlock-btn { color: var(--accent); font-weight: 500; cursor: pointer; text-decoration: underline; margin-left: 4px; }
.count-unlock-btn:hover { color: white; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.shake { animation: shake .4s cubic-bezier(.36,.07,.19,.97) both; border-color: hsl(0 80% 65%) !important; }

