:root {
  --bg: #111827;
  --panel: #1f2937;
  --text: #f9fafb;
  --muted: #9ca3af;
  --released: #14532d;
  --unreleased: #7f1d1d;
  --owned: #1d4ed8;
  --shinyOwned: #7c3aed;
  --border: rgba(255,255,255,0.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar, .panel {
  max-width: 1400px;
  margin: 16px auto;
  padding: 16px;
}
.topbar {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
}
.auth-columns, .controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.auth-form {
  display: grid;
  gap: 8px;
}
input, select, button {
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 12px;
  font-size: 14px;
}
input, select {
  background: #0b1220;
  color: var(--text);
}
button {
  cursor: pointer;
  background: #2563eb;
  color: white;
}
button.secondary { background: #374151; }
.hidden { display: none !important; }
.message, .muted { color: var(--muted); }
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}
.grid {
  max-width: 1400px;
  margin: 16px auto 40px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
}
.card {
  position: relative;
  min-height: 220px;
  text-align: center;
  background: #374151;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 10px;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card.released { background: var(--released); }
.card.unreleased { background: var(--unreleased); }
.card.owned { outline: 3px solid var(--owned); }
.card.shiny-owned { outline: 3px solid var(--shinyOwned); }
.badge {
  position: absolute;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 14px;
}
.badge-left { left: 8px; }
.badge-right { right: 8px; }
.sprite-wrap {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  margin-top: 16px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  overflow: hidden;
}
.sprite {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
}
.sprite-fallback {
  font-size: 12px;
}
.dex-number {
  font-weight: bold;
  margin-top: 2px;
  color: rgba(255,255,255,0.85);
}
.pokemon-name {
  margin-top: 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}
.pokemon-region {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.8);
}
.owned-state {
  margin-top: auto;
  font-size: 12px;
  color: rgba(255,255,255,0.95);
  background: rgba(15, 23, 42, 0.24);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 6px 10px;
}
@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
}
