/* =========================================================
   FUTFUT CLUB : styles communs à tous les jeux
   - récapitulatif de fin de niveau (FutfutGameUtils.resultsHtml) ;
   - bouton "Plein écran" au-dessus du jeu.
   ========================================================= */

/* Dans les labyrinthes, le récapitulatif est déjà dans la carte du jeu. */
.peeksee-addition-results-panel,
.peeksee-geometry-results-panel {
    max-width: 680px !important;
    padding: 4px 0 0 !important;
    background: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.futfut-results {
    width: 100%;
    color: #210742;
    font-family: "Fredoka Regular", Fredoka, Arial, sans-serif;
    text-align: left;
}

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

/* En-tête */

.futfut-results-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 12px;
    margin: 0 0 14px;
}

.futfut-results .futfut-results-title {
    margin: 0;
    padding: 0;
    color: #210742;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    width: auto;
    flex: 0 1 auto;
    font-size: 28px;
    line-height: 1.1;
    text-align: center;
    text-transform: none;
}

.futfut-results-level {
    padding: 5px 12px;
    color: #5710b8;
    background: #f1e9ff;
    border-radius: 999px;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.2;
}

.futfut-results-message {
    margin: 0 0 12px;
    color: #5710b8;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 17px;
    text-align: center;
}

/* Bouton "Niveau suivant", tout en haut */

.futfut-results-next {
    margin: 0 0 16px;
}

.futfut-results-next:empty {
    display: none;
}

.futfut-results .futfut-results-next-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 62px;
    margin: 0;
    padding: 12px 22px;
    cursor: pointer;
    color: #ffffff;
    background: linear-gradient(180deg, #ff9d1f 0%, #F78701 100%);
    border: 0;
    border-radius: 18px;
    box-shadow: 0 6px 0 #c96a00, 0 12px 24px rgba(247, 135, 1, 0.35);
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
    text-align: center;
    text-transform: none;
    animation: futfut-results-pulse 1.8s ease-in-out infinite;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.futfut-results .futfut-results-next-button:hover,
.futfut-results .futfut-results-next-button:focus-visible {
    color: #ffffff;
    background: linear-gradient(180deg, #ffa733 0%, #ff8f0a 100%);
    outline: none;
}

.futfut-results .futfut-results-next-button:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #c96a00, 0 6px 14px rgba(247, 135, 1, 0.3);
    animation: none;
}

/* Le bouton est masqué par la classe du jeu tant que le niveau n'est pas fini. */
.futfut-results-next-button.peeksee-addition-is-hidden,
.futfut-results-next-button.peeksee-geometry-is-hidden {
    display: none !important;
}

@keyframes futfut-results-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
    .futfut-results .futfut-results-next-button {
        animation: none;
    }
}

/* Cartes de score */

.futfut-results-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.futfut-results-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    padding: 12px 10px;
    background: #f7f2ff;
    border: 2px solid #eadfff;
    border-radius: 16px;
}

.futfut-results-card-icon {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    color: #ffffff;
    border-radius: 50%;
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
}

.futfut-results-card.is-stars .futfut-results-card-icon {
    background: #ffe7a3;
}

.futfut-results-card.is-good .futfut-results-card-icon {
    background: #3cc46c;
}

.futfut-results-card.is-bad .futfut-results-card-icon {
    background: #ff6b6b;
}

.futfut-results-card-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.futfut-results-card small {
    color: #6c6184;
    font-size: 13px;
    line-height: 1.2;
}

.futfut-results-card strong {
    color: #210742;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 24px;
    line-height: 1.1;
}

/* Lignes de résultat */

.futfut-results .futfut-results-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.futfut-results-row {
    display: grid;
    grid-template-columns: 26px 44px minmax(0, 1fr) auto 30px;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 8px 12px 8px 10px;
    background: #f2fbf5;
    border: 2px solid #ccefd9;
    border-radius: 16px;
}

.futfut-results-row.is-bad {
    background: #fff4f4;
    border-color: #ffd3d3;
}

.futfut-results-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: #ffffff;
    background: #7b3cf0;
    border-radius: 50%;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 13px;
    line-height: 1;
}

.futfut-results-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    overflow: hidden;
    color: #7b3cf0;
    background: #ffffff;
    border: 2px solid #eadfff;
    border-radius: 12px;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 26px;
    line-height: 1;
}

/* Figures de géométrie en miniature */
.futfut-results-icon .peeksee-geometry-shape {
    position: static !important;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    transform: none !important;
}

.futfut-results-icon svg {
    width: 100%;
    height: 100%;
}

.futfut-results-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.futfut-results-text strong {
    color: #210742;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 19px;
    line-height: 1.2;
}

.futfut-results-detail {
    color: #6c6184;
    font-size: 13px;
    line-height: 1.25;
}

.futfut-results-answer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 20px;
    line-height: 1.1;
    white-space: nowrap;
}

.futfut-results-good {
    color: #1f9a50;
}

.futfut-results-wrong {
    color: #e04848;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
}

.futfut-results-arrow {
    color: #9a8fb3;
    font-size: 16px;
}

.futfut-results-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    color: #ffffff;
    background: #3cc46c;
    border-radius: 50%;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
}

.futfut-results-row.is-bad .futfut-results-status {
    background: #ff6b6b;
}

/* Mobile */

@media (max-width: 600px) {
    .futfut-results .futfut-results-title {
        font-size: 23px;
    }

    .futfut-results .futfut-results-next-button {
        min-height: 56px;
        font-size: 19px;
    }

    .futfut-results-cards {
        gap: 6px;
    }

    .futfut-results-card {
        flex-direction: column;
        gap: 4px;
        padding: 8px 4px;
        text-align: center;
    }

    .futfut-results-card-icon {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .futfut-results-card small {
        font-size: 11px;
    }

    .futfut-results-card strong {
        font-size: 20px;
    }

    .futfut-results-row {
        grid-template-columns: 22px 36px minmax(0, 1fr) auto 26px;
        gap: 7px;
        padding: 7px 8px;
    }

    /* Erreur : la réponse passe sous le nom de la figure pour garder la ligne compacte. */
    .futfut-results-row.is-bad {
        grid-template-columns: 22px 36px minmax(0, 1fr) 26px;
        grid-template-areas:
            "num icon text status"
            "num icon answer status";
        row-gap: 2px;
    }

    .futfut-results-row.is-bad .futfut-results-num { grid-area: num; }
    .futfut-results-row.is-bad .futfut-results-icon { grid-area: icon; }
    .futfut-results-row.is-bad .futfut-results-text { grid-area: text; }
    .futfut-results-row.is-bad .futfut-results-status { grid-area: status; }

    .futfut-results-row.is-bad .futfut-results-answer {
        grid-area: answer;
        flex-wrap: wrap;
        justify-self: start;
        font-size: 16px;
        white-space: normal;
    }

    .futfut-results-num {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .futfut-results-icon {
        width: 36px;
        height: 36px;
        font-size: 21px;
        border-radius: 10px;
    }

    .futfut-results-icon .peeksee-geometry-shape {
        width: 30px !important;
        height: 30px !important;
    }

    .futfut-results-text strong {
        font-size: 16px;
    }

    .futfut-results-detail {
        font-size: 12px;
    }

    .futfut-results-answer {
        gap: 3px;
        font-size: 17px;
    }

    .futfut-results-status {
        width: 26px;
        height: 26px;
        font-size: 14px;
    }
}


/* =========================================================
   Bouton "Plein écran"
   ========================================================= */

.futfut-fullscreen-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin: 0 0 10px;
}

/* Choix du niveau, à gauche du bouton "Plein écran" */
.futfut-level-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-right: auto;
}

.futfut-level-picker-label {
    color: #5710b8;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 16px;
}

.futfut-level-picker .futfut-level-picker-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    margin: 0;
    padding: 8px 14px;
    cursor: pointer;
    color: #5710b8;
    background: #ffffff;
    border: 2px solid #eadfff;
    border-radius: 999px;
    box-shadow: 0 4px 0 #eadfff;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 16px;
    line-height: 1;
    text-transform: none;
    letter-spacing: 0;
}

.futfut-level-picker .futfut-level-picker-button small {
    font-size: 11px;
    letter-spacing: -2px;
}

.futfut-level-picker .futfut-level-picker-button:hover,
.futfut-level-picker .futfut-level-picker-button:focus-visible {
    border-color: #7b3cf0;
    outline: none;
}

.futfut-level-picker .futfut-level-picker-button.is-current {
    color: #ffffff;
    background: #7b3cf0;
    border-color: #7b3cf0;
    box-shadow: 0 4px 0 #5710b8;
}

@media (max-width: 600px) {
    .futfut-level-picker {
        flex: 1 1 100%;
        flex-wrap: nowrap;
        margin-right: 0;
    }

    .futfut-level-picker-label {
        display: none;
    }

    .futfut-level-picker .futfut-level-picker-button {
        flex: 1 1 0;
        flex-direction: column;
        justify-content: center;
        gap: 2px;
        min-width: 0;
        padding: 6px 4px;
        font-size: 15px;
    }
}

.futfut-fullscreen-bar .futfut-fullscreen-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    margin: 0;
    padding: 8px 16px;
    cursor: pointer;
    color: #5710b8;
    background: #ffffff;
    border: 2px solid #eadfff;
    border-radius: 999px;
    box-shadow: 0 4px 0 #eadfff;
    font-family: "Fredoka Bold", Fredoka, Arial, sans-serif;
    font-size: 15px;
    line-height: 1;
    text-transform: none;
}

.futfut-fullscreen-bar .futfut-fullscreen-button:hover,
.futfut-fullscreen-bar .futfut-fullscreen-button:focus-visible {
    color: #ffffff;
    background: #7b3cf0;
    border-color: #7b3cf0;
    outline: none;
}

.futfut-fullscreen-bar .futfut-fullscreen-button span {
    font-size: 18px;
}

/* En plein écran, la page garde son fond (et non du noir). */
html:fullscreen {
    overflow-y: auto;
    background: #fdf6ef;
}

html:-webkit-full-screen {
    overflow-y: auto;
    background: #fdf6ef;
}
