/* Chat text effects (m/chatfx.js): "red:wave: hello". Loaded by the desktop and mobile pages.
   Bright colours with a thin black shadow so they read on every theme. */
.fx { text-shadow: 1px 1px 0 #000, -1px 0 0 rgba(0, 0, 0, 0.55), 0 -1px 0 rgba(0, 0, 0, 0.55); font-weight: 600; }
.fx-word { white-space: nowrap; }
.fx-ch { display: inline-block; white-space: pre; }

/* colours */
.fx-yellow { color: #ffff00; }
.fx-red    { color: #ff2a2a; }
.fx-green  { color: #33ff33; }
.fx-cyan   { color: #00ffff; }
.fx-purple { color: #ff4dff; }
.fx-white  { color: #ffffff; }
.fx-flash1 { animation: fx-flash1 0.9s steps(1) infinite; }
.fx-flash2 { animation: fx-flash2 0.9s steps(1) infinite; }
.fx-flash3 { animation: fx-flash3 0.9s steps(1) infinite; }
.fx-glow1  { animation: fx-glow1 3s linear infinite; }
.fx-glow2  { animation: fx-glow2 3s linear infinite; }
.fx-glow3  { animation: fx-glow3 3s linear infinite; }
@keyframes fx-flash1 { 0% { color: #ff2a2a; } 50% { color: #ffff00; } }
@keyframes fx-flash2 { 0% { color: #00ffff; } 50% { color: #3f6dff; } }
@keyframes fx-flash3 { 0% { color: #33ff33; } 50% { color: #0d7a0d; } }
@keyframes fx-glow1 { 0% { color: #ff2a2a; } 20% { color: #ffff00; } 40% { color: #33ff33; } 60% { color: #00ffff; } 80% { color: #ff4dff; } 100% { color: #ff2a2a; } }
@keyframes fx-glow2 { 0% { color: #ff2a2a; } 33% { color: #ff4dff; } 66% { color: #3f6dff; } 100% { color: #ff2a2a; } }
@keyframes fx-glow3 { 0% { color: #ffffff; } 33% { color: #33ff33; } 66% { color: #00ffff; } 100% { color: #ffffff; } }

/* letter-by-letter movement */
.fx-wave .fx-ch  { animation: fx-wave 1.2s ease-in-out infinite; animation-delay: calc(var(--i) * -0.09s); }
.fx-wave2 .fx-ch { animation: fx-wave2 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * -0.09s); }
.fx-shake .fx-ch { animation: fx-shake 0.3s steps(2) infinite; animation-delay: calc(var(--i) * -0.07s); }
@keyframes fx-wave  { 0%, 100% { transform: translateY(-0.18em); } 50% { transform: translateY(0.18em); } }
@keyframes fx-wave2 { 0%, 100% { transform: translate(-0.08em, -0.18em); } 50% { transform: translate(0.08em, 0.18em); } }
@keyframes fx-shake { 0% { transform: translate(0.06em, -0.08em); } 50% { transform: translate(-0.06em, 0.08em); } }

/* whole-message movement: scroll right to left across a band, slide in and out */
.fx-scroll, .fx-slide { display: inline-block; vertical-align: bottom; overflow: hidden; white-space: nowrap; }
.fx-scroll { width: min(26em, 70%); }
.fx-scroll .fx-move { display: inline-block; padding-left: 100%; animation: fx-scroll 7s linear infinite; }
.fx-slide .fx-move { display: inline-block; animation: fx-slide 3.5s ease-in-out infinite; }
@keyframes fx-scroll { from { transform: translateX(0); } to { transform: translateX(-100%); } }
@keyframes fx-slide { 0% { transform: translateY(-120%); } 15%, 80% { transform: translateY(0); } 100% { transform: translateY(120%); } }

/* Devices set to reduce motion: colour only, no movement or flashing */
@media (prefers-reduced-motion: reduce) {
  .fx, .fx * { animation: none !important; }
  .fx-flash1, .fx-glow1 { color: #ff2a2a; }
  .fx-flash2, .fx-glow2 { color: #00ffff; }
  .fx-flash3, .fx-glow3 { color: #33ff33; }
  .fx-scroll, .fx-slide { width: auto; white-space: normal; }
  .fx-scroll .fx-move { padding-left: 0; }
}
