:root {
  --bg: #080b10;
  --bg-elevated: #11161f;
  --bg-card: #151c28;
  --border: rgba(255, 255, 255, 0.07);
  --text: #eef2f8;
  --text-muted: #8b95a8;
  --accent: #4d9fff;
  --accent-soft: rgba(77, 159, 255, 0.14);
  --accent-2: #f0c14a;
  --accent-2-soft: rgba(240, 193, 74, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "DM Sans", system-ui, sans-serif;
  --font-display: "Outfit", var(--font);
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(ellipse 100% 70% at 50% -30%, rgba(77, 159, 255, 0.12) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(240, 193, 74, 0.06) 0%, transparent 50%);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #061018;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.85em;
}

code {
  font-family: ui-monospace, monospace;
  font-size: 0.88em;
  padding: 0.12em 0.4em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(8, 11, 16, 0.88);
  backdrop-filter: blur(14px);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  min-width: 0;
}

.brand-mark {
  flex-shrink: 0;
  width: 2.65rem;
  height: 2.65rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(77, 159, 255, 0.25);
}

.brand-title {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  line-height: 1.2;
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.header-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-left: auto;
}

.lang-select {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.42rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  max-width: 11rem;
}

.lang-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
  align-items: center;
}

@media (max-width: 720px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .header-tools {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
}

.nav-tabs button {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-tabs button:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.14);
}

.nav-tabs button[aria-current="page"] {
  color: var(--text);
  border-color: rgba(77, 159, 255, 0.55);
  background: var(--accent-soft);
}

.nav-tabs button.nav-all {
  font-weight: 600;
  color: var(--text);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.view {
  display: none;
  animation: fadeIn 0.35s ease;
}

.view-active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.hero {
  margin-bottom: 2.75rem;
  max-width: 40rem;
}

.hero-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 2.65rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hero-lead {
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  margin: 0;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.hero-stats dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
}

.hero-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.collection-groups {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.lineage-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.nav-back {
  display: inline-flex;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.45rem 0.85rem 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted, #5c6470);
  background: transparent;
  border: 1px solid var(--border, #e2e6ec);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.nav-back:hover {
  color: var(--text, #1a1d21);
  border-color: var(--accent, #3d6bf3);
  background: var(--accent-soft, rgba(77, 159, 255, 0.08));
}

.nav-back:focus-visible {
  outline: 2px solid var(--accent, #3d6bf3);
  outline-offset: 2px;
}

.nav-back__icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.lineage-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted, #5c6470);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lineage-meta {
  margin: 0.5rem 0 0;
}

.lineage-head h2 {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.lineage-head p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.collection-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1rem;
}

.card-collection {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.25rem 1.35rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card-collection:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 159, 255, 0.35);
  box-shadow: var(--shadow);
}

.card-collection:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.card-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.card-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
}

.card-tagline {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
  line-height: 1.45;
}

.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.78rem;
}

.pill {
  display: inline-block;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.pill-count {
  color: var(--accent-2);
  border-color: rgba(240, 193, 74, 0.22);
  background: var(--accent-2-soft);
}

.pill-series {
  color: var(--accent);
  border-color: rgba(77, 159, 255, 0.22);
  background: var(--accent-soft);
}

.home-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.home-footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.65rem;
  margin: 0;
}

.home-footer-links a {
  color: inherit;
  text-decoration: none;
}

.home-footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.muted {
  opacity: 0.8;
}

.collection-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem 2rem;
  margin-bottom: 1.25rem;
}

.collection-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
}

.collection-head h2 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 600;
}

.collection-tagline {
  margin: 0;
  color: var(--text-muted);
  max-width: 36rem;
}

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.search-wrap {
  flex: 1;
  min-width: min(100%, 220px);
}

.search-wrap input,
.select-variant {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
}

.search-wrap input:focus,
.select-variant:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.select-variant {
  width: auto;
  min-width: 11rem;
  cursor: pointer;
}

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

@media (min-width: 640px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }
}

.sticker-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}

.sticker-card:hover {
  border-color: rgba(77, 159, 255, 0.4);
  transform: scale(1.02);
}

.sticker-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.sticker-thumb {
  aspect-ratio: 3 / 4;
  background: #1a2230;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sticker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.35rem;
}

.sticker-info {
  padding: 0.5rem 0.6rem 0.65rem;
  border-top: 1px solid var(--border);
}

.sticker-name {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-id {
  display: block;
  font-size: 0.68rem;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
  margin-top: 0.15rem;
}

.sticker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.3rem;
}

.sticker-badge {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}

.sticker-badge--line {
  background: var(--accent-soft);
  color: var(--accent);
}

.sticker-badge--variant {
  background: var(--accent-2-soft);
  color: var(--accent-2);
}

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

.lightbox {
  padding: 0;
  border: none;
  max-width: min(92vw, 420px);
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow);
}

.lightbox::backdrop {
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
}

.lightbox-figure {
  margin: 0;
}

.lightbox-figure img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #121820;
}

.lightbox-figure figcaption {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.lightbox-collection {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lightbox-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  background: rgba(77, 159, 255, 0.45);
}
