/* V4 catalogue pilot (/personnages and its fiches): the public pages' Read
   surface (privacy.css + public.css) plus the game's own rarity marks.
   Script-free and still. Every colour is a DESIGN.md token: the two foils
   are drawn from the rarity and candy tokens, never a flat gold or pink. */

/* Where the reader stands */
.crumbs { margin: 8px 0 0; }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .875rem; font-weight: 700; color: #c4bfd2; }
.crumbs li:not(:last-child)::after { content: "/"; content: "/" / ""; color: #aeacbf; font-weight: 500; }
.crumbs a, .crumbs [aria-current] { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.crumbs [aria-current] { color: #f6f3ee; }
.catalogue h1 { margin: 8px 0 16px; }
.lede { font-size: 1.05rem; line-height: 1.6; color: #dbd7e4; }
.note { font-size: .875rem; line-height: 1.6; color: #c4bfd2; }
.pilot { margin: 24px 0; padding: 12px 16px; border-radius: 14px; background: #1f1f36; border: 1px solid #aeacbf; font-size: .875rem; line-height: 1.6; color: #f6f3ee; }

/* The rarity outside a card: its gems then its name (never colour alone),
   each tier in its own shape as in the game (GEM_SHAPES of ui/theme.js: a
   pebble, a diamond, a triangle, a hexagon, a star, a crown); the two top
   tiers are foils, never flat. */
.rarity { display: inline-flex; align-items: center; gap: 8px; padding: 2px 12px 2px 10px; border-radius: 999px; background: rgb(255 255 255 / 0.08); border: 1px solid rgb(255 255 255 / 0.16); color: #f6f3ee; font-size: .875rem; font-weight: 800; line-height: 1.6; white-space: nowrap; }
.pips { display: inline-flex; align-items: center; gap: 4px; }
.pips span { display: block; width: 9px; height: 9px; clip-path: polygon(50% 0, 85% 50%, 50% 100%, 15% 50%); }
.r-common .pips span { background: #a7aeb8; clip-path: circle(27.5%); }
.r-uncommon .pips span { background: #37c172; }
.r-rare .pips span { background: #528ee9; clip-path: polygon(50% 0, 99% 86%, 1% 86%); }
.r-epic .pips span { background: #9b47fb; clip-path: polygon(0 50%, 25% 6.7%, 75% 6.7%, 100% 50%, 75% 93.3%, 25% 93.3%); }
.r-legendary .pips span { clip-path: polygon(50% 4.7%, 62.3% 37.8%, 97.6% 39.3%, 70% 61.2%, 79.4% 95.2%, 50% 75.8%, 20.6% 95.2%, 30% 61.2%, 2.4% 39.3%, 37.7% 37.8%); }
.r-mythic .pips span { clip-path: polygon(3% 87%, 0 22%, 25% 49%, 50% 7%, 75% 49%, 100% 22%, 97% 87%); }
.r-legendary { background: linear-gradient(135deg, #f2b632, #fef2e1 30%, #f2b632 58%, #fef2e1 82%, #f2b632); }
.r-mythic { background: linear-gradient(115deg, #ff7eb6, #ffd3b0 22%, #aaefe6 44%, #b2ebf8 66%, #d9ddfe 88%, #ff7eb6); }
.r-legendary, .r-mythic { border-color: rgb(255 255 255 / 0.55); color: #131426; }
.r-legendary .pips span, .r-mythic .pips span { background: rgb(19 20 38 / 0.78); }
.number { font-variant-numeric: tabular-nums; }

/* The hub: an index of portraits and names, each row one link. */
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); column-gap: 24px; margin: 32px 0 0; padding: 0; list-style: none; }
.roster li { display: grid; margin: 0; border-top: 1px solid rgb(255 255 255 / 0.1); }
.entry { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: center; gap: 16px; margin: 0 -8px; padding: 12px 8px; border-radius: 14px; color: #f6f3ee; text-decoration: none; }
.entry.no-portrait { grid-template-columns: minmax(0, 1fr); min-height: 72px; }
.entry:hover { background: #1f1f36; }
.entry:focus-visible { outline-offset: 2px; }
/* A stored portrait's <picture> (AVIF then WebP) holds its <img>'s grid cell. */
picture { display: block; min-width: 0; }
.identity picture { grid-area: portrait; }
.thumb, .portrait { display: block; height: auto; aspect-ratio: 2 / 3; object-fit: cover; object-position: 50% 0; background: #1f1f36; outline: 1px solid rgb(255 255 255 / 0.1); outline-offset: -1px; }
.thumb { width: 80px; border-radius: 8px; }
.entry-text { display: grid; gap: 4px; min-width: 0; justify-items: start; }
.entry-name { font-size: 1.05rem; font-weight: 800; line-height: 1.3; color: #ffb4a4; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; overflow-wrap: anywhere; }
.entry:hover .entry-name { text-decoration-thickness: 3px; }
.entry-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .875rem; font-weight: 700; color: #c4bfd2; }
.entry-work { font-size: .875rem; color: #c4bfd2; overflow-wrap: anywhere; }
.empty { margin: 32px 0; padding: 24px; border-radius: 22px; background: #1f1f36; }
.empty h2 { margin-top: 0; }
.empty .actions { margin-bottom: 0; }

/* A fiche: name, then portrait and facts side by side from the first view. */
.identity { display: grid; grid-template-columns: minmax(96px, 36%) minmax(0, 1fr); grid-template-areas: "title title" "portrait facts"; gap: 16px 20px; align-items: start; }
.identity h1 { grid-area: title; margin-bottom: 0; }
.identity .portrait { grid-area: portrait; width: 100%; max-width: 230px; border-radius: 14px; }
.identity-facts { grid-area: facts; min-width: 0; }
.identity.no-portrait { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "facts"; }
.identity .note { margin: 16px 0 0; }
.work { margin: 0 0 16px; font-weight: 700; color: #dbd7e4; overflow-wrap: anywhere; }
.facts { display: grid; gap: 12px; margin: 0; }
.facts div { display: grid; gap: 4px; justify-items: start; }
.facts dt { font-size: .875rem; font-weight: 700; color: #c4bfd2; }
.facts dd { margin: 0; font-size: 1.05rem; font-weight: 800; color: #f6f3ee; }
.works { margin: 16px 0 0; padding: 0; list-style: none; }
.works li { display: grid; gap: 2px; margin: 0; padding: 12px 0; border-bottom: 1px solid rgb(255 255 255 / 0.1); }
.work-title { font-weight: 700; color: #f6f3ee; overflow-wrap: anywhere; }
.role { font-size: .875rem; color: #c4bfd2; }
.packs th, .packs td { vertical-align: top; }
.packs th[scope="row"] { font-weight: 800; }
.packs th[scope="row"] a, .pack-name { display: inline-flex; align-items: center; min-height: 44px; overflow-wrap: anywhere; }
.packs a:focus-visible, .crumbs a:focus-visible { outline-offset: 2px; }
.packs td { padding-top: 22px; }
.packs td strong { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.when, .one-in { display: block; font-size: .875rem; font-weight: 500; color: #c4bfd2; }
.packs + .note { margin-top: 16px; margin-bottom: 0; }
.guide-link { margin: 0 0 8px; }
.related { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 16px 0 0; padding: 0; list-style: none; }
.related li { margin: 0; }
.related a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.back-link { margin: 40px 0 0; }

@media (min-width: 600px) {
  .identity { grid-template-columns: 230px minmax(0, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "portrait title" "portrait facts"; column-gap: 32px; }
  .identity h1 { margin-top: 0; }
}
@media print {
  .entry, .identity { break-inside: avoid; }
}
