/* ================================================================= cards */

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 0.5px solid var(--separator);
  overflow: hidden;
  transition: transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.16s;
}
.card:active {
  transform: scale(0.985);
}

/* An NFT card. Art on top, title and price under it. */
.nftcard {
  width: 180px;
  text-align: left;
  display: block;
  background: var(--card);
  border-radius: 6px;
  border: 0.5px solid var(--card-border-color, #7c3aed);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s;
  position: relative;
  /* No infinite animation here. The old `animation: pulse 2s` collided with a
     second `@keyframes pulse` lower in the file, and CSS keeps the LAST block,
     so every card was animating a box-shadow ring instead of a scale - a
     paint-per-frame cost spread across the whole grid for a rhythm nothing
     asked for. The hover/active transitions below are the feedback. */
}

.token-card {
  border: 1px solid #b83fc8;
  border-radius: 6px;
  overflow: hidden;
}
.nftcard:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.nftcard:active {
  transform: scale(0.975);
}
.nftcard .art { border-radius: 0; }
.nftcard .body { padding: 10px 12px 12px; }
.nftcard .nftname {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--label);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nftcard .name { font-size: 14px; font-weight: 700; letter-spacing: -0.02em; }
.nftcard .sub { margin-top: 2px; font-size: 12px; color: var(--label-2); }
.nftcard .price {
  margin-top: 8px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  justify-content: space-between;
}
.nftcard .price .label { font-size: 11px; font-weight: 700; color: var(--label-3); text-transform: uppercase; letter-spacing: 0.05em; align-self: center; }
.nftcard .price .amt { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.nftcard .price .amt.none { font-size: 12px; font-weight: 650; color: var(--label-3); }
.nftcard .price .cur { font-size: 11px; font-weight: 700; color: var(--accent); }

/* The generative art tile. */
.art {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  display: block;
  overflow: hidden;
  background: var(--fill);
}
.art svg,
.art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.art .badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  /* Backdrop blur removed from card chips: the All grid held 300+ blur surfaces
     at once, each one a fresh backdrop root the compositor samples on every
     repaint, and on the Pi badge below the blur was invisible anyway (an opaque
     gradient sits behind it). Chips stay translucent — that is the visible part. */
  color: var(--label);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
/* The creator / seller chip overlaid on the artwork, top-left. */
.art .who {
  position: absolute;
  left: 10px;
  top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 3px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-sm);
  max-width: calc(100% - 20px);
}
.art .who .avatar { width: 20px; height: 20px; font-size: 9px; }
.art .who .handle {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--label);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pi badge in top-right corner */
.art .pi-badge {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
}

.art .placeholder-tag {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.72);
  color: var(--label-2);
  font-size: 10px;
  font-weight: 600;
}

/* A grid for explore and profile. */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.grid .nftcard { width: 100%; }

/* =========================================================== grouped lists */
/* The inset white table with hairline rows — the most iOS shape there is. */

.group {
  margin-top: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.group > .ghead {
  padding: 13px 14px 6px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--label-2);
}
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 44px;
}
.row + .row { border-top: 0.5px solid var(--separator); }
.row .k { flex: 1; min-width: 0; font-size: 15px; }
.row .k .sub { color: var(--label-2); font-size: 12.5px; margin-top: 1px; }
.row .v { font-size: 14px; color: var(--label-2); text-align: right; word-break: break-all; }
.row .v.mono { font-variant-numeric: tabular-nums; }

/* =============================================================== buttons */

.btn {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius-pill);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.28);
  transition: transform 0.12s, filter 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.985); background: var(--accent-press); }
.btn[disabled] {
  background: var(--fill-2);
  color: var(--label-3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn.ghost { background: var(--fill); color: var(--label); box-shadow: none; }
.btn.ghost:active { background: var(--fill-2); }

.btn.sm { min-height: 40px; font-size: 15px; }

.btnstack { display: flex; flex-direction: column; gap: 10px; }

/* =============================================================== sign-in */

/* The gate before any tab. Content is centred and the actions are pinned to the
   bottom, the way an iOS onboarding screen arranges itself: the reason at eye
   level, the choice under the thumb. */
.login {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: calc(env(safe-area-inset-top, 0px) + 56px) 24px calc(env(safe-area-inset-bottom, 0px) + 34px);
}
.login-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 15px;
}
.login-mark {
  width: 84px;
  height: 84px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 44px;
  line-height: 1;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: var(--shadow-sm);
}
.login-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.login-sub {
  margin: 0;
  max-width: 32ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--label-2);
}
.login-badge {
  margin-top: 6px;
}
.login-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-fine {
  margin: 2px 0 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--label-3);
  text-align: center;
}
.login-note {
  font-size: 13px;
  line-height: 1.5;
}

/* The tab bar is a navigation for inside the app; the sign-in page is not
   inside it. `hidden` alone would lose to `display: flex` above. */
.tabbar[hidden] {
  display: none;
}

/* ============================================================= segmented */

.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 13px;
  background: var(--fill);
  margin: 14px 0 4px;
}
.segmented button {
  flex: 1;
  min-height: 34px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--label-2);
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.segmented button.on {
  background: #fff;
  color: var(--label);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ================================================================ inputs */

.field { margin-top: 14px; }
.field label {
  display: block;
  margin: 0 0 6px 2px;
  font-size: 13px;
  font-weight: 650;
  color: var(--label-2);
}
.field input,
.field textarea {
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  background: var(--fill);
  border: 0.5px solid transparent;
  font-size: 16px;
  outline: none;
  transition: background 0.15s, border-color 0.15s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus,
.field textarea:focus { background: #fff; border-color: var(--accent); }
.field input::placeholder,
.field textarea::placeholder { color: var(--label-3); }
.field .hint { margin: 6px 0 0 2px; font-size: 12.5px; color: var(--label-3); }

/* ================================================================ search */

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--fill);
  color: var(--label-2);
}
.searchbar svg { width: 17px; height: 17px; flex: none; }
.searchbar input {
  flex: 1;
  border: 0;
  background: none;
  outline: none;
  font-size: 16px;
  min-width: 0;
}
.searchbar input::placeholder { color: var(--label-3); }

/* ======================================================== chips and tags */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--fill);
  color: var(--label);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  opacity: 0.85;
}

/* The Pi Testnet badge: small, calm, impossible to miss but never shouty. */
.testnet-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: var(--radius-pill);
  background: rgba(255, 149, 0, 0.1);
  color: #a35c00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.testnet-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.5);
  /* `pulseRing`, not `pulse`: two `@keyframes pulse` blocks used to exist and
     the last one won, silently retargeting every `.nftcard` animation to this
     ring. One keyframe name, one owner. */
  animation: pulseRing 2.6s infinite;
}
@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(255, 149, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 149, 0, 0); }
}

/* ================================================================ avatar */

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  box-shadow: var(--shadow-sm);
}
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }

/* ================================================================ sheet */

.sheet-host {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.24);
  display: flex;
  align-items: flex-end;
  animation: fade 0.18s ease;
}
.sheet-host[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }

.sheet {
  width: 100%;
  max-height: 92%;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg);
  animation: slideup 0.28s cubic-bezier(0.32, 0.72, 0.35, 1);
}
@keyframes slideup { from { transform: translateY(40%); opacity: 0.4; } }

.sheet .grabber {
  width: 38px;
  height: 5px;
  border-radius: 3px;
  background: var(--separator-strong);
  margin: 0 auto 14px;
}
.sheet h3 {
  margin: 2px 0 4px;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.03em;
}
.sheet .sheet-sub { margin: 0 0 12px; font-size: 14px; color: var(--label-2); }

/* ============================================================== overlay */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.overlay.on { display: flex; animation: pushin 0.3s cubic-bezier(0.32, 0.72, 0.35, 1); }
@keyframes pushin { from { transform: translateX(28%); opacity: 0.5; } }
.overlay .scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ================================================================ tabbar */

.tabbar {
  position: relative;
  z-index: 20;
  display: flex;
  flex: none;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-top: 0.5px solid var(--separator);
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--label-2);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.16s;
}
.tab .ic { width: 24px; height: 24px; transition: transform 0.18s cubic-bezier(0.32, 0.72, 0.35, 1); }
.tab.on { color: var(--accent); }
.tab.on .ic { transform: scale(1.06); }
.tab:active .ic { transform: scale(0.9); }

