/* ============================================================
   斗地主 · 人机对战 覆盖层
   视觉方向：Q版 · 新中式茶馆风
   暖木金墙 + 绿呢牌桌 + 卡通头像 + 金黄椭圆按钮/蓝色主按钮
   参照经典斗地主 Q 版中国风界面
   ============================================================ */

/* 游戏卡片“人机对战”快捷入口 */
.game-type-ai {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ff8f3d, #f06a1f);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(240, 106, 31, 0.5);
  transition: transform .12s;
}
.game-type-ai:hover { transform: translateY(-2px); }

/* ---------- 舞台：暖木金墙背景 ---------- */
.ddz-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  font-family: "Noto Serif SC", "Ma Shan Zheng", serif;
  color: #5a2e0a;
  background:
    radial-gradient(130% 95% at 50% 0%, rgba(255, 240, 200, 0.55), transparent 55%),
    radial-gradient(120% 110% at 50% 110%, rgba(120, 60, 10, 0.45), transparent 60%),
    linear-gradient(170deg, #f6ddA6 0%, #ecc98a 42%, #dfae63 100%);
  box-shadow: inset 0 0 120px 40px rgba(120, 60, 10, 0.45);
}
/* 中式窗棂暗纹 + 木质纹理 */
.ddz-overlay::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image:
    linear-gradient(90deg, rgba(120, 60, 10, .10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 60, 10, .10) 1px, transparent 1px);
  background-size: 68px 46px, 34px 23px;
  background-position: 0 0, 17px 12px;
  mask-image: radial-gradient(120% 100% at 50% 50%, #000 45%, transparent 100%);
}
.ddz-overlay::after {
  /* 顶角悬挂灯笼光晕 */
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(14% 20% at 12% 0%, rgba(255, 176, 80, .35), transparent 60%),
    radial-gradient(14% 20% at 88% 0%, rgba(255, 176, 80, .35), transparent 60%);
}
.ddz-overlay.open { display: block; }

/* 游戏界面内禁止任何内容被鼠标拖选复制，避免滑过牌面出现蓝色选中阴影 */
.ddz-overlay,
.ddz-overlay *,
.ddz-overlay *::before,
.ddz-overlay *::after {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.ddz-box {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- 顶栏：木质横幅 ---------- */
.ddz-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 16px;
  background: linear-gradient(180deg, rgba(96, 48, 8, 0.85), rgba(96, 48, 8, 0.95));
  border-bottom: 3px solid #c9893a;
  box-shadow: 0 3px 12px rgba(70, 32, 4, 0.4);
}
.ddz-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffe9b0;
  -webkit-text-stroke: 1px #7a3c0a;
  text-shadow: 0 2px 3px rgba(60, 26, 2, 0.7);
}
.ddz-meta { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.ddz-multiplier {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 12px;
  padding: 5px 18px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 245, 220, .95), rgba(240, 205, 140, .95));
  border: 2px solid #e0a84f;
  color: #6a3400; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 10px rgba(60,30,4,.35);
  white-space: nowrap;
}
.ddz-multiplier b { color: #c22a26; font-size: 20px; margin-left: 2px; }
.ddz-landlord-badge {
  padding: 3px 12px; border-radius: 16px;
  background: linear-gradient(180deg, #ffd76a, #e6a22e);
  border: 1px solid #b8871a;
  color: #4d2500; font-weight: 800; font-size: 13px;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  white-space: nowrap;
}
.ddz-menu-btn {
  width: 34px; height: 34px; border: none;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff3d0, #e8b964);
  color: #6a3400; font-size: 20px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,.3);
  transition: all .15s;
}
.ddz-menu-btn:hover { background: #ffca7a; transform: scale(1.08); }
.ddz-menu {
  position: absolute; top: 100%; right: 0;
  min-width: 120px;
  background: linear-gradient(180deg, rgba(96,48,8,.98), rgba(78,38,6,.96));
  border: 2px solid #f0c069;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 20px rgba(60,30,4,.5);
  display: flex; flex-direction: column; gap: 2px;
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: all .18s;
  z-index: 20;
}
.ddz-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.ddz-menu-item {
  border: none; border-radius: 8px;
  background: transparent; color: #ffe9b0;
  padding: 9px 12px; font-size: 14px; font-weight: 700;
  text-align: left; cursor: pointer;
  transition: all .15s; white-space: nowrap;
}
.ddz-menu-item:hover { background: rgba(255,215,122,.22); color: #fff; }
.ddz-menu-item.dissolve { color: #ff9d7a; }

/* ---------- 牌桌区 ---------- */
.ddz-table { position: relative; flex: 1; min-height: 0; }

/* 中央绿呢牌桌：暖木托盘 + 中心绿色绒布 */
.ddz-body-area {
  position: absolute;
  left: 50%; top: 49%; transform: translate(-50%, -50%);
  width: min(86%, 760px); height: 52%;
  border-radius: 200px / 135px;
  background:
    radial-gradient(circle at 50% 40%, rgba(180, 240, 150, .05), transparent 55%),
    radial-gradient(ellipse at 50% 50%, #2f9c3f 0%, #1f7d30 55%, #145a22 100%);
  border: 8px solid #8a5a22;
  box-shadow:
    inset 0 0 60px rgba(0, 40, 10, .55),
    inset 0 2px 4px rgba(190, 255, 140, .2),
    0 16px 40px rgba(60, 30, 4, .5),
    0 0 0 4px #e0a84f;
}
/* 木质托盘描金边环 */
.ddz-body-area::before {
  content: "";
  position: absolute; inset: -15px;
  border-radius: 225px / 160px;
  border: 10px solid rgba(224, 168, 79, .65);
  background-image: repeating-radial-gradient(ellipse at 50% 50%, transparent 0 14px, rgba(200, 150, 70, .25) 14px 16px);
  filter: drop-shadow(0 2px 3px rgba(90, 45, 5, .4));
}
/* 桌面中心一道高光 */
.ddz-body-area::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(80% 45% at 50% 18%, rgba(255, 255, 255, .14), transparent 60%);
}

/* 标注牌局进行中的英文/装饰小字 */
.ddz-table::before {
  content: "斗 地 主";
  position: absolute; top: 34%; left: 50%; transform: translateX(-50%);
  font-size: clamp(14px, 2.2vw, 22px);
  letter-spacing: 10px;
  color: rgba(255, 240, 200, .28);
  font-weight: 900;
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
}

/* ---------- 座位通用：Q版卡通头标 ---------- */
.ddz-seat { position: absolute; display: flex; flex-direction: column; align-items: center; z-index: 3; }
.ddz-seat-head { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.ddz-avatar {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: #f6e3bd center/cover;
  border: 3px solid #e0a84f;
  box-shadow:
    0 4px 10px rgba(90, 45, 5, .4),
    inset 0 0 0 2px rgba(255, 246, 220, .8);
}
.ddz-self .ddz-avatar { background-image: url("../images/doudizhu/avatar-farmer.jpg"); }
.ddz-ai-right .ddz-avatar { background-image: url("../images/doudizhu/avatar-landlord.jpg"); }
.ddz-ai-left .ddz-avatar { background-image: url("../images/doudizhu/avatar-lady.jpg"); }
.ddz-avatar::after {
  /* Q版描眼圈 */
  content: "";
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px dashed rgba(255, 226, 160, .65);
}
.ddz-name {
  padding: 2px 12px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 240, 205, .95), rgba(240, 196, 116, .95));
  border: 1px solid #c9893a;
  font-size: 13px; font-weight: 800; color: #5a2e0a;
  box-shadow: 0 2px 5px rgba(90,45,5,.3);
  white-space: nowrap;
  letter-spacing: 1px;
}
.ddz-count {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px; border-radius: 12px;
  background: linear-gradient(180deg, #37a07f, #24705a);
  border: 1px solid #7fd6bb;
  color: #fff; font-weight: 800; font-size: 12px;
  box-shadow: 0 2px 5px rgba(0,0,0,.3);
}
/* 地主座位：金光圈 */
.ddz-seat.landlord .ddz-avatar,
.ddz-self.landlord .ddz-avatar {
  border-color: #ffd74d;
  box-shadow: 0 0 0 3px rgba(255, 215, 77, .55), 0 0 20px 3px rgba(255, 215, 77, .8), inset 0 0 0 2px rgba(255,255,255,.7);
}
/* 皇冠：给地主戴在头顶，离头上 2px */
.ddz-crown {
  position: absolute;
  top: -2px; left: 50%; transform: translateX(-50%);
  display: none;
  font-size: 22px; line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(90,45,5,.6));
  z-index: 3;
  pointer-events: none;
}
.ddz-seat-played { display: flex; flex-wrap: wrap; gap: 1px; justify-content: center; min-height: 34px; }
.ddz-seat-played .ddz-card { width: 30px; height: 43px; border-radius: 5px; }
.ddz-seat-played .ddz-card .center { font-size: 20px; }
.ddz-seat-played .ddz-card .corner .c-rank { font-size: 10px; }
.ddz-seat-played .ddz-card .corner .c-suit { font-size: 7px; }

.ddz-ai-right { top: 3%; right: 1.5%; }
.ddz-ai-left { top: 3%; left: 1.5%; }

/* ---------- 自己区域 ---------- */
.ddz-self {
  position: absolute;
  left: 50%; bottom: 8px;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  z-index: 3;
}
/* 自己头像移到左下侧，避开手牌遮挡，隐藏昵称 */
.ddz-self .ddz-seat-head {
  position: absolute;
  left: 12px; bottom: 200px;
  flex-direction: column; align-items: center; gap: 2px;
  transform: none;
  z-index: 6;
}
.ddz-self .ddz-avatar { width: 46px; height: 46px; }
.ddz-self .ddz-name { display: none; }
.ddz-self .ddz-count {
  position: relative; top: -24px; margin-left: 0;
  background: #c22a26; color: #fff; border-radius: 8px;
  padding: 1px 5px; font-size: 10px; font-weight: 700;
  border: 1px solid rgba(255,255,255,.6);
}
.ddz-self-played { display: flex; flex-wrap: wrap; justify-content: center; min-height: 40px; margin-bottom: 4px; gap: 1px; z-index: 2; }
.ddz-self-played .ddz-card { width: 40px; height: 56px; border-radius: 6px; }
.ddz-self-played .ddz-card .center { font-size: 26px; }
.ddz-self-played .ddz-card .corner .c-rank { font-size: 12px; }
/* 手牌：单行重叠扇形，紧凑又保证全部可见 */
.ddz-self-hand {
  display: flex; justify-content: center; align-items: flex-end;
  flex-wrap: nowrap;
  margin-top: 2px;
  padding: 6px 8px;
  min-height: 88px;
  width: 96%;
  box-sizing: border-box;
  touch-action: none; /* 支持按住牌左右拖动反选 */
}
.ddz-self-hand .ddz-card { width: 56px; height: 80px; border-radius: 7px; }
.ddz-self-hand .ddz-card .center { font-size: 34px; }
.ddz-self-hand .ddz-card .corner .c-rank { font-size: 13px; }
.ddz-self-hand .ddz-card .corner .c-suit { font-size: 9px; }
.ddz-self-hand .ddz-card { cursor: pointer; transition: transform .13s, box-shadow .13s, margin-bottom .1s; }
.ddz-self-hand .ddz-card:hover { transform: none; box-shadow: none; }
.ddz-self-hand .ddz-card.selected {
  transform: translateY(-18px);
  box-shadow: 0 -2px 0 3px #ffd74d, 0 0 18px rgba(255, 215, 77, .95);
}
.ddz-self-hand .ddz-card.hinted { outline: 3px solid #47c7e6; box-shadow: 0 0 12px rgba(71, 199, 230, .9); }
.ddz-self-hand.shake { animation: ddz-shake .38s; }
@keyframes ddz-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

/* 金豆余额条 */
.ddz-coinbar {
  position: relative; left: auto; bottom: auto;
  display: flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(96, 48, 8, .95), rgba(78, 38, 6, .9));
  border: 2px solid #f0c069;
  color: #ffe9b0; font-weight: 800; font-size: 14px;
  box-shadow: 0 2px 6px rgba(60,30,4,.4);
}
.ddz-coinbar .coin { font-size: 16px; filter: drop-shadow(0 1px 2px rgba(255,215,80,.8)); }
.ddz-coinbar .plus { display: none; }

/* ---------- 中央出牌区 ---------- */
.ddz-center { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%); text-align: center; z-index: 2; }
.ddz-hole { display: flex; flex-direction: column; align-items: center; margin-bottom: 4px; }
.ddz-label {
  font-size: 11px; color: #fff3cf; letter-spacing: 4px;
  margin-bottom: 3px; font-weight: 800;
  text-shadow: 0 1px 2px rgba(0,40,10,.6);
}
.ddz-hole-cards { display: flex; gap: 3px; }
.ddz-hole-cards .ddz-card { width: 46px; height: 65px; box-shadow: 0 4px 8px rgba(0,40,10,.35); }
.ddz-hole-cards .ddz-card .center { font-size: 30px; }
.ddz-message {
  margin-top: 6px; padding: 5px 16px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 245, 220, .92), rgba(240, 205, 140, .92));
  border: 2px solid #e0a84f;
  color: #6a3400; font-size: 14px; font-weight: 800; letter-spacing: 1px;
  min-height: 22px; display: inline-block;
  box-shadow: 0 3px 8px rgba(0,40,10,.3);
}

/* ---------- 操作按钮：金黄椭圆 + 蓝色主按钮 ---------- */
.ddz-actions {
  display: flex; gap: 8px; align-items: center;
  z-index: 4;
  margin: 6px 0 8px; /* 手牌上方的空隙 */
  transform: translateY(-8px); /* 提牌时组件位置固定，整体上移 8px 避让 */
}
.ddz-btn {
  min-width: 76px; padding: 10px 6px;
  border: none; border-radius: 28px;
  font-family: inherit; font-size: 15px; font-weight: 900; letter-spacing: 2px;
  cursor: pointer;
  color: #5a2e0a;
  background:
    radial-gradient(120% 150% at 50% -20%, rgba(255, 255, 255, .95), transparent 42%),
    linear-gradient(180deg, #ffdf7c 0%, #f6b93b 55%, #e89b1e 100%);
  border-bottom: 4px solid #bb7410;
  box-shadow: 0 5px 12px rgba(90, 45, 5, .45), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .12s, filter .12s, box-shadow .12s;
}
.ddz-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.03); filter: brightness(1.06); box-shadow: 0 9px 18px rgba(90,45,5,.5); }
.ddz-btn:active:not(:disabled) { transform: translateY(0); border-bottom-width: 2px; }
.ddz-btn:disabled { opacity: .4; cursor: not-allowed; filter: saturate(.6); }
.ddz-btn.ddz-play {
  color: #fff;
  background:
    radial-gradient(120% 150% at 50% -20%, rgba(255, 255, 255, .55), transparent 42%),
    linear-gradient(180deg, #4fa3f0 0%, #2b78d6 55%, #1d5cb0 100%);
  border-bottom-color: #123d77;
}
.ddz-btn.ddz-bid3 { background: linear-gradient(180deg, #ff8a6a, #ef5230 55%, #cf3010); color: #fff; border-bottom-color: #8f1c05; }
.ddz-btn.ddz-hint { color: #0a4a44; background: linear-gradient(180deg, #8fefea, #3ec4bb 55%, #2ba39b); border-bottom-color: #1c7a74; }

/* 回合倒计时徽章：闹钟 */
.ddz-timer {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 30px;
  background: linear-gradient(180deg, #fff6dd, #f4dca6);
  border: 2px solid #e0a84f;
  color: #6a3400; font-weight: 900; font-size: 16px;
  box-shadow: 0 3px 8px rgba(90,45,5,.3);
}
.ddz-timer .clock { font-size: 17px; }
.ddz-timer.urgent { color: #e23b1f; border-color: #e23b1f; animation: ddz-blink .6s step-start infinite; }
@keyframes ddz-blink { 50% { opacity: .4; } }

/* 轮到谁出牌，时钟就停在该玩家头像旁 */
.ddz-seat-head { position: relative; }
.ddz-turn-clock {
  position: absolute; top: 21px; right: -10px;
  display: none; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 22px;
  background: linear-gradient(180deg, #fff6dd, #f4dca6);
  border: 2px solid #e0a84f;
  color: #6a3400; font-weight: 900; font-size: 13px;
  box-shadow: 0 3px 8px rgba(90,45,5,.4);
  z-index: 10;
  line-height: 1;
  white-space: nowrap;
}
.ddz-turn-clock .clock { font-size: 14px; }
.ddz-turn-clock.urgent { color: #e23b1f; border-color: #e23b1f; animation: ddz-blink .6s step-start infinite; }
/* 右上座位：时钟在头像左侧 10px（顶部头像已下移，时钟垂直对齐头像中心） */
.ddz-ai-right .ddz-turn-clock { left: -10px; right: auto; top: 31px; }
.ddz-ai-left .ddz-turn-clock { top: 31px; }
/* 顶部两个头像下移 10px */
.ddz-ai-right .ddz-seat-head,
.ddz-ai-left .ddz-seat-head { padding-top: 10px; }

/* ---------- 结算层 ---------- */
.ddz-result { position: absolute; inset: 0; background: rgba(70, 30, 4, 0.55); display: none; align-items: center; justify-content: center; z-index: 12; }
.ddz-result.show { display: flex; }
.ddz-result-card {
  width: 380px; padding: 26px 26px 22px; border-radius: 24px;
  background:
    radial-gradient(140% 180% at 50% -20%, rgba(255, 233, 168, .35), transparent 45%),
    linear-gradient(180deg, #eab861, #c98a3a);
  border: 4px solid #8a5a22;
  box-shadow: 0 0 0 6px rgba(70,30,4,.35), 0 16px 40px rgba(0,0,0,.5);
  text-align: center; color: #4a2404;
}
.ddz-result-title { font-size: 24px; font-weight: 900; letter-spacing: 3px; margin-bottom: 12px; color: #6a2d00; text-shadow: 0 1px 0 rgba(255,240,200,.5); }
.ddz-tags { color: #6a3400; font-size: 13px; margin-bottom: 8px; }
.ddz-net { font-size: 20px; font-weight: 900; margin-bottom: 12px; color: #8f1c05; }
.ddz-line { font-size: 15px; padding: 4px 0; color: #4a2404; }
.ddz-result-btns { margin-top: 18px; display: flex; gap: 12px; justify-content: center; }
.ddz-result-btns .ddz-btn { min-width: 108px; }

/* ============================================================
   占位扑克牌：圆润描金 Q版牌
   ============================================================ */
.ddz-card {
  position: relative;
  width: 54px; height: 77px;
  border-radius: 7px;
  background: linear-gradient(165deg, #ffffff 0%, #fbf5e8 55%, #f0e6cd 100%);
  border: 1px solid #c9b489;
  box-shadow: 0 3px 6px rgba(90, 45, 5, 0.35), inset 0 0 0 1px rgba(255,255,255,.7);
  color: #222;
  flex-shrink: 0;
}
.ddz-card::before {
  /* 描金圆角线 */
  content: ""; position: absolute; inset: 2px;
  border-radius: 7px;
  border: 1px solid rgba(180, 140, 60, .35);
  pointer-events: none;
}
.ddz-card.red { color: #df2a3d; }
.ddz-card.black { color: #253550; }
.ddz-card .corner {
  position: absolute; top: 4px; left: 6px;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
}
.ddz-card .corner .c-rank { font-weight: 900; font-size: 16px; }
.ddz-card .corner .c-suit { font-size: 11px; margin-top: 1px; }
.ddz-card .corner.br { top: auto; left: auto; bottom: 4px; right: 6px; transform: rotate(180deg); }
.ddz-card .center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 42px; text-shadow: 0 1px 0 rgba(255,255,255,.7); }

/* 牌背：Q版红白波浪纹 */
.ddz-card.back {
  background:
    radial-gradient(circle at 50% 44%, #fff 0 16%, transparent 17%),
    repeating-linear-gradient(45deg, #cf3a2a 0 4px, #fff2d0 4px 8px);
  border: 2px solid #fff;
  box-shadow: 0 4px 7px rgba(90,45,5,.4), inset 0 0 0 2px #3a0d07;
  display: flex; align-items: center; justify-content: center;
  background-color: #e8442f;
}
.ddz-card.back::after {
  content: "";
  width: 64%; height: 70%;
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,.5), transparent 40%),
    repeating-linear-gradient(45deg, #ffd74d 0 4px, #fff4cf 4px 8px);
  box-shadow: inset 0 0 6px rgba(0,0,0,.3);
}

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .ddz-title { font-size: 13px; letter-spacing: 0; display: none; }
  .ddz-header { gap: 5px; padding: 6px 8px; }
  .ddz-meta { gap: 4px; }
  .ddz-self-hand { gap: 1px; width: 98%; min-height: 70px; padding: 4px 2px; }
  .ddz-self-hand .ddz-card { width: 44px; height: 63px; border-radius: 6px; }
  .ddz-self-hand .ddz-card:first-child { margin-left: 0; }
  .ddz-self-hand .ddz-card .center { font-size: 26px; }
  .ddz-self-hand .ddz-card .corner .c-rank { font-size: 10px; }
  .ddz-self-hand .ddz-card.selected { transform: translateY(-14px); }
  .ddz-actions { gap: 5px; margin: 4px 0 6px; }
  .ddz-btn { min-width: 56px; padding: 9px 2px; font-size: 13px; letter-spacing: 1px; }
  .ddz-avatar { width: 44px; height: 44px; }
  .ddz-ai-left, .ddz-ai-right { top: 3%; }
  .ddz-ai-left { left: .5%; }
  .ddz-ai-right { right: .5%; }
  .ddz-count { font-size: 11px; }
  .ddz-coinbar { font-size: 12px; padding: 3px 8px; gap: 4px; }
  .ddz-hole-cards .ddz-card { width: 38px; height: 54px; }
  .ddz-body-area { width: 96%; height: 56%; }
  .ddz-self { bottom: 6px; }
  .ddz-self-played .ddz-card { width: 34px; height: 48px; }
  .ddz-self-played .ddz-card .center { font-size: 22px; }
}

/* ============================================================
   在线对战 · 茶馆牌局 弹窗（开放房间加载/列表）
   与牌桌同源：暖木金墙 + 绿色绒布牌桌 + 描金 + Q版占位牌
   ============================================================ */
.ddz-lobby-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(52, 22, 4, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-family: "Noto Serif SC", "Ma Shan Zheng", serif;
  animation: ddz-lobby-fade .2s ease;
}
.ddz-lobby-overlay,
.ddz-lobby-overlay * {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
@keyframes ddz-lobby-fade { from { opacity: 0; } to { opacity: 1; } }

/* 主体：暖木金墙牌匾 */
.ddz-lobby {
  position: relative;
  width: min(590px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(140% 130% at 50% 0%, rgba(255, 240, 200, .5), transparent 52%),
    radial-gradient(120% 120% at 50% 115%, rgba(122, 60, 12, .4), transparent 60%),
    linear-gradient(170deg, #f0d295 0%, #e6b974 45%, #c98a3a 100%);
  border: 3px solid #8a5a22;
  box-shadow:
    0 0 0 5px rgba(70, 30, 4, .35),
    0 26px 60px rgba(0, 0, 0, .55),
    inset 0 0 80px 20px rgba(122, 60, 12, .28);
  animation: ddz-lobby-pop .28s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes ddz-lobby-pop { from { transform: translateY(20px) scale(.92); opacity: 0; } to { transform: none; opacity: 1; } }

/* 窗棂暗纹 */
.ddz-lobby::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image:
    linear-gradient(90deg, rgba(122, 60, 12, .14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 60, 12, .14) 1px, transparent 1px);
  background-size: 64px 44px, 32px 22px;
  background-position: 0 0, 16px 11px;
  mask-image: radial-gradient(130% 110% at 50% 40%, #000 45%, transparent 100%);
}

/* 顶栏：深棕木横幅 */
.ddz-lobby-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(96, 48, 8, .92), rgba(78, 38, 6, .95));
  border-bottom: 3px solid #c9893a;
  box-shadow: 0 3px 12px rgba(70, 32, 4, .4);
}
.ddz-lobby-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffe9b0;
  -webkit-text-stroke: 1px #7a3c0a;
  text-shadow: 0 2px 3px rgba(60, 26, 2, .7);
}
.ddz-lobby-logo {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd76a, #e6a22e);
  border: 2px solid #b8871a;
  font-size: 18px;
  box-shadow: 0 2px 5px rgba(0,0,0,.35);
}
.ddz-lobby-close {
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: linear-gradient(180deg, #fff3d0, #e8b964);
  color: #6a3400; font-size: 17px; line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,.3);
  transition: all .15s;
}
.ddz-lobby-close:hover { background: #ffca7a; transform: scale(1.1) rotate(90deg); }

/* 工具栏：计数 + 刷新 */
.ddz-lobby-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 6px;
}
.ddz-lobby-count { color: #6a3400; font-size: 14px; font-weight: 800; }
.ddz-lobby-count b {
  display: inline-block; min-width: 22px;
  padding: 1px 8px; margin: 0 4px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffd76a, #e6a22e);
  border: 1px solid #b8871a;
  color: #4d2500; font-size: 14px; text-align: center;
}
.ddz-lobby-refresh {
  border: 2px solid #b8871a;
  border-radius: 18px;
  padding: 5px 14px;
  background: linear-gradient(180deg, #fff3d0, #eec277);
  color: #6a3400; font-size: 13px; font-weight: 800;
  cursor: pointer;
  transition: all .15s;
}
.ddz-lobby-refresh:hover { transform: translateY(-2px); box-shadow: 0 4px 10px rgba(90,45,5,.3); }
.ddz-lobby-refresh.spin .ico { display: inline-block; animation: ddz-lobby-spin .7s linear infinite; }
@keyframes ddz-lobby-spin { to { transform: rotate(360deg); } }

/* 舞台：绿色绒布牌桌 */
.ddz-lobby-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 8px 18px 14px;
  padding: 16px 14px;
  overflow-y: auto;
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 30%, rgba(180, 240, 150, .06), transparent 55%),
    radial-gradient(ellipse at 50% 50%, #2f9c3f 0%, #1f7d30 55%, #145a22 100%);
  border: 3px solid #8a5a22;
  box-shadow:
    inset 0 0 40px rgba(0, 40, 10, .5),
    inset 0 2px 3px rgba(190, 255, 140, .2),
    0 8px 20px rgba(60, 30, 4, .35);
}
.ddz-lobby-stage::-webkit-scrollbar { width: 8px; }
.ddz-lobby-stage::-webkit-scrollbar-thumb { background: #c98a3a; border-radius: 6px; }
.ddz-lobby-stage::-webkit-scrollbar-track { background: rgba(0,40,10,.25); }

/* 加载态：金色铜钱旋转 */
.ddz-lobby-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 40px 0;
  color: #eaf6df; font-size: 15px; font-weight: 700; letter-spacing: 2px;
}
.ddz-lobby-coin {
  width: 46px; height: 46px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 40%, #fff6dd, transparent 40%),
    repeating-radial-gradient(circle at 50% 50%, transparent 0 3px, rgba(122,60,12,.25) 4px),
    linear-gradient(180deg, #ffe9b0, #e0a84f);
  border: 3px solid #b8871a;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,40,10,.4);
  animation: ddz-lobby-spin 1s linear infinite;
}
.ddz-lobby-coin::after {
  content: "斗";
  color: #6a3400; font-size: 18px; font-weight: 900;
}

/* 空态：Q版茶壶 */
.ddz-lobby-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 12px;
  text-align: center;
}
.ddz-lobby-empty-art {
  width: 74px; height: 74px;
  display: flex; align-items: center; justify-content: center;
  font-size: 40px;
  border-radius: 50%;
  background: rgba(255, 240, 200, .22);
  border: 2px solid rgba(255, 240, 200, .5);
  box-shadow: inset 0 0 14px rgba(0,40,10,.3);
  margin-bottom: 6px;
}
.ddz-lobby-empty-title {
  color: #fff6df; font-size: 17px; font-weight: 900; letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0,40,10,.5);
}
.ddz-lobby-empty-sub {
  color: #d8f0c4; font-size: 13px; line-height: 1.7; max-width: 320px;
}

/* 局卡：Q版扑克牌质感 */
.ddz-lobby-list { display: flex; flex-direction: column; gap: 12px; }
.ddz-lobby-room {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background:
    radial-gradient(120% 140% at 50% -30%, rgba(255, 255, 255, .9), transparent 45%),
    linear-gradient(165deg, #fffdf4 0%, #f7efdb 55%, #efe3c4 100%);
  border: 2px solid rgba(224, 168, 79, .8);
  box-shadow: 0 4px 10px rgba(0, 40, 10, .3), inset 0 0 0 2px rgba(255,255,255,.55);
  color: #4a2404;
  cursor: pointer;
  transition: transform .13s, box-shadow .13s;
}
.ddz-lobby-room::before {
  content: ""; position: absolute; inset: 4px;
  border-radius: 12px;
  border: 1px solid rgba(180, 140, 60, .35);
  pointer-events: none;
}
.ddz-lobby-room:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,40,10,.4); }

/* 座位席：3个Q版头标 */
.ddz-lobby-seats {
  display: flex;
  flex-shrink: 0;
}
.ddz-lobby-seat {
  width: 34px; height: 34px;
  margin-left: -10px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: linear-gradient(135deg, #dce3ea, #b9c3cf); /* 空位：灰 */
  box-shadow: 0 2px 5px rgba(60,30,4,.3);
  display: flex; align-items: center; justify-content: center;
  color: #7a3c0a; font-size: 14px; font-weight: 900;
}
.ddz-lobby-seat:first-child { margin-left: 0; }
.ddz-lobby-seat.off { background: #9aa7b3; color: #eef1f4; font-size: 11px; }
.ddz-lobby-seat.filled { border-color: #ffd76a; }
/* 底分/计费徽章 */
.ddz-lobby-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 5px;
}
.ddz-lobby-badge {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px; font-weight: 800;
  background: linear-gradient(180deg, #ffd76a, #e6a22e);
  border: 1px solid #b8871a;
  color: #4d2500;
  white-space: nowrap;
}
.ddz-lobby-badge.settle-coins { background: linear-gradient(180deg, #ffb04a, #e07a16); border-color: #a54f0a; }
.ddz-lobby-badge.settle-points { background: linear-gradient(180deg, #9fd6ff, #4f98e0); border-color: #2f6fa8; color: #0a2c4a; }

/* 局卡信息 */
.ddz-lobby-room-info { flex: 1; min-width: 0; }
.ddz-lobby-room-name {
  font-size: 15px; font-weight: 900; letter-spacing: 1px; color: #5a2e0a;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ddz-lobby-room-meta {
  font-size: 12px; color: #96612a; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 进入：金黄椭圆按钮 */
.ddz-lobby-enter {
  flex-shrink: 0;
  padding: 8px 20px;
  border: none; border-radius: 24px;
  font-family: inherit; font-size: 14px; font-weight: 900; letter-spacing: 2px;
  cursor: pointer;
  color: #5a2e0a;
  background:
    radial-gradient(120% 150% at 50% -20%, rgba(255, 255, 255, .95), transparent 42%),
    linear-gradient(180deg, #ffdf7c 0%, #f6b93b 55%, #e89b1e 100%);
  border-bottom: 4px solid #bb7410;
  box-shadow: 0 4px 9px rgba(90, 45, 5, .4), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .12s, filter .12s;
}
.ddz-lobby-enter:hover { transform: translateY(-2px) scale(1.03); filter: brightness(1.06); }
.ddz-lobby-enter:active { transform: translateY(0); border-bottom-width: 2px; }

/* 底部：创建按钮（蓝色主按钮） */
.ddz-lobby-foot {
  padding: 4px 18px 16px;
  display: flex;
  justify-content: center;
}
.ddz-lobby-btn {
  min-width: 230px;
  padding: 12px 22px;
  border: none; border-radius: 30px;
  font-family: inherit; font-size: 16px; font-weight: 900; letter-spacing: 2px;
  cursor: pointer;
  color: #fff;
  background:
    radial-gradient(120% 150% at 50% -20%, rgba(255, 255, 255, .5), transparent 42%),
    linear-gradient(180deg, #4fa3f0 0%, #2b78d6 55%, #1d5cb0 100%);
  border-bottom: 4px solid #123d77;
  box-shadow: 0 6px 14px rgba(90, 45, 5, .45);
  transition: transform .12s, filter .12s, box-shadow .12s;
}
.ddz-lobby-btn:hover { transform: translateY(-3px) scale(1.03); filter: brightness(1.06); box-shadow: 0 9px 20px rgba(90,45,5,.5); }
.ddz-lobby-btn:active { transform: translateY(0); border-bottom-width: 2px; }