:root {
  --bg: #0c1016;
  --bg-2: #141a24;
  --ink: #eef3f8;
  --muted: #9aa8b8;
  --line: rgba(255, 255, 255, 0.08);
  --gold: #e2b04a;
  --gold-soft: #f3d48a;
  --foil: #7ee0d0;
  --commune: #c5cdd8;
  --shiny: #d7b4ff;
  --fullart: #e2b04a;
  --shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "spartan-variable", "Spartan", sans-serif;
  background:
    radial-gradient(900px 480px at 80% -10%, rgba(126, 224, 208, 0.12), transparent 50%),
    radial-gradient(700px 420px at 0% 100%, rgba(226, 176, 74, 0.1), transparent 46%),
    var(--bg);
  color: var(--ink);
}

img { max-width: 100%; display: block; }
button, input { font: inherit; }
a { color: var(--foil); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(16px);
  background: rgba(12, 16, 22, 0.88);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 78rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: space-between;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  color: var(--gold);
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -0.03em;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stat {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.stat strong {
  color: var(--ink);
  font-weight: 700;
}

.nav {
  display: flex;
  gap: 0.4rem;
  width: 100%;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 650;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.nav a:hover { color: var(--ink); }
.nav a.is-active {
  color: var(--bg);
  background: var(--ink);
}

.toolbar {
  max-width: 78rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tab {
  appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 650;
}

.tab:hover { color: var(--ink); border-color: rgba(255,255,255,0.2); }

.tab.is-active {
  color: var(--bg);
  background: var(--ink);
  border-color: var(--ink);
}

.tab[data-filter="shiny"].is-active { background: linear-gradient(90deg, #9ee7dc, #d7b4ff, #f3d48a); }
.tab[data-filter="fullart"].is-active { background: var(--gold); color: #1a1408; }

.search {
  min-width: min(18rem, 100%);
}

.search input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}

.stage {
  max-width: 78rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3.5rem;
}

.count {
  margin: 0 0 1rem;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13.5rem, 1fr));
  gap: 1.2rem;
}

.card {
  position: relative;
  aspect-ratio: 63 / 88;
  border: 0;
  padding: 0;
  background: #0a0d12;
  border-radius: 1.1rem;
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(0) rotateY(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-shine,
.card-foil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: color-dodge;
  transition: opacity 0.2s ease;
}

.card-shine {
  background: linear-gradient(115deg, transparent 32%, rgba(255,255,255,0.55) 50%, transparent 68%);
  background-size: 220% 220%;
}

.card.is-shiny {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(126, 224, 208, 0.45);
}
.card.is-fullart {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(226, 176, 74, 0.55);
}

.card.is-shiny .card-foil {
  opacity: 0.4;
  background: linear-gradient(125deg, #7ee0d0, #d7b4ff 40%, #f3d48a 70%, #7ee0d0);
  mix-blend-mode: overlay;
}
.card.is-fullart .card-foil {
  opacity: 0.22;
  background: linear-gradient(125deg, #e2b04a, #fff3c4 45%, #7ee0d0);
  mix-blend-mode: overlay;
}

.card:hover,
.card:focus-visible {
  box-shadow: var(--shadow);
  outline: none;
}

.card.is-shiny:hover .card-shine,
.card.is-fullart:hover .card-shine,
.card.is-shiny:focus-visible .card-shine,
.card.is-fullart:focus-visible .card-shine {
  opacity: 1;
}

.badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.72);
  color: var(--commune);
  backdrop-filter: blur(8px);
}

.badge-shiny { color: #ead7ff; }
.badge-fullart { color: var(--gold-soft); }

.card-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.4rem 0.8rem 0.8rem;
  background: linear-gradient(transparent, rgba(8, 10, 14, 0.92));
  text-align: left;
}

.card-meta strong {
  display: block;
  font-size: 1.05rem;
}

.card-meta small {
  color: var(--muted);
}

.empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 1.25rem;
  background: rgba(5, 7, 10, 0.86);
  backdrop-filter: blur(10px);
}

.lightbox.is-open { display: grid; }

.lightbox-card {
  width: min(92vw, 28rem);
  display: grid;
  gap: 1rem;
}

.lightbox-frame {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.lightbox-frame img {
  width: 100%;
  display: block;
}

.lightbox-info {
  text-align: center;
}

.lightbox-info h2 {
  margin: 0 0 0.3rem;
  font-size: 1.7rem;
}

.lightbox-info p {
  margin: 0.2rem 0;
  color: var(--muted);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(12, 16, 22, 0.8);
  color: var(--ink);
  cursor: pointer;
  border-radius: 999px;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 2.6rem;
  height: 2.6rem;
  font-size: 1.4rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.8rem;
  height: 2.8rem;
  font-size: 1.4rem;
}

.lightbox-nav.prev { left: 0.8rem; }
.lightbox-nav.next { right: 0.8rem; }

.site-footer {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.88rem;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}
.stat-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
}
.stat-card span {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold-soft);
}
.stat-card small { color: var(--muted); }

.block { margin: 2rem 0; }
.block h2 { margin: 0 0 0.9rem; font-size: 1.3rem; }
.muted { color: var(--muted); }

.bars { list-style: none; margin: 0; padding: 0; }
.bars li {
  display: grid;
  grid-template-columns: 7.5rem 1fr 4.5rem;
  gap: 0.6rem;
  align-items: center;
  margin: 0.45rem 0;
}
.bar-label { color: var(--muted); font-size: 0.9rem; }
.bar-track {
  height: 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 99px;
  overflow: hidden;
}
.bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--foil), var(--gold));
  border-radius: 99px;
}
.bar-value { text-align: right; font-weight: 700; }

.rank { list-style: none; margin: 0; padding: 0; }
.rank li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.rank small { display: block; color: var(--muted); }
.rank span { font-weight: 800; color: var(--gold-soft); }

.table-wrap { overflow-x: auto; }
.inventory {
  width: 100%;
  border-collapse: collapse;
}
.inventory th, .inventory td {
  text-align: left;
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.inventory small { display: block; color: var(--muted); font-weight: 500; }
.inventory .is-out strong { color: var(--gold); }
.inventory .is-over strong { color: #ff8a8a; }

.booster-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.9rem;
}
.booster {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.9rem 1rem 1rem;
}
.booster h3 { margin: 0; }
.booster ol { list-style: none; margin: 0.8rem 0 0; padding: 0; }
.booster li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.28rem 0;
  color: var(--muted);
}
.booster li span { color: var(--ink); }
.tag-commune, .tag-shiny, .tag-fullart {
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.tag-commune { color: var(--commune); }
.tag-shiny { color: var(--shiny); }
.tag-fullart { color: var(--fullart); }

@media (max-width: 700px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .lightbox-nav { display: none; }
  .bars li { grid-template-columns: 5.5rem 1fr 3.6rem; }
}
