/* ═══════════ 牌桌 HUD / 操作栏 / 倒计时 / 结算 ═══════════ */
#screen-table { padding: 0; flex-direction: column; }

.topbar {
  width: 100%;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 14px;
  background: linear-gradient(180deg, rgba(20, 12, 18, 0.95), rgba(20, 12, 18, 0.75));
  border-bottom: 1px solid rgba(217, 165, 90, 0.25);
  font-size: 13px; color: var(--text-dim);
  z-index: 20;
  gap: 8px;
}
.tb-left { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.tb-left span { white-space: nowrap; }
#tb-room { color: var(--gold-bright); font-weight: bold; letter-spacing: 1px; }
.tb-right { display: flex; gap: 8px; }

#canvas-wrap { position: relative; flex: 1; width: 100%; overflow: hidden; background: #12090e; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* 回合提示：贴右下角操作栏上方（与倒计时/出牌按钮同一视线焦点，不挡牌面与上家信息条） */
.turn-banner {
  position: absolute; right: 12px; bottom: 88px;
  background: rgba(20, 12, 18, 0.8);
  border: 1px solid var(--line);
  color: var(--gold-bright);
  font-size: 14px;
  padding: 6px 18px; border-radius: 16px;
  z-index: 15;
  pointer-events: none;
  animation: fadeIn 0.2s ease;
}
.liuju-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  color: #ff9a8f; font-size: 13px;
  background: rgba(60, 10, 10, 0.7);
  border: 1px solid rgba(255, 100, 90, 0.4);
  padding: 4px 14px; border-radius: 12px;
  z-index: 15; pointer-events: none;
}

/* ── 操作栏（右下角，避开底部中央的手牌） ── */
.action-bar {
  position: absolute; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 14px; row-gap: 8px;
  flex-wrap: wrap; justify-content: flex-end;
  z-index: 30;
  padding: 8px 14px;
  background: rgba(18, 10, 14, 0.72);
  border: 1px solid rgba(217, 165, 90, 0.3);
  border-radius: 18px;
  backdrop-filter: blur(4px);
  max-width: min(46vw, 560px);
}
.ab-btns { display: flex; gap: 10px; }
.ab-btns .btn { font-size: 17px; font-weight: bold; padding: 10px 22px; }
.btn.hu {
  background: linear-gradient(180deg, #ffd45e, #c98a1e);
  color: #402208;
  border-color: rgba(255, 230, 150, 0.8);
  box-shadow: 0 0 18px rgba(255, 200, 80, 0.45);
}
.btn.gang { background: linear-gradient(180deg, #b04a9e, #6e2260); border-color: rgba(230, 140, 220, 0.5); }
.btn.peng { background: linear-gradient(180deg, #2f8e6e, #175540); border-color: rgba(120, 230, 180, 0.4); }

.ab-timer { position: relative; width: 46px; height: 46px; flex-shrink: 0; }
.timer-svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.timer-svg circle { fill: none; stroke-width: 4; }
.timer-bg { stroke: rgba(255, 255, 255, 0.12); }
.timer-ring {
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-dasharray: 119.4;
  stroke-dashoffset: 0;
  transition: stroke 0.3s;
}
.ab-timer.urgent .timer-ring { stroke: #ff5a4e; animation: pulse 0.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.45; } }
#timer-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: bold; color: var(--gold-bright);
}
.ab-timer.urgent #timer-text { color: #ff8a80; }

.ting-hint {
  position: absolute;
  bottom: calc(100% + 8px); /* 悬浮于操作栏上方，不占栏内宽度 */
  right: 0;
  max-width: 340px;
  font-size: 12px; color: #ffe9a8;
  background: rgba(60, 40, 10, 0.6);
  border: 1px solid rgba(255, 210, 120, 0.35);
  padding: 6px 12px; border-radius: 10px;
  line-height: 1.7;
}
.ting-hint .tiles { letter-spacing: 3px; color: #ffd166; font-weight: bold; }

.gang-menu {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 8px;
  background: rgba(30, 18, 26, 0.97);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 40;
  min-width: 140px;
}
.gang-menu button {
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06);
  color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-size: 14px;
}
.gang-menu button:hover { background: rgba(217, 165, 90, 0.2); }

/* ── 结算 ── */
.settle-panel { width: min(640px, 94vw); }
.settle-title {
  text-align: center; font-size: 30px; font-weight: bold;
  font-family: 'KaiTi', 'STKaiti', serif;
  color: var(--gold-bright);
  text-shadow: 0 0 24px rgba(255, 200, 80, 0.5);
  margin-bottom: 14px;
  letter-spacing: 8px;
}
.settle-title.hu { color: #ffd45e; }
.settle-title.liuju { color: #b9a998; text-shadow: none; }
.settle-body { display: flex; flex-direction: column; gap: 10px; }
.settle-winner { background: rgba(255, 220, 120, 0.08); border: 1px solid rgba(255, 210, 120, 0.3); border-radius: 12px; padding: 12px 16px; }
.sw-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 15px; }
.sw-head .who { font-weight: bold; color: #ffd45e; }
.sw-head .src { font-size: 12px; color: var(--text-dim); background: rgba(255, 255, 255, 0.07); padding: 2px 10px; border-radius: 8px; }
.sw-fan { font-size: 18px; font-weight: bold; color: #ff9d3c; }
.sw-tiles { display: flex; gap: 3px; flex-wrap: wrap; margin: 8px 0; }
.sw-tiles img { height: 44px; border-radius: 4px; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); }
.sw-detail { display: flex; gap: 8px; flex-wrap: wrap; }
.sw-detail .tag { font-size: 12px; padding: 3px 10px; border-radius: 8px; background: rgba(217, 165, 90, 0.15); color: var(--gold-bright); }
.sw-detail .tag.flag { background: rgba(255, 90, 60, 0.2); color: #ffb0a5; }
.settle-deltas { border-top: 1px dashed rgba(255, 255, 255, 0.12); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.delta-row { display: flex; justify-content: space-between; font-size: 14px; }
.delta-row .name { color: var(--text-dim); }
.delta-row .score { font-weight: bold; }
.delta-row .score.plus { color: #7fe0a8; }
.delta-row .score.minus { color: #ff8a80; }
.delta-row .score.zero { color: var(--text-dim); }
.settle-lines { font-size: 13px; color: var(--text-dim); line-height: 1.9; }
.settle-actions { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }
