/* parley screen-transition FX layer. Overlays that sit above the views during a transition.
   Plain uses #fx-cut only; Lamp adds #fx-sweep + #fx-grit + #fx-scratch. Driven by transitions.js.
   Everything starts invisible and is pointer-events:none — never affects layout or input. */
#fx-layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#fx-layer > div { position: absolute; inset: 0; pointer-events: none; opacity: 0; }

/* Fade-to-black veil (near-black with a touch of noir blue). */
#fx-cut { background: #07060c; z-index: 1; }

/* Interrogation-lamp light bar that sweeps across the seam on Lamp transitions. */
#fx-sweep { right: auto; width: 46%; transform: translateX(-60%); z-index: 3; filter: blur(1px);
  background: linear-gradient(90deg, #0000 0%, #e7bf6a55 46%, #fff2cf3d 52%, #0000 100%); }

/* Running film grain — boils via background-position steps. JS bursts the opacity during the cut. */
#fx-grit { z-index: 4; mix-blend-mode: screen; background-size: 170px 170px;
  animation: fx-boil .45s steps(5) infinite;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"); }

/* Three sparse film scratches that flicker/jump. */
#fx-scratch { z-index: 4; mix-blend-mode: screen; animation: fx-scratch .4s steps(3) infinite;
  background: linear-gradient(90deg,#0000 21.8%,#e9d9b04d 22.1%,#0000 22.4%),
    linear-gradient(90deg,#0000 57.6%,#f0e2bb40 57.9%,#0000 58.2%),
    linear-gradient(90deg,#0000 79%,#e9d9b038 79.4%,#0000 79.8%); }

@keyframes fx-boil { 0%{background-position:0 0} 25%{background-position:-34px 20px} 50%{background-position:26px -30px} 75%{background-position:-20px -14px} 100%{background-position:30px 26px} }
@keyframes fx-scratch { 0%,100%{transform:translateX(0)} 33%{transform:translateX(-3px)} 66%{transform:translateX(4px)} }

/* Reduced motion: transitions.js already skips the whole sequence; stop the overlay's own
   idle animations too so nothing boils in the background. */
html[data-reduce="1"] #fx-grit, html[data-reduce="1"] #fx-scratch { animation: none; }
