/* ── Emoji Reactions ── */

.rxn-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px var(--sp-md) 8px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.rxn-bar::-webkit-scrollbar { display: none; }

.rxn-defaults {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  align-items: center;
}

.rxn-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px 3px 6px;
  background: var(--surface-soft);
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.rxn-btn:hover {
  background: var(--surface-mid);
  transform: scale(1.12);
}
.rxn-btn:active { transform: scale(0.94); }
.rxn-btn.rxn-active {
  border-color: var(--primary);
  background: rgba(208,188,255,0.12);
}

.rxn-emoji {
  font-size: 16px;
  line-height: 1;
  display: inline-block;
  transition: transform 0.15s;
}
.rxn-btn:hover .rxn-emoji { transform: scale(1.2) rotate(-5deg); }
.rxn-btn.rxn-active .rxn-emoji { animation: rxn-pop 0.35s cubic-bezier(0.34,1.6,0.64,1); }

.rxn-count {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-bright);
  min-width: 12px;
  line-height: 1;
}
.rxn-btn.rxn-active .rxn-count { color: var(--primary); }

.rxn-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-full);
  border: 1.5px dashed var(--card-border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s, transform 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.rxn-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.1) rotate(45deg);
}

/* Pop keyframe */
@keyframes rxn-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.5) rotate(-8deg); }
  70%  { transform: scale(0.9) rotate(4deg); }
  100% { transform: scale(1.2); }
}

/* ── Floating emoji that flies upward on react ── */
.rxn-float {
  position: absolute;
  font-size: 28px;
  pointer-events: none;
  z-index: 9999;
  animation: float-up 0.9s ease-out forwards;
  line-height: 1;
  user-select: none;
}
@keyframes float-up {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  60%  { opacity: 1; transform: translateY(-60px) scale(1.3); }
  100% { opacity: 0; transform: translateY(-100px) scale(0.8); }
}

/* ── Emoji Picker popup ── */
.emoji-picker {
  position: absolute;
  z-index: 9000;
  width: 260px;
  background: var(--canvas-mid);
  border: 1px solid var(--card-border);
  border-radius: var(--r-xl);
  padding: var(--sp-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  opacity: 0;
  transform: scale(0.9) translateY(-8px);
  transform-origin: top left;
  transition: opacity 0.18s, transform 0.22s cubic-bezier(0.34,1.2,0.64,1);
  pointer-events: none;
}
.emoji-picker.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}

.ep-btn {
  width: 36px;
  height: 36px;
  font-size: 20px;
  border: none;
  background: transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.ep-btn:hover {
  background: var(--surface-mid);
  transform: scale(1.2);
}
.ep-btn:active { transform: scale(0.9); }
