/* ============================================================================
   棋牌娱乐模块样式（纯新增文件，不改动原有组件样式）
   设计原则和论坛一致：白/深色主题用 tokens 变量、细边框、小圆角、没有渐变和动画；
   唯一的"动画"是随机匹配的抽取高亮（业务要求），也只用描边变化，不做位移/缩放。
   ============================================================================ */

.games { --g-card: var(--surface); }

/* ---------------------------------------------------------------- 通用 */
.gspacer { flex: 1 1 auto; }
.g-tiny { font-size: var(--fs-xs); line-height: 1.6; }
.g-muted { color: var(--text-3); }
.g-ok { color: var(--success); }
.g-warn { color: var(--warn); }
.g-error { color: var(--danger); }
.g-body { font-size: var(--fs-body); color: var(--text-2); line-height: 1.7; }
.gsection {
  font-size: var(--fs-h2); color: var(--text);
  margin: 22px 0 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.gempty-box { text-align: center; padding: 26px 12px; }

/* ---------------------------------------------------------------- 顶部 */
.ghero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 6px;
}
.ghero__title { font-size: var(--fs-page); color: var(--text); display: flex; align-items: center; gap: 8px; }
.ghero__desc { color: var(--text-2); font-size: var(--fs-body); margin-top: 8px; max-width: 620px; line-height: 1.7; }
.ghero__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.ghero__hint { color: var(--text-3); font-size: var(--fs-xs); margin-top: 10px; }

/* ---------------------------------------------------------------- 游戏卡片 */
.ggrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.gcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gcard--flat { padding: 0; }
.gcard__head { display: flex; align-items: center; gap: 10px; }
.gcard__title { font-size: var(--fs-title); color: var(--text); }
.gcard__desc { color: var(--text-2); font-size: var(--fs-sm); line-height: 1.6; margin: 0; }
.gcard__foot { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 4px; }
.gcard__body { padding: 16px; }

.gicon {
  width: 44px; height: 44px; flex: 0 0 44px;
  display: grid; place-items: center;
  border-radius: var(--radius-md);
  background: var(--primary-100);
  color: var(--primary);
}
.gicon--sm { width: 32px; height: 32px; flex-basis: 32px; border-radius: var(--radius-sm); }
.gicon--lg { width: 56px; height: 56px; flex-basis: 56px; }
/* 每种游戏一个淡淡的底色，靠 token 变量保证深色主题也正常 */
.gicon--gomoku { background: var(--success-soft); color: var(--success); }
.gicon--chess { background: var(--warn-soft); color: var(--warn); }
.gicon--xiangqi { background: var(--danger-soft); color: var(--danger); }
.gicon--doudizhu { background: var(--primary-100); color: var(--primary); }
.gicon--uno { background: var(--info-soft); color: var(--info); }
.gicon--mahjong { background: var(--surface-3); color: var(--text-2); }

/* ---------------------------------------------------------------- 列表行 */
.glist { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); }
.grow { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.glist .grow:last-child { border-bottom: 0; }
.grow__main { min-width: 0; flex: 1 1 auto; }
.grow__main b { display: block; font-size: var(--fs-sm); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gbadge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.gbadge--go { background: var(--primary-100); color: var(--primary); }
.gbadge--win { background: var(--success-soft); color: var(--success); }
.gbadge--host { background: var(--warn-soft); color: var(--warn); margin-left: 6px; }

/* ---------------------------------------------------------------- 匹配 */
.gmroll { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px 20px; text-align: center; }
.gmroll__title { font-size: var(--fs-page); color: var(--text); }
.gmroll__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.gmroll__item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 8px; color: var(--text-2); font-size: var(--fs-sm);
  background: var(--surface-2);
}
.gmroll__item.is-active { border-color: var(--primary); background: var(--primary-100); color: var(--primary); }

.gmatch { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.gmatch__top { display: flex; align-items: center; gap: 14px; }
.gmatch__title { font-size: var(--fs-h2); color: var(--text); }
.gmstat { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.gmstat__item { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px; text-align: center; }
.gmstat__item b { display: block; font-size: var(--fs-h2); color: var(--text); }
.gmstat__item span { font-size: var(--fs-xs); color: var(--text-3); }
.gmatch__acts { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.gnotice {
  border: 1px solid var(--border); border-left: 3px solid var(--primary);
  background: var(--primary-soft); color: var(--text-2);
  border-radius: var(--radius-sm); padding: 11px 13px; margin-top: 14px;
  font-size: var(--fs-sm); line-height: 1.7;
}
.gnotice--wait { border-left-color: var(--warn); background: var(--warn-soft); }
.gnotice--go { border-left-color: var(--success); background: var(--success-soft); }

/* ---------------------------------------------------------------- 房间 */
.groomhead { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.groomtitle { font-size: var(--fs-page); color: var(--text); margin-bottom: 12px; }
.gseats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gseat {
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  padding: 14px 10px; text-align: center; background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.gseat.is-taken { border-style: solid; background: var(--surface); }
.gseat__name { font-size: var(--fs-sm); color: var(--text); }
.gseat__empty { color: var(--text-3); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; }
.ginfo { margin-top: 14px; font-size: var(--fs-sm); color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.gcode { font-family: var(--font-mono); font-size: var(--fs-title); letter-spacing: 2px; color: var(--primary); }
.gacts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.gmembers { display: flex; flex-direction: column; }

/* ---------------------------------------------------------------- 对局顶部 */
.gtop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 12px; }
.gtop__left { display: flex; align-items: baseline; gap: 8px; }
.gtop__left b { font-size: var(--fs-title); color: var(--text); }
.gtop__right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gboardwrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; }
.gboardwrap--ended { opacity: .85; }

.gplayers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.gplayers--mj { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.gplayer { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; background: var(--surface-2); }
.gplayer.is-me { border-color: var(--primary-200); background: var(--primary-soft); }
.gplayer.is-landlord { border-color: var(--warn); }
.gplayer.is-won { border-color: var(--success); background: var(--success-soft); }
.gplayer.is-turn { box-shadow: inset 3px 0 0 var(--primary); }
.gplayer__main { min-width: 0; flex: 1 1 auto; }
.gplayer__main b { font-size: var(--fs-sm); color: var(--text); }

/* ---------------------------------------------------------------- 五子棋 */
.gmn {
  display: grid; grid-template-columns: repeat(15, 1fr);
  gap: 0; width: min(100%, 540px); margin: 0 auto;
  border: 1px solid var(--border-strong); background: var(--warn-soft);
}
.gmn__cell {
  aspect-ratio: 1 / 1; border: 0; padding: 0; margin: 0; cursor: pointer;
  background: transparent; position: relative;
}
.gmn__cell::after {
  content: ''; position: absolute; inset: 0;
  border-right: 1px solid rgba(120, 100, 70, .35);
  border-bottom: 1px solid rgba(120, 100, 70, .35);
}
.gmn__cell:nth-child(15n)::after { border-right: 0; }
.gmn__cell.is-b::before,
.gmn__cell.is-w::before {
  content: ''; position: absolute; inset: 14%; border-radius: 50%;
  background: var(--text); z-index: 2;
}
.gmn__cell.is-w::before { background: var(--surface); border: 1px solid var(--text-2); }
.gmn__cell.is-last::before { box-shadow: 0 0 0 2px var(--accent); }
.gmn__cell.is-win::before { box-shadow: 0 0 0 3px var(--success); }
.gmn__cell:disabled { cursor: default; }

/* ---------------------------------------------------------------- 棋盘（象棋类） */
.gch, .gxq {
  display: grid; gap: 0; margin: 0 auto;
  border: 1px solid var(--border-strong);
  user-select: none;
}
.gch { grid-template-columns: repeat(8, 1fr); width: min(100%, 460px); }
.gxq { grid-template-columns: repeat(9, 1fr); width: min(100%, 460px); background: var(--warn-soft); }
.gch__cell, .gxq__cell {
  aspect-ratio: 1 / 1; border: 0; padding: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--warn-soft);
  position: relative; font-size: 0;
}
.gch__cell.is-dark { background: var(--warn); opacity: .82; }
.gch__cell.is-dark { background: #b08b57; }
.gxq__cell::after {
  content: ''; position: absolute; inset: 0;
  border-right: 1px solid rgba(120, 100, 70, .4);
  border-bottom: 1px solid rgba(120, 100, 70, .4);
}
.gxq__cell:nth-child(9n)::after { border-right: 0; }
.gch__cell.is-sel, .gxq__cell.is-sel { outline: 2px solid var(--primary); outline-offset: -2px; z-index: 3; }
.gch__cell.is-target, .gxq__cell.is-target { background: var(--primary-100); }
.gch__cell.is-target::before, .gxq__cell.is-target::before {
  content: ''; width: 26%; height: 26%; border-radius: 50%;
  background: var(--primary); opacity: .45; position: absolute;
}
.gch__cell:disabled, .gxq__cell:disabled { cursor: default; }
.gch__p { font-size: clamp(18px, 4.4vw, 30px); line-height: 1; }
.gch__p--w { color: #fff; text-shadow: 0 0 1px #333, 0 1px 1px rgba(0,0,0,.5); }
.gch__p--b { color: #222; text-shadow: 0 0 1px #fff; }
.gxq__p {
  font-size: clamp(14px, 3.4vw, 22px); line-height: 1; font-weight: 700;
  width: 76%; height: 76%; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border-strong);
  position: relative; z-index: 2;
}
.gxq__p--r { color: var(--danger); border-color: var(--danger); }
.gxq__p--b { color: var(--text); border-color: var(--text-2); }

/* ---------------------------------------------------------------- 手牌 / 牌 */
.ghand { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.gpc {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 44px; height: 64px; padding: 4px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: pointer;
  font-family: var(--font-mono);
}
.gpc b { font-size: 17px; line-height: 1.1; }
.gpc i { font-style: normal; font-size: 12px; color: var(--text-2); }
.gpc.is-sel { outline: 2px solid var(--primary); background: var(--primary-100); transform: none; }
.gpc--sm { min-width: 32px; height: 44px; }
.gpc--sm b { font-size: 13px; }
.gpc--joker b { color: var(--danger); font-size: 14px; }
.gl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gl__t { font-size: var(--fs-xs); color: var(--text-3); }
.glastplay { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 8px 0; }

/* UNO 牌：彩色底 + 白椭圆 + 大字符 + 角落小标（与宣传片同一套牌面） */
.guc {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 82px; padding: 0; flex: 0 0 auto;
  border-radius: 9px; border: 3px solid #fff; overflow: hidden;
  box-shadow: 0 1px 2px rgba(20,30,40,.22), 0 0 0 1px rgba(20,30,40,.12);
  background: #c0392b; color: #c0392b; cursor: pointer;
  font-family: var(--font-sans); -webkit-tap-highlight-color: transparent;
}
.guc__oval {
  position: absolute; left: 8%; right: 8%; top: 12%; bottom: 12%;
  background: #fff; border-radius: 50%; transform: rotate(-20deg);
}
.guc__face {
  position: relative; font-size: 28px; font-weight: 800; line-height: 1; letter-spacing: -.03em;
  font-family: "Segoe UI Symbol", var(--font-sans);
}
.guc__corner {
  position: absolute; left: 4px; top: 3px; font-size: 9px; font-weight: 800; line-height: 1;
  color: #fff; opacity: .92; font-family: "Segoe UI Symbol", var(--font-sans);
}
.guc--0 { background: #c0392b; color: #c0392b; }
.guc--1 { background: #c9a227; color: #a87f0e; }
.guc--2 { background: #2f7d4f; color: #29704a; }
.guc--3 { background: #2c6e9b; color: #265f88; }
.guc--wild { color: #1b1f23; background: conic-gradient(from 45deg, #c0392b 0 25%, #c9a227 0 50%, #2f7d4f 0 75%, #2c6e9b 0); }
.guc--wild .guc__corner { color: #fff; }
.guc--wildcard .guc__face { font-size: 17px; letter-spacing: 0; }
.guc--wildcard .guc__corner { display: none; }
.guc--big { width: 78px; height: 114px; border-radius: 11px; cursor: default; }
.guc--big .guc__face { font-size: 40px; }
.guc--big.guc--wildcard .guc__face { font-size: 22px; }
.guc.is-playable { box-shadow: 0 0 0 2px var(--primary), 0 4px 10px rgba(20,30,40,.18); transform: translateY(-2px); }
.guc.is-playable:hover { transform: translateY(-4px); }
.gcenter { display: flex; align-items: center; gap: 16px; margin: 10px 0 14px; }
.gcenter__meta { font-size: var(--fs-sm); color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.gcolor-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: -1px; margin-right: 4px; }
.gcolor-dot--0 { background: #c0392b; }
.gcolor-dot--1 { background: #c9a227; }
.gcolor-dot--2 { background: #2f7d4f; }
.gcolor-dot--3 { background: #2c6e9b; }

/* 麻将牌 */
.gmt {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 38px; height: 54px; padding: 2px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); cursor: default;
  font-family: var(--font-mono);
}
.gmt b { font-size: 17px; line-height: 1.05; }
.gmt i { font-style: normal; font-size: 11px; color: var(--text-3); }
.gmt.is-clickable { cursor: pointer; }
.gmt.is-clickable:hover { border-color: var(--primary); }
.gmt--sm { min-width: 28px; height: 40px; }
.gmt--s0 b { color: var(--danger); }
.gmt--s1 b { color: var(--success); }
.gmt--s2 b { color: var(--info); }
.ghand--mj { gap: 4px; }
.gmjbar { font-size: var(--fs-xs); color: var(--text-3); margin: 8px 0; }
.gmjriver { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 10px; }
.gmjriver__item { opacity: .9; }
.gmmelds { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.gmmeld { display: inline-flex; align-items: center; gap: 3px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: 2px 4px; }
.gmmeld i { font-style: normal; font-size: 10px; color: var(--text-3); }

/* ---------------------------------------------------------------- 结束 */
.gend { text-align: center; padding: 24px 12px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); margin-bottom: 12px; }
.gend__icon { color: var(--warn); }
.gend__title { font-size: var(--fs-page); color: var(--text); margin-top: 8px; }
.gend__sub { font-size: var(--fs-sm); color: var(--text-3); margin-top: 4px; }

.gcardsel { display: flex; flex-wrap: wrap; gap: 8px; }

/* 牌的小动效：出牌飞行残影（只做视觉，不参与布局） */
.card-ghost {
  position: fixed !important; z-index: 90; margin: 0 !important;
  pointer-events: none !important; transform-origin: center center;
  box-shadow: 0 12px 28px rgba(20, 30, 40, .28);
}

/* ---------------------------------------------------------------- 手机 */
@media (max-width: 620px) {
  .ggrid { grid-template-columns: 1fr; }
  .ghero { padding: 16px; }
  .ghero__acts .btn { flex: 1 1 46%; }
  .gmroll__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gmstat { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .gmstat__item { padding: 9px 4px; }
  .gmstat__item b { font-size: var(--fs-title); }
  .gseats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gplayers--mj { grid-template-columns: 1fr; }
  .gboardwrap { padding: 8px; }
  .gpc { min-width: 38px; height: 56px; }
  .gpc b { font-size: 15px; }
  .guc { width: 44px; height: 64px; border-width: 2px; }
  .guc__face { font-size: 21px; }
  .guc__corner { display: none; }
  .guc--big { width: 64px; height: 94px; }
  .guc--big .guc__face { font-size: 30px; }
  .guc--wildcard .guc__face { font-size: 13px; }
  .guc--big.guc--wildcard .guc__face { font-size: 18px; }
  .gmt { min-width: 32px; height: 46px; }
  .gmt b { font-size: 15px; }
  .gacts .btn { min-height: 42px; }
  .grow { padding: 10px; }
}

/* ============================================================================
   斗地主牌桌（仿主流斗地主布局：左右两家 / 中间出牌区 / 底部手牌）
   配色全部用本站 tokens，不引入图片背景；手牌自动从大到小排好。
   ============================================================================ */

.gboardwrap--ddz { padding: 0; border: 0; background: transparent; }

.ddz-table {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 520px;
  padding: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.ddz-topbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ddz-topbar__mid { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; }
.ddz-topbar__label { font-size: var(--fs-xs); color: var(--text-3); }

/* 记牌器 */
.ddz-counter {
  display: flex; gap: 3px; overflow-x: auto;
  padding: 5px 2px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
.ddz-counter__item {
  flex: 0 0 auto; min-width: 28px;
  display: flex; flex-direction: column; align-items: center;
  padding: 1px 3px; border: 1px solid var(--border); border-radius: 3px;
  background: var(--surface);
}
.ddz-counter__item i { font-style: normal; font-size: 10px; color: var(--text-3); line-height: 1.3; }
.ddz-counter__item b { font-size: 11px; color: var(--text); line-height: 1.3; }
.ddz-counter__item.is-out { opacity: .32; }

/* 桌面：左右两家 + 中间 */
.ddz-table__body {
  flex: 1 1 auto;
  display: grid; grid-template-columns: 110px minmax(0, 1fr) 110px;
  gap: 8px; align-items: start; padding: 4px 0;
}
.ddz-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ddz-side--right { align-items: flex-end; }
.ddz-seat {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 100%; padding: 7px 5px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
}
.ddz-seat.is-turn { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary-200); }
.ddz-seat__ava { position: relative; display: inline-flex; }
.ddz-seat__tag {
  position: absolute; left: -7px; bottom: -5px;
  background: var(--warn); color: #fff; font-size: 10px;
  padding: 0 4px; border-radius: 3px;
}
.ddz-seat__info { display: flex; flex-direction: column; align-items: center; gap: 1px; width: 100%; }
.ddz-seat__name { font-size: var(--fs-xs); color: var(--text); max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddz-seat__count { font-size: 10.5px; color: var(--text-3); }
.ddz-seat__turn { font-size: 10.5px; color: var(--primary); font-weight: 600; }

.ddz-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 168px; text-align: center; min-width: 0; }
.ddz-logo { display: flex; flex-direction: column; align-items: center; gap: 5px; opacity: .45; }
.ddz-logo img { width: 46px; height: 46px; }
.ddz-logo span { font-size: 10px; color: var(--text-3); letter-spacing: .5px; }
.ddz-last { max-width: 100%; padding: 7px 10px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-md); }
.ddz-last--empty { border-style: dashed; color: var(--text-3); font-size: var(--fs-sm); padding: 12px 14px; }
.ddz-last__who { font-size: 11px; color: var(--text-3); margin-bottom: 5px; }
.ddz-last__cards { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.ddz-mini {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 30px; height: 42px; padding: 0; gap: 1px;
  background: #fffdf8; color: #1f2933; border: 1px solid #b8c0c8; border-radius: 4px;
  font-family: var(--font-mono); line-height: 1.05;
}
.ddz-mini b { font-size: 13px; font-weight: 800; }
.ddz-mini i { font-style: normal; font-size: 11px; }
.ddz-mini.is-red { color: #c0392b; }

/* 我的区域 */
.ddz-me { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }
.ddz-me__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--text-2); }
.ddz-me__avatar { display: inline-flex; }
.ddz-me__name { color: var(--text); font-size: var(--fs-sm); }
.ddz-me__mult { color: var(--warn); }
.ddz-me__sel { color: var(--primary); min-width: 0; }

/* 手牌：不换行、自动叠放，牌多也放得下 */
.ddz-hand {
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 2px 2px; min-height: 96px; overflow-x: auto; overflow-y: hidden;
}
.ddz-card {
  flex: 0 0 auto; position: relative;
  width: 58px; height: 84px; margin-left: -18px;
  padding: 0; cursor: pointer; overflow: hidden;
  background: #fffdf8; color: #1f2933;
  border: 1px solid #b8c0c8; border-radius: 5px;
  box-shadow: 0 1px 2px rgba(20,30,40,.12);
  -webkit-tap-highlight-color: transparent;
}
.ddz-card:first-child { margin-left: 0; }
.ddz-card:hover { border-color: #9fb0c0; }
.ddz-card__idx {
  position: absolute; left: 5px; top: 3px;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
}
.ddz-card__idx b { font-size: 16px; font-weight: 800; font-family: var(--font-mono); letter-spacing: -.02em; }
.ddz-card__idx i { font-style: normal; font-size: 12px; line-height: 1.1; }
.ddz-card__idx--br { left: auto; right: 5px; top: auto; bottom: 3px; transform: rotate(180deg); }
.ddz-card__pip {
  position: absolute; left: 50%; top: 53%; transform: translate(-50%, -50%);
  font-size: 26px; line-height: 1;
}
.ddz-card__joker {
  position: absolute; left: 50%; top: 55%; transform: translate(-50%, -50%);
  font-size: 20px; font-weight: 800; line-height: 1;
}
.ddz-card--red,
.ddz-card--red .ddz-card__idx b,
.ddz-card--red .ddz-card__idx i,
.ddz-card--red .ddz-card__pip,
.ddz-card--red .ddz-card__joker { color: #c0392b; }
.ddz-card--joker .ddz-card__idx b { font-size: 13px; }
.ddz-card.is-sel {
  transform: translateY(-16px); border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-200), 0 8px 18px rgba(20,30,40,.18); z-index: 3;
}
.ddz-actions { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 2px 0 4px; }
.ddz-tip { text-align: center; }

/* 竖屏提示：建议横屏（点了"先竖着玩"就不显示） */
.grotate { display: none; }
@media (max-width: 620px) and (orientation: portrait) {
  .grotate {
    display: flex; position: fixed; inset: 0; z-index: 80;
    align-items: center; justify-content: center; padding: 18px;
    background: rgba(20, 24, 28, .55);
  }
  .grotate__box {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    max-width: 330px; padding: 18px; text-align: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  }
  .grotate__icon { color: var(--primary); }
  .grotate__box b { font-size: var(--fs-title); color: var(--text); }
  .grotate__box p { font-size: var(--fs-sm); color: var(--text-2); line-height: 1.7; }
}

/* 手机横屏：牌桌铺开，手牌一屏放下 */
@media (max-width: 980px) and (orientation: landscape) {
  .games[data-sub="room"] { padding: 0; }
  .gboardwrap--ddz { border: 0; padding: 0; }
  .ddz-table {
    min-height: 0;
    height: calc(100vh - 8px);
    border-radius: 0; border-left: 0; border-right: 0;
    padding: 6px 12px;
  }
  .ddz-counter { padding: 3px 2px; }
  .ddz-counter__item { min-width: 23px; }
  .ddz-table__body { grid-template-columns: 112px minmax(0, 1fr) 112px; padding: 2px 0; }
  .ddz-center { min-height: 0; }
  .ddz-logo { display: none; }
  .ddz-hand { min-height: 0; padding-top: 18px; }
  .ddz-card { width: 52px; height: 76px; margin-left: -16px; }
  .ddz-card:first-child { margin-left: 0; }
  .ddz-card__idx b { font-size: 14px; }
  .ddz-card__idx i { font-size: 11px; }
  .ddz-card__pip { font-size: 26px; }
  .ddz-actions .btn { min-height: 40px; }
  .ddz-tip { display: none; }
}
@media (max-width: 380px) {
  .ddz-table__body { grid-template-columns: 92px minmax(0, 1fr) 92px; }
  .ddz-seat__name { max-width: 78px; }
}

/* 斗地主横屏时把顶部的房间标题/通用信息条收起来，牌桌整屏放得下 */
@media (max-width: 980px) and (orientation: landscape) {
  .games[data-sub="room"][data-game="doudizhu"] .groomhead,
  .games[data-sub="room"][data-game="doudizhu"] .gtop { display: none; }
  .games[data-sub="room"][data-game="doudizhu"] .main { padding-bottom: 0; }
}

/* 卡牌牌桌整屏模式：进斗地主/UNO/麻将房间时隐藏站点页头页脚，牌桌独占屏幕 */
.g-room-table .header,
.g-room-table .footer { display: none; }
.g-room-table .main {
  padding: 0; margin: 0; max-width: none;
  min-height: 100vh;
}
.g-room-table .container { max-width: none; padding: 0; }
.g-room-table .games[data-sub="room"] { padding: 0; }
.g-room-table .gboardwrap--ddz { border: 0; padding: 0; }

/* 手机横屏：牌桌就是整屏；手牌和操作按钮必须在一屏内出现 */
@media (max-width: 980px) and (orientation: landscape) {
  .g-room-table .ddz-table {
    height: 100vh;
    min-height: 0;
    border: 0; border-radius: 0;
    padding: 4px 10px 2px;
  }
  .g-room-table .ddz-hand { padding-top: 14px; padding-bottom: 0; }
  .g-room-table .ddz-actions { padding: 0 0 2px; }
  .g-room-table .ddz-me__bar { padding-top: 2px; }
}

/* ============================================================================
   UNO 牌桌（1:1 复刻参考图）
   · 深绿桌面 + 顶栏（UNO 标志 / 房间号 / 对局信息 / 退出·横屏·规则）
   · 左右对手：头像 + 昵称 + 年级 + 手牌张数条
   · 中央：顺时针提示、牌堆、出牌（万能牌颜色）、摸牌/过/抓 UNO
   · 底部：扇形手牌 + 右下角大 UNO 按钮 + 深色状态条
   配色是本站 tokens 里的绿/白，不走渐变，符合全站「无渐变、无毛玻璃」的要求。
   ============================================================================ */

.gboardwrap--uno { padding: 0; border: 0; background: transparent; }

.uno-table {
  --uno-felt: #1d5a44;
  --uno-felt-2: #194f3c;
  --uno-bar: #0c2a20;
  --uno-line: rgba(255, 255, 255, .16);
  --uno-text: #eef6f1;
  --uno-muted: rgba(238, 246, 241, .62);
  --uno-red: #d7263d;
  --uno-yellow: #e8b71a;
  --uno-green: #1f9d55;
  --uno-blue: #1f6fb2;
  position: relative;
  display: flex;
  flex-direction: column;
  height: min(840px, calc(100vh - 16px));
  min-height: 560px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--uno-bar);
  color: var(--uno-text);
}

/* ---------------------------------------------------------------- 顶栏 */
.uno-topbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 14px;
  background: var(--uno-bar);
}
.uno-logo {
  font-weight: 900; font-size: 23px; letter-spacing: .5px; line-height: 1;
  color: #fff; font-style: italic;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, .28);
}
.uno-roompill {
  flex: 0 0 auto;
  padding: 3px 10px;
  background: #f4efe3; color: #22493a;
  border-radius: 5px; font-size: 13px; font-weight: 700; letter-spacing: .3px;
}
.uno-topbar__info { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--uno-muted); }
.uno-topbar__acts { flex: 0 0 auto; display: flex; gap: 6px; }
.uno-minibtn {
  height: 26px; padding: 0 9px;
  background: rgba(255, 255, 255, .1); color: #e8f3ed;
  border: 1px solid rgba(255, 255, 255, .22); border-radius: 5px;
  font-size: 12px; cursor: pointer;
}
.uno-minibtn:hover { background: rgba(255, 255, 255, .18); }

/* ---------------------------------------------------------------- 桌面 */
.uno-felt {
  position: relative; flex: 1 1 auto; min-height: 0;
  background: var(--uno-felt);
  border-top: 1px solid var(--uno-line);
}

/* 对手 */
.uno-seat {
  position: absolute; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  min-width: 196px; max-width: 46%;
  padding: 9px 12px;
  background: rgba(8, 36, 27, .42);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 12px;
}
.uno-seat--left { left: 18px; top: 42px; }
.uno-seat--right { right: 18px; top: 42px; flex-direction: row-reverse; text-align: right; }
.uno-seat--top { left: 50%; top: 14px; transform: translateX(-50%); }
.uno-seat.is-turn { border-color: rgba(255, 255, 255, .55); background: rgba(8, 36, 27, .6); }
.uno-seat.is-turn::after {
  content: '出牌中';
  position: absolute; right: 10px; bottom: -9px;
  padding: 1px 7px; border-radius: 9px;
  background: #f4efe3; color: #1d5a44; font-size: 10.5px; font-weight: 700;
}
.uno-seat--left.is-turn::after { right: 10px; }
.uno-seat--top.is-turn::after { right: 10px; }
.uno-seat__ava { flex: 0 0 auto; display: inline-flex; }
.uno-seat__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.uno-seat--right .uno-seat__info { align-items: flex-end; }
.uno-seat__name {
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 14px; font-weight: 700; color: #fff;
}
.uno-seat__sub { font-size: 11px; color: var(--uno-muted); }
.uno-seat__count { display: flex; align-items: center; gap: 7px; margin-top: 1px; }
.uno-bars { display: inline-flex; align-items: center; gap: 2px; font-style: normal; }
.uno-bars i { display: block; width: 7px; height: 15px; border-radius: 2px; background: #7f1d1d; border: 1px solid rgba(255, 255, 255, .45); }
.uno-bars b { font-size: 10px; color: var(--uno-muted); font-weight: 600; }
.uno-seat__count em { font-style: normal; font-size: 14px; font-weight: 700; color: #fff; }
.uno-seat__count em small { font-size: 10px; font-weight: 400; margin-left: 1px; color: var(--uno-muted); }

/* 中央：方向 + 牌堆 + 出牌 */
.uno-center {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 58px 180px 120px;
}
.uno-turn {
  padding: 4px 14px; border-radius: 20px;
  background: rgba(0, 0, 0, .26); color: #f2f7f4;
  font-size: 12.5px; letter-spacing: .4px;
}
.uno-arrow {
  position: absolute; left: calc(50% - 178px); top: 52%;
  width: 0; height: 0;
  border-top: 17px solid transparent;
  border-bottom: 17px solid transparent;
  border-left: 26px solid rgba(255, 255, 255, .5);
}
.uno-arrow--ccw { transform: rotate(180deg); }
.uno-piles { display: flex; align-items: flex-end; gap: 26px; }
.uno-pile { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.uno-pile__label { font-size: 11.5px; color: var(--uno-muted); display: inline-flex; align-items: center; gap: 5px; }
.uno-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .7); }
.uno-last {
  max-width: 92%; margin-top: 2px; text-align: center;
  font-size: 11.5px; color: var(--uno-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.uno-notice {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(255, 255, 255, .92); color: #1c3b2d; font-size: 12px; font-weight: 600;
}
.uno-drawn { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--uno-text); }
.uno-colors {
  position: absolute; left: 50%; top: 54%; transform: translate(-50%, -50%);
  z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 18px; border-radius: 14px;
  background: #0b241b; border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
}
.uno-colors__title { font-size: 13px; color: #eaf5ee; }
.uno-colors__row { display: flex; gap: 10px; }
.uno-colorbtn {
  width: 54px; height: 54px; border-radius: 10px; border: 3px solid #fff;
  color: #fff; font-size: 14px; font-weight: 800; cursor: pointer;
}
.uno-colorbtn--0 { background: var(--uno-red); }
.uno-colorbtn--1 { background: #b98b00; }
.uno-colorbtn--2 { background: var(--uno-green); }
.uno-colorbtn--3 { background: var(--uno-blue); }
.uno-colors__cancel { background: none; border: 0; color: var(--uno-muted); font-size: 12px; cursor: pointer; }

/* ---------------------------------------------------------------- 手牌 */
.uno-hand {
  position: absolute; left: 50%; bottom: 24px; z-index: 3;
  transform: translateX(-50%);
  display: flex; align-items: flex-end; justify-content: center;
  max-width: 96%;
  padding-top: 18px; /* 给悬停/抬牌留空间 */
}
.uno-card {
  position: relative; flex: 0 0 auto; display: inline-flex;
  padding: 0; border: 0; background: transparent;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  border-radius: 9px;
}
.uno-card__inner {
  position: relative; display: block; width: 100%; height: 100%;
  box-sizing: border-box; overflow: hidden;
  background: #fffdf7;
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
}
.uno-card--hand .uno-card__inner {
  border: 3px solid #fffdf7;
  background: var(--uno-c);
}
.uno-card--big { width: clamp(78px, 9vw, 108px); height: calc(clamp(78px, 9vw, 108px) * 1.42); }
.uno-card--big .uno-card__inner { border: 4px solid #fffdf7; background: var(--uno-c); }
.uno-card--0 { --uno-c: var(--uno-red); }
.uno-card--1 { --uno-c: var(--uno-yellow); }
.uno-card--2 { --uno-c: var(--uno-green); }
.uno-card--3 { --uno-c: var(--uno-blue); }
.uno-card--wild { --uno-c: #3a3a3a; }
.uno-card__oval {
  position: absolute; left: 50%; top: 50%;
  width: 82%; height: 54%;
  transform: translate(-50%, -50%) rotate(-18deg);
  border-radius: 50%;
  background: #fffdf7;
}
.uno-card__face {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-9deg);
  color: var(--uno-c); font-weight: 900; line-height: 1;
  font-size: calc(var(--uno-w, 64px) * .58);
  letter-spacing: -.02em;
}
.uno-card--big .uno-card__face { font-size: 44px; }
.uno-card__corner {
  position: absolute; color: #fff; font-weight: 800; line-height: 1;
  font-size: calc(var(--uno-w, 64px) * .2);
}
.uno-card--big .uno-card__corner { font-size: 17px; }
.uno-card__corner--tl { left: 7px; top: 5px; }
.uno-card__corner--br { right: 7px; bottom: 5px; transform: rotate(180deg); }
.uno-card__quads { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.uno-card__q { display: block; }
.uno-card__q--0 { background: var(--uno-red); }
.uno-card__q--1 { background: var(--uno-yellow); }
.uno-card__q--2 { background: var(--uno-green); }
.uno-card__q--3 { background: var(--uno-blue); }
.uno-card--wild .uno-card__corner { color: #fff; }

/* 背面（牌堆） */
.uno-card--back { display: inline-flex; cursor: default; }
.uno-card--back .uno-card__inner { border: 3px solid #fffdf7; background: #141414; }
.uno-card--back .uno-card__oval { width: 84%; height: 50%; background: #b8241f; }
.uno-card__logo {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-18deg);
  color: #fff; font-weight: 900; font-style: italic;
  font-size: 24px; letter-spacing: .5px; line-height: 1;
}
.uno-card--big .uno-card__logo { font-size: 32px; }
.uno-card--back.is-drawable { cursor: pointer; }
.uno-card--back.is-drawable:hover .uno-card__inner { box-shadow: 0 0 0 3px rgba(255, 255, 255, .35), 0 3px 8px rgba(0, 0, 0, .35); }
.uno-card--empty {
  display: grid; place-items: center;
  width: clamp(78px, 9vw, 108px); height: calc(clamp(78px, 9vw, 108px) * 1.42);
  background: rgba(255, 255, 255, .1); border: 2px dashed var(--uno-line); border-radius: 9px;
  color: var(--uno-muted); font-size: 22px;
}

/* 手牌：扇形叠放 + 可出牌高亮 */
.uno-card--hand {
  width: var(--uno-w, 64px); height: calc(var(--uno-w, 64px) * 1.42);
  transform: translateY(var(--lift, 0px)) rotate(var(--rot, 0deg));
  transform-origin: 50% 130%;
  z-index: 1;
}
.uno-hand .uno-card--hand + .uno-card--hand { margin-left: calc(var(--uno-w, 64px) * -.44); }
.uno-card--hand.is-playable { z-index: 2; }
.uno-card--hand.is-playable .uno-card__inner { box-shadow: 0 0 0 2px rgba(255, 255, 255, .95), 0 6px 14px rgba(0, 0, 0, .4); }
.uno-card--hand:hover { transform: translateY(calc(var(--lift, 0px) - 12px)) rotate(var(--rot, 0deg)); z-index: 4; }

/* 大 UNO 按钮 */
.uno-btn {
  position: absolute; right: 26px; bottom: 26px; z-index: 4;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  width: 96px; height: 96px; padding: 0;
  border-radius: 50%; border: 4px solid rgba(255, 255, 255, .9);
  background: #c4302b; color: #fff;
  font-weight: 900; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}
.uno-btn span { font-size: 24px; font-style: italic; letter-spacing: .5px; line-height: 1; }
.uno-btn small { font-size: 10px; font-weight: 600; opacity: .9; }
.uno-btn--idle { opacity: .45; cursor: default; }
.uno-btn--ready { background: #d7263d; }
.uno-btn--armed { background: #146b45; border-color: #fff; }
.uno-btn--call { background: #e8b71a; color: #2a2200; }
.uno-btn:not(.uno-btn--idle):hover { filter: brightness(1.06); }

/* ---------------------------------------------------------------- 底栏 */
.uno-status {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 40px; padding: 0 16px;
  background: var(--uno-bar); border-top: 1px solid var(--uno-line);
  font-size: 12.5px; color: #d6e7dd;
}
.uno-status__left { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uno-status__dot { width: 9px; height: 9px; border-radius: 50%; background: #5f7f71; flex: 0 0 auto; }
.uno-status__dot.is-on { background: #5fd39a; }
.uno-status__right { color: var(--uno-muted); white-space: nowrap; }

/* 全屏牌桌模式（进 UNO 对局时站点页头/页脚收起） */
.g-room-table .uno-table { height: 100vh; min-height: 0; border-radius: 0; }
.g-room-table .gboardwrap--uno { border: 0; padding: 0; }
.g-room-table .games[data-sub="room"] { padding: 0; }

/* UNO 对局中把通用房间标题/信息条收起来（牌桌自带顶栏） */
.games[data-status="live"][data-game="uno"] .groomhead,
.games[data-status="live"][data-game="uno"] .gtop { display: none; }

/* 手机横屏：整屏放得下 */
@media (max-width: 980px) and (orientation: landscape) {
  .uno-table { height: 100vh; border-radius: 0; }
  .uno-topbar { height: 38px; padding: 0 10px; gap: 8px; }
  .uno-logo { font-size: 19px; }
  .uno-roompill { font-size: 12px; padding: 2px 8px; }
  .uno-topbar__info { font-size: 11px; }
  .uno-seat { min-width: 168px; padding: 7px 10px; }
  .uno-seat--left { left: 10px; top: 26px; }
  .uno-seat--right { right: 10px; top: 26px; }
  .uno-center { padding: 42px 150px 96px; gap: 7px; }
  .uno-arrow { left: calc(50% - 150px); }
  .uno-card--big { width: 76px; height: 108px; }
  .uno-card--big .uno-card__face { font-size: 34px; }
  .uno-hand { bottom: 14px; }
  .uno-btn { width: 74px; height: 74px; right: 14px; bottom: 14px; border-width: 3px; }
  .uno-btn span { font-size: 19px; }
  .uno-status { height: 30px; font-size: 11.5px; }
}

/* 手机竖屏：对手收窄、牌桌竖向排 */
@media (max-width: 620px) {
  .uno-table { height: calc(100vh - 8px); min-height: 0; border-radius: 0; }
  .uno-topbar { flex-wrap: nowrap; gap: 6px; padding: 0 8px; height: 44px; }
  .uno-topbar__info { display: none; }
  .uno-topbar__acts { margin-left: auto; }
  .uno-seat { min-width: 0; width: 44%; max-width: 44%; padding: 7px 8px; gap: 7px; }
  .uno-seat--left { left: 8px; top: 10px; }
  .uno-seat--right { right: 8px; top: 10px; }
  .uno-seat--top { top: 78px; }
  .uno-seat__name { max-width: 84px; font-size: 12.5px; }
  .uno-seat__sub { font-size: 10px; }
  .uno-center { padding: 116px 10px 150px; }
  .uno-arrow { display: none; }
  .uno-card--big { width: 66px; height: 94px; }
  .uno-card--big .uno-card__face { font-size: 30px; }
  .uno-card--big .uno-card__logo { font-size: 20px; }
  .uno-card--empty { width: 66px; height: 94px; }
  .uno-piles { gap: 18px; }
  .uno-hand { bottom: 66px; }
  .uno-btn { width: 64px; height: 64px; right: 10px; bottom: 8px; border-width: 3px; }
  .uno-btn span { font-size: 16px; }
  .uno-btn small { font-size: 9px; }
  .uno-status { height: 34px; padding: 0 10px; font-size: 11px; }
  .uno-status__right { display: none; }
}

/* ----------------------------------------------------------------------------
   UNO 视觉微调（对照参考图 1:1）
   · 牌堆背牌要和中央出牌一样大（之前漏了尺寸，缩成一小块）
   · 方向/轮次提示固定在桌面上方，牌堆和出牌在桌面正中
   ---------------------------------------------------------------------------- */
.uno-card--back {
  width: clamp(78px, 9vw, 108px);
  height: calc(clamp(78px, 9vw, 108px) * 1.42);
}
.uno-card--back .uno-card__logo { font-size: 26px; }
.uno-turn {
  position: absolute; left: 50%; top: 18px; transform: translateX(-50%);
  z-index: 2; white-space: nowrap;
}
.uno-center { padding-bottom: 132px; }
@media (max-width: 980px) and (orientation: landscape) {
  .uno-card--back { width: 76px; height: 108px; }
  .uno-turn { top: 10px; }
  .uno-center { padding-bottom: 104px; }
}
@media (max-width: 620px) {
  .uno-card--back { width: 66px; height: 94px; }
  .uno-turn { top: 84px; }
}

/* ---- UNO 第二轮微调：卡牌比例、手牌叠放、对手信息排布、4 人局提示位置 ---- */
.uno-hand .uno-card--hand + .uno-card--hand { margin-left: calc(var(--uno-w, 64px) * -.32); }
.uno-card--big { width: clamp(96px, 10.5vw, 136px); height: calc(clamp(96px, 10.5vw, 136px) * 1.42); }
.uno-card--big .uno-card__face { font-size: 52px; }
.uno-card--big .uno-card__corner { font-size: 19px; }
.uno-card--big .uno-card__logo { font-size: 36px; }
.uno-card--back { width: clamp(96px, 10.5vw, 136px); height: calc(clamp(96px, 10.5vw, 136px) * 1.42); }
.uno-seat { min-width: 220px; }
.uno-seat__info { flex: 1 1 auto; }
.uno-seat__count { flex: 0 0 auto; margin-left: 2px; }
.uno-topbar__info { margin-left: auto; text-align: right; }
.uno-btn--idle { opacity: .82; }
/* 4 人局正上方还有一个对手，轮次提示往下让开 */
.uno-table--4p .uno-turn { top: 122px; }
@media (max-width: 980px) and (orientation: landscape) {
  .uno-card--big { width: 88px; height: 125px; }
  .uno-card--back { width: 88px; height: 125px; }
  .uno-card--big .uno-card__face { font-size: 40px; }
  .uno-table--4p .uno-turn { top: 100px; }
}
@media (max-width: 620px) {
  .uno-card--big { width: 74px; height: 105px; }
  .uno-card--back { width: 74px; height: 105px; }
  .uno-card--big .uno-card__face { font-size: 32px; }
  .uno-table--4p .uno-turn { top: 150px; }
}

/* ============================================================================
   斗地主牌桌（对标 UNO 参考图：深绿桌面 / 顶栏 / 左右两家 / 中央出牌 / 扇形手牌 / 状态条）
   复用原来的 .ddz-* 类名，测试与动作不用改。
   ============================================================================ */
.ddz-table {
  --ddz-felt: #1d5a44;
  --ddz-bar: #0c2a20;
  --ddz-text: #eef6f1;
  --ddz-muted: rgba(238, 246, 241, .62);
  --ddz-line: rgba(255, 255, 255, .16);
  position: relative; display: flex; flex-direction: column;
  height: min(840px, calc(100vh - 16px)); min-height: 560px;
  overflow: hidden; border-radius: var(--radius-lg);
  background: var(--ddz-bar); color: var(--ddz-text);
}
.g-room-table .ddz-table, .ddz-table { height: min(840px, calc(100vh - 16px)); }
.g-room-table .ddz-table { height: 100vh; min-height: 0; border-radius: 0; }
.gboardwrap--ddz { padding: 0; border: 0; background: transparent; }

/* 顶栏 */
.ddz-topbar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 12px; background: var(--ddz-bar);
}
.ddz-brand {
  font-weight: 900; font-size: 20px; font-style: italic; color: #fff;
  letter-spacing: .4px; text-shadow: 1px 1px 0 rgba(0, 0, 0, .25);
}
.ddz-roompill {
  padding: 3px 10px; border-radius: 5px;
  background: #f4efe3; color: #22493a; font-size: 12.5px; font-weight: 700;
}
.ddz-topbar__info {
  margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; color: var(--ddz-muted);
}
.ddz-topbar__mid { display: flex; align-items: center; gap: 4px; }
.ddz-topbar__label { font-size: 11px; color: var(--ddz-muted); }
.ddz-topbar__acts { display: flex; gap: 6px; }
.ddz-minibtn {
  height: 26px; padding: 0 9px; border-radius: 5px;
  background: rgba(255, 255, 255, .1); color: #e8f3ed;
  border: 1px solid rgba(255, 255, 255, .22); font-size: 12px; cursor: pointer;
}
.ddz-minibtn:hover { background: rgba(255, 255, 255, .18); }
.ddz-topbar .ddz-mini { width: 24px; height: 34px; border-width: 1px; }

/* 记牌器 */
.ddz-counter {
  flex: 0 0 auto; display: flex; gap: 3px; overflow-x: auto;
  padding: 4px 10px; background: rgba(8, 36, 27, .55);
  border-top: 1px solid var(--ddz-line); border-bottom: 1px solid var(--ddz-line);
  -webkit-overflow-scrolling: touch;
}
.ddz-counter__item {
  flex: 0 0 auto; min-width: 27px; padding: 1px 3px;
  display: flex; flex-direction: column; align-items: center;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); border-radius: 3px;
}
.ddz-counter__item i { font-style: normal; font-size: 10px; color: var(--ddz-muted); line-height: 1.3; }
.ddz-counter__item b { font-size: 11px; color: var(--ddz-text); line-height: 1.3; }
.ddz-counter__item.is-out { opacity: .32; }

/* 桌面 */
.ddz-felt { position: relative; flex: 1 1 auto; min-height: 0; background: var(--ddz-felt); }

/* 左右两家 */
.ddz-seat {
  position: absolute; top: 40px; z-index: 2;
  display: flex; align-items: center; gap: 10px;
  min-width: 214px; padding: 9px 12px;
  background: rgba(8, 36, 27, .42); border: 1px solid rgba(255, 255, 255, .14); border-radius: 12px;
}
.ddz-seat--left { left: 18px; }
.ddz-seat--right { right: 18px; flex-direction: row-reverse; text-align: right; }
.ddz-seat.is-turn { border-color: rgba(255, 255, 255, .55); background: rgba(8, 36, 27, .62); }
.ddz-seat__ava { position: relative; display: inline-flex; flex: 0 0 auto; }
.ddz-seat__tag {
  position: absolute; left: -7px; bottom: -6px;
  padding: 0 5px; border-radius: 3px;
  background: #c4302b; color: #fff; font-size: 10px; font-weight: 700;
}
.ddz-seat__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.ddz-seat--right .ddz-seat__info { align-items: flex-end; }
.ddz-seat__name { font-size: 13.5px; font-weight: 700; color: #fff; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddz-seat__grade { font-size: 11px; color: var(--ddz-muted); }
.ddz-seat__count { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.ddz-bars { display: inline-flex; align-items: center; gap: 2px; font-style: normal; }
.ddz-bars i { display: block; width: 6px; height: 14px; border-radius: 2px; background: #7f1d1d; border: 1px solid rgba(255, 255, 255, .45); }
.ddz-bars b { font-size: 10px; color: var(--ddz-muted); }
.ddz-seat__count em { font-style: normal; font-size: 13px; font-weight: 700; color: #fff; }
.ddz-seat__count em small { font-size: 10px; font-weight: 400; color: var(--ddz-muted); margin-left: 1px; }
.ddz-seat__turn {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%);
  padding: 1px 8px; border-radius: 9px;
  background: #f4efe3; color: #1d5a44; font-size: 10.5px; font-weight: 700; white-space: nowrap;
}

/* 中央：轮次 + 出牌区 */
.ddz-center {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 36px 190px 200px; text-align: center;
}
.ddz-turn {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  padding: 4px 14px; border-radius: 20px; white-space: nowrap;
  background: rgba(0, 0, 0, .26); color: #f2f7f4; font-size: 12.5px;
}
.ddz-last {
  padding: 9px 12px; border-radius: 10px;
  background: rgba(8, 36, 27, .5); border: 1px solid rgba(255, 255, 255, .16);
  max-width: 100%;
}
.ddz-last__who { font-size: 11px; color: var(--ddz-muted); margin-bottom: 6px; }
.ddz-last__cards { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.ddz-last--empty { border-style: dashed; color: var(--ddz-muted); font-size: 12.5px; padding: 16px 18px; }

/* 我的区域 + 手牌 + 操作 */
.ddz-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: flex; flex-direction: column; gap: 4px;
}
.ddz-me {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; font-size: 12px; color: var(--ddz-text);
}
.ddz-me__avatar { display: inline-flex; }
.ddz-me__name { font-size: 13px; color: #fff; }
.ddz-me__role { padding: 0 6px; border-radius: 3px; background: rgba(255, 255, 255, .14); font-size: 11px; color: #fff; }
.ddz-me__mult { color: #e8b71a; font-size: 11.5px; }
.ddz-me__sel { color: #fff; font-size: 11.5px; }
.ddz-me__spacer { flex: 1 1 auto; }
.ddz-clearbtn { background: none; border: 0; color: var(--ddz-muted); font-size: 11.5px; cursor: pointer; }
.ddz-clearbtn:hover { color: #fff; }
.ddz-hand {
  display: flex; align-items: flex-end; justify-content: center;
  min-height: 94px; padding: 16px 8px 2px; overflow: visible;
}
.ddz-card {
  width: 60px; height: 86px; margin-left: -21px; border-radius: 6px;
  background: #fffdf8; border: 1px solid #b8c0c8;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .35);
  transform: translateY(var(--lift, 0px)) rotate(var(--rot, 0deg));
  transform-origin: 50% 130%;
  z-index: 1;
}
.ddz-card:first-child { margin-left: 0; }
.ddz-card:hover { z-index: 4; }
.ddz-card.is-sel {
  z-index: 5; border-color: #e8b71a;
  transform: translateY(calc(var(--lift, 0px) - 16px)) rotate(var(--rot, 0deg));
  box-shadow: 0 0 0 2px rgba(232, 183, 26, .8), 0 8px 18px rgba(0, 0, 0, .4);
}
.ddz-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 2px 18px 6px; min-height: 46px; }
.ddz-actbtn {
  min-width: 96px; height: 42px; padding: 0 18px; border-radius: 8px;
  background: rgba(255, 255, 255, .14); color: #fff;
  border: 1px solid rgba(255, 255, 255, .35); font-size: 15px; font-weight: 700; cursor: pointer;
}
.ddz-actbtn:hover { background: rgba(255, 255, 255, .22); }
.ddz-actbtn--primary { background: #e8b71a; border-color: #e8b71a; color: #2a2200; }
.ddz-actbtn--primary:hover { background: #f0c53a; }
.ddz-actbtn:disabled { opacity: .45; cursor: default; }
.ddz-waittip { font-size: 12px; color: var(--ddz-muted); }

/* 底部状态条 */
.ddz-status {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: 38px; padding: 0 14px; background: var(--ddz-bar);
  border-top: 1px solid var(--ddz-line); font-size: 12.5px; color: #d6e7dd;
}
.ddz-status__left { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ddz-status__dot { width: 9px; height: 9px; border-radius: 50%; background: #5f7f71; flex: 0 0 auto; }
.ddz-status__dot.is-on { background: #5fd39a; }
.ddz-status__right { color: var(--ddz-muted); white-space: nowrap; }

/* 对局中把通用房间标题收起来（牌桌自带顶栏） */
.games[data-status="live"][data-game="doudizhu"] .groomhead,
.games[data-status="live"][data-game="doudizhu"] .gtop { display: none; }

/* 手机横屏：整屏放得下 */
@media (max-width: 980px) and (orientation: landscape) {
  .ddz-table { height: 100vh; border-radius: 0; }
  .ddz-topbar { height: 38px; padding: 0 10px; gap: 8px; }
  .ddz-brand { font-size: 17px; }
  .ddz-topbar__info { display: none; }
  .ddz-counter { padding: 3px 8px; }
  .ddz-counter__item { min-width: 23px; }
  .ddz-seat { top: 24px; min-width: 176px; padding: 7px 9px; }
  .ddz-seat--left { left: 10px; }
  .ddz-seat--right { right: 10px; }
  .ddz-center { padding: 30px 150px 168px; gap: 7px; }
  .ddz-turn { top: 8px; }
  .ddz-hand { min-height: 0; padding-top: 14px; }
  .ddz-card { width: 50px; height: 72px; margin-left: -17px; }
  .ddz-card:first-child { margin-left: 0; }
  .ddz-actions { min-height: 40px; padding: 2px 12px 4px; }
  .ddz-actbtn { height: 36px; min-width: 84px; font-size: 14px; }
  .ddz-status { height: 30px; font-size: 11.5px; }
}

/* 手机竖屏 */
@media (max-width: 620px) {
  .ddz-table { height: calc(100vh - 8px); min-height: 0; border-radius: 0; }
  .ddz-topbar { gap: 6px; padding: 0 8px; height: 42px; }
  .ddz-brand { font-size: 16px; }
  .ddz-topbar__info { display: none; }
  .ddz-seat { top: 12px; min-width: 0; width: 44%; padding: 6px 7px; gap: 7px; }
  .ddz-seat--left { left: 7px; }
  .ddz-seat--right { right: 7px; }
  .ddz-seat__name { max-width: 80px; font-size: 12px; }
  .ddz-seat__grade { font-size: 10px; }
  .ddz-bars i { width: 5px; height: 12px; }
  .ddz-center { padding: 70px 8px 168px; }
  .ddz-turn { top: 66px; }
  .ddz-hand { min-height: 0; padding-top: 16px; }
  .ddz-card { width: 46px; height: 66px; margin-left: -16px; }
  .ddz-card:first-child { margin-left: 0; }
  .ddz-status { height: 32px; padding: 0 10px; font-size: 11px; }
  .ddz-status__right { display: none; }
}

/* 覆盖上一版斗地主遗留的纵向布局（.ddz-seat / .ddz-me 原来是竖排 + width:100%） */
.ddz-table { padding: 0; gap: 0; border: 0; min-height: 0; }
.ddz-topbar { flex-wrap: nowrap; }
.ddz-topbar__mid { flex: 0 0 auto; justify-content: flex-end; }
.ddz-seat {
  flex-direction: row; align-items: center; width: auto; gap: 10px;
}
.ddz-seat--right { flex-direction: row-reverse; }
.ddz-seat__info { width: auto; align-items: flex-start; }
.ddz-seat--right .ddz-seat__info { align-items: flex-end; }
.ddz-seat__count { display: flex; flex-direction: row; gap: 6px; }
.ddz-me { flex-direction: row; flex-wrap: nowrap; margin-top: 0; gap: 8px; }
@media (max-width: 620px) {
  .ddz-seat { width: 44%; }
}

/* 回合计时器（发牌/出牌音效见 assets/audio/） */
.g-turn-timer {
  display: inline-block; margin-left: 8px; padding: 1px 7px;
  border-radius: 10px; background: rgba(0, 0, 0, .3);
  color: #e9f4ee; font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.g-turn-timer.is-low { background: #b3261e; color: #fff; }
