/* 牌桌、棋盘共用的小效果（gamefx.js）：喇叭、赢了的彩带爱心烟花星星、座位上的小表情。网站和原型是同一份 */
.gx-sound { flex: none; margin-left: auto; }
.gx-sound .wave { display: none; }
.gx-sound.on .wave { display: inline; }
.gx-sound.on .off { display: none; }
.gx-sound.on { background: var(--gold-soft, #f4e7c7); color: var(--gold, #a37a18); }
.top .gx-sound + .table-chips { margin-left: 8px; }

/* ---------- 赢了 ---------- */
.gx-burst {
  position: absolute;
  inset: 0;
  z-index: 30;
  overflow: visible;
  pointer-events: none;
}

.gx-burst.still {
  border-radius: inherit;
  box-shadow: inset 0 0 0 4px #f2c46b, 0 0 40px 10px rgba(242, 196, 107, 0.6);
  animation: gx-glow 1.4s ease both;
}

@keyframes gx-glow {
  0%, 100% { opacity: 0; }
  20%, 70% { opacity: 1; }
}

.gx-p {
  position: absolute;
  left: var(--ox);
  top: var(--oy);
  display: block;
  pointer-events: none;
}

/* 闪星星（没买牌桌特效的默认款） */
.gx-burst.sparkle .gx-p {
  width: 14px;
  height: 14px;
  margin: -7px;
  background: #f6c64f;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: gx-spark 1.1s var(--d) ease-out both;
}

@keyframes gx-spark {
  0% { transform: translate(0, 0) scale(0.2) rotate(0); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(1) rotate(90deg); opacity: 0; }
}

/* 撒彩带：从上面撒下来，转着落 */
.gx-burst.fx-confetti .gx-p {
  top: -6%;
  left: 50%;
  width: 7px;
  height: 12px;
  border-radius: 2px;
  background: var(--c);
  animation: gx-fall 1.9s var(--d) cubic-bezier(.2, .6, .4, 1) both;
}

.gx-burst.fx-confetti .gx-p:nth-child(3n) { width: 9px; height: 9px; border-radius: 50%; }

@keyframes gx-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 0; }
  10% { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; }
}

/* 飘爱心 */
.gx-burst.fx-hearts .gx-p {
  width: 18px;
  height: 18px;
  margin: -9px;
  background: var(--c);
  clip-path: path("M9 16.5 1.8 9.5C-1.6 6 1.3 0 5.6 1.2 7.3 1.7 8.4 3 9 4.2 9.6 3 10.7 1.7 12.4 1.2 16.7 0 19.6 6 16.2 9.5z");
  animation: gx-float 1.9s var(--d) ease-out both;
}

.gx-burst.fx-hearts .gx-p:nth-child(odd) { background: #ff6f91; }

@keyframes gx-float {
  0% { transform: translate(0, 0) scale(0.3); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) scale(var(--s)); opacity: 0; }
}

/* 放烟花：三朵一朵一朵炸开 */
.gx-burst.fx-fireworks .gx-p {
  left: calc(var(--ox) + var(--bx));
  top: calc(var(--oy) + var(--by));
  width: 6px;
  height: 6px;
  margin: -3px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 6px var(--c);
  animation: gx-pop 1.2s var(--d) cubic-bezier(.1, .7, .3, 1) both;
}

@keyframes gx-pop {
  0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translate(var(--x), calc(var(--y) + 18px)) scale(0.8); opacity: 0; }
}

/* ---------- 小表情 ---------- */
.gx-face {
  position: relative;
  display: inline-block;
  flex: none;
  line-height: 0;
  vertical-align: middle;
  transform-origin: 50% 100%;
}

.gx-face[data-mood="happy"] { animation: gx-hop 0.9s ease-in-out 2; }
.gx-face[data-mood="sad"] > :first-child { filter: saturate(0.6) brightness(0.95); }
.gx-face[data-mood="sad"] { animation: gx-droop 0.6s ease both; }
.gx-face[data-mood="think"] { animation: gx-sway 2.4s ease-in-out infinite; }

@keyframes gx-hop {
  0%, 100% { transform: translateY(0) scale(1); }
  30% { transform: translateY(-9px) scale(1.04, 0.98); }
  55% { transform: translateY(0) scale(1.05, 0.94); }
  75% { transform: translateY(-3px); }
}

@keyframes gx-droop {
  to { transform: translateY(2px) rotate(-5deg); }
}

@keyframes gx-sway {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(3deg); }
}

.gx-mood {
  position: absolute;
  right: -10px;
  top: -12px;
  z-index: 6;
  width: 26px;
  height: 26px;
  pointer-events: none;
  animation: gx-bubble 260ms cubic-bezier(.3, 1.6, .5, 1) both;
}

.gx-mood svg { display: block; width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }
.gx-mood .head { fill: #ffd34e; stroke: #c9902a; stroke-width: 1.2; }
.gx-mood.sad .head { fill: #cfe3f7; stroke: #6f8fb3; }
.gx-mood .line { fill: none; stroke: #4a2e16; stroke-width: 1.8; stroke-linecap: round; }
.gx-mood .mouth { fill: #8b2f22; stroke: #4a2e16; stroke-width: 1.2; stroke-linejoin: round; }
.gx-mood .blush { fill: #ff8f8f; opacity: 0.7; }
.gx-mood .tear { fill: #5aa7ec; }
.gx-mood .cloud { fill: #fff; stroke: #c9c1b4; stroke-width: 1; }
.gx-mood .dot { fill: #6b6258; animation: gx-dot 1.2s ease-in-out infinite; }
.gx-mood .dot.d1 { animation-delay: 0.2s; }
.gx-mood .dot.d2 { animation-delay: 0.4s; }

@keyframes gx-dot {
  0%, 60%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
}

@keyframes gx-bubble {
  from { transform: scale(0.2) translateY(6px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .gx-face[data-mood] { animation: none; }
  .gx-face[data-mood="sad"] { transform: none; }
  .gx-mood, .gx-mood .dot { animation: none; }
  .gx-mood .dot { opacity: 0.8; }
}
