/* Vue Exercice : le film. Positions en % de la scène, tailles en em
   (donc tout suit la taille de la dalle). Chorégraphie dans js/film.js. */
.view.view-film { padding: 0; overflow: hidden; }
.fx { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; background: radial-gradient(120% 90% at 50% 0%, #0a1122 0%, var(--ink) 62%); }
.fx-stage { position: relative; overflow: hidden; }
.fx-stage p, .fx-stage h2, .fx-stage h3 { margin: 0; }

/* Rail des trois phases : la progression se remplit, un clic saute à la phase */
.fx-rail { display: flex; align-items: end; gap: .8em; padding: .7em 1.4em 1em; counter-reset: ch; position: relative; z-index: 3; }
.fx-rail [data-ch] { flex: 1; counter-increment: ch; text-align: left; background: none; border: 0; padding: 0; display: grid; gap: .5em; color: var(--faint); font-size: .86em; transition: color .3s; }
.fx-rail [data-ch] span::before { content: counter(ch); font-family: var(--mono); font-size: .86em; margin-right: .7em; opacity: .7; }
.fx-rail [data-ch]:hover { color: var(--text); }
.fx-rail [data-ch].on { color: #fff; }
.fx-rail i { display: block; height: 2px; background: var(--line-2); }
.fx-rail i b { display: block; height: 100%; width: 0; background: var(--blue); transition: width .8s linear; }
.fx-rail [data-ch="sim"] i b { background: var(--red); box-shadow: 0 0 .6em var(--red); }
.fx-replay { flex: none; margin-bottom: -.5em; }

/* Intro et question finale : la typo fait l'image */
.fx-stage .fx-title { position: absolute; left: 7%; right: 7%; top: 50%; transform: translateY(-56%); font-family: var(--display); font-weight: 400; font-size: 4.9em; line-height: 1.04; letter-spacing: -.016em; }
.fx-line { display: block; }
.fx-word { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .12em; margin-bottom: -.12em; }
.fx-word i { display: inline-block; font-style: normal; }
.fx-stage .fx-question { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: #000; font-family: var(--display); font-weight: 400; font-size: 6.4em; letter-spacing: -.02em; padding: 0 6%; }
.fx-question span { display: block; }

.fx-cap { position: absolute; left: 4.5%; bottom: 5%; font-family: var(--display); font-size: 2em; line-height: 1.15; max-width: 80%; z-index: 4; }
.fx-cap-top { bottom: auto; top: 7%; left: 8%; }
.fx-cap-mid { left: 0; right: 0; bottom: auto; top: 58%; max-width: none; text-align: center; }
.fx-note { position: absolute; right: 8%; top: 9%; font-size: .8em; color: var(--faint); }

/* Préparation : les trois étapes de l'entonnoir, affichées en haut */
.fx-steps { position: absolute; left: 4.5%; top: 5.5%; margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: .5em 1.7em; counter-reset: st; font-size: .92em; z-index: 4; }
.fx-steps li { counter-increment: st; display: flex; align-items: center; gap: .6em; color: var(--faint); transition: color .4s; }
.fx-steps li::before { content: counter(st); font-family: var(--mono); font-size: .8em; width: 1.7em; height: 1.7em; border: 1px solid currentColor; border-radius: 50%; display: inline-grid; place-items: center; flex: none; }
.fx-steps li.on { color: #fff; font-weight: 600; }
.fx-steps li.on::before { color: var(--red); }
.fx-steps li.done { color: var(--dim); }
.fx-steps li.done::before { content: "✓"; color: var(--term); }
.fx-ref { position: absolute; right: 4.5%; top: 5.8%; font-family: var(--mono); font-size: .7em; color: var(--dim); border: 1px solid var(--line-2); padding: .2em .65em; border-radius: 2px; z-index: 4; }

/* 1 et 2 : menaces, fonctions critiques et les liens entre elles */
.fx-map { position: absolute; inset: 0; }
.fx-link { position: absolute; height: 1px; transform-origin: 0 50%; background: rgba(150, 170, 205, .34); transition: background .3s, box-shadow .3s; }
.fx-link.hot { background: var(--red); box-shadow: 0 0 .5em var(--red); }
.fx-node { position: absolute; width: 0; height: 0; opacity: 0; }
.fx-node i { position: absolute; left: -.38em; top: -.38em; width: .76em; height: .76em; border-radius: 50%; background: var(--blue); transition: background .2s, box-shadow .2s; }
.fx-node span { position: absolute; left: 1em; top: -.72em; white-space: nowrap; color: #cfd5de; font-size: .95em; transition: color .2s; }
.fx-node.l span { left: auto; right: 1em; }
.fx-node.hot i { background: var(--red); box-shadow: 0 0 1.1em var(--red); }
.fx-node.hot i::after { content: ""; position: absolute; inset: -.5em; border-radius: 50%; border: 1px solid var(--red); animation: fx-lock .7s ease-out both; }
.fx-node.hot span { color: #fff; font-weight: 600; }
@keyframes fx-lock { from { transform: scale(3.2); opacity: 0; } }
.fx-sweep { position: absolute; width: 0; height: 0; opacity: 0; pointer-events: none; }
.fx-sweep b { position: absolute; border-radius: 50%; background: conic-gradient(from 0deg, transparent 0 76%, rgba(75, 132, 255, .05) 82%, rgba(75, 132, 255, .34) 100%); }
.fx-core {
  position: absolute; transform: translate(-50%, -50%); text-align: center; white-space: nowrap; display: grid; gap: .15em;
  padding: .85em 1.7em; border: 1px solid var(--line-2); border-radius: 99px; background: rgba(4, 6, 10, .9);
  transition: border-color .4s, box-shadow .4s;
}
.fx-core b { font-family: var(--display); font-weight: 400; font-size: 1.55em; }

/* 3 : les scénarios graves mais plausibles, dont un est retenu */
.fx-deck { position: absolute; left: 6%; right: 6%; top: 50%; transform: translateY(-52%); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.1em; }
.fx-card { display: grid; gap: .7em; align-content: start; min-height: 9em; padding: 1.4em 1.3em 1.5em; border: 1px solid var(--line-2); border-radius: .3em; background: rgba(11, 14, 19, .92); transition: border-color .12s, background .12s, box-shadow .12s, transform .5s cubic-bezier(.2, .8, .2, 1); }
.fx-card b { font-family: var(--display); font-weight: 400; font-size: 1.7em; line-height: 1.1; }
.fx-card span { font-size: .8em; color: var(--dim); }
.fx-card.lit { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 1.6em rgba(75, 132, 255, .35); }
.fx-card.won { border-color: var(--red); background: rgba(240, 72, 62, .1); box-shadow: 0 0 2.8em rgba(240, 72, 62, .4); transform: scale(1.08); }
.fx-count { position: absolute; left: 0; right: 0; top: 70%; text-align: center; font-family: var(--mono); font-size: .86em; color: #cfd5de; }

/* Simulation : l'horloge fictive, le catalogue qui défile et les fenêtres d'injects */
.fx-clock { position: absolute; left: 4.5%; top: 5%; transform-origin: 50% 50%; display: flex; align-items: baseline; gap: .7em; font-family: var(--mono); z-index: 6; }
.fx-day { font-size: 1.05em; color: var(--dim); }
.fx-time { font-size: 3.5em; font-weight: 500; letter-spacing: -.03em; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; }
.fx-win {
  position: absolute; padding: .85em 1em 1em; border-radius: .45em; background: var(--graph); border: 1px solid var(--line-2);
  box-shadow: 0 1.4em 3.4em rgba(0, 0, 0, .65); transform: rotate(var(--rot, 0deg)); transition: filter .5s;
}
/* Assombries sans transparence : les fenêtres se recouvrent, leurs textes ne doivent pas se mêler */
.fx-win.dim { filter: saturate(.5) brightness(.5); }
.fx-win header { display: flex; gap: .8em; align-items: baseline; font-family: var(--mono); font-size: .7em; color: var(--dim); margin-bottom: .7em; }
.fx-win header time { color: var(--red); }
.fx-win header b { font-weight: 500; }
/* Le catalogue : la bande défile et s'arrête sous le cadre */
.fx-reel { position: absolute; left: 0; right: 0; bottom: 0; height: 3em; display: flex; align-items: center; gap: 1em; padding: 0 1.4em; z-index: 7; background: linear-gradient(transparent, rgba(4, 6, 10, .92) 50%); }
.fx-reel-label { flex: none; font-family: var(--mono); font-size: .7em; color: var(--dim); }
.fx-reel-win { position: relative; flex: 1; min-width: 0; height: 100%; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); }
.fx-reel-track { position: absolute; left: 0; top: 0; height: 100%; display: flex; align-items: center; white-space: nowrap; will-change: transform; }
.fx-reel-track span { padding: 0 1.3em; font-size: .84em; color: var(--faint); transition: color .2s; }
.fx-reel-track span.sel { color: #fff; font-weight: 600; }
.fx-reel-sel { position: absolute; left: 50%; top: 50%; width: 8em; height: 1.9em; transform: translate(-50%, -50%); border: 1px solid var(--line-2); border-radius: 2px; pointer-events: none; transition: width .25s, border-color .2s, box-shadow .2s; }
.fx-reel-sel.on { border-color: var(--red); box-shadow: 0 0 1.2em rgba(240, 72, 62, .45); }

/* Emplacements 1 à 9 (content.js → film.sim.beats[].slot) */
.fx-w1 { left: 4.5%; top: 24%; width: 31%; }
.fx-w2 { left: 22%; top: 43%; width: 31%; }
.fx-w3 { left: 67%; top: 5%; width: 25%; }
.fx-w4 { left: 5%; top: 62%; width: 35%; }
.fx-w5 { left: 79%; top: 31%; width: 17.5%; }
.fx-w6 { left: 44%; top: 62%; width: 29%; }
.fx-w7 { left: 34%; top: 4%; width: 30%; }
.fx-w8 { left: 53%; top: 36%; width: 25%; }
.fx-w9 { left: 30%; top: 29%; width: 21%; }

.fx-from { font-size: .8em; color: var(--dim); }
.fx-subj { font-size: 1.3em; font-weight: 600; min-height: 1.45em; }
.fx-count-down { font-family: var(--mono); font-size: 2.1em; color: var(--red); margin-top: .25em; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.fx-news { background: #f4f1e9; border-color: #f4f1e9; color: #17140f; }
.fx-news header { color: #6a6355; }
.fx-news header time { color: #b3261e; }
.fx-mast { font-family: var(--display); font-weight: 600; font-size: 1.05em; padding-bottom: .3em; border-bottom: 2px solid #17140f; }
.fx-flag { display: inline-block; margin-top: .75em; background: #b3261e; color: #fff; font-size: .68em; font-weight: 600; padding: .12em .5em; }
.fx-head { font-family: var(--display); font-weight: 600; font-size: 1.55em; line-height: 1.1; letter-spacing: -.01em; margin-top: .35em; min-height: 2.2em; }
.fx-reach { font-size: .76em; color: #6a6355; margin-top: .55em; }
.fx-reach b { font-family: var(--mono); font-weight: 500; color: #b3261e; font-variant-numeric: tabular-nums; }

.fx-call { text-align: center; background: radial-gradient(100% 80% at 50% 0%, #133324 0%, var(--coal) 80%); border-color: rgba(69, 224, 138, .4); display: grid; justify-items: center; }
.fx-call header { justify-self: start; }
.fx-av { width: 3.4em; height: 3.4em; border-radius: 50%; background: #1d2b3d; display: grid; place-items: center; font-weight: 600; margin: .4em 0 .7em; position: relative; }
.fx-av::before, .fx-av::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--term); animation: ring 1.4s ease-out infinite; }
.fx-av::after { animation-delay: .7s; }
.fx-name { font-size: 1.2em; font-weight: 600; }
.fx-sub { font-size: .8em; color: var(--dim); }
.fx-call .call-bars { justify-content: center; height: 1.5em; margin-top: .5em; }

.fx-who { font-size: .8em; color: var(--dim); }
.fx-bars { display: flex; align-items: center; gap: 2px; height: 3.2em; margin: .5em 0; }
.fx-bars i { flex: 1; height: calc(var(--h) * 100%); background: var(--red); border-radius: 1px; animation: fx-breathe 1s ease-in-out infinite; animation-delay: calc(var(--i) * -67ms); }
@keyframes fx-breathe { 50% { transform: scaleY(.45); } }
.fx-quote { font-family: var(--display); font-style: italic; font-size: 1.3em; }

.fx-video, .fx-clip { padding: 0; overflow: hidden; aspect-ratio: 9 / 16; border-radius: .9em; background: #05070c; }
.fx-clip { aspect-ratio: 16 / 9; border-radius: .45em; }
.fx-video video, .fx-clip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fx-live { position: absolute; left: .8em; bottom: .7em; z-index: 2; background: var(--red); color: #fff; font-size: .68em; font-weight: 600; padding: .15em .55em; display: inline-flex; align-items: center; gap: .45em; }
.fx-live::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: #fff; animation: live 1.2s ease-in-out infinite; }
.fx-video header, .fx-clip header { position: absolute; left: 0; right: 0; top: 0; z-index: 2; margin: 0; padding: .8em .9em 1.6em; background: linear-gradient(rgba(0, 0, 0, .75), transparent); color: #fff; }
.fx-video::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--blue); box-shadow: 0 0 1.2em .2em var(--blue); animation: fx-scan 2.1s linear infinite; }
@keyframes fx-scan { to { transform: translateY(32em); } }
.fx-face { position: absolute; left: 20%; top: 24%; width: 60%; height: 36%; border: 1px solid rgba(75, 132, 255, .85); border-radius: .2em; animation: fx-track 2.6s ease-in-out infinite; }
.fx-face em { position: absolute; left: -1px; top: 100%; font-style: normal; font-family: var(--mono); font-size: .58em; background: var(--blue); color: #fff; padding: .1em .45em; white-space: nowrap; }
@keyframes fx-track { 50% { transform: translate(3%, 2%) scale(1.04); } }

.fx-dark { background: #060906; border-color: rgba(69, 224, 138, .35); font-family: var(--mono); }
.fx-dk-title { font-size: .92em; color: #e6e9ee; }
.fx-dk-label { font-size: .66em; color: var(--dim); margin-top: .7em; }
.fx-dk-price { color: var(--term); font-size: .95em; }
.fx-dk-price b { font-size: 2em; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fx-dk-ends { font-size: .78em; color: var(--red); font-variant-numeric: tabular-nums; }

.fx-chat { display: grid; gap: .4em; }
.fx-bub { width: fit-content; max-width: 86%; padding: .42em .75em; border-radius: .2em .8em .8em .8em; background: var(--graph-2); font-size: .92em; }
.fx-bub.me { justify-self: end; background: var(--blue); color: #fff; border-radius: .8em .2em .8em .8em; }

.fx-chip { position: absolute; z-index: 8; white-space: nowrap; padding: .42em .8em; font-size: .86em; background: rgba(20, 25, 32, .97); border-left: 2px solid var(--red); box-shadow: 0 .6em 1.8em rgba(0, 0, 0, .6); }

/* Restitution : le relevé */
.fx-ledger { position: absolute; left: 8%; right: 8%; top: 20%; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line-2); }
.fx-ledger li { display: grid; grid-template-columns: 7em minmax(0, 1fr) minmax(0, 1.15fr) 1.6em; gap: 0 1.4em; align-items: center; padding: .5em 0; border-bottom: 1px solid var(--line); font-size: 1.02em; }
.fx-ledger time { font-family: var(--mono); font-size: .8em; color: var(--dim); }
.fx-ledger b { font-weight: 600; font-size: 1.05em; }
.fx-ledger span { color: #cfd5de; }
.fx-ledger svg { width: 1.5em; height: 1.5em; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fx-ledger path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.fx-ledger .ok svg { stroke: var(--term); }
.fx-ledger .ko svg { stroke: var(--red); }
.fx-ledger .ko span { color: #ff8d85; }
.fx-cta { position: absolute; left: 8%; bottom: 6%; display: flex; flex-wrap: wrap; gap: .8em; z-index: 5; }
.btn.ghost { background: none; border: 1px solid var(--line-2); color: var(--text); }
.btn.ghost:hover { background: var(--blue-soft); border-color: var(--blue); }

/* ---------- Écran étroit : les fenêtres s'empilent au centre ---------- */
@container scr (max-width: 760px) {
  .fx-stage .fx-title { font-size: 2.7em; }
  .fx-stage .fx-question { font-size: 3.3em; }
  .fx-cap { font-size: 1.45em; }
  .fx-rail { gap: .5em; padding: .6em .9em .8em; }
  .fx-rail [data-ch] { font-size: .78em; }
  .fx-node span { font-size: .78em; }
  .fx-core b { font-size: 1.1em; }
  .fx-steps { flex-direction: column; gap: .35em; font-size: .8em; top: 3%; }
  .fx-ref { top: auto; bottom: 4.5em; right: 6%; }
  .fx-deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7em; }
  .fx-card { padding: .9em .8em 1em; }
  .fx-card b { font-size: 1.2em; }
  .fx-count { top: 78%; }
  .fx-reel-label { display: none; }
  .fx-time { font-size: 2.6em; }
  .fx-win { left: 7%; width: 86%; top: calc(18% + var(--i) * 5.2%); }
  .fx-w3 { left: 16%; width: 68%; }
  .fx-w5 { left: 29%; width: 42%; }
  .fx-ledger { left: 6%; right: 6%; top: 17%; }
  .fx-ledger li { grid-template-columns: 5.4em minmax(0, 1fr) 1.4em; gap: 0 .7em; padding: .28em 0; font-size: .9em; }
  .fx-ledger b, .fx-ledger span { grid-column: 2; }
  .fx-ledger svg { grid-column: 3; grid-row: 1 / span 2; }
  .fx-cap-top { left: 6%; top: 5%; }
  .fx-note { right: 6%; top: 11.5%; }
  .fx-cta { left: 6%; right: 6%; bottom: 4%; }
}
