/* v8: reactions after each choice (story) and the scene-by-scene ending film */

/* ---------- story: the reaction cut-in on the stage; the figure's portrait steps aside for it ---------- */
#s-story .st-portrait { transition: translate .45s cubic-bezier(.2,1.2,.4,1), opacity .35s ease, transform .45s cubic-bezier(.2,1.4,.4,1); }
#s-story .st-stage.rx-l .st-portrait { translate: 42% 0; }
#s-story .st-stage.rx-r .st-portrait { translate: -42% 0; }
#s-story .rx-cut {
  position: absolute; top: 4%; bottom: 3%; right: 4%; width: 36%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  pointer-events: none; z-index: 4; opacity: 0;
  transform: translateX(40%) rotate(3deg);
  transition: transform .42s cubic-bezier(.2,1.35,.4,1), opacity .25s ease;
}
#s-story .rx-cut.on { opacity: 1; transform: rotate(1.5deg); }
#s-story .rx-cut.ally { right: auto; left: 4%; transform: translateX(-40%) rotate(-3deg); }
#s-story .rx-cut.ally.on { transform: rotate(-1.5deg); }
#s-story .rx-cut .rx-frame {
  position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 100%; flex: 0 1 auto;
  border-radius: 14px; overflow: hidden;
  border: 3px solid #d9b46a; box-shadow: 0 8px 24px rgba(0,0,0,.6), inset 0 0 0 2px rgba(0,0,0,.5);
  background: radial-gradient(ellipse at 50% 30%, #5a4026 0%, #241810 70%);
}
#s-story .rx-cut.rival .rx-frame { border-color: #c4473a; background: radial-gradient(ellipse at 50% 30%, #5a2a22 0%, #1e0f0c 70%); }
#s-story .rx-cut .rx-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
#s-story .rx-cut .rx-frame img.cast { object-fit: contain; object-position: 50% 100%; }
#s-story .rx-cut .rx-plate {
  margin-top: -.9rem; position: relative; z-index: 2; max-width: 120%;
  padding: .2rem .7rem .25rem; border-radius: 8px;
  background: linear-gradient(#3a2716, #1c120a); border: 2px solid #d9b46a;
  color: #f6dfa4; font-weight: 900; font-size: .95rem; text-align: center; line-height: 1.2;
  text-shadow: 0 2px 0 #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#s-story .rx-cut.rival .rx-plate { border-color: #c4473a; color: #ffd0c4; }
#s-story .rx-cut .rx-plate small { display: block; font-size: .7rem; font-weight: 700; opacity: .8; letter-spacing: .08em; }

#s-story .st-stage.rx-shake { animation: rxShake .38s ease-out; }
@keyframes rxShake {
  0%, 100% { transform: none; }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, 0); }
}

/* ---------- story: the reaction lines in the text card ---------- */
#s-story .rx-list { margin-top: .2rem; }
#s-story .rx-beat {
  display: flex; gap: .6rem; align-items: flex-start; margin: .6rem 0 .2rem;
  animation: rxIn .42s cubic-bezier(.2,1.35,.4,1) both;
}
#s-story .rx-beat .rx-av {
  flex: 0 0 2.7rem; width: 2.7rem; height: 2.7rem; border-radius: 50%; overflow: hidden;
  border: 2px solid #d9b46a; background: radial-gradient(#5a4026, #241810); box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
#s-story .rx-beat.rival .rx-av { border-color: #c4473a; background: radial-gradient(#5a2a22, #1e0f0c); }
#s-story .rx-beat .rx-av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
#s-story .rx-beat .rx-body { flex: 1 1 auto; min-width: 0; }
#s-story .rx-beat .rx-body b { display: block; font-weight: 900; color: #f3d48b; font-size: .95rem; line-height: 1.25; }
#s-story .rx-beat.rival .rx-body b { color: #ffb4a4; }
#s-story .rx-beat .rx-body b i {
  font-style: normal; font-weight: 700; font-size: .68rem; vertical-align: .12em;
  padding: .05em .5em; margin-left: .45em; border-radius: .7em;
  background: rgba(217,180,106,.25); color: #f6e2b0;
}
#s-story .rx-beat.rival .rx-body b i { background: rgba(196,71,58,.4); color: #ffe0d8; }
#s-story .rx-beat .rx-body p { margin: .15rem 0 0; line-height: 1.55; }
#s-story .rx-beat.nar { display: block; padding: .1rem 0 .1rem .7rem; border-left: 3px solid rgba(217,180,106,.6); font-style: italic; opacity: .95; }
#s-story .rx-beat.nar p { margin: 0; line-height: 1.6; color: #efe3c6; }
@keyframes rxIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

#s-story #st-tag.rx { background: linear-gradient(#7a2b22, #4a1712); border-color: #e0806e; color: #ffe3d8; }
#s-story .btn.choice.rx-next { text-align: center; font-weight: 900; }

/* ---------- film: reaction cut-ins, the cast row, the scene titles, the camera shake ---------- */
#cine.fshake { animation: fShake .5s ease-out; }
@keyframes fShake {
  0%, 100% { transform: none; }
  15% { transform: translate(-8px, 3px); }
  30% { transform: translate(7px, -4px); }
  45% { transform: translate(-5px, 2px); }
  60% { transform: translate(4px, -1px); }
  80% { transform: translate(-2px, 1px); }
}
#cine .film-rx {
  position: absolute; top: 17%; width: 46%; z-index: 6; pointer-events: none;
  display: flex; flex-direction: column; align-items: center;
  opacity: 0; transition: transform .5s cubic-bezier(.2,1.35,.4,1), opacity .3s ease;
}
#cine .film-rx.r { right: 6%; transform: translateX(60%) rotate(4deg); }
#cine .film-rx.l { left: 6%; transform: translateX(-60%) rotate(-4deg); }
#cine .film-rx.on.r { opacity: 1; transform: rotate(2deg); }
#cine .film-rx.on.l { opacity: 1; transform: rotate(-2deg); }
#cine .film-rx .fx-frame {
  width: 100%; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden;
  border: 3px solid #d9b46a; box-shadow: 0 12px 30px rgba(0,0,0,.7);
  background: radial-gradient(ellipse at 50% 30%, #5a4026 0%, #1a110a 75%);
}
#cine .film-rx.rival .fx-frame { border-color: #c4473a; background: radial-gradient(ellipse at 50% 30%, #5a2a22 0%, #170b09 75%); }
#cine .film-rx .fx-frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
#cine .film-rx .fx-frame img.cast { object-fit: contain; object-position: 50% 100%; }
#cine .film-rx .fx-plate {
  margin-top: -1rem; padding: .2rem .8rem .25rem; border-radius: 8px; max-width: 120%;
  background: linear-gradient(#3a2716, #1c120a); border: 2px solid #d9b46a;
  color: #f6dfa4; font-weight: 900; font-size: 1rem; text-shadow: 0 2px 0 #000;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#cine .film-rx.rival .fx-plate { border-color: #c4473a; color: #ffd0c4; }

#cine .film-castrow {
  position: absolute; left: 0; right: 0; top: 15%; z-index: 6; pointer-events: none;
  display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; padding: 0 8%;
}
#cine .film-castrow .cr-k {
  flex: 0 0 100%; text-align: center; color: #f3d48b; font-weight: 900; font-size: .9rem;
  letter-spacing: .12em; text-shadow: 0 2px 0 #000, 0 0 10px #000; margin-bottom: .2rem;
  animation: rxIn .5s ease both;
}
#cine .film-castrow .cr {
  width: 3.6rem; height: 3.6rem; border-radius: 50%; overflow: hidden;
  border: 2px solid #d9b46a; background: radial-gradient(#5a4026, #1a110a);
  box-shadow: 0 4px 12px rgba(0,0,0,.6);
  animation: crIn .5s cubic-bezier(.2,1.4,.4,1) both;
}
#cine .film-castrow .cr.me { width: 4.6rem; height: 4.6rem; border-width: 3px; border-color: #ffe08a; }
#cine .film-castrow .cr.rival { border-color: #c4473a; }
#cine .film-castrow .cr img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
@keyframes crIn { from { opacity: 0; transform: translateY(20px) scale(.6); } to { opacity: 1; transform: none; } }

#cine .film-act {
  position: absolute; left: 0; right: 0; top: 38%; z-index: 7; text-align: center; pointer-events: none;
  color: #f6dfa4; font-weight: 900; font-size: 2.1rem; letter-spacing: .2em;
  text-shadow: 0 3px 0 #000, 0 0 18px rgba(0,0,0,.9); opacity: 0;
}
#cine .film-act small { display: block; font-size: .95rem; letter-spacing: .1em; color: #e9dcc0; margin-top: .3rem; font-weight: 700; }
#cine .film-act.on { animation: actIn 1.5s ease both; }
@keyframes actIn {
  0% { opacity: 0; transform: scale(1.25); letter-spacing: .5em; }
  25% { opacity: 1; transform: none; letter-spacing: .2em; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: scale(.96); }
}
