/* =========================================================
   Wallet connect + free-pack gate
   ========================================================= */

/* the hidden attribute must always win over component display rules */
[hidden] { display: none !important; }

/* ---------- header button ---------- */
.wallet-wrap { position: relative; }
.btn-wallet {
  color: var(--text); background: linear-gradient(180deg, rgba(167, 123, 255, .2), rgba(167, 123, 255, .08));
  border-color: rgba(167, 123, 255, .5); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.btn-wallet:hover { border-color: rgba(167, 123, 255, .85); background: linear-gradient(180deg, rgba(167, 123, 255, .3), rgba(167, 123, 255, .12)); }
.btn-wallet.on { font-family: var(--mono); font-weight: 600; font-size: 12.5px; padding: 0 12px 0 6px; background: rgba(255, 255, 255, .04); border-color: var(--line-2); }
.btn-wallet.on > .ic { display: none; }
.btn-wallet .ava { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.btn-wallet .ava img { width: 18px; height: 18px; border-radius: 4px; }

.wallet-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 230px; padding: 8px;
  border-radius: 14px; border: 1px solid var(--line-2); background: rgba(15, 13, 21, .97);
  box-shadow: 0 24px 60px -16px rgba(0, 0, 0, .9); backdrop-filter: blur(14px);
  animation: wmIn .18s var(--ease);
}
@keyframes wmIn { from { opacity: 0; transform: translateY(-4px); } }
.wm-head { display: flex; align-items: center; gap: 10px; padding: 6px 6px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.wm-ava { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.wm-head b { display: block; font: 600 13px var(--mono); }
.wm-head small { color: var(--dim); font-size: 11.5px; font-weight: 600; }
.wallet-menu button, .wallet-menu a { width: 100%; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 10px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; }
.wallet-menu button:hover, .wallet-menu a:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.wallet-menu .danger:hover { color: #ff7a8a; }

/* ---------- connect modal ---------- */
.wmodal .modal-bg { background: rgba(4, 2, 8, .78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.wbox {
  position: relative; width: min(400px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 28px 22px 20px; text-align: center;
  border-radius: 24px; border: 1px solid rgba(167, 123, 255, .35);
  background: radial-gradient(120% 60% at 50% 0%, rgba(167, 123, 255, .18), transparent 60%), linear-gradient(180deg, #17121f, #0d0b12);
  box-shadow: 0 40px 100px -30px rgba(167, 123, 255, .45), 0 30px 80px -20px rgba(0, 0, 0, .85);
  animation: pop .28s cubic-bezier(.2, .9, .3, 1.15);
}
@keyframes pop { from { transform: scale(.95); opacity: 0; } }
.wclose { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--muted); }
.wclose:hover { color: var(--text); }
.wlogo { width: 64px; margin: 0 auto 12px; filter: drop-shadow(0 6px 16px rgba(255, 79, 174, .45)); }
.wbox h3 { font-size: 22px; }
.wsub { margin: 8px auto 18px; max-width: 320px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.wlist, .wmore { display: grid; gap: 8px; text-align: left; }
.wmore:not(:empty) { margin-top: 14px; }
.wlabel { margin: 0 0 2px 4px; color: var(--dim); font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.witem {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 56px; padding: 0 14px 0 10px;
  border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); color: var(--text);
  transition: border-color .2s, background .2s, transform .15s;
}
.witem:hover { border-color: rgba(167, 123, 255, .6); background: rgba(167, 123, 255, .08); transform: translateY(-1px); }
.witem b { font-size: 14.5px; font-weight: 700; }
.witem em { margin-left: auto; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--dim); }
.witem em.det { color: var(--green); }
.witem.ghost { opacity: .85; }
.witem.busy { pointer-events: none; opacity: .6; }
.witem.busy em::after { content: " …"; }
.wi { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 10px; overflow: hidden; background: rgba(255, 255, 255, .06); font: 800 16px var(--head); }
.wi img { width: 100%; height: 100%; object-fit: cover; }
.wi.letter { color: #fff; background: var(--wc); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .2); }
.wnone { margin: 0; padding: 14px; border-radius: 12px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; text-align: center; }
.wfine { margin: 16px 0 0; color: var(--dim); font-size: 11px; }

/* ---------- free-pack gate over the rip stage ---------- */
.pack.locked { pointer-events: none; filter: grayscale(.6) brightness(.45); animation: none; }
.rip-gate { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; background: radial-gradient(60% 60% at 50% 50%, rgba(7, 6, 10, .55), rgba(7, 6, 10, .82)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.gate-card {
  width: min(420px, 100%); padding: 26px 22px; text-align: center; border-radius: 22px;
  border: 1px solid var(--line-2); background: linear-gradient(180deg, rgba(23, 18, 31, .96), rgba(13, 11, 18, .96));
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.gate-ico { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 16px; color: var(--violet); background: rgba(167, 123, 255, .14); border: 1px solid rgba(167, 123, 255, .45); }
.gate-ico.gold { color: var(--gold); background: rgba(245, 196, 81, .12); border-color: rgba(245, 196, 81, .45); }
.gate-ico .ic { width: 24px; height: 24px; }
.gate-card h3 { font-size: 20px; }
.gate-card p { margin: 10px auto 18px; max-width: 330px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.gate-card p b { color: var(--text); }
.gate-timer { margin: 12px 0 14px; font: 300 52px/1 var(--head); font-variant-numeric: tabular-nums; letter-spacing: -.02em; background: linear-gradient(180deg, #fff 30%, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.gate-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--pink), var(--gold)); box-shadow: 0 0 10px rgba(245, 196, 81, .6); transition: width 1s linear; }
.gate-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* stat + rip-another states */
#statFree { font-variant-numeric: tabular-nums; }
#statFree.ready { color: var(--green); }
#ripAgain:disabled { cursor: not-allowed; filter: grayscale(.5) brightness(.75); font-variant-numeric: tabular-nums; }

/* ---------- binder gate ---------- */
.binder-gate { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 18px; border: 1px solid rgba(167, 123, 255, .35); background: linear-gradient(135deg, rgba(167, 123, 255, .12), rgba(15, 13, 21, .9)); }
.binder-gate > .ic { width: 22px; height: 22px; color: var(--violet); flex: none; }
.binder-gate b { display: block; font-size: 15px; }
.binder-gate span { color: var(--muted); font-size: 13px; }
.binder-gate .btn { margin-left: auto; }

@media (max-width: 720px) {
  .btn-wallet:not(.on) span { display: none; }
  .btn-wallet:not(.on) { padding: 0 11px; }
  .btn-wallet.on { padding: 0 10px 0 5px; font-size: 11.5px; }
  .rip-stats { flex-wrap: wrap; }
  .rip-stats > div { flex: 1 1 40%; }
  .gate-timer { font-size: 42px; }
  .binder-gate { flex-direction: column; align-items: flex-start; }
  .binder-gate .btn { margin-left: 0; }
}
@media (max-width: 400px) {
  .btn-wallet.on #walletLabel { display: none; }
}

/* ---------- reveal grid follows the pack size (3 / 5 / 10) ---------- */
.reveal { grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); max-width: calc(var(--n, 5) * 200px); margin-inline: auto; row-gap: 40px; }
.pack.paid img { filter: drop-shadow(0 26px 40px rgba(245, 196, 81, .55)); }
.pack img { max-height: 340px; width: auto; margin: 0 auto; object-fit: contain; }
@media (max-width: 720px) { .reveal { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: none; } }

/* ---------- checkout modal ---------- */
.buybox { width: min(460px, 100%); text-align: left; padding: 24px 22px 18px; border-color: rgba(245, 196, 81, .35);
  background: radial-gradient(120% 55% at 50% 0%, rgba(245, 196, 81, .14), transparent 60%), linear-gradient(180deg, #17121f, #0d0b12);
  box-shadow: 0 40px 100px -30px rgba(245, 196, 81, .35), 0 30px 80px -20px rgba(0, 0, 0, .85); }
.buy-head { display: flex; gap: 16px; align-items: center; padding-right: 30px; }
.buy-art { flex: none; width: 96px; height: 120px; display: grid; place-items: center; border-radius: 14px; border: 1px solid var(--line-2);
  background: radial-gradient(closest-side, rgba(167, 123, 255, .3), transparent), rgba(0, 0, 0, .35); }
.buy-art img { max-width: 86%; max-height: 92%; object-fit: contain; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .6)); }
.buy-set { margin: 0; color: var(--gold); font: 600 11px var(--mono); }
.buy-info h3 { margin: 4px 0; font-size: 21px; }
.buy-meta { margin: 0; color: var(--muted); font-size: 12.5px; }
.buy-label { margin: 18px 0 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.buy-label span { color: var(--dim); letter-spacing: .06em; text-transform: none; font-weight: 600; }
.buy-odds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bo { display: flex; flex-direction: column; gap: 1px; padding: 8px 9px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); }
.bo small { color: var(--c); font: 800 11px var(--head); letter-spacing: .06em; }
.bo b { font: 800 15px var(--head); }
.bo em { font-style: normal; color: var(--dim); font-size: 10.5px; font-weight: 600; }
.buy-rows { margin: 16px 0 14px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.buy-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.buy-row + .buy-row { border-top: 1px solid var(--line); }
.buy-row b { color: var(--gold-2); font: 800 18px var(--head); }
.buy-row code { font: 500 12.5px var(--mono); color: var(--text); }
.buy-row a { color: var(--text); }
.buy-row a:hover code { color: var(--gold-2); }
.buy-row em { font-style: normal; font-size: 12px; color: var(--dim); }
.buy-go { width: 100%; }
.buy-go:disabled { cursor: progress; filter: grayscale(.4) brightness(.8); }
.buy-status { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; border: 1px solid var(--line-2); background: rgba(255, 255, 255, .03); }
.buy-status a { margin-left: auto; color: var(--gold-2); font-size: 12px; }
.buy-status.ok { border-color: rgba(94, 230, 168, .45); color: var(--green); background: rgba(94, 230, 168, .08); }
.buy-status.err { border-color: rgba(255, 122, 138, .45); color: #ff9aa6; background: rgba(255, 122, 138, .08); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .2); border-top-color: var(--gold); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 420px) {
  .buy-odds { grid-template-columns: repeat(2, 1fr); }
  .buy-art { width: 80px; height: 100px; }
}

/* ---------- empty leaderboard (after reset) ---------- */
.board-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 40px 20px; border-top: 1px solid var(--line); text-align: center; }
.board-empty b { font: 800 18px var(--head); }
.board-empty span { color: var(--muted); font-size: 13.5px; margin-bottom: 8px; }

/* ---------- collector reward panel ---------- */
.reward {
  position: relative; overflow: hidden; isolation: isolate; margin-bottom: 18px;
  display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; padding: 26px 28px;
  border-radius: var(--radius-lg); border: 1px solid rgba(245, 196, 81, .35);
  background: radial-gradient(80% 120% at 100% 0%, rgba(245, 196, 81, .16), transparent 60%), linear-gradient(160deg, #1a1420, #0d0b12);
  box-shadow: inset 0 1px 0 rgba(255, 220, 133, .1), 0 30px 60px -36px rgba(245, 196, 81, .5);
}
.reward::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: radial-gradient(rgba(245, 196, 81, .3) 1px, transparent 1.4px); background-size: 12px 12px; -webkit-mask-image: radial-gradient(50% 80% at 0% 100%, #000, transparent 70%); mask-image: radial-gradient(50% 80% at 0% 100%, #000, transparent 70%); opacity: .5; }
.rw-k { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.rw-main h3 { font-size: clamp(20px, 2.4vw, 26px); font-weight: 800; letter-spacing: -.02em; }
.rw-lead { margin: 8px 0 16px; color: var(--muted); font-size: 14px; max-width: 620px; }
.rw-lead b { color: var(--text); }
.rw-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.rw-facts > div { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .25); min-width: 0; }
.rw-facts small { display: block; color: var(--dim); font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.rw-facts b { font: 800 16px var(--head); color: var(--gold-2); }
.rw-facts a { color: var(--text); font-size: 13px; white-space: nowrap; }
.rw-facts code { font: 500 12.5px var(--mono); }
.rw-steps { margin: 0; padding: 0; list-style: none; counter-reset: rw; display: grid; gap: 8px; }
.rw-steps li { counter-increment: rw; position: relative; padding-left: 34px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.rw-steps li::before { content: counter(rw); position: absolute; left: 0; top: -1px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 8px; font: 800 12px var(--head); color: #1d1300; background: linear-gradient(180deg, #ffe08f, #f5c451); }
.rw-steps b { color: var(--text); }
.rw-steps span { color: var(--gold-2); font-weight: 700; }
.rw-fine { margin: 14px 0 0; color: var(--dim); font-size: 11.5px; line-height: 1.5; }
.rw-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; }
.rw-ring {
  --p: 0; width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255, 255, 255, .08) 0);
  box-shadow: 0 0 40px -10px rgba(245, 196, 81, .5);
}
.rw-ring > div { width: 122px; height: 122px; border-radius: 50%; display: grid; place-content: center; background: #110d17; }
.rw-ring b { font: 800 28px var(--head); letter-spacing: -.02em; }
.rw-ring small { color: var(--dim); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.rw-ring.done { box-shadow: 0 0 50px -6px rgba(245, 196, 81, .9); }
.rw-status { margin: 0; color: var(--muted); font-size: 13px; }
.rw-claim { width: 100%; }
.rw-claim.disabled { filter: grayscale(.7) brightness(.6); cursor: not-allowed; }
.rw-link { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.rw-link:hover { color: var(--gold-2); }
@media (max-width: 820px) {
  .reward { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .rw-side { order: -1; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; }
  .rw-ring { width: 96px; height: 96px; }
  .rw-ring > div { width: 76px; height: 76px; }
  .rw-ring b { font-size: 19px; }
  .rw-ring small { font-size: 9px; }
  .rw-side .rw-status { flex: 1; min-width: 140px; }
  .rw-facts { grid-template-columns: 1fr 1fr; }
}
