/* ================= 基础 ================= */
:root {
  --bg: #06130f;
  --bg-2: #0a1f19;
  --felt: #0d3a2c;
  --felt-2: #0a2c22;
  --gold: #e8c887;
  --gold-2: #c9a25a;
  --text: #f4ecdb;
  --muted: #8ea79b;
  --red: #e2604d;
  --green: #46d99b;
  --line: rgba(232, 200, 135, 0.16);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: radial-gradient(120% 80% at 50% 0%, #10382b 0%, #071a15 55%, #04100c 100%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font-family: inherit; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
input { color: inherit; }
img { display: block; }

.muted { color: var(--muted); }
.gold { color: var(--gold); }
.green { color: var(--green); }
.red { color: var(--red); }
.hidden { display: none !important; }

/* ================= 按钮 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.2s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-gold {
  background: linear-gradient(180deg, #f4dca8, #d3a961);
  border: 0;
  color: #2a1c06;
  box-shadow: 0 8px 22px rgba(211, 169, 97, 0.28);
}
.btn-green {
  background: linear-gradient(180deg, #25c47c, #0f8f56);
  color: #04210f;
  border: 0;
}
.btn-ghost { background: rgba(255, 255, 255, 0.04); }
.btn-block { width: 100%; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }

/* ================= 入口 ================= */
.entry {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.entry-box { text-align: center; max-width: 340px; }
.brand-suit {
  width: 92px; height: 92px; margin: 0 auto 26px;
  border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; color: #1c1406;
  background: linear-gradient(150deg, #f6e0b1, #cfa45c);
  box-shadow: 0 18px 40px rgba(207, 164, 92, 0.28);
}
.brand h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: 3px; }
.brand p { margin: 0 0 34px; color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.entry-status { font-size: 14px; color: var(--muted); min-height: 60px; }
.gate-msg { display: flex; flex-direction: column; gap: 10px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,0.03); }
.gate-msg b { font-size: 17px; color: var(--text); }
.gate-msg span { font-size: 13px; line-height: 1.7; }
.blocked .brand-suit { filter: grayscale(0.7); opacity: 0.7; }

/* ================= 通用头像 / 徽标 ================= */
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover; background: #1c4a3a; flex: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.avatar-txt {
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #10241c;
  background: linear-gradient(150deg, #f0d9a7, #c39c58);
}
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  height: 18px; padding: 0 6px; border-radius: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
}
.badge-banker { background: linear-gradient(180deg, #ffe6ad, #d3a34e); color: #3a2604; }
.badge-ready { background: rgba(70, 217, 155, 0.16); color: var(--green); border: 1px solid rgba(70,217,155,.3); }
.badge-spectate { background: rgba(255,255,255,.08); color: var(--muted); }
.badge-off { background: rgba(255,255,255,.06); color: #6f8579; }
.badge-cheat {
  background: rgba(155, 89, 255, 0.16);
  color: #cbb0ff;
  border: 1px solid rgba(155, 89, 255, 0.35);
}
.badge-declare {
  background: rgba(232, 200, 135, .16);
  color: var(--gold);
  border: 1px solid rgba(232, 200, 135, .35);
}

/* ================= 大厅 ================= */
.lobby-brand {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px 0;
}
.lb-mark {
  width: 26px; height: 26px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, #f6e0b1, #cfa45c);
  color: #2a1c06; font-size: 14px;
}
.lobby-brand b { font-size: 17px; letter-spacing: 2px; }
.lb-sub { font-size: 10px; color: var(--muted); letter-spacing: 1px; }

.hall-entries {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 4px 0 6px;
}
.hall-entry {
  display: block;
  padding: 12px 10px;
  border-radius: 14px;
  text-align: left;
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}
.hall-entry b { display: block; font-size: 17px; letter-spacing: 1px; }
.hall-entry span { display: block; margin-top: 4px; font-size: 10px; color: var(--muted); }
.hall-entry.active {
  border-color: var(--gold-2);
  background: rgba(232, 200, 135, .1);
}
.hall-entry.union {
  background: linear-gradient(150deg, #3a2a16, #1c130a);
}
.match-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 4px;
  padding: 12px 14px;
  border-radius: 14px;
  color: var(--text);
  text-decoration: none;
  background: linear-gradient(135deg, #3a2418, #1a0f08);
  border: 1px solid rgba(232, 200, 135, .3);
}
.match-banner b { display: block; font-size: 15px; letter-spacing: 1px; }
.match-banner span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.match-banner em { font-style: normal; font-size: 12px; color: var(--gold); }

.page {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: var(--safe-t);
}
.topbar {
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.me-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  min-width: 0;
}
.me-meta { flex: 1; min-width: 0; }
.me-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-uid { font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: 0.5px; }
.balance-box {
  text-align: right;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.balance-box b { font-size: 18px; color: var(--gold); font-variant-numeric: tabular-nums; }
.balance-box span { font-size: 10px; color: var(--muted); margin-left: 2px; }
.balance-box em { display: block; font-style: normal; font-size: 9px; color: var(--muted); letter-spacing: 1px; }

.wallet-banner {
  margin: 0 16px 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(226, 96, 77, 0.1);
  border: 1px solid rgba(226, 96, 77, 0.28);
  color: #f0a596;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wallet-banner button { color: var(--gold); font-size: 12px; text-decoration: underline; }

.lobby-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 16px calc(96px + var(--safe-b));
  -webkit-overflow-scrolling: touch;
}
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 2px 10px;
  font-size: 12px; letter-spacing: 1.5px; color: var(--muted);
}
.section-title b { color: var(--text); font-size: 14px; letter-spacing: 0.5px; }

.games { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.game-card {
  position: relative;
  height: 132px;
  border-radius: 18px;
  padding: 16px;
  text-align: left;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, #12503c, #0a2a20);
  transition: border-color .15s, transform .12s;
}
.game-card:active { transform: scale(0.98); }
.game-card.active { border-color: rgba(232, 200, 135, .65); box-shadow: 0 0 0 1px rgba(232,200,135,.25) inset, 0 10px 30px rgba(0,0,0,.35); }
.game-card .gc-name { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
.game-card .gc-sub { margin-top: 6px; font-size: 11px; color: rgba(244, 236, 219, .6); line-height: 1.5; }
.game-card .gc-seats { position: absolute; bottom: 14px; left: 16px; font-size: 11px; color: var(--gold); }
.game-card .gc-deco {
  position: absolute; right: -6px; bottom: -14px;
  font-size: 74px; line-height: 1; opacity: .14; transform: rotate(-12deg);
}
.game-card.niuniu { background: linear-gradient(150deg, #1a4f3f, #08241b); }
.game-card.sangong { background: linear-gradient(150deg, #4a2b1e, #1e0f0a); }

.panel {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.panel-head b { font-size: 14px; }
.panel-head span { font-size: 11px; color: var(--muted); }

.bases { display: flex; gap: 8px; margin-bottom: 12px; }
.base-opt {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .18);
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
.base-opt.active {
  border-color: var(--gold-2);
  color: var(--gold);
  background: rgba(232, 200, 135, .1);
}
.join-row { display: flex; gap: 8px; }
.join-row input {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .25);
  padding: 0 14px;
  font-size: 16px;
  letter-spacing: 4px;
  outline: none;
  min-width: 0;
}
.join-row input::placeholder { letter-spacing: 1px; font-size: 13px; color: #5f7469; }
.join-row input:focus { border-color: rgba(232,200,135,.5); }

.room-list { display: flex; flex-direction: column; gap: 8px; }
.room-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(0,0,0,.16);
  border: 1px solid rgba(255,255,255,.05);
}
.room-row .rr-id { font-size: 16px; font-weight: 700; letter-spacing: 1px; color: var(--gold); font-variant-numeric: tabular-nums; }
.room-row .rr-meta { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); }
.room-row .rr-meta b { color: var(--text); font-size: 12px; font-weight: 500; }
.room-empty { padding: 18px 0; text-align: center; font-size: 12px; color: #5f7469; }

/* 房间卡片 */
.room-panel { padding: 12px; }
.room-card {
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--line);
}
.room-card.full { opacity: .72; }
.rc-top { display: flex; align-items: center; gap: 8px; }
.rc-game { font-size: 13px; font-weight: 700; }
.rc-base {
  font-size: 10px; color: var(--gold);
  border: 1px solid rgba(232, 200, 135, .25);
  padding: 2px 6px; border-radius: 6px;
}
.rc-state { margin-left: auto; font-size: 10px; padding: 2px 7px; border-radius: 6px; }
.rc-state.wait { color: var(--green); background: rgba(70, 217, 155, .12); }
.rc-state.play { color: #ffc9bd; background: rgba(226, 96, 77, .14); }
.rc-mid { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; }
.rc-id {
  padding: 0; border: 0; background: none;
  font-size: 20px; font-weight: 700; letter-spacing: 2px;
  color: var(--gold); font-variant-numeric: tabular-nums;
}
.rc-count { font-size: 11px; color: var(--muted); }
.rc-seats { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }
.rc-seat .avatar { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.rc-seat.off { opacity: .35; filter: grayscale(1); }
.rc-empty {
  width: 26px; height: 26px; border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, .16);
  display: inline-block;
}
.rc-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.rc-online { font-size: 10px; color: var(--muted); }

/* 左下角开房 */
.fab {
  position: fixed;
  left: 16px;
  bottom: calc(18px + var(--safe-b));
  z-index: 35;
  height: 48px;
  padding: 0 20px;
  border-radius: 24px;
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, #f4dca8, #d3a961);
  color: #2a1c06;
  font-size: 15px; font-weight: 700;
  box-shadow: 0 10px 28px rgba(211, 169, 97, .35);
}
.fab:active { transform: scale(.97); }

.bgm-btn {
  position: fixed;
  right: 16px;
  bottom: calc(18px + var(--safe-b));
  z-index: 35;
  width: 44px;
  height: 44px;
  border-radius: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  color: var(--gold);
  font-size: 18px;
}
.bgm-btn.off, .icon-btn.off { color: var(--muted); opacity: .55; }

/* 开房玩法切换 */
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; height: 40px; border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
  color: var(--muted);
  font-size: 14px;
}
.seg button.active {
  border-color: var(--gold-2);
  color: var(--gold);
  background: rgba(232, 200, 135, .1);
}

/* ================= 牌桌 ================= */
.game-page { position: relative; height: 100dvh; display: flex; flex-direction: column; padding-top: var(--safe-t); }
.table-top {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  font-size: 16px;
  position: relative;
  color: var(--text);
  text-decoration: none;
}
.icon-btn.has-pending::after {
  content: "";
  position: absolute; right: 3px; top: 3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(232, 200, 135, .9);
}
.table-meta { flex: 1; min-width: 0; }
.table-meta .tm-1 { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.table-meta .tm-1 .code { color: var(--gold); letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.table-meta .tm-2 {
  font-size: 10px; color: var(--muted); margin-top: 2px;
  display: flex; gap: 10px; flex-wrap: nowrap;
  white-space: nowrap; overflow: hidden;
}
.table-meta .tm-2 span { flex: none; }
.link-btn {
  padding: 0; border: 0; background: none;
  font-size: 10px; color: var(--muted);
  text-decoration: underline;
}

.table-area {
  position: relative;
  flex: 1;
  margin: 4px 10px 0;
  border-radius: 26px;
  background:
    radial-gradient(70% 60% at 50% 45%, #12503e 0%, #0b3328 60%, #08241c 100%);
  border: 1px solid rgba(232, 200, 135, .16);
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .45), 0 16px 40px rgba(0, 0, 0, .35);
  overflow: hidden;
  min-height: 0;
}
.standers {
  padding: 0 14px 4px;
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-area::before {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 20px;
  border: 1px solid rgba(232, 200, 135, .08);
  pointer-events: none;
}

.table-center {
  position: absolute; left: 50%; top: 48%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: 150px;
}
.round-no { font-size: 10px; letter-spacing: 2px; color: rgba(244,236,219,.45); }
.round-no b { color: var(--gold); font-size: 12px; }
.phase-name { margin-top: 6px; font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.phase-sub { margin-top: 4px; font-size: 10px; color: var(--muted); min-height: 14px; }
.cd-wrap { margin: 8px auto 0; width: 96px; height: 4px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.cd-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #f4dca8, #c9a25a); border-radius: 3px; }
.pot-line { margin-top: 8px; font-size: 11px; color: var(--gold); letter-spacing: 1px; }

/* 座位 */
.seat {
  position: absolute;
  width: 84px;
  transform: translate(-50%, -50%);
  text-align: center;
  transition: filter .2s;
}
.seat-avatar-wrap { position: relative; width: 44px; height: 44px; margin: 0 auto; }
.seat .avatar { width: 44px; height: 44px; border-radius: 13px; }
.seat.self .avatar { border-color: rgba(232,200,135,.6); }
.seat.acting .seat-avatar-wrap::after {
  content: ""; position: absolute; inset: -3px; border-radius: 16px;
  border: 1.5px solid var(--gold);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
.seat.offline { filter: grayscale(1); opacity: .5; }
.seat-name {
  margin-top: 3px; font-size: 10px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; color: #d8e3dc;
}
.seat-chips { font-size: 10px; color: var(--gold); font-variant-numeric: tabular-nums; }
.seat-badges { display: flex; gap: 3px; justify-content: center; margin-top: 2px; min-height: 16px; flex-wrap: wrap; }
.seat-cards { display: flex; justify-content: center; margin-top: 3px; min-height: 34px; }
.seat-cards .pcard { margin-left: -9px; }
.seat-cards .pcard:first-child { margin-left: 0; }
.delta-bubble {
  position: absolute; left: 50%; top: -16px; transform: translateX(-50%);
  font-size: 13px; font-weight: 700; white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0,0,0,.8);
  animation: floatUp .5s ease both;
}
@keyframes floatUp { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.grab-tag {
  position: absolute; right: -6px; top: -6px;
  background: rgba(0,0,0,.55); border: 1px solid var(--line);
  border-radius: 7px; font-size: 9px; padding: 1px 5px; color: var(--gold);
}

/* 扑克牌 */
.pcard {
  width: 30px; height: 42px;
  border-radius: 5px;
  background: linear-gradient(160deg, #ffffff, #f1eee4);
  color: #1b1b1b;
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  border: 1px solid rgba(0, 0, 0, .08);
  font-weight: 700;
  flex: none;
  user-select: none;
}
.pcard .pc-r { font-size: 12px; line-height: 1; }
.pcard .pc-s { font-size: 11px; line-height: 1; margin-top: 1px; }
.pcard.red { color: #d23b2f; }
.pcard.back {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.09) 0 3px, transparent 3px 6px),
    linear-gradient(160deg, #1e5a48, #113a2d);
  border: 1px solid rgba(232,200,135,.25);
}
.pcard.back::after {
  content: "♠"; color: rgba(232,200,135,.55); font-size: 12px;
}
.pcard.sm { width: 24px; height: 34px; border-radius: 4px; }
.pcard.sm .pc-r { font-size: 10px; }
.pcard.sm .pc-s { font-size: 9px; }
.pcard.lg { width: 52px; height: 74px; border-radius: 8px; }
.pcard.lg .pc-r { font-size: 20px; }
.pcard.lg .pc-s { font-size: 18px; }
.pcard.dealt { animation: dealIn .28s ease both; }
@keyframes dealIn { from { opacity: 0; transform: translateY(-10px) scale(.9); } to { opacity: 1; transform: none; } }

/* 我的区域 */
.myzone {
  padding: 6px 14px 2px;
  display: flex; align-items: center; gap: 12px;
}
.my-hand-info { flex: none; min-width: 62px; }
.my-hand-name { font-size: 13px; font-weight: 700; color: var(--gold); }
.my-hand-pay { font-size: 10px; color: var(--muted); }
.my-cards { flex: 1; display: flex; justify-content: center; gap: 4px; min-height: 74px; align-items: center; }
.my-cards .pcard { width: 46px; height: 66px; border-radius: 7px; }
.my-cards .pcard .pc-r { font-size: 17px; }
.my-cards .pcard .pc-s { font-size: 16px; }

/* 操作区 */
.actionbar {
  padding: 8px 12px calc(10px + var(--safe-b));
  display: flex; gap: 8px; align-items: stretch;
  min-height: 66px;
}
.action-hint {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted);
  border: 1px dashed rgba(255,255,255,.09);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
}
.act-group { flex: 1; display: flex; gap: 6px; }
.act-btn {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  padding: 8px 4px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
}
.act-btn b { font-size: 14px; }
.act-btn span { font-size: 9px; color: var(--muted); }
.act-btn.primary { background: linear-gradient(180deg, #f4dca8, #d3a961); border: 0; color: #2a1c06; }
.act-btn.primary span { color: rgba(42,28,6,.65); }
.act-btn.danger { background: rgba(226,96,77,.14); border-color: rgba(226,96,77,.3); }
.act-btn:active { transform: scale(.97); }

/* 结果层 */
.result-mask {
  position: absolute; inset: 0; z-index: 40;
  background: rgba(3, 12, 9, .72);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.result-card {
  width: 100%; max-width: 380px;
  max-height: 86%;
  overflow-y: auto;
  border-radius: 20px;
  background: linear-gradient(170deg, #0f3a2d, #082319);
  border: 1px solid rgba(232,200,135,.28);
  box-shadow: var(--shadow);
  padding: 16px;
}
.result-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-head b { font-size: 16px; letter-spacing: 1px; }
.result-head span { font-size: 11px; color: var(--muted); }
.result-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 6px; border-bottom: 1px dashed rgba(255,255,255,.07);
}
.result-row:last-child { border-bottom: 0; }
.result-row .rr-name { width: 62px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row .rr-cards { display: flex; gap: 2px; }
.result-row .rr-cards .pcard { width: 20px; height: 28px; border-radius: 3px; }
.result-row .rr-cards .pcard .pc-r { font-size: 9px; }
.result-row .rr-cards .pcard .pc-s { font-size: 8px; }
.result-row .rr-hand { flex: 1; font-size: 10px; color: var(--muted); }
.result-row .rr-delta { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rake-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  color: #cbb0ff;
  background: rgba(155, 89, 255, .14);
  border: 1px solid rgba(155, 89, 255, .28);
}
.win-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  color: #2a1c06;
  background: var(--gold);
}
.lose-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  color: #9fb0a7;
  background: rgba(255, 255, 255, .08);
}
.match-rank {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, .1);
}

.compare-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(3, 10, 7, .82);
  backdrop-filter: blur(4px);
}
.compare-card {
  width: 100%;
  max-width: 380px;
  padding: 16px;
  border-radius: 20px;
  background: linear-gradient(170deg, #0f3a2d, #082319);
  border: 1px solid rgba(232, 200, 135, .3);
  box-shadow: var(--shadow);
}
.cmp-title {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 8px;
}
.cmp-head { text-align: center; font-size: 11px; color: var(--muted); margin-bottom: 10px; }
.cmp-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.cmp-side { flex: 1; min-width: 0; text-align: center; }
.cmp-name {
  font-size: 11px;
  color: #fff;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cmp-cards { display: flex; justify-content: center; min-height: 44px; }
.cmp-cards .pcard { width: 28px; height: 40px; margin-left: -10px; }
.cmp-cards .pcard:first-child { margin-left: 0; }
.cmp-hand { margin-top: 4px; font-size: 10px; color: var(--muted); }
.cmp-vs { font-size: 16px; font-weight: 800; color: var(--gold); letter-spacing: 1px; }
.cmp-result { text-align: center; font-size: 18px; font-weight: 800; margin-top: 12px; }
.cmp-result.win { color: var(--green); }
.cmp-result.lose { color: var(--red); }
.cmp-pulse { animation: cmpIn .25s ease both; }
@keyframes cmpIn {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: none; }
}
.mr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 2px;
  font-size: 12px;
  color: var(--text);
}
.mr-row b { font-variant-numeric: tabular-nums; }
.declare-btn {
  margin-top: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10px;
  color: var(--gold);
  background: rgba(232, 200, 135, .12);
  border: 1px solid rgba(232, 200, 135, .3);
}
.declare-btn:disabled { opacity: .55; }
.vote-bar {
  height: 4px;
  margin: 10px 0 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.vote-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--gold);
  transition: width .2s;
}
.qr-box {
  width: fit-content;
  margin: 4px auto 10px;
  padding: 0;
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}
.qr-box img { display: block; width: 300px; height: auto; }
.qr-tip { text-align: center; font-size: 11px; color: var(--muted); margin-bottom: 14px; }

.chat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.chat-phrase {
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 10px;
  text-align: left;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--line);
}
.chat-phrase:active { background: rgba(232, 200, 135, .12); }
.voice-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}
.voice-toggle input { width: 16px; height: 16px; accent-color: #e8c887; }

.chat-bubble {
  position: absolute;
  left: 50%;
  top: -40px;
  transform: translateX(-50%);
  max-width: 172px;
  padding: 6px 9px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .84);
  border: 1px solid rgba(232, 200, 135, .4);
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  z-index: 20;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
  animation: chatIn .18s ease both;
}
.chat-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 8px;
  height: 8px;
  background: rgba(0, 0, 0, .84);
  border-right: 1px solid rgba(232, 200, 135, .4);
  border-bottom: 1px solid rgba(232, 200, 135, .4);
  transform: translateX(-50%) rotate(45deg);
}
@keyframes chatIn {
  from { opacity: 0; transform: translate(-50%, 4px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.result-foot { margin-top: 12px; text-align: center; font-size: 11px; color: var(--muted); }
.result-foot b { color: var(--gold); }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(2, 9, 7, .75);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .16s ease;
}
@media (min-width: 520px) { .modal-mask { align-items: center; } }
.modal {
  width: 100%; max-width: 460px;
  max-height: 84dvh;
  overflow-y: auto;
  background: linear-gradient(180deg, #0e3529, #092219);
  border: 1px solid rgba(232,200,135,.22);
  border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(18px + var(--safe-b));
  display: flex; flex-direction: column;
  animation: sheetUp .22s ease;
}
@media (min-width: 520px) { .modal { border-radius: 20px; padding-bottom: 18px; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.modal-head b { font-size: 16px; }
.modal-close { font-size: 20px; color: var(--muted); line-height: 1; padding: 4px 8px; }
.wallet-total { text-align: center; padding: 10px 0 16px; }
.wallet-total b { font-size: 34px; color: var(--gold); font-variant-numeric: tabular-nums; }
.wallet-total span { font-size: 12px; color: var(--muted); margin-left: 4px; }
.wallet-uid {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  font-size: 12px; margin-bottom: 12px;
}
.wallet-uid code { color: var(--gold); letter-spacing: 1px; }
.ledger-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ledger-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 4px; border-bottom: 1px dashed rgba(255,255,255,.06);
}
.ledger-row .lr-main { flex: 1; min-width: 0; }
.ledger-row .lr-t1 { font-size: 12px; }
.ledger-row .lr-t2 { font-size: 10px; color: var(--muted); margin-top: 2px; }
.ledger-row .lr-amt { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger-empty { padding: 26px 0; text-align: center; color: #5f7469; font-size: 12px; }

/* 控牌面板 */
.cheat-seats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 6px;
}
.cheat-seat {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
  text-align: left;
}
.cheat-seat b {
  display: block; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cheat-seat span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }
.cheat-seat.active {
  border-color: var(--gold-2);
  background: rgba(232, 200, 135, .12);
}
.cheat-modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cheat-mode {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, .2);
  font-size: 12px;
  color: var(--muted);
}
.cheat-mode.active {
  border-color: var(--gold-2);
  color: var(--gold);
  background: rgba(232, 200, 135, .12);
}
.row .ops { flex-wrap: wrap; }
.tip-box {
  margin-top: 12px; padding: 10px 12px; border-radius: 12px;
  background: rgba(232,200,135,.07); border: 1px solid rgba(232,200,135,.18);
  font-size: 11px; line-height: 1.7; color: #cbb891;
}

/* Toast */
.toast-wrap {
  position: fixed; left: 0; right: 0; top: calc(16px + var(--safe-t));
  z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 86vw;
  padding: 9px 16px; border-radius: 20px;
  background: rgba(6, 24, 18, .94);
  border: 1px solid rgba(232,200,135,.28);
  font-size: 12.5px; color: var(--text);
  box-shadow: 0 10px 26px rgba(0,0,0,.4);
  animation: toastIn .2s ease both;
}
.toast.warn { border-color: rgba(226,96,77,.45); color: #ffc9bd; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ================= 玩家工会页 ================= */
.match-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px 16px calc(60px + var(--safe-b));
}
.match-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.match-card {
  padding: 14px;
  border-radius: 16px;
  background: linear-gradient(150deg, #123328, #0a211a);
  border: 1px solid var(--line);
}
.match-card b { display: block; font-size: 16px; }
.match-card span { display: block; font-size: 10px; color: var(--muted); margin: 4px 0 10px; line-height: 1.5; }
.match-card button {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(180deg, #f4dca8, #d3a961);
  color: #2a1c06;
  font-size: 13px;
  font-weight: 700;
}
.match-room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .16);
  border: 1px solid rgba(255, 255, 255, .05);
}
.match-room b { display: block; font-size: 13px; }
.match-room span { display: block; margin-top: 2px; font-size: 10px; color: var(--muted); }

.union-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(60px + var(--safe-b));
}
.union-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.union-top h1 { margin: 0; font-size: 19px; letter-spacing: 2px; }
.union-top p { margin: 2px 0 0; font-size: 10px; color: var(--muted); }
.union-me { display: flex; align-items: center; gap: 10px; }
.union-me-meta { flex: 1; min-width: 0; }
.union-me-meta b { display: block; font-size: 14px; }
.union-me-meta span { font-size: 10px; color: var(--muted); }
.union-balance { text-align: right; }
.union-balance b { font-size: 22px; color: var(--gold); }
.union-balance span { font-size: 10px; color: var(--muted); margin-left: 2px; }
.union-actions { display: flex; gap: 8px; margin-top: 12px; }
.union-actions .btn { flex: 1; }
.union-notice {
  font-size: 12px;
  line-height: 1.8;
  color: #cfdcd5;
  white-space: pre-wrap;
}

/* ================= 工会后台 ================= */
.agent-body {
  background:
    radial-gradient(100% 60% at 50% 0%, #0d2a22 0%, #061410 60%, #04100c 100%);
  overflow: auto;
  min-height: 100dvh;
}
.agent-login {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.agent-login .card {
  width: 100%; max-width: 360px;
  padding: 28px 24px;
  border-radius: 20px;
  background: linear-gradient(170deg, #10382c, #08211a);
  border: 1px solid rgba(232,200,135,.22);
  box-shadow: var(--shadow);
}
.agent-login h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: 2px; }
.agent-login p { margin: 0 0 22px; font-size: 12px; color: var(--muted); }
.login-logo {
  width: 58px; height: 58px; margin: 0 auto 16px;
  border-radius: 17px;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #1c1406;
  background: linear-gradient(150deg, #f6e0b1, #cfa45c);
  box-shadow: 0 14px 30px rgba(207, 164, 92, .25);
}
.login-name {
  text-align: center;
  font-size: 17px;
  letter-spacing: 5px;
  color: var(--gold);
  margin: -6px 0 16px;
}
.agent-login .card h1 { text-align: center; }
.agent-login .card p { text-align: center; }
.reg-ok { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0 6px; }
.reg-id {
  text-align: center;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.reg-tip { text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7; margin: 10px 0 16px; }
.remember-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -2px 0 12px;
  font-size: 11px;
  color: var(--muted);
}
.remember-row input { width: 15px; height: 15px; accent-color: #e8c887; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; letter-spacing: 1px; }
.field input {
  width: 100%; height: 44px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(0,0,0,.28);
  padding: 0 14px; font-size: 15px; outline: none;
}
.field input:focus { border-color: rgba(232,200,135,.5); }

.agent-shell { max-width: 1080px; margin: 0 auto; padding: 20px 16px 60px; }
.agent-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.agent-top h1 { font-size: 19px; margin: 0; letter-spacing: 2px; }
.agent-top .who { flex: 1; font-size: 11px; color: var(--muted); }
.agent-tag {
  font-size: 10px; padding: 3px 8px; border-radius: 6px;
  background: rgba(70,217,155,.12); color: var(--green); border: 1px solid rgba(70,217,155,.28);
}
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
@media (min-width: 900px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } }
.stat {
  padding: 14px; border-radius: 14px;
  background: rgba(255,255,255,.035); border: 1px solid var(--line);
}
.stat .s-label { font-size: 10px; color: var(--muted); letter-spacing: 1px; }
.stat .s-value { margin-top: 6px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); }
.stat .s-sub { font-size: 10px; color: var(--muted); margin-top: 3px; }

.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tab {
  padding: 9px 16px; border-radius: 10px; font-size: 13px; color: var(--muted);
  border: 1px solid transparent;
}
.tab.active { background: rgba(232,200,135,.1); color: var(--gold); border-color: rgba(232,200,135,.25); }

.toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.toolbar input {
  flex: 1; min-width: 140px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0,0,0,.25);
  padding: 0 12px; font-size: 13px; outline: none;
}
.toolbar input:focus { border-color: rgba(232,200,135,.5); }

.sheet {
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.025);
}
.table-head, .row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.9fr 0.9fr 0.8fr 1.4fr;
  gap: 8px; align-items: center; padding: 11px 12px;
}
.table-head { font-size: 10px; color: var(--muted); letter-spacing: 1px; background: rgba(0,0,0,.22); }
.row { font-size: 12px; border-top: 1px solid rgba(255,255,255,.045); }
.row .r-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row .r-name .nm { min-width: 0; }
.row .r-name .nm b { display: block; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .r-name .nm span { font-size: 9px; color: var(--muted); letter-spacing: .5px; }
.row .num { font-variant-numeric: tabular-nums; }
.row .ops { display: flex; gap: 6px; justify-content: flex-end; }
.row .ops .btn { height: 28px; padding: 0 10px; font-size: 11px; border-radius: 7px; }
.online-dot { width: 6px; height: 6px; border-radius: 50%; background: #3a5047; flex: none; }
.online-dot.on { background: var(--green); box-shadow: 0 0 6px rgba(70,217,155,.7); }
.empty { padding: 30px 0; text-align: center; color: #5f7469; font-size: 12px; }

/* 上分弹窗 */
.amt-presets { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.amt-presets button {
  flex: 1; min-width: 64px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0,0,0,.2); font-size: 13px; color: var(--muted);
}
.amt-presets button.active { border-color: var(--gold-2); color: var(--gold); background: rgba(232,200,135,.1); }
.modal-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.2);
  border: 1px solid var(--line); margin-bottom: 14px;
}
.modal-user .mu-meta { flex: 1; min-width: 0; }
.modal-user .mu-meta b { display: block; font-size: 13px; }
.modal-user .mu-meta span { font-size: 10px; color: var(--muted); }
.modal-user .mu-bal { font-size: 15px; color: var(--gold); font-weight: 700; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }

/* 滚动条 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(232,200,135,.2); border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

/* 后台表格变体 */
.sheet { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.row .avatar { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.ledger-sheet .table-head,
.ledger-sheet .row {
  grid-template-columns: 0.9fr 1.5fr 0.6fr 0.7fr 1.2fr 1.5fr;
  min-width: 660px;
}
.room-sheet .table-head,
.room-sheet .row {
  grid-template-columns: 0.8fr 0.9fr 0.5fr 1.4fr 1.3fr 0.8fr;
  min-width: 580px;
}
.row > div { min-width: 0; }

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat .s-value { font-size: 19px; }
  .agent-shell { padding: 16px 12px 50px; }
  .row { font-size: 11px; }
  .row .ops .btn { height: 26px; padding: 0 8px; font-size: 10px; }
  .join-row input { letter-spacing: 3px; }
}

/* ================= 棋牌桌视觉（参考深色底纹 + 绿色椭圆桌） ================= */
.game-page {
  background:
    radial-gradient(60% 45% at 50% 45%, rgba(30, 80, 50, .35), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .018) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #0b0f18 0%, #0a1a16 45%, #120b16 100%);
}
.game-page::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(232, 200, 135, .055) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 65%, rgba(232, 200, 135, .04) 0 2px, transparent 3px);
  background-size: 64px 64px, 86px 86px;
  opacity: .7;
}

.table-top {
  position: relative;
  z-index: 5;
  padding: calc(8px + var(--safe-t)) 8px 6px;
  background: linear-gradient(180deg, rgba(5, 10, 16, .94), rgba(5, 10, 16, .25));
  border-bottom: 1px solid rgba(232, 200, 135, .12);
  gap: 6px;
}
.tt-left, .tt-right { display: flex; align-items: center; gap: 6px; flex: none; }
.tt-center { flex: 1; min-width: 0; text-align: center; }
.round-line { font-size: 10px; color: var(--muted); white-space: nowrap; }
.round-line b { color: var(--gold); font-size: 13px; }
.state-pill {
  display: inline-block;
  margin-left: 3px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 9px;
  color: var(--green);
  background: rgba(70, 217, 155, .12);
}
.tt-center .phase-name { font-size: 12px; margin-top: 1px; }
.anti-tag {
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 10px;
  color: #ffd9cf;
  background: rgba(226, 96, 77, .22);
  border: 1px solid rgba(226, 96, 77, .45);
  font-variant-numeric: tabular-nums;
}
.auto-ready { display: flex; align-items: center; gap: 4px; font-size: 9px; color: #d8c69a; }
.auto-ready input { width: 14px; height: 14px; accent-color: #e8c887; }
.casino-btn {
  height: 28px;
  padding: 0 9px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(232, 200, 135, .22), rgba(232, 200, 135, .07));
  border: 1px solid rgba(232, 200, 135, .45);
  color: #f0d9a7;
  font-size: 11px;
  white-space: nowrap;
}
.casino-btn:disabled { opacity: .45; }
#btnCheat { font-size: 15px; padding: 0 10px; }
.casino-btn.has-pending { position: relative; }
.casino-btn.has-pending::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(232, 200, 135, .9);
}

.table-area {
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  margin: 4px 8px 0;
}
.table-area::before {
  content: "";
  position: absolute;
  inset: 12px 12px 6px;
  border-radius: 46% 46% 42% 42% / 44% 44% 40% 40%;
  background: radial-gradient(75% 70% at 50% 42%, #1f7a43 0%, #176235 55%, #0d4425 100%);
  border: 12px solid #5a3a22;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, .55),
    inset 0 0 0 4px rgba(232, 200, 135, .12),
    0 0 0 3px #c9a25a,
    0 0 0 6px #33200f,
    0 18px 40px rgba(0, 0, 0, .65);
  z-index: 0;
  pointer-events: none;
}
.table-area > * { position: relative; z-index: 1; }
#seats {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.watermark {
  position: absolute;
  left: 50%;
  top: 36%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: rgba(5, 45, 24, .55);
  font-weight: 900;
  font-size: 30px;
  letter-spacing: 4px;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .06);
  z-index: 0;
}
.watermark span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 3px;
  color: rgba(5, 45, 24, .42);
}

.table-center {
  top: 61%;
  width: 190px;
}
.table-center .phase-sub { font-size: 10px; color: #d8e8dc; }
.table-center .cd-wrap { width: 118px; background: rgba(0, 0, 0, .28); }
.table-center .cd-bar { background: linear-gradient(90deg, #ffd77a, #ff9a3c); }
.table-center .pot-line { color: #ffe0a3; }
.room-sub { margin-top: 4px; font-size: 9px; color: rgba(255, 255, 255, .55); }

.seat { width: 76px; }
.seat .avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid rgba(232, 200, 135, .35);
}
.seat.empty {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .38);
  border-radius: 4px;
  background: rgba(0, 0, 0, .18);
  color: rgba(255, 255, 255, .55);
  font-size: 10px;
}
.seat.empty span { line-height: 1; }

.myseat {
  position: absolute;
  left: 14px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 4;
}
.myseat.has-cards { bottom: 84px; }
.myseat .avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 2px solid rgba(232, 200, 135, .5);
}
.myseat-meta b {
  display: block;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #fff;
}
.myseat-meta span { font-size: 11px; color: var(--gold); }

.my-hand {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  width: 100%;
  text-align: center;
  z-index: 3;
}
.hand-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 16px;
  margin-bottom: 2px;
  font-size: 11px;
  color: var(--gold);
}
.hand-badge #myHandPay { font-size: 9px; color: var(--muted); }
.hand-badge .declare-btn { margin-top: 0; }
.my-cards {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-height: 64px;
}
.my-cards .pcard { width: 44px; height: 62px; border-radius: 6px; }
.my-cards .pcard .pc-r { font-size: 16px; }
.my-cards .pcard .pc-s { font-size: 15px; }
.scratch-wrap {
  position: relative;
  width: 44px;
  height: 62px;
  flex: none;
  touch-action: none;
}
.scratch-wrap .pcard { position: absolute; inset: 0; width: 100%; height: 100%; }
.scratch-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: inset(0 0 0 0);
  transition: clip-path .08s linear;
}
.scratch-cover .pcard { width: 100%; height: 100%; }
.scratch-hint {
  position: absolute;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 1px 4px #000;
}

.actionbar {
  position: relative;
  z-index: 6;
  min-height: 62px;
  padding: 6px 10px 4px;
  background: transparent;
}
.act-btn {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(35, 50, 40, .95), rgba(12, 22, 18, .95));
  border: 1px solid rgba(232, 200, 135, .3);
}
.act-btn.primary {
  background: linear-gradient(180deg, #ffc85a, #ff8a1e);
  border: 0;
  color: #2a1604;
  box-shadow: 0 6px 16px rgba(255, 138, 30, .35);
}
.act-btn.primary span { color: rgba(42, 22, 4, .65); }
.act-btn.danger { border-radius: 22px; }
.action-hint { border-radius: 22px; background: rgba(0, 0, 0, .18); }

.casino-bottom {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 12px calc(8px + var(--safe-b));
}
.circle-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffe0a3;
  font-size: 17px;
  text-decoration: none;
  background: radial-gradient(circle at 30% 25%, #3a4a5a, #141c26);
  border: 1px solid rgba(232, 200, 135, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 4px 10px rgba(0, 0, 0, .4);
}
.base-badge {
  padding: 6px 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 30, 40, .95), rgba(8, 14, 20, .95));
  border: 1px solid rgba(232, 200, 135, .3);
  color: #f3e6c8;
  font-size: 12px;
}
.base-badge b { color: var(--gold); }
.bottom-right { display: flex; gap: 8px; }

/* ---------- 本场结算（8~16 局） ---------- */
.mx-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 14px;
}
.mx-row span {
  flex: 1;
  min-width: 0;
  color: #e9edf5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mx-row b {
  min-width: 56px;
  text-align: right;
  font-size: 15px;
}
.mx-row b.green { color: #4ade80; }
.mx-row b.red { color: #f87171; }
.mx-row em {
  font-style: normal;
  color: #8f9bb3;
  font-size: 11px;
  min-width: 64px;
  text-align: right;
}

/* ---------- 手搓第 3 张（三公）动画 ---------- */
.scratch-wrap:active .scratch-cover { animation: scratchShake .16s linear infinite alternate; }
@keyframes scratchShake {
  from { transform: translateX(-1.5px) rotate(-.6deg); }
  to { transform: translateX(1.5px) rotate(.6deg); }
}
@keyframes hintPulse {
  0%, 100% { opacity: .55; transform: scale(.96); }
  50% { opacity: 1; transform: scale(1.06); }
}
.scratch-hint { animation: hintPulse 1.1s ease-in-out infinite; }
@keyframes cardPop {
  0% { transform: scale(.9) rotate(-1.5deg); filter: brightness(1.35); }
  55% { transform: scale(1.08) rotate(.8deg); }
  100% { transform: scale(1) rotate(0); }
}
.pcard.pop { animation: cardPop .55s cubic-bezier(.2, .9, .25, 1.2); }

/* ---------- 外挂举报奖励条 ---------- */
.anti-fraud-bar {
  margin: 8px 12px 2px;
  padding: 8px 12px;
  border-radius: 10px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: .5px;
  color: #f0d9a0;
  background: linear-gradient(90deg, rgba(232, 200, 135, .18), rgba(232, 200, 135, .04) 55%, rgba(232, 200, 135, .18));
  border: 1px solid rgba(232, 200, 135, .35);
  box-shadow: inset 0 0 12px rgba(232, 200, 135, .08);
}
.anti-fraud-bar b {
  color: #ffd76a;
  font-size: 14px;
  font-weight: 800;
  padding: 0 2px;
  text-shadow: 0 0 10px rgba(255, 215, 106, .45);
}
.anti-fraud-bar.compact {
  margin: 6px 10px 0;
  padding: 5px 10px;
  font-size: 11.5px;
  border-radius: 8px;
}
.anti-fraud-bar.compact b { font-size: 13px; }

/* ================= 三公桌参考样式（亮绿绒布 + 金边 + 大牌型） ================= */
.table-area::before {
  background:
    radial-gradient(70% 62% at 50% 40%, #2fae63 0%, #1c8a4c 42%, #106035 72%, #08381e 100%);
  border: 13px solid #6b4526;
  box-shadow:
    inset 0 0 70px rgba(0, 0, 0, .55),
    inset 0 0 0 3px rgba(255, 226, 150, .22),
    0 0 0 3px #e0be7d,
    0 0 0 6px #3a2410,
    0 0 46px rgba(255, 196, 90, .18),
    0 20px 44px rgba(0, 0, 0, .65);
}
.table-area::after {
  content: "";
  position: absolute;
  inset: 12px 12px 6px;
  border-radius: 46% 46% 42% 42% / 44% 44% 40% 40%;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 255, 255, .05) 0 2px, transparent 3px) 0 0 / 26px 26px,
    radial-gradient(circle at 68% 72%, rgba(0, 0, 0, .12) 0 2px, transparent 3px) 0 0 / 34px 34px;
  opacity: .55;
}

.tt-info {
  display: grid;
  grid-template-columns: auto auto;
  gap: 1px 10px;
  padding: 5px 9px;
  border-radius: 9px;
  background: rgba(6, 30, 18, .55);
  border: 1px solid rgba(232, 200, 135, .22);
  font-size: 9px;
  line-height: 1.5;
}
.tt-info span { color: rgba(210, 232, 214, .7); }
.tt-info b { color: #ffe0a3; font-weight: 700; font-variant-numeric: tabular-nums; }

.pot-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 5px 18px;
  border-radius: 999px;
  background: rgba(4, 34, 18, .78);
  border: 1px solid rgba(255, 226, 150, .5);
  box-shadow: inset 0 0 16px rgba(255, 210, 90, .14), 0 6px 14px rgba(0, 0, 0, .35);
}
.pot-label { font-size: 11px; color: #cfe8d3; letter-spacing: 1px; }
.pot-value {
  font-size: 20px;
  font-weight: 900;
  color: #ffe27a;
  text-shadow: 0 0 12px rgba(255, 200, 60, .6);
  font-variant-numeric: tabular-nums;
}
.center-status {
  display: inline-block;
  margin-top: 8px;
  padding: 6px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #fff6d8;
  background: linear-gradient(180deg, rgba(255, 214, 120, .3), rgba(122, 74, 12, .55));
  border: 1px solid rgba(255, 226, 150, .55);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .38), inset 0 0 12px rgba(255, 210, 90, .18);
}
.center-status.live { animation: statusPulse 1.6s ease-in-out infinite; }
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 6px 16px rgba(0, 0, 0, .38), inset 0 0 12px rgba(255, 210, 90, .12); }
  50% { box-shadow: 0 6px 18px rgba(0, 0, 0, .45), inset 0 0 20px rgba(255, 210, 90, .35); }
}

.pcard.md { width: 30px; height: 42px; border-radius: 5px; }
.pcard.md .pc-r { font-size: 12px; }
.pcard.md .pc-s { font-size: 11px; }
.seat-cards .pcard.md { margin-left: -12px; }

.seat-hand {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1px;
  color: #ffe27a;
  text-shadow:
    0 1px 0 #8a4b00,
    0 0 10px rgba(255, 190, 50, .9);
  white-space: nowrap;
}
.seat.win .seat-cards { animation: seatWinGlow 1.2s ease-in-out infinite alternate; }
@keyframes seatWinGlow {
  from { filter: drop-shadow(0 0 2px rgba(255, 210, 90, .5)); transform: translateY(0); }
  to { filter: drop-shadow(0 0 10px rgba(255, 210, 90, .95)); transform: translateY(-1px); }
}
.seat.win .seat-hand { color: #fff3b8; text-shadow: 0 0 14px rgba(255, 200, 60, 1); }

.delta-bubble {
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .5px;
  padding: 2px 8px 2px 22px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .32);
  font-variant-numeric: tabular-nums;
}
.delta-bubble.green { color: #ffe27a; text-shadow: 0 1px 0 #8a4b00, 0 0 12px rgba(255, 190, 50, .9); }
.delta-bubble.red { color: #ffb3a2; text-shadow: 0 1px 0 #6b1d10; }
.delta-bubble::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 50%;
  width: 12px;
  height: 12px;
  margin-top: -6px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #f0b429 55%, #a86b00 100%);
  box-shadow: 0 0 6px rgba(255, 200, 60, .7);
}

.my-hand .hand-badge b { font-size: 17px; letter-spacing: 2px; }
.my-cards .pcard { width: 54px; height: 76px; border-radius: 7px; }
.my-cards .pcard .pc-r { font-size: 20px; }
.my-cards .pcard .pc-s { font-size: 18px; }

/* 收口：桌面观感（只调外观，不动积分/结算逻辑） */
.watermark {
  top: 33%;
  font-size: 22px;
  letter-spacing: 3px;
  color: rgba(4, 42, 22, .38);
}
.watermark span { font-size: 10px; letter-spacing: 2px; color: rgba(4, 42, 22, .3); }
.seat { width: 80px; }
.seat-name { max-width: 80px; margin: 2px auto 0; font-size: 9.5px; }
.seat-cards { margin-top: 2px; }
.seat-cards .pcard.md { margin-left: -10px; }
.delta-bubble {
  top: -8px;
  transform: translate(-50%, -100%);
  z-index: 6;
  padding: 2px 8px 2px 20px;
}
.casino-bottom .auto-ready { font-size: 10px; color: #d8c69a; display: flex; align-items: center; gap: 3px; }
.casino-bottom .auto-ready input { width: 14px; height: 14px; accent-color: #e8c887; }

/* 修正：牌叠间距别太紧，保证每张的点数可见 */
.seat-cards .pcard.md { margin-left: -8px; }

/* ---------- 亮牌阶段动画（牛牛 / 三公通用） ---------- */
.game-page.show-phase .seat-cards .pcard,
.game-page.show-phase .my-cards .pcard {
  animation: revealFlip .42s cubic-bezier(.2, .9, .25, 1.2) both;
}
@keyframes revealFlip {
  0% { transform: translateY(6px) scale(.88); opacity: .35; }
  60% { transform: translateY(-2px) scale(1.06); }
  100% { transform: none; opacity: 1; }
}
.game-page.show-phase .seat-hand {
  animation: handPop .45s ease both;
}
@keyframes handPop {
  from { transform: scale(.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* 每把小输赢：直接飘在自己头像上，不出比分表 */
.myseat .my-delta {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translate(-50%, -100%);
  padding: 2px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .34);
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
  z-index: 6;
  animation: floatUp .45s ease both;
}
.myseat .my-delta.green {
  color: #ffe27a;
  text-shadow: 0 1px 0 #8a4b00, 0 0 12px rgba(255, 190, 50, .9);
}
.myseat .my-delta.red {
  color: #ffb3a2;
  text-shadow: 0 1px 0 #6b1d10;
}

/* ---------- 拉杆下注 ---------- */
.actionbar .bet-slider { flex: 1; min-width: 0; }
.bet-slider {
  padding: 8px 12px 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .34);
  border: 1px solid rgba(232, 200, 135, .28);
}
.bs-top { display: flex; align-items: baseline; gap: 8px; font-size: 11px; color: #cfe8d3; }
.bs-top b { font-size: 18px; color: #ffe27a; font-variant-numeric: tabular-nums; }
.bs-top em { margin-left: auto; font-style: normal; font-size: 10px; color: #8ea79b; }
.bet-slider input[type="range"] {
  width: 100%;
  margin: 8px 0 4px;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ffd77a, #c9902f);
  outline: none;
}
.bet-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #f0b429 60%, #a86b00);
  border: 2px solid #7a4a12;
  box-shadow: 0 0 10px rgba(255, 200, 60, .85);
}
.bet-slider input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff3b0, #f0b429 60%, #a86b00);
  border: 2px solid #7a4a12;
}
.bs-hint { font-size: 10px; color: #9fb7a8; }

/* 官方桌标签 */
.rc-official {
  font-style: normal;
  font-size: 9px;
  padding: 1px 4px;
  margin-left: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffe6ad, #d3a34e);
  color: #3a2604;
  font-weight: 700;
}

/* 三公 10~12 人：座位整体缩小，避免挤在一起 */
.seats-many .seat { width: 64px; }
.seats-many .seat .avatar { width: 32px; height: 32px; border-radius: 8px; }
.seats-many .seat-avatar-wrap { width: 32px; height: 32px; }
.seats-many .seat-name { font-size: 8.5px; max-width: 64px; }
.seats-many .seat-chips { font-size: 9px; }
.seats-many .seat-cards .pcard.md { width: 22px; height: 31px; border-radius: 4px; margin-left: -8px; }
.seats-many .seat-cards .pcard.md .pc-r { font-size: 9px; }
.seats-many .seat-cards .pcard.md .pc-s { font-size: 8px; }
.seats-many .seat-hand { font-size: 9px; letter-spacing: .5px; }
.seats-many .grab-tag { font-size: 8px; }
.seats-many .delta-bubble { font-size: 13px; }

.badge-auto {
  background: linear-gradient(180deg, #ffe0a3, #d3a34e);
  color: #3a2604;
  font-weight: 700;
}

/* 头像放进座位框里 */
.seat-avatar-wrap {
  width: 54px;
  height: 54px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 30, 18, .45);
  border: 1px solid rgba(232, 200, 135, .38);
  border-radius: 10px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, .35);
}
.seat.empty {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  border: 1px dashed rgba(232, 200, 135, .45);
  background: rgba(4, 30, 18, .3);
}
.seats-many .seat-avatar-wrap { width: 40px; height: 40px; border-radius: 8px; }
.seats-many .seat.empty { width: 40px; height: 40px; border-radius: 8px; font-size: 9px; }

/* 对手手牌再大一点 */
.pcard.md { width: 34px; height: 48px; border-radius: 5px; }
.pcard.md .pc-r { font-size: 13px; }
.pcard.md .pc-s { font-size: 12px; }
.seat-cards .pcard.md { margin-left: -12px; }
.seats-many .seat-cards .pcard.md { width: 25px; height: 35px; margin-left: -9px; }
.seats-many .seat-cards .pcard.md .pc-r { font-size: 10px; }
.seats-many .seat-cards .pcard.md .pc-s { font-size: 9px; }

/* 自己的座位：隐藏左下角浮块，头像坐进座位框 */
.myseat { display: none !important; }
.seat.self .seat-avatar-wrap {
  border-color: rgba(255, 226, 150, .75);
  box-shadow: 0 0 12px rgba(255, 210, 90, .35), inset 0 0 10px rgba(0, 0, 0, .35);
}
.seat.self .seat-name { color: #ffe27a; }
