/* ---------- F2 : écran après match ---------- */
.apres-match:not([hidden]) {
  position: fixed; z-index: 75; inset: 0; display: grid; place-items: center; padding: 16px; overflow-y: auto;
  background: rgba(5, 3, 4, .86); backdrop-filter: blur(4px);
}
.carte-apres {
  display: grid; gap: 14px; width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px 20px;
  background: var(--plaque); border: 1px solid var(--trait); border-top: 4px solid var(--trait);
}
.carte-apres.victoire { border-top-color: var(--rouge); box-shadow: 0 0 60px rgba(227, 6, 19, .3); }
.bandeau-apres { display: grid; gap: 6px; text-align: center; }
.bandeau-apres h2 { font: 700 clamp(44px, 12vw, 64px)/1 var(--f-titre); text-transform: uppercase; letter-spacing: .02em; }
.victoire .bandeau-apres h2 { color: var(--rouge-vif); }
.defaite .bandeau-apres h2 { color: var(--gris); }
.score-apres { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; color: var(--gris); }
.score-apres .chiffre { font-size: 26px; font-weight: 700; color: var(--texte); }
.score-apres img { border-radius: 50%; }
.score-apres b { color: var(--texte); }

.ligne-apres { display: grid; grid-template-columns: 110px 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; background: var(--sol); border: 1px solid var(--trait); }
.ligne-apres .libelle, .defis-apres .libelle { font: 600 12px/1 var(--f-titre); letter-spacing: .12em; text-transform: uppercase; color: var(--gris); }
.elo-apres .chiffre { font-size: 18px; }
.elo-apres .libelle:only-child { grid-column: 1 / -1; font: 500 15px/1.3 var(--f-texte); letter-spacing: 0; text-transform: none; } /* match non classé */
.delta { font: 700 24px/1 var(--f-chiffre); }
.delta.plus { color: var(--ok); }
.delta.moins { color: var(--ko); }
.kc-apres .chiffre { grid-column: 3; color: var(--or); font-weight: 700; }
.xp-apres .chiffre { font-weight: 700; color: #35d0c4; }
.barre-apres { display: block; height: 8px; background: var(--plaque-2); overflow: hidden; }
.barre-apres i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #35d0c4, #7ef0e6); transition: width 1.2s cubic-bezier(.2, .8, .2, 1); }
.niveau-apres { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font: 700 20px/1 var(--f-titre); text-transform: uppercase; color: #35d0c4; }
.niveau-apres .btn { min-height: 44px; }

.rang-apres { padding: 14px; text-align: center; font: 700 22px/1.2 var(--f-titre); text-transform: uppercase; border: 1px solid var(--c); }
.rang-apres b { color: var(--c); }
.rang-apres.promu { background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%); animation: eclat-rang 1s ease-out; }
.rang-apres.retrograde { opacity: .85; }
.rang-stable { text-align: center; color: var(--gris); }

.defis-apres { display: grid; gap: 8px; }
.defis-apres ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.defis-apres li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; background: var(--sol); font-size: 14px; }
.defis-apres li.fini b { color: var(--ok); }

.boutons-apres, .menu-partage { display: flex; flex-wrap: wrap; gap: 10px; }
.boutons-apres .btn, .menu-partage .btn { flex: 1 1 140px; min-height: 48px; }
.menu-partage[hidden] { display: none; }

.attente-apres { text-align: center; justify-items: center; }
.attente-apres h2 { font: 700 26px/1.2 var(--f-titre); text-transform: uppercase; }
.chrono-attente { font-size: 44px; font-weight: 700; color: var(--rouge-vif); }
.attente-apres p { color: var(--gris); }

/* Historique du profil : un match se rouvre au clic. */
[data-revoir-match] { cursor: pointer; }
[data-revoir-match]:hover, [data-revoir-match]:focus-visible { outline: 1px solid var(--rouge); }

@keyframes eclat-rang { from { transform: scale(.9); opacity: 0; } 60% { transform: scale(1.04); opacity: 1; } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .barre-apres i { transition: none; }
  .rang-apres.promu { animation: none; }
}

/* F30 : courbe des kills relevés par le robot */
.courbe-apres { margin: 0 0 14px; padding: 12px 14px 10px; background: rgb(255 255 255 / .03); border: 1px solid var(--trait); border-radius: 12px; }
.tete-courbe { display: flex; justify-content: space-between; margin-bottom: 6px; }
.courbe-apres svg { display: block; width: 100%; height: 96px; overflow: visible; }
.courbe-apres path { fill: none; stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.courbe-apres path.moi { stroke: var(--rouge-vif); }
.courbe-apres path.adv { stroke: var(--gris); stroke-dasharray: 4 3; }
.courbe-apres .axe { stroke: var(--trait); vector-effect: non-scaling-stroke; }
.courbe-apres .bascule { stroke: var(--or); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.legende-courbe { display: flex; gap: 16px; margin-top: 6px; font-size: 12px; color: var(--gris); }
.legende-courbe span::before { content: ""; display: inline-block; width: 14px; height: 3px; margin-right: 6px; vertical-align: middle; border-radius: 2px; }
.legende-courbe .moi::before { background: var(--rouge-vif); }
.legende-courbe .adv::before { background: var(--gris); }
