/* Who Faked Who — scene backdrops.
 *
 * One set of keyframes shared by every cut of every scene, so the wide
 * and banner versions of the same room move identically.
 *
 * Scenes are decoration. They sit behind the controls, never take pointer
 * events, and go completely still for anyone who asks for reduced motion.
 */

.fb-scene {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--fb-radius-lg, 0.5rem);
  border: 1px solid var(--fb-panel-border, rgba(148,163,184,0.25));
  background: #141010;
  line-height: 0;             /* kill the inline-svg descender gap */
  pointer-events: none;       /* never steal a tap from the controls */
  user-select: none;
}

.fb-scene[hidden] { display: none !important; }

.fb-scene .sc {
  display: block;
  width: 100%;
  height: auto;
  shape-rendering: crispEdges;
}

/* Wide cut rides behind the host's round flow; banner sits above the
   player's tiles. Caps stop a tall viewport stretching either one. */
.fb-scene-wide   .sc { max-height: 46vh; }
.fb-scene-banner .sc { max-height: 184px; }

/* A caption lane over the bottom of the scene, for "who sent page 02". */
.fb-scene-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.4rem 0.85rem 0.55rem;
  /* Deep enough that the caption stays legible over chips and cards. */
  background: linear-gradient(to top,
              rgba(10,9,8,0.97) 0%, rgba(10,9,8,0.92) 45%, rgba(10,9,8,0) 100%);
  text-shadow: 0 1px 2px rgba(0,0,0,0.9);
  color: #E8C87A;
  font-family: var(--fb-font-mono, ui-monospace, monospace);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}
.fb-scene-caption .sub {
  display: block;
  color: #8A7A5E;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* ---------- shared animation ---------- */

@keyframes sc-swing { 0%,100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
.sc-lamp { animation: sc-swing 6.5s ease-in-out infinite; transform-origin: 50% 0; }

@keyframes sc-bulbflick { 0%,88%,100% { opacity: 1; } 90% { opacity: .62; } 92% { opacity: .95; } }
.sc-bulb { animation: sc-bulbflick 7s steps(1) infinite; }

@keyframes sc-smoke {
  0%   { transform: translateY(0) translateX(0);      opacity: 0; }
  15%  { opacity: .5; }
  100% { transform: translateY(-104px) translateX(22px); opacity: 0; }
}
.sc-smk  { animation: sc-smoke 6s linear infinite; }
.sc-smk2 { animation-delay: 2s; }
.sc-smk3 { animation-delay: 4s; }

@keyframes sc-nudge {
  0%,70%,100% { transform: translateY(0); }
  76%         { transform: translateY(-8px); }
  82%         { transform: translateY(0); }
}
.sc-chips { animation: sc-nudge 4.2s ease-in-out infinite; }

@keyframes sc-flip {
  0%,55%   { transform: scaleX(1); }
  62%      { transform: scaleX(0.08); }
  70%,100% { transform: scaleX(1); }
}
.sc-flip { animation: sc-flip 5.5s ease-in-out infinite; transform-origin: 50% 50%; }

@keyframes sc-faceshow { 0%,62% { opacity: 0; } 70%,100% { opacity: 1; } }
.sc-cardface { animation: sc-faceshow 5.5s steps(1) infinite; }

@keyframes sc-backshow { 0%,62% { opacity: 1; } 70%,100% { opacity: 0; } }
.sc-cardback { animation: sc-backshow 5.5s steps(1) infinite; }

@keyframes sc-lean { 0%,100% { transform: translateX(0); } 50% { transform: translateX(5px); } }
.sc-leanA { animation: sc-lean 7s ease-in-out infinite; }
.sc-leanB { animation: sc-lean 8.4s ease-in-out infinite; animation-delay: -3s; }

@keyframes sc-peek { 0%,86%,100% { opacity: 1; } 88%,92% { opacity: 0; } }
.sc-eyes { animation: sc-peek 4.4s steps(1) infinite; }

/* ---------- office ---------- */

@keyframes sc-tube { 0%,96%,100% { opacity: 1; } 97% { opacity: .45; } 98% { opacity: .9; } }
.sc-tube { animation: sc-tube 11s steps(1) infinite; }

@keyframes sc-bubble {
  0%   { transform: translateY(0);    opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(-42px); opacity: 0; }
}
.sc-bub  { animation: sc-bubble 2.6s linear infinite; }
.sc-bub2 { animation-delay: .85s; }
.sc-bub3 { animation-delay: 1.7s; }

@keyframes sc-blink { 0%, 62% { opacity: .18; } 70%, 100% { opacity: 1; } }
.sc-led { animation: sc-blink 1.5s steps(1) infinite; }

@keyframes sc-feed { 0% { height: 0; } 70% { height: 54px; } 100% { height: 54px; } }
.sc-paper { animation: sc-feed 9s ease-out infinite; }

@keyframes sc-crt { 0%,92%,100% { opacity: .92; } 94% { opacity: .62; } 96% { opacity: 1; } }
.sc-crt { animation: sc-crt 5.5s steps(1) infinite; }

@keyframes sc-tick { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.sc-hand { animation: sc-tick 60s linear infinite; }

@keyframes sc-sway { 0%,100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
.sc-frond { animation: sc-sway 6s ease-in-out infinite; }

/* The walker crosses, then waits offscreen most of the cycle, so the room
   feels occupied without someone pacing past every four seconds. */
@keyframes sc-walk {
  0%   { transform: translateX(-160px); }
  45%  { transform: translateX(1400px); }
  100% { transform: translateX(1400px); }
}
.sc-walk { animation: sc-walk 19s linear infinite; }

@keyframes sc-stride { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
.sc-legA { animation: sc-stride .62s steps(1) infinite; }
.sc-legB { animation: sc-stride .62s steps(1) infinite; animation-delay: .31s; }

@keyframes sc-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.sc-bob { animation: sc-bob .62s ease-in-out infinite; }

/* ---------- studio ---------- */

@keyframes sc-beamA { 0%,100% { transform: skewX(-3deg); } 50% { transform: skewX(3deg); } }
@keyframes sc-beamB { 0%,100% { transform: skewX(3deg); }  50% { transform: skewX(-3deg); } }
.sc-beamA { animation: sc-beamA 9s ease-in-out infinite; transform-origin: 50% 0; }
.sc-beamB { animation: sc-beamB 11s ease-in-out infinite; transform-origin: 50% 0; }

@keyframes sc-glow { 0%,100% { opacity: 1; } 50% { opacity: .72; } }
.sc-glow { animation: sc-glow 4s ease-in-out infinite; }

@keyframes sc-screen { 0%,100% { opacity: 1; } 50% { opacity: .88; } }
.sc-screen { animation: sc-screen 6s ease-in-out infinite; }

@keyframes sc-chase { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.sc-chase { animation: sc-chase 2.4s ease-in-out infinite; }

/* ---------- bakery ---------- */

@keyframes sc-oven { 0%,100% { opacity: 1; } 40% { opacity: .78; } 70% { opacity: .92; } }
.sc-oven { animation: sc-oven 2.3s steps(1) infinite; }

@keyframes sc-steam {
  0%   { transform: translateY(0) scaleX(1);      opacity: 0; }
  18%  { opacity: .85; }
  100% { transform: translateY(-74px) scaleX(1.5); opacity: 0; }
}
.sc-wisp  { animation: sc-steam 3.4s linear infinite; }
.sc-wisp2 { animation-delay: 1.1s; }
.sc-wisp3 { animation-delay: 2.2s; }

/* Pivots at the machine's drive shaft, so the beater orbits the bowl
   the way a stand mixer does, rather than swinging from its own tip. */
@keyframes sc-paddle { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.sc-paddle { animation: sc-paddle 1.9s linear infinite; }

@keyframes sc-swinglamp { 0%,100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } }
.sc-lampA { animation: sc-swinglamp 5s ease-in-out infinite; }
.sc-lampB { animation: sc-swinglamp 5s ease-in-out infinite; animation-delay: -2.1s; }

@keyframes sc-tail { 0%,100% { transform: rotate(-9deg); } 50% { transform: rotate(14deg); } }
.sc-tail { animation: sc-tail 2.8s ease-in-out infinite; }

@keyframes sc-motes {
  0%   { transform: translateY(0);   opacity: 0; }
  25%  { opacity: .55; }
  100% { transform: translateY(54px); opacity: 0; }
}
.sc-mote  { animation: sc-motes 6s linear infinite; }
.sc-mote2 { animation-delay: 2s; }
.sc-mote3 { animation-delay: 4s; }

@media (prefers-reduced-motion: reduce) {
  .sc-lamp, .sc-bulb, .sc-smk, .sc-chips, .sc-flip,
  .sc-cardface, .sc-cardback, .sc-leanA, .sc-leanB, .sc-eyes,
  .sc-tube, .sc-bub, .sc-led, .sc-paper, .sc-crt, .sc-hand, .sc-frond,
  .sc-walk, .sc-legA, .sc-legB, .sc-bob,
  .sc-beamA, .sc-beamB, .sc-glow, .sc-screen, .sc-chase,
  .sc-oven, .sc-wisp, .sc-paddle, .sc-lampA, .sc-lampB, .sc-tail, .sc-mote {
    animation: none;
  }
  .sc-cardback { opacity: 0; }   /* leave the card showing its face */
  .sc-legB     { opacity: 0; }   /* one pair of legs, not two */
  .sc-walk     { transform: translateX(240px); }  /* park them in frame */
}
