/* Gobbo NFT Gallery — luxury dark theme, matching the Gobbo Deal Shop Mini App */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/fraunces-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/fraunces-italic-latin.woff2') format('woff2');
}
:root {
  --bg: #0f0e0c;
  --text: #f3ead7;
  --hint: #a89a7d;
  --button: #d9a521;
  --button-text: #1a1a1a;
  --secondary-bg: #171512;
  --gold: #d9a521;
  --gold-dark: #b8890f;
  --gold-soft: rgba(217, 165, 33, 0.14);
  --gold-bright: #f0c94f;
  --gold-line: rgba(217, 165, 33, 0.32);
  --card: #171512;
  --card-elev: #1d1a15;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
}
html { color-scheme: dark; }
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 480px at 50% -12%, rgba(217, 165, 33, 0.10) 0%, rgba(217, 165, 33, 0) 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 0 0 32px;
}
.wrap { max-width: 900px; margin: 0 auto; padding: 0 12px; }
a { color: var(--gold-bright); }
img { display: block; max-width: 100%; }

/* ---------- Hero / profile ---------- */
.hero { text-align: center; }
.banner { position: relative; margin: 0 -12px; overflow: hidden; }
.banner img { width: 100%; height: 180px; object-fit: cover; }
.banner-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(15,14,12,0) 40%, rgba(15,14,12,0.85) 88%, var(--bg) 100%);
}
.profile { margin-top: -58px; position: relative; padding: 0 8px; }
.logo {
  width: 116px; height: 116px; margin: 0 auto 10px;
  border-radius: 50%; object-fit: cover;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 5px var(--bg), 0 8px 28px rgba(0,0,0,0.55);
  background: var(--card);
}
h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: 34px; letter-spacing: 0.4px; color: var(--text);
}
.tagline { color: var(--hint); font-size: 14px; line-height: 1.55; max-width: 560px; margin: 8px auto 0; }
.hero-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.btn {
  display: inline-block; border: none; cursor: pointer; text-decoration: none;
  font-size: 15px; font-weight: 700; border-radius: 999px; padding: 11px 20px;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn.gold { background: linear-gradient(180deg, var(--gold-bright), var(--gold)); color: var(--button-text); }
.btn.ghost { background: transparent; color: var(--gold-bright); border: 1px solid var(--gold-line); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.wide { display: block; text-align: center; width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin: 20px 0 6px;
}
.stat {
  background: var(--card); border: 1px solid var(--gold-line);
  border-radius: 14px; padding: 12px 6px;
}
.stat-num { display: block; font-family: var(--serif); font-weight: 600; font-size: 19px; color: var(--gold-bright); }
.stat-label { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hint); margin-top: 3px; }
.data-note { font-size: 12px; color: var(--hint); margin-top: 8px; }

/* ---------- Rarest ---------- */
.rarest { margin-top: 26px; }
.rarest h2, .controls h2 {
  font-family: var(--serif); font-weight: 600; font-size: 21px; margin-bottom: 10px; text-align: left;
}
.rarest-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--gold-bright);
  border-radius: 999px; padding: 8px 13px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.chip small { color: var(--hint); font-weight: 400; margin-left: 2px; }

/* ---------- Controls ---------- */
.controls { margin-top: 24px; }
.search-row { display: flex; gap: 8px; }
.search-row input {
  flex: 1; min-width: 0; background: var(--card); color: var(--text);
  border: 1px solid var(--gold-line); border-radius: 999px; padding: 11px 16px;
  font-size: 15px; outline: none;
}
.search-row input:focus { border-color: var(--gold); }
.search-row input::placeholder { color: var(--hint); }
.filter-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px;
}
.filter-row select, .sort-row select {
  width: 100%; background: var(--card); color: var(--text);
  border: 1px solid var(--gold-line); border-radius: 12px; padding: 10px 12px;
  font-size: 14px; outline: none;
}
.sort-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.sort-row label { font-size: 13px; color: var(--hint); }
.sort-row select { width: auto; flex: 1; min-width: 150px; }
.result-count { font-size: 13px; color: var(--hint); margin-left: auto; }

/* ---------- Grid ---------- */
.grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px;
}
@media (min-width: 640px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card {
  background: var(--card); border: 1px solid rgba(217, 165, 33, 0.16);
  border-radius: 16px; overflow: hidden; cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover, .card:focus-visible { border-color: var(--gold); transform: translateY(-2px); outline: none; }
.card img { width: 100%; aspect-ratio: 1; object-fit: cover; background: #221e18; }
.card-img-ph {
  width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: #221e18; color: var(--hint); font-size: 13px; text-align: center; padding: 8px;
}
.card-body { padding: 9px 10px 11px; }
.card-name { font-weight: 700; font-size: 14px; }
.card-badge {
  display: inline-block; margin-top: 5px; font-size: 11.5px; font-weight: 700;
  color: var(--gold-bright); background: var(--gold-soft);
  border: 1px solid var(--gold-line); border-radius: 999px; padding: 3px 8px;
}
.empty { text-align: center; color: var(--hint); padding: 32px 12px; font-size: 14px; }
.more-wrap { text-align: center; margin-top: 18px; }

/* ---------- Detail ---------- */
#detailView { margin-top: 8px; }
.detail-card {
  background: var(--card); border: 1px solid var(--gold-line);
  border-radius: 20px; padding: 16px; margin-top: 12px;
}
.detail-img-wrap { border-radius: 14px; overflow: hidden; background: #221e18; }
.detail-img-wrap img { width: 100%; aspect-ratio: 1; object-fit: cover; }
#detailView h2 { font-family: var(--serif); font-weight: 600; font-size: 28px; margin-top: 14px; text-align: center; }
.detail-rank { text-align: center; color: var(--gold-bright); font-weight: 700; font-size: 14px; margin-top: 4px; }
.traits { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.traits th, .traits td { padding: 9px 6px; border-bottom: 1px solid rgba(217, 165, 33, 0.14); text-align: left; }
.traits th { color: var(--hint); font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 600; }
.traits td:last-child, .traits th:last-child { text-align: right; }
.traits td.trait-val { font-weight: 700; }
.detail-note { text-align: center; color: var(--hint); font-size: 12px; margin-top: 10px; }

/* ---------- Footer ---------- */
footer { text-align: center; color: var(--hint); font-size: 12.5px; line-height: 1.7; margin-top: 34px; }
footer .contract { word-break: break-all; }
