/* Live emoji reactions (#158): the popups, the island badges, the tray and the room card. See reactions.js. */

/* ---- the emoji moves (Reactions.Motion); each plays once when a class is added */
.rx-em { display: inline-block; line-height: 1; transform-origin: 50% 70%; }
.rx-move-flicker { animation: rx-flicker .65s ease-out; }
.rx-move-clap { animation: rx-clap .6s ease-out; }
.rx-move-glow { animation: rx-glow .8s ease-out; }
.rx-move-jump { animation: rx-jump .7s ease-out; }
.rx-move-rock { animation: rx-rock .65s ease-in-out; }
.rx-move-shake { animation: rx-shake .4s linear; }
.rx-move-drop { animation: rx-drop .8s ease-in; }
.rx-move-launch { animation: rx-launch .7s ease-out; }
@keyframes rx-flicker { 0% { transform: scale(1); } 22% { transform: scale(1.3, 1.4); filter: brightness(1.25); } 40% { transform: scale(1.1, 1.15); } 58% { transform: scale(1.25, 1.3); filter: brightness(1.2); } 100% { transform: scale(1); filter: none; } }
@keyframes rx-clap { 0% { transform: scale(1); } 14% { transform: scale(1.35, .8); } 28% { transform: scale(.85, 1.15); } 42% { transform: scale(1.35, .8); } 56% { transform: scale(.85, 1.15); } 100% { transform: scale(1); } }
@keyframes rx-glow { 0% { transform: scale(1); filter: none; } 20% { transform: scale(1.25); filter: brightness(1.45) drop-shadow(0 0 8px var(--accent)); } 40% { transform: scale(1.1); filter: brightness(1.15) drop-shadow(0 0 4px var(--accent)); } 60% { transform: scale(1.22); filter: brightness(1.4) drop-shadow(0 0 8px var(--accent)); } 100% { transform: scale(1); filter: none; } }
@keyframes rx-jump { 0% { transform: translateY(0); } 25% { transform: translateY(-22px) scale(1.15); } 55% { transform: translateY(0); } 72% { transform: translateY(-8px); } 100% { transform: translateY(0); } }
@keyframes rx-rock { 0% { transform: rotate(0); } 18% { transform: rotate(-18deg); } 45% { transform: rotate(16deg); } 65% { transform: rotate(-12deg); } 85% { transform: rotate(8deg); } 100% { transform: rotate(0); } }
@keyframes rx-shake { 0% { transform: translateX(0) rotate(0); } 20% { transform: translateX(5px) rotate(10deg); } 40% { transform: translateX(-5px) rotate(-10deg); } 60% { transform: translateX(5px) rotate(10deg); } 80% { transform: translateX(-5px) rotate(-10deg); } 100% { transform: translateX(0) rotate(0); } }
@keyframes rx-drop { 0% { transform: translateY(-30px); animation-timing-function: ease-in; } 35% { transform: translateY(0) scale(1.3, .7); } 50% { transform: scale(1); } 65% { transform: translateY(-8px); } 85% { transform: translateY(0) scale(1.1, .9); } 100% { transform: none; } }
@keyframes rx-launch { 0% { transform: translate(0, 0) rotate(0); } 28% { transform: translate(8px, -26px) rotate(-25deg) scale(1.2); } 100% { transform: translate(0, 0) rotate(0); } }

/* ---- popups: a layer above every panel and modal that never takes a click */
.rx-layer { position: fixed; z-index: 3000; top: calc(env(safe-area-inset-top) + 54px); right: 14px; display: grid; justify-items: end; gap: 8px; pointer-events: none; max-width: calc(100vw - 28px); }
.rx-bubble { display: flex; align-items: center; gap: 10px; max-width: 300px; padding: 8px 16px 8px 10px; border-radius: 999px; background: var(--ink); color: var(--deep); border: 2.5px solid transparent;
  box-shadow: 0 4px 8px rgba(0,0,0,.3); animation: rx-in .55s cubic-bezier(.34, 1.56, .64, 1) both; }
.rx-bubble .rx-em { font-size: 40px; animation-duration: .8s; }
.rx-text { display: grid; line-height: 1.1; }
.rx-x { font-size: 26px; color: var(--accent); }
.rx-x.rx-pop { animation: rx-pop .45s cubic-bezier(.34, 1.56, .64, 1); }
.rx-line { font-size: 15px; font-weight: 600; }
.rx-bubble.rx-combo { border-color: var(--accent); }
.rx-bubble.rx-grow { animation: rx-grow .4s cubic-bezier(.34, 1.56, .64, 1); }
.rx-bubble.rx-out { animation: rx-out .25s ease-in forwards; }
@keyframes rx-in { from { opacity: 0; transform: translateX(120%) scale(.4); } to { opacity: 1; transform: none; } }
@keyframes rx-out { to { opacity: 0; transform: scale(1.3); } }
@keyframes rx-pop { from { transform: scale(2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rx-grow { 0% { transform: scale(1); } 40% { transform: scale(1.1); } 100% { transform: scale(1); } }

.rx-toast { position: fixed; z-index: 3000; top: calc(env(safe-area-inset-top) + 12px); left: 50%; transform: translate(-50%, -140%); padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--deep);
  font-size: 15px; font-weight: 600; box-shadow: 0 3px 6px rgba(0,0,0,.3); opacity: 0; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .2s; pointer-events: none; max-width: 92vw; text-align: center; }
.rx-toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---- the town */
.rx-badges { position: absolute; pointer-events: none; z-index: 2; }
.rx-badge { position: absolute; transform: translate(-50%, -50%); line-height: 1; pointer-events: auto; padding: 0; background: none; cursor: pointer; filter: drop-shadow(0 2px 2px rgba(0,0,0,.4)); }
.rx-bob { display: inline-block; animation: rx-bob 1.6s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
@keyframes rx-bob { from { transform: translateY(3px); } to { transform: translateY(-3px); } }
.rx-tip { position: absolute; z-index: 4; transform: translate(-50%, calc(-50% - var(--r, 24px) - 8px)); padding: 3px 9px; border-radius: 999px; background: var(--ink); color: var(--deep); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; animation: rx-in .3s cubic-bezier(.34, 1.56, .64, 1) both; }
.tg-island.full .tg-lotart { filter: drop-shadow(0 0 18px var(--accent)); }
.rx-ribbon { position: relative; z-index: 1; margin-bottom: -8px; padding: 0 10px; border-radius: 999px; background: var(--accent); color: var(--deep); font-size: 16px; text-transform: uppercase; animation: rx-shine 1.1s ease-in-out infinite alternate; }
@keyframes rx-shine { from { transform: scale(1); box-shadow: 0 0 4px rgba(255,200,60,.3); } to { transform: scale(1.06); box-shadow: 0 0 10px rgba(255,200,60,.8); } }
.tg-townhead .rx-shout { color: var(--accent); font-size: 13px; font-weight: 600; opacity: 1; }

.rx-react { position: relative; z-index: 3; display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; background: var(--accent); color: var(--deep); font-size: 12px; font-weight: 700; }
.rx-tray { position: absolute; top: 100%; z-index: 6; display: grid; gap: 8px; justify-items: center; padding: 14px; width: max-content; border-radius: 16px; background: #f4efe4; color: #1c1438; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.rx-tray.left { left: 0; }
.rx-tray.right { right: 0; }
.rx-ttitle { font-size: 16px; }
.rx-grid { display: grid; grid-template-columns: repeat(4, 54px); gap: 6px; }
.rx-e { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 12px; background: rgba(28,20,56,.08); font-size: 34px; color: inherit; }
.rx-e:disabled { opacity: .4; }
.rx-note { font-size: 12px; opacity: .7; }
.rx-more { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; }
.rx-mute { font-size: 13px; padding: 2px 6px; min-height: 44px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* ---- the room card (teacher class settings, group page) */
.rx-card { display: grid; gap: 6px; }
.rx-logtitle { margin: 8px 0 0; font-size: 15px; }
.rx-logline { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 2px 0; }
.rx-logline small { flex: none; }

@media (prefers-reduced-motion: reduce) {
  .rx-bubble, .rx-bob, .rx-ribbon, .rx-tip, .rx-em, .rx-x { animation: none !important; }
  .rx-toast { transition: none; }
}
