:root { --accent: var(--pink); }

body { padding: 0 24px 64px; }

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  width: 100%;
  max-width: 720px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 40px;
}

/* ── Main content ────────────────────────────────────────────────────────── */
main {
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

h2 {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--text);
  letter-spacing: -0.01em;
}

/* ── Search bar ──────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 12px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

#nick-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  padding: 13px 18px;
  transition: border-color .15s ease;
}
#nick-input::placeholder { color: var(--text-muted); }
#nick-input:focus { border-color: rgba(255,95,162,0.5); }

#search-btn {
  background: var(--pink);
  border: none;
  border-radius: 10px;
  color: var(--bg);
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 28px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
#search-btn:hover {
  background: #ff77b3;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255,95,162,0.3);
}
#search-btn:active { transform: translateY(0); }

/* ── Autocomplete dropdown ───────────────────────────────────────────────── */
.suggest-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.45);
  max-height: 320px;
  overflow-y: auto;
}

.suggest-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
}
.suggest-item:hover,
.suggest-item.active { background: rgba(255,95,162,0.14); }

.suggest-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.suggest-bp {
  flex: none;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Results area ────────────────────────────────────────────────────────── */
#results {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.status {
  color: var(--text-muted);
  text-align: center;
  font-size: 15px;
  padding: 24px 0;
}

.error {
  color: var(--danger);
  font-size: 14px;
  padding: 16px 20px;
  background: rgba(248,113,113,0.08);
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 8px;
}

/* ── Snapshot list ───────────────────────────────────────────────────────── */
.snapshots-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: -4px;
}

.snapshot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.snapshot-btn {
  width: 100%;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 14px 20px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.snapshot-btn:hover {
  border-color: rgba(255,95,162,0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.snapshot-btn.active {
  border-color: var(--pink);
  box-shadow: 0 0 0 1px var(--pink), 0 4px 20px rgba(255,95,162,0.2);
}

.snap-date {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.04em;
}

/* ── Stat cards ──────────────────────────────────────────────────────────── */
#stat-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 4px;
}

.stat-cards {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-value {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 36px;
  color: var(--pink);
  letter-spacing: -0.01em;
  line-height: 1;
}

/* ── Artifacts ───────────────────────────────────────────────────────────── */
.artifacts-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.artifacts-label {
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

.artifact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.artifact-chip {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
}

/* Grade rarity tints (Grade3 < Grade4 < Grade5) */
.artifact-chip.grade3 {
  color: #c79bff;
  border-color: rgba(199,155,255,0.45);
  background: rgba(199,155,255,0.10);
}
.artifact-chip.grade4 {
  color: #ffcf5c;
  border-color: rgba(255,207,92,0.5);
  background: rgba(255,207,92,0.12);
}
.artifact-chip.grade5 {
  color: #2dd4bf;
  border-color: rgba(45,212,191,0.45);
  background: rgba(45,212,191,0.12);
}
