:root {
  --bg: #0a0a0d;
  --panel: #111114;
  --border: #26262c;
  --text: #f2f2f4;
  --text-dim: #8a8a92;
  --pink: #e8879e;
  --pink-dark: #d46b85;
  --common: #b9b9c2;
  --uncommon: #6bcf8d;
  --rare: #4fb8e8;
  --epic: #9b6be8;
  --legendary: #e8975a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 22px 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
}

.logo-img { height: 32px; display: block; }

.wallet-btn {
  background: var(--pink);
  color: #2a1018;
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.wallet-btn:hover { background: var(--pink-dark); }

.rarity-bar {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  padding: 14px 28px;
  background: #101013;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}

.rarity-label { color: var(--text); font-weight: 600; margin-right: 8px; }
.rarity-view { margin-left: auto; text-decoration: underline; cursor: pointer; color: var(--text); }

.rarity-item { display: flex; align-items: center; gap: 6px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.common { background: var(--common); }
.dot.uncommon { background: var(--uncommon); }
.dot.rare { background: var(--rare); }
.dot.epic { background: var(--epic); }
.dot.legendary { background: var(--legendary); }

.carousel-section {
  padding: 60px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.carousel {
  position: relative;
  height: 420px;
  width: 100%;
  max-width: 900px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nft-card {
  position: absolute;
  width: 240px;
  height: 340px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  transition: transform 0.35s ease, opacity 0.35s ease, z-index 0.35s;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.nft-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.nft-card .card-head > div:first-child { min-width: 0; }

.nft-card .card-title {
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nft-card .card-sub {
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nft-card .card-rank { font-size: 11px; color: var(--pink); }

.nft-card .grade {
  text-align: right;
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.nft-card .grade b { display: block; font-size: 16px; color: var(--text); }

.nft-card .card-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  font-size: 10px;
  color: var(--text-dim);
  margin-bottom: 10px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
.nft-card .card-meta div { min-width: 0; }
.nft-card .card-meta b {
  display: block;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.art-box {
  height: 220px;
  border-radius: 8px;
  background: #050506;
  position: relative;
  overflow: hidden;
}

.radar-ring {
  position: absolute;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}

.radar-dot {
  position: absolute;
  border-radius: 50%;
}

.avatar-box {
  height: 220px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

.purchase-panel {
  margin-top: 40px;
  width: 100%;
  max-width: 500px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
}

.qty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.qty-value { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }

.gear-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 30px; height: 30px;
  cursor: pointer;
}

.qty-slider {
  position: relative;
  height: 40px;
  background: #0c0c0f;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.qty-track {
  position: absolute;
  left: 20px; right: 20px;
  height: 2px;
  background: var(--border);
  top: 50%;
  transform: translateY(-50%);
}

.qty-dot {
  width: 12px;
  height: 12px;
  min-width: 12px;
  border-radius: 50%;
  background: #3a3a40;
  position: relative;
  z-index: 2;
  cursor: pointer;
}
.qty-slider { justify-content: space-between; }
.qty-dot.selected { background: var(--pink); box-shadow: 0 0 0 6px rgba(232,135,158,0.2); }

.purchase-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 10px;
  background: var(--pink);
  color: #2a1018;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
.purchase-btn:hover { background: var(--pink-dark); }

.batch-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin: 14px 0 0;
}
.batch-note a { color: var(--text); }

.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 30px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.stat-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.stat-value { color: var(--text); font-weight: 700; }
.stat-desc { font-size: 12px; color: var(--text-dim); margin: 8px 0 0; }

.progress-bar { height: 6px; background: #0c0c0f; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--pink); }

.metrics-row {
  display: flex;
  justify-content: space-around;
  max-width: 900px;
  margin: 0 auto 50px;
  padding: 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.metric { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.metric-label { font-size: 12px; color: var(--text-dim); }
.metric-value { font-size: 18px; font-weight: 700; }

.grid-section { max-width: 1200px; margin: 0 auto; padding: 0 20px 60px; }

.grid-header {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}
.grid-header strong { color: var(--text); }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.tab {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab.active { color: var(--text); border-color: var(--pink); }

.nft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.grid-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.grid-card .card-head { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.grid-card .grade { font-size: 10px; text-align: right; }
.grid-card .grade b { font-size: 14px; display: block; }
.grid-card .card-meta { font-size: 9px; }
.grid-card .art-box, .grid-card .avatar-box { height: 130px; }

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 30px;
  color: var(--text-dim);
  font-size: 13px;
}
.pagination button {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
}
.site-footer a { color: var(--text-dim); margin: 0 6px; text-decoration: none; }
.site-footer a:hover { color: var(--text); }

@media (max-width: 900px) {
  .carousel { height: 380px; }
  .nft-card { width: 200px; height: 290px; padding: 10px; }
  .nft-card .art-box, .nft-card .avatar-box { height: 180px; }
  .topbar { padding: 14px 18px; }
  .rarity-bar { padding: 12px 18px; gap: 16px; }
  .purchase-panel { padding: 18px; }
  .metrics-row { flex-wrap: wrap; gap: 20px; }
}

@media (max-width: 640px) {
  .topbar { padding: 12px 16px; }
  .logo-img { height: 26px; }
  .wallet-btn { padding: 8px 14px; font-size: 13px; }

  .rarity-bar { gap: 10px; font-size: 12px; padding: 10px 16px; }
  .rarity-view { margin-left: 0; }

  .carousel-section { padding: 32px 12px 24px; }
  .carousel { height: 300px; }
  .nft-card { width: 150px; height: 230px; padding: 8px; border-radius: 10px; }
  .nft-card .art-box, .nft-card .avatar-box { height: 130px; }
  .nft-card .card-title { font-size: 12px; }
  .nft-card .card-sub, .nft-card .card-rank { font-size: 9px; }
  .nft-card .grade { font-size: 9px; }
  .nft-card .grade b { font-size: 13px; }
  .nft-card .card-meta { font-size: 8px; }
  .nft-card .card-meta b { font-size: 10px; }

  .purchase-panel { padding: 16px; margin-top: 24px; }

  .stats-row { grid-template-columns: 1fr; padding: 0 16px 24px; }
  .metrics-row { justify-content: flex-start; padding: 16px; }
  .metric { flex: 1 1 40%; }

  .site-footer { flex-direction: column; gap: 8px; padding: 16px; text-align: center; }
}
