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

   ONE SITE WITH THE APP. Since 2 November 2026 these pages wear the web app's
   own surfaces (web/src/styles/tokens.css): a light grey page with white cards
   for everybody, and the dark variant when the visitor chose it with the
   header's switch — `data-theme="dark"` on <html>, written by /theme-boot.js
   (staged from web/public). The page tokens below (`--page`, `--card`, `--text`
   …) are copies of that file's `--color-*` values; keep the two in step.

   THE FIRST :root BLOCK IS NOT THE PAGE'S COLOURS. It is the mirrored BRAND
   palette, and scripts/art/palette.mjs reads exactly that block (the first
   `:root {` in this file) to build the swatch every generated picture is
   anchored to. Its `--bg` is the art's near-black violet ground. Leave it
   first, leave its names alone, and never use it to colour a page.

   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. */

/* The BRAND palette (read by scripts/art/palette.mjs) — not the page colours. */
:root {
  --bg: #08070d;
  --bg-raised: #120d26;
  --violet: #a78bfa;
  --pink: #f472b6;
  --purple: #8b5cf6;
  /* Two more brand hues, read by scripts/art/palette.mjs for the art tool's palette
     swatch (it reads this :root since 6 September 2026, when web/src/styles/tokens.css
     stopped carrying the brand palette). Mirrored with the other copies of the brand hues. */
  --purple2: #a855f7;
  --cyan: #22d3ee;
  --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;
}

/* The page, light — web/src/styles/tokens.css `@theme`. */
:root {
  color-scheme: light;
  --page: #f2f3f5;
  --card: #ffffff;
  --card-2: #f6f7f9;
  --card-3: #eceef2;
  --line: #e4e5e9;
  --line-strong: #d3d5db;
  --text: #17181c;
  --text-dim: #5f6370;
  --text-faint: #7a7e89;
  --header: rgba(255, 255, 255, 0.86);
  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-fg: #ffffff;
  --accent-soft: rgba(124, 58, 237, 0.1);
  --accent-line: rgba(124, 58, 237, 0.3);
  --r-rare: #0284c7;
  --r-epic: #9333ea;
  --r-legendary: #d97706;
  --r-mythic: #e11d48;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 6px rgba(16, 24, 40, 0.06);
}

/* The page, dark — the same file's `:root[data-theme="dark"]`. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111114;
  --card: #18181c;
  --card-2: #1f1f24;
  --card-3: #27272d;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.15);
  --text: #f4f4f5;
  --text-dim: #a1a1aa;
  --text-faint: #7a7a84;
  --header: rgba(17, 17, 20, 0.86);
  --accent: #8b5cf6;
  --accent-hover: #a78bfa;
  --accent-fg: #0b0b0d;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-line: rgba(139, 92, 246, 0.35);
  --r-rare: #38bdf8;
  --r-epic: #a855f7;
  --r-legendary: #f59e0b;
  --r-mythic: #f43f5e;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
  --shadow-pop: 0 16px 48px rgba(0, 0, 0, 0.55);
}

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

body {
  background: var(--page);
  color: var(--text);
  font: 400 16.5px/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(--accent); }
a:hover { color: var(--accent-hover); }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------------------------------------------------------------- chrome
   The app's own header (web/src/components/shell/TopBar.tsx + SecondaryNav.tsx):
   a bar with the word mark, search and tools, the portal's sections under it
   as underlined tabs, and — on a Sprites page — the section's pages as pills
   (SectionTabs.tsx). The lists are PORTAL_NAV / SPRITES_MENU in
   scripts/build-seo.mjs, copies of the app's nav.ts; site/bot.html carries a
   copy of these rules under `.sc-` names. */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--header);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.bar, .sections {
  max-width: 80rem; margin: 0 auto; padding: 0 1.5rem;
}
.bar { height: 3.5rem; display: flex; align-items: center; gap: 0.75rem; }

.brand {
  display: flex; align-items: center; gap: 0.55rem; flex: none;
  text-decoration: none; color: var(--text); font-weight: 700; font-size: 1rem; letter-spacing: -0.01em;
}
.brand:hover { color: var(--text); }
.brand img { border-radius: 0.5rem; }

.search {
  flex: 1; display: flex; justify-content: center; min-width: 0;
}
.search a {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; max-width: 28rem; height: 2.25rem;
  padding: 0 0.75rem; border: 1px solid var(--line); border-radius: 0.5rem; background: var(--card-2);
  color: var(--text-faint); text-decoration: none; font-size: 0.82rem;
}
.search a:hover { background: var(--card-3); color: var(--text-faint); }
.search svg { width: 1rem; height: 1rem; flex: none; }
.search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tools { display: flex; align-items: center; gap: 0.4rem; flex: none; }
/* The search field's stand-in on a phone, as the app's bar does it. */
.search-icon {
  display: none; place-items: center; width: 2.25rem; height: 2.25rem; margin-left: auto;
  border-radius: 0.5rem; color: var(--text-dim);
}
.search-icon:hover { background: var(--card-3); color: var(--text); }
.search-icon svg { width: 1.1rem; height: 1.1rem; }

.theme-toggle {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border: 0; border-radius: 0.5rem; background: transparent; color: var(--text-dim); cursor: pointer;
}
.theme-toggle:hover { background: var(--card-3); color: var(--text); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }

.topbar .lang {
  color: var(--text-dim); text-decoration: none; font-size: 0.8rem; font-weight: 600;
  border: 1px solid var(--line); border-radius: 0.5rem; padding: 0.3rem 0.6rem; white-space: nowrap;
}
.topbar .lang:hover { color: var(--text); border-color: var(--line-strong); }

.topbar .cta {
  background: var(--accent); color: var(--accent-fg); text-decoration: none;
  border-radius: 0.5rem; padding: 0.45rem 0.85rem;
  font-size: 0.82rem; font-weight: 600; white-space: nowrap;
}
.topbar .cta:hover { background: var(--accent-hover); color: var(--accent-fg); }

/* The sections: the app's underlined tabs, sitting on the header's own rule. */
.sections {
  display: flex; align-items: stretch; gap: 0.25rem; margin-bottom: -1px;
  font-size: 0.82rem; font-weight: 500;
}
.sections > a, .menu > summary {
  display: flex; align-items: center; gap: 0.25rem; height: 2.5rem; padding: 0 0.75rem;
  border-bottom: 2px solid transparent; color: var(--text-dim);
  text-decoration: none; white-space: nowrap; cursor: pointer;
}
.sections > a:hover, .menu > summary:hover { color: var(--text); border-bottom-color: var(--line-strong); }
.sections > a[aria-current="page"], .menu.on > summary { color: var(--text); border-bottom-color: var(--accent); }

/* The Sprites menu: a <details>, so it opens with no script and every link in
   it is plain HTML a crawler reads. */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after { content: "▾"; font-size: 0.7rem; opacity: 0.6; }
.menu[open] > summary { color: var(--text); }
.menu-panel {
  position: absolute; top: calc(100% + 0.35rem); left: 0; z-index: 60;
  display: grid; gap: 0.15rem; min-width: 17rem; padding: 0.4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem;
  box-shadow: var(--shadow-pop);
}
.menu-panel a {
  display: block; padding: 0.5rem 0.65rem; border-radius: 0.5rem;
  color: var(--text); text-decoration: none; font-size: 0.84rem; font-weight: 600; line-height: 1.3;
}
.menu-panel a span { display: block; color: var(--text-faint); font-weight: 400; font-size: 0.76rem; }
.menu-panel a:hover { background: var(--card-3); color: var(--text); }
.menu-panel a[aria-current="page"] { background: var(--accent-soft); }

/* A Sprites page's sub-tabs: the section's pages as pills, under the header
   rather than in it, so a third row is never pinned over a phone's screen. */
.subtabs { background: var(--card); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs-row {
  display: flex; gap: 0.4rem; width: max-content; min-width: 100%;
  max-width: 80rem; margin: 0 auto; padding: 0.6rem 1.5rem;
}
@media (min-width: 83rem) { .subtabs-row { width: 80rem; min-width: 0; } }
.subtabs a {
  display: flex; align-items: center; height: 2.25rem; padding: 0 0.9rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card-2);
  color: var(--text-dim); text-decoration: none; white-space: nowrap; font-size: 0.82rem; font-weight: 500;
}
.subtabs a:hover { color: var(--text); border-color: var(--line-strong); }
.subtabs a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }

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

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

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

h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.6rem);
  line-height: 1.12; letter-spacing: -0.025em; font-weight: 750;
  margin-bottom: 0.75rem;
}

h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.5rem);
  line-height: 1.25; letter-spacing: -0.015em; font-weight: 700;
  margin: 2.75rem 0 0.85rem;
}

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

.badges { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 0.85rem 0; }
.badge {
  display: inline-block; font-size: 0.74rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  border: 1px solid var(--line); background: var(--card); border-radius: 100px;
  padding: 0.22rem 0.65rem; color: var(--text-dim);
}
.badge.perk { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }

/* 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(--r-rare); }
.rarity-epic .badge.rarity, .rarity-epic .nm { color: var(--r-epic); }
.rarity-legendary .badge.rarity, .rarity-legendary .nm { color: var(--r-legendary); }
.rarity-mythic .badge.rarity, .rarity-mythic .nm { color: var(--r-mythic); }
.badge.rarity { border-color: currentColor; }

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

.sprite-grid {
  display: grid; gap: 0.75rem; margin: 1.5rem 0;
  grid-template-columns: repeat(auto-fill, minmax(9.25rem, 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(--text);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  border-radius: 0.8rem; padding: 0.95rem 0.6rem;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.sprite-card:hover { transform: translateY(-2px); border-color: var(--accent-line); color: var(--text); }
.sprite-card img {
  width: 5rem; height: 5rem; object-fit: contain; margin: 0 auto 0.6rem;
  background: var(--card-2); border-radius: 0.6rem; padding: 0.25rem;
}
.sprite-card .noart {
  display: grid; place-items: center; width: 5rem; height: 5rem;
  margin: 0 auto 0.6rem; color: var(--text-faint); font-size: 2rem;
}
.sprite-card .nm { display: block; font-weight: 700; font-size: 0.92rem; }
.sprite-card .mt { display: block; color: var(--text-faint); font-size: 0.74rem; 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;
  background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 0.5rem;
}
.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;
  background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem; box-shadow: var(--shadow);
}

table { width: 100%; border-collapse: collapse; font-size: 0.93rem; min-width: 30rem; }
th, td {
  text-align: left; padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line); vertical-align: middle;
}
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
thead th {
  color: var(--text-faint); font-size: 0.74rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; background: var(--card-2);
}
tbody th { font-weight: 700; white-space: nowrap; }
td { color: var(--text-dim); }
table a { text-decoration: none; font-weight: 700; }
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; background: var(--card-2); border-radius: 0.5rem; }

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

/* The row of links to /variants/<style>/ on the index and on each style page.
   Styled off .badge so a chip and a badge read as the same object — one is a
   fact about the page, the other a door to another one. */
.style-row { display: flex; flex-wrap: wrap; gap: 0.45rem; margin: 1.5rem 0 0; }
.style-chip {
  display: inline-block;
  padding: 0.38rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.style-chip:hover { color: var(--accent); border-color: var(--accent-line); }

.style-block { padding-top: 0.5rem; }
.style-head h2 a { color: inherit; text-decoration: none; }
.style-head h2 a:hover { color: var(--accent); }
.style-block + .style-block { border-top: 1px solid var(--line); 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;
  background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem;
}
.style-head h2 { margin: 0; }
.style-head > div { flex: 1 1 16rem; }
.owners { font-size: 0.93rem; color: var(--text-dim); }
.owners a { text-decoration: none; }
.owners a:hover { text-decoration: underline; }

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

/* The news section. .post is the one place on these pages long-form prose runs,
   so it is the one place lists and third-level headings need dressing: the reset
   at the top of this file takes their margins and markers away. */
.post h3 { font-size: 1.08rem; font-weight: 700; margin: 1.25rem 0 0.4rem; }
.post ul, .post ol { margin: 0 0 1rem; padding-left: 1.4rem; color: var(--text-dim); }
.post li { margin-bottom: 0.4rem; }
.post .faq-item p { margin-bottom: 1rem; }
.post-card { width: 100%; height: auto; border-radius: 0.9rem; margin: 1.25rem 0 1.5rem; border: 1px solid var(--line); }
.byline { color: var(--text-faint); font-size: 0.88rem; margin-top: 0.6rem; }

.news-callout {
  margin: 1rem 0 0; padding: 0.7rem 0.95rem; font-weight: 600; font-size: 0.95rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 0.8rem; box-shadow: var(--shadow);
}
.news-callout a { text-decoration: none; }
.news-callout a:hover { text-decoration: underline; }
.news-callout .tag {
  display: inline-block; margin-right: 0.4rem; padding: 0.05rem 0.5rem; border-radius: 100px;
  background: var(--accent); color: var(--accent-fg); font-size: 0.72rem; font-weight: 700;
}

.news-list { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.news-card a {
  display: block; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 0.9rem; box-shadow: var(--shadow);
}
.news-card a:hover { border-color: var(--accent-line); color: inherit; }
.news-card img { width: 100%; height: auto; }
.news-card div { padding: 1rem 1.1rem 1.15rem; }
.news-card time { color: var(--text-faint); font-size: 0.83rem; }
.news-card h2 { margin: 0.35rem 0 0.45rem; font-size: 1.25rem; }
.news-card p { margin: 0; color: var(--text-dim); font-size: 0.96rem; }

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

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

.cta-card {
  margin: 3rem 0 0;
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--card) 70%);
  border: 1px solid var(--accent-line);
  border-radius: 1rem; padding: 1.6rem;
}
.cta-card h2 { margin: 0 0 0.55rem; font-size: 1.3rem; }
.cta-card p { color: var(--text-dim); font-size: 0.96rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.15rem 0 0; }

.btn {
  display: inline-block; text-decoration: none; font-weight: 600; font-size: 0.92rem;
  border-radius: 0.55rem; padding: 0.6rem 1.1rem;
  border: 1px solid var(--line-strong); color: var(--text); background: var(--card);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { border-color: var(--text-faint); color: var(--text); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-hover); color: var(--accent-fg); }

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

.sitefoot {
  border-top: 1px solid var(--line);
  background: var(--card);
  padding: 2rem 0 3rem;
}
.sitefoot .bar { display: block; max-width: 56rem; }
.sitefoot .links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; font-size: 0.88rem; font-weight: 600; }
.sitefoot .links a { color: var(--text-dim); text-decoration: none; }
.sitefoot .links a:hover { color: var(--text); }
.sitefoot .disclaimer { color: var(--text-faint); font-size: 0.8rem; line-height: 1.55; margin-top: 1.25rem; }
/* Fan Content Policy §1.10, verbatim — see site/style.css for why it is quieter
   than .disclaimer and why it may never be hidden outright. */
.sitefoot .fan-content { color: var(--text-faint); font-size: 0.72rem; line-height: 1.5; opacity: 0.8; margin-top: 0.6rem; }
.fan-content { color: var(--text-faint); font-size: 0.72rem; line-height: 1.5; opacity: 0.8; margin-top: 0.6rem; }
.sitefoot .disclaimer a { color: var(--text-faint); }
.sitefoot .fine { color: var(--text-faint); font-size: 0.78rem; margin: 0; }

/* Narrow screens: the word mark and the language pill give way first, then the
   search field becomes an icon; the sections scroll sideways rather than wrap
   into more rows over the content. The Sprites menu opens as a full-width sheet. */
@media (max-width: 52rem) {
  .bar, .sections { padding: 0 1rem; }
  .bar { gap: 0.5rem; }
  .subtabs-row { padding: 0.55rem 1rem; }
  .brand span { display: none; }
  .topbar .lang { display: none; }
  .sections { overflow-x: auto; scrollbar-width: none; }
  .sections::-webkit-scrollbar { display: none; }
  .menu { position: static; }
  /* Fixed, because the strip scrolls sideways and would clip an absolute
     panel; 6rem is the bar plus the strip, the header being pinned at the top. */
  .menu-panel { position: fixed; top: 6rem; left: 0.75rem; right: 0.75rem; }
}

@media (max-width: 34rem) {
  .topbar .cta { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
  .search { display: none; }
  .search-icon { display: grid; }
  .sprite-hero img { width: 7.5rem; height: 7.5rem; }
  .wrap { padding: 1.5rem 1rem 3rem; }
}

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