:root {
  --bg: #07101d;
  --bg-2: #0d1728;
  --panel: rgba(15, 23, 38, 0.94);
  --panel-2: rgba(17, 28, 48, 0.96);
  --line: rgba(255, 255, 255, 0.08);
  --text: #edf4ff;
  --muted: #9fb2d9;
  --accent: #79d7ff;
  --accent-2: #6ef0ab;
  --accent-3: #ffd86f;
  --owned: #7be5a3;
  --evolve: #ffd166;
  --missing: #ff8f9d;
  --unreleased: #aeb9d4;
  --unavailable: #7d88a6;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(121, 215, 255, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(110, 240, 171, 0.08), transparent 18%),
    linear-gradient(180deg, #040a14 0%, #09111f 32%, #0d1426 100%);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body {
  padding: 14px;
}

a,
button,
input {
  font: inherit;
}

.app-shell {
  max-width: 1800px;
  margin: 0 auto;
}

.panel,
.grid-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  padding: 16px 18px;
}

.topbar {
  background: transparent;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding: 0 0 12px;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 11px;
  font-weight: 700;
}

.topbar h1,
.stats-head h2,
.grid-head h2 {
  margin: 0;
}

.lede,
.count-note {
  color: var(--muted);
}

.lede {
  max-width: 760px;
  margin: 8px 0 0;
  line-height: 1.5;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  background: #111d33;
  font-weight: 700;
}

.panel,
.grid-panel {
  padding: 14px;
}

main {
  display: grid;
  gap: 12px;
}

.dex-mode-bar,
.chip-group,
.summary-pills,
.availability-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#regionFilterBar {
  margin-top: 12px;
}

.mode-btn,
.filter-btn,
.mini-pill,
.availability-pill,
.status-btn,
.availability-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #111c31;
  color: var(--text);
}

.mode-btn,
.filter-btn {
  min-height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.mode-btn.active,
.filter-btn.active {
  background: linear-gradient(135deg, rgba(121, 215, 255, 0.28), rgba(110, 240, 171, 0.24));
  border-color: rgba(121, 215, 255, 0.35);
}

.control-row {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  margin-top: 12px;
}

.search-wrap {
  display: grid;
  gap: 4px;
  min-width: 280px;
}

.search-wrap span,
.toggle span {
  font-size: 11px;
  color: var(--muted);
}

.search-wrap input {
  height: 40px;
  min-width: 260px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #091426;
  color: var(--text);
}

.toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0d182c;
}

.toggle input {
  margin: 0;
}

.stats-head,
.grid-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.stats-head.compact {
  margin-bottom: 8px;
}

.mini-pill,
.availability-pill {
  padding: 7px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.summary-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

.summary-table th,
.summary-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-table th {
  background: #14203a;
  position: sticky;
  top: 0;
}

.summary-table tfoot td {
  font-weight: 700;
  background: rgba(121, 215, 255, 0.08);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.dex-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  border: 1px solid rgba(121, 215, 255, 0.3);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(121, 215, 255, 0.08));
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 10px 0;
}

.dex-number {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tag {
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

.tag.unreleased {
  color: #d7e0f8;
}

.tag.regional {
  color: #9ff0ff;
}

.tag.alt {
  color: #ffd86f;
}

.tag.dismissed {
  color: #b8c5e8;
}

.sprite-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 154px;
  padding: 10px 10px 4px;
}

.sprite-wrap img {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.25));
}

.sprite-badge {
  position: absolute;
  right: 10px;
  bottom: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  font-size: 10px;
  font-weight: 700;
}

.card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 12px;
}

.pokemon-name {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
}

.subline {
  color: var(--muted);
  font-size: 12px;
}

.status-btn,
.availability-btn {
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  cursor: pointer;
  font-weight: 700;
}

.status-owned {
  color: #031018;
  background: var(--owned);
}

.status-can-evolve {
  color: #251600;
  background: var(--evolve);
}

.status-missing {
  color: white;
  background: rgba(255, 143, 157, 0.72);
}

.status-unreleased {
  background: rgba(174, 185, 212, 0.26);
  color: var(--text);
}

.availability-btn.available {
  background: rgba(110, 240, 171, 0.18);
}

.availability-btn.unavailable {
  background: rgba(174, 185, 212, 0.18);
  color: var(--muted);
}

.release-btn {
  width: 100%;
  min-height: 32px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.release-btn.is-unreleased {
  color: #f5d8de;
  border-color: rgba(255, 143, 157, 0.35);
  background: rgba(255, 143, 157, 0.1);
}

.release-btn.is-released {
  color: #c6d6f2;
  border-color: rgba(121, 215, 255, 0.24);
}

.mode-only {
  display: none;
}

.mode-availability.visible {
  display: block;
}

.toggle.mode-availability.visible {
  display: inline-flex;
}

.empty-state {
  padding: 30px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

@media (max-width: 900px) {
  body {
    padding: 8px;
  }

  .topbar,
  .stats-head,
  .grid-head {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrap,
  .search-wrap input {
    min-width: 100%;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  }
}
