/* Pages espèces (HTML statique, voir seo/pages.ts). Elles chargent d'abord la feuille du jeu
   (couleurs, badges, polaroïd, avertissement), puis celle-ci : mise en page de lecture,
   une colonne sur téléphone, photo à gauche et fiche à droite sur grand écran. */
body.sx { background-color: var(--paper); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 22px 22px; height: auto; }
.sx-wrap { max-width: 1040px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-left, 0px)); }
.sx h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); color: var(--ink); }
.sx h2 { font-size: 1.25rem; color: var(--ink); margin: 0 0 10px; }
.sx section { margin-top: 28px; }
.sx section p + p { margin-top: 10px; }
.sx main p { line-height: 1.55; }

/* Barre du haut */
.sx-top { background: var(--card); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 5; }
.sx-top .sx-wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.sx-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.125rem; color: var(--ink); text-decoration: none; }
.sx-brand svg { width: 24px; height: 24px; }
.sx-top nav { display: flex; align-items: center; gap: 16px; font-size: .9375rem; }
.sx-top nav a { text-decoration: none; font-weight: 600; }
.sx-top nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }
.sx-play { background: var(--ink); color: var(--on-ink) !important; padding: 8px 16px; border-radius: 6px; }

.sx-crumbs { font-size: .8125rem; color: var(--muted); margin: 18px 0 14px; }
.sx-kicker { color: var(--muted); font-size: 1.05rem; }
.sx-sci { font-size: 1.125rem; margin: 4px 0 12px; }

/* Fiche : une colonne, puis deux à partir de 860 px */
.sx-sp { display: grid; gap: 20px; }
.sx-photo .polaroid { width: min(100% - 12px, 460px); padding-bottom: 9px; transform: rotate(-1deg); margin: 10px auto 0; }
.sx-photo .ph { height: auto; aspect-ratio: 1; }
.sx-photo .ph img { animation: none; }
.credit-line { font-size: .75rem; color: var(--muted); text-align: center; margin-top: 10px; }
@media (min-width: 860px) {
  .sx-sp { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: start; }
  .sx-photo { position: sticky; top: 84px; }
}

/* Sosies */
.sx-lookalikes { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.sx-lookalikes li { padding: 12px; }
.sx-lookalikes a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.sx-lookalikes img { width: 56px; height: 56px; aspect-ratio: 1; object-fit: cover; border-radius: 3px; flex: none; }
.sx-lookalikes span { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.sx-lookalikes p { font-size: .875rem; margin-top: 8px; }

.sx-cta { margin-top: 32px; padding: 22px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.sx-cta .hand { font-size: 1.35rem; color: var(--ink); }
.sx-cta .btn { margin-top: 6px; text-decoration: none; }
@media (min-width: 560px) { .sx-cta .btn { width: auto; align-self: flex-start; padding: 0 28px; } }

/* Grilles de vignettes */
.sx-kin { margin: 44px 0 0; }
.sx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 12px; }
.sx-card { display: flex; flex-direction: column; gap: 4px; padding: 8px 8px 10px; text-decoration: none; color: var(--text); }
.sx-card img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; margin-bottom: 4px; }
.sx-card .n { font-weight: 700; font-size: .9375rem; line-height: 1.25; }
.sx-card .sci { font-size: .8125rem; }
.sx-card .badge { align-self: flex-start; margin-top: 4px; }
@media (hover: hover) { .sx-card:hover { box-shadow: 0 0 0 1.5px var(--ink), var(--shadow); } }

/* Liste des espèces */
.sx-head { max-width: 720px; display: flex; flex-direction: column; gap: 10px; }
.sx-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sx-jump a { font-size: .875rem; font-weight: 600; padding: 4px 12px; border-radius: 16px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--outline); text-decoration: none; }
.sx-fam { margin-top: 36px; scroll-margin-top: 72px; }
.sx-fam .note { max-width: 720px; }

/* Pied de page */
.sx-foot { margin-top: 56px; padding: 24px 0 40px; background: var(--card); box-shadow: var(--shadow-up); }
.sx-foot .sx-wrap { display: flex; flex-direction: column; gap: 14px; }
.sx-foot .warn { background: var(--paper); }

/* Encadré du critère, en version lecture */
.sx .tipbox { background: var(--card); margin-bottom: 12px; box-shadow: var(--shadow); }
.sx .tipbox .t1 { font-size: 1rem; line-height: 1.5; }
.sx-lookalikes p { font-size: .9375rem; }

/* Barre du haut sur petit écran : tout sur une ligne */
.sx-brand, .sx-top nav a { white-space: nowrap; }
@media (max-width: 420px) {
  .sx-top nav { gap: 12px; font-size: .875rem; }
  .sx-brand { font-size: 1rem; gap: 6px; }
  .sx-play { padding: 7px 12px; }
}
.sx-lookalikes a.sx-more { display: inline; font-weight: 600; color: var(--ink); text-decoration: underline; }

/* Sosies : deux colonnes côte à côte, même sur téléphone */
.sx-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; max-width: 860px; }
.sx-side { padding: 8px 8px 14px; display: flex; flex-direction: column; gap: 6px; }
.sx-side-ph img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; display: block; }
.sx-side h2 { font-size: clamp(1rem, 2.4vw, 1.35rem); margin: 6px 0 0; }
.sx-side h2 a { text-decoration: none; }
.sx-side .sci { font-size: .875rem; }
.sx-side .badge { align-self: flex-start; }
.sx-side-tip { font-size: .875rem; line-height: 1.45; }
@media (min-width: 700px) { .sx-side { padding: 12px 12px 18px; } .sx-side-tip { font-size: .9375rem; } }
.sx-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 12px; }
.sx-pcard { display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 12px; text-decoration: none; color: var(--text); }
.sx-pth { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.sx-pth img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 2px; }
.sx-pcard .n { font-weight: 700; line-height: 1.3; }
.sx-pbadges { display: flex; flex-wrap: wrap; gap: 6px; }
@media (hover: hover) { .sx-pcard:hover, .sx-gcard:hover { box-shadow: 0 0 0 1.5px var(--ink), var(--shadow); } }
.sx-all { margin-top: 20px; font-weight: 600; }

/* Texte de lecture (guides, critère des sosies) */
.sx-prose { max-width: 760px; }
.sx-prose section { margin-top: 30px; }
.sx-prose ul { padding-left: 1.2em; margin: 0; display: grid; gap: 8px; line-height: 1.55; }
.sx-prose .warn { margin-top: 14px; }
.sx-lead { font-size: 1.125rem; line-height: 1.55; }
.sx-article .sx-head { max-width: none; }
.sx-rows { list-style: none; padding: 0 !important; display: grid; gap: 12px !important; margin-top: 12px !important; }
.sx-row { display: flex; gap: 14px; padding: 12px; align-items: flex-start; }
.sx-row img { width: 84px; height: 84px; object-fit: cover; border-radius: 3px; flex: none; }
.sx-row p { margin: 0; }
.sx-row p + p { margin-top: 6px; }
.sx-row .sci { font-size: .875rem; margin: 0 4px; }
.sx-famsec .sx-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.sx-sources ul { font-size: .875rem; }
.sx-guides { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin-top: 18px; }
.sx-gcard { display: flex; flex-direction: column; gap: 6px; padding: 10px 10px 16px; text-decoration: none; color: var(--text); }
.sx-gcard img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 2px; margin-bottom: 4px; }
.sx-gcard .hand { color: var(--muted); }
.sx-gcard .n { font-weight: 700; font-size: 1.125rem; line-height: 1.25; color: var(--ink); }

/* Barre du haut : quatre liens, les plus petits écrans gardent le pictogramme seul */
@media (max-width: 480px) {
  .sx-brand span { display: none; }
  .sx-top nav { gap: 14px; }
}
