/*
 * jeux-classiques.fr — feuille de style unique
 *
 * Troisième identité du réseau, distincte des deux autres :
 *   comment-jouer.fr   = vert bouteille, « manuel de règles »
 *   jeux-a-deux.fr     = rouge/bleu, « duel »
 *   jeux-classiques.fr = bordeaux + laiton sur ivoire chaud, « cabinet de jeux,
 *                        collection patrimoniale ». Découverte, pas règles.
 *
 * Mêmes fondamentaux réseau : papier, encre, bordures franches, ombres dures sans
 * flou, aucune webfont (pile système), mobile first, dark mode via variables.
 */

:root {
  --papier: #f5efe1;
  --papier-creux: #ebe1cd;
  --encre: #191410;
  --encre-doux: #5f5648;
  --accent: #7a2233;      /* bordeaux */
  --accent-clair: #9c3446;
  --or: #a9791b;          /* laiton */
  --surface: #fffdf7;
  --filet: #cdbfa3;
  --trait: 2px solid var(--encre);
  --ombre: 4px 4px 0 var(--encre);
  --ombre-petite: 3px 3px 0 var(--encre);
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

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

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-text-size-adjust: 100%;
}

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

.enveloppe { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

.skip {
  position: absolute; left: -9999px;
  background: var(--encre); color: var(--papier); padding: 10px 16px; z-index: 50;
}
.skip:focus { left: 8px; top: 8px; }

/* ---------- En-tête ---------- */
.entete { border-bottom: var(--trait); background: var(--papier); }
.entete .enveloppe {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px 12px; padding-top: 14px; padding-bottom: 14px;
}
.logo {
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
  letter-spacing: -0.01em; color: var(--encre); text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.logo .classiques { color: var(--accent); font-style: italic; }
.entete nav { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.9rem; font-weight: 600; }
.entete nav a { color: var(--encre-doux); text-decoration: none; }
.entete nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */
.hero { padding: 44px 0 34px; border-bottom: var(--trait); }
.hero h1 {
  font-family: var(--serif); font-size: 2rem; line-height: 1.14;
  letter-spacing: -0.02em; margin: 0 0 16px; font-weight: 700; text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { margin: 0 0 12px; font-size: 1.05rem; color: var(--encre-doux); max-width: 64ch; }

/* Filet ornemental sous le hero (touche « collection ») */
.ornement {
  height: 6px; margin: 20px 0 0; max-width: 220px;
  background: repeating-linear-gradient(90deg, var(--accent) 0 14px, transparent 14px 22px);
  border-bottom: 2px solid var(--or);
}

/* ---------- Sections ---------- */
.section { padding: 34px 0; }
.section + .section { border-top: var(--trait); }
.titre-section {
  font-family: var(--serif); font-size: 1.5rem; letter-spacing: -0.02em;
  margin: 0 0 6px; font-weight: 700;
}
.chapeau { margin: 0 0 22px; color: var(--encre-doux); max-width: 64ch; }

/* Étiquette de famille (comme une étiquette de boîte de jeu) */
.etiquette {
  display: inline-flex; align-items: center; gap: 8px;
  border: var(--trait); background: var(--or); color: var(--encre);
  font-size: 0.74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 4px 10px; margin-bottom: 12px;
  box-shadow: var(--ombre-petite);
}

/* ---------- Collection : grille de jeux ---------- */
.collection {
  display: grid;
  /* minmax(0,1fr) et .jeu-carte min-width:0 : sans ça, un élément de grille a
     min-width:auto et refuse de descendre sous la largeur de son contenu, donc
     le résumé en nowrap déborde au lieu d'être tronqué. */
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  list-style: none; margin: 0; padding: 0;
}
.jeu-carte {
  min-width: 0;
  border: var(--trait); background: var(--surface); box-shadow: var(--ombre);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.jeu-carte:hover, .jeu-carte:focus-within {
  transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--encre);
}
.jeu-carte a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px 12px 12px; text-decoration: none; color: inherit; min-width: 0;
}
.jeu-carte .vignette,
.jeu-carte .vignette-repli {
  width: 60px; height: 60px; flex-shrink: 0;
  border: 1px solid var(--encre); object-fit: cover;
}
.jeu-carte .vignette-repli {
  display: flex; align-items: center; justify-content: center;
  background: var(--papier-creux); font-size: 1.7rem;
}
.jeu-carte .texte { flex: 1; min-width: 0; }
.jeu-carte .nom { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; display: block; }
.jeu-carte .resume {
  display: block; font-size: 0.86rem; color: var(--encre-doux);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jeu-carte .badge {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 7px; border: 1px solid var(--encre); white-space: nowrap; flex-shrink: 0;
}
.jeu-carte .badge.en-ligne { background: var(--accent); color: #fff; }
.jeu-carte .badge.hors-ligne { background: var(--papier-creux); color: var(--encre-doux); }

/* Bandeau de famille sur l'accueil */
.famille-bloc + .famille-bloc { margin-top: 30px; }
.famille-bloc .voir-famille {
  display: inline-block; margin-top: 14px; font-weight: 600; font-size: 0.9rem;
  color: var(--accent); text-decoration: none;
}
.famille-bloc .voir-famille:hover { text-decoration: underline; }

/* ---------- Page découverte d'un jeu ---------- */
.fil { font-size: 0.82rem; color: var(--encre-doux); padding: 14px 0; }
.fil a { color: var(--encre-doux); }
.fil span[aria-current] { font-weight: 600; color: var(--encre); }

.jeu-entete { padding-bottom: 22px; }
.jeu-entete h1 {
  font-family: var(--serif); font-size: 1.9rem; line-height: 1.14;
  letter-spacing: -0.02em; margin: 0 0 6px; text-wrap: balance;
}
.jeu-sous-titre {
  font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--encre-doux); margin: 0 0 16px;
}
.jeu-accroche { font-size: 1.1rem; color: var(--encre-doux); margin: 0; max-width: 62ch; }

/* Bloc « Où y jouer » : le coeur du site */
.ou-jouer {
  border: var(--trait); background: var(--surface); box-shadow: var(--ombre);
  margin: 0 0 26px;
}
.ou-jouer h2 {
  font-family: var(--serif); font-size: 1.15rem; margin: 0;
  padding: 12px 16px; border-bottom: var(--trait); background: var(--papier-creux);
}
.ou-jouer ul { list-style: none; margin: 0; padding: 0; }
.ou-jouer li {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px dashed var(--filet);
}
.ou-jouer li:last-child { border-bottom: 0; }
.ou-jouer .canal {
  flex-shrink: 0; width: 92px; font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--encre-doux);
}
.ou-jouer .detail { flex: 1; min-width: 160px; font-size: 0.94rem; }
.ou-jouer .detail .note { display: block; font-size: 0.82rem; color: var(--encre-doux); }
.ou-jouer .liens { display: flex; flex-wrap: wrap; gap: 8px; }

/* Bouton principal (jouer en ligne) */
.bouton {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border: var(--trait); box-shadow: none;
  padding: 9px 16px; font-weight: 700; font-size: 0.92rem; text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.bouton:hover { transform: translate(-1px, -1px); box-shadow: none; }
.bouton.secondaire { background: var(--surface); color: var(--encre); }
.bouton.or { background: var(--or); color: var(--encre); }

/* Puces de liens externes (applis, achat) */
.lien-ext {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--encre); background: var(--surface); color: var(--encre);
  padding: 6px 12px; font-size: 0.84rem; font-weight: 600; text-decoration: none;
}
.lien-ext:hover { background: var(--papier-creux); }

/* ---------- Corps rédactionnel ---------- */
.prose h2 {
  font-family: var(--serif); font-size: 1.35rem; letter-spacing: -0.02em;
  margin: 30px 0 12px; padding-bottom: 6px; border-bottom: var(--trait);
}
.prose h3 { font-family: var(--serif); font-size: 1.1rem; margin: 20px 0 8px; }
.prose p { margin: 0 0 14px; max-width: 66ch; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 22px; max-width: 66ch; }
.prose li { margin-bottom: 7px; }
.article-seul { max-width: 760px; }

/* Encadré */
.encadre {
  border: var(--trait); border-left: 6px solid var(--or); background: var(--surface);
  padding: 14px 16px; margin: 0 0 20px;
}
.encadre .encadre-titre { font-family: var(--serif); font-weight: 700; margin: 0 0 6px; }
.encadre p:last-child { margin-bottom: 0; }

/* Sources */
.sources { border-top: var(--trait); margin-top: 32px; padding-top: 16px; font-size: 0.86rem; }
.sources h2 { font-family: var(--serif); font-size: 1rem; margin: 0 0 8px; border: 0; padding: 0; }
.sources ul { margin: 0; padding-left: 18px; }
.sources li { margin-bottom: 5px; color: var(--encre-doux); }

/* Jeux voisins en bas de page découverte */
.mini-grille {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  list-style: none; margin: 0; padding: 0;
}
.mini-grille a {
  display: flex; align-items: center; gap: 10px;
  border: var(--trait); background: var(--surface); box-shadow: var(--ombre-petite);
  padding: 8px 10px; text-decoration: none; color: var(--encre);
  font-weight: 600; font-size: 0.88rem; transition: transform 0.12s ease;
}
.mini-grille a:hover { transform: translate(-2px, -2px); }
.mini-grille img { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--encre); flex-shrink: 0; }
.mini-grille .repli-mini {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--encre); background: var(--papier-creux); font-size: 1.2rem; flex-shrink: 0;
}

/* ---------- Pied de page ---------- */
.pied {
  border-top: var(--trait); background: var(--papier-creux);
  padding: 28px 0; margin-top: 40px; font-size: 0.88rem;
}
.pied .colonnes { display: grid; grid-template-columns: 1fr; gap: 22px; }
.pied h2 { font-family: var(--serif); font-size: 1rem; margin: 0 0 8px; }
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin-bottom: 5px; }
.pied a { color: var(--encre-doux); text-decoration: none; }
.pied a:hover { color: var(--accent); text-decoration: underline; }
.pied .mention {
  margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--filet);
  color: var(--encre-doux); font-size: 0.82rem;
}

/* ---------- 404 ---------- */
.page-404 { padding: 60px 0; text-align: center; }
.page-404 h1 { font-family: var(--serif); font-size: 2.4rem; margin: 0 0 12px; }

/* ---------- Tablette ---------- */
@media (min-width: 620px) {
  body { font-size: 18px; }
  .hero { padding: 56px 0 40px; }
  .hero h1 { font-size: 2.7rem; }
  .titre-section { font-size: 1.8rem; }
  .collection { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .mini-grille { grid-template-columns: repeat(3, 1fr); }
  .pied .colonnes { grid-template-columns: repeat(3, 1fr); }
  .jeu-entete h1 { font-size: 2.4rem; }
}

/* ---------- Desktop ---------- */
@media (min-width: 960px) {
  .enveloppe { padding: 0 24px; }
  .hero h1 { font-size: 3.1rem; max-width: 22ch; }
  .prose h2 { font-size: 1.5rem; }
  /* Page découverte : texte à gauche, bloc « où jouer » collé en haut à droite */
  .decouverte { display: grid; grid-template-columns: 1fr 340px; gap: 0 40px; align-items: start; }
  .decouverte .jeu-entete { grid-column: 1; grid-row: 1; }
  .decouverte .jeu-corps { grid-column: 1; grid-row: 2; }
  .decouverte .jeu-aside { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 20px; }
  .decouverte .ou-jouer { margin-bottom: 16px; }
}

/* ---------- Mode sombre (variables uniquement) ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --papier: #17130d;
    --papier-creux: #221b12;
    --encre: #efe6d4;
    --encre-doux: #a99d87;
    --accent: #cf6b7c;
    --accent-clair: #e08595;
    --or: #d3a63f;
    --surface: #221c14;
    --filet: #3c3324;
    --ombre: 4px 4px 0 #000;
    --ombre-petite: 3px 3px 0 #000;
    --trait: 2px solid #000;
  }
  .jeu-carte:hover, .jeu-carte:focus-within,
  .bouton:hover { box-shadow: 6px 6px 0 #000; }
  .bouton { color: #17130d; }
  .bouton.secondaire { color: var(--encre); }
  .jeu-carte .badge.en-ligne { color: #17130d; }
  .etiquette { color: #17130d; }
}

/* ---------- Impression ---------- */
@media print {
  .entete nav, .bouton, .lien-ext { display: none; }
  body { background: #fff; }
  .jeu-carte, .ou-jouer, .encadre { box-shadow: none; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
