/*! amara-fx.css v1 – efekty rozmowy w „Amarze” + niższe pole wpisywania */

/* ---------- pole wpisywania: równe z przyciskiem ---------- */
#story .chat-input.flafx-row { align-items: stretch; gap: 10px; margin-top: 12px; }
#story .chat-input.flafx-row button { margin: 0 !important; flex: 0 0 auto; }
#story .chat-input.flafx-row input {
  height: auto; min-height: 0; margin: 0;
  padding: 0 14px; line-height: 1.2;
  border: 1px solid #333; border-radius: 0;
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
#story .chat-input.flafx-row input:focus {
  outline: none; border-color: rgba(0, 243, 255, .65); background-color: #1d1d22;
  box-shadow: 0 0 0 1px rgba(0, 243, 255, .25), 0 0 14px rgba(0, 243, 255, .18);
}
#story .chat-input.flafx-row input:disabled { opacity: .55; }
@media (max-width: 700px) {
  #story .chat-input.flafx-row { gap: 8px; }
  #story .chat-input.flafx-row button { padding-left: 16px !important; padding-right: 16px !important; }
  #story .chat-input.flafx-row input { padding: 0 10px; }
}

/* ---------- pasek nad czatem (status + 🔊) ---------- */
#story .flafx-bar {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 26px; margin: 18px 0 -14px;
}
#story .flafx-bar + .chat-window { margin-top: 18px; }
#story .flafx-mute {
  all: unset; cursor: pointer; font-size: 15px; line-height: 1;
  padding: 4px 6px; opacity: .55; border-radius: 4px; transition: opacity .2s;
}
#story .flafx-mute:hover, #story .flafx-mute:focus-visible { opacity: 1; outline: 1px solid rgba(0, 243, 255, .5); }
#story .flafx-badge {
  font-family: 'Courier New', monospace; font-size: 12px; letter-spacing: 1px; color: #7fd8e0; opacity: .85;
}
#story .flafx-badge:empty { visibility: hidden; }
#story .flafx-rec { color: #ff6b6b; }
#story .flafx-rec i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ff3b3b;
  margin-right: 6px; vertical-align: 0; box-shadow: 0 0 6px #ff3b3b; animation: flafxBlink 1.2s steps(1) infinite;
}
#story .flafx-call i {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #00f3ff;
  margin-right: 6px; box-shadow: 0 0 6px #00f3ff; animation: flafxBreathDot 1.6s ease-in-out infinite;
}
#story .flafx-call b { font-weight: normal; }
#story .flafx-ended { opacity: .4; }
#story .flafx-ended i { animation: none; background: #777; box-shadow: none; }

/* ---------- wiadomości ---------- */
#story .flafx-win .msg { transform-origin: left center; }
#story .flafx-sent { animation: flafxSent .35s ease-out both; }
#story .flafx-recv { animation: flafxRecv .45s ease-out both; }
/* migający kursor podczas pisania odpowiedzi */
#story .flafx-typing::after {
  content: ''; display: inline-block; width: 7px; height: 1em; margin-left: 2px;
  vertical-align: -2px; background: currentColor; opacity: .7; animation: flafxBlink .8s steps(1) infinite;
}
/* „Amara myśli…” – spokojny oddech */
#story .flafx-think { animation: flafxBreath 1.8s ease-in-out infinite; }
#story .flafx-think::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: #00f3ff; margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 8px #00f3ff;
  animation: flafxBreathDot 1.8s ease-in-out infinite;
}
/* myśli Claire – wyłaniają się jak wspomnienie */
#story .flafx-thought { animation: flafxMemory .9s ease-out both; }
/* wskazówka ⭐ – złoty połysk przelatuje po tekście (obok istniejącego clueReveal) */
#story .msg.flafx-clue {
  background: linear-gradient(100deg, transparent 30%, rgba(255, 209, 102, .22) 50%, transparent 70%) no-repeat;
  background-size: 250% 100%; background-position: 130% 0;
  animation: clueReveal .7s ease, flafxShine 1.4s .35s ease-out both;
  padding: 2px 4px; margin-left: -4px;
}
#story .flafx-summary { animation: flafxSummary .9s ease-out both; }
#story .flafx-warn { color: #ffb347; animation: flafxMemory .6s ease-out both, flafxWarn 1.2s .2s ease-in-out 2; }
#story .flafx-lock { color: #ff7b7b; font-family: 'Courier New', monospace; font-style: normal; animation: flafxGlitchTxt .6s steps(2) 1; }
#story .chat-window.flafx-glitch { animation: flafxGlitchWin .6s steps(3) 1; }

/* ---------- karty postaci ---------- */
#story .metaCard.flafx-cardglow { animation: flafxCard 1.4s ease-out; }
#story .metaCard img.flafx-imgreveal { animation: flafxImg 1.3s ease-out; }
#story .metaTitle.flafx-relabel { animation: flafxRelabel .9s ease-out; }

/* ---------- „Zakończ rozmowę” gotowe ---------- */
#story .flafx-endready button { animation: flafxIn .5s ease-out both, flafxReady 2.4s .5s ease-in-out 3; }

/* ---------- nagranie (scena 9) ---------- */
#story .recordingBox.flafx-playing .recordingLabel::after {
  content: ''; display: inline-block; width: 22px; height: 10px; margin-left: 10px; vertical-align: -1px;
  background: linear-gradient(#00eaff, #00eaff) 0 100%/3px 40% no-repeat,
              linear-gradient(#00eaff, #00eaff) 6px 100%/3px 90% no-repeat,
              linear-gradient(#00eaff, #00eaff) 12px 100%/3px 60% no-repeat,
              linear-gradient(#00eaff, #00eaff) 18px 100%/3px 75% no-repeat;
  animation: flafxEq .5s ease-in-out infinite alternate;
}
#story .flafx-recline { opacity: 0; transform: translateX(-6px); transition: opacity .5s ease, transform .5s ease; }
#story .flafx-recline.flafx-on { opacity: 1; transform: none; }

/* ---------- klatki ---------- */
@keyframes flafxBlink { 0%, 49% { opacity: .7; } 50%, 100% { opacity: 0; } }
@keyframes flafxSent { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
@keyframes flafxRecv { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes flafxIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes flafxBreath { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@keyframes flafxBreathDot { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes flafxMemory { from { opacity: 0; filter: blur(3px); letter-spacing: .04em; } to { opacity: 1; filter: none; letter-spacing: normal; } }
@keyframes flafxShine { from { background-position: 130% 0; } to { background-position: -30% 0; } }
@keyframes flafxSummary { from { opacity: 0; border-left-width: 0; transform: translateY(6px); } to { opacity: 1; border-left-width: 4px; transform: none; } }
@keyframes flafxWarn { 0%, 100% { text-shadow: none; } 50% { text-shadow: 0 0 10px rgba(255, 179, 71, .7); } }
@keyframes flafxGlitchTxt { 0% { transform: translateX(-3px); opacity: .4; } 50% { transform: translateX(3px); } 100% { transform: none; opacity: 1; } }
@keyframes flafxGlitchWin { 0% { box-shadow: inset 0 0 0 1px rgba(255, 60, 60, .6); filter: hue-rotate(20deg); } 100% { box-shadow: none; filter: none; } }
@keyframes flafxCard { 0% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); border-color: #333; }
  25% { box-shadow: 0 0 22px rgba(255, 209, 102, .55); border-color: #ffd166; }
  100% { box-shadow: 0 0 0 rgba(255, 209, 102, 0); border-color: #333; } }
@keyframes flafxImg { 0% { opacity: 0; filter: blur(6px) brightness(2); transform: scale(.94); } 100% { opacity: 1; filter: none; transform: none; } }
@keyframes flafxRelabel { 0% { opacity: 0; letter-spacing: .3em; color: #ffd166; } 100% { opacity: 1; letter-spacing: normal; } }
@keyframes flafxReady { 0%, 100% { box-shadow: 0 0 15px rgba(0, 243, 255, .4); } 50% { box-shadow: 0 0 26px rgba(0, 243, 255, .85), 0 0 8px rgba(255, 0, 255, .4) inset; } }
@keyframes flafxEq { from { background-size: 3px 30%, 3px 80%, 3px 50%, 3px 95%; } to { background-size: 3px 85%, 3px 35%, 3px 95%, 3px 45%; } }

@media (prefers-reduced-motion: reduce) {
  #story .flafx-win .msg, #story .flafx-think, #story .flafx-think::before, #story .metaCard, #story .metaCard img,
  #story .metaTitle, #story .flafx-endready button, #story .chat-window, #story .flafx-rec i, #story .flafx-call i,
  #story .recordingLabel::after { animation: none !important; }
  #story .flafx-typing::after { display: none; }
  #story .flafx-recline { opacity: 1; transform: none; transition: none; }
}
