/* Stylesheet for the generated reference pages (scripts/build-seo.mjs):
   /sprites/, /sprites/<id>/, /variants/, /faq/ and their /es/ twins.

   Separate from site/style.css, which dresses the legal pages as a plain
   light/dark document. These are funnel pages and wear the app's palette —
   the same values as site/index.html, iOS DesignSystem/ and web/src/styles/
   tokens.css (CLAUDE.md lists the palette as mirrored in five places; this
   consumes those values, it does not introduce new ones).

   No web fonts on purpose: these pages are read after a search-result click,
   where the first paint is the whole impression, and a font request on the
   critical path is the cheapest LCP regression there is. */

:root {
  --bg: #08070d;
  --bg-raised: #120d26;
  --violet: #a78bfa;
  --pink: #f472b6;
  --purple: #8b5cf6;
  --ink: #ffffff;
  --ink-dim: rgba(230, 225, 255, 0.68);
  --ink-faint: rgba(255, 255, 255, 0.38);
  --rule: rgba(255, 255, 255, 0.09);
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);

  --rarity-rare: #38bdf8;
  --rarity-epic: #c084fc;
  --rarity-legendary: #fbbf24;
  --rarity-mythic: #fb7185;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.65 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--violet); }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ---------------------------------------------------------------- chrome */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(8, 7, 13, 0.86);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}

.bar {
  max-width: 62rem; margin: 0 auto; padding: 0.7rem 1.25rem;
  display: flex; align-items: center; gap: 1.1rem; flex-wrap: wrap;
}

.brand {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.05rem;
}
.brand img { border-radius: 0.5rem; }

.topbar .links { display: flex; gap: 1.1rem; margin-right: auto; font-size: 0.95rem; font-weight: 600; }
.topbar .links a { color: var(--ink-dim); text-decoration: none; white-space: nowrap; }
.topbar .links a:hover { color: var(--ink); }

.topbar .lang {
  color: var(--ink-dim); text-decoration: none; font-size: 0.85rem; font-weight: 700;
  border: 1px solid var(--rule); border-radius: 100px; padding: 0.25rem 0.75rem;
  white-space: nowrap;
}
.topbar .lang:hover { color: var(--ink); border-color: var(--ink-faint); }

.topbar .cta {
  background: var(--accent-gradient); color: #fff; text-decoration: none;
  border-radius: 0.7rem; padding: 0.5rem 1.05rem;
  font-size: 0.9rem; font-weight: 800; white-space: nowrap;
}

.wrap { max-width: 52rem; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

.crumbs { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 1.5rem; }
.crumbs a { color: var(--ink-dim); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { margin: 0 0.5rem; opacity: 0.5; }

/* ------------------------------------------------------------- typography */

h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.12; letter-spacing: -0.02em; font-weight: 800;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  line-height: 1.25; letter-spacing: -0.01em; font-weight: 800;
  margin: 3rem 0 0.9rem;
}

p { margin: 0 0 1rem; }
.lede { font-size: 1.1rem; color: var(--ink-dim); line-height: 1.6; }
.counts { color: var(--ink-dim); font-size: 0.95rem; }
.counts strong { color: var(--violet); font-size: 1.15rem; }

.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.85rem 0; }
.badge {
  display: inline-block; font-size: 0.78rem; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--rule); border-radius: 100px;
  padding: 0.25rem 0.7rem; color: var(--ink-dim);
}
.badge.perk { border-color: rgba(167, 139, 250, 0.45); color: var(--violet); }

/* Rarity is carried on the container so both the badge and the card edge can
   read it without a second class per element. */
.rarity-rare .badge.rarity, .rarity-rare .nm { color: var(--rarity-rare); }
.rarity-epic .badge.rarity, .rarity-epic .nm { color: var(--rarity-epic); }
.rarity-legendary .badge.rarity, .rarity-legendary .nm { color: var(--rarity-legendary); }
.rarity-mythic .badge.rarity, .rarity-mythic .nm { color: var(--rarity-mythic); }
.badge.rarity { border-color: currentColor; }

/* ------------------------------------------------------------------ cards */

.sprite-grid {
  display: grid; gap: 0.85rem; margin: 1.75rem 0;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
}
.sprite-grid.small { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }

.sprite-card {
  display: block; text-align: center; text-decoration: none; color: var(--ink);
  background: var(--bg-raised); border: 1px solid var(--rule);
  border-radius: 0.9rem; padding: 1rem 0.6rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.sprite-card:hover { transform: translateY(-3px); border-color: rgba(167, 139, 250, 0.5); }
.sprite-card img { width: 5rem; height: 5rem; object-fit: contain; margin: 0 auto 0.6rem; }
.sprite-card .noart {
  display: grid; place-items: center; width: 5rem; height: 5rem;
  margin: 0 auto 0.6rem; color: var(--ink-faint); font-size: 2rem;
}
.sprite-card .nm { display: block; font-weight: 800; font-size: 0.95rem; }
.sprite-card .mt { display: block; color: var(--ink-faint); font-size: 0.75rem; margin-top: 0.15rem; }

.sprite-hero {
  display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.sprite-hero img { width: 11rem; height: 11rem; object-fit: contain; flex: none; }
.sprite-hero > div { flex: 1 1 18rem; }
.sprite-hero h1 { margin-bottom: 0; }

/* ----------------------------------------------------------------- tables */

/* The scroll container is the wrapper, never <body> — a wide variant table
   must not make the whole page scroll sideways on a phone. */
.tablewrap { overflow-x: auto; margin: 1.25rem 0 0; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 0.95rem; min-width: 30rem; }
th, td {
  text-align: left; padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--rule); vertical-align: middle;
}
thead th { color: var(--ink-faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
tbody th { font-weight: 800; white-space: nowrap; }
td { color: var(--ink-dim); }
table a { text-decoration: none; font-weight: 800; }
table a:hover { text-decoration: underline; }

table.variants { min-width: 24rem; }
td.art { width: 4.5rem; padding-right: 0; }
td.art img { width: 3.25rem; height: 3.25rem; object-fit: contain; }

/* ------------------------------------------------------------------ style */

.style-block { padding-top: 0.5rem; }
.style-block + .style-block { border-top: 1px solid var(--rule); margin-top: 2.5rem; }
.style-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.style-head img { width: 5.5rem; height: 5.5rem; object-fit: contain; flex: none; }
.style-head h2 { margin: 0; }
.style-head > div { flex: 1 1 16rem; }
.owners { font-size: 0.95rem; color: var(--ink-dim); }
.owners a { text-decoration: none; }
.owners a:hover { text-decoration: underline; }

.faq-item + .faq-item { border-top: 1px solid var(--rule); padding-top: 0.5rem; }
.faq-item h2 { font-size: 1.2rem; }
.faq-item p { color: var(--ink-dim); }

.backlink { margin-top: 2.5rem; font-weight: 700; }
.backlink a { text-decoration: none; }

/* -------------------------------------------------------------------- cta */

.cta-card {
  margin: 3rem 0 0;
  background: linear-gradient(160deg, #1c1240 0%, #120d26 100%);
  border: 1px solid rgba(167, 139, 250, 0.28);
  border-radius: 1.1rem; padding: 1.75rem;
}
.cta-card h2 { margin: 0 0 0.6rem; font-size: 1.35rem; }
.cta-card p { color: var(--ink-dim); font-size: 0.98rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.25rem 0 0; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 800; font-size: 0.95rem;
  border-radius: 0.75rem; padding: 0.7rem 1.3rem;
  border: 1.5px solid var(--rule); color: var(--ink);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--ink-faint); }
.btn.primary { background: var(--accent-gradient); border-color: transparent; color: #fff; }

/* ----------------------------------------------------------------- footer */

.sitefoot {
  border-top: 1px solid var(--rule);
  background: #06050a;
  padding: 2rem 0 3rem;
}
.sitefoot .bar { display: block; max-width: 52rem; }
.sitefoot .links { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: 0.9rem; font-weight: 700; }
.sitefoot .links a { color: var(--ink-dim); text-decoration: none; }
.sitefoot .links a:hover { color: var(--ink); }
.sitefoot .disclaimer { color: var(--ink-faint); font-size: 0.82rem; line-height: 1.55; margin-top: 1.25rem; }
.sitefoot .disclaimer a { color: var(--ink-faint); }
.sitefoot .fine { color: var(--ink-faint); font-size: 0.8rem; margin: 0; }

@media (max-width: 34rem) {
  .topbar .links { gap: 0.85rem; font-size: 0.88rem; }
  .topbar .cta { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
  .sprite-hero img { width: 7.5rem; height: 7.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
