/* Pages joueurs Scoringames : mobile d'abord, colonne centrée. Tokens dans tokens.css. */

* { box-sizing: border-box; }
/* Cadre commun à toutes les pages publiques (même valeurs dans landing.css) : même largeur, mêmes marges latérales */
:root { --site-largeur: 1160px; --site-gouttiere: 20px; }
@media (min-width: 960px) { :root { --site-gouttiere: 40px; } }
/* La barre de défilement ne doit pas décaler le contenu entre une page courte et une page longue */
html { scrollbar-gutter: stable; }
body.front { margin: 0; min-height: 100vh; background: var(--fond); color: var(--encre); font-family: var(--font-texte); font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; }
:where(.front a) { color: var(--bleu); }
/* :where() : sans spécificité, pour que .bouton-principal garde sa police */
:where(.front button) { font: inherit; cursor: pointer; }
/* hidden doit gagner sur les display posés par les classes (boutons, cartes…) */
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }

/* ---------- En-tête ---------- */
.front-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: var(--site-largeur); margin: 0 auto; padding: 20px var(--site-gouttiere) 12px; }
@media (min-width: 960px) { .front-tete { padding-top: 28px; padding-bottom: 20px; } }
.marque { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--encre) !important; text-decoration: none; }
.marque img { width: 36px; height: 36px; border-radius: 8px; }
.front-tete nav { flex-shrink: 0; }
/* Petits téléphones : le logo seul suffit, la navigation ne doit pas déborder */
@media (max-width: 380px) {
    .marque-nom { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .front-tete nav a { padding: 0 8px; }
}
.front-tete nav { display: flex; gap: 4px; }
.front-tete nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--encre-douce); text-decoration: none; font-weight: 500; font-size: 15px; }
.front-tete nav a[aria-current="page"], .front-tete nav a:hover { color: var(--encre); background: var(--surface); }

/* ---------- Mise en page ---------- */
/* Même largeur et même bord gauche que l'en-tête sur toutes les pages ; les écrans étroits limitent leur contenu sans le recentrer */
.ecran { max-width: var(--site-largeur); margin: 0 auto; padding: 8px var(--site-gouttiere) 32px; display: flex; flex-direction: column; gap: 20px; }
.ecran-etroit > * { max-width: 480px; }
.ecran-moyen > * { max-width: 960px; }
.ecran-jeu > * { max-width: 760px; }
/* Desktop : l'écran de partie passe sur deux colonnes (voir scoresheet.css), il prend toute la largeur */
@media (min-width: 960px) {
    .ecran-jeu > * { max-width: none; }
}
.titre { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 32px; line-height: 1; letter-spacing: -1px; }
.sous-titre { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.1; }
.doux { color: var(--encre-douce); }
.petit { font-size: 14px; line-height: 20px; }
.chiffre { font-family: var(--font-chiffres); font-weight: 700; color: var(--score); }
/* ---------- Fil d'Ariane (front/_fil.html.twig) ----------
   Une seule ligne même à 390 px : le premier maillon ne rétrécit jamais, les suivants s'abrègent (…). */
.fil { min-width: 0; }
.fil ol { display: flex; align-items: center; min-height: 44px; margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 20px; color: var(--encre-douce); }
.fil li { flex: 0 1 auto; min-width: 2.5em; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fil li:first-child { flex: none; min-width: 0; }
.fil li + li::before { content: "›"; margin: 0 8px; color: var(--encre-douce); opacity: .6; }
.fil a { padding: 12px 0; color: var(--encre-douce) !important; text-decoration: none; } /* le padding vertical agrandit la zone de tap sans changer la ligne */
.fil a:hover { color: var(--encre) !important; text-decoration: underline; }
.fil [aria-current] { color: var(--encre); font-weight: 600; }
.fiche-haut { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lien-admin { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 2px dashed var(--encre-douce); border-radius: var(--radius-pill); color: var(--encre-douce) !important; text-decoration: none; font-size: 14px; font-weight: 600; }
.lien-admin svg { width: 16px; height: 16px; flex: none; }
.pile { display: flex; flex-direction: column; gap: 10px; }
.carte { background: var(--surface); border-radius: 16px; padding: 14px; }

.bouton-principal { display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; border: 0; border-radius: var(--radius-pill); background: var(--accent); color: var(--nuit) !important; font-family: var(--font-display); font-weight: 800; font-size: 18px; text-decoration: none; }
.bouton-vert { background: var(--vert); }
.bouton-contour { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--radius-sm); border: 2px dashed var(--encre-douce); background: transparent; color: var(--encre); font-weight: 600; font-size: 15px; text-decoration: none; }
.pied-fixe { position: sticky; bottom: 0; margin: 0 calc(-1 * var(--site-gouttiere)) -32px; padding: 16px var(--site-gouttiere); background: var(--fond); border-top: 1px solid var(--surface); }
/* Écran bas (téléphone en paysage) : la barre du bas ne doit pas masquer le contenu */
@media (max-height: 500px) {
    .pied-fixe { position: static; margin: 0; padding: 0; border: 0; }
}
/* Desktop : le bouton est à portée sans barre collée en bas, et n'a pas besoin de toute la largeur */
@media (min-width: 760px) {
    .pied-fixe { position: static; margin: 4px 0 0; padding: 0; border: 0; background: none; }
    .pied-fixe .bouton-principal { width: auto; min-width: 280px; padding: 0 40px; }
}

/* ---------- Dé de niveau d'assistance (1, 3 ou 6 points) ---------- */
.de-niveau { flex: none; width: 44px; height: 44px; box-sizing: border-box; padding: 7px; border-radius: var(--radius-de); display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; }
.de-niveau i { width: 7px; height: 7px; border-radius: 50%; }
.de-niveau i.p { background: var(--nuit); }
.de-niveau-simple { background: var(--rose); }
.de-niveau-assiste { background: var(--bleu); }
.de-niveau-detaille { background: var(--ambre); }
.de-niveau-complet { background: var(--vert); }

/* ---------- Liste des jeux ---------- */
.jeux { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.jeu-carte { display: flex; flex-direction: column; gap: 8px; color: var(--encre) !important; text-decoration: none; }
.jeu-carte .visuel { aspect-ratio: 1; border-radius: 16px; background: var(--surface); overflow: hidden; display: grid; place-items: center; }
.jeu-carte .visuel img { width: 100%; height: 100%; object-fit: cover; }
.jeu-carte .visuel span { font-family: var(--font-display); font-weight: 800; font-size: 48px; color: var(--encre-douce); }
.jeu-carte strong { font-weight: 600; font-size: 16px; line-height: 20px; }
.jeu-carte small { font-size: 13px; color: var(--encre-douce); line-height: 18px; }
/* Recherche : loupe à gauche, croix d'effacement à droite */
.recherche { position: relative; }
.recherche > svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; width: 20px; height: 20px; color: var(--encre-douce); pointer-events: none; }
.recherche .champ { padding: 0 44px 0 42px; }
.recherche .champ::-webkit-search-cancel-button { display: none; }
.recherche-effacer { position: absolute; right: 0; top: 0; width: 44px; height: 44px; display: grid; place-items: center; color: var(--encre-douce) !important; }
.recherche-effacer svg { width: 18px; height: 18px; }
/* Pagination */
.pagination { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 8px; }
.pagination p { margin: 0; }
.pagination-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.pagination-pages a, .pagination-pages span { min-width: 44px; height: 44px; padding: 0 8px; box-sizing: border-box; border-radius: 12px; display: grid; place-items: center; font-weight: 600; color: var(--encre-douce) !important; text-decoration: none; }
.pagination-pages a { background: var(--surface); }
.pagination-pages a[aria-current="page"] { background: var(--encre); color: var(--fond) !important; }
.pagination-pages svg { width: 20px; height: 20px; }
.vide { padding: 24px; border-radius: 16px; border: 2px dashed var(--surface); color: var(--encre-douce); text-align: center; }

/* ---------- Page du jeu ---------- */
/* Une colonne sur mobile ; sur desktop, la fiche à gauche et le choix de la scoresheet à droite */
.fiche, .fiche-jeu, .fiche-compter { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 760px) {
    .fiche { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 48px; align-items: start; }
}
.jeu-visuel { max-width: 200px; border-radius: 20px; background: var(--surface); overflow: hidden; }
.jeu-visuel img { display: block; width: 100%; height: auto; }
.infos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.infos div { background: var(--surface); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column-reverse; gap: 2px; }
.infos dt { font-size: 13px; color: var(--encre-douce); line-height: 18px; }
.infos dd { margin: 0; font-family: var(--font-chiffres); font-weight: 700; font-size: 18px; color: var(--score); line-height: 22px; }
.credits { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.credits div { display: flex; align-items: flex-start; gap: 10px; }
.credits dt { flex: none; width: 32px; height: 32px; border-radius: var(--radius-de); background: var(--surface); color: var(--encre-douce); display: grid; place-items: center; }
.credits dt svg { width: 18px; height: 18px; }
.credits dd { margin: 0; padding-top: 6px; font-size: 15px; line-height: 20px; }
.description-jeu { padding-top: 12px; border-top: 1px solid var(--surface); }
.description-jeu p { margin: 0; color: var(--encre-douce); font-size: 15px; line-height: 24px; text-align: justify; hyphens: auto; }
.extension { display: flex; align-items: center; gap: 12px; }
.extension img, .extension .pastille { width: 40px; height: 40px; flex: none; border-radius: var(--radius-de); object-fit: cover; background: var(--bleu); }

/* ---------- Choix de la scoresheet ---------- */
.groupe-titre { margin: 0; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--encre-douce); }
.choix { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; background: var(--surface); color: var(--encre) !important; text-decoration: none; }
.choix:hover { outline: 2px solid var(--trait-fort, oklch(0.40 0.02 285)); }
.choix-texte { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.choix-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.choix-ligne strong { font-weight: 600; }
.choix-ligne small, .choix-texte > span { font-size: 13px; color: var(--encre-douce); line-height: 18px; }
.choix-ligne small { font-weight: 600; font-size: 12px; }

/* ---------- Joueurs ---------- */
.rappel { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface); font-size: 14px; font-weight: 600; }
.rappel small { margin-left: auto; font-size: 12px; color: var(--encre-douce); }
.rappel .pastille { width: 28px; height: 28px; flex: none; border-radius: var(--radius-de); }
/* « Qui joue ? » : extensions à gauche (desktop), joueurs ajoutés un à un par un seul champ */
.qj-form { display: flex; flex-direction: column; gap: 20px; }
.qj-gauche, .qj-droite { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
/* Un peu d'air entre les extensions et les joueurs, qui sont deux étapes */
.qj-gauche + .qj-droite { margin-top: 12px; }
.qj-pied { display: flex; flex-direction: column; gap: 10px; }
.qj-pied p { margin: 0; text-align: center; }
.qj-pied p.erreur { color: var(--rose); font-weight: 600; }
@media (min-width: 760px) {
    .qj-form { max-width: 600px; }
    .qj-form.qj-deux { max-width: 960px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px 48px; align-items: start; }
    .qj-deux > .erreurs { grid-column: 1 / -1; }
    .qj-gauche + .qj-droite { margin-top: 0; }
    .qj-pied { flex-direction: row; align-items: center; justify-content: flex-end; gap: 20px; }
    .qj-pied .pied-fixe { margin: 0; }
}
.qj-section { display: flex; flex-direction: column; gap: 10px; }
.qj-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.qj-tete h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 18px; }
.qj-tete span { font-size: 12px; font-weight: 600; color: var(--encre-douce); }
.qj-tete .qj-compte { font-family: var(--font-chiffres); }

/* Extensions : des bascules, comme en partie */
.qj-bascules { display: flex; flex-wrap: wrap; gap: 6px; }
.qj-bascule { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px 0 8px; border: 2px solid oklch(0.38 0.02 285); border-radius: var(--radius-pill); color: var(--encre-douce) !important; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.qj-bascule i { width: 20px; height: 20px; border-radius: 6px; border: 2px solid currentColor; display: grid; place-items: center; }
.qj-bascule i svg { width: 12px; height: 12px; opacity: 0; }
/* Cochée : teinte neutre, pour ne pas jurer avec la couleur des pictos d'extension */
.qj-bascule:has(input:checked) { border-color: var(--encre); background: color-mix(in oklab, var(--encre) 14%, transparent); color: var(--encre) !important; }
.qj-bascule:has(input:checked) i { background: var(--encre); border-color: var(--encre); color: var(--surface); }
.qj-bascule:has(input:checked) i svg { opacity: 1; }
.qj-bascule:has(input:focus-visible) { outline: 3px solid var(--encre); outline-offset: 2px; }
.qj-bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.qj-manque { border-style: dashed; padding: 0 14px; font-weight: 500; font-size: 14px; }
.qj-phrases { margin: 0; font-size: 13px; line-height: 18px; color: var(--encre-douce); }
.qj-phrases b { color: var(--encre); font-weight: 600; }

/* Joueurs à table */
.joueurs-ordre { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: 13px; line-height: 18px; color: var(--encre-douce); }
.joueurs-ordre svg { width: 18px; height: 18px; flex: none; color: var(--ambre); }
.joueurs-ordre strong { color: var(--encre); font-weight: 600; }
.qj-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.qj-liste:empty { display: none; }
.qj-joueur { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px; border-radius: 14px; background: var(--surface); }
.qj-joueur.qj-tire { box-shadow: 0 0 0 2px var(--encre); position: relative; z-index: 1; }
.qj-poignee { flex: none; width: 28px; height: 44px; margin-right: -4px; padding: 0; border: 0; border-radius: 8px; background: none; color: oklch(0.5 0.02 285); display: grid; place-items: center; cursor: grab; touch-action: none; }
.qj-liste:has(> :only-child) .qj-poignee { visibility: hidden; }
.qj-poignee svg { width: 16px; height: 16px; }
.qj-de { position: relative; width: 40px; height: 40px; flex: none; border-radius: 11px; display: grid; place-items: center; color: var(--nuit); font-family: var(--font-display); font-weight: 800; font-size: 17px; }
.qj-lien { position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; border-radius: 50%; background: var(--bleu); color: var(--nuit); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.qj-lien svg { width: 11px; height: 11px; }
.qj-nom { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qj-prenom { width: 100%; height: 26px; padding: 0 6px; margin-left: -6px; border: 0; border-radius: 6px; background: transparent; color: var(--encre); font: inherit; font-weight: 600; font-size: 16px; }
.qj-prenom:focus { outline: none; background: var(--fond); }
.qj-prenom::placeholder { color: var(--rose); font-weight: 500; }
.qj-nom small { font-size: 12px; line-height: 16px; color: var(--encre-douce); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qj-retirer { flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--encre-douce); display: grid; place-items: center; }
.qj-retirer svg { width: 18px; height: 18px; }
.qj-saisie { position: relative; }
.qj-saisie .champ { height: 52px; padding-right: 108px; font-size: 17px; border-color: oklch(0.38 0.02 285); }
.qj-saisie .champ:focus { border-color: var(--encre); }
.qj-saisie button { position: absolute; right: 6px; top: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: var(--encre); color: var(--nuit); font-weight: 700; font-size: 14px; }
.qj-saisie button:disabled { opacity: .5; }
.qj-aide { margin: -4px 0 0; font-size: 12px; line-height: 16px; color: var(--encre-douce); }
.qj-aide code { font-family: var(--font-chiffres); color: var(--encre); }
.qj-aide.erreur { color: var(--rose); font-weight: 600; }
.qj-habitues { display: flex; flex-wrap: wrap; gap: 6px; }
.qj-habitues button { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--radius-pill); background: var(--surface); color: var(--encre); font-weight: 600; font-size: 14px; }
.qj-habitues button svg { width: 14px; height: 14px; color: var(--encre-douce); }
.qj-habitues button .qj-lie { color: var(--bleu); }
.champ { width: 100%; height: 44px; padding: 0 12px; border-radius: 12px; border: 2px solid var(--surface); background: var(--surface); color: var(--encre); font: inherit; font-size: 16px; }
.champ:focus { outline: none; border-color: var(--rose); }
.erreurs { margin: 0; padding: 12px 14px; list-style: none; border-radius: 12px; border: 2px solid var(--rose); font-size: 14px; line-height: 20px; }
.bouton-plein { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm); border: 0; background: oklch(0.27 0.022 285); color: var(--encre) !important; font-weight: 600; font-size: 15px; text-decoration: none; }
.bouton-plein svg { width: 18px; height: 18px; }
.bouton-plein:disabled { opacity: .6; cursor: default; }
.bouton-bleu { background: var(--bleu); color: var(--nuit) !important; }

/* ---------- En-tête connecté : l'avatar mène à « Mon profil » ---------- */
.front-tete nav a.nav-profil { padding: 0 7px; }
.nav-profil img { display: block; width: 30px; height: 30px; }

/* ---------- Mon profil ---------- */
.profil, .profil-contenu { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 760px) {
    .profil { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 40px; align-items: start; }
    .profil-carte { position: sticky; top: 16px; }
    .profil-contenu { gap: 28px; }
    .ludotheque { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}
.mini { font-size: 12px; line-height: 16px; }
.bandeau { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--surface); box-shadow: inset 4px 0 0 var(--vert); font-size: 14px; font-weight: 600; }
.profil-carte { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 16px 16px; border-radius: 20px; background: var(--surface); text-align: center; }
.profil-carte p { margin: 0; }
.profil-avatar { width: 96px; height: 96px; }
.profil-nom { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.05; overflow-wrap: anywhere; }
.code-joueur { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: var(--radius-pill); background: var(--fond); }
.code-joueur span { font-size: 12px; color: var(--encre-douce); font-weight: 600; }
.code-joueur code, .verrou code { font-family: var(--font-chiffres); font-weight: 700; font-size: 17px; letter-spacing: .1em; color: var(--score); }
.code-joueur button, .verrou button { min-height: 32px; padding: 0 12px; border: 0; border-radius: var(--radius-pill); background: oklch(0.27 0.022 285); color: var(--encre); font-weight: 600; font-size: 13px; }
.chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; margin: 4px 0 0; }
.chiffres div { background: var(--fond); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column-reverse; }
.chiffres dt { font-size: 12px; color: var(--encre-douce); line-height: 16px; }
.chiffres dd { margin: 0; font-family: var(--font-chiffres); font-weight: 700; font-size: 18px; color: var(--score); line-height: 22px; }
.bouton-large { width: 100%; }
.deconnexion { align-self: center; min-height: 36px; display: inline-flex; align-items: center; color: var(--encre-douce) !important; font-size: 14px; font-weight: 600; }

/* Une partie dans un historique (profil, fiche du jeu) */
.partie-carte { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--surface); color: var(--encre) !important; text-decoration: none; }
.partie-carte:hover { outline: 2px solid oklch(0.40 0.02 285); }
.pc-tete { display: flex; align-items: center; gap: 12px; }
.pc-visuel { width: 42px; height: 42px; flex: none; border-radius: 10px; object-fit: cover; background: var(--vert-profond); display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--creme); }
.pc-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pc-titre strong { font-weight: 600; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-titre small { font-size: 12px; line-height: 16px; color: var(--encre-douce); }
.pc-titre small::first-letter { text-transform: uppercase; }
.pc-place { flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.pc-place b { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1; }
.pc-place small { font-size: 11px; color: var(--encre-douce); font-weight: 600; }
.pc-place.premier b { color: var(--ambre); }
.pc-joueurs { display: flex; flex-wrap: wrap; gap: 6px; }
.pc-joueurs span { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 8px 0 4px; border-radius: var(--radius-pill); background: var(--fond); font-size: 13px; font-weight: 600; }
.pc-joueurs span::before { content: ""; width: 8px; height: 8px; margin-left: 4px; border-radius: 50%; background: var(--couleur); }
.pc-joueurs b { font-family: var(--font-chiffres); font-size: 12px; color: var(--score); }
.pc-joueurs span.moi { outline: 2px solid var(--couleur); }
.badge { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; padding: 0 8px; min-height: 22px; border-radius: var(--radius-pill); background: oklch(0.27 0.022 285); color: var(--encre-douce); font-size: 11px; font-weight: 600; }
.badge svg { width: 12px; height: 12px; }
.mes-parties { padding-top: 8px; border-top: 1px solid oklch(0.30 0.02 285); }
.mes-parties-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lien { color: var(--bleu); font-weight: 600; font-size: 14px; text-decoration: none; }

/* « Modifier mon profil » */
.formulaire, .formulaire-identite { display: flex; flex-direction: column; gap: 18px; }
/* Desktop : identité (pseudo, code, e-mail) à gauche, avatars à droite */
@media (min-width: 760px) {
    .formulaire-colonnes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
    .avatars { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
}
.champ-bloc { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.champ-bloc > span, .champ-bloc > legend { padding: 0; font-size: 13px; font-weight: 600; color: var(--encre-douce); }
.champ-bloc > legend { margin-bottom: 6px; }
.champ-bloc > small { font-size: 12px; line-height: 16px; color: var(--encre-douce); }
.facultatif { font-weight: 500; }
.avatars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.avatar-choix { position: relative; aspect-ratio: 1; padding: 4px; border: 3px solid transparent; border-radius: 22px; cursor: pointer; }
.avatar-choix img { display: block; width: 100%; height: 100%; }
.avatar-choix:has(input:checked) { border-color: var(--encre); }
.avatar-choix:has(input:focus-visible) { outline: 3px solid var(--rose); outline-offset: 2px; }
.verrou { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 0 6px 0 14px; border-radius: 12px; background: var(--surface); }
.verrou-texte { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--encre-douce); font-size: 15px; }
.verrou svg { width: 16px; height: 16px; flex: none; margin-right: 8px; color: var(--encre-douce); }

/* « Faire un retour » */
.objets { display: flex; flex-wrap: wrap; gap: 8px; }
.objet-choix { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 2px solid var(--surface); border-radius: var(--radius-pill); background: var(--surface); color: var(--encre-douce); font-weight: 600; font-size: 15px; cursor: pointer; }
.objet-choix:has(input:checked) { border-color: var(--encre); color: var(--encre); }
.objet-choix:has(input:focus-visible) { outline: 3px solid var(--rose); outline-offset: 2px; }
.champ-texte { height: auto; min-height: 180px; padding: 10px 12px; line-height: 1.45; resize: vertical; field-sizing: content; }

/* ---------- Ludothèque ---------- */
.bouton-ludotheque { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 2px solid var(--vert); border-radius: var(--radius-pill); background: transparent; color: var(--vert); font-weight: 600; font-size: 15px; }
.bouton-ludotheque svg { width: 18px; height: 18px; flex: none; }
.bouton-ludotheque.dedans { border-color: transparent; background: var(--vert); color: var(--nuit); }
.bouton-ludotheque-action { margin-left: 6px; padding-left: 10px; border-left: 1px solid oklch(0.15 0.015 285 / .3); font-weight: 500; font-size: 13px; }
.bascule { display: inline-flex; align-self: flex-start; gap: 4px; padding: 3px; border-radius: var(--radius-pill); background: var(--surface); }
.bascule a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: var(--radius-pill); color: var(--encre-douce) !important; text-decoration: none; font-weight: 600; font-size: 14px; }
.bascule a[aria-current="page"] { background: var(--encre); color: var(--fond) !important; }
.ludotheque { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ludotheque li { display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 8px; border-radius: 14px; background: var(--surface); }
.ludo-jeu { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--encre) !important; text-decoration: none; }
.ludo-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.ludo-retirer { width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--encre-douce); display: grid; place-items: center; }
.ludo-retirer:hover { background: oklch(0.27 0.022 285); color: var(--encre); }
.ludo-retirer svg { width: 20px; height: 20px; }

/* ---------- Pages légales ---------- */
/* Colonne de lecture : environ 70 caractères par ligne */
.ecran-texte > * { max-width: 680px; }
.legal { display: flex; flex-direction: column; gap: 12px; }
.legal .titre { margin-top: 16px; }
.legal > .doux { margin: -4px 0 4px; }
.legal h2 { margin: 20px 0 0; font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.2; }
.legal p, .legal ul { margin: 0; }
.legal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.legal li::marker { color: var(--accent); }
.legal strong { color: var(--encre); font-weight: 600; }
.legal-chapo { padding: 14px 16px; border-radius: 16px; background: var(--surface); }

/* ---------- Réglages du profil (newsletter) ---------- */
.reglage { width: 100%; margin: 4px 0 0; }
.reglage-ligne { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 10px 8px 14px; border-radius: 14px; background: var(--fond); text-align: left; cursor: pointer; }
.reglage-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reglage-texte strong { font-size: 15px; font-weight: 600; }
.reglage .bouton-plein { margin-top: 8px; width: 100%; }
/* Interrupteur : une case à cocher redessinée, au clavier comme au doigt */
.interrupteur { appearance: none; flex: none; position: relative; width: 48px; height: 28px; margin: 0; border-radius: var(--radius-pill); background: oklch(0.32 0.02 285); cursor: pointer; transition: background .15s; }
.interrupteur::before { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--encre-douce); transition: transform .15s, background .15s; }
.interrupteur:checked { background: var(--vert); }
.interrupteur:checked::before { transform: translateX(20px); background: var(--nuit); }
.interrupteur:disabled { opacity: .6; cursor: progress; }
.interrupteur:focus-visible { outline: 3px solid var(--encre); outline-offset: 2px; }

/* Désinscription depuis un e-mail */
.newsletter-page { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; }
.newsletter-page p { margin: 0; }
.newsletter-adresse { color: var(--encre); font-weight: 600; overflow-wrap: anywhere; }
.newsletter-page .bouton-contour { align-self: flex-start; }

/* ---------- Quoi de neuf ? (accordéon des mises à jour) ---------- */
.nouveautes { display: flex; flex-direction: column; gap: 12px; }
.nouveautes .titre { margin-top: 16px; }
.nouveautes > p { margin: 0; max-width: 680px; }
.nouveautes a { color: var(--encre); }
.versions { display: flex; flex-direction: column; gap: 10px; margin: 8px 0; }
.version { border-radius: 16px; background: var(--surface); }
.version summary { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px 52px 14px 16px; cursor: pointer; list-style: none; border-radius: 16px; }
.version summary::-webkit-details-marker { display: none; }
.version summary:focus-visible { outline: 2px solid var(--encre); outline-offset: 2px; }
.version-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.version-date { font-family: var(--font-display); font-weight: 800; font-size: 18px; line-height: 1.2; color: var(--encre); }
.version-badge { padding: 2px 9px; border-radius: var(--radius-pill); background: var(--accent); color: var(--nuit); font-size: 12px; font-weight: 600; line-height: 18px; }
.version-resume { color: var(--encre-douce); font-size: 15px; line-height: 21px; }
.version-chevron { position: absolute; top: 16px; right: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--fond); }
.version-chevron::before { content: ""; position: absolute; inset: 0; margin: auto; width: 7px; height: 7px; border-right: 2px solid var(--encre); border-bottom: 2px solid var(--encre); transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.version[open] .version-chevron::before { transform: translateY(1px) rotate(-135deg); }
.version-corps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px 32px; padding: 4px 16px 18px; }
.rubrique h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--encre); }
.rubrique h2::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rubrique); }
.rubrique-feuilles { --rubrique: var(--vert); }
.rubrique-nouveautes { --rubrique: var(--bleu); }
.rubrique-optimisations { --rubrique: var(--rose); }
.rubrique-corrections { --rubrique: var(--ambre); }
.rubrique ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.rubrique li { line-height: 22px; }
.rubrique li::marker { color: var(--rubrique); }
.rubrique strong { color: var(--encre); font-weight: 600; }
@media (min-width: 760px) {
    .version summary { padding: 18px 64px 18px 22px; }
    .version-chevron { top: 20px; right: 20px; }
    .version-date { font-size: 20px; }
    .version summary:hover .version-chevron { background: color-mix(in oklab, var(--encre) 16%, var(--fond)); }
    /* Deux colonnes équilibrées : une longue rubrique se coupe d'une colonne à l'autre (ligne par ligne), sinon elle en remplit une seule */
    .version-corps { display: block; columns: 2; column-gap: 48px; padding: 6px 22px 2px; }
    .version-corps .rubrique { padding-bottom: 20px; }
    .version-corps .rubrique h2 { break-after: avoid; }
    .version-corps .rubrique ul { display: block; }
    .version-corps .rubrique li { break-inside: avoid; }
    .version-corps .rubrique li + li { margin-top: 6px; }
}

/* ---------- Fenêtre « Quoi de neuf ? » (après une mise en prod) ---------- */
.nouveautes-fenetre { width: 100%; max-width: 560px; max-height: min(86dvh, 720px); margin: auto auto 0; padding: 0; border: 0; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--encre); overflow: hidden; }
.nouveautes-fenetre::backdrop { background: oklch(0.08 0.01 285 / .72); }
.nouveautes-fenetre[open] { display: flex; animation: nouveautes-monte .25s ease-out; }
.nouveautes-fenetre-corps { display: flex; flex-direction: column; gap: 14px; width: 100%; min-height: 0; padding: 10px 18px max(18px, env(safe-area-inset-bottom, 0px)); }
.nouveautes-fenetre .poignee { width: 40px; height: 5px; border-radius: var(--radius-pill); background: oklch(0.27 0.022 285); align-self: center; }
.nouveautes-fenetre-tete { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.nouveautes-fenetre-tete h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1.1; }
.nouveautes-fenetre-tete p { margin: 0; }
.nouveautes-fenetre-defile { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px; border-radius: 16px; background: var(--fond); }
/* Le navigateur donne le focus à cette zone à l'ouverture : pas d'anneau, le défilement au clavier reste actif */
.nouveautes-fenetre-defile:focus { outline: none; }
.nouveautes-fenetre-rubriques { display: flex; flex-direction: column; gap: 16px; }
.nouveautes-fenetre .rubrique h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--encre); }
.nouveautes-fenetre .rubrique h3::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--rubrique); }
.nouveautes-fenetre-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.nouveautes-fenetre-actions a { color: var(--encre-douce); }
@keyframes nouveautes-monte { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 640px) {
    .nouveautes-fenetre { margin: auto; border-radius: 24px; }
    .nouveautes-fenetre .poignee { display: none; }
    .nouveautes-fenetre-corps { padding: 24px; }
}
@media (min-width: 960px) {
    .nouveautes-fenetre { max-width: 900px; }
    .nouveautes-fenetre-defile { padding: 18px 20px 2px; }
    .nouveautes-fenetre-rubriques { display: block; columns: 2; column-gap: 40px; }
    .nouveautes-fenetre-rubriques .rubrique { padding-bottom: 18px; }
    .nouveautes-fenetre-rubriques .rubrique h3 { break-after: avoid; }
    .nouveautes-fenetre-rubriques .rubrique li { break-inside: avoid; }
    .nouveautes-fenetre-rubriques .rubrique ul { display: block; }
    .nouveautes-fenetre-rubriques .rubrique li + li { margin-top: 6px; }
    .nouveautes-fenetre-actions { flex-direction: row-reverse; justify-content: space-between; }
    .nouveautes-fenetre-actions .bouton-principal { width: auto; min-width: 240px; height: 48px; padding: 0 32px; }
}
@media (prefers-reduced-motion: reduce) { .nouveautes-fenetre[open] { animation: none; } }

/* ---------- Extensions (étape 2) : choix sur « Qui joue ? », puces sur la fiche, la partie et l'historique ---------- */
.xt-puces { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.xt-puce { display: inline-flex; align-items: center; gap: 4px; min-height: 22px; padding: 0 8px; border-radius: var(--radius-pill); background: var(--fond); font-size: 12px; font-weight: 600; color: var(--encre); }
.xt-puce svg { width: 12px; height: 12px; flex: none; }
/* Picto d'une extension, rappelé à côté de son nom (choix des feuilles, « Qui joue ? ») */
.xt-picto { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; margin-left: -4px; border-radius: 5px; background: var(--k); color: var(--nuit); }
.xt-picto svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.qj-bascule .xt-picto { width: 22px; height: 22px; margin-left: 0; border-radius: 6px; }
.qj-bascule .xt-picto svg { width: 15px; height: 15px; }
.xt-puce-doux { background: none; padding: 0; color: var(--encre-douce); font-weight: 500; }
.xt-entete { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; }
.xt-entete[hidden] { display: none; }
.xt-entete .xt-puce { background: var(--surface); }
.pc-ext { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--encre-douce); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-ext svg { width: 12px; height: 12px; flex: none; color: var(--vert); }
