* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #0e0e10; color: #f1f1f1;
  padding-bottom: 72px;
}

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14,14,16,.92); backdrop-filter: blur(8px);
  padding: 14px 20px;
}
.logo { font-size: 1.3rem; font-weight: 700; }

.page { display: none; padding: 8px 12px; }
.page.active { display: block; }

/* Pinterest-style masonry */
.masonry { columns: 3 160px; column-gap: 10px; }
.card {
  break-inside: avoid; margin-bottom: 10px;
  position: relative; border-radius: 14px; overflow: hidden;
  cursor: pointer; background: #1a1a1d;
}
.card img { width: 100%; display: block; }
.card .heart {
  position: absolute; top: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.45); border: none;
  font-size: 15px; cursor: pointer;
}

/* Search */
.search-wrap { padding: 4px 0 10px; }
#searchInput {
  width: 100%; padding: 12px 16px;
  border-radius: 24px; border: 1px solid #2c2c30;
  background: #1a1a1d; color: #fff; font-size: 1rem; outline: none;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.chip {
  white-space: nowrap; padding: 8px 14px; border-radius: 20px;
  background: #1a1a1d; border: 1px solid #2c2c30;
  color: #ddd; cursor: pointer; font-size: .85rem;
}
.chip.active { background: #e60023; border-color: #e60023; color: #fff; }

/* Profile */
.profile-card {
  background: #1a1a1d; border-radius: 18px;
  padding: 24px; text-align: center; margin: 10px 0 18px;
}
.avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: #2c2c30; display: flex; align-items: center;
  justify-content: center; font-size: 36px; margin: 0 auto 12px;
}
.muted { color: #888; font-size: .85rem; margin-top: 4px; }
.stats { display: flex; justify-content: center; gap: 32px; margin-top: 16px; }
.stats span { display: block; font-size: 1.3rem; font-weight: 700; }
.stats small { color: #888; }
.sec-title { margin: 8px 2px 10px; color: #aaa; font-size: 1rem; }

/* Preview overlay */
.preview {
  position: fixed; inset: 0; background: #000; z-index: 50;
  display: none; flex-direction: column;
}
.preview.show { display: flex; }
.preview-top { display: flex; justify-content: space-between; padding: 14px; }
.preview-top button {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.12); border: none;
  color: #fff; font-size: 18px; cursor: pointer;
}
#previewImg { flex: 1; min-height: 0; width: 100%; object-fit: contain; padding: 0 8px; }
.preview-info {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px 22px;
}
.preview-info p { font-weight: 600; }
#downloadBtn {
  background: #e60023; color: #fff; border: none;
  padding: 12px 20px; border-radius: 24px;
  font-weight: 700; cursor: pointer;
}

/* Bottom nav */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; border-top: 1px solid #232326;
  background: rgba(20,20,22,.95); backdrop-filter: blur(8px);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; background: none; border: none; color: #777;
  font-size: 18px; padding: 8px 0 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav-btn span { font-size: .68rem; }
.nav-btn.active { color: #e60023; }
/* ---------- Icon styles (emoji hatane ke baad) ---------- */
.logo { display: flex; align-items: center; gap: 8px; }
.logo svg { width: 22px; height: 22px; color: #e60023; }

.nav-btn svg { width: 22px; height: 22px; }

.heart {
  display: flex; align-items: center; justify-content: center;
}
.heart svg { width: 16px; height: 16px; }

.avatar svg { width: 36px; height: 36px; color: #888; }

.preview-top button {
  display: flex; align-items: center; justify-content: center;
}
.preview-top button svg { width: 20px; height: 20px; }

#downloadBtn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
#downloadBtn svg { width: 18px; height: 18px; }