/* Profil (profil.js) : annonces de hauts faits et bilan de fin de partie. Préfixe pf-. */
.pf-piece { width: 1.05em; height: 1.05em; vertical-align: -.17em; flex: none; }

/* Annonces : un sceau d'or qui descend du haut, puis s'efface */
.pf-toasts { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; z-index: 90; transform: translateX(-50%); display: grid; gap: 8px; width: min(calc(100% - 32px), 380px); pointer-events: none; }
.pf-toast {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px 14px 10px 10px;
  background: linear-gradient(180deg, #2A1C14, #160E0B); border: 1px solid rgba(240, 196, 107, .7);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .7), 0 0 26px rgba(240, 196, 107, .22), inset 0 1px 0 rgba(255, 240, 200, .15);
  color: var(--encre, #EDE3D1); animation: pf-descend .5s cubic-bezier(.2, 1.3, .4, 1) both;
}
.pf-toast.sortie { animation: pf-remonte .45s ease-in both; }
.pf-toast-sceau {
  width: 38px; height: 38px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #FFF3C4, #E9C066 40%, #8A5E16 100%);
  box-shadow: 0 0 0 2px #3A2408, 0 0 0 3px rgba(240, 196, 107, .6), 0 0 16px rgba(240, 196, 107, .55);
  position: relative;
}
.pf-toast-sceau::after { content: ""; position: absolute; inset: 9px; border: 1.5px solid #5A3A0C; border-radius: 50%; border-top-color: transparent; transform: rotate(-30deg); }
.pf-toast-texte { display: grid; gap: 2px; min-width: 0; }
.pf-toast-texte b { font: 600 1.08rem/1.15 var(--titre, serif); color: var(--serment, #F0D9A0); }
.pf-toast-texte span { font-size: .88rem; color: var(--encre-att, #A8998A); }
@keyframes pf-descend { from { opacity: 0; transform: translateY(-24px) scale(.96); } }
@keyframes pf-remonte { to { opacity: 0; transform: translateY(-16px); } }

/* Bilan de fin de partie */
.pf-bilan {
  position: fixed; inset: 0; z-index: 85; display: grid; align-items: end; justify-items: center; padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom)); background: rgba(5, 3, 4, .6); animation: pf-fondu .3s ease-out both;
}
.pf-bilan.sortie { animation: pf-fondu .3s ease-in reverse both; }
@keyframes pf-fondu { from { opacity: 0; } }
.pf-bilan-carte {
  position: relative; width: min(100%, 420px); display: grid; gap: 10px; padding: 22px 20px 20px;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(240, 196, 107, .14), transparent 70%), linear-gradient(180deg, #1F1517, #0F0A0C);
  border: 1px solid rgba(240, 196, 107, .5); box-shadow: 0 30px 70px rgba(0, 0, 0, .75);
  animation: pf-monte .45s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes pf-monte { from { opacity: 0; transform: translateY(30px); } }
.pf-bilan-sur { margin: 0; text-align: center; font: italic 500 1rem/1 var(--titre, serif); color: var(--encre-att, #A8998A); }
.pf-bilan h2 { margin: 0; text-align: center; font: 600 2rem/1.05 var(--titre, serif); color: var(--encre, #EDE3D1); }
.pf-bilan-gain { color: #F2C46B; text-shadow: 0 0 22px rgba(240, 196, 107, .55); font-variant-numeric: lining-nums tabular-nums; }
.pf-bilan-lignes { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 4px; }
.pf-bilan-lignes li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--filet, #3B2A2E); font-size: .95rem; }
.pf-bilan-lignes li span:last-child { color: var(--serment, #F0D9A0); }
.pf-bilan-hf span:first-child { color: var(--serment, #F0D9A0); font-family: var(--titre, serif); font-size: 1.05rem; font-weight: 600; }
.pf-bilan-total { margin: 4px 0 0; text-align: center; color: var(--encre-att, #A8998A); font-size: .92rem; }
.pf-bilan-actions { display: grid; gap: 8px; margin-top: 6px; }
.pf-bilan-actions .bouton { width: 100%; text-decoration: none; }
.pf-bilan-fermer { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: none; color: var(--encre-att, #A8998A); font: 300 1.8rem/1 var(--titre, serif); cursor: pointer; }
.pf-bilan-fermer:hover { color: var(--serment, #F0D9A0); }

@media (prefers-reduced-motion: reduce) {
  .pf-toast, .pf-toast.sortie, .pf-bilan, .pf-bilan.sortie, .pf-bilan-carte { animation: none; }
}

/* Bilan : le trésor se compte, les hauts faits éclatent, l'objectif suivant */
.pf-bilan-tresor { display: grid; justify-items: center; gap: 2px; }
.pf-bilan-piece { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle, rgba(242, 196, 107, .32), transparent 70%); }
.pf-bilan-piece .pf-piece { width: 46px; height: 46px; filter: drop-shadow(0 0 12px rgba(242, 196, 107, .7)); animation: pf-tourne 1.4s ease-in-out .4s 2; }
@keyframes pf-tourne { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(-1); } }
.pf-bilan h2 { font-size: 2.5rem; }
.pf-bilan.compte .pf-bilan-gain { animation: pf-gonfle .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pf-gonfle { 40% { transform: scale(1.25); text-shadow: 0 0 34px rgba(255, 231, 168, 1); } }
.pf-bilan-gain { display: inline-block; }
.pf-bilan-lignes li { opacity: 0; animation: pf-ligne .45s cubic-bezier(.2, .8, .3, 1) calc(2.1s + var(--n, 0) * .42s) forwards; }
@keyframes pf-ligne { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
.pf-bilan-hf { align-items: center; }
.pf-bilan-hf-nom { flex: 1; min-width: 0; }
.pf-bilan-sceau {
  flex: none; width: 22px; height: 22px; border-radius: 50%; transform: scale(.4); opacity: .4;
  background: radial-gradient(circle at 38% 32%, #FFF3C4, #E9C066 40%, #8A5E16); box-shadow: 0 0 0 1.5px #3A2408, 0 0 0 2.5px rgba(242, 196, 107, .55);
  transition: transform .45s cubic-bezier(.2, 1.8, .4, 1), opacity .2s, box-shadow .45s;
}
.pf-bilan-hf.eclate .pf-bilan-sceau { transform: scale(1); opacity: 1; box-shadow: 0 0 0 1.5px #3A2408, 0 0 0 2.5px rgba(242, 196, 107, .7), 0 0 16px rgba(242, 196, 107, .8); }
.pf-bilan-hf.eclate { background: linear-gradient(90deg, rgba(242, 196, 107, .14), transparent 70%); }
.pf-objectif { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid rgba(242, 196, 107, .28); background: rgba(242, 196, 107, .06); opacity: 0; transition: opacity .5s; }
.pf-bilan.fini .pf-objectif { opacity: 1; }
.pf-objectif p { margin: 0; text-align: center; font-size: .95rem; line-height: 1.35; color: var(--encre, #EDE3D1); }
.pf-objectif b { color: var(--serment, #F0D9A0); font-family: var(--titre, serif); font-size: 1.08rem; }
.pf-objectif-type { font-family: var(--texte, serif); font-weight: 400; font-size: .82rem; color: var(--encre-att, #A8998A); }
.pf-objectif-barre { position: relative; display: block; height: 6px; border-radius: 3px; overflow: hidden; background: rgba(5, 3, 4, .9); box-shadow: inset 0 0 0 1px var(--filet, #3B2A2E); }
.pf-objectif-barre > span { position: absolute; inset: 0; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, #B9852A, #F2C46B, #FFF3C4); transition: transform 1s cubic-bezier(.2, .8, .3, 1) .2s; }
.pf-bilan.fini .pf-objectif-barre > span { transform: scaleX(var(--v, 0)); }
.pf-objectif.pret { border-color: rgba(242, 196, 107, .6); box-shadow: 0 0 22px rgba(242, 196, 107, .2); }
.pf-bilan-boutique { position: relative; overflow: hidden; min-height: 60px; padding: 0 16px; font-size: 1.08rem; letter-spacing: .06em; white-space: nowrap; }
.pf-bilan-boutique .pf-piece { width: 24px; height: 24px; }
.pf-bilan-boutique::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .7) 50%, transparent 65%) 0 0 / 250% 100% no-repeat;
  animation: pf-lustre 3.2s ease-in-out 3s infinite;
}
@keyframes pf-lustre { 0% { background-position: 130% 0; } 45%, 100% { background-position: -30% 0; } }

/* Bourse dans les en-têtes des téléphones : ouvre la boutique */
.pf-bourse {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 10px 0 7px; flex: none;
  border: 1px solid rgba(242, 196, 107, .45); border-radius: 999px; cursor: pointer;
  background: radial-gradient(ellipse at 30% 0%, rgba(242, 196, 107, .18), transparent 70%), #140D0B;
  color: #F6D894; font: 600 1rem/1 var(--titre, serif);
}
.pf-bourse .pf-piece { width: 18px; height: 18px; filter: drop-shadow(0 0 5px rgba(242, 196, 107, .5)); }
.pf-bourse:active { transform: scale(.96); }

/* La boutique par-dessus la partie */
.pf-boutique { position: fixed; inset: 0; z-index: 88; background: #0B0809; animation: pf-fondu .22s ease-out both; }
.pf-boutique.sortie { animation: pf-fondu .22s ease-in reverse both; }
.pf-boutique iframe { width: 100%; height: 100%; border: 0; display: block; }

.bourse-entete { min-height: 30px; padding: 0 8px 0 6px; font-size: .9rem; vertical-align: middle; }
.bourse-entete .pf-piece { width: 15px; height: 15px; }
.perso-salon { margin-top: 18px; }
/* Aventure : la bourse se range sous le bouton du son, les stats lui laissent la place */
.bourse-av { position: absolute; top: 48px; right: 8px; z-index: 3; min-height: 30px; padding: 0 8px 0 6px; font-size: .9rem; }
.bourse-av .pf-piece { width: 15px; height: 15px; }
/* Le son, la musique et le compte en haut, la bourse dessous : la fiche leur laisse la colonne de droite */
.av-entete:has(.bourse-av) .av-moi { padding-right: 128px; }
.bouton-boutique { text-decoration: none; margin-top: 10px; }

/* Carte « Personnaliser » des salons (téléphones) */
.pf-perso {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 14px;
  border: 1px solid rgba(242, 196, 107, .35); background: radial-gradient(ellipse 70% 120% at 0% 50%, rgba(242, 196, 107, .1), transparent 70%), rgba(20, 13, 15, .85);
  text-align: left; width: 100%; color: var(--encre, #EDE3D1); cursor: pointer; font: inherit;
}
.pf-perso-apercu { display: flex; align-items: flex-end; gap: 8px; line-height: 0; }
.pf-perso-apercu .de6 { --taille: 22px; }
.pf-perso-corps { display: grid; gap: 3px; min-width: 0; }
.pf-perso-corps b { font: 600 1.15rem/1.1 var(--titre, serif); color: var(--serment, #F0D9A0); }
.pf-perso-corps span { font-size: .84rem; line-height: 1.3; color: var(--encre-att, #A8998A); }
.pf-perso-corps .pf-perso-bourse { display: inline-flex; align-items: center; gap: 5px; color: #F6D894; font: 600 .95rem/1 var(--titre, serif); }
.pf-perso:hover, .pf-perso:focus-visible { border-color: rgba(242, 196, 107, .7); }

@media (prefers-reduced-motion: reduce) {
  .pf-bilan-piece .pf-piece, .pf-bilan.compte .pf-bilan-gain, .pf-bilan-boutique::after, .pf-boutique, .pf-boutique.sortie { animation: none; }
  .pf-bilan-lignes li { animation: none; opacity: 1; }
  .pf-objectif { opacity: 1; }
  .pf-objectif-barre > span { transition: none; transform: scaleX(var(--v, 0)); }
}

/* Lien vers la boutique en fin de partie */
.lien-boutique { display: inline-block; justify-self: center; padding: 10px 4px; color: var(--serment, #F0D9A0); font: italic 600 1.02rem/1.2 var(--titre, serif); text-decoration: underline; text-decoration-color: rgba(240, 217, 160, .4); text-underline-offset: 4px; text-align: center; }
.lien-boutique:hover { text-decoration-color: currentColor; }
.pf-bilan-fermer:focus-visible { outline-offset: -8px; }

/* Serments : le sceau de cire (monnaie premium), partout à côté de l'Or */
.pf-serment { width: 1.1em; height: 1.1em; vertical-align: -.2em; flex: none; }
.pf-bourse .pf-serment { width: 18px; height: 18px; margin-left: 4px; filter: drop-shadow(0 0 5px rgba(92, 184, 255, .45)); }
.pf-bourse b + .pf-serment { margin-left: 6px; }
.pf-bilan-annales { font-size: .95rem; }

/* L'exclusivité Céleste de la Tour : une annonce à part */
.pf-toast--celeste { border-color: rgba(143, 230, 218, .7) !important; box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 0 26px rgba(143, 230, 218, .35) !important; }
.pf-toast--celeste .pf-toast-sceau { background: conic-gradient(#8FE6DA, #B9A4FF, #FFE7A8, #8FE6DA) !important; }
.pf-toast--celeste .pf-toast-texte b { color: transparent; -webkit-background-clip: text; background-clip: text; background-image: linear-gradient(100deg, #A8F0E6, #FFFFFF 45%, #CBB8FF 70%, #FFE7A8); }

/* Bilan : pourquoi la partie rapporte moins (trop courte, interrompue, plafond du jour) */
.pf-bilan-note { margin: 6px 0 0; padding: 8px 10px; border-left: 2px solid rgba(240, 217, 160, .5); background: rgba(240, 217, 160, .06); font-size: .88rem; line-height: 1.4; color: var(--encre, #EDE3D1); text-align: left; }

/* Bilan : « Un avis sur cette partie ? » (un bouton qui a l’air d’un lien) */
.pf-bilan-avis { display: block; margin: 6px auto 0; padding: 6px 4px; background: none; border: 0; font: inherit; cursor: pointer; }
