/* =========================================================
   My Apes: the gallery's grid and popup (../gallery/gallery.css) for the Apes one wallet
   holds, under a panel that connects a wallet or looks up an address.
   ========================================================= */

.my-layout { max-width: 1440px; }

/* ---------- connect ---------- */
.my-connect { display: flex; flex-direction: column; align-items: center; gap: 30px; margin: clamp(28px, 5vw, 64px) auto clamp(12px, 3vw, 32px); text-align: center; }
.my-title { font: 400 clamp(30px, 3.4vw, 42px)/1.15 var(--serif); }
.my-find { width: min(520px, 100%); margin-top: 10px; padding-top: 28px; border-top: 1px solid var(--rule); }
.my-find label { display: block; margin-bottom: 12px; font: 400 15px/1.4 var(--sans); color: var(--ink-2); }
.my-find-row { display: flex; gap: 10px; }
.my-find input {
  flex: 1; min-width: 0; height: 50px; padding: 0 16px;
  background: var(--field); color: var(--ink); border: 1px solid var(--rule-2); border-radius: 0;
  font: 400 15px/1 var(--sans); -webkit-appearance: none; appearance: none;
  transition: border-color .25s var(--ease);
}
.my-find input::placeholder { color: var(--ink-3); }
.my-find input:focus { outline: none; border-color: var(--gold); }
.my-find input:focus-visible { outline: 1px solid var(--gold-l); outline-offset: 2px; }
/* waiting on the lookup: dimmed, not the dashed "unavailable" look */
.my-find .btn[disabled] { opacity: .6; cursor: progress; border-style: solid; }
.my-err { min-height: 1.5em; margin-top: 12px; font: 400 14px/1.5 var(--sans); color: #e39a83; }

/* ---------- the Connect wallet popup, after RainbowKit ----------
   A rounded modal: the wallets on the left, what the chosen one needs on the right.
   On phones it's a sheet from the bottom that steps from the list into one wallet. */
.cw {
  --cw-bg: #16140f; --cw-line: rgba(201, 164, 92, .16); --cw-hover: rgba(239, 233, 223, .06);
  margin: auto; padding: 0; width: min(720px, calc(100% - 32px)); max-height: calc(100% - 32px);
  background: var(--cw-bg); color: var(--ink); border: 1px solid var(--cw-line); border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .6); overflow: hidden;
  font-family: var(--sans);
}
.cw::backdrop { background: rgba(4, 4, 3, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.cw-in { display: grid; grid-template-columns: 287px minmax(0, 1fr); height: min(500px, calc(100vh - 34px)); }
.cw-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--cw-line); }
.cw-top { display: flex; align-items: center; justify-content: space-between; padding: 22px 18px 10px 24px; }
.cw-title { font: 600 18px/1.2 var(--sans); letter-spacing: 0; }
.cw-x {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  background: var(--cw-hover); color: var(--ink-2); border: 0; border-radius: 50%; cursor: pointer;
  transition: background-color .2s, color .2s, transform .15s;
}
.cw-x:hover { background: rgba(239, 233, 223, .12); color: var(--ink); transform: scale(1.06); }
.cw-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cw-x-list { display: none; }
.cw-rows { flex: 1; overflow-y: auto; padding: 0 12px 16px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--rule-2) transparent; }
.cw-group { margin: 14px 12px 6px; font: 600 13.5px/1 var(--sans); color: var(--gold); }
.cw-rows ul { display: grid; gap: 2px; }
.cw-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; min-height: 46px;
  background: none; color: var(--ink); border: 0; border-radius: 12px; cursor: pointer; text-align: left;
  font: 600 15.5px/1.2 var(--sans); transition: background-color .15s, transform .15s;
}
.cw-row:hover { background: var(--cw-hover); }
.cw-row:active { transform: scale(.985); }
.cw-row:focus-visible { outline: 2px solid var(--gold-l); outline-offset: -2px; }
.cw-row[aria-current] { background: var(--gold); color: #17120a; }
.cw-row img { flex: none; width: 28px; height: 28px; border-radius: 7px; }
.cw-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-tag { flex: none; font: 600 12px/1 var(--sans); color: var(--gold); }
.cw-row[aria-current] .cw-tag { color: rgba(23, 18, 10, .7); }

.cw-side { position: relative; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.cw-side-top { position: absolute; top: 18px; left: 18px; right: 18px; display: flex; justify-content: flex-end; }
.cw-back { display: none; }
.cw-detail { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 64px 48px 40px; text-align: center; }
.cw-h { font: 600 18px/1.25 var(--sans); }
.cw-detail p { max-width: 320px; font: 400 14.5px/1.55 var(--sans); color: var(--ink-2); }
.cw-intro { gap: 12px; }
.cw-big { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 6px; }
.cw-btn {
  display: inline-flex; align-items: center; justify-content: center; margin-top: 10px; height: 40px; padding: 0 20px;
  background: var(--gold); color: #17120a; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 14.5px/1 var(--sans); white-space: nowrap; transition: background-color .2s, transform .15s;
}
.cw-btn:hover { background: var(--gold-l); transform: scale(1.03); }
.cw-btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.cw-btn:focus-visible { outline: 2px solid var(--gold-l); outline-offset: 3px; }
.cw-spin { width: 22px; height: 22px; margin-top: 8px; border: 2px solid var(--cw-line); border-top-color: var(--gold); border-radius: 50%; animation: cw-spin .8s linear infinite; }
@keyframes cw-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) {
  .cw[open] { animation: cw-in .22s cubic-bezier(.2, .9, .3, 1.2); }
  @keyframes cw-in { from { opacity: 0; transform: scale(.96); } }
}
@media (prefers-reduced-motion: reduce) { .cw-spin { animation-duration: 2.4s; } }

/* phones: a bottom sheet, the list first, then one wallet with a back arrow */
@media (max-width: 640px) {
  .cw { margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88vh; max-height: 88dvh; border-radius: 24px 24px 0 0; border-bottom: 0; }
  .cw-in { display: block; height: auto; }
  .cw-list { border-right: 0; max-height: 88vh; max-height: 88dvh; }
  .cw-x-list { display: grid; }
  .cw-top { padding: 20px 18px 6px 22px; }
  .cw-rows { padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  .cw-side { display: none; }
  .cw-in.is-detail .cw-list { display: none; }
  .cw-in.is-detail .cw-side { display: flex; min-height: 380px; }
  .cw-side-top { justify-content: space-between; }
  .cw-back { display: grid; }
  .cw-detail { padding: 72px 26px calc(34px + env(safe-area-inset-bottom)); }
  @media (prefers-reduced-motion: no-preference) {
    .cw[open] { animation: cw-up .28s cubic-bezier(.2, .8, .3, 1); }
    @keyframes cw-up { from { transform: translateY(40px); opacity: .4; } }
  }
}

/* ---------- the wallet being shown ---------- */
.my-who {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px;
  padding-bottom: 22px; margin-bottom: 26px; border-bottom: 1px solid var(--rule);
}
.my-id { min-width: 0; }
.my-addr { font: 400 clamp(26px, 2.8vw, 34px)/1.15 var(--serif); font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.my-sub { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font: 500 11.5px/1.4 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.my-sub span { color: var(--ink-3); letter-spacing: .06em; text-transform: none; font-variant-numeric: tabular-nums; }
.my-loading { min-height: 36vh; }
.my-empty { padding: 48px 16px 24px; text-align: center; }
.my-empty-t { font: 400 clamp(22px, 2.4vw, 28px)/1.3 var(--serif); }
.my-empty-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }

/* no sidebar here, so the filters always open in the drawer */
.my-main .gx-filters-btn { display: inline-flex; }
.my-main .gx-bar[hidden] { display: none; }
.my-main .gx-bar[hidden] + .gx-meta { display: none; }
.my-main[hidden] { display: none; }

@media (max-width: 600px) {
  .my-find-row { flex-direction: column; }
  .my-find input { flex: none; width: 100%; }
  .my-find-row .btn { width: 100%; }
  .my-who { padding-bottom: 18px; margin-bottom: 20px; }
  .my-who .my-out { width: 100%; }
}
