﻿/* 麻将大厅样式：深绿牌桌 + 金色点缀，移动优先 */
:root {
  --bg: #0b211b;
  --bg-2: #103127;
  --panel: #153a2e;
  --panel-2: #1b4738;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --text: #f3efe2;
  --muted: #9cb3a7;
  --gold: #f2c14e;
  --gold-2: #c99a2e;
  --red: #e0574c;
  --green: #41b276;
  --blue: #5b9bd5;
  --tile: #fbf6e6;
  --tile-edge: #d6c9a6;
  --radius: 14px;
  --tw: 42px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, #1b4a3a 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 100%, #123a2d 0%, transparent 55%),
    var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
input, select { outline: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error-text { color: #ff9b90; min-height: 1.2em; font-size: 13px; margin: 8px 0 0; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn:hover { background: rgba(255, 255, 255, 0.1); }
.btn.primary {
  background: linear-gradient(180deg, #f6cd63, #d9a634);
  border-color: #e5b845;
  color: #2a1f05;
  font-weight: 700;
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px; font-size: 16px; }
.btn.danger { border-color: rgba(224, 87, 76, 0.5); color: #ffb1a8; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.icon-btn {
  background: transparent; border: none; color: var(--text); font-size: 18px;
  cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.08); }

/* ---------- 登录 ---------- */
.view { min-height: 100dvh; }
.login-view {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px calc(24px + var(--safe-bottom));
}
.login-card {
  width: 100%; max-width: 400px;
  background: linear-gradient(180deg, rgba(28, 70, 56, 0.96), rgba(19, 50, 40, 0.96));
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 28px 22px 22px;
  box-shadow: var(--shadow);
}
.brand { text-align: center; margin-bottom: 20px; }
.brand-tile { font-size: 44px; line-height: 1; margin-bottom: 6px; }
.brand h1 { margin: 0 0 6px; font-size: 24px; letter-spacing: 4px; color: var(--gold); }
.brand p { margin: 0; font-size: 13px; }
.tabs { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.25); padding: 4px; border-radius: 10px; margin-bottom: 16px; }
.tab {
  flex: 1; border: none; background: transparent; color: var(--muted);
  padding: 8px; border-radius: 8px; cursor: pointer; font-size: 14px;
}
.tab.active { background: rgba(242, 193, 78, 0.16); color: var(--gold); font-weight: 600; }
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field select, .join-input, #chat-input {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 15px;
  width: 100%;
}
.field input:focus, .join-input:focus, #chat-input:focus { border-color: var(--gold-2); }
#login-code { letter-spacing: 4px; text-transform: uppercase; font-size: 20px; text-align: center; font-weight: 700; }
.login-foot { color: var(--muted); font-size: 12px; margin-top: 16px; }

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; gap: 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 30, 24, 0.8);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
}
.logo { font-weight: 700; letter-spacing: 1px; color: var(--gold); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.user-chip {
  font-size: 13px; color: var(--muted); max-width: 140px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.user-chip b { color: var(--text); font-weight: 600; }

/* ---------- 大厅 ---------- */
.lobby-main {
  width: 100%; max-width: 980px; margin: 0 auto;
  padding: 16px 16px calc(28px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
.panel {
  background: linear-gradient(180deg, rgba(24, 58, 47, 0.92), rgba(18, 46, 37, 0.92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}
.panel-title { margin: 0 0 12px; font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 1px; }
.game-card {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.game-icon {
  width: 56px; height: 56px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 30px;
  background: linear-gradient(145deg, #25624c, #164233);
  border: 1px solid var(--line-strong);
}
.game-info { flex: 1; min-width: 0; }
.game-info h3 { margin: 0 0 4px; font-size: 17px; }
.game-info p { margin: 0; font-size: 12px; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.collapse-btn {
  background: transparent; border: none; color: var(--text); font-size: 15px;
  cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 4px 0;
}
.collapse-btn .chev { transition: transform 0.15s ease; color: var(--muted); }
.collapse-btn[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.badge {
  background: rgba(242, 193, 78, 0.18); color: var(--gold);
  border-radius: 20px; padding: 1px 9px; font-size: 12px;
}
.panel-actions { display: flex; align-items: center; gap: 8px; }
.join-input { width: 92px; padding: 7px 10px; font-size: 13px; text-align: center; letter-spacing: 2px; }

.room-list { display: flex; flex-direction: column; gap: 10px; }
.room-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.room-item:hover { border-color: var(--line-strong); }
.room-main { flex: 1; min-width: 0; }
.room-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.room-title .rid { color: var(--muted); font-weight: 400; font-size: 12px; letter-spacing: 1px; }
.room-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.tag {
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px;
  background: rgba(255, 255, 255, 0.04); white-space: nowrap;
}
.tag.hot { color: var(--gold); border-color: rgba(242, 193, 78, 0.4); }
.room-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.room-empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 13px; }

/* ---------- 房间 ---------- */
.room-body {
  width: 100%; max-width: 900px; margin: 0 auto;
  padding: 12px 14px calc(20px + var(--safe-bottom));
  display: flex; flex-direction: column; gap: 14px; min-height: 100dvh;
}
.room-head { display: flex; align-items: center; gap: 10px; }
.room-head .title { font-size: 18px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-code { color: var(--muted); font-size: 12px; letter-spacing: 2px; }
.room-settings { display: flex; flex-wrap: wrap; gap: 6px; }
.seat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.seat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 104px;
}
.seat-card.empty { border-style: dashed; opacity: 0.6; align-items: center; justify-content: center; }
.seat-card.ready { border-color: rgba(65, 178, 118, 0.55); box-shadow: inset 0 0 0 1px rgba(65, 178, 118, 0.2); }
.seat-card.offline { opacity: 0.55; }
.seat-top { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700;
  background: linear-gradient(145deg, #2a6b53, #174535); border: 1px solid var(--line-strong);
}
.seat-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-sub { font-size: 12px; color: var(--muted); }
.pill { font-size: 11px; padding: 1px 7px; border-radius: 20px; border: 1px solid var(--line); }
.pill.gold { color: var(--gold); border-color: rgba(242, 193, 78, 0.45); }
.pill.me { color: #ffd9a0; border-color: rgba(255, 180, 90, 0.55); background: rgba(255, 160, 60, 0.12); }
.pill.green { color: #7fdfa9; border-color: rgba(65, 178, 118, 0.45); }
.pill.red { color: #ff9b90; border-color: rgba(224, 87, 76, 0.45); }
.room-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.room-actions .btn { flex: 1; }
.room-chat-preview { background: rgba(0, 0, 0, 0.2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px; color: var(--muted); }
.room-chat-preview .msg { padding: 3px 0; color: var(--text); }
.room-chat-preview .msg b { color: var(--gold); font-weight: 500; margin-right: 6px; }

/* ---------- 牌 ---------- */
.tile {
  --tw: 42px;
  width: var(--tw);
  height: calc(var(--tw) * 1.36);
  border-radius: calc(var(--tw) * 0.14);
  background: linear-gradient(180deg, #fffdf3 0%, #f2ead4 100%);
  border: 1px solid var(--tile-edge);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0; padding: 0; cursor: default; position: relative; flex: 0 0 auto;
  color: #2a2a2a; font-weight: 700; line-height: 1;
  transition: transform 0.08s ease;
  user-select: none;
}
.hand .tile:active { transform: translateY(1px); }
.tile .t-rank { font-size: calc(var(--tw) * 0.42); }
.tile .t-suit { font-size: calc(var(--tw) * 0.3); margin-top: calc(var(--tw) * 0.04); }
.tile .t-char { font-size: calc(var(--tw) * 0.52); }
.tile .tile-face {
  width: 100%;
  height: 138.89%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5% 4%;
  pointer-events: none;
}
.tile .tile-svg { width: 100%; height: 100%; display: block; }
.tile .tile-img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.tile.source::after {
  content: attr(data-from);
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 13px;
  padding: 1px 3px;
  border-radius: 4px;
  background: var(--gold);
  color: #2a1f05;
  font-size: 9px;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
  z-index: 3;
  pointer-events: none;
}
.tile.suit-m { color: #b23a2f; }
.tile.suit-s { color: #1c7a45; }
.tile.suit-p { color: #22509b; }
.tile.honor-wind { color: #2c3e50; }
.tile.honor-dragon { color: #8e2f2f; }
.tile.flower { color: #8a5a1c; background: linear-gradient(180deg, #fdf7e2, #efe2c0); }
.tile.selected { transform: translateY(-12px); box-shadow: 0 10px 16px rgba(0, 0, 0, 0.45), 0 0 0 2px var(--gold) inset; }
.tile.disabled { opacity: 0.45; cursor: default; }
.tile.small { --tw: 26px; }
.tile.tiny { --tw: 20px; border-radius: 3px; }
.tile.tiny .t-rank { font-size: 10px; }
.tile.tiny .t-suit { font-size: 8px; }
.tile.tiny .t-char { font-size: 11px; }
.tile.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0 3px, transparent 3px 6px),
    linear-gradient(160deg, #1f6b4e, #124634);
  border-color: #0c3327;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.08), 0 2px 3px rgba(0, 0, 0, 0.4);
}
.tile.back::after {
  content: ""; position: absolute; inset: 18%; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 2px;
}
.tile.win { box-shadow: 0 0 0 2px var(--gold) inset, 0 4px 10px rgba(0, 0, 0, 0.4); }
.tile.hint {
  box-shadow: 0 0 0 2px #4aa3ff, 0 0 10px rgba(74, 163, 255, 0.55);
}
.tile.hint::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(64, 150, 255, 0.42);
  pointer-events: none;
  z-index: 1;
}
.tile.laizi {
  background: linear-gradient(180deg, #fff8dc 0%, #f5dfa0 100%);
  box-shadow: 0 0 0 2px var(--gold) inset, 0 2px 6px rgba(0, 0, 0, 0.4);
}
.tile.laizi::after {
  content: "赖";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f6cd63, #d9a634);
  color: #2a1f05;
  font-size: 9px;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.tile.small.laizi::after,
.tile.tiny.laizi::after {
  width: 12px;
  height: 12px;
  font-size: 8px;
  top: -4px;
  right: -4px;
}

.rotate-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 18, 14, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  backdrop-filter: blur(3px);
}
.rotate-card {
  max-width: 330px;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rotate-icon { font-size: 38px; }
.rotate-card h3 { margin: 0; color: var(--gold); }
.rotate-card p { color: var(--muted); font-size: 13px; margin: 0 0 6px; line-height: 1.6; }

@media (orientation: landscape) and (max-height: 640px) {
  .login-view { padding: 10px; }
  .login-card { max-width: 440px; padding: 16px; }
  .brand { margin-bottom: 10px; }
  .brand-tile { display: none; }
  .brand h1 { font-size: 20px; }
  .lobby-main { padding: 10px; gap: 10px; }
  .room-body { padding: 10px; gap: 8px; min-height: 0; }
  .seat-grid { grid-template-columns: repeat(4, 1fr); }

  .game-body { padding: 4px 8px calc(4px + var(--safe-bottom)); gap: 4px; }
  .game-topbar { gap: 5px; }
  .game-title { font-size: 11px; }
  .table-grid { gap: 4px; }
  .seat-panel { padding: 4px 6px; gap: 3px; }
  .seat-panel.top { width: 56%; max-height: 72px; }
  .seat-panel .seat-head { font-size: 11px; }
  .seat-panel .seat-hand { max-height: 16px; }
  .seat-panel .seat-hand .tile { --tw: 9px; }
  .seat-panel .seat-melds { max-height: 38px; }
  .seat-panel.left .seat-melds,
  .seat-panel.right .seat-melds { max-height: 58px; }
  .river-quad .tile { --tw: 20px; }
  .river-quad.left .tile,
  .river-quad.right .tile { --tw: 18px; }
  .center-info-card { flex-direction: row; gap: 8px; padding: 4px 8px; min-width: 0; }
  .center-tiles { gap: 6px; }
  .center-stat b { font-size: 20px; }
  .center-tile .tile { --tw: 22px; }
  .hand .tile { --tw: 26px; }
  .hand { padding-top: 10px; }
  .self-head { font-size: 11px; }
  .self-melds { min-height: 18px; max-height: 40px; overflow: hidden; }
  .actions { min-height: 38px; }
  .action-btn { padding: 7px 14px; font-size: 14px; min-width: 62px; }
  .seat-bottom { gap: 4px; }
}

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.62);
  display: flex; align-items: center; justify-content: center; z-index: 60;
  padding: 16px; backdrop-filter: blur(2px);
}
.modal-card {
  width: 100%; max-width: 460px; max-height: 88dvh; overflow-y: auto;
  background: linear-gradient(180deg, #1b4a3a, #133427);
  border: 1px solid var(--line-strong);
  border-radius: 18px; padding: 18px;
  box-shadow: var(--shadow);
}
.modal-card.wide { max-width: 560px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-foot { display: flex; gap: 10px; margin-top: 16px; }
.modal-foot .btn { flex: 1; }
.opt-section { margin-bottom: 14px; }
.opt-label { font-size: 13px; color: var(--muted); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.opt-label .req { color: var(--gold); font-size: 11px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.04);
  color: var(--text); border-radius: 9px; padding: 7px 12px; font-size: 13px; cursor: pointer;
}
.seg button.on { background: rgba(242, 193, 78, 0.18); border-color: rgba(242, 193, 78, 0.6); color: var(--gold); font-weight: 600; }
.check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 6px 10px; font-size: 13px; cursor: pointer; color: var(--text);
  background: rgba(255, 255, 255, 0.04); user-select: none;
}
.check input { accent-color: var(--gold); width: 14px; height: 14px; margin: 0; }
.check.on { border-color: rgba(242, 193, 78, 0.55); background: rgba(242, 193, 78, 0.12); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.num-input {
  width: 100%; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line-strong);
  border-radius: 8px; padding: 7px 9px; font-size: 14px; color: var(--text);
}
.small-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.advanced-toggle { width: 100%; text-align: left; }
.advanced-body { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ---------- 战绩 / 结算 ---------- */
.result-winners { display: flex; flex-direction: column; gap: 10px; }
.winner-card { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.winner-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.winner-head .amount { margin-left: auto; color: var(--gold); font-size: 18px; }
.fan-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fan-chip { font-size: 11px; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; color: var(--muted); }
.fan-chip b { color: var(--gold); font-weight: 600; }
.score-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 12px; }
.score-table th, .score-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.score-table td.num, .score-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pos { color: #7fdfa9; }
.neg { color: #ff9b90; }
.hist-item { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; display: flex; gap: 8px; }
.hist-item .when { color: var(--muted); font-size: 11px; }
.hist-item .delta { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- 聊天抽屉 ---------- */
.drawer {
  position: fixed; z-index: 55;
  right: 0; bottom: 0; top: 0; width: min(360px, 92vw);
  background: #12332a;
  border-left: 1px solid var(--line-strong);
  display: flex; flex-direction: column;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.chat-item { font-size: 13px; line-height: 1.45; word-break: break-word; }
.chat-item.sys { color: var(--muted); font-size: 12px; text-align: center; padding: 3px 0; }
.chat-item .who { color: var(--gold); font-size: 11px; margin-right: 6px; }
.chat-item .time { color: #6d8579; font-size: 10px; margin-left: 6px; }
.chat-item.sys { color: var(--muted); font-size: 12px; text-align: center; }
.chat-tools { border-top: 1px solid var(--line); padding: 8px 12px; display: flex; flex-direction: column; gap: 8px; max-height: 34dvh; overflow-y: auto; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 12px; padding: 5px 9px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.emoji-grid button { font-size: 19px; background: transparent; border: none; cursor: pointer; padding: 2px; border-radius: 6px; }
.emoji-grid button:hover { background: rgba(255, 255, 255, 0.08); }
.chat-form { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--line); }
.chat-form input { flex: 1; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(20, 20, 20, 0.92); color: #fff;
  padding: 9px 16px; border-radius: 20px; font-size: 13px;
  z-index: 90; pointer-events: none; max-width: 80vw; text-align: center;
}

/* ---------- 桌面端 ---------- */
@media (min-width: 760px) {
  :root { --tw: 46px; }
  .hand .tile { --tw: 44px; }
  .seat-grid { grid-template-columns: repeat(4, 1fr); }
  .center-stage { min-height: 180px; }
  .opponents { gap: 12px; }
  .room-body { padding-top: 20px; }
  .action-btn { padding: 13px 26px; font-size: 18px; min-width: 96px; }
}
@media (max-width: 420px) {
  .hand .tile { --tw: 32px; }
  .my-melds .tile { --tw: 24px; }
  .opponents { gap: 6px; }
  .game-body { padding: 6px 7px calc(6px + var(--safe-bottom)); }
  .room-head .title { font-size: 16px; }
  .action-btn { min-width: 68px; padding: 10px 14px; font-size: 15px; border-radius: 12px; }
}

/* ---------- 管理员 ---------- */
.admin-wrap { max-width: 1100px; margin: 0 auto; padding: 18px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat-card .num { font-size: 26px; font-weight: 700; color: var(--gold); }
.stat-card .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.admin-table th { color: var(--muted); font-weight: 500; font-size: 12px; }
.code-cell { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; }
.admin-toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }


/* ==========================================================================
   牌桌布局（唯一来源，设计基准 1920×1080）
   不再使用后置补丁覆盖；所有牌桌尺寸、位置、手牌/副露/弃牌规则都写在
   本段内。JS 只负责按窗口等比缩放整个 .game-stage。
   ========================================================================== */


/* ==========================================================================
   牌桌、聊天、结算的最终样式（唯一来源）
   设计基准 1920×1080，由 JS 等比缩放；
   本节不再区分历史版本，所有牌桌尺寸只在这里出现一次。
   ========================================================================== */

/* ---------- 舞台 ---------- */
.game-body {
  position: relative;
  width: 100vw;
  height: 100dvh;
  padding: 0 !important;
  overflow: hidden;
  background: #081b15;
}
.game-stage {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  transform-origin: 0 0;
  background: radial-gradient(circle at 50% 42%, #19503b, #0b241b 78%);
  overflow: hidden;
}

/* ---------- 角落操作 ---------- */
.corner-layer {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}
.corner-layer button,
.corner-layer .voice-fab { pointer-events: auto; }
.corner-exit,
.corner-match {
  position: absolute;
  top: 14px;
  border: 1px solid rgba(242, 193, 78, .55);
  background: rgba(0, 0, 0, .45);
  color: var(--gold);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 30px;
}
.corner-exit { left: 14px; color: #fff; }
.corner-match { right: 14px; }
.corner-laizi { position: absolute; left: 36px; top: 90px; pointer-events: none; }
.corner-laizi .tile { width: 36px; height: 50px; --tw: 36px; }
.corner-voice {
  position: absolute;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.voice-fab {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: rgba(0, 0, 0, .55);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.voice-fab img {
  width: 26px !important;
  height: 26px !important;
  max-width: 26px !important;
  max-height: 26px !important;
  object-fit: contain !important;
  display: block;
}
/* 麦克风音量绿色叠层 */
.voice-fab.mic { position: relative; overflow: hidden; }
.voice-fab.mic .mic-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--level, 0%);
  background: linear-gradient(180deg, rgba(72, 210, 132, .95), rgba(30, 150, 86, .95));
  opacity: .9;
  transition: height .08s linear;
  pointer-events: none;
  z-index: 0;
}
.voice-fab.mic img { position: relative; z-index: 2; }
.stage-banner {
  position: absolute;
  top: 105px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  background: rgba(18, 52, 40, .96);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 8px 18px;
  font-size: 14px;
  color: var(--gold);
  white-space: nowrap;
}

/* ---------- 玩家通用 ---------- */
.avatar,
.avatar-img { border-radius: 12px !important; }
.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.player-score {
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  font-size: 22px;
  line-height: 20px;
  text-align: center;
  color: var(--text);
}
.player-tags {
  position: absolute;
  right: -2px;
  top: -10px;
  display: flex;
  gap: 2px;
}
.tag-dealer {
  font-size: 14px;
  line-height: 14px;
  padding: 4px;
  border-radius: 6px;
  color: #2a1f05;
  background: var(--gold);
  font-weight: 700;
}
.top-id,
.side-id {
  position: relative;
  text-align: center;
}
.top-id .avatar,
.side-id .avatar { width: 54px; height: 54px; margin: 0 auto; }
.active-avatar { box-shadow: none !important; border-radius: 0 !important; }
.active-avatar .avatar {
  box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(242, 193, 78, .3) !important;
  border-radius: 12px !important;
}
.offline { opacity: .55; }

/* ---------- 上方玩家 ---------- */
.stage-top {
  position: absolute;
  left: 0;
  top: 16px;
  width: 1920px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-player {
  position: relative;
  width: auto;
  min-width: 758px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.top-play-area {
  width: auto;
  min-width: 758px;
  max-width: 1200px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  overflow: visible;
}
.top-melds {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  height: 64px;
  max-width: none;
  overflow: visible;
}
.top-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 64px;
  overflow: hidden;
}
.top-hand .tile { width: 36px; height: 50px; --tw: 36px; margin: 0; }
.top-melds .tile { width: 28.8px; height: 40px; --tw: 28.8px; margin: 0; }
.top-hand .tile,
.top-melds .tile { transform: rotate(180deg); }
.top-id {
  position: absolute;
  left: auto;
  right: -54px;
  top: -8px;
  width: 54px;
  height: 64px;
}
.top-id .player-tags { right: -10px; }

/* ---------- 左右玩家 ---------- */
.stage-mid { position: absolute; inset: 0; }
.stage-mid .side-player {
  position: absolute;
  top: 32px;
  width: 128px;
  height: 808px;
}
.stage-mid .side-player.left { left: 64px; }
.stage-mid .side-player.right { right: 64px; }
.stage-mid.seats-2 .side-player { display: none; }
.side-player {
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  overflow: hidden;
}
.side-player.right { flex-direction: row-reverse; }
.side-avatar-col {
  width: 64px;
  height: 808px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.side-id { width: 64px; }
.side-id .player-tags { right: -6px; }
.side-play-col {
  width: 64px;
  height: 808px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40.5px;
  overflow: hidden;
}
.side-player.right .side-play-col { flex-direction: column-reverse; }
.side-hand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.side-hand .tile {
  width: 50px;
  height: 36px;
  --tw: 50px;
  margin: 0;
}
.side-melds {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-height: none;
  flex: 0 0 auto;
}
.side-player.right .side-melds { flex-direction: column-reverse; }
.side-melds .meld {
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.side-melds .tile {
  width: 40px;
  height: 28.8px;
  --tw: 40px;
  margin: 0;
}
.side-melds .tile-img { transform: rotate(-90deg); }
.side-player.left .side-melds .tile { transform: rotate(180deg); }
.side-player.left .side-melds .tile.source::after {
  transform: translateX(-50%) rotate(270deg) !important;
  left: 5px;
  top: auto;
  min-height: 6px;
  min-width: 6px;
  font-size: 6px;
}
.side-player.right .side-melds .tile.source::after {
  transform: translateX(-50%) rotate(270deg) !important;
  left: 5px;
  top: auto;
  min-height: 6px;
  min-width: 6px;
  font-size: 6px;
}

/* ---------- 中间区域 ---------- */
.center-area {
  position: absolute;
  left: 192px;
  top: 96px;
  width: 1536px;
  height: 744px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, .12);
  overflow: hidden;
}
.center-info-shell {
  position: absolute;
  left: 576px;
  top: 180px;
  width: 384px;
  height: 384px;
  border-radius: 14px;
  background: radial-gradient(ellipse at 50% 45%, rgba(22, 70, 52, .98), rgba(8, 30, 24, .98));
  overflow: hidden;
  z-index: 4;
}
.trap { position: absolute; background: rgba(255, 255, 255, .025); }
.trap.top {
  left: 0; right: 0; top: 0; height: 28%;
  clip-path: polygon(0 0, 100% 0, 79% 100%, 21% 100%);
}
.trap.bottom {
  left: 0; right: 0; bottom: 0; height: 28%;
  clip-path: polygon(21% 0, 79% 0, 100% 100%, 0 100%);
}
.trap.left {
  left: 0; top: 28%; bottom: 28%; width: 21%;
  clip-path: polygon(0 0, 100% 21%, 100% 79%, 0 100%);
}
.trap.right {
  right: 0; top: 28%; bottom: 28%; width: 21%;
  clip-path: polygon(0 21%, 100% 0, 100% 100%, 0 79%);
}
.trap-wind {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  font-weight: 700;
  color: #e8dfc6;
  pointer-events: none;
}
.trap-wind.active {
  color: #2a1f05;
  background: var(--gold);
  border-radius: 8px;
  padding: 2px 10px;
  box-shadow: 0 0 0 2px rgba(242, 193, 78, .5), 0 0 18px rgba(242, 193, 78, .45);
}
.center-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.center-lines line { stroke: rgba(255, 255, 255, .35); stroke-width: .25; }
.center-info-rect {
  position: absolute;
  left: 21%;
  right: 21%;
  top: 28%;
  bottom: 28%;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 14px;
  background: rgba(0, 0, 0, .3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  z-index: 3;
}
.hub-remaining { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hub-remaining b { font-size: 34px; color: #fff; font-variant-numeric: tabular-nums; }
.hub-remaining span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.hub-timer { font-size: 16px; color: var(--gold); }
.hub-status { font-size: 10px; color: var(--muted); text-align: center; }

/* ---------- 弃牌区 ---------- */
.discard-zone { position: absolute; overflow: hidden; }
.discard-zone.top { left: 0; top: 0; width: 1536px; height: 180px; }
.discard-zone.bottom { left: 0; bottom: 0; width: 1536px; height: 180px; }
.discard-zone.left { left: 0; top: 0; width: 576px; height: 744px; }
.discard-zone.right { right: 0; top: 0; width: 576px; height: 744px; }
.river-quad {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  padding: 0;
  border: 0;
  overflow: hidden;
}
.river-quad .tile { width: 36px; height: 50px; --tw: 36px; margin: 0; }
.discard-zone.top .river-quad {
  left: 576px;
  right: 583px;
  bottom: 10px;
  height: auto;
  flex-direction: row-reverse;
  flex-wrap: wrap-reverse;
  justify-content: flex-start;
  align-content: flex-start;
}
.discard-zone.bottom .river-quad {
  left: 583px;
  right: 576px;
  top: 10px;
  height: auto;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
}
.discard-zone.left .river-quad,
.discard-zone.right .river-quad {
  top: 187px;
  bottom: 187px;
  left: 8px;
  right: 8px;
  width: auto;
  height: auto;
  flex-direction: column;
  justify-content: flex-start;
}
.discard-zone.left .river-quad { flex-wrap: wrap-reverse; align-content: flex-start; }
.discard-zone.right .river-quad { flex-wrap: wrap; align-content: flex-start; flex-direction: column-reverse; }
.discard-zone.top .river-quad .tile { transform: rotate(180deg); }
/* 左右弃牌旋转盒：布局按 50×36，牌面朝中心，间距 1px */
.river-tile-rot {
  position: relative;
  display: block;
  width: 50px;
  height: 36px;
}
.discard-zone.left .river-tile-rot .tile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 50px;
  margin: 0 !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
}
.discard-zone.right .river-tile-rot .tile {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 36px;
  height: 50px;
  margin: 0 !important;
  transform: translate(-50%, -50%) rotate(-90deg) !important;
}
.tile.claimed { opacity: .35; }

/* ---------- 下方玩家 ---------- */
.stage-bottom {
  position: absolute;
  left: 192px;
  top: 840px;
  width: 1536px;
  height: 240px;
}
.self-bottom {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.self-topline {
  height: 64px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.self-id {
  position: relative;
  display: block;
  width: 64px;
  text-align: center;
}
.self-id .avatar { width: 54px; height: 54px; margin: 0 auto; }
.self-id .player-score {
  position: absolute;
  left: 0;
  right: 0;
  top: 64px;
  margin: 0;
  font-size: 22px;
  line-height: 12px;
  text-align: center;
}
.self-id .player-tags { right: -2px; top: -10px; }
.self-bottom .actions {
  flex: 1 1 auto;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.action-btn {
  min-width: 84px;
  padding: 8px 20px;
  border-radius: 12px;
  border: 1px solid #e5b845;
  background: linear-gradient(180deg, #f6cd63, #d9a634);
  color: #2a1f05;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 4px 0 #9c731d, 0 7px 12px rgba(0, 0, 0, .35);
  transform: translateY(-1px);
}
.action-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #9c731d, 0 3px 6px rgba(0, 0, 0, .3);
}
.action-hint { font-size: 24px; color: var(--muted); }
.self-hand-row {
  width: 1536px;
  height: 142px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 40.5px;
}
.hand-wrap { flex: 0 0 auto; padding-bottom: 2px; }
.hand {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 18px 14px 0;
  overflow-x: auto;
  overflow-y: hidden;
  width: max-content;
  max-width: none;
}
.hand .tile {
  width: 81px;
  height: 112.5px;
  --tw: 81px;
  margin: 0;
}
.tile { cursor: default; }
.hand .tile { cursor: pointer; }
.hand .tile:active { transform: translateY(1px); }
.tile.selected { transform: none; }
.hand .tile.selected {
  transform: translateY(-18px) !important;
  box-shadow: 0 10px 16px rgba(0, 0, 0, .45), 0 0 0 2px var(--gold) inset;
}
.hand-sep {
  flex: 0 0 2px;
  align-self: center;
  height: 64%;
  margin: 0 6px;
  border-radius: 1px;
  background: rgba(255, 255, 255, .38);
}
.self-melds {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 2px;
  flex: 0 0 auto;
  overflow: visible;
}
.self-melds:empty { display: none; }
.self-melds .meld { flex-direction: row; align-items: flex-end; gap: 0; }
.self-melds .tile { width: 64.8px; height: 90px; --tw: 64.8px; }
.hand .tile.laizi::after {
  width: 30px;
  height: 30px;
  font-size: 18px;
  top: -10px;
  right: -10px;
}

/* ---------- 副露 ---------- */
.meld { display: inline-flex; align-items: flex-end; gap: 0; }
.meld.gang { position: relative; display: block; }
.meld.gang .gang-top {
  position: absolute;
  left: 50%;
  top: -10%;
  transform: translateX(-50%);
  z-index: 2;
}
.meld.gang .gang-row { display: flex; gap: 0; }
.side-melds .meld.gang .gang-row { flex-direction: column; align-items: center; }
.top-player .meld.gang .gang-top { top: 10%; }
.side-player.left .meld.gang .gang-top { top: 50%; left: 60%; transform: translate(-50%, -50%); }
.side-player.right .meld.gang .gang-top { top: 50%; left: 40%; transform: translate(-50%, -50%); }
.tile.source::after {
  content: attr(data-from);
  position: absolute;
  top: 1px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 11px;
  padding: 1px;
  border-radius: 3px;
  background: var(--gold);
  color: #2a1f05;
  font-size: 9.6px;
  line-height: 1;
  font-weight: 700;
  text-align: center;
  z-index: 3;
  pointer-events: none;
}
.top-melds .tile.source::after {
  transform: translateX(-50%) rotate(0deg) !important;
  min-width: 6px;
  font-size: 6px;
}

/* 最后一张打出的牌：金色蒙版 */
.tile.last::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 246, 200, .62), rgba(242, 193, 78, .48));
  box-shadow: inset 0 0 0 2px rgba(242, 193, 78, .95);
  pointer-events: none;
  z-index: 2;
}
.tile.last::after { content: none !important; }
.status-line { font-size: 24px; color: var(--muted); }
.status-line b { color: var(--gold); }

/* ---------- 聊天 ---------- */
.chat-layout { flex: 1 1 auto; min-height: 0; display: flex; }
.chat-tabs {
  flex: 0 0 86px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
}
.chat-tabs button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 4px;
  font-size: 12px;
}
.chat-tabs button.on {
  color: #2a1f05;
  background: var(--gold);
  border-color: var(--gold);
  font-weight: 700;
}
.chat-panels {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.chat-panel {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px;
}
.chat-panel.on { display: flex; flex-direction: column; }
.chat-panel[data-chat-panel="records"] { overflow: hidden; }
.chat-form.hidden { display: none; }
.chat-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.room-body { height: 100dvh; min-height: 0; overflow: hidden; }
.room-chat-preview { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* 游戏内浮动聊天气泡：按玩家方位贴边 */
.chat-bubble {
  position: fixed;
  width: max-content;
  max-width: 240px;
  padding: 7px 12px;
  border-radius: 12px;
  background: #f2c14e;
  color: #2a1f05;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 600;
  text-align: left;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
  z-index: 2147483000;
  pointer-events: none;
  white-space: normal;
  word-break: break-word;
}
#chat-bubble-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: none;
  overflow: visible;
}
.chat-bubble::after { display: none; }
.side-player.left .chat-bubble,
.self-id .chat-bubble {
  left: 100%;
  right: auto;
  bottom: 100%;
  top: auto;
  transform: none;
}
.side-player.right .chat-bubble {
  right: 100%;
  left: auto;
  bottom: 100%;
  top: auto;
  transform: none;
}
.top-id .chat-bubble {
  right: 100%;
  left: auto;
  top: 100%;
  bottom: auto;
  transform: none;
}

/* ---------- 结算：内容滚动，底部固定 ---------- */
.modal-card.result-modal {
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.result-modal .result-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}
.result-modal .modal-foot {
  flex: 0 0 auto;
  position: relative;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 12px;
}

/* 积分流水：每列等宽，分数居中 */
.ledger-table { table-layout: fixed; width: 100%; }
.ledger-table th:first-child,
.ledger-table td:first-child { width: 72px; }
.ledger-table .ledger-head { text-align: center; vertical-align: bottom; }
.ledger-table .ledger-score { text-align: center; font-variant-numeric: tabular-nums; }
.score-table td.num,
.score-table th.num {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* 房间语音图标 */
.room-voice-icon { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; }
.seat-card .room-voice-icon { width: 17px; height: 17px; margin-left: 2px; }
.room-actions .btn.icon-only { padding: 6px 10px; min-width: 0; }
.room-actions .btn.icon-only .room-voice-icon { width: 22px; height: 22px; }

/* 禁止网页右键/长按选择 */
html, body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* 左右杠牌：3 张竖排，第 4 张叠在中间那张上方，向中心浮动 */
.side-melds .meld.gang .gang-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
