/*
 * FUTFUT CLUB : page d'un jeu (single-jeu.php)
 * En-tête du jeu, « Pour les parents », « Continue avec »
 * + petites retouches communes aux 6 jeux (niveaux, ligne des gains).
 */

.fpj {
    --fpj-nuit: #210742;
    --fpj-violet: #7a2fe6;
    --fpj-orange: #F78701;
    --fpj-gris: #7b6a92;
    width: 96%;          /* 96 % de l'écran, comme tout le site */
    max-width: none;
    margin: 0 auto 50px;
    font-family: 'Fredoka Regular', sans-serif;
    color: var(--fpj-nuit);
}
.fpj h1, .fpj h2, .fpj h3 { font-family: 'Fredoka Bold', sans-serif; font-weight: normal; margin: 0; }
.fpj a { text-decoration: none; }

/* 1. Fil d'Ariane */
.fpj-ariane { display: flex; align-items: center; gap: 8px; margin: 20px 0 10px; font-size: 14.5px; color: var(--fpj-gris); }
.fpj-ariane a { color: inherit; }
.fpj-ariane .fpj-retour {
    display: inline-flex; align-items: center; gap: 6px; background: #fff; border-radius: 20px;
    padding: 5px 12px 5px 8px; color: var(--fpj-violet); font-family: 'Fredoka Bold', sans-serif;
    box-shadow: 0 2px 8px rgba(122, 47, 230, .12);
}
.fpj-retour i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; background: #f6f0fe; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }

/* 2. En-tête du jeu */
.fpj-tete { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.fpj-pastille {
    flex: 0 0 auto; width: 64px; height: 64px; border-radius: 18px; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-family: Arial, sans-serif; font-weight: 900; font-size: 36px; box-shadow: 0 4px 0 rgba(33, 7, 66, .15);
}
.fpj-pastille.is-texte { font-family: 'Fredoka Bold', sans-serif; font-weight: normal; font-size: 26px; }
.fpj-tete h1 {
    font-size: 46px; line-height: 1;
    background: linear-gradient(90deg, #b04df5, var(--fpj-orange));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fpj-sous { font-size: 18px; color: var(--fpj-gris); margin: 4px 0 0; }
.fpj-puces { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fpj-puces span { background: #fff; border-radius: 10px; padding: 3px 10px; font-size: 14px; box-shadow: 0 1px 4px rgba(122, 47, 230, .1); }
.fpj-puces .fpj-mat { background: var(--fpj-c); color: #fff; font-family: 'Fredoka Bold', sans-serif; }

/* 4. et 5. Blocs sous le jeu */
.fpj-bloc { margin-top: 40px; }
.fpj-bloc > h2 { font-size: 28px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.fpj-pic { width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; color: #fff; background: var(--fpj-violet); }
.fpj-pic.fpj-orange { background: var(--fpj-orange); }

.fpj-parents { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.fpj-boite { background: #fff; border-radius: 22px; padding: 18px 22px; box-shadow: 0 2px 10px rgba(247, 135, 1, .12); }
.fpj-boite h3 { font-size: 21px; color: var(--fpj-violet); margin-bottom: 8px; }
.fpj-boite table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 0; border: 0; }
.fpj-boite td { padding: 7px 4px; border: 0; border-top: 1px solid #f0e8fb; vertical-align: top; }
.fpj-boite td:first-child { font-family: 'Fredoka Bold', sans-serif; white-space: nowrap; width: 1%; padding-right: 14px; }
.fpj-vie { background: #eefbf3; border-radius: 22px; padding: 18px 22px; border: 2px solid #c9efd7; }
.fpj-vie h3 { font-size: 21px; color: #1f9d55; }
.fpj-vie ul { margin: 6px 0 0; padding-left: 20px; }
.fpj-vie li { margin: 3px 0; }

/* « Continue avec » : les cartes de l'accueil (futfut-accueil.css), 4 colonnes (voir plus bas) */

/* ------------------------------------------------------------------ */
/* Retouches communes aux jeux                                         */
/* ------------------------------------------------------------------ */

/* Niveaux : nom + étoiles, et le détail de la fiche en dessous */
.futfut-level-picker .futfut-level-picker-button { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.15; }
.futfut-level-picker-detail { font-size: 12.5px; opacity: .75; font-family: 'Fredoka Regular', sans-serif; }


/* Ligne des gains au-dessus de la Géométrie (même style que les Additions) */
.peeksee-geometry-current-level { margin: 0 0 10px; color: #4a367f; font-size: 18px; font-weight: 900; line-height: 1.25; text-align: center; }
.peeksee-geometry-current-level[hidden] { display: none; }

/* ------------------------------------------------------------------ */
/* Tablette / mobile                                                   */
/* ------------------------------------------------------------------ */
@media (max-width: 900px) {
    .fpj-parents { grid-template-columns: 1fr; }
    .fpj .fpj-autres { overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 4px 10px; gap: 14px; }
    .fpj .fpj-autres .fa-jeu { scroll-snap-align: start; }
}
@media (max-width: 640px) {
    .fpj-ariane { margin: 14px 0 8px; font-size: 13px; }
    .fpj-chemin { display: none; }
    .fpj-tete { gap: 12px; margin-bottom: 12px; }
    .fpj-pastille { width: 48px; height: 48px; border-radius: 14px; font-size: 27px; }
    .fpj-pastille.is-texte { font-size: 19px; }
    .fpj-tete h1 { font-size: 32px; }
    .fpj-sous { font-size: 15px; }
    .fpj-puces { display: none; }
    .futfut-level-picker .futfut-level-picker-button { align-items: center; text-align: center; }
    .futfut-level-picker-detail { font-size: 11.5px; }
    .fpj-bloc > h2 { font-size: 22px; }
    .peeksee-geometry-current-level { margin-bottom: 8px; font-size: 15px; }
}

/* ------------------------------------------------------------------ */
/* Même trame pour les 6 jeux (maquette v2)                            */
/* La classe .fpj-trame est posée par js/futfut-page-jeu.js            */
/* ------------------------------------------------------------------ */

.fpj {
    --cote: 300px;                     /* colonne personnage : la même pour tous les jeux */
    --scene-h: min(62vh, 640px);       /* hauteur de la zone de jeu : la même pour tous */
}

/* Bandeau sur une ligne : titre · niveaux · plein écran */
.fpj-jeu { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px 16px; margin-top: 22px; }
.fpj-jeu > .fpj-tete { grid-column: 1; grid-row: 1; margin: 0; min-width: 0; gap: 14px; }
.fpj-jeu > .futfut-fullscreen-bar { display: contents; }
.fpj-jeu .futfut-level-picker { grid-column: 2; grid-row: 1; margin: 0; flex-wrap: nowrap; gap: 4px; padding: 4px; background: #fff; border-radius: 16px; box-shadow: 0 2px 10px rgba(122, 47, 230, .1); }
.fpj-jeu .futfut-fullscreen-button { grid-column: 3; grid-row: 1; }
.fpj-jeu > [id^="peeksee"] { grid-column: 1 / -1; grid-row: 2; min-width: 0; }

.fpj-tete .fpj-pastille { width: 56px; height: 56px; border-radius: 16px; font-size: 32px; }
.fpj-tete .fpj-pastille.is-texte { font-size: 23px; }
.fpj-tete > div { min-width: 0; }
.fpj-tete h1 { font-size: 38px; line-height: 1.2; padding-bottom: 2px; white-space: nowrap; } /* 1.2 : le bas des lettres (g, j) n'est plus coupé */
.fpj-tete .fpj-sous { font-size: 15px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpj-tete .fpj-sous b { font-family: 'Fredoka Bold', sans-serif; font-weight: normal; color: var(--fpj-c); }

.fpj-jeu .futfut-level-picker-label { display: none; }
.fpj-jeu .futfut-level-picker .futfut-level-picker-button {
    width: 150px; min-height: 0; padding: 5px 14px; border: 0; border-radius: 12px; box-shadow: none;
    flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; text-align: left; font-size: 15px; line-height: 1.15; color: var(--fpj-nuit);
}
.fpj-jeu .futfut-level-picker .futfut-level-picker-button small { color: #f5b400; letter-spacing: -2px; }
.fpj-jeu .futfut-level-picker-detail { display: block; max-width: 100%; font-size: 12px; color: var(--fpj-gris); opacity: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpj-jeu .futfut-level-picker .futfut-level-picker-button:hover { background: #f6f0fe; }
.fpj-jeu .futfut-level-picker .futfut-level-picker-button.is-current { color: #fff; background: linear-gradient(180deg, #8d45f5, #6a1fd8); box-shadow: 0 3px 0 #4e12a8; }
.fpj-jeu .futfut-level-picker .futfut-level-picker-button.is-current .futfut-level-picker-detail { color: #e5d8ff; }
.fpj-jeu .futfut-fullscreen-bar .futfut-fullscreen-button { min-height: 0; padding: 10px 14px; border: 0; border-radius: 14px; box-shadow: 0 3px 0 #e4d6fb; white-space: nowrap; }

/* Jeu à gauche, personnage à droite */
.fpj-trame .fpj-main { display: grid; grid-template-columns: minmax(0, 1fr) var(--cote); gap: 20px; align-items: stretch; }
.fpj-trame .fpj-cache { display: none !important; }

.fpj-trame .fpj-carte {
    grid-column: 1; grid-row: 1; min-width: 0; margin: 0; display: flex; flex-direction: column;
    padding: 12px 16px 14px; background: #fff; border: 3px solid #efe4fd; border-radius: 24px; box-shadow: 0 6px 24px rgba(122, 47, 230, .12);
}
.fpj-trame .fpj-carte.pss2-hidden, .fpj-trame .fpj-carte.psm2-hidden { display: flex !important; }
.fpj-trame .fpj-carte > div:empty { display: none; }

.fpj-etat { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; min-height: 30px; padding: 0 4px; font-family: 'Fredoka Bold', sans-serif; font-size: 15px; color: var(--fpj-nuit); }
.fpj-niv { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fpj-niv small { font-family: 'Fredoka Regular', sans-serif; font-size: 14px; color: var(--fpj-gris); }
.fpj-etat > :nth-child(2) { grid-column: 2; margin: 0 !important; min-height: 0 !important; justify-content: center; flex-wrap: nowrap; }
.fpj-droite { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 12px; }
.fpj-droite > * { margin: 0 !important; }

.fpj-gains { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; min-height: 30px; align-items: center; margin: 4px 0 8px; }
.fpj-gains span { background: #fff4d6; border-radius: 12px; padding: 3px 11px; font-size: 14px; font-family: 'Fredoka Bold', sans-serif; white-space: nowrap; color: var(--fpj-nuit); }

.fpj-scene {
    --fpj-stage: calc(var(--scene-h) - 20px);
    position: relative; height: var(--scene-h); padding: 10px; border-radius: 18px; overflow: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    background: radial-gradient(circle at 50% 40%, #fbf8ff 0, #efe6fb 75%);
}
.fpj-scene > .peeksee-addition-maze-wrap,
.fpj-scene > .peeksee-geometry-maze-wrap,
.fpj-scene > .peeksee-snake-board-wrap,
.fpj-scene > .pss2-game-frame,
.fpj-scene > .psm2-game-frame { flex: none; width: min(100%, var(--fpj-stage)); max-width: none; aspect-ratio: 1 / 1; margin: 0; }
.fpj-scene > .peeksee-anglais-scene { flex: none; width: min(100%, calc(var(--fpj-stage) * 16 / 8.4)); max-width: none; margin: 0; }
#peeksee-conjugaison-game .fpj-scene { --fpj-stage: calc(var(--scene-h) - 165px); gap: 6px; }
#peeksee-conjugaison-game .fpj-scene > .peeksee-snake-consigne { flex: none; width: 100%; margin: 0; min-height: 0; height: auto; padding-top: 6px; padding-bottom: 6px; }
#peeksee-conjugaison-game .fpj-scene > .peeksee-snake-hint { flex: none; margin: 0; min-height: 20px; }
/* Conjugaison : si la consigne passe sur 2 lignes (« Passé simple »), le plateau rétrécit au lieu de couper. */
@media (min-width: 701px) {
    #peeksee-conjugaison-game .fpj-scene { justify-content: flex-start; }
    #peeksee-conjugaison-game .fpj-scene > .peeksee-snake-board-wrap { flex: 1 1 0; min-height: 0; height: auto; width: auto; max-width: 100%; aspect-ratio: 1 / 1; }
    #peeksee-conjugaison-game .peeksee-snake-box > :nth-child(2) { font-size: 28px; line-height: 1.05; }
}

/* Fin de partie : le récapitulatif prend la place du jeu, dans le même cadre */
.fpj-scene > .fpj-resultats { width: 100%; max-height: 100%; min-height: 0; overflow: auto; margin: 0; flex: 0 1 auto; }
.fpj-fin .fpj-scene { justify-content: flex-start; }
.fpj-fin .fpj-scene > :not(.fpj-resultats) { display: none !important; }
.fpj-fin .fpj-cmd { visibility: hidden; }

/* Commandes : texte « au clavier » sur ordinateur, flèches sur tablette */
.fpj-cmd { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; min-height: 28px; margin-top: 8px; font-size: 14px; color: var(--fpj-gris); }
.fpj-cmd kbd { font-family: 'Fredoka Bold', sans-serif; font-size: 13px; background: #fff; border: 2px solid #e4d6fb; border-bottom-width: 3px; border-radius: 7px; padding: 0 6px; margin: 0 2px; color: var(--fpj-nuit); box-shadow: none; }
.fpj-cmd > .fpj-commandes { margin: 0 !important; }
.fpj-trame .pss2-controls-hint, .fpj-trame .psm2-controls-hint { display: none !important; }
@media (hover: hover) and (pointer: fine) {
    .fpj-trame .fpj-commandes, .fpj-tactile { display: none !important; }
}
@media not all and (hover: hover) and (pointer: fine) {
    .fpj-clavier { display: none; }
}

/* Côté : bulle, personnage, Recommencer */
.fpj-trame .fpj-cote {
    grid-column: 2; grid-row: 1; order: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 18px; padding: 16px 14px; margin: 0; background: rgba(255, 255, 255, .55); border-radius: 24px;
}
.fpj-trame .fpj-bulle {
    position: relative; width: 100%; height: 118px; margin: 0; padding: 12px 16px; display: block; align-content: center;
    background: #fff; border: 0; border-radius: 20px; box-shadow: 0 4px 16px rgba(122, 47, 230, .12);
    font-family: 'Fredoka Bold', sans-serif; font-weight: normal; font-size: 16px; line-height: 1.3; text-align: center; color: var(--fpj-nuit);
}
.fpj-trame .fpj-bulle::after {
    content: ""; position: absolute; top: auto; right: auto; bottom: -9px; left: 50%; width: 18px; height: 18px; margin-left: -9px;
    background: #fff; border: 0; box-shadow: none; transform: rotate(45deg);
}
.fpj-trame .fpj-bulle.fpj-mission::before { content: "Ta mission"; display: block; margin-bottom: 3px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--fpj-orange); }
.fpj-trame .fpj-perso { width: 250px; height: 250px; max-width: 100%; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; }
.fpj-trame .fpj-perso img { width: 100%; height: 100%; max-width: none; object-fit: contain; }
.fpj-trame .fpj-cote .fpj-recommencer { width: auto; margin: 0; }
.fpj-trame div.fpj-recommencer { display: flex; justify-content: center; }
.fpj-trame .fpj-cote button,
.fpj-trame .fpj-cote button.fpj-recommencer,
.fpj-trame .fpj-cote .fpj-recommencer button {
    width: auto; min-height: 0; margin: 0; padding: 9px 18px; border: 0; border-radius: 14px; background: #fff; color: var(--fpj-violet);
    box-shadow: 0 3px 0 #e4d6fb; font-family: 'Fredoka Bold', sans-serif; font-weight: normal; font-size: 16px; text-transform: none; letter-spacing: 0;
}
.fpj-trame .fpj-cote button::before { content: "↻ "; }

/* Sous le jeu : plus serré */
.fpj-jeu ~ .fpj-bloc { margin-top: 20px; }
/* Le thème parent met 80 px de marge intérieure en haut et en bas de chaque <section> : on l'enlève. */
.fpj section.fpj-bloc { padding: 0; }
.fpj .fpj-bloc > h2 { margin: 0 0 12px; }
.fpj-parents { grid-template-columns: 2fr 1fr; }
.fpj .fpj-autres { grid-template-columns: repeat(4, 1fr); }

/* Tablette : niveaux sur leur propre ligne, colonne personnage plus étroite */
@media (max-width: 1100px) {
    .fpj { --cote: 250px; }
    .fpj-jeu { grid-template-columns: minmax(0, 1fr) auto; }
    .fpj-jeu .futfut-level-picker { grid-column: 1 / -1; grid-row: 2; }
    .fpj-jeu .futfut-level-picker .futfut-level-picker-button { flex: 1 1 0; width: auto; min-width: 0; }
    .fpj-jeu .futfut-fullscreen-button { grid-column: 2; }
    .fpj-jeu > [id^="peeksee"] { grid-row: 3; }
    .fpj-trame .fpj-perso { width: 190px; height: 190px; }
}
@media (max-width: 900px) {
    .fpj-parents { grid-template-columns: 1fr; }
    .fpj .fpj-autres { grid-template-columns: repeat(4, 70%); }
}

/* Mobile : bulle + personnage en bandeau au-dessus, jeu carré */
@media (max-width: 700px) {
    .fpj-jeu { gap: 10px; margin-top: 14px; }
    .fpj-tete h1 { font-size: 28px; }
    .fpj-tete .fpj-sous { font-size: 13px; }
    .fpj-tete .fpj-pastille { width: 46px; height: 46px; border-radius: 13px; font-size: 26px; }
    .fpj-tete .fpj-pastille.is-texte { font-size: 18px; }
    .fpj-jeu .futfut-fullscreen-bar .futfut-fullscreen-button { padding: 8px 10px; font-size: 0; gap: 0; }
    .fpj-jeu .futfut-level-picker .futfut-level-picker-button { padding: 5px 6px; align-items: center; text-align: center; font-size: 14px; }
    .fpj-jeu .futfut-level-picker-detail { font-size: 11px; }

    .fpj-trame .fpj-main { grid-template-columns: 76px minmax(0, 1fr); grid-template-areas: "perso bulle" "carte carte" "rest rest"; gap: 10px; }
    .fpj-trame .fpj-cote { display: contents; }
    .fpj-trame .fpj-perso { grid-area: perso; width: 76px; height: 76px; align-self: center; }
    .fpj-trame .fpj-bulle { grid-area: bulle; height: 76px; padding: 8px 12px; border-radius: 16px; font-size: 14px; align-self: center; }
    .fpj-trame .fpj-bulle::after { bottom: auto; top: 50%; left: -7px; margin: -7px 0 0; width: 14px; height: 14px; }
    .fpj-trame .fpj-bulle.fpj-mission::before { font-size: 11px; margin-bottom: 1px; }
    .fpj-trame .fpj-carte { grid-area: carte; padding: 8px 8px 10px; border-radius: 20px; }
    .fpj-trame .fpj-recommencer { grid-area: rest; justify-self: center; }

    .fpj-etat { grid-template-columns: auto minmax(0, 1fr) auto; font-size: 13px; min-height: 26px; gap: 6px; }
    .fpj-etat > :nth-child(2) { gap: 3px !important; }
    .fpj-etat > :nth-child(2) > * { width: 11px !important; height: 11px !important; border-width: 2px !important; }
    .fpj-niv small { display: none; }
    .fpj-gains { gap: 6px; margin: 4px 0 6px; }
    .fpj-gains span { font-size: 12.5px; padding: 2px 8px; }
    .fpj-scene { height: auto; padding: 6px; --fpj-stage: 100%; }
    #peeksee-conjugaison-game .fpj-scene { --fpj-stage: 100%; }
    .fpj-cmd { font-size: 13px; }
}
