/**
 * 魔法表情专用特效层（建议稿 · emo-fx）
 * ----------------------------------------------------------------
 * 与 gift-fx.css / mount-fx 完全隔离。落地时：
 *   - H5 另引本文件（勿塞进 gift-fx.css）
 *   - JS 播送用 #emo-fx-root + .emo-fx--e1|e2|e3，禁止复用
 *     #gift-fx-root / #mount-fx-root / .gfx-lux-* / .mount-fx-*
 *   - 图标仅用 Unicode 默认表情字符，禁止礼物/坐骑 PNG
 * 本文件暂未挂到页面；挂载与 JS 接线需另发 Y。
 */

/* ========== 禁止清单（实现时勿引入） ==========
 * .gfx-lux-dim / .gfx-lux-spot / .gfx-lux-rain / .gfx-lux-champ / .gfx-lux-bubbles
 * .gfx-lux-caption / .gfx-play--t* / .gfx-play--shake
 * .mount-fx-carpet / .mount-fx-spot / .mount-fx-stage--shake
 * 金雨、香槟喷泉、红毯、重暗场、GRANDE TOAST 类文案层
 */

#emo-fx-root {
  position: fixed;
  inset: 0;
  z-index: 48; /* 建议 < #gift-fx-root，礼物压表情 */
  pointer-events: none;
  overflow: hidden;
}

/* —— 商城格：安静、不像礼物彩边 —— */
.gift-panel .gift-cell--emoji,
.gift-sheet .gift-cell--emoji {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
  overflow: hidden;
  contain: layout paint;
}
.gift-cell--emoji .gi {
  transform-origin: center center;
  backface-visibility: hidden;
}
.gift-cell--e1 .gi {
  font-size: 28px;
  line-height: 1;
  animation: emo-shop-idle 2.4s ease-in-out infinite;
}
.gift-cell--e2 {
  border-color: rgba(160, 210, 255, 0.35) !important;
}
.gift-cell--e2 .gi {
  font-size: 30px;
  animation: emo-shop-bob 2s ease-in-out infinite;
}
.gift-cell--e3 {
  border-color: rgba(200, 180, 255, 0.45) !important;
  box-shadow: inset 0 0 0 1px rgba(200, 180, 255, 0.2);
}
.gift-cell--e3 .gi {
  font-size: 32px;
  animation: emo-shop-pulse 1.8s ease-in-out infinite;
}
.emo-tier-badge {
  position: absolute;
  top: 2px;
  right: 3px;
  z-index: 2;
  font-size: 8px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  color: #e8f0ff;
  background: rgba(40, 50, 80, 0.75);
  letter-spacing: 0.02em;
}

@keyframes emo-shop-idle {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes emo-shop-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
@keyframes emo-shop-pulse {
  0%, 100% { transform: scale(1); filter: none; }
  50% { transform: scale(1.06); filter: drop-shadow(0 0 6px rgba(180, 160, 255, 0.45)); }
}

/* —— E1：贴公聊气泡旁，不上全屏舞台 —— */
.emo-fx--e1 {
  position: absolute;
  z-index: 2;
  font-size: 28px;
  line-height: 1;
  transform-origin: center bottom;
  animation: emo-e1-pop 1.1s ease-out forwards;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.emo-fx--e1 .emo-fx__glyph {
  display: block;
}
.emo-fx--e1 .emo-fx__combo {
  position: absolute;
  top: -10px;
  right: -14px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

@keyframes emo-e1-pop {
  0% { opacity: 0; transform: scale(0.6) translateY(8px); }
  18% { opacity: 1; transform: scale(1.12) translateY(0); }
  55% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.92) translateY(-6px); }
}

/* —— E2：局部环绕粒子（圆点/短弧），非全屏奢庆 —— */
.emo-fx--e2 {
  position: absolute;
  left: 50%;
  bottom: 28%;
  transform: translateX(-50%);
  z-index: 3;
  width: min(42vw, 180px);
  height: min(42vw, 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: emo-e2-life 1.5s ease-out forwards;
}
.emo-fx--e2 .emo-fx__glyph {
  font-size: clamp(36px, 12vw, 56px);
  line-height: 1;
  animation: emo-e2-spin 1.5s ease-out forwards;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}
.emo-fx--e2 .emo-fx__orbit {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px dashed rgba(180, 210, 255, 0.35);
  animation: emo-e2-orbit 1.5s linear forwards;
  pointer-events: none;
}
.emo-fx--e2 .emo-fx__dot {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(200, 230, 255, 0.85);
  transform: translate(-50%, -50%);
}
.emo-fx--e2 .emo-fx__label {
  position: absolute;
  bottom: -18%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  color: rgba(230, 240, 255, 0.9);
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

@keyframes emo-e2-life {
  0% { opacity: 0; transform: translateX(-50%) scale(0.85); }
  15% { opacity: 1; transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(1.05); }
}
@keyframes emo-e2-spin {
  0% { transform: scale(0.8) rotate(-8deg); }
  40% { transform: scale(1.08) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes emo-e2-orbit {
  0% { transform: rotate(0deg); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: rotate(120deg); opacity: 0; }
}

/* —— E3：房间中上短暂「贴纸放大」，非暗场/金雨/香槟 —— */
.emo-fx--e3 {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: emo-e3-life 2s ease-out forwards;
}
.emo-fx--e3 .emo-fx__glyph {
  font-size: clamp(56px, 18vw, 88px);
  line-height: 1;
  animation: emo-e3-bounce 2s ease-out forwards;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
}
/* 极淡光晕：冷色、低对比，严禁暖金 lux */
.emo-fx--e3 .emo-fx__halo {
  position: absolute;
  width: 140%;
  height: 140%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(160, 180, 255, 0.22) 0%,
    transparent 68%
  );
  animation: emo-e3-halo 2s ease-out forwards;
  pointer-events: none;
  z-index: -1;
}
.emo-fx--e3 .emo-fx__who {
  font-size: 12px;
  font-weight: 700;
  color: rgba(240, 245, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  max-width: 70vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emo-fx--e3 .emo-fx__tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(200, 210, 255, 0.85);
  /* 文案示例：SHOW · 秀场 — 禁止 CHEERS/SPOTLIGHT/GRANDE TOAST/RED CARPET */
}

@keyframes emo-e3-life {
  0% { opacity: 0; transform: translate(-50%, -46%) scale(0.7); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54%) scale(0.96); }
}
@keyframes emo-e3-bounce {
  0% { transform: scale(0.75); }
  20% { transform: scale(1.12); }
  40% { transform: scale(0.98); }
  60% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes emo-e3-halo {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
}

/* 公聊行内：发送后的小标记（所有档共用） */
.chat-gift-inline-emoji {
  display: inline-block;
  font-size: 1.15em;
  vertical-align: -0.1em;
  animation: emo-inline-flash 0.6s ease-out;
}
@keyframes emo-inline-flash {
  0% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

@media (max-width: 768px) {
  .emo-fx--e1 {
    font-size: clamp(36px, 10vw, 48px);
  }

  .emo-fx--e2 {
    width: min(58vw, 240px);
    height: min(58vw, 240px);
  }

  .emo-fx--e2 .emo-fx__glyph {
    font-size: clamp(48px, 16vw, 80px);
  }

  .emo-fx--e2 .emo-fx__dot {
    width: 7px;
    height: 7px;
  }

  .emo-fx--e3 .emo-fx__glyph {
    font-size: clamp(72px, 24vw, 120px);
  }

  .emo-fx--e3 .emo-fx__halo {
    width: 180%;
    height: 180%;
  }

  .emo-fx--e3 .emo-fx__who {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .emo-fx--e1,
  .emo-fx--e2,
  .emo-fx--e3,
  .gift-cell--e1 .gi,
  .gift-cell--e2 .gi,
  .gift-cell--e3 .gi,
  .chat-gift-inline-emoji {
    animation: none !important;
  }
  .emo-fx--e1,
  .emo-fx--e2,
  .emo-fx--e3 {
    opacity: 1;
  }
}
