:root {
  --bamboo: #2f2a22;
  --bamboo-2: #3a342a;
  --ivory: #f3ead7;
  --ivory-2: #e6d9bd;
  --ink: #2a2620;
  --tea: #7d9b6a;
  --tea-dark: #4d6b45;
  --gold: #d8a53a;
  --gold-soft: #f0cf7a;
  --danger: #b8543f;
  /* 手牌最小 44px：手机上点得中（原来 38px 偏小），屏幕更高时按 vh 放大 */
  --tile-w: clamp(44px, 6.4vh, 56px);
  --tile-h: calc(var(--tile-w) * 1.36);

  /* 美术包 token（web/assets/art/manifest.json） */
  --table-bg: url("/assets/art/bg/table-1.webp");
  --table-pattern: url("/assets/art/bg/pattern.webp");
  --avatar-size: clamp(30px, 3.6vh, 40px);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --shadow-card: 0 18px 50px rgba(0, 0, 0, 0.6);
  --shadow-tile: 0 2px 0 #b9a884, 0 3px 6px rgba(0, 0, 0, 0.35);
  --bubble-bg: #fffdf8;
  --z-panel: 18;
  --z-overlay: 20;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* 手机端：任何时候都不许横向溢出（格子里用 minmax(0,1fr)，别让 1fr 撑破容器） */
html, body { max-width: 100%; overflow-x: hidden; }
button, input, select, .tile, .avatars img, .steal-grid img { touch-action: manipulation; }

/* 元素级隐藏统一走 .hidden：别再让 .net-dock{display:flex} 这类规则把 hidden 压掉 */
.hidden { display: none; }

html, body {
  margin: 0;
  height: 100%;
  background: #191510;
  color: var(--ivory);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  overscroll-behavior: none;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(20, 16, 13, 0.42), rgba(20, 16, 13, 0.62)),
    url("/assets/art/bg/app.webp") center / cover no-repeat,
    radial-gradient(120% 80% at 50% 0%, #4a4133 0%, #2b2620 45%, #1d1914 100%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.022) 0 2px, transparent 2px 7px);
}

/* ---------- 顶栏 ---------- */
.bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.28);
  border-bottom: 1px solid rgba(240, 207, 122, 0.16);
  flex: 0 0 auto;
}
.brand { font-weight: 700; letter-spacing: 2px; color: var(--gold-soft); }
.brand span { font-weight: 400; font-size: 12px; color: var(--tea); letter-spacing: 1px; margin-left: 4px; }
.meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ivory-2); opacity: 0.9; }
/* 倒计时用浅色，深底上对比度 >4.5:1；将超时时换成亮橙红 */
.timer { font-variant-numeric: tabular-nums; color: #cfe6b8; letter-spacing: 0.5px; }
.timer.warn { color: #ffb3a1; font-weight: 700; }
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.controls { margin-left: auto; display: flex; gap: 8px; align-items: center; }
select, button {
  font: inherit;
  font-size: 13px;
  border-radius: 8px;
  border: 1px solid rgba(240, 207, 122, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ivory);
  padding: 6px 10px;
  min-height: 34px;
}
button { cursor: pointer; transition: transform 0.08s ease, background 0.15s ease; }
button:active { transform: translateY(1px) scale(0.99); }
button.primary { background: linear-gradient(180deg, #8a5420, #5f3608); border-color: #c9963f; color: #fff8e7; font-weight: 600; }
button.ghost { background: transparent; }
button:disabled { opacity: 0.35; cursor: default; }

/* ---------- 桌面 ---------- */
.table {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr minmax(190px, 32%) 1fr;
  grid-template-rows: minmax(0, 46fr) minmax(0, 54fr);
  padding: 10px 16px 4px;
  gap: 6px;
  background-image:
    linear-gradient(180deg, rgba(12, 10, 8, 0.56), rgba(12, 10, 8, 0.3) 38%, rgba(12, 10, 8, 0.68)),
    var(--table-bg);
  background-size: auto, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
}
/* 麻将牌背平铺纹理，只做 7% 氛围，不参与抢戏 */
.table::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--table-pattern) center / 300px auto repeat;
  opacity: 0.07;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 0;
}
.table > * { position: relative; z-index: 1; }
.seat { min-width: 0; position: relative; }
.seat.top { grid-area: 1 / 2 / 2 / 3; align-self: start; }
.seat.left { grid-area: 1 / 1 / 3 / 2; }
.seat.right { grid-area: 1 / 3 / 3 / 4; }
/* 三家座位统一用纵向 flex；旧文件里的 .opp 选择器早就没人加了，别再依赖它 */
.seat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
  justify-content: center;
}
.seat .who {
  font-size: 12px;
  color: #cbbfa5;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.seat .who .tag { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: rgba(216, 165, 58, 0.18); color: var(--gold-soft); }
.seat .who .tag.lock { background: rgba(184, 84, 63, 0.25); color: #f0b9a8; }
.seat .back-row { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
/* 参考三明麻将摆法：对家横排一溜，左右两家牌背竖着贴边，牌河朝中心 */
.seat.left .back-row,
.seat.right .back-row { flex-direction: column; flex-wrap: nowrap; gap: 1px; }
.seat.left .tile,
.seat.right .tile { --tile-w: 30px; --tile-h: 41px; }
.seat.left .river,
.seat.right .river { align-content: flex-start; }
.seat.left { align-items: flex-end; }
.seat.right { align-items: flex-start; }
.seat .meld-row, .seat .river { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 100%; }
.self-label {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 13px; color: var(--ivory-2);
}
.self-label .score { color: var(--gold-soft); font-weight: 700; }

/* ---------- 头像 ---------- */
.avatar {
  width: var(--avatar-size);
  height: var(--avatar-size);
  flex: 0 0 auto;
  border-radius: 50%;
  object-fit: cover;
  background: #2b2620;
  border: 2px solid rgba(240, 207, 122, 0.5);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}
.who .avatar { width: calc(var(--avatar-size) * 0.82); height: calc(var(--avatar-size) * 0.82); }
.self-avatar { width: calc(var(--avatar-size) * 0.92); height: calc(var(--avatar-size) * 0.92); }

/* ---------- 表情气泡 ---------- */
.emoji-bubble {
  position: absolute;
  z-index: 3;
  width: clamp(52px, 7vh, 68px);
  padding: 4px;
  border-radius: 14px;
  background: var(--bubble-bg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  animation: bubbleIn 0.16s ease-out;
  pointer-events: none;
}
.emoji-bubble img { width: 100%; height: auto; display: block; border-radius: 10px; }
.emoji-bubble::after {
  content: "";
  position: absolute;
  bottom: -5px; left: 50%;
  width: 10px; height: 10px;
  margin-left: -5px;
  background: var(--bubble-bg);
  transform: rotate(45deg);
  border-radius: 2px;
}
.seat[data-seat="2"] .emoji-bubble { left: 50%; margin-left: 34px; top: 2px; }
.seat[data-seat="1"] .emoji-bubble { right: -6px; top: 8px; }
.seat[data-seat="3"] .emoji-bubble { left: -6px; top: 8px; }
.self-label .emoji-bubble { left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); }
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- 表情面板 ---------- */
.emoji-wrap { position: relative; align-self: flex-end; }
.emoji-btn { padding: 6px 12px; }
.emoji-panel {
  position: fixed;
  right: 18px;
  bottom: 96px;
  width: min(372px, 90vw);
  max-height: 46vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: rgba(26, 22, 19, 0.97);
  border: 1px solid rgba(240, 207, 122, 0.26);
  box-shadow: var(--shadow-card);
  z-index: var(--z-panel);
}
.emoji-panel.hidden { display: none; }
.emoji-cell {
  padding: 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease;
}
.emoji-cell img { width: 100%; height: auto; display: block; border-radius: 8px; }
.emoji-cell:active { transform: scale(0.94); }
.emoji-cell:disabled { opacity: 0.35; cursor: default; }

.center {
  grid-area: 2 / 2 / 3 / 3;
  align-self: center;
  justify-self: stretch;
  width: 100%;
  text-align: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(240, 207, 122, 0.12);
}
.gold-line { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.gold-line .label { font-size: 12px; color: var(--gold); letter-spacing: 3px; }
.hint { font-size: 12px; color: #b9ae96; }
.turn-hint { margin: 8px 0 6px; font-size: 14px; font-weight: 600; color: var(--ivory); }
.turn-hint.mine { color: var(--gold-soft); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.62; } }
.scores { display: flex; justify-content: center; gap: 12px; font-size: 12px; color: #c8bda6; flex-wrap: wrap; }
.scores b { color: var(--ivory); }

/* 对家 */
.opp { display: flex; flex-direction: column; gap: 5px; align-items: center; justify-content: center; height: 100%; }
.opp .who { font-size: 12px; color: #cbbfa5; display: flex; gap: 6px; align-items: center; }
.opp .who .tag { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: rgba(216, 165, 58, 0.18); color: var(--gold-soft); }
.opp .who .tag.lock { background: rgba(184, 84, 63, 0.25); color: #f0b9a8; }
.opp .back-row { display: flex; gap: 2px; }
.back {
  width: calc(var(--tile-w) * 0.42);
  height: calc(var(--tile-h) * 0.66);
  border-radius: 3px;
  background: linear-gradient(160deg, #7d9b6a, #3f5738);
  background-image: var(--tile-back, linear-gradient(160deg, #7d9b6a, #3f5738));
  background-size: 100% 100%;
  background-repeat: no-repeat;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25);
}
.opp .meld-row, .opp .river { display: flex; gap: 2px; flex-wrap: wrap; justify-content: center; max-width: 100%; }

/* ---------- 牌 ---------- */
.tiles { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.tile {
  width: var(--tile-w);
  height: var(--tile-h);
  border-radius: 6px;
  background: linear-gradient(180deg, #fbf4e3 0%, var(--ivory) 52%, #dfd0ae 100%);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: calc(var(--tile-w) * 0.52);
  line-height: 1;
  position: relative;
  border: 1px solid #cfc0a0;
  box-shadow: 0 2px 0 #b9a884, 0 3px 6px rgba(0, 0, 0, 0.35);
  user-select: none;
}
.tile.suit-0 { color: #a63c2c; }   /* 万 */
.tile.suit-1 { color: #2f6b45; }   /* 条 */
.tile.suit-2 { color: #2b5b86; }   /* 筒 */
.tile.suit-3 { color: #4a4032; }   /* 字 */
.tile.small { --tile-w: 30px; font-size: 14px; }
.tile.big { --tile-w: 64px; --tile-h: 88px; font-size: 30px; }
.tile.tiny { --tile-w: 20px; font-size: 10px; }
.tile.tiny.gold::after { content: ""; }

/* 牌面贴图（每套 28 张）：手牌、副露、牌河都用同一套，只有 20px 的 tiny 退回数字 */
.tile.has-face {
  background: var(--face) center / 100% 100% no-repeat;
  border-color: rgba(240, 207, 122, 0.55);
  color: transparent;
  font-size: 0;
  box-shadow: 0 2px 0 #3c3021, 0 3px 8px rgba(0, 0, 0, 0.45);
}
.tile.has-face.small {
  border-radius: 3px;
  box-shadow: 0 1px 0 #3c3021, 0 1px 3px rgba(0, 0, 0, 0.5);
}
/* 金：全项目只留一种标记——一圈金边 + 右上角一枚圆形金印 */
.tile.gold {
  border-color: #d8b262;
  box-shadow: 0 0 0 2px rgba(216, 178, 98, 0.9), 0 2px 0 #3c3021, 0 0 16px rgba(240, 207, 122, 0.5);
}
.tile.has-face.gold {
  background: var(--face) center / 100% 100% no-repeat;
  box-shadow: 0 0 0 2px rgba(216, 178, 98, 0.9), 0 2px 0 #3c3021, 0 0 16px rgba(240, 207, 122, 0.5);
}
.tile.gold:not(.tiny)::after {
  content: "金";
  position: absolute;
  top: -6px; right: -6px;
  min-width: 14px; height: 14px;
  padding: 0 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; line-height: 1;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fff6d8, #e8c065 62%, #b98f36);
  color: #4a3210;
  border: 1px solid rgba(255, 240, 200, 0.9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.tile.has-face.tiny::after { content: ""; }

.hand { gap: 4px; padding: 2px 0; }
/* 手牌最小 44px 宽：手机上 34px 的牌面既难点、也容易一碰就打错 */
.hand .tile { --tile-w: clamp(44px, 6.4vh, 54px); transition: transform 0.12s ease, filter 0.12s ease; }
.hand .tile.playable { cursor: pointer; }
.hand .tile.playable:active { transform: translateY(-8px); filter: brightness(1.05); }
/* 第一次点 = 选中：上浮 + 金色描边；再点同一张才出牌 */
.hand .tile.picked {
  transform: translateY(-10px);
  outline: 3px solid var(--gold-soft);
  outline-offset: 1px;
  filter: brightness(1.08);
  box-shadow: 0 2px 0 #b9a884, 0 8px 16px rgba(0, 0, 0, 0.45);
}
.hand .tile:focus-visible { outline: 3px solid var(--gold-soft); outline-offset: 2px; }
/* 刚摸的那张单独排在最右，留 6px 间隙，并挂「刚摸」小签 */
.hand .tile.drawn {
  margin-left: 6px;
  box-shadow: 0 2px 0 #b9a884, 0 0 0 2px var(--tea) inset, 0 3px 8px rgba(0, 0, 0, 0.4);
}
.hand .tile.drawn::before {
  content: "刚摸";
  position: absolute;
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--tea-dark);
  color: #f4fff0;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- 底部 ---------- */
.dock {
  flex: 0 0 auto;
  /* 底部留出固定操作条的高度，手牌永远不会被浮层压住 */
  padding: 4px 14px 66px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.36));
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
.melds { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.meld { display: flex; gap: 2px; padding: 2px 4px; border-radius: 6px; background: rgba(0, 0, 0, 0.2); }
/* 操作条：贴屏底的浮层，不占文档流，横屏也不会被挤出可视区 */
.actions {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  z-index: 12;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 24px);
  padding: 6px 10px;
  border-radius: 14px;
  background: rgba(20, 16, 12, 0.9);
  border: 1px solid rgba(240, 207, 122, 0.32);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.actions:empty { display: none; }
.actions button {
  min-width: 64px;
  min-height: 40px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border-color: rgba(240, 207, 122, 0.35);
}
.actions button:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 2px; }
.actions button.hu { background: linear-gradient(180deg, #a8641a, #6d3d0b); border-color: #d8a53a; }
.actions button.pass { opacity: 0.85; }

/* ---------- 结算 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 6, 0.66);
  backdrop-filter: blur(3px);
  z-index: 20;
  padding: 12px;
}
.overlay.hidden { display: none; }
/* 结算卡：限高 + 内部滚动，标题和「继续」始终留在视口里 */
.card {
  position: relative;
  width: min(560px, 92vw);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  padding: 18px 18px 14px;
  background: linear-gradient(180deg, #332d24, #241f18);
  border: 1px solid rgba(240, 207, 122, 0.3);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
.card h2 { margin: 0 0 10px; font-size: 18px; color: var(--gold-soft); letter-spacing: 1px; flex: 0 0 auto; }
.ov-body { font-size: 14px; line-height: 1.75; color: #e8dfca; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.ov-body .row { display: flex; justify-content: space-between; gap: 12px; }
.ov-body .row.sub { font-size: 12.5px; opacity: 0.86; padding-left: 10px; }
/* 对账表：底分 / 涉庄倍数 / 每笔转账 / 合计是否相抵 */
.ledger { margin: 8px 0 2px; border-top: 1px solid rgba(240, 207, 122, 0.18); padding-top: 8px; }
.ledger-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 2px 0; color: rgba(246, 232, 205, 0.86); }
.ledger-row span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ov-body .pos { color: #9ad39a; }
.ov-body .neg { color: #e5a08d; }
.ov-actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 14px; flex: 0 0 auto; }
/* 结算左右双栏：左番型/转账/分数，右抢头像；窄屏自动叠成上下 */
.result-cols { display: flex; gap: 14px; flex: 1 1 auto; min-height: 0; }
.result-main, .result-side { min-width: 0; min-height: 0; overflow-y: auto; }
.result-main { flex: 1 1 58%; }
.result-side { flex: 1 1 42%; border-left: 1px solid rgba(240, 207, 122, 0.16); padding-left: 12px; }
.result-side.hidden { display: none; }
.countdown { margin-right: auto; font-size: 13px; font-variant-numeric: tabular-nums; color: #ffd9a0; }
@media (max-width: 520px) {
  .result-cols { flex-direction: column; }
  .result-side { border-left: 0; border-top: 1px solid rgba(240, 207, 122, 0.16); padding-left: 0; padding-top: 10px; }
}

@media (max-height: 520px) {
  :root { --tile-w: 34px; }
  /* 手牌仍然保持 44px：横屏手机上 34px 点不准，也看不清「刚摸」 */
  .hand .tile { --tile-w: 44px; }
  .bar { padding: 4px 10px; }
  .turn-hint { margin: 4px 0; }
  .dock { padding-bottom: 58px; }
  .actions { bottom: 8px; padding: 4px 8px; gap: 6px; }
  .actions button { min-width: 50px; min-height: 34px; font-size: 14px; padding: 4px 10px; }
}

/* ---------- 单机页：手机竖屏（第 8 步第三项） ---------- */
@media (orientation: portrait) and (max-width: 720px) {
  .bar { flex-wrap: wrap; gap: 4px 8px; padding: 6px 10px; }
  .brand { font-size: 15px; white-space: nowrap; letter-spacing: 1px; }
  .brand span { display: none; }
  .meta { font-size: 11px; gap: 5px; }
  .controls { margin-left: 0; width: 100%; gap: 6px; flex-wrap: wrap; }
  .controls select, .controls button { font-size: 12px; padding: 6px 8px; min-height: 34px; }
  .table {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 6px;
    padding: 6px;
  }
  .seat.top { grid-area: 1 / 1 / 2 / 3; align-self: start; }
  .seat.left { grid-area: 2 / 1 / 3 / 2; align-items: center; justify-content: flex-start; }
  .seat.right { grid-area: 2 / 2 / 3 / 3; align-items: center; justify-content: flex-start; }
  .center { grid-area: 3 / 1 / 4 / 3; align-self: start; padding: 8px; }
  .seat.left .back-row, .seat.right .back-row { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .seat.left .tile, .seat.right .tile { --tile-w: 16px; --tile-h: 22px; }
  .seat.left .river, .seat.right .river { align-content: flex-start; justify-content: flex-start; }
  .hand .tile { --tile-w: 40px; }
  .dock { padding-bottom: 64px; }
  .turn-hint { margin: 4px 0; font-size: 13px; }
}

/* ---------- 单机页：手机横屏矮屏（390 高）压缩上下家牌列，避免溢出压住手牌 ---------- */
@media (orientation: landscape) and (max-height: 560px) {
  .bar { padding: 4px 10px; }
  .brand { font-size: 16px; }
  .controls select, .controls button { padding: 4px 8px; font-size: 12px; min-height: 30px; }
  .seat.left .tile, .seat.right .tile { --tile-w: 15px; --tile-h: 20px; }
  .seat.left .back-row, .seat.right .back-row { gap: 0; overflow: hidden; }
  .seat.top .back-row { gap: 1px; }
  .seat.top .tile { --tile-w: 30px; }
  .table { padding: 6px; gap: 4px; }
  .center { padding: 6px; }
  .turn-hint { margin: 4px 0; font-size: 13px; }
  .hand .tile { --tile-w: 44px; }
  .dock { padding-bottom: 56px; }
}

/* ---------- 竖屏提示：游戏是按横屏设计的，竖屏先劝一句，点过就不再拦 ---------- */
.rotate-hint { display: none; }
@media (orientation: portrait) and (max-width: 900px) {
  .rotate-hint {
    position: fixed; inset: 0; z-index: 60;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; padding: 24px; text-align: center;
    background: rgba(8, 10, 9, .94); color: var(--ivory, #f6e8cd);
  }
  .rotate-hint .rh-ico { font-size: 40px; transform: rotate(-90deg); }
  .rotate-hint p { margin: 0; font-size: 16px; line-height: 1.6; }
  .rotate-hint button { min-height: 44px; padding: 10px 18px; }
  html.portrait-ok .rotate-hint { display: none; }
}

/* ---------- 听牌提示（2026-11-08）：牌角标 + 中央一行「打 X 听 Y 张」 ---------- */
.tile.tenpai { box-shadow: 0 0 0 2px rgba(214, 178, 106, .55); }
.tile .tenpai-badge {
  position: absolute; top: -7px; right: -6px;
  padding: 1px 5px; border-radius: 999px;
  background: #d6b26a; color: #23190c;
  font-size: 11px; font-style: normal; font-weight: 700; line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  pointer-events: none;
}
.tenpai-line {
  margin: 2px 0 6px; padding: 4px 10px; border-radius: 999px;
  background: rgba(214, 178, 106, .14); color: #f0d9a6;
  font-size: 13px; text-align: center;
}
.tenpai-line[hidden] { display: none; }

/* ---------- 表情雪碧图（2026-11-08，tools/mksprite.mjs 生成） ---------- */
.emo-sprite {
  display: inline-block;
  width: 100%; height: 100%;
  background-repeat: no-repeat;
  background-size: 800% 400%;
  background-position: 0 0;
}
button .emo-sprite.emo-img { width: 34px; height: 34px; }
.emo-sprite.emo-bubble-img { width: 40px; height: 40px; }
