/* HG_AVATAR_MOTION_V4_UI */

.hg-emote-palette {
  position: fixed;
  z-index: 409;
  right: 50%;
  bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px));
  width: min(560px, calc(100vw - 20px));
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(200, 255, 56, 0.34);
  border-radius: 22px;
  background: rgba(3, 11, 8, 0.88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.52), inset 0 -2px rgba(200, 255, 56, 0.2);
  transform: translateX(50%);
  backdrop-filter: blur(22px) saturate(1.16);
  animation: hg-emote-rise 220ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.hg-emote-palette[hidden] { display: none !important; }

.hg-emote-palette > header {
  min-height: 47px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  padding: 0 2px 9px;
}

.hg-emote-palette > header > span { min-width: 0; display: grid; gap: 3px; }
.hg-emote-palette > header small { color: #49d7ff; font: 850 7px/1 system-ui, sans-serif; letter-spacing: 0.12em; }
.hg-emote-palette > header strong { color: #f6fbf8; font: 850 14px/1 system-ui, sans-serif; }
.hg-emote-palette > header em { overflow: hidden; color: rgba(232, 243, 237, 0.55); font: 650 8px/1.2 system-ui, sans-serif; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.hg-emote-palette > header > button {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(235, 247, 240, 0.16);
  border-radius: 12px;
  color: #f4faf6;
  background: rgba(255, 255, 255, 0.05);
  font: 500 22px/1 system-ui, sans-serif;
}

.hg-emote-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.hg-emote-grid > button {
  position: relative;
  min-width: 0;
  min-height: 72px;
  display: grid;
  grid-template-rows: 30px auto;
  place-items: center;
  gap: 5px;
  padding: 8px 5px;
  border: 1px solid rgba(230, 245, 237, 0.14);
  border-radius: 15px;
  color: rgba(241, 249, 245, 0.74);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}
.hg-emote-grid > button:hover,
.hg-emote-grid > button:focus-visible,
.hg-emote-grid > button.is-playing { border-color: #c8ff38; color: #07100d; background: #c8ff38; }
.hg-emote-grid i { font: 800 24px/1 system-ui, sans-serif; font-style: normal; }
.hg-emote-grid span { overflow: hidden; max-width: 100%; font: 850 8px/1 system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.hg-emote-grid kbd { position: absolute; top: 6px; right: 7px; color: currentColor; opacity: 0.52; font: 750 7px/1 ui-monospace, monospace; }
.hg-emote-palette > p { margin: 9px 2px 0; color: rgba(232, 243, 237, 0.48); font: 700 8px/1 system-ui, sans-serif; text-align: center; }

.hg-mobile-director-dock:has(.hg-emote-toggle) { grid-template-columns: repeat(5, 50px); }
.hg-mobile-director-dock .hg-emote-toggle { width: 50px; }
.hg-mobile-director-dock .hg-emote-toggle[aria-expanded="true"] { color: #07100d; background: #49d7ff; box-shadow: 0 0 26px rgba(73, 215, 255, 0.24); }
html[data-hg-emote-open] .hg-mobile-director-cue { opacity: 0; pointer-events: none; transform: translateY(16px); }

@keyframes hg-emote-rise {
  from { opacity: 0; transform: translate(50%, 16px) scale(0.98); }
  to { opacity: 1; transform: translate(50%, 0) scale(1); }
}

@media (max-width: 380px) {
  .hg-mobile-director-dock:has(.hg-emote-toggle) { grid-template-columns: repeat(5, 46px); }
  .hg-mobile-director-dock .hg-emote-toggle { width: 46px; }
  .hg-emote-grid > button { min-height: 66px; }
}

@media (min-width: 721px) {
  .hg-emote-palette { right: 18px; bottom: 92px; width: min(500px, calc(100vw - 36px)); transform: none; }
  @keyframes hg-emote-rise {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .hg-emote-palette { animation-duration: 0.01ms !important; }
}

