/* ===================== 双扣 · 界面样式 ===================== */
:root {
  --felt-1: #14624a;
  --felt-2: #0a3427;
  --gold: #e8b53f;
  --ink: #1b1b1b;
  --red: #c1272d;
  --cw: clamp(34px, 3.5vw, 52px);
  --ch: calc(var(--cw) * 1.4);
  --mw: calc(var(--cw) * 0.62);
  --mh: calc(var(--mw) * 1.4);
  --shadow: 0 2px 0 rgba(0, 0, 0, .35), 0 6px 14px rgba(0, 0, 0, .18);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: #f2f7f4; background: #07211a;
}
.app {
  height: 100dvh; height: 100vh;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) 10px;
  background: radial-gradient(120% 90% at 50% 0%, #1a7457 0%, var(--felt-1) 40%, var(--felt-2) 100%);
}
/* 窄屏：允许 grid 列收缩到屏幕宽度以内（否则整页会被撑到 1360，手机上看不全） */
.app { grid-template-columns: minmax(0, 1fr); }
.app > * { min-width: 0; }
/* 超宽屏：内容收窄居中，别把「出牌/不要」甩到屏幕最右边 */
.app > .topbar, .app > .playzone, .app > .handzone, .app > .chat, .app > .logbar {
  width: 100%; max-width: 1360px; margin-left: auto; margin-right: auto;
}
/* 顶栏 */
.topbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 10px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(0, 0, 0, .18));
  border: 1px solid rgba(255, 255, 255, .14);
}
.brand { display: flex; align-items: center; gap: 9px; }
.logo {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px;
  background: linear-gradient(160deg, #f6d472, #d99b22); color: #4a2c0c; font-weight: 800; font-size: 19px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; letter-spacing: .5px; }
.brand-text small { font-size: 11px; opacity: .72; }
.stats { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.stat {
  font-size: 12px; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .12);
}
.tools { display: flex; gap: 6px; }
.btn {
  font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 10px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .2); color: #fff; box-shadow: var(--shadow);
  background: linear-gradient(180deg, #2b9c74, #1a6d51); transition: transform .08s ease, filter .15s;
}
.btn:active { transform: translateY(1px); }
.btn.ghost { background: rgba(0, 0, 0, .25); font-weight: 500; }
.btn.play { background: linear-gradient(180deg, #f0674f, #c1272d); }
.btn.pass { background: rgba(255, 255, 255, .18); }
.btn.hintbtn { background: linear-gradient(180deg, #f0b53f, #c98a12); color: #3a2405; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* 牌桌 3x3 */
.table {
  width: 100%; max-width: 1200px; margin: 0 auto; min-height: 0; position: relative;
  display: grid; gap: 6px;
  grid-template-columns: minmax(0, .95fr) minmax(0, 2.1fr) minmax(0, .95fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
}
.slot { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 0; overflow: hidden; }
.slot-top { grid-area: 1 / 2 / 2 / 3; align-items: center; }
.slot-left { grid-area: 2 / 1 / 3 / 2; }
.slot-right { grid-area: 2 / 3 / 3 / 4; }
.slot-center { grid-area: 2 / 2 / 3 / 3; }
.slot-bottom { grid-area: 3 / 2 / 4 / 3; align-items: center; }

.pcard {
  display: flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 12px;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .1);
  transition: all .2s ease; align-self: flex-start;
}
.slot-top .pcard, .slot-bottom .pcard { align-self: center; }
.pcard.active { background: rgba(232, 181, 63, .16); border-color: rgba(232, 181, 63, .8); box-shadow: 0 0 16px rgba(232, 181, 63, .22); }
.pcard.out { opacity: .6; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: linear-gradient(160deg, #2f8d6c, #17553f); }
.pcard.active .avatar { background: linear-gradient(160deg, #f6d472, #d99b22); color: #43290a; }
.pname { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.tag-mate { font-size: 10px; padding: 1px 5px; border-radius: 5px; background: rgba(127, 224, 168, .22); color: #9ff0c0; }
.tag-rank { font-size: 10px; padding: 1px 5px; border-radius: 5px; background: var(--gold); color: #40270a; font-weight: 700; }
.pmeta { font-size: 11px; opacity: .78; white-space: nowrap; }
.pmeta b { color: var(--gold); font-weight: 700; }

/* 出牌区 */
.playbox { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; min-height: calc(var(--mh) + 2px); }
.playbox .card + .card { margin-left: calc(var(--mw) * -0.34); }
.playbox .card:first-child { margin-left: 0; }
.slot-top .playbox, .slot-bottom .playbox { justify-content: center; }
.passed-badge {
  font-size: 12px; padding: 3px 10px; border-radius: 999px; color: #ffd8d8;
  background: rgba(193, 39, 45, .28); border: 1px solid rgba(255, 150, 150, .35);
}
.centerbox { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 100%; }
.trickinfo { font-size: 12px; text-align: center; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .12); }
.trickinfo b { color: var(--gold); }
.bombrow { display: flex; gap: 6px; font-size: 11px; opacity: .85; }
.bombrow span { padding: 2px 7px; border-radius: 999px; background: rgba(232, 181, 63, .14); border: 1px solid rgba(232, 181, 63, .35); }

/* 牌面 */
.card {
  position: relative; flex: none; width: var(--cw); height: var(--ch);
  background: linear-gradient(170deg, #fffefb, #f3ecdc);
  border: 1px solid #b6a68a; border-radius: 7px; color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, 0 2px 4px rgba(0, 0, 0, .28);
}
.card .cr { position: absolute; top: 1px; left: 3px; font-size: calc(var(--cw) * .36); font-weight: 800; line-height: 1.05; }
.card .cs { position: absolute; top: calc(var(--cw) * .38); left: 3px; font-size: calc(var(--cw) * .32); line-height: 1; }
.card .big { position: absolute; right: 3px; bottom: 1px; font-size: calc(var(--cw) * .58); opacity: .18; line-height: 1; }
.card.red { color: var(--red); }
.card.joker { display: grid; place-items: center; background: linear-gradient(170deg, #fffdf3, #efe4c8); }
.card.joker .jk { font-size: calc(var(--cw) * .3); font-weight: 800; line-height: 1.1; writing-mode: vertical-rl; letter-spacing: 1px; }
.card.joker.big-joker { color: var(--red); }
.card.joker .jm { position: absolute; bottom: 2px; left: 3px; font-size: calc(var(--cw) * .17); opacity: .45; }
.card.mini { width: var(--mw); height: var(--mh); border-radius: 5px; }
.card.mini .cr { font-size: calc(var(--mw) * .4); top: 0px; left: 1.5px; }
.card.mini .cs { font-size: calc(var(--mw) * .34); top: calc(var(--mw) * .42); left: 1.5px; }
.card.mini .big, .card.mini .jm { display: none; }
.card.mini.joker .jk { font-size: calc(var(--mw) * .34); }
.card.tiny { width: calc(var(--mw) * .8); height: calc(var(--mh) * .8); }
.card.mid { width: calc(var(--cw) * .82); height: calc(var(--ch) * .72); border-radius: 6px; }
.card.mid .cr { font-size: calc(var(--cw) * .34); top: 0; left: 2px; }
.card.mid .cs { font-size: calc(var(--cw) * .30); top: calc(var(--cw) * .36); left: 2px; }
.card.mid .big, .card.mid .jm { display: none; }
.center-play { justify-content: center; margin-top: 3px; }
/* 出牌位：谁出的牌就显示在谁面前 */
.play-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.play-layer .pp { position: absolute; display: flex; align-items: center; gap: 5px; max-width: 46%; }
.play-layer .pp .who { font-size: 11px; color: #d8f5e8; background: rgba(0, 0, 0, .38); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.play-layer .pp .playbox { max-width: 100%; }
.play-layer .p2 { left: 50%; top: 37%; transform: translate(-50%, -50%); }
.play-layer .p0 { left: 50%; top: 78%; transform: translate(-50%, -50%); }
.play-layer .p3 { left: 28%; top: 50%; transform: translate(-50%, -50%); }
.play-layer .p1 { left: 72%; top: 50%; transform: translate(-50%, -50%); }
body.land .play-layer .pp { gap: 4px; max-width: 42%; }
body.land .play-layer .pp .who { font-size: 10px; padding: 0 4px; }
body.land .play-layer .pp .card.mini { width: calc(var(--cw) * .68); height: calc(var(--ch) * .52); }
.hand .card { touch-action: none; }
.card.back { background: repeating-linear-gradient(45deg, #2f8d6c 0 4px, #1d6349 4px 8px); border-color: #164c38; }

/* 手牌 */
.handzone {
  padding: 6px 8px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, .3));
  border: 1px solid rgba(255, 255, 255, .1);
}
.hand {
  display: flex; align-items: flex-end; gap: 0; min-height: calc(var(--ch) + 12px);
  overflow-x: auto; overflow-y: hidden; padding: 10px 2px 2px 2px; scrollbar-width: none;
}
.hand::-webkit-scrollbar { height: 0; }
.hand .card + .card { margin-left: calc(var(--cw) * -0.42); }
.hand .card .big { display: none; }   /* 叠牌时只露出左上角点数与花色 */
.hand .card { cursor: pointer; transition: transform .09s ease, box-shadow .15s ease; }
.hand .card:hover { transform: translateY(-7px); z-index: 5; }
.hand .card.sel { transform: translateY(-12px); z-index: 6; box-shadow: 0 0 0 2px var(--gold), 0 4px 10px rgba(0, 0, 0, .4); }
.hand .card.lead-hint { box-shadow: 0 0 0 2px #7fb2ff; z-index: 4; }

/* 操作区 */
.playzone {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 10px; border-radius: 14px;
  background: rgba(0, 0, 0, .2); border: 1px solid rgba(255, 255, 255, .08);
}
.playinfo { display: flex; flex-direction: column; gap: 2px; flex: 0 1 auto; min-width: 0; }
.hint { font-size: 12.5px; }
.hint.warn { color: #ffb3b3; font-weight: 700; }
.selinfo { font-size: 11.5px; color: var(--gold); }
.controls { display: flex; gap: 8px; flex: none; margin-left: 6px; }
.controls .btn { min-width: 86px; padding: 8px 16px; font-size: 14px; }
.controls .btn.play, .controls .btn.pass { min-width: 100px; font-weight: 700; }

/* 日志 */
.logbar {
  display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 5px 10px; border-radius: 12px;
  background: rgba(0, 0, 0, .22); border: 1px solid rgba(255, 255, 255, .08);
}
.logbar-title { flex: none; opacity: .55; font-size: 11px; }
.log { display: flex; gap: 14px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.log::-webkit-scrollbar { height: 0; }
.log span { opacity: .85; }
.log span.hi { color: var(--gold); opacity: 1; }

/* 弹层 */
.overlay[hidden] { display: none !important; }
.overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(4, 16, 12, .74); }
.sheet {
  width: min(700px, 100%); max-height: min(86vh, 100%); overflow: auto; padding: 18px 20px; border-radius: 18px;
  background: linear-gradient(180deg, #123f31, #0b2b21); border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
}
.sheet h2 { margin: 0 0 4px; font-size: 20px; color: var(--gold); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sheet-head h2 { margin: 0; }
.sheet-head .btn { padding: 6px 14px; font-size: 13px; }
.sheet h3 { margin: 15px 0 6px; font-size: 14px; color: #bff0da; border-left: 3px solid var(--gold); padding-left: 8px; }
.sheet p, .sheet li { font-size: 13px; line-height: 1.65; color: #e2eee8; }
.sheet ul { margin: 4px 0; padding-left: 20px; }
.sheet table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-top: 4px; }
.sheet th, .sheet td { border-bottom: 1px solid rgba(255, 255, 255, .1); padding: 5px 6px; text-align: left; }
.sheet th { color: #9fd9c0; font-weight: 600; }
.sheet td:last-child { text-align: right; color: var(--gold); white-space: nowrap; }
.row-act { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap;
  position: sticky; bottom: 0; z-index: 3; padding: 10px 0 8px; margin-bottom: -10px;
  background: linear-gradient(180deg, rgba(11, 43, 33, 0), rgba(11, 43, 33, .97) 45%); }
.tag { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: rgba(232, 181, 63, .16); border: 1px solid rgba(232, 181, 63, .5); }
.switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; margin-top: 10px; }
.switch select { font: inherit; padding: 3px 6px; border-radius: 8px; background: #0d3a2c; color: #fff; border: 1px solid rgba(255, 255, 255, .25); }
.delta-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 10px; }
.delta-table td { padding: 6px 4px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.delta-table td:last-child { text-align: right; font-weight: 700; }
.delta-table tr.me td { color: var(--gold); }
.up { color: #7fe0a8; } .down { color: #ff9a9a; }

/* 小屏 */
@media (max-width: 720px) {
  :root { --cw: clamp(30px, 8.6vw, 40px); }
  .app { padding: 6px; gap: 4px; }
  .brand-text small { display: none; }
  .stats { order: 3; width: 100%; margin-left: 0; justify-content: space-between; }
  .stat { font-size: 11px; padding: 4px 8px; }
  .table { grid-template-columns: minmax(0, .8fr) minmax(0, 2.4fr) minmax(0, .8fr); gap: 4px; }
  .pcard { padding: 4px 6px; gap: 5px; flex-direction: column; align-items: center; text-align: center; }
  .avatar { width: 22px; height: 22px; font-size: 11px; }
  .pname { font-size: 11px; }
  .pmeta { font-size: 10px; }
  .hand { flex-wrap: nowrap; min-height: 0; overflow-x: visible; }
  .handrow { display: flex; flex-direction: column; gap: 5px; }
  .hand .card + .card { margin-left: calc(var(--cw) * -0.34); }
  .playinfo { flex: 1 1 100%; }
  .controls { flex: 1 1 100%; justify-content: center; margin-left: 0; }
  .controls .btn { min-width: 72px; padding: 8px 14px; font-size: 14px; }
  .controls .btn.play, .controls .btn.pass { min-width: 88px; }
}
@media (max-width: 420px) {
  .brand-text b { font-size: 13.5px; }
  .trickinfo { font-size: 11px; }
}

/* ---------------- 出牌 / 结算 动画 ---------------- */
@keyframes playIn { from { transform: translateY(-22px) scale(.82); opacity: 0; } to { transform: none; opacity: 1; } }
.playbox .card.animin { animation: playIn .24s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes bombFlash { 0% { box-shadow: 0 0 0 0 rgba(232,181,63,.85); background: rgba(232,181,63,.35); } 100% { box-shadow: 0 0 0 30px rgba(232,181,63,0); background: rgba(0,0,0,.3); } }
.trickinfo.flash { animation: bombFlash .75s ease-out; }
@keyframes pulseTurn { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); } 50% { box-shadow: inset 0 0 0 2px rgba(232,181,63,.7); } }
.handzone.await { animation: none; }   /* 不再做明暗呼吸，避免闪烁 */
@keyframes sheetIn { from { transform: translateY(16px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet { animation: sheetIn .2s ease-out both; }
@keyframes cardIn { from { transform: translateY(18px) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.hand .card.newcard { animation: cardIn .3s ease-out both; }
.card.sel { transition: transform .1s ease, box-shadow .15s ease; }

/* ---------------- 聊天 ---------------- */
.chat { display: flex; flex-direction: column; gap: 5px; padding: 6px 8px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px solid rgba(255,255,255,.08); }
.chat[hidden] { display: none !important; }
.chatlist { max-height: 54px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; font-size: 12px; scrollbar-width: thin; }
.chatlist .cm { color: #dff3ea; }
.chatlist .cm b { color: #9fd9c0; font-weight: 600; }
.chatlist .cm.me b { color: var(--gold); }
.chatbox { display: flex; gap: 6px; }
.chatbox input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 12.5px; padding: 6px 10px; border-radius: 9px; background: #0d3a2c; color: #fff; border: 1px solid rgba(255,255,255,.22); }
.chatbox .btn { padding: 6px 12px; font-size: 12.5px; }
.profile { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .9; flex-wrap: wrap; }
.profile input:not([type="checkbox"]) { width: 96px; font: inherit; font-size: 12px; padding: 4px 8px; border-radius: 8px; background: #0d3a2c; color: #fff; border: 1px solid rgba(255,255,255,.22); }
.profile label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.profile input[type="checkbox"] { width: auto; height: auto; margin: 0; accent-color: var(--gold); }


/* 空位接管 / 自动续局 相关样式 */
.tag-ai { font-size: 10px; padding: 1px 5px; border-radius: 5px; background: rgba(232, 181, 63, .18); color: #f0d089; }
.tag-off { font-size: 10px; padding: 1px 5px; border-radius: 5px; background: rgba(255, 154, 154, .2); color: #ffb3b3; }
.seatsum { font-size: 12.5px; opacity: .92; }
.starttip { font-size: 12px; opacity: .78; line-height: 1.6; }
.nextbar { margin-top: 14px; padding: 8px 10px; border-radius: 8px; background: rgba(127, 224, 168, .12); color: #9ff0c0; font-size: 13px; text-align: center; }
/* 结算面板底部操作栏：倒计时 + 按钮一起吸底，横屏也按得到「退出」 */
.actbar { position: sticky; bottom: 0; z-index: 3; margin-top: 12px; padding: 6px 0 6px;
  background: linear-gradient(180deg, rgba(11, 43, 33, 0), rgba(11, 43, 33, .97) 35%); }
.actbar .nextbar { margin-top: 0; }
.actbar .row-act { position: static; background: none; padding: 0; margin: 8px 0 0; }

/* ===== 横屏样式：手机横过来，或点「横屏」强制（JS 加 body.land） ===== */
body.land { --cw: clamp(40px, 5.4vw, 58px); }
body.land .app { padding: 4px 6px calc(4px + env(safe-area-inset-bottom)) 6px; gap: 3px; }
body.land .topbar { padding: 3px 8px; gap: 6px; border-radius: 10px; }
body.land .brand { gap: 6px; }
body.land .logo { width: 26px; height: 26px; font-size: 15px; border-radius: 8px; }
body.land .brand-text b { font-size: 13px; }
body.land .brand-text small { display: none; }
body.land .stat { font-size: 11px; padding: 3px 8px; }
body.land .tools { gap: 4px; }
body.land .tools .btn { font-size: 12px; padding: 4px 9px; }
body.land .table { gap: 4px; }
body.land .pcard { padding: 3px 6px; gap: 4px; }
body.land .avatar { width: 22px; height: 22px; font-size: 11px; }
body.land .pname { font-size: 11px; }
body.land .slot .card.back { display: none; }        /* 横屏不显示牌背，省空间给"剩 N 张" */
body.land .pcard { padding: 2px 5px; gap: 4px; flex-direction: row; align-items: center; text-align: left; }
body.land .avatar { width: 20px; height: 20px; font-size: 10.5px; }
body.land .pmeta { font-size: 10px; opacity: .95; }
body.land .pmeta { font-size: 10.5px; }
body.land .playzone { padding: 4px 8px; border-radius: 10px; gap: 8px; }
body.land .hint { font-size: 13px; }
body.land .selinfo { font-size: 11px; }
body.land .controls { margin-left: 6px; gap: 8px; }
body.land .controls .btn { min-width: 84px; padding: 8px 14px; font-size: 15px; }
body.land .controls .btn.play, .controls .btn.pass { min-width: 104px; }
body.land .handzone { padding: 3px 6px; border-radius: 10px; }
body.land .hand { min-height: calc(var(--ch) + 8px); padding: 8px 2px 2px; }
body.land .playbox .card.mini { width: calc(var(--cw) * .8); height: calc(var(--ch) * .62); }
body.land .chat { padding: 3px 6px; gap: 3px; }
body.land .chatlist { max-height: 34px; font-size: 11.5px; }
body.land .chatbox input, body.land .chatbox .btn { font-size: 11.5px; padding: 4px 8px; }
body.land .logbar { padding: 2px 8px; font-size: 11px; border-radius: 8px; }
body.land .logbar-title { font-size: 10px; }
/* 结算/规则面板：紧凑 + 按钮吸底 */
body.land .sheet { width: min(860px, 100%); max-height: min(94vh, 100%); padding: 10px 14px; border-radius: 14px; }
body.land .sheet h2 { font-size: 17px; }
body.land .sheet h3 { margin: 8px 0 4px; font-size: 12.5px; }
body.land .sheet p, body.land .sheet li { font-size: 12px; line-height: 1.5; }
body.land .sheet table { font-size: 11.5px; margin-top: 2px; }
body.land .sheet th, body.land .sheet td { padding: 3px 5px; }
body.land .nextbar { margin-top: 8px; padding: 6px 10px; font-size: 12px; }
body.land .row-act { margin-top: 8px; gap: 8px; }
body.land .row-act .btn { font-size: 13.5px; padding: 7px 14px; }
body.land .actbar { margin-top: 6px; padding: 4px 0 4px; }
body.land .actbar .row-act { margin-top: 6px; }

/* 浏览器不支持方向锁时：整页转 90°，请把手机横着拿 */
body.force-land { position: fixed; left: 50%; top: 50%; width: var(--vh, 100vh); height: var(--vw, 100vw); margin: 0; overflow: hidden;
  transform: translate(-50%, -50%) rotate(90deg); transform-origin: 50% 50%; }
body.force-land .app { height: 100%; }
body.force-land .overlay { padding: 6px; }
body.force-land .topbar { flex-wrap: nowrap; gap: 6px; }
body.force-land .brand-text small { display: none; }
body.force-land .stats { order: 0; width: auto; margin-left: auto; }
body.force-land .tools { flex: none; }

/* 退出游戏后的界面 */
.bye { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: #07211a; z-index: 99; }
.bye-box { text-align: center; }
.bye-box h2 { color: var(--gold); margin: 0 0 10px; }
.bye-box p { opacity: .8; font-size: 13px; margin-bottom: 14px; }

/* 联机时的常驻退出按钮 */
#btnExitFloat { position: fixed; right: 10px; bottom: 96px; z-index: 40; font-size: 13px; padding: 6px 12px; opacity: .92; }
body.force-land #btnExitFloat { right: 8px; bottom: 90px; }

/* 局末亮牌：四家剩余手牌全部摊开 */
.reveal-hands { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 4px; }
.reveal-row { display: flex; align-items: flex-start; gap: 6px; min-height: calc(var(--mh) + 2px); }
.reveal-row .who { flex: 0 0 46px; font-size: 12px; color: #9fd9c0; padding-top: 6px; }
.reveal-row .cards { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 1px; }
.reveal-row .cards .card + .card { margin-left: calc(var(--mw) * -0.34); }
.reveal-row .none { font-size: 12px; opacity: .55; padding-top: 6px; }
.reveal-row.empty { min-height: 0; }
body.land .reveal-row .who { flex-basis: 40px; font-size: 11px; }
body.land .reveal-row { min-height: calc(var(--mh) + 1px); }
body.land .reveal-row.empty { min-height: 0; }

/* 底部聊天栏不显示（保持桌面清爽） */
.chat, #chatWrap { display: none !important; }
