/* LudoGraph — Un jeu à offrir, profil de joueur, scan et import (07/10/2026).
   Complète style.css, chargé après lui ; reprend ses variables. */

/* ---- portes de Découvrir : 5 portes, la grille passe à 2 colonnes sur grand écran aussi */
.dec-porte-offrir { background: linear-gradient(135deg, #7c3aed, #db2777 70%); border-color: transparent; color: #fff; }
.dec-porte-offrir svg { fill: rgb(255 255 255 / .2); }
.dec-porte-profil { background: linear-gradient(135deg, var(--nuit), var(--nuit-2)); border-color: transparent; color: #fff; }
.dec-porte-profil svg { fill: rgb(255 255 255 / .15); }

/* ---- Un jeu à offrir */
.offrir-intro { display: flex; flex-direction: column; gap: 12px; margin: 8px 0 16px; }
.offrir-intro > .btn { align-self: flex-start; }
.offrir-portes { grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .offrir-portes { grid-template-columns: 1fr; } }
.offrir-envoi { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 14px; border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface); }
.offrir-envoi label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; font-weight: 650; color: var(--encre-2); }
.offrir-envoi input, .offrir-champ, .scan-saisie input, .plus-lien input {
  font: inherit; color: var(--encre); background: var(--surface); border: 1.5px solid var(--trait-2);
  border-radius: var(--rayon-petit); padding: 10px 12px; min-height: 44px; width: 100%; box-sizing: border-box; }
.offrir-deja { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 14px; }
.offrir-sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.offrir-sugg-item { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--trait-2); background: var(--surface-2); color: var(--encre); font-weight: 600; }
.offrir-puces { display: flex; flex-wrap: wrap; gap: 6px; }
.offrir-puce { padding: 6px 12px; border-radius: 999px; border: 0; background: var(--accent); color: #fff; font-weight: 650; }
.plus-lien { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.plus-lien p { margin: 0; color: var(--encre-2); }

/* ---- profil de joueur */
.profil-carte { --p: var(--accent); margin: 8px 0 10px; padding: 20px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, var(--p), var(--nuit) 120%); box-shadow: var(--ombre); }
.profil-carte .profil-vous { margin: 0; opacity: .85; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.profil-carte .profil-nom { margin: 2px 0 2px; font-size: 1.9rem; font-weight: 850; }
.profil-carte .profil-nom::first-letter { text-transform: uppercase; }
.profil-carte .profil-aussi { margin: 0 0 8px; opacity: .9; font-style: italic; }
.profil-carte .profil-desc { margin: 8px 0 14px; line-height: 1.5; max-width: 60ch; }
.profil-barres { display: grid; gap: 6px; }
.profil-barre { display: grid; grid-template-columns: minmax(110px, 9rem) 1fr; align-items: center; gap: 10px; font-size: .88rem; }
.profil-barre i { display: block; height: 8px; border-radius: 99px; background: rgb(255 255 255 / .22); overflow: hidden; }
.profil-barre b { display: block; height: 100%; border-radius: 99px; background: #fff; }
.profil-stratege { --p: #4338ca; } .profil-batisseur { --p: #0f766e; } .profil-conquerant { --p: #b91c1c; }
.profil-bluffeur { --p: #7c3aed; } .profil-equipier { --p: #15803d; } .profil-conteur { --p: #b45309; }
.profil-boute { --p: #db2777; } .profil-flambeur { --p: #ea580c; }
.profil-banniere { --p: var(--nuit-2); display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 14px 0 4px;
  padding: 14px 16px; border-radius: var(--rayon); border: 0; color: #fff; background: linear-gradient(135deg, var(--p), var(--nuit) 130%); box-shadow: var(--ombre); }
.profil-banniere .dec-porte-txt span { opacity: .9; font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---- Ma ludothèque : boutons scan / import */
.ludo-outils { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }

/* ---- fenêtres scan et import */
.plus-boite { width: min(560px, 100%); }
.plus-fermer { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--encre); display: grid; place-items: center; flex: none; }
.plus-fermer svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.scan-cadre { position: relative; border-radius: var(--rayon); overflow: hidden; background: #000; aspect-ratio: 4 / 3; max-width: 100%; }
.scan-cadre video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-viseur { position: absolute; left: 12%; right: 12%; top: 34%; bottom: 34%; border: 3px solid rgb(255 255 255 / .9); border-radius: 12px; box-shadow: 0 0 0 999px rgb(0 0 0 / .28); }
.scan-info { min-height: 1.4em; font-weight: 650; margin: 10px 0 6px; }
.scan-jeu { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border: 1px solid var(--trait); border-radius: var(--rayon); }
.scan-vignette { display: block; width: 64px; height: 64px; flex: none; border-radius: var(--rayon-petit); overflow: hidden; background: var(--vig-fond); }
.scan-vignette > * { width: 100%; height: 100%; }
.scan-vignette img { width: 100%; height: 100%; object-fit: cover; }
.scan-jeu-txt { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.scan-etats, .import-etat { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.scan-etat { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; min-height: 36px; border-radius: 999px; border: 1.5px solid var(--trait-2); background: var(--surface); color: var(--encre); font-weight: 600; font-size: .88rem; }
.scan-etat svg { width: 16px; height: 16px; color: var(--e); }
.scan-etat[aria-pressed="true"] { border-color: var(--e); background: color-mix(in srgb, var(--e) 14%, var(--surface)); }
.scan-saisie { display: flex; gap: 8px; margin-top: 12px; }
.scan-saisie .btn { flex: none; }
.import-bloc { margin: 12px 0 16px; }
.import-bloc h3 { margin: 0 0 4px; font-size: 1rem; }
.import-bloc p { margin: 0 0 10px; color: var(--encre-2); line-height: 1.45; }
.import-bloc textarea { width: 100%; box-sizing: border-box; margin-bottom: 8px; }
.import-etat { margin: 4px 0 10px; color: var(--encre-2); }
.import-bilan { border-top: 1px solid var(--trait); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.import-bilan:empty { display: none; }
.import-compte { font-weight: 750; margin: 0; }
.import-vignettes { display: flex; flex-wrap: wrap; gap: 6px; }
.import-vignettes .scan-vignette { width: 44px; height: 44px; }
.import-absents { color: var(--encre-3); font-size: .88rem; line-height: 1.5; }
.import-garder { display: flex; align-items: center; gap: 6px; color: var(--encre-2); }
.import-bilan > .btn { align-self: flex-start; }
.erreur { color: var(--accent-encre); font-weight: 650; }

/* les pages des modules (#liste=offrir, cadeaux, profil) : sans les portes de l'accueil */
#corps-decouvrir[data-vue="module"] > .dec-portes { display: none; }

/* ==== 13/10/2026 : retours de Gaspard ==== */
/* ---- Découvrir : quatre portes compactes, deux par ligne */
#corps-decouvrir > .dec-portes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 8px; }
#corps-decouvrir > .dec-portes .dec-porte { min-height: 0; padding: 12px 14px; gap: 10px; border-radius: 16px; box-shadow: none; }
#corps-decouvrir > .dec-portes .dec-porte svg { width: 24px; height: 24px; }
#corps-decouvrir > .dec-portes .dec-porte strong { font-size: .95rem; font-weight: 800; line-height: 1.2; }
#corps-decouvrir > .dec-portes .dec-porte-explorer svg, #corps-decouvrir > .dec-portes .dec-porte-commu svg { stroke: var(--accent); }
#corps-decouvrir > .dec-portes.sans-commu .dec-porte-explorer { grid-column: 1 / -1; }
.dec-porte-commu { background: var(--surface); }

/* ---- fiche : le « + » et J'aime / Je n'aime pas, sur une ligne encadrée de traits */
.fiche .ludo-boutons { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 0; border-top: 1px solid var(--trait-2); border-bottom: 1px solid var(--trait-2); grid-template-columns: none; }
.b-plus { width: 46px; height: 46px; min-height: 46px; padding: 0; border-radius: 14px; display: grid; place-items: center; border: 1.5px solid var(--trait-2); background: var(--surface); color: var(--encre); flex: none; }
.b-plus svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.b-plus.dedans { background: var(--etat-ai); border-color: var(--etat-ai); color: #fff; }
.reactions { display: inline-flex; border: 1.5px solid var(--trait-2); border-radius: 14px; background: var(--surface); overflow: hidden; flex: none; }
.reac { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 60px; height: 43px; padding: 0 12px; border: 0; background: transparent; color: var(--encre-2); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; cursor: pointer; }
.reac + .reac { border-left: 1px solid var(--trait-2); }
.reac svg { width: 21px; height: 21px; fill: none; stroke: var(--c); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.reac.aime { --c: var(--etat-adore); }
.reac.pasaime { --c: var(--etat-pas); }
.reac-n:empty { display: none; }
.reac[aria-pressed="true"] { color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.reac.aime[aria-pressed="true"] svg path { fill: var(--c); }
.reac:active, .b-plus:active { transform: scale(.96); }
@media (hover: hover) { .reac:hover { background: var(--surface-2); } .b-plus:hover { border-color: var(--encre-3); } }

/* ---- Acheter : le prix sur le bouton, la mini fenêtre des boutiques */
.btn-acheter .achat-prix { font-weight: 800; padding-left: 10px; border-left: 1px solid rgb(255 255 255 / .3); }
.achat-voile { position: fixed; inset: 0; z-index: 130; background: rgb(15 14 26 / .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.achat-boite { width: min(440px, 100%); max-height: calc(100% - 24px); overflow-y: auto; background: var(--surface); border-radius: 20px; box-shadow: var(--ombre-forte); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.achat-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.achat-tete h2 { font-size: 1.05rem; font-weight: 800; margin: 0; }
.achat-boite .boutiques { display: flex; flex-direction: column; gap: 8px; }
.achat-boite .petit { margin: 0; }
@media (max-width: 900px) {
  .achat-voile { align-items: flex-end; padding: 0; }
  .achat-boite { width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- Ma ludothèque : le titre, le nombre, l'import ; puis les jeux */
.ludo-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.ludo-tete .pg-titre { margin-right: auto; }
.ludo-nb { color: var(--encre-3); font-weight: 650; font-size: .9rem; }
.ludo-tete .ludo-outils { margin: 0; }
#corps-ludotheque > .grille { margin-top: 16px; }
.plus-rond { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--etat-ai); color: #fff; }
.plus-rond svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* ---- feuille de fiche sur téléphone : en aperçu, le contenu ne défile pas (le geste déplace la feuille) */
@media (max-width: 900px) {
  .fiche[data-etat="apercu"] .fiche-corps { overflow: hidden; }
}
.achat-boite a.boutique strong { color: var(--encre); font-size: 1rem; }
.ludo-outils svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dec-vide { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin: 28px auto; max-width: 360px; color: var(--encre-2); }
/* sur grand écran, le « ? » passe à gauche de la fiche ouverte (il recouvrait « Fermer la vidéo ») */
@media (min-width: 901px) { body.fiche-ouverte .sig-fab { right: calc(min(430px, 100vw - 28px) + 28px); } }
/* thème sombre : le rose clair (#fb7185) porte un texte foncé, pas blanc (contraste 2,7:1 → 7:1) ;
   le bouton Acheter s'éclaircit pour ne pas se fondre dans la feuille (13/10/2026, essai) */
:root[data-theme="sombre"] :is(.compteur, .tuto-suivant, .dec-cat[aria-pressed="true"], .quiz-option[aria-pressed="true"], .quiz-option[aria-checked="true"], .sig-type[aria-checked="true"], .filtres-n, .offrir-puce, .btn-danger-plein) { color: #1c1a2e; }
:root[data-theme="sombre"] .btn-acheter { background: #4338ca; border-color: #4338ca; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="clair"]) :is(.compteur, .tuto-suivant, .dec-cat[aria-pressed="true"], .quiz-option[aria-pressed="true"], .quiz-option[aria-checked="true"], .sig-type[aria-checked="true"], .filtres-n, .offrir-puce, .btn-danger-plein) { color: #1c1a2e; }
  :root:not([data-theme="clair"]) .btn-acheter { background: #4338ca; border-color: #4338ca; }
}

/* ====================================================================
   TROIS INTERFACES (16/10/2026, Gaspard : « un truc différent selon le site et l'application,
   et pour le site sur mobile et sur PC »).
   - Ordinateur, à partir de 1100 px, comme PodGraph : une colonne fixe à gauche (le logo, les
     trois pages, le groupe « Explorer »), la recherche, Affiner et les Réglages dans la barre du
     haut, et sur le graphe la fiche du jeu au centre posée en colonne à droite, en permanence.
   - Téléphone (site) : onglets en bas, fiche en feuille du bas (style.css, ≤ 900 px).
   - Appli Android : la même base que le téléphone, plus la barre d'état au thème, la feuille de
     partage d'Android et le double retour pour quitter (app.js, NATIF).
   ==================================================================== */
.cote-groupe { display: none; }
.btn-partager { margin-top: 10px; min-height: 34px; padding: 0 12px; font-size: .86rem; }
.btn-centre + .btn-partager { margin-left: 6px; }
.btn-partager svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.zone-clavier { padding: 12px 0; border-top: 1px solid var(--trait); }
.zone-clavier h3 { font-size: .95rem; margin-bottom: 8px; }
.clavier { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: .88rem; align-items: center; }
.clavier dt { display: flex; gap: 4px; }
.clavier dd { margin: 0; color: var(--encre-2); }
.clavier kbd { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--trait-2); border-bottom-width: 2px;
  background: var(--surface-2); font: 700 .78rem/22px inherit; text-align: center; color: var(--encre); }

@media (min-width: 1100px) {
  :root { --cote-l: 236px; --fiche-l: 400px; }
  .app { grid-template-columns: var(--cote-l) minmax(0, 1fr); }
  .barre { grid-column: 2; padding-left: 24px; }
  .pages { grid-column: 2; }
  .barre .quete { margin-right: auto; }
  /* la colonne : le logo en tête, puis les pages et les raccourcis */
  .marque {
    position: fixed; left: 0; top: 0; z-index: 62; width: var(--cote-l);
    height: calc(var(--h-barre) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 20px 0;
    background: var(--surface-2); border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait);
  }
  #onglets {
    position: fixed; left: 0; z-index: 61; width: var(--cote-l); margin: 0;
    top: calc(var(--h-barre) + env(safe-area-inset-top, 0px)); bottom: 0;
    display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 14px 12px 80px; overflow-y: auto;
    border-right: 1px solid var(--trait); background: var(--surface-2);
  }
  #onglets .onglet, #onglets .onglet-raccourci {
    display: flex; align-items: center; gap: 12px; min-height: 42px; height: auto; padding: 0 12px; border-radius: 10px;
    font-size: .95rem; font-weight: 650; color: var(--encre-2); width: 100%; text-align: left; justify-content: flex-start;
  }
  #onglets .onglet svg, #onglets .onglet-raccourci svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  #onglets .onglet:hover, #onglets .onglet-raccourci:hover { background: var(--trait); color: var(--encre); }
  #onglets .onglet[aria-current="page"], #onglets .onglet-raccourci[aria-current="page"] { background: var(--surface); color: var(--accent-encre); box-shadow: var(--ombre); }
  #onglets .onglet-raccourci { font-weight: 550; }
  #onglets .compteur { margin-left: auto; }
  .cote-groupe { display: flex; flex-direction: column; gap: 2px; margin-top: 22px; }
  .cote-titre { margin: 0; padding: 0 12px 6px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--encre-3); }
  /* les portes de Découvrir sont déjà dans « Explorer » : les répéter en tête de page ferait doublon */
  .dec-portes { display: none; }
  /* le « ? » descend dans le coin de la colonne */
  .sig-fab { left: calc(var(--cote-l) - 60px); right: auto; }
  /* sur le graphe, la fiche est une colonne à droite (celle du jeu au centre, ou du jeu touché) */
  .app[data-page="graphe"] .fiche {
    top: calc(env(safe-area-inset-top, 0px) + var(--h-barre)); right: 0; bottom: 0; width: var(--fiche-l);
    border-radius: 0; border-width: 0 0 0 1px; box-shadow: none; transform: none; z-index: 55;
  }
  .app[data-page="graphe"] .fiche.au-centre .fiche-fermer { display: none; }
  .app[data-page="graphe"] .fiche .fiche-tete { grid-template-columns: 112px 1fr; }
  .app[data-page="graphe"] .fiche .fiche-visuel { width: 112px; }
  body.fiche-ouverte .zoom { display: flex; right: calc(var(--fiche-l) + 14px); }
}
