/* fin-partie.css — la carte de fin de partie (fin-partie.js), chargée par
   les six jeux ; tirée de game-ux.css le 6 oct., que 2viZu ne charge pas. */

/* ============================================================
   La carte de fin de partie, commune aux jeux (Julien, 5 oct. : « améliore
   la page, c'est pas très harmonieux ») : le jeu et le niveau, le mot de
   félicitation, deux tuiles — votre temps, votre record —, puis Rejouer,
   Changer de niveau et la page des exercices. Même carte que le défi du joK.
   ============================================================ */
.fin-box {
    background: #fff; border-radius: 22px; width: 100%; max-width: 360px;
    padding: 22px 18px 14px; text-align: center; color: #3a2a22;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.35);
    display: flex; flex-direction: column; align-items: stretch; gap: 14px;
}
.fin-niveau { align-self: center; margin: 0; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-radius: 50px; padding: 4px 12px; }
.fin-titre { margin: -4px 0 0; font-size: 2rem; line-height: 1.1; font-weight: 900; color: #0089D4; }
.fin-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fin-score { background: #f6efe3; border-radius: 16px; padding: 12px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.fin-score small { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: #8b7d6f; }
.fin-score b { font-size: 1.7rem; font-weight: 900; font-variant-numeric: tabular-nums; color: #3a2a22; line-height: 1.2; }
.fin-score em { font-style: normal; font-size: 14px; font-weight: 700; color: #6b5c4a; }
/* Un nouveau record : la tuile du temps passe à l'or. */
.fin-score.fin-score-or { background: #fff4c2; box-shadow: inset 0 0 0 2px #FFD700; }
.fin-score.fin-score-or em { color: #9a6800; }
.fin-actions { display: flex; flex-direction: column; gap: 10px; }
.fin-actions button { font-family: inherit; font-size: 1rem; font-weight: 800; min-height: 50px; border-radius: 50px; cursor: pointer; padding: 0 16px; }
.fin-rejouer { background: linear-gradient(145deg, #0089D4, #00699f); color: #fff; border: none; }
.fin-niveaux { background: #fff; color: #3a2a22; border: 2px solid #ddd2c0; }
.fin-niveaux:hover { border-color: #b9a88f; }
.fin-exercices { display: flex; align-items: center; justify-content: center; min-height: 44px; font-size: 0.95rem; font-weight: 700; color: #0089D4; text-decoration: none; }
.fin-exercices:hover { text-decoration: underline; }
/* La carte commune (fin-partie.js) : la ligne de détail (coups, sauts…) et
   « Partager votre résultat » (Julien, 6 oct.). */
.fin-overlay[hidden] { display: none; }
.fin-box .k-tilt { display: inline-block; transform: rotate(-10deg); color: inherit; }
.fin-detail { margin: -4px 0 0; font-size: 1rem; color: #6b5c4a; }
.fin-detail b { font-size: 1.35rem; font-weight: 900; color: #3a2a22; }
.fin-scores.fin-scores-seul { grid-template-columns: 1fr; }
.fin-actions .fin-partager { align-self: center; min-height: 44px; padding: 0 22px; font-size: 0.95rem; background: #fff; color: #0089D4; border: 2px solid #0089D4; }   /* petit, sous les deux grands boutons */

/* L'aperçu de l'image à partager, au-dessus de la carte de fin. */
.fin-partage { position: fixed; inset: 0; z-index: 10070; background: rgba(30, 22, 16, 0.78); display: flex; align-items: center; justify-content: center; padding: 14px; }
.fin-partage-box { width: 100%; max-width: 380px; max-height: 100%; display: flex; flex-direction: column; gap: 12px; }
.fin-partage-image { display: flex; align-items: center; justify-content: center; min-height: 200px; flex: 1 1 auto; overflow: hidden; }
.fin-partage-image img { max-width: 100%; max-height: calc(100vh - 230px); max-height: calc(100dvh - 230px); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4); }
.fin-partage-image span { color: #fff; font-weight: 700; }
.fin-partage-actions { display: flex; flex-direction: column; gap: 8px; }
.fin-partage-actions > * { min-height: 50px; border-radius: 50px; font: inherit; font-weight: 800; font-size: 1rem; display: flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; border: 0; }
.fin-partage-envoyer { background: #0089D4; color: #fff; }
.fin-partage-enregistrer { background: #fff; color: #3a2a22; }
.fin-partage-fermer { background: transparent; color: #fff; min-height: 44px !important; }
