/* Killer — end styles (one owner: lot « Mort, mur, fin », see docs/PLAN-MULTI-AGENTS.md §3.2). Use the tokens of style.css.
   Screens: fin-dead (9), fin-ghost (10), fin-wall (11), fin-rank (12), fin-grille (13), fin-rematch (14).
   Every screen is ONE portrait page that never scrolls (390x844, 375x667, 320x568), targets >= 44 px, nothing under 11 px,
   the main action >= 30 px above the bottom (the .screen padding of style.css). */
:root { --dead: #b80f26; --dead-deep: #5e0412; }

/* ---- feel.js: the flash that goes with the visual shake when the phone cannot vibrate ---- */
.feel-flash { position: fixed; inset: 0; z-index: 50; pointer-events: none; background: var(--danger); animation: fin-flash .7s ease-out forwards; }
@keyframes fin-flash { from { opacity: .85; } to { opacity: 0; } }

/* ---- 9. Tu es mort: the wahou ---- */
.fin-dead { z-index: 5; text-align: center; color: #fff; padding: 24px 20px var(--margin-bottom);
  background: radial-gradient(120% 90% at 50% 30%, var(--dead) 0%, var(--dead-deep) 100%); }
.fin-dead .center { gap: 18px; }
.fin-dead-title { font-size: clamp(34px, 13vw, 58px); line-height: 1.05; font-weight: 900; overflow-wrap: anywhere; animation: fin-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; }
.fin-dead-by { font-size: 20px; line-height: 1.3; max-width: 20em; }
.fin-hunter { font-weight: 800; }
.fin-gadget { font-style: normal; font-weight: 700; background: rgba(0, 0, 0, .28); border-radius: 6px; padding: 0 .3em; overflow-wrap: anywhere; }
.fin-dead-play { font-size: 26px; font-weight: 800; line-height: 1.15; animation: fin-pulse 1.2s ease-in-out .5s infinite alternate; }
.fin-dead-safe { margin: 0; font-size: 13px; opacity: .9; }
@keyframes fin-pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fin-pulse { from { transform: scale(1); } to { transform: scale(1.06); } }

/* ---- 10. Hors jeu ---- */
.fin-ghost { text-align: center; }
.fin-title { font-size: 34px; }
.fin-chrono { color: var(--muted); font-size: 16px; }
.fin-clock { display: block; margin-top: 4px; color: var(--ink); font-size: 46px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fin-wait { font-size: 18px; max-width: 18em; }
.fin-sound { align-self: center; width: auto; min-width: 180px; }

/* ---- 11. Le mur: the ring of the chain, then the timeline ---- */
.fin-wall { gap: 8px; }
.fin-wall-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.fin-wall-head h2 { flex: 1; min-width: 0; font-size: 20px; }
.fin-skip { width: auto; min-width: 96px; padding: 0 18px; color: var(--ink); border: 1px solid var(--muted); }
.fin-skip[hidden] { display: none; }
.fin-ring-title { margin: 0; text-align: center; }
.fin-ring-box { position: relative; flex: 1 1 0; min-height: 0; }
.fin-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fin-node circle { fill: var(--panel); stroke: var(--muted); stroke-width: 2; transition: fill .3s, stroke .3s; }
.fin-node.me circle { stroke: var(--accent); stroke-width: 3.5; }
.fin-init { fill: var(--ink); font-size: 15px; font-weight: 700; text-anchor: middle; }
.fin-lbl { fill: var(--ink); font-size: 13px; text-anchor: middle; }
.fin-node.dead circle { fill: #3a0f18; stroke: var(--danger); }
.fin-node.dead .fin-init { fill: var(--danger); }
.fin-node.dead .fin-lbl { fill: var(--muted); }
.fin-node.left circle { stroke-dasharray: 4 3; opacity: .6; }
.fin-node.left .fin-lbl { fill: var(--muted); }
.fin-link { stroke: var(--muted); stroke-width: 1.5; opacity: .5; }
.fin-head-dim { fill: var(--muted); opacity: .8; }
.fin-hit { stroke: var(--danger); stroke-width: 3; opacity: .85; }
.fin-hit.hot { stroke-width: 4.5; opacity: 1; stroke-dasharray: 220; animation: fin-draw .5s ease-out both; }
.fin-head-hot { fill: var(--danger); }
@keyframes fin-draw { from { stroke-dashoffset: 220; } to { stroke-dashoffset: 0; } }
.fin-clocks { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; margin-top: 2px; }
.fin-track { position: relative; height: 6px; margin: 4px 5px 10px; background: var(--panel-2); border-radius: 3px; }
.fin-track-fill { height: 100%; width: 0; background: var(--danger); border-radius: 3px; transition: width .45s ease; }
.fin-dot { position: absolute; top: 50%; width: 12px; height: 12px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--bg); border: 2px solid var(--muted); }
.fin-dot.lit { background: var(--danger); border-color: var(--ink); }
.fin-line { min-height: 4.4em; margin: 0; text-align: center; font-size: 15px; line-height: 1.45; }
.fin-line.pop { animation: fin-line-in .35s ease both; }
@keyframes fin-line-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fin-next:not(.ready) { visibility: hidden; }

/* ---- 12. Classement ---- */
.fin-rank, .fin-rematch, .fin-grille { gap: 10px; }
.fin-head { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.fin-kicker { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fin-winner { font-size: 22px; line-height: 1.15; }
.fin-reason { margin: 0; }
.fin-rank > * { flex-shrink: 0; }   /* a block that cannot fit must overflow (end.js then tightens), never overlap its neighbour */
.fin-ranks { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
.fin-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 6px 10px; background: var(--panel); border-radius: 10px; }
.fin-row.me { outline: 2px solid var(--accent); }
.fin-row.left { opacity: .7; }
.fin-rk { font-size: 16px; font-weight: 800; text-align: center; color: var(--accent); }
.fin-row.win .fin-rk { color: var(--ok); }
.fin-nm { font-size: 16px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-me { margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; vertical-align: 1px; }
.fin-ks { font-size: 13px; color: var(--muted); white-space: nowrap; }
.fin-dt { grid-column: 2 / 4; font-size: 12px; line-height: 1.25; color: var(--muted); }
.fin-epis h3, .fin-wins-title { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.fin-epi { margin: 0 0 4px; font-size: 13px; line-height: 1.3; }
.fin-epi b { color: var(--accent); }
.fin-wins { display: flex; flex-direction: column; }
.fin-wins-list, .fin-who { display: flex; flex-wrap: wrap; gap: 6px; }
.fin-who { justify-content: center; gap: 8px; }
.fin-chip { padding: 4px 12px; border-radius: 999px; background: var(--panel); font-size: 14px; }
.fin-chip.on { background: var(--ok); color: #05281a; font-weight: 700; }
.fin-chip.none { color: var(--muted); }
.fin-rank .fin-go { margin-top: auto; flex-shrink: 0; }
/* The screen overflows: end.js adds .compact, then .tight, then .tiny, until it does not. */
.fin-rank.compact .fin-dt, .fin-rank.compact .fin-reason { display: none; }
.fin-rank.tight { gap: 6px; }
.fin-rank.tight .fin-kicker { display: none; }
.fin-rank.tight .fin-row { padding: 3px 10px; }
.fin-rank.tight .fin-ranks { gap: 3px; }
.fin-rank.tight .fin-epi { margin-bottom: 2px; font-size: 12px; }
.fin-rank.tight .fin-chip { padding: 2px 10px; }
.fin-rank.tiny .fin-epis h3, .fin-rank.tiny .fin-wins-title { display: none; }

/* ---- 13. Grille du testeur ---- */
.fin-grille-head { text-align: center; }
.fin-grille-head h2 { margin-bottom: 4px; }
.fin-q { display: flex; flex-direction: column; justify-content: center; }
.pt-q { display: flex; flex-direction: column; gap: 14px; text-align: center; }
.pt-step { margin: 0; font-size: 13px; color: var(--muted); }
.pt-ask { margin: 0; font-size: 22px; font-weight: 700; line-height: 1.25; }
.pt-grades { display: flex; gap: 8px; }
.pt-grade { flex: 1; min-width: 44px; min-height: 56px; border: 0; border-radius: var(--radius); background: var(--panel-2); color: var(--ink); font: inherit; font-size: 22px; font-weight: 700; }
.pt-grade.on { background: var(--accent); color: var(--accent-ink); }
.pt-grade:active { transform: scale(.96); }
.pt-ends { display: flex; justify-content: space-between; gap: 12px; margin: 0; font-size: 12px; color: var(--muted); }
.fin-pass { align-self: center; width: auto; min-width: 160px; }

/* ---- 14. Revanche ---- */
.fin-rematch { text-align: center; }
.fin-rematch .center { gap: 18px; }
.fin-rematch .fin-go { max-width: 340px; }
.fin-asked { margin: 0; }
.fin-quit { align-self: center; width: auto; min-width: 180px; color: var(--ink); border: 1px solid var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .fin-dead-title, .fin-dead-play, .fin-line.pop, .fin-hit.hot { animation: none; }
  .fin-track-fill, .fin-node circle { transition: none; }
  .feel-flash { animation: none; opacity: .3; }
}
