/* ============================================================
   斗地主客户端样式 — 顶级UI
   ============================================================ */

.ddz-table {
  position: relative; width: 100%; max-width: 500px; margin: 0 auto;
  background: radial-gradient(ellipse at center, #1565c0 0%, #0d47a1 60%, #082818 100%);
  border-radius: 16px; padding: 14px; min-height: 480px;
  box-shadow: inset 0 0 50px rgba(0,0,0,0.4), 0 8px 32px rgba(0,0,0,0.4);
  border: 3px solid #0a2d5a;
}
.ddz-info-bar {
  display: flex; justify-content: space-around; color: #fff; font-size: 12px;
  padding: 6px 12px; background: rgba(0,0,0,0.4); border-radius: 10px; margin-bottom: 8px;
}
.ddz-player-area { position: absolute; transition: all 0.3s; }
.ddz-player-area.bottom { bottom: 10px; left: 50%; transform: translateX(-50%); width: 96%; }
.ddz-player-area.top { top: 40px; left: 50%; transform: translateX(-50%); }
.ddz-player-area.left { left: 6px; top: 45%; transform: translateY(-50%); }
.ddz-player-area.right { right: 6px; top: 45%; transform: translateY(-50%); }
.ddz-player-area.active .ddz-player-info { color: #FFD700; text-shadow: 0 0 8px rgba(255,215,0,0.6); }
.ddz-player-info { font-size: 12px; color: #ccc; text-align: center; margin-bottom: 4px; }
.ddz-role-badge { display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 10px; font-weight: 700; }
.ddz-role-badge.landlord { background: #e74c3c; color: #fff; }
.ddz-role-badge.farmer { background: #2ecc71; color: #fff; }
/* 手牌区：扇形重叠排列，确保全部可见 */
.ddz-hand {
  display: flex; flex-wrap: nowrap; justify-content: center;
  padding: 8px 4px 4px; overflow: visible; position: relative;
  min-height: 64px;
}
.ddz-card {
  width: 42px; height: 60px;
  border-radius: 5px; cursor: pointer;
  border: 1px solid #aaa; border-bottom: 2px solid #888;
  transition: transform 0.12s, box-shadow 0.12s; flex-shrink: 0; position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  margin-left: -20px;        /* 重叠，让17张牌完整显示在有限宽度内 */
  background-repeat: no-repeat; background-color: transparent;
}
.ddz-hand .ddz-card:first-child { margin-left: 0; }
.ddz-card.selected { transform: translateY(-16px); box-shadow: 0 0 0 2px #FFD700, 0 6px 14px rgba(255,215,0,0.4); z-index: 10; }
.ddz-card:hover { z-index: 20; transform: translateY(-8px); }
.ddz-card.selected:hover { transform: translateY(-20px); }
.ddz-card.hint { box-shadow: 0 0 0 2px #4FC3F7; }
.ddz-card::before { content: ''; position: absolute; top: 1px; left: 1px; right: 1px; height: 35%; background: linear-gradient(180deg, rgba(255,255,255,0.6), transparent); border-radius: 4px 4px 0 0; pointer-events: none; }
.ddz-other-cards { font-size: 14px; color: rgba(255,255,255,0.4); text-align: center; }
/* 中央出牌区 — 所有玩家出的牌都显示在桌中央 */
.ddz-center-played {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%);
  display: flex; gap: 2px; justify-content: center; align-items: center;
  min-height: 48px; z-index: 5; animation: ddzPlayedAppear 0.3s ease-out;
}
@keyframes ddzPlayedAppear {
  from { opacity: 0; transform: translate(-50%, -30%) scale(0.8); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.ddz-center-played .ddz-played-card {
  width: 34px; height: 48px; font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
/* 出牌者标签 */
.ddz-played-label {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: #FFD700; white-space: nowrap; text-shadow: 0 0 4px rgba(0,0,0,0.8);
}
/* "不出"标签 */
.ddz-pass-label {
  position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%);
  font-size: 18px; color: #aaa; font-weight: 700; z-index: 5;
  text-shadow: 0 0 6px rgba(0,0,0,0.8); animation: ddzPlayedAppear 0.3s ease-out;
}
.ddz-action-bar { display: flex; gap: 8px; justify-content: center; padding: 10px; background: rgba(0,0,0,0.5); border-radius: 12px; margin-top: 8px; min-height: 52px; }
.ddz-btn { padding: 8px 22px; border-radius: 22px; border: none; font-size: 14px; font-weight: 700; cursor: pointer; transition: all 0.15s; box-shadow: 0 3px 8px rgba(0,0,0,0.3); }
.ddz-btn:hover { transform: translateY(-2px); }
.ddz-btn.play { background: linear-gradient(135deg, #FFD700, #FFA500); color: #1a1a1a; }
.ddz-btn.pass { background: linear-gradient(135deg, #555, #333); color: #fff; }
.ddz-btn.hint { background: linear-gradient(135deg, #4FC3F7, #2196F3); color: #fff; }
.ddz-btn.bid-1 { background: linear-gradient(135deg, #2ecc71, #27ae60); color: #fff; }
.ddz-btn.bid-2 { background: linear-gradient(135deg, #f1c40f, #e67e22); color: #fff; }
.ddz-btn.bid-3 { background: linear-gradient(135deg, #e74c3c, #c0392b); color: #fff; }
.ddz-btn.bid-0 { background: linear-gradient(135deg, #555, #333); color: #fff; }
.ddz-center-display { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.ddz-multiplier { color: #FFD700; font-size: 16px; font-weight: 700; }
.ddz-bottom-cards { display: flex; gap: 2px; justify-content: center; margin-top: 4px; }
.ddz-bottom-card { width: 24px; height: 34px; background: linear-gradient(180deg, #FFD700, #FFA500); border-radius: 4px; font-size: 11px; font-weight: 700; color: #1a1a1a; display: flex; align-items: center; justify-content: center; border: 1px solid #fff; }
.ddz-bid-area { display: flex; gap: 8px; justify-content: center; padding: 12px; }

/* ============================================================
   P1 打击感与特效（震撼反馈 · 低性能自动降级）
   ============================================================ */

/* 屏幕震动（作用在牌桌容器上） */
@keyframes ddzShake {
  0%,100% { transform: translate(0,0); }
  10% { transform: translate(-7px, 4px) rotate(-0.5deg); }
  20% { transform: translate(7px, -4px) rotate(0.5deg); }
  30% { transform: translate(-6px, -3px); }
  40% { transform: translate(6px, 3px); }
  50% { transform: translate(-5px, 4px); }
  60% { transform: translate(5px, -4px); }
  70% { transform: translate(-3px, 2px); }
  80% { transform: translate(3px, -2px); }
  90% { transform: translate(-1px, 0); }
}
.ddz-table.fx-shake { animation: ddzShake 0.5s ease-in-out; }

/* 碎牌粒子 */
.ddz-fx-particle {
  position: fixed; width: 10px; height: 14px; border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.3); pointer-events: none; z-index: 9500;
  will-change: transform, opacity;
}

/* 炸弹 / 王炸 文案爆点 */
.ddz-fx-banner {
  position: fixed; top: 38%; left: 50%; transform: translate(-50%,-50%);
  z-index: 9510; font-size: 54px; font-weight: 900; color: #fff;
  text-shadow: 0 0 18px #ff5252, 0 0 44px #ff1744; pointer-events: none;
  animation: ddzBombPop 0.75s ease-out forwards;
}
.ddz-fx-banner.rocket { color: #FFD700; text-shadow: 0 0 18px #FFD700, 0 0 44px #ff8f00; }
@keyframes ddzBombPop {
  0%   { transform: translate(-50%,-50%) scale(0.2); opacity: 0; }
  30%  { transform: translate(-50%,-50%) scale(1.25); opacity: 1; }
  70%  { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1.1); opacity: 0; }
}

/* 春天 / 反春天 金色横幅 */
.ddz-spring-banner {
  position: fixed; top: 30%; left: 50%; transform: translate(-50%,-50%);
  z-index: 9520; padding: 14px 42px; border-radius: 14px;
  font-size: 34px; font-weight: 900; color: #1a1a1a;
  background: linear-gradient(135deg,#FFE082,#FFD700);
  border: 3px solid #FFA000; box-shadow: 0 0 30px rgba(255,215,0,0.7);
  pointer-events: none; animation: ddzSpringPop 1.7s ease-out forwards;
}
@keyframes ddzSpringPop {
  0%   { transform: translate(-50%,-50%) scale(0.3); opacity: 0; }
  20%  { transform: translate(-50%,-50%) scale(1.1); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1); opacity: 0; }
}

/* 撒花 */
.ddz-confetti {
  position: fixed; top: -24px; width: 9px; height: 14px; z-index: 9515;
  border-radius: 2px; pointer-events: none; will-change: transform, opacity;
  animation-name: ddzConfettiFall; animation-timing-function: linear; animation-fill-mode: forwards;
}
@keyframes ddzConfettiFall {
  0%   { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(106vh) rotate(720deg); opacity: 0.85; }
}

/* 压制反馈：被压死的玩家手牌区抖动 + 灰罩（作用在 .ddz-player-inner，避免覆盖定位 transform） */
.ddz-player-area .ddz-player-inner { position: relative; transition: none; }
.ddz-player-area.fx-suppress .ddz-player-inner { animation: ddzSuppressShake 0.5s ease-in-out; }
.ddz-player-area.fx-suppress::after {
  content: ''; position: absolute; inset: 0; border-radius: 10px;
  background: rgba(120,120,120,0.5); border: 2px solid #888;
  pointer-events: none; z-index: 30;
}
@keyframes ddzSuppressShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

/* 明牌 / 托管 状态标签 */
.ddz-status-badge {
  display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; font-weight: 700; vertical-align: middle;
}
.ddz-status-badge.reveal { background: #e74c3c; color: #fff; }
.ddz-status-badge.trustee { background: #3498db; color: #fff; }

/* 特效开关按钮（info-bar 内） */
.ddz-fx-toggle {
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: #FFD700; border-radius: 6px; padding: 2px 8px; cursor: pointer; font-size: 12px;
}

/* 特效彻底关闭时：兜底移除所有动画 */
body.ddz-fx-off * { animation: none !important; }
