/* ============================================================
 * 福安麻将 · 白板金 —— 桌面 UI(重绘版)
 * 风格:翠绿毡布桌面 + 鎏金麻将牌 + 四方位牌河 + 动作特效
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: #10352a;
  color: #f5f2e8;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

#app { display: flex; flex-direction: column; height: 100vh; }

/* ---------------- 顶栏 ---------------- */
#topbar {
  height: 48px; flex: 0 0 48px; position: relative; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  background: linear-gradient(180deg, #17493a, #0e3327);
  border-bottom: 1px solid rgba(216, 176, 79, .55);
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
#topbar::after { content:''; position:absolute; left:0; right:0; bottom:-1px; height:1px;
  background: linear-gradient(90deg, transparent, rgba(255,217,104,.9), transparent); }
#topbar .brand { display:flex; align-items:baseline; gap:2px; font-size:15px; }
#topbar .brand b { font-size:19px; color:#ffd968; letter-spacing:2px;
  text-shadow: 0 1px 0 rgba(0,0,0,.4), 0 0 14px rgba(255,200,80,.35); }
#topbar .brand .sub { margin-left:9px; font-size:12px; color:#9fc8b8; letter-spacing:1px; }
.roundinfo { color:#e8e2cf; font-size:13px; text-shadow:0 1px 2px rgba(0,0,0,.5); }
.roundinfo b { color:#ffd968; }
.tools { display:flex; gap:8px; }
.tb {
  background: linear-gradient(#2b6150,#1c4638); color:#f0ead7;
  border:1px solid #3d7a67; border-radius:8px; padding:5px 15px; font-size:13px;
  cursor:pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 1px 3px rgba(0,0,0,.3);
  transition: transform .15s, filter .15s;
}
.tb:hover { filter:brightness(1.18); transform: translateY(-1px); }
.tb.primary { background: linear-gradient(#e8bb4a,#c99a2e); border-color:#f0ce72; color:#33230a; font-weight:700; }
.tb.primary:hover { filter:brightness(1.1); }

/* ---------------- 桌面骨架 ---------------- */
#table {
  flex: 1; display: grid; position: relative; min-height: 0;
  grid-template-columns: 170px minmax(0,1fr) 170px;
  grid-template-rows: 118px minmax(0,1fr) auto;
  grid-template-areas:
    "left top right"
    "left center right"
    "self self self";
  background:
    radial-gradient(ellipse 140% 90% at 50% 32%, #2c6b52 0%, #1e5541 48%, #13392c 100%);
}
#table::before { content:''; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255,255,255,.05), transparent 55%),
    radial-gradient(ellipse at 50% 110%, rgba(0,0,0,.32), transparent 60%);
}
#seat1 { grid-area: right; }   /* 下家 福仔(东) */
#seat2 { grid-area: top; }     /* 对家 安姐(北) */
#seat3 { grid-area: left; }    /* 上家 宁叔(西) */
#seat0 { grid-area: self; }
#center { grid-area: center; position:relative; display:flex; flex-direction:column;
  min-width:0; min-height:0; }
#stage { position:relative; flex:1; min-height:0; }

/* ---------------- AI 座位 ---------------- */
.ai-seat {
  position: relative; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 8px; overflow: hidden;
}
.seat-top { flex-direction: column; }
.seat-left, .seat-right { justify-content: center; }
.seat-name {
  font-size:15px; font-weight:800; color:#ffd968; letter-spacing:1px;
  text-shadow:0 1px 2px rgba(0,0,0,.5); padding:1px 8px; border-radius:11px;
  transition: background .2s; white-space:nowrap;
}
.seat-name .dealer-mark { color:#ff8b3d; margin-left:3px; font-size:12px; }
.seat-name .count { color:#cfe3da; font-size:11px; font-weight:400; margin-left:6px; }
/* 出牌瞬间:出牌人名牌金色脉冲(FLIP 轨迹的起点提示,"谁打的"第二重通道) */
.seat-name.seat-flash, .me-name.seat-flash { animation: seatFlashGlow .7s ease-out; }
@keyframes seatFlashGlow {
  0% { color:#ffe9a8; text-shadow:0 0 3px #ffd968, 0 0 14px rgba(255,217,104,.85); }
  100% { text-shadow:0 1px 2px rgba(0,0,0,.4); }
}
/* 行动中光环(名牌呼吸光 + 整个座位面板淡金底,一眼可辨轮到谁) */
.ai-seat.acting { background: rgba(255,217,104,.06); }
.ai-seat.acting .seat-name, #myInfo.acting .me-name {
  color:#fff; background:rgba(255,217,104,.18);
  box-shadow:0 0 0 1px rgba(255,217,104,.45), 0 0 16px rgba(255,217,104,.35);
  animation: namePulse 1.15s ease-in-out infinite;
}
@keyframes namePulse { 0%,100%{ box-shadow:0 0 0 1px rgba(255,217,104,.45),0 0 12px rgba(255,217,104,.3);} 50%{ box-shadow:0 0 0 1px rgba(255,217,104,.8),0 0 22px rgba(255,217,104,.65);} }
.ai-seat.acting::before { content:''; position:absolute; inset:6px; border-radius:16px; pointer-events:none;
  box-shadow: inset 0 0 26px rgba(255,200,90,.10); }

/* 手牌背面 */
.ai-hand { display:flex; align-items:center; }
.ai-tile-back {
  position:relative; width:17px; height:27px; border-radius:4px;
  margin:0 -6px 0 0; flex:0 0 auto;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.22) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.16) 0 1px, transparent 1.6px),
    linear-gradient(140deg, #4c8a6d 0%, #245c43 55%, #143b2b 100%);
  border:1px solid #8ba37e; box-shadow: 0 1px 2px rgba(0,0,0,.4), inset 0 0 0 1px rgba(0,0,0,.18);
}
.ai-tile-back::after { content:''; position:absolute; inset:2px; border-radius:2px;
  border:1px solid rgba(255,217,104,.35); }
.ai-tile-back.more { margin-left:4px; border-style:dashed; }
.ai-melds { display:flex; gap:3px; flex-wrap:wrap; justify-content:center; }
.meld-group {
  display:flex; gap:1px; align-items:center;
  background:linear-gradient(rgba(0,0,0,.22), rgba(0,0,0,.12)); padding:2px 3px; border-radius:6px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,.25), 0 1px 0 rgba(255,255,255,.06);
}
.meld-group .tile { margin:0; box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.meld-group .meld-tag {
  font-size:8px; color:#ffe9a8; writing-mode:vertical-lr; letter-spacing:1px;
  background:rgba(255,200,90,.12); border-radius:3px; padding:1px;
}
/* 动效辅助类(由 JS 短暂添加) */
.ai-seat.bump { animation: seatBump .5s ease; }
@keyframes seatBump { 0%{transform:scale(1)} 30%{transform:scale(1.04)} 100%{transform:scale(1)} }

/* ---------------- 麻将牌(鎏金面) ---------------- */
.tile {
  position: relative; width:44px; height:62px; border-radius:8px; margin:2px;
  flex: 0 0 auto;
  display:inline-flex; flex-direction:column; align-items:center; justify-content:center;
  font-weight:800; cursor:default;
  background:
    linear-gradient(166deg, rgba(255,255,255,.9) 0%, rgba(255,255,255,0) 34%),
    linear-gradient(180deg, #fffef5 0%, #fdf8e6 46%, #f1e7cb 100%);
  border:1px solid #a89d7c;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 -8px 10px -8px rgba(126,96,34,.6),
    0 2px 4px rgba(0,0,0,.4);
}
/* 金丝内框 + 釉面高光 */
.tile::before {
  content:''; position:absolute; inset:3px; border-radius:5px; pointer-events:none;
  border:1px solid rgba(168,138,72,.42);
  background: linear-gradient(115deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.08) 30%, rgba(255,255,255,0) 60%);
}
/* 牌面图形:SVG 居中自动缩放(100×140 视口) */
.tile svg {
  position: absolute; left: 50%; top: 50%;
  width: calc(100% - 8px); height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
  overflow: visible;
}
.tile svg text.tf {
  font-family: "STKaiti", "KaiTi", "PingFang SC", "Microsoft YaHei", serif;
}
/* 河区"被收走"角标(碰/吃/杠) */
.tile .cmark {
  position: absolute; right: 0; bottom: 0; z-index: 3;
  font-size: 9px; line-height: 1.1; font-weight: 900;
  color: #fff; background: rgba(8, 14, 11, .8);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 3px; padding: 1px 2.5px;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  text-shadow: none;
}
.tile.claimed { opacity: .6; filter: saturate(.72) brightness(.98); }
.tile.claimed .cmark { opacity: 1; filter: none; }
/* 白板(金)牌面 = 常规雕刻样式(双黑框+四角白三角),由 ui.js baiSVG 绘制,
   与其它牌共用白色牌底,无专属材质 */

/* 尺寸档 */
.tile.mini { width:28px; height:39px; border-radius:5px; margin:1px; }
.tile.mini::before { inset:2px; border-radius:3px; }
.tile.mini .cmark { font-size:7.5px; padding:0 1.5px; border-radius:2px; }

.tile.midi { width:35px; height:48px; border-radius:7px; margin:1px; }
.tile.midi::before { inset:2.5px; border-radius:4px; }
.tile.midi .cmark { font-size:10px; }

.tile.small { width:40px; height:55px; border-radius:8px; }
.tile.small::before { inset:3px; border-radius:5px; }
.tile.small .cmark { font-size:11px; }

/* 我的手牌:大号档(主视区,更清晰易读) */
.tile.hand { width:62px; height:87px; border-radius:10px; margin:2px 3px; }
.tile.hand::before { inset:5px; border-radius:7px; }
.tile.hand .cmark { font-size:12px; }

.tile.micro { width:30px; height:42px; border-radius:6px; margin:1px; }
.tile.micro::before { inset:2px; border-radius:3.5px; }
.tile.micro .cmark { font-size:9px; }

.tile.dim { opacity:.5; filter:saturate(.75); }
.tile.discarded { opacity:.85; }

/* 暗杠/金杠:对手亮组中的扣牌(背面朝上,不露牌面;仅"暗杠/金杠"文字标签) */
.tile.facedown {
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.22) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.16) 0 1px, transparent 1.6px),
    linear-gradient(140deg, #4c8a6d 0%, #245c43 55%, #143b2b 100%);
  border-color: rgba(216,176,79,.45);
}
.tile.facedown::before { display:none; }

/* 互动态 */
.tile.selectable { cursor:pointer; }
.tile.selectable:hover {
  transform: translateY(-9px) scale(1.05);
  box-shadow: 0 0 0 2px rgba(255,217,104,.65), 0 10px 16px rgba(0,0,0,.4);
  transition: transform .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
  z-index:4;
}
.tile.selected {
  transform: translateY(-14px) scale(1.06);
  box-shadow: 0 0 0 3px #ffd968, 0 0 22px rgba(255,217,104,.8), 0 12px 14px rgba(0,0,0,.42);
  z-index:5;
}
.tile.fresh { animation: tileFresh .6s cubic-bezier(.2,.9,.3,1.4); }
@keyframes tileFresh {
  0% { transform: translateY(-26px) scale(.7); opacity:.1; }
  55% { transform: translateY(3px) scale(1.03); opacity:1; }
  100% { transform:none; }
}
.tile.fresh { box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -8px 10px -8px rgba(126,96,34,.6),
  0 0 0 2px #7ef0b2, 0 0 16px rgba(126,240,178,.55), 0 2px 4px rgba(0,0,0,.4); }
.tile.forbidden { animation: shake .45s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }

/* 发牌入场(stagger) */
#myHand.dealing > .tile, .ai-seat.dealing .ai-hand .ai-tile-back {
  animation: dealIn .5s cubic-bezier(.2,.85,.3,1.18) both;
}
#myHand.dealing > .tile:nth-child(1),  .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(1)  { animation-delay:.02s; }
#myHand.dealing > .tile:nth-child(2),  .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(2)  { animation-delay:.05s; }
#myHand.dealing > .tile:nth-child(3),  .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(3)  { animation-delay:.08s; }
#myHand.dealing > .tile:nth-child(4),  .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(4)  { animation-delay:.11s; }
#myHand.dealing > .tile:nth-child(5),  .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(5)  { animation-delay:.14s; }
#myHand.dealing > .tile:nth-child(6),  .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(6)  { animation-delay:.17s; }
#myHand.dealing > .tile:nth-child(7),  .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(7)  { animation-delay:.20s; }
#myHand.dealing > .tile:nth-child(8),  .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(8)  { animation-delay:.23s; }
#myHand.dealing > .tile:nth-child(9),  .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(9)  { animation-delay:.26s; }
#myHand.dealing > .tile:nth-child(10), .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(10) { animation-delay:.29s; }
#myHand.dealing > .tile:nth-child(11), .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(11) { animation-delay:.32s; }
#myHand.dealing > .tile:nth-child(12), .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(12) { animation-delay:.35s; }
#myHand.dealing > .tile:nth-child(13), .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(13) { animation-delay:.38s; }
#myHand.dealing > .tile:nth-child(14), .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(14) { animation-delay:.41s; }
#myHand.dealing > .tile:nth-child(15), .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(15) { animation-delay:.44s; }
#myHand.dealing > .tile:nth-child(16), .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(16) { animation-delay:.47s; }
#myHand.dealing > .tile:nth-child(17), .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(17) { animation-delay:.50s; }
#myHand.dealing > .tile:nth-child(18), .ai-seat.dealing .ai-hand .ai-tile-back:nth-child(18) { animation-delay:.53s; }
@keyframes dealIn {
  0% { transform: translateY(70px) scale(.5) rotate(3deg); opacity:0; }
  100% { transform:none; opacity:1; }
}

/* ---------------- 玩家自己(南) ---------------- */
.player-seat {
  position:relative; z-index:5;
  display:flex; flex-direction:column; align-items:center; justify-content:flex-end;
  padding:2px 10px 6px; gap:3px;
  background: linear-gradient(0deg, rgba(0,0,0,.28), transparent 70%);
}
.myinfo { display:flex; align-items:center; gap:12px; font-size:13px; color:#dceadf; text-shadow:0 1px 2px rgba(0,0,0,.4);
  padding:2px 12px; border-radius:12px; }
/* 行动中:整个底部座位区(信息条+亮组+手牌背景)淡金发光,强度对齐 AI 座位大区块 */
.player-seat { transition: background .3s; }
.player-seat.acting {
  background: linear-gradient(0deg, rgba(255,217,104,.20), rgba(255,217,104,.08) 55%, transparent);
}
/* 内发光描边 + 呼吸脉冲,观感对齐 .ai-seat.acting::before */
.player-seat.acting::before {
  content:''; position:absolute; inset:4px; border-radius:16px; pointer-events:none;
  box-shadow: inset 0 0 30px rgba(255,200,90,.25), 0 0 20px rgba(255,217,104,.18);
  animation: seatGlowPulse 1.15s ease-in-out infinite;
}
@keyframes seatGlowPulse {
  0%,100% { box-shadow: inset 0 0 30px rgba(255,200,90,.25), 0 0 20px rgba(255,217,104,.18); }
  50%     { box-shadow: inset 0 0 36px rgba(255,200,90,.42), 0 0 30px rgba(255,217,104,.35); }
}
/* 信息条胶囊仍保留呼吸光晕,与名牌高亮叠加 */
#myInfo.acting {
  background:rgba(255,217,104,.10);
  animation: namePulse 1.15s ease-in-out infinite;
}
.myinfo .me-name { font-size:17px; font-weight:800; color:#ffd968; padding:0 8px; border-radius:11px; letter-spacing:1px; }
#myMelds { display:flex; gap:4px; min-height:64px; align-items:flex-end; flex-wrap:wrap; justify-content:center; max-width:1100px; }
#myHand {
  position: relative;   /* 出牌浮条 #floatDiscard 的定位基准 */
  display:flex; align-items:flex-end; justify-content:center; flex-wrap:wrap;
  min-height:104px; max-width:1100px; padding-top:12px;
}
/* 自摸刚摸进的新牌:抽到最右 + 绿色光圈持续脉动,一眼可见 */
.tile.hand.justdrawn { margin-left:16px; }
.tile.hand.justdrawn.fresh {
  animation: tileFresh .6s cubic-bezier(.2,.9,.3,1.4), justPulse 1.15s ease-in-out .55s infinite;
}
/* 刚摸的牌"新"印章角标:悬浮在牌右上角(一半悬于牌外,几乎不遮牌面),
   朱红圆印+金边+微旋转,像盖了个小图章;牌面上方是空桌面,不会被裁剪 */
.tile.fresh { position: relative; }
.tile.fresh::after {
  content: '新';
  position: absolute; top: -8px; right: -6px; z-index: 3;
  width: 19px; height: 19px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #ff8a68, #e04a2e 55%, #b02a15);
  color: #fff8ee; font-weight: 800; font-size: 11px; line-height: 19px; text-align: center;
  font-family: 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  box-shadow: 0 2px 6px rgba(0,0,0,.5), inset 0 1px 1px rgba(255,255,255,.55);
  border: 1.5px solid #ffe1a6;
  transform: rotate(-12deg);
  pointer-events: none;
  animation: stampIn .35s cubic-bezier(.2,1.2,.4,1.3) .25s both;
}
@keyframes stampIn {
  0% { transform: rotate(-12deg) scale(2.1); opacity: 0; }
  100% { transform: rotate(-12deg) scale(1); opacity: 1; }
}
@keyframes justPulse {
  0%,100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -8px 10px -8px rgba(126,96,34,.6),
    0 0 0 3px #7ef0b2, 0 0 16px rgba(126,240,178,.6), 0 2px 4px rgba(0,0,0,.4); }
  50% { box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -8px 10px -8px rgba(126,96,34,.6),
    0 0 0 3px #bfffe0, 0 0 30px rgba(126,240,178,1), 0 4px 8px rgba(0,0,0,.45); }
}

/* 出牌浮条:贴近所选牌出现,免去鼠标长途移动(fixed 定位+视口钳制,保证永不超出屏幕) */
#floatDiscard {
  position:fixed; z-index:60; display:flex; align-items:center; gap:8px;
  background:linear-gradient(rgba(11,26,18,.97), rgba(7,18,12,.97));
  padding:6px 10px 6px 12px; border-radius:16px;
  border:1px solid rgba(255,217,104,.7);
  box-shadow: 0 10px 26px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
  animation: fdIn .18s cubic-bezier(.2,.9,.3,1.35);
}
@keyframes fdIn { 0%{ transform:translateY(10px) scale(.8); opacity:0;} 100%{ transform:none; opacity:1;} }
#floatDiscard .fd-label { color:#ffe9a8; font-size:16px; font-weight:800; letter-spacing:1px; }
#floatDiscard .fd-preview { display:flex; }
#floatDiscard .fd-preview .tile { margin:0; }
.fd-btn {
  border:none; border-radius:12px; font-weight:900; cursor:pointer;
  font-size:20px; letter-spacing:2px; padding:8px 18px;
  transition: transform .12s, filter .12s;
}
.fd-btn:hover { filter:brightness(1.15); transform:translateY(-1px); }
.fd-btn:active { transform:translateY(1px) scale(.97); }
.fd-btn.ok {
  background:linear-gradient(180deg,#ffe08a 0%,#f2b63a 60%,#d98a12 100%);
  color:#4a2b00; text-shadow:0 1px 0 rgba(255,255,255,.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 3px 10px rgba(0,0,0,.4);
}
.fd-btn.plain {
  background:linear-gradient(rgba(255,255,255,.14), rgba(255,255,255,.07));
  color:#eaf2ec; border:1px solid rgba(255,255,255,.35);
}
.btn {
  background:linear-gradient(#3f7563, #2a5a49); color:#fff;
  border:1px solid #55917b; border-radius:9px; padding:6px 16px; font-size:14px;
  cursor:pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 3px rgba(0,0,0,.3);
  transition: transform .12s, filter .12s;
}
.btn:hover { filter:brightness(1.15); }
.btn:active { transform:translateY(1px); }
.btn.ok { background:linear-gradient(#eec357, #cf9f30); border-color:#f4d47b; color:#33230a; font-weight:800; }
.hidden { display:none !important; }

/* ---------------- 中央顶部行 ---------------- */
#centerTop { height:26px; flex:0 0 26px; display:flex; justify-content:space-between;
  align-items:center; padding:0 16px; position:relative; z-index:6;
  background:linear-gradient(180deg, rgba(0,0,0,.14), transparent); }
#wallInfo { font-size:13px; color:#d8e9df; text-shadow:0 1px 2px rgba(0,0,0,.5); }
#wallInfo b { color:#ffe9a8; }
#turnTip { font-size:13px; color:#d8e9df; text-shadow:0 1px 2px rgba(0,0,0,.6); }
#turnTip .turn-name { color:#ffd968; font-weight:800; }
#turnTip .op { color:#a5f0c6; }
.fx-tip-pop { animation: namePulse 1s ease; }

/* ---------------- 中央舞台:四方位牌河 ---------------- */
#stageDecor {
  position:absolute; left:7%; right:7%; top:3%; bottom:3%; z-index:0; pointer-events:none;
  border-radius: 48% / 40%;
  border:1px solid rgba(216,176,79,.28);
  box-shadow: 0 0 0 7px rgba(216,176,79,.05), inset 0 0 70px rgba(0,0,0,.10);
}
#stageDecor::after { content:''; position:absolute; inset:8px; border-radius:50%/42%;
  border:1px dashed rgba(216,176,79,.14); }

.river { position:absolute; z-index:1; display:flex; gap:1px; pointer-events:none; }
.river-top { top:2px; left:50%; transform:translateX(-50%); flex-wrap:wrap; justify-content:center; max-width:100%; }
.river-bottom { bottom:3px; left:50%; transform:translateX(-50%); flex-wrap:wrap; justify-content:center; max-width:100%; }
.river-left { left:5px; top:47%; transform:translateY(-50%); flex-direction:column; flex-wrap:wrap; align-content:flex-start; max-height:92%; max-width:180px; }
.river-right { right:5px; top:47%; transform:translateY(-50%); flex-direction:column; flex-wrap:wrap; align-content:flex-end; max-height:92%; max-width:180px; }

.river-chip {
  align-self:center; font-size:10px; font-weight:800; color:#fff8dd; letter-spacing:1px;
  background:rgba(10,26,19,.55); border:1px solid rgba(255,217,104,.4);
  padding:1px 6px; border-radius:9px; line-height:14px;
}
.river-left .river-chip, .river-right .river-chip { writing-mode:vertical-lr; letter-spacing:2px; align-self:flex-start; margin:0 1px 2px 0; }

/* 最新一张刚落入河:轻微弹跳 */
.river .tile.newest { animation: riverIn .38s cubic-bezier(.2,.9,.3,1.35); }
@keyframes riverIn { 0%{ transform: translateY(-20px) scale(.8); opacity:.2;} 60%{ transform: translateY(2px) scale(1.04);} 100%{ transform:none; opacity:1;} }

/* ---------------- 中央操作台 ---------------- */
/* 中央最新出牌永远锚定 stage 正中心;听牌/按钮/日志从中心向下排,不再把牌顶偏
   (嵌入小尺寸 iframe 与全屏下视觉一致) */
#midStage {
  position:absolute; left:15%; right:15%; top:50%; bottom:4px; transform:none;
  /* 只剩中央大图与听牌提示(操作按钮已并入 #seat0,见下方 actionBar 注释)。
     本体 pointer-events:none,只有内部真实元素可点,不会误拦手牌点击 */
  z-index:6; display:flex; flex-direction:column; align-items:center; gap:5px;
  padding-top:53px;   /* 给居中的出牌让位:半张牌高 48 + 间距 5 */
  pointer-events:none;
}
#midStage > * { pointer-events:auto; }

#lastDiscardWrap {
  position:absolute; top:0; left:50%; transform:translate(-50%,-50%);
  display:flex; align-items:center; gap:8px; min-height:96px;
  padding:4px 14px; border-radius:14px;
  background:radial-gradient(ellipse at center, rgba(0,0,0,.10), transparent 68%);
}
#lastDiscardTag { writing-mode:vertical-lr; letter-spacing:3px; font-size:11px; color:#ffe9a8;
  text-shadow:0 1px 2px rgba(0,0,0,.6); }
#lastDiscard { position:relative; min-width:70px; min-height:96px; display:flex;
  align-items:center; justify-content:center; }
#lastDiscard .tile {
  width:64px; height:88px; border-radius:11px; margin:0;
  animation: bigPulse 2.2s ease-in-out 0.4s infinite;
}
/* 非飞行路径的入场弹入(如中途刷新页面补渲染);出牌走 FLIP 飞行不加此类 */
#lastDiscard .tile.pop {
  animation: bigTileIn .3s cubic-bezier(.2,.9,.3,1.3), bigPulse 2.2s ease-in-out 0.4s infinite;
}
/* FLIP 飞行中:压掉呼吸动画,抬高投影让它"浮"在牌桌上空 */
#lastDiscard .tile.fx-flip {
  animation:none; z-index:70; will-change:transform;
  box-shadow: 0 10px 26px rgba(0,0,0,.55);
}
#lastDiscard .tile .num { font-size:36px; }
#lastDiscard .tile .suit { font-size:17px; }
#lastDiscard .tile::before { inset:5px; border-radius:7px; }
@keyframes bigTileIn { 0%{ transform:scale(1.6); opacity:0; } 100%{ transform:scale(1); opacity:1; } }
@keyframes bigPulse { 0%,100%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -10px 12px -8px rgba(126,96,34,.6), 0 0 0 2px rgba(255,217,104,.4), 0 4px 14px rgba(0,0,0,.5);} 50%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.95), inset 0 -10px 12px -8px rgba(126,96,34,.6), 0 0 0 2px rgba(255,217,104,.85), 0 0 30px rgba(255,200,90,.55), 0 4px 14px rgba(0,0,0,.5);} }

#tingTip { font-size:13px; color:#a5f0c9; background:rgba(0,0,0,.28); padding:3px 14px;
  border-radius:12px; min-height:24px; border:1px solid rgba(165,240,201,.18);
  text-shadow:0 1px 2px rgba(0,0,0,.4); }
#tingTip b { color:#ffd968; }

/* ---------------- 操作按钮区(悬浮在 #seat0 上沿之外,不占文档流) ---------------- */
/* 绝对定位锚在座位区上沿:按钮出现/消失时中央区、名字、亮组、手牌几何完全不动,
   椭圆桌不再被压缩(此前按钮行走文档流,self 行 auto 长高会挤掉中央区 ~82px)。
   悬浮期间只盖住椭圆下缘与我方牌河最下一两张,claim 窗口瞬态,可接受 */
#actionBar {
  position:absolute; bottom:100%; left:12%; right:12%; z-index:2;
  display:flex; flex-direction:column; align-items:center; gap:6px;
}
#actBtns {
  display:flex; gap:12px; align-items:center; justify-content:center;
  flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; max-width:100%;
  /* 滚动容器会裁掉纵向溢出(单轴 auto 强制另一轴也 auto):
     上下内边距给 hover 抬升与出场白圈留绘制空间 */
  padding:12px 8px;
}
#actBtns::-webkit-scrollbar { display:none; }
.bigbtn {
  font-size:23px; font-weight:900; padding:11px 26px; border-radius:16px; border:none;
  cursor:pointer; letter-spacing:3px; position:relative; white-space:nowrap; flex:0 0 auto;
  color:#fff; text-shadow:0 2px 3px rgba(0,0,0,.45);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 14px rgba(0,0,0,.45);
  transition: transform .16s cubic-bezier(.34,1.56,.64,1), filter .15s, box-shadow .2s;
  animation: btnIn .34s cubic-bezier(.2,.9,.3,1.4) backwards;
}
@keyframes btnIn { 0%{ transform:scale(.6); opacity:0;} 100%{ transform:scale(1); opacity:1;} }
/* 出场:一圈白光由按钮中心向外扩散 */
.bigbtn::before {
  content:''; position:absolute; left:50%; top:50%; width:74px; height:74px;
  margin:-37px 0 0 -37px; border-radius:50%;
  border:3px solid rgba(255,255,255,.9); opacity:0; pointer-events:none;
  animation: btnRing .85s ease-out .12s 1;
}
@keyframes btnRing { 0%{ transform:scale(.3); opacity:.95;} 100%{ transform:scale(2.05); opacity:0;} }
/* 出场:高光带横扫(之后每 3.4s 轻轻掠过一次) */
.bigbtn::after {
  content:''; position:absolute; top:-35%; bottom:-35%; width:36%; left:-80%;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  transform:skewX(-20deg); pointer-events:none;
  animation: btnSweep 1.15s ease-out .35s 1, btnSweep 3.4s ease-out 3.8s infinite;
}
@keyframes btnSweep { 0%{ left:-80%; } 100%{ left:135%; } }
/* hover 不做 scale:滚动容器(#actBtns overflow-x:auto)会裁掉放大溢出,
   改用抬升+亮度+阴影,观感反馈足够且任何情况下不被裁 */
.bigbtn:hover { filter:brightness(1.14) saturate(1.08); transform:translateY(-3px); }
.bigbtn:active { transform:translateY(1px); filter:brightness(1.05); }

/* 胡:特大金色(自摸胡 / 点炮胡共用) */
.bigbtn.hu {
  font-size:29px; letter-spacing:2px; padding:12px 30px; border-radius:20px;
  background:linear-gradient(180deg,#ffe08a 0%,#f5b93c 55%,#e08a12 100%);
  color:#4a2b00; text-shadow:0 1px 0 rgba(255,255,255,.45);
  animation: btnIn .34s cubic-bezier(.2,.9,.3,1.4) backwards, huGlow 1.35s ease-in-out .45s infinite;
}
.bigbtn.hu::before { width:110px; height:110px; margin:-55px 0 0 -55px; }
@keyframes huGlow { 0%,100%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 10px rgba(255,190,60,.6), 0 6px 14px rgba(0,0,0,.45);} 50%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 0 30px rgba(255,205,80,1), 0 0 54px rgba(255,180,50,.6), 0 6px 16px rgba(0,0,0,.5);} }

/* 碰:翡翠绿 */
.bigbtn.peng, .bigbtn.act {
  font-size:25px; padding:11px 28px;
  background:linear-gradient(180deg,#7fe6b2 0%,#3fb27d 60%,#1f7e52 100%);
  color:#eafff3; text-shadow:0 2px 3px rgba(0,50,25,.55);
  animation: btnIn .34s cubic-bezier(.2,.9,.3,1.4) backwards, glowPeng 1.7s ease-in-out .5s infinite;
}
@keyframes glowPeng { 0%,100%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 10px rgba(90,235,165,.55), 0 6px 14px rgba(0,0,0,.45);} 50%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 0 28px rgba(90,235,165,1), 0 0 46px rgba(90,235,165,.5), 0 6px 16px rgba(0,0,0,.5);} }

/* 杠:琥珀橙 */
.bigbtn.gang {
  font-size:25px; padding:11px 28px;
  background:linear-gradient(180deg,#ffc07a 0%,#f5923a 60%,#c96612 100%);
  color:#fff6ec; text-shadow:0 2px 3px rgba(120,50,0,.55);
  animation: btnIn .34s cubic-bezier(.2,.9,.3,1.4) backwards, glowGang 1.7s ease-in-out .5s infinite;
}
@keyframes glowGang { 0%,100%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 10px rgba(255,170,80,.6), 0 6px 14px rgba(0,0,0,.45);} 50%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 0 30px rgba(255,170,80,1), 0 0 50px rgba(255,140,50,.55), 0 6px 16px rgba(0,0,0,.5);} }

/* 吃按钮(候选卡内) 备用样式:雾蓝 */
.bigbtn.chi {
  font-size:25px; padding:11px 28px;
  background:linear-gradient(180deg,#9dbcf2 0%,#5b7fd0 60%,#3a57a8 100%);
  color:#fff; text-shadow:0 1px 2px rgba(0,0,20,.4);
  animation: btnIn .34s cubic-bezier(.2,.9,.3,1.4) backwards, glowChi 1.7s ease-in-out .5s infinite;
}
@keyframes glowChi { 0%,100%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 10px rgba(130,175,255,.6), 0 6px 14px rgba(0,0,0,.45);} 50%{ box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 0 30px rgba(130,175,255,1), 0 6px 16px rgba(0,0,0,.5);} }

/* 过:同排最右,字号与吃碰接近,但用低调玻璃质感不抢主操作 */
.bigbtn.pass {
  font-size:23px; letter-spacing:3px; padding:11px 24px; border-radius:16px;
  background:linear-gradient(rgba(230,240,233,.16), rgba(230,240,233,.07)); color:#eef5f0;
  border:1px solid rgba(255,255,255,.4);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 5px 10px rgba(0,0,0,.4);
  animation: btnIn .34s cubic-bezier(.2,.9,.3,1.4) backwards;
}
.bigbtn.pass::before, .bigbtn.pass::after { display:none; }
.bigbtn.pass:hover { filter:brightness(1.4); border-color:rgba(255,255,255,.75); }
.bigbtn:disabled { opacity:.45; cursor:not-allowed; filter:grayscale(.6); animation:none; transform:none; }

/* 吃牌候选卡:并入动作行,卡身(候选牌+吃钮)紧凑醒目 */
.chi-card { display:flex; align-items:center; gap:6px;
  background:linear-gradient(rgba(18,34,26,.92), rgba(10,22,16,.94));
  padding:5px 8px 5px 10px; border-radius:14px; border:1px solid rgba(140,180,255,.5);
  box-shadow: 0 4px 12px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.08);
  animation: btnIn .3s cubic-bezier(.2,.9,.3,1.35) backwards; flex:0 0 auto; }
.chi-card .tile { margin:1px 2px; }
.chi-card .btn {
  font-size:23px; font-weight:900; padding:8px 18px; border-radius:14px; letter-spacing:2px;
  background:linear-gradient(180deg,#9dbcf2 0%,#5b7fd0 60%,#3a57a8 100%);
  color:#fff; border-color:#7f9fe0; text-shadow:0 1px 2px rgba(0,0,20,.4);
  animation: glowChi 1.6s ease-in-out .3s infinite;
}
.chi-card .btn:hover { filter:brightness(1.16); }

/* ---------------- 结算 ---------------- */
.overlay {
  position: fixed; inset: 0; z-index:50;
  background: rgba(4,12,8,.66);
  backdrop-filter: blur(2px);
  display:flex; align-items:center; justify-content:center;
  animation: ovIn .25s ease;
}
@keyframes ovIn { 0%{opacity:0} 100%{opacity:1} }
.result-card {
  width:660px; max-width:94vw; max-height:88vh; overflow:auto;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255,217,104,.14), transparent 60%),
    linear-gradient(#265c4a, #173f32);
  border:1px solid rgba(255,217,104,.6); outline:1px solid rgba(0,0,0,.4); outline-offset:2px;
  border-radius:20px; padding:22px 28px;
  box-shadow: 0 18px 60px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.1);
  animation: cardIn .34s cubic-bezier(.2,.9,.3,1.25);
}
@keyframes cardIn { 0%{ transform:scale(.72) translateY(30px); opacity:0;} 100%{ transform:none; opacity:1;} }
.result-title { text-align:center; font-size:25px; font-weight:900; color:#ffd968;
  letter-spacing:6px; text-shadow:0 2px 0 rgba(90,50,0,.4), 0 0 18px rgba(255,200,80,.3); }
.result-title liuju { color:#cfd8d3; text-shadow:none; }
.result-fan { text-align:center; font-size:44px; font-weight:900; margin:8px 0 4px;
  background:linear-gradient(180deg,#fff8da,#ffd968 55%,#ff9a3d);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 2px 1px rgba(90,50,0,.5)) drop-shadow(0 6px 16px rgba(255,170,60,.35));
}
.result-fan small { font-size:15px; color:#ffe9a8; -webkit-text-fill-color:#ffe9a8; font-weight:400; }
.result-hand { display:flex; flex-wrap:wrap; gap:6px; justify-content:center; margin:12px 0;
  background:rgba(0,0,0,.18); padding:10px; border-radius:12px; }
.result-hand .meld-group { background:rgba(0,0,0,.25); }
.result-detail { text-align:center; font-size:13px; color:#d5e6dd; margin-bottom:5px; }
.result-detail b { color:#ffd968; }
.result-scores { border-collapse:collapse; width:100%; margin:10px 0; font-size:14px; }
.result-scores th, .result-scores td { padding:7px 9px; border-bottom:1px solid rgba(255,255,255,.1); text-align:center; }
.result-scores th { color:#ffe9a8; font-weight:600; letter-spacing:1px; }
.result-scores .win { color:#7ff0b0; font-weight:800; }
.result-scores .lose { color:#ff9d9d; }
.result-btns { display:flex; justify-content:center; gap:14px; margin-top:14px; }
.result-btns .btn { font-size:16px; padding:9px 26px; }

.toast {
  position: fixed; top:58px; left:50%; transform:translateX(-50%);
  z-index:60; background:linear-gradient(rgba(24,38,30,.95), rgba(14,26,20,.95));
  color:#ffe9a8; border:1px solid rgba(255,217,104,.55);
  padding:9px 22px; border-radius:24px; font-size:15px; letter-spacing:1px;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
  animation: toastIn .3s cubic-bezier(.2,.9,.3,1.3);
}
@keyframes toastIn { 0%{ transform:translate(-50%,-12px) scale(.8); opacity:0;} 100%{ transform:translate(-50%,0) scale(1);} }

/* ============================================================
 * FX 特效层
 * ============================================================ */
#fx-layer { position:fixed; inset:0; z-index:45; pointer-events:none; overflow:hidden; }
.fx-fly { margin:0 !important; border-radius:8px; pointer-events:none;
  box-shadow: 0 10px 26px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.6);
  opacity:1; }
.fx-fly.fx-shadow::after { content:''; position:absolute; inset:0; border-radius:8px;
  background:radial-gradient(ellipse at 50% 120%, rgba(255,200,90,.35), transparent 60%); }
.fx-dot { position:fixed; border-radius:50%; pointer-events:none;
  box-shadow:0 0 12px rgba(255,217,104,.9); }
.fx-ring { position:fixed; border-radius:50%; pointer-events:none;
  animation: fxRing .5s ease-out forwards; }
@keyframes fxRing { 0%{ transform:scale(.3); opacity:1;} 100%{ transform:scale(1.9); opacity:0;} }
.fx-part { position:fixed; border-radius:50%; pointer-events:none; z-index:46; }
.fx-flash { position:fixed; inset:0; pointer-events:none; }

#table.fx-shake { animation: fxShake .5s linear; }
@keyframes fxShake {
  0%,100% { transform:translate(0,0); }
  15% { transform:translate(calc(-1 * var(--shk,5px)), 0); }
  30% { transform:translate(var(--shk,5px), -2px); }
  45% { transform:translate(calc(-1 * var(--shk,5px)), 2px); }
  60% { transform:translate(var(--shk,5px), 0); }
  75% { transform:translate(calc(-0.6 * var(--shk,5px)), 0); }
  90% { transform:translate(calc(0.4 * var(--shk,5px)), 0); }
}
.fx-seat-glow { animation: seatGlow 2.4s ease; }
@keyframes seatGlow { 0%{ } 15%{ outline:3px solid rgba(255,217,104,.85); outline-offset:2px; border-radius:18px;
    filter: drop-shadow(0 0 22px rgba(255,200,90,.8));} 70%{ outline:3px solid rgba(255,217,104,.3); filter:none; } 100%{ outline:3px solid transparent; } }

.fx-word { position:fixed; font-weight:900; letter-spacing:5px; text-align:center;
  transform:translate(-50%,-50%); z-index:47; opacity:0; pointer-events:none;
  white-space:nowrap;
}
.fx-word-center { left:50%; top:42%; }
.fx-word-big { font-size:64px; }
.fx-word-go { animation: fxWordIn .14s ease-out forwards, fxWordFloat 1s .5s ease-out forwards; }
@keyframes fxWordIn { 0%{ transform:translate(-50%,-50%) scale(2.4); opacity:0;} 100%{ transform:translate(-50%,-50%) scale(1); opacity:1;} }
@keyframes fxWordFloat { 0%{ transform:translate(-50%,-50%) scale(1); opacity:1;} 100%{ transform:translate(-50%,-60%) scale(1.12); opacity:0;} }

.fx-c-peng { color:#ffd968; text-shadow:0 2px 0 rgba(90,60,0,.45), 0 0 30px rgba(255,200,90,.9); }
.fx-c-chi  { color:#a9c9ff; text-shadow:0 2px 0 rgba(20,40,90,.45), 0 0 30px rgba(130,170,255,.9); }
.fx-c-gang { color:#ffb35c; text-shadow:0 2px 0 rgba(90,45,0,.5), 0 0 34px rgba(255,150,50,.95); }
.fx-win {
  background:linear-gradient(180deg,#fffbe0 0%,#ffd968 45%,#ff8f3d 100%);
  -webkit-background-clip:text; background-clip:text; -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 3px 1px rgba(120,60,0,.55)) drop-shadow(0 10px 30px rgba(255,160,50,.7));
  font-size:84px;
}
.fx-win-ultra { font-size:106px; letter-spacing:8px; }
.fx-sub { color:#ffffff; font-size:30px; text-shadow:0 2px 0 rgba(0,0,0,.5), 0 0 24px rgba(255,255,255,.8); }
.fx-liuju { color:#cfd8d3; font-size:34px; text-shadow:0 2px 6px rgba(0,0,0,.5); }

/* 屏幕较窄时缩放 */
@media (max-width: 1180px) {
  #table { grid-template-columns: 148px minmax(0,1fr) 148px; grid-template-rows: 104px minmax(0,1fr) auto; }
  .tile { width:40px; height:57px; }
  .tile.hand { width:54px; height:76px; }
  .tile.midi { width:31px; height:43px; }
  .tile.small { width:35px; height:49px; }
  .tile.micro { width:27px; height:38px; }
  .tile.mini { width:25px; height:35px; }
  .ai-tile-back { width:15px; height:23px; margin-right:-5px; }
  #lastDiscard .tile { width:58px; height:80px; }
  .bigbtn { font-size:19px; padding:9px 20px; }
  .bigbtn.hu { font-size:24px; padding:10px 24px; }
  .bigbtn.peng, .bigbtn.gang, .bigbtn.chi, .bigbtn.act { font-size:21px; padding:9px 22px; }
  .bigbtn.pass { font-size:19px; padding:9px 18px; }
  .chi-card .btn { font-size:19px; padding:7px 14px; }
  .river-left, .river-right { max-width:150px; }
  .result-card { width:600px; }
}
@media (max-width: 920px) {
  #table { grid-template-columns: 108px minmax(0,1fr) 108px; }
  #topbar .brand .sub { display:none; }
  #midStage { left:6%; right:6%; }
}
/* 手机竖屏:桌面栅格再收窄,手牌降到"两行放得下"的档位。
   牌面是 SVG(width:100%),缩牌尺寸会等比缩放,只需同步覆盖 px 写死的金/角标字号。 */
@media (max-width: 760px) {
  #topbar { height:auto; flex:0 0 auto; min-height:48px; flex-wrap:wrap; row-gap:4px; padding:5px 10px; }
  .online-room-bar { flex-wrap:wrap; row-gap:4px; }
}
@media (max-width: 560px) {
  #topbar { padding:5px 8px; }
  #topbar .brand { font-size:12px; }
  #topbar .brand b { font-size:16px; letter-spacing:1px; }
  #topbar .tools { gap:5px; }
  #topbar .tb { padding:5px 9px; font-size:12px; }
  .roundinfo { font-size:11px; }
  /* 侧栏座位收窄,中央牌河区留出更多空间 */
  #table { grid-template-columns: 62px minmax(0,1fr) 62px; grid-template-rows: 78px minmax(0,1fr) auto; }
  .ai-seat { padding:4px; gap:3px; }
  .seat-name { font-size:12px; padding:0 5px; }
  .seat-name .count { font-size:10px; margin-left:3px; }
  .ai-tile-back { width:11px; height:17px; margin-right:-6px; }
  /* 手牌:40px 宽可在 340px 内容宽里一行放 7 张 → 13/14 张稳定两行 */
  #myMelds { gap:3px; min-height:46px; }
  #myHand { min-height:74px; padding-top:8px; }
  .tile.hand { width:40px; height:56px; border-radius:7px; margin:2px; }
  .tile.hand::before { inset:3px; border-radius:5px; }
  .tile.hand .cmark { font-size:9px; padding:0 2px; }
  .tile.hand.justdrawn { margin-left:10px; }
  #myInfo { padding:0 8px 4px; }
  .myinfo { font-size:11px; gap:8px; }
  .myinfo .me-name { font-size:14px; padding:0 6px; }
}
/* 平台联机工具栏与牌桌闲聊，不改变规则或牌面 */
.online-room-bar{display:flex;align-items:center;gap:6px;flex-wrap:nowrap;margin-left:auto;min-width:0}.online-room-bar span{font-size:11px;color:#9fc8b8;white-space:nowrap}.online-room-bar b{padding:4px 8px;border:1px solid #b99545;border-radius:6px;color:#ffd968;font:700 11px monospace;letter-spacing:1px}.online-room-bar input{width:70px;min-width:0;flex-shrink:1;height:28px;border:1px solid #477763;border-radius:6px;background:#10382c;color:#fff;padding:0 7px;font-size:11px}.online-room-bar .tb{height:28px;padding:4px 9px;font-size:11px}.online-chat{position:fixed;right:14px;bottom:14px;width:225px;max-height:195px;display:flex;flex-direction:column;border:1px solid #c9a34f;border-radius:9px;background:#123d30ee;box-shadow:0 8px 25px #0006;z-index:20}.online-chat-head{display:flex;justify-content:space-between;padding:8px 10px;border-bottom:1px solid #3a6b59;color:#ffd968;font-size:11px}.online-chat-head span{color:#b6d0c3;font:11px monospace}.online-chat-messages{max-height:125px;min-height:55px;overflow:auto;padding:7px 9px}.online-chat-msg{display:flex;gap:6px;margin:4px 0;font-size:10px;line-height:1.45}.online-chat-msg b{color:#ffd968;white-space:nowrap}.online-chat-msg span{color:#e2eee8;word-break:break-word}.online-chat-empty{padding:16px 4px;text-align:center;color:#9fc8b8;font-size:10px}.online-chat form{display:flex;gap:5px;padding:7px;border-top:1px solid #3a6b59}.online-chat input{min-width:0;flex:1;height:27px;border:1px solid #477763;border-radius:6px;background:#0d3328;color:#fff;padding:0 7px;font-size:10px}.online-chat .tb{height:27px;padding:3px 8px;font-size:10px}.online-modal{position:fixed;inset:0;background:#0f1e2d52;backdrop-filter:blur(3px);display:grid;place-items:center;z-index:50}.online-modal-card{width:min(360px,92%);background:#10382c;border:1px solid #477763;border-radius:14px;padding:18px 18px 14px;color:#d8efe7;box-shadow:0 30px 60px #000a}.online-modal-card h4{margin:0 0 6px;font-size:15px;color:#ffd968}.online-modal-card p{margin:0 0 14px;font-size:12px;line-height:1.65;color:#bcd6cb}.online-modal-actions{display:flex;justify-content:flex-end;gap:8px}@media(max-width:760px){.online-room-bar{width:100%;margin:4px 0 0}.online-chat{width:200px}.online-chat-messages{max-height:90px}}
/* 房间号可点击复制 + 房间条渐进显示 */
.online-room-bar b{cursor:pointer;transition:.15s}
.online-room-bar b:hover{background:#ffd96815;border-color:#ffd968}
.online-room-bar .tb:disabled{opacity:.5;cursor:not-allowed}
.online-room-bar .tb.active{background:#ffd968;border-color:#ffd968;color:#10382c}
/* 闲聊框拖动态:fixed 定位跟随拖动,窗口缩放时钳回屏内 */
#onlineChat .online-chat-head{cursor:move;user-select:none;touch-action:none}
#onlineChat.dragged{position:fixed;right:auto;bottom:auto;z-index:40}
#onlineChat.dragging{opacity:.85;box-shadow:0 14px 40px #000a}
