/* ---------- Emotes & quick-chat (public/js/emotes.js) ---------- */
#emoteBtn {
  right: 108px;
  font-size: 20px;
  transition: transform 0.15s;
}
#emoteBtn:hover {
  transform: scale(1.12) rotate(-8deg);
}
#emoteBtn.whisper {
  border-color: rgba(120, 230, 255, 0.5);
}

#emoteWheel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  pointer-events: auto;
  background: radial-gradient(circle at center, rgba(12, 6, 24, 0.55) 0, rgba(12, 6, 24, 0.15) 340px, transparent 520px);
  animation: ewFade 0.12s ease-out;
  user-select: none;
}
#emoteWheel.hidden {
  display: none;
}
@keyframes ewFade {
  from {
    opacity: 0;
  }
}
.ew-scale {
  position: relative;
  width: 0;
  height: 0;
  transform: scale(var(--ew-scale, 1));
}
.ew-ring {
  position: absolute;
  left: -146px;
  top: -146px;
  width: 292px;
  height: 292px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 20, 58, 0.92) 0 42%, rgba(30, 16, 50, 0.82) 43% 100%);
  border: 2px solid var(--card-border, rgba(190, 160, 255, 0.22));
  box-shadow: 0 0 40px rgba(157, 123, 255, 0.35), inset 0 0 30px rgba(0, 0, 0, 0.5);
  animation: ewPop 0.18s cubic-bezier(0.3, 1.6, 0.6, 1);
}
@keyframes ewPop {
  from {
    transform: scale(0.6);
  }
}
.ew-center {
  position: absolute;
  left: -60px;
  top: -60px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}
.ew-big {
  font-size: 40px;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}
.ew-label {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.2;
  color: var(--text, #f1eaff);
  max-width: 112px;
}
.ew-items {
  position: absolute;
  left: 0;
  top: 0;
}
.ew-emote {
  position: absolute;
  left: -29px;
  top: -29px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid transparent;
  transition: background 0.1s, border-color 0.1s;
}
.ew-emote span {
  display: block;
  transition: transform 0.12s cubic-bezier(0.3, 1.8, 0.6, 1);
}
.ew-emote.sel {
  background: rgba(157, 123, 255, 0.45);
  border-color: #c9b4ff;
  box-shadow: 0 0 18px rgba(157, 123, 255, 0.8);
}
.ew-emote.sel span {
  transform: scale(1.3) rotate(-10deg);
}
.ew-phrase {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  max-width: 150px;
  padding: 7px 11px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  color: var(--text, #f1eaff);
  background: rgba(30, 16, 50, 0.9);
  border: 1px solid var(--card-border, rgba(190, 160, 255, 0.22));
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  transition: background 0.1s, border-color 0.1s, scale 0.1s;
}
.ew-phrase b {
  font-weight: normal;
}
.ew-phrase.sel {
  background: #ffb347;
  border-color: #ffe0a8;
  color: #2a1745;
  scale: 1.1;
  box-shadow: 0 0 20px rgba(255, 179, 71, 0.7);
}
#emoteWheel.whisper .ew-phrase.sel {
  background: #6fe8ff;
  border-color: #c8f6ff;
}
.ew-emote.disabled,
.ew-phrase.disabled {
  opacity: 0.28;
  filter: grayscale(1);
}
.ew-emote.disabled.sel {
  background: rgba(255, 107, 129, 0.3);
  border-color: #ff6b81;
  box-shadow: none;
}
.ew-cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px #c9b4ff;
  display: none;
  pointer-events: none;
}
#emoteWheel.locked .ew-cursor {
  display: block;
}

/* Screen-space reactions (no avatar / no position shown) */
#emoteReactions {
  position: fixed;
  right: 18px;
  bottom: 64px;
  width: 190px;
  height: 0;
  z-index: 16;
  pointer-events: none;
}
.emote-react {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 190px;
  animation: erFloat 3s ease-out forwards;
  pointer-events: none;
  text-align: center;
}
.emote-react.phrase {
  animation-duration: 3.8s;
}
.emote-react.self {
  position: fixed;
  left: 64%;
  right: auto;
  bottom: 110px;
  z-index: 16;
  translate: -50% 0;
}
.er-emoji {
  font-size: 46px;
  line-height: 1;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.6));
}
.er-text {
  margin-top: 4px;
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 13px;
  background: rgba(255, 252, 255, 0.95);
  color: #2a1745;
  font-weight: 600;
}
.emote-react.whisper .er-text {
  background: rgba(200, 246, 255, 0.95);
}
.er-name {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted, #b3a6cc);
  text-shadow: 0 1px 3px #000;
}
@keyframes erFloat {
  0% {
    opacity: 0;
    transform: translate(0, 20px) scale(0.4);
  }
  12% {
    opacity: 1;
    transform: translate(calc(var(--drift, 0px) * 0.2), -10px) scale(1.15);
  }
  25% {
    transform: translate(calc(var(--drift, 0px) * 0.35), -30px) scale(1);
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(var(--drift, 0px), -170px) scale(0.9);
  }
}

#emoteToast {
  position: fixed;
  left: 50%;
  top: 96px;
  transform: translateX(-50%);
  z-index: 30;
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--card, rgba(24, 14, 38, 0.86));
  border: 1px solid var(--card-border, rgba(190, 160, 255, 0.22));
  font-size: 14px;
  pointer-events: none;
  animation: feedIn 0.25s ease-out;
  max-width: calc(100vw - 32px);
  text-align: center;
}
#emoteToast.hidden {
  display: none;
}

#chatLog .emote-line .emote-big {
  font-size: 18px;
  vertical-align: -2px;
}
#chatLog .emote-line i {
  color: var(--muted, #b3a6cc);
}
#chatLog .emote-line.whisper {
  color: #bff3ff;
}

@media (max-width: 600px) {
  #emoteReactions {
    bottom: 110px;
  }
}
