/* ============================================================
   联机扑克 · 好友约局 — Premium Poker Table Theme
   深绿呢绒 × 鎏金 × 玻璃拟态 · 移动优先 / 横屏 WebView 适配
   ============================================================ */

:root {
  --bg-0: #070d0a;
  --bg-1: #0b1510;
  --bg-2: #101f18;
  --panel: rgba(16, 31, 24, 0.72);
  --panel-lite: rgba(255, 255, 255, 0.045);
  --panel-hover: rgba(255, 255, 255, 0.09);
  --line: rgba(232, 193, 90, 0.14);
  --line-strong: rgba(232, 193, 90, 0.35);

  --gold: #e8c15a;
  --gold-2: #c9962e;
  --gold-deep: #8a6420;
  --gold-soft: rgba(232, 193, 90, 0.12);
  --gold-glow: rgba(232, 193, 90, 0.35);

  --felt: #0e4d2e;
  --felt-2: #0a3a22;
  --felt-3: #126240;

  --green: #35c46f;
  --green-deep: #1c7a45;
  --red: #e5534b;
  --red-deep: #a83232;
  --blue: #4f9cf0;
  --purple: #9d6ff0;

  --tx-1: #f4f0e4;
  --tx-2: #b9c4bb;
  --tx-3: #7d8a80;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;

  --sh-1: 0 2px 8px rgba(0, 0, 0, 0.35);
  --sh-2: 0 6px 24px rgba(0, 0, 0, 0.45);
  --sh-3: 0 12px 48px rgba(0, 0, 0, 0.6);

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'SF Mono', 'Fira Code', Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --cw: 34px;   /* 牌宽 */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--tx-1);
  background: var(--bg-0);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
input, button { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(232, 193, 90, 0.25); border-radius: 2px; }

/* ---------- 背景 ---------- */
.bg-scene { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.bg-felt-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, rgba(18, 98, 64, 0.5) 0%, transparent 65%),
    radial-gradient(ellipse 70% 45% at 50% 115%, rgba(18, 98, 64, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse 120% 100% at 50% 50%, var(--bg-1) 0%, var(--bg-0) 100%);
}
.bg-suit {
  position: absolute; font-size: 220px; line-height: 1;
  color: rgba(232, 193, 90, 0.045);
  animation: suitFloat 14s ease-in-out infinite;
}
.bg-suit.s1 { top: -60px; left: -50px; transform: rotate(-18deg); }
.bg-suit.s2 { top: 12%; right: -70px; color: rgba(229, 83, 75, 0.05); animation-delay: -4s; }
.bg-suit.s3 { bottom: -80px; left: 8%; color: rgba(229, 83, 75, 0.04); animation-delay: -8s; }
.bg-suit.s4 { bottom: 5%; right: 12%; animation-delay: -11s; }
@keyframes suitFloat { 0%, 100% { margin-top: 0; } 50% { margin-top: -18px; } }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed; top: max(12px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none; width: 92%; max-width: 380px;
}
.toast {
  pointer-events: auto;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(10, 20, 15, 0.92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-2);
  font-size: 13px; color: var(--tx-1);
  display: flex; align-items: center; gap: 8px;
  animation: toastIn 0.35s var(--ease);
  transition: opacity 0.3s, transform 0.3s;
}
.toast::before { font-size: 13px; }
.toast.good { border-color: rgba(53, 196, 111, 0.5); }
.toast.good::before { content: '✓'; color: var(--green); font-weight: 800; }
.toast.bad { border-color: rgba(229, 83, 75, 0.5); }
.toast.bad::before { content: '✕'; color: var(--red); font-weight: 800; }
.toast.info::before { content: '♠'; color: var(--gold); }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(0.94); } to { opacity: 1; } }

/* ---------- 更新横幅 ---------- */
.update-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9998;
  padding: 9px 16px; text-align: center;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold), var(--gold-deep));
  color: #241a05; font-weight: 700; font-size: 13px;
  box-shadow: var(--sh-2);
  animation: slideDown 0.4s var(--ease);
}
@keyframes slideDown { from { transform: translateY(-100%); } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px;
  border-radius: 10px;
  font-weight: 600; font-size: 14px;
  color: var(--tx-1);
  background: var(--panel-lite);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.12s var(--ease), filter 0.15s, background 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-gold {
  background: linear-gradient(160deg, #f3d27a 0%, var(--gold) 38%, var(--gold-2) 100%);
  color: #2a1e05; border: none; font-weight: 800;
  box-shadow: 0 4px 18px rgba(232, 193, 90, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}
.btn-gold:active { filter: brightness(0.94); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong); color: var(--gold);
}
.btn-ghost:active { background: var(--gold-soft); }

.btn-green {
  background: linear-gradient(160deg, #43d67e, var(--green-deep));
  color: #06210f; border: none; font-weight: 800;
  box-shadow: 0 4px 16px rgba(53, 196, 111, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn-red {
  background: linear-gradient(160deg, #f2726a, var(--red-deep));
  color: #2b0808; border: none; font-weight: 800;
  box-shadow: 0 4px 16px rgba(229, 83, 75, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.btn-plain { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12); color: var(--tx-2); }

.btn-xl { padding: 14px 28px; font-size: 16px; border-radius: 14px; letter-spacing: 2px; }
.btn-lg { padding: 12px 26px; font-size: 15px; border-radius: 12px; }
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ============================================================
   登录页
   ============================================================ */
.login-screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.login-card {
  position: relative; width: 100%; max-width: 400px;
  margin: auto;
  padding: 34px 30px 26px;
  border-radius: var(--r-xl);
  background: linear-gradient(170deg, rgba(20, 38, 29, 0.9), rgba(9, 17, 13, 0.94));
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-3), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  animation: cardUp 0.5s var(--ease);
}
.login-card::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(160deg, rgba(232,193,90,0.6), transparent 30%, transparent 70%, rgba(232,193,90,0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
@keyframes cardUp { from { opacity: 0; transform: translateY(24px); } }

.login-logo { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 10px; }
.logo-suit { font-size: 26px; animation: suitBob 3s ease-in-out infinite; }
.logo-suit.red { color: var(--red); animation-delay: -1.5s; }
.logo-suit.black { color: var(--tx-1); }
@keyframes suitBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.logo-chip {
  width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f3d27a, var(--gold-2) 68%);
  border: 4px dashed rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 3px var(--gold-deep), 0 6px 18px rgba(232, 193, 90, 0.45);
}
.login-title {
  text-align: center; font-size: 30px; font-weight: 900; letter-spacing: 8px;
  background: linear-gradient(180deg, #f7e3a1, var(--gold) 55%, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 24px rgba(232, 193, 90, 0.25);
}
.login-sub { text-align: center; font-size: 11px; letter-spacing: 3px; color: var(--tx-3); margin: 6px 0 24px; }

.login-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 700; color: var(--tx-2); letter-spacing: 1px; }
.field input {
  width: 100%; padding: 12px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--tx-1); font-size: 15px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.field input.invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(229, 83, 75, 0.15); animation: shake 0.35s; }
.field-tip { font-size: 11px; color: var(--tx-3); }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }

.server-adv { font-size: 12px; color: var(--tx-3); }
.server-adv summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 4px; padding: 2px 0; }
.server-adv summary::before { content: '⚙'; font-size: 12px; }
.server-adv summary::after { content: '▾'; margin-left: auto; transition: transform 0.2s; }
.server-adv[open] summary::after { transform: rotate(180deg); }
.server-adv .field { margin-top: 8px; }

.conn-err { min-height: 16px; font-size: 12px; color: var(--red); text-align: center; }
.conn-err:empty { display: none; }
.conn-err { padding: 0 4px; }
.conn-err:not(:empty) { padding: 6px 10px; background: rgba(229,83,75,0.1); border: 1px solid rgba(229,83,75,0.3); border-radius: 8px; }

.login-games { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 22px; font-size: 12px; color: var(--tx-2); flex-wrap: wrap; }
.login-games i { color: var(--gold-deep); font-style: normal; }
.login-legal { text-align: center; font-size: 11px; color: var(--tx-3); margin-top: 12px; }

/* ============================================================
   顶栏
   ============================================================ */
.app { position: fixed; inset: 0; z-index: 5; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(8, 15, 11, 0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0; z-index: 20;
}
.tb-user { display: flex; align-items: center; gap: 9px; min-width: 0; }
.tb-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #2a1e05;
  background: radial-gradient(circle at 32% 28%, #f3d27a, var(--gold-2) 70%);
  box-shadow: 0 0 0 2px var(--gold-deep), 0 3px 10px rgba(0,0,0,0.4);
  flex-shrink: 0;
}
.tb-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tb-name { font-size: 13px; font-weight: 700; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-money {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--gold);
}
.tb-money em { font-style: normal; font-size: 10px; color: var(--tx-3); font-family: var(--font); }
.coin-dot {
  width: 13px; height: 13px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f3d27a, var(--gold-2) 68%);
  border: 2px dashed rgba(255,255,255,0.7);
  box-shadow: 0 0 0 1px var(--gold-deep);
}
.tb-brand {
  flex: 1; text-align: center;
  font-size: 15px; font-weight: 900; letter-spacing: 5px;
  background: linear-gradient(180deg, #f7e3a1, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.tb-actions { display: flex; gap: 6px; }
.tb-btn {
  min-width: 32px; height: 32px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 14px; color: var(--tx-2);
  background: var(--panel-lite); border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.15s, color 0.15s, transform 0.12s;
}
.tb-btn:active { transform: scale(0.92); background: var(--panel-hover); color: var(--tx-1); }

/* ============================================================
   大厅
   ============================================================ */
.view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.lobby-view { overflow-y: auto; padding: 16px 16px 32px; -webkit-overflow-scrolling: touch; }

.lobby-hero { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 14px; }
.hero-text h2 {
  font-size: 22px; font-weight: 900; letter-spacing: 3px;
  background: linear-gradient(180deg, #f7e3a1, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-text p { font-size: 12px; color: var(--tx-3); margin-top: 2px; letter-spacing: 1px; }
.hero-online {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--tx-2);
  padding: 5px 12px; border-radius: 999px;
  background: var(--panel-lite); border: 1px solid rgba(255,255,255,0.08);
}
.hero-online b { color: var(--green); font-family: var(--mono); }
.online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); animation: pulseDot 2s infinite; }
@keyframes pulseDot { 50% { opacity: 0.5; } }

.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mode-card {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  padding: 14px 14px 12px;
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, rgba(255,255,255,0.06), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.09);
  text-align: left;
  transition: transform 0.16s var(--ease), border-color 0.2s, box-shadow 0.25s;
}
.mode-card:active { transform: scale(0.97); }
.mode-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--mc, var(--gold)), transparent);
  opacity: 0.7;
}
.mode-card:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); transform: translateY(-2px); }
.mode-icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; margin-bottom: 6px;
  background: linear-gradient(150deg, var(--mc, var(--gold)), transparent 160%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 12px rgba(0,0,0,0.35);
}
.mode-name { font-size: 15px; font-weight: 800; letter-spacing: 1px; }
.mode-meta { font-size: 11px; color: var(--tx-3); }
.mode-go {
  position: absolute; right: 12px; bottom: 12px;
  font-size: 11px; font-weight: 700; color: var(--mc, var(--gold));
  opacity: 0.9;
}
.mc-gold { --mc: #e8c15a; } .mc-red { --mc: #f2708a; } .mc-green { --mc: #35c46f; }
.mc-blue { --mc: #4f9cf0; } .mc-purple { --mc: #b08cff; }
.mode-card:nth-child(5) { grid-column: span 2; flex-direction: row; align-items: center; gap: 12px; padding: 12px 14px; }
.mode-card:nth-child(5) .mode-icon { margin-bottom: 0; }
.mode-card:nth-child(5) .mode-name { font-size: 16px; }
.mode-card:nth-child(5) .mode-meta { flex: 1; }
.mode-card:nth-child(5) .mode-go { position: static; }

.lobby-rooms { margin-top: 20px; }
.rooms-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rooms-head h3 { font-size: 14px; font-weight: 800; letter-spacing: 2px; color: var(--tx-2); }
.rooms-head h3::before { content: '▸ '; color: var(--gold); }

.room-list { display: flex; flex-direction: column; gap: 8px; }
.room-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--panel-lite);
  border: 1px solid rgba(255,255,255,0.07);
  transition: transform 0.14s var(--ease), border-color 0.2s, background 0.2s;
}
.room-card.joinable { cursor: pointer; }
.room-card.joinable:active { transform: scale(0.98); background: var(--panel-hover); }
.room-card.joinable:hover { border-color: var(--line-strong); }
.room-card.locked { opacity: 0.55; }
.rc-badge {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
  background: linear-gradient(150deg, var(--mc, var(--gold)), transparent 170%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.rc-main { flex: 1; min-width: 0; }
.rc-id { font-size: 13px; font-weight: 800; letter-spacing: 0.5px; }
.rc-id small { font-weight: 600; color: var(--tx-3); margin-left: 6px; }
.rc-meta { font-size: 11px; color: var(--tx-3); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-status {
  flex-shrink: 0; font-size: 11px; font-weight: 800; letter-spacing: 1px;
  padding: 5px 10px; border-radius: 999px;
}
.rc-status.open { color: var(--green); background: rgba(53,196,111,0.12); border: 1px solid rgba(53,196,111,0.35); }
.rc-status.full { color: var(--tx-3); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); }
.rc-status.play { color: var(--gold); background: var(--gold-soft); border: 1px solid var(--line-strong); }

.lobby-empty {
  text-align: center; padding: 44px 20px; color: var(--tx-3); font-size: 13px; line-height: 2;
}
.lobby-empty .le-icon { font-size: 40px; display: block; margin-bottom: 10px; opacity: 0.6; }

/* ============================================================
   房间视图
   ============================================================ */
.room-view { position: relative; overflow: hidden; }
.room-head {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px; flex-shrink: 0; z-index: 5;
}
.rh-btn {
  padding: 6px 12px; border-radius: 9px;
  font-size: 12px; font-weight: 700; color: var(--tx-2);
  background: var(--panel-lite); border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.15s, transform 0.12s;
}
.rh-btn:active { transform: scale(0.94); background: var(--panel-hover); }
.rh-btn.danger { color: var(--red); border-color: rgba(229,83,75,0.35); background: rgba(229,83,75,0.08); }
.room-title { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.room-title-name { font-size: 15px; font-weight: 800; letter-spacing: 2px; color: var(--gold); white-space: nowrap; }
.room-title-id {
  font-size: 10px; font-weight: 700; font-family: var(--mono); color: var(--tx-3);
  padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  white-space: nowrap;
}

/* 座位条（玩家名单） */
.seat-strip {
  display: flex; gap: 6px; align-items: center;
  padding: 4px 12px 8px;
  overflow-x: auto; flex-shrink: 0;
  scrollbar-width: none;
}
.seat-strip::-webkit-scrollbar { display: none; }
.strip-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px 4px 4px; border-radius: 999px; flex-shrink: 0;
  background: var(--panel-lite); border: 1px solid rgba(255,255,255,0.08);
  font-size: 11px;
}
.strip-chip.me { border-color: var(--line-strong); background: var(--gold-soft); }
.strip-chip .sc-av {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: #2a1e05;
  background: radial-gradient(circle at 34% 30%, #f3d27a, var(--gold-2) 70%);
}
.strip-chip .sc-name { font-weight: 700; max-width: 72px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip-chip .sc-money { font-family: var(--mono); color: var(--gold); font-size: 10px; }
.strip-chip .sc-host { font-size: 10px; }
.strip-chip .sc-off { width: 6px; height: 6px; border-radius: 50%; background: var(--tx-3); }
.strip-chip .sc-on { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 5px var(--green); }

/* 牌桌主区域 */
.room-table { flex: 1; position: relative; min-height: 0; display: flex; flex-direction: column; }

/* ---------- 等待面板 ---------- */
.wait-panel {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 20px; text-align: center; overflow-y: auto;
}
.wait-icon {
  width: 84px; height: 84px; border-radius: 24px;
  display: flex; align-items: center; justify-content: center; font-size: 42px;
  background: linear-gradient(150deg, var(--mc, var(--gold)), transparent 180%);
  box-shadow: var(--sh-2), inset 0 1px 0 rgba(255,255,255,0.25);
  animation: waitBob 2.6s ease-in-out infinite;
}
@keyframes waitBob { 50% { transform: translateY(-6px); } }
.wait-title { font-size: 20px; font-weight: 900; letter-spacing: 3px; color: var(--gold); }
.wait-sub { font-size: 12px; color: var(--tx-3); }
.wait-count { font-size: 13px; color: var(--tx-2); }
.wait-count b { color: var(--gold); font-family: var(--mono); }
.wait-rules {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.wait-rules span {
  font-size: 11px; color: var(--tx-2);
  padding: 4px 12px; border-radius: 999px;
  background: var(--panel-lite); border: 1px solid rgba(255,255,255,0.08);
}
.wait-hint { font-size: 12px; color: var(--tx-3); display: flex; align-items: center; gap: 8px; }
.wait-hint .mini-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gold-soft); border-top-color: var(--gold); animation: rot 0.9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ============================================================
   牌桌（椭圆呢绒桌）
   ============================================================ */
.table-stage {
  flex: 1; min-height: 0; position: relative;
  display: flex; align-items: center; justify-content: center;
  padding: 4px 8px;
}
.felt {
  position: relative;
  width: min(100%, 620px);
  aspect-ratio: 1.45;
  max-height: 100%;
  margin: auto 0;
}
@media (min-aspect-ratio: 1/1) {
  .felt { width: auto; height: min(100%, 420px); aspect-ratio: 1.9; margin: 0; }
  .table-stage { padding: 2px 8px; }
}
.felt-rim {
  position: absolute; inset: 0;
  border-radius: 50% / 46%;
  background: linear-gradient(160deg, #4a2f17 0%, #2d1c0d 50%, #4a2f17 100%);
  box-shadow: var(--sh-3), inset 0 2px 3px rgba(255,255,255,0.15), inset 0 -3px 6px rgba(0,0,0,0.5);
}
.felt-cloth {
  position: absolute; inset: 5.5%;
  border-radius: 50% / 46%;
  background:
    radial-gradient(ellipse 75% 70% at 50% 38%, var(--felt-3) 0%, var(--felt) 45%, var(--felt-2) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(232, 193, 90, 0.28),
    inset 0 0 46px rgba(0, 0, 0, 0.5),
    inset 0 2px 10px rgba(0,0,0,0.4);
}
.felt-cloth::after {
  content: '♠ ♥ ♦ ♣';
  position: absolute; top: 9%; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: 6px; color: rgba(232, 193, 90, 0.22);
  white-space: nowrap;
}

/* 桌面中心 */
.felt-center {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  z-index: 2; pointer-events: none;
  max-width: 74%;
}
.pot-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 16px 5px 6px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-1);
  font-size: 13px; font-weight: 800; color: var(--gold);
  font-family: var(--mono);
}
.pot-chip .pc-icon {
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f3d27a, var(--gold-2) 68%);
  border: 3px dashed rgba(255,255,255,0.75);
  box-shadow: 0 0 0 1.5px var(--gold-deep);
}
.pot-sub { font-size: 10px; color: rgba(244, 240, 228, 0.55); letter-spacing: 1px; }
.comm-row { display: flex; gap: 5px; justify-content: center; }
.table-msg {
  font-size: 11px; color: rgba(244, 240, 228, 0.75);
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 12px; border-radius: 999px;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vs-emblem {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 900; letter-spacing: 1px; color: #2a1e05;
  background: radial-gradient(circle at 34% 30%, #f3d27a, var(--gold-2) 72%);
  box-shadow: 0 0 0 3px var(--gold-deep), 0 6px 20px rgba(232,193,90,0.4);
}

/* 结算横幅 */
.result-banner {
  position: absolute; top: 46%; left: 50%; transform: translate(-50%, -50%);
  z-index: 30; max-width: 88%;
  padding: 12px 26px; border-radius: 16px;
  font-size: 14px; font-weight: 800; text-align: center; line-height: 1.6;
  background: rgba(8, 15, 11, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-3);
  animation: resultPop 0.45s var(--ease);
}
.result-banner.win { border-color: rgba(53,196,111,0.6); box-shadow: 0 0 40px rgba(53,196,111,0.25), var(--sh-3); color: #b8f4d2; }
.result-banner.lose { border-color: rgba(229,83,75,0.5); color: #f6cfc9; }
.result-banner.tie { border-color: rgba(79,156,240,0.5); color: #cfe3f8; }
/* 结算横幅：不拦截点击（永不挡操作），fade 版 4.5s 后自动淡出不再遮牌 */
.result-banner { pointer-events: none; }
.result-banner.fade { animation: resultPop 0.45s var(--ease), bannerOut 0.6s ease 4.5s forwards; }
@keyframes bannerOut { to { opacity: 0; visibility: hidden; } }
.result-line { border: 1px solid var(--line-strong); background: rgba(35,28,8,0.55); color: var(--gold); }
@keyframes resultPop { 0% { opacity: 0; transform: translate(-50%,-50%) scale(0.8); } 60% { transform: translate(-50%,-50%) scale(1.04); } 100% { opacity: 1; transform: translate(-50%,-50%) scale(1); } }

/* ---------- 座位 ---------- */
.seat {
  position: absolute; z-index: 3;
  transform: translate(-50%, -50%) scale(var(--seat-scale, 1));
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 96px;
  transition: opacity 0.3s;
}
.seat-av-wrap { position: relative; }
.seat-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: var(--tx-1);
  background: radial-gradient(circle at 34% 30%, #3d5a4a, #1c2f26 75%);
  border: 2px solid rgba(255,255,255,0.18);
  box-shadow: var(--sh-1);
  transition: border-color 0.2s, box-shadow 0.25s, filter 0.2s;
}
.seat.me .seat-avatar { border-color: var(--gold); box-shadow: 0 0 14px rgba(232,193,90,0.4); }
.seat.turn .seat-avatar { border-color: var(--gold); animation: turnRing 1.2s ease-in-out infinite; }
@keyframes turnRing {
  0%, 100% { box-shadow: 0 0 0 3px rgba(232,193,90,0.55), 0 0 18px rgba(232,193,90,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(232,193,90,0.2), 0 0 26px rgba(232,193,90,0.75); }
}
.seat.winner .seat-avatar { border-color: var(--green); animation: winRing 0.9s ease-in-out infinite; }
@keyframes winRing {
  0%, 100% { box-shadow: 0 0 0 3px rgba(53,196,111,0.6), 0 0 22px rgba(53,196,111,0.55); }
  50% { box-shadow: 0 0 0 7px rgba(53,196,111,0.25), 0 0 34px rgba(53,196,111,0.8); }
}
.seat.folded { opacity: 0.42; }
.seat.folded .seat-avatar { filter: grayscale(0.8); }
.seat.offline .seat-avatar { filter: grayscale(1) brightness(0.7); }

.seat-tags { position: absolute; top: -7px; right: -12px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
.stag {
  font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  padding: 1.5px 7px; border-radius: 999px;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(255,255,255,0.15);
  color: var(--tx-2); white-space: nowrap;
}
.stag.dealer { background: linear-gradient(160deg,#f3d27a,var(--gold-2)); color: #2a1e05; border: none; }
.stag.blind { color: var(--gold); border-color: var(--line-strong); }
.stag.allin { color: #fff; background: linear-gradient(160deg,#f2726a,var(--red-deep)); border: none; }
.stag.seen { color: var(--blue); border-color: rgba(79,156,240,0.4); }
.stag.win { color: var(--green); border-color: rgba(53,196,111,0.5); }

.seat-name-plate {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 3px 10px; border-radius: 9px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255,255,255,0.1);
  max-width: 100%;
}
.seat.me .seat-name-plate { border-color: var(--line-strong); background: rgba(35, 28, 8, 0.65); }
.seat-name { font-size: 11px; font-weight: 700; max-width: 86px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat-money { font-size: 10px; font-family: var(--mono); color: var(--gold); }

.seat-cards { display: flex; gap: 3px; min-height: calc(var(--cw) * 1.42); align-items: center; }
.seat-committed {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: -14px;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 800; font-family: var(--mono); color: #ffe9ad;
  padding: 1px 9px 1px 3px; border-radius: 999px;
  background: rgba(0,0,0,0.55); border: 1px solid rgba(232,193,90,0.35);
  white-space: nowrap;
}
.seat-committed::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f2726a, var(--red-deep) 70%);
  border: 2px dashed rgba(255,255,255,0.7);
}
.seat-hand-desc {
  font-size: 10px; color: var(--gold); font-weight: 700;
  background: rgba(0,0,0,0.5); padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--line-strong); white-space: nowrap;
}
.turn-tip-float {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
  font-size: 10px; font-weight: 800; color: #2a1e05;
  background: linear-gradient(160deg, #f3d27a, var(--gold-2));
  padding: 2px 10px; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 3px 10px rgba(232,193,90,0.4);
  animation: tipBob 1s ease-in-out infinite;
  z-index: 5;
}
@keyframes tipBob { 50% { margin-top: -3px; } }

/* ---------- 扑克牌 ---------- */
.pcard {
  position: relative;
  width: var(--cw); height: calc(var(--cw) * 1.42);
  border-radius: calc(var(--cw) * 0.14);
  background: linear-gradient(165deg, #ffffff, #e9e9e4);
  box-shadow: 0 2px 5px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  animation: cardIn 0.3s var(--ease);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(-8px) rotate(-3deg); } }
.pcard .pc-corner {
  position: absolute; top: 6%; left: 9%;
  font-size: calc(var(--cw) * 0.3); font-weight: 800; line-height: 1.05;
  display: flex; flex-direction: column; align-items: center;
}
.pcard .pc-corner i { font-style: normal; font-size: calc(var(--cw) * 0.28); }
.pcard .pc-center { font-size: calc(var(--cw) * 0.52); }
.pcard.red { color: #c52828; }
.pcard.black { color: #1d2430; }
.pcard.back {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.09) 0 3px, transparent 3px 6px),
    linear-gradient(150deg, #8c1f2f, #5c1020);
  box-shadow: 0 2px 5px rgba(0,0,0,0.45), inset 0 0 0 2px rgba(232,193,90,0.4), inset 0 0 0 5px rgba(92,16,32,1), inset 0 0 0 6px rgba(232,193,90,0.25);
}
.pcard.mini { --cw: 26px; }
.pcard.ten .pc-corner { font-size: calc(var(--cw) * 0.24); }

/* ---------- 庄家区（21点） ---------- */
.dealer-zone {
  position: absolute; top: 4%; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  z-index: 3;
}
.dealer-label {
  font-size: 11px; font-weight: 800; letter-spacing: 2px; color: var(--tx-2);
  padding: 2px 12px; border-radius: 999px;
  background: rgba(0,0,0,0.45); border: 1px solid rgba(255,255,255,0.12);
}
.dealer-label b { color: var(--gold); font-family: var(--mono); }
.dealer-cards { display: flex; gap: 4px; min-height: calc(var(--cw) * 1.42); }

/* ============================================================
   轮盘赌
   ============================================================ */
.rou-wrap { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.rou-head { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.rou-total {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 16px 5px 6px; border-radius: 999px;
  background: rgba(0,0,0,0.45); border: 1px solid var(--line-strong);
  font-size: 12px; font-weight: 800; color: var(--gold); font-family: var(--mono);
}
.rou-last { font-size: 11px; color: var(--tx-3); }
.rou-wheel-result {
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.rou-ball {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 900; font-family: var(--mono);
  border: 3px solid rgba(255,255,255,0.25);
  box-shadow: var(--sh-2), inset 0 -4px 8px rgba(0,0,0,0.35);
  animation: ballIn 0.5s var(--ease);
}
.rou-ball.r { background: radial-gradient(circle at 34% 30%, #e5604c, #8c1f1f); }
.rou-ball.b { background: radial-gradient(circle at 34% 30%, #3a4454, #141a24); }
.rou-ball.g { background: radial-gradient(circle at 34% 30%, #35c46f, #14532d); }
@keyframes ballIn { 0% { transform: scale(0.3) rotate(-180deg); opacity: 0; } 100% { transform: scale(1) rotate(0); } }

.rou-board {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  grid-auto-rows: minmax(34px, auto);
  gap: 3px;
  padding: 10px;
  border-radius: var(--r-md);
  background: linear-gradient(160deg, #123f27, #0b2c1a);
  border: 2px solid rgba(232,193,90,0.25);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.4), var(--sh-2);
}
.rcell {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 34px;
  border-radius: 5px;
  font-size: 13px; font-weight: 800; font-family: var(--mono);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.16);
  transition: filter 0.12s, transform 0.1s;
  padding: 0;
}
.rcell:active { transform: scale(0.95); }
.rcell.red { background: linear-gradient(160deg, #b33, #7c1d1d); }
.rcell.black { background: linear-gradient(160deg, #2b3547, #141a24); }
.rcell.green { background: linear-gradient(160deg, #1d7a45, #0f4d2a); }
.rcell.side { background: rgba(0,0,0,0.3); font-family: var(--font); font-size: 11px; letter-spacing: 1px; }
.rcell.side.red { background: linear-gradient(160deg, #b33, #7c1d1d); }
.rcell.bettable:hover { filter: brightness(1.3); }
.rcell.hit { outline: 3px solid var(--gold); outline-offset: -3px; box-shadow: 0 0 18px var(--gold-glow); animation: hitFlash 0.8s ease-in-out infinite; }
@keyframes hitFlash { 50% { outline-color: #fff2c9; } }
.rcell .bet-mark {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 800; color: #fff;
  background: radial-gradient(circle at 34% 30%, #4f9cf0, #1d4f8c 70%);
  border: 2px dashed rgba(255,255,255,0.8);
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
}
.rcell .bet-mark.mine { background: radial-gradient(circle at 34% 30%, #f3d27a, var(--gold-2) 70%); color: #2a1e05; }

.rou-mybets {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 12px; border-radius: var(--r-md);
  background: var(--panel-lite); border: 1px solid rgba(255,255,255,0.08);
  font-size: 12px; color: var(--tx-2);
}
.rou-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  background: var(--gold-soft); border: 1px solid var(--line-strong);
  color: var(--gold); font-size: 11px; font-weight: 700; font-family: var(--mono);
}
.rou-spin-tip { text-align: center; font-size: 12px; color: var(--tx-3); }

/* ============================================================
   底部动作栏
   ============================================================ */
.action-bar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  background: rgba(8, 15, 11, 0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  min-height: 58px;
  z-index: 10;
}
.abtn {
  position: relative;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 84px; padding: 8px 18px;
  border-radius: 14px;
  font-size: 15px; font-weight: 800; letter-spacing: 1px;
  transition: transform 0.12s var(--ease), filter 0.15s, box-shadow 0.2s;
}
.abtn:active { transform: scale(0.94); }
.abtn small { font-size: 10px; font-weight: 600; opacity: 0.85; letter-spacing: 0; }
.abtn-fold { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14); color: var(--tx-2); }
.abtn-check, .abtn-call { background: linear-gradient(160deg, #43d67e, var(--green-deep)); color: #06210f; box-shadow: 0 4px 16px rgba(53,196,111,0.3), inset 0 1px 0 rgba(255,255,255,0.4); }
.abtn-raise { background: linear-gradient(160deg, #f3d27a, var(--gold-2)); color: #2a1e05; box-shadow: 0 4px 18px rgba(232,193,90,0.35), inset 0 1px 0 rgba(255,255,255,0.5); }
.abtn-allin { background: linear-gradient(160deg, #f2726a, var(--red-deep)); color: #2b0808; box-shadow: 0 4px 16px rgba(229,83,75,0.35), inset 0 1px 0 rgba(255,255,255,0.35); }
.abtn:disabled { opacity: 0.4; pointer-events: none; }
.action-hint { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tx-2); }
.action-hint .mini-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--gold-soft); border-top-color: var(--gold); animation: rot 0.9s linear infinite; }
.action-hint b { color: var(--gold); }

/* ============================================================
   聊天抽屉
   ============================================================ */
.chat-fab {
  position: absolute; right: 12px; bottom: 72px; z-index: 40;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px;
  background: linear-gradient(160deg, rgba(20,38,29,0.95), rgba(9,17,13,0.95));
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-2);
  transition: transform 0.14s var(--ease);
}
.chat-fab:active { transform: scale(0.9); }
.chat-unread {
  position: absolute; top: -3px; right: -3px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-0);
}
.chat-drawer {
  position: absolute; right: 10px; bottom: 124px; z-index: 41;
  width: min(300px, 82vw); height: min(340px, 58%);
  display: flex; flex-direction: column;
  border-radius: var(--r-lg);
  background: rgba(10, 19, 14, 0.96);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-3);
  animation: drawerIn 0.25s var(--ease);
  overflow: hidden;
}
@keyframes drawerIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } }
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; font-size: 13px; font-weight: 800; letter-spacing: 1px; color: var(--gold);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.chat-list:empty::after { content: '还没有消息，来打个招呼吧 ♠'; color: var(--tx-3); font-size: 12px; display: block; text-align: center; padding: 26px 0; }
.chat-item { display: flex; flex-direction: column; gap: 1px; animation: chatIn 0.2s var(--ease); }
@keyframes chatIn { from { opacity: 0; transform: translateY(5px); } }
.chat-item .ci-name { font-size: 10px; font-weight: 700; color: var(--gold); }
.chat-item .ci-bubble {
  align-self: flex-start; max-width: 92%;
  padding: 6px 11px; border-radius: 4px 12px 12px 12px;
  background: rgba(255,255,255,0.07);
  font-size: 12px; color: var(--tx-1); line-height: 1.5; word-break: break-all;
}
.chat-item.mine .ci-name { color: var(--green); text-align: right; }
.chat-item.mine .ci-bubble { align-self: flex-end; border-radius: 12px 4px 12px 12px; background: rgba(53,196,111,0.14); }
.chat-input-row { display: flex; gap: 6px; padding: 8px; border-top: 1px solid rgba(255,255,255,0.07); flex-shrink: 0; }
.chat-input-row input {
  flex: 1; padding: 8px 12px;
  background: rgba(0,0,0,0.35); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px; color: var(--tx-1); font-size: 13px; outline: none;
}
.chat-input-row input:focus { border-color: var(--gold); }

/* ============================================================
   连接遮罩
   ============================================================ */
.conn-overlay {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 9, 7, 0.82);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.25s;
}
@keyframes fadeIn { from { opacity: 0; } }
.overlay-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 30px 40px; border-radius: var(--r-lg);
  background: rgba(16, 31, 24, 0.9);
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-3);
}
.spinner { display: flex; gap: 6px; }
.spinner i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--gold);
  animation: spinBounce 1s ease-in-out infinite;
}
.spinner i:nth-child(2) { animation-delay: 0.15s; }
.spinner i:nth-child(3) { animation-delay: 0.3s; }
@keyframes spinBounce { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-8px); opacity: 1; } }
.overlay-title { font-size: 15px; font-weight: 800; letter-spacing: 1px; }
.overlay-sub { font-size: 11px; color: var(--tx-3); font-family: var(--mono); max-width: 260px; word-break: break-all; text-align: center; }

/* ============================================================
   模态框
   ============================================================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  padding: 22px;
  background: rgba(5, 9, 7, 0.78);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s;
}
.modal-box {
  position: relative; width: 100%; max-width: 360px;
  padding: 24px 22px;
  border-radius: var(--r-lg);
  background: linear-gradient(170deg, rgba(22, 40, 31, 0.97), rgba(10, 18, 14, 0.98));
  border: 1px solid var(--line-strong);
  box-shadow: var(--sh-3);
  animation: modalUp 0.3s var(--ease);
}
@keyframes modalUp { from { opacity: 0; transform: translateY(18px) scale(0.96); } }
.modal-x {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--tx-3); font-size: 14px;
  background: rgba(255,255,255,0.06);
  transition: background 0.15s, color 0.15s, transform 0.2s;
}
.modal-x:hover { background: rgba(255,255,255,0.12); color: var(--tx-1); transform: rotate(90deg); }
.modal-title {
  font-size: 16px; font-weight: 900; letter-spacing: 2px; text-align: center;
  background: linear-gradient(180deg, #f7e3a1, var(--gold-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
}
.modal-body { font-size: 13px; color: var(--tx-2); line-height: 1.7; text-align: center; }
.modal-body b { color: var(--gold); }
.modal-btns { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.modal-btns .btn { flex: 1; }

.num-input {
  width: 100%; margin-top: 10px;
  padding: 13px 16px;
  background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  color: var(--gold); font-size: 20px; font-weight: 800; font-family: var(--mono);
  text-align: center; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.num-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.num-input.invalid { border-color: var(--red); animation: shake 0.35s; }
.modal-err { min-height: 14px; font-size: 11px; color: var(--red); margin-top: 6px; }

/* 加注滑杆 */
.amt-slider { width: 100%; margin-top: 12px; -webkit-appearance: none; appearance: none; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); outline: none; }
.amt-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #f3d27a, var(--gold-2) 70%);
  border: 3px dashed rgba(255,255,255,0.8);
  box-shadow: 0 0 0 2px var(--gold-deep), 0 3px 10px rgba(0,0,0,0.5);
  cursor: pointer;
}
.amt-quick { display: flex; gap: 6px; margin-top: 10px; justify-content: center; flex-wrap: wrap; }
.amt-quick button {
  padding: 5px 12px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: var(--gold);
  background: var(--gold-soft); border: 1px solid var(--line-strong);
  transition: background 0.15s, transform 0.1s;
}
.amt-quick button:active { transform: scale(0.93); background: rgba(232,193,90,0.28); }

/* ============================================================
   响应式
   ============================================================ */

/* ---------- 补充：静态结算条 / 金币跳动 / 快捷金额选中 ---------- */
.result-banner.flat { position: static; transform: none; max-width: none; animation: resultPopFlat 0.4s var(--ease); }
@keyframes resultPopFlat { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.tb-money.pulse { animation: moneyPulse 0.6s var(--ease); }
@keyframes moneyPulse { 0% { transform: scale(1); } 35% { transform: scale(1.18); color: #ffe9ad; } 100% { transform: scale(1); } }
.amt-quick button.on { background: var(--gold); color: #2a1e05; }

@media (min-width: 720px) {
  :root { --cw: 40px; }
  .mode-grid { grid-template-columns: repeat(3, 1fr); }
  .mode-card:nth-child(5) { grid-column: span 1; }
  .mode-card:nth-child(4), .mode-card:nth-child(5) { grid-column: span 1; }
  .lobby-view { padding: 22px 28px 40px; }
  .room-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-height: 500px) {
  /* 横屏手机紧凑模式 */
  :root { --cw: 27px; }
  .topbar { padding: 4px 12px; }
  .tb-avatar { width: 30px; height: 30px; font-size: 13px; }
  .room-head { padding: 2px 12px; }
  .felt { aspect-ratio: 2.05; }
  .seat { width: 82px; gap: 2px; }
  .seat-avatar { width: 38px; height: 38px; font-size: 15px; }
  .seat-name-plate { padding: 2px 8px; }
  .seat-committed { bottom: -10px; }
  .seat-name { font-size: 10px; max-width: 72px; }
  .seat-money { font-size: 9px; }
  .action-bar { padding: 6px 10px; min-height: 48px; }
  .abtn { min-width: 72px; padding: 6px 14px; font-size: 13px; border-radius: 11px; }
  .chat-fab { bottom: 56px; width: 38px; height: 38px; }
  .chat-drawer { bottom: 102px; height: min(300px, 72%); }
  .felt-cloth::after { display: none; }
  .login-card { padding: 22px 24px 18px; }
  .login-title { font-size: 24px; }
  .login-form { gap: 10px; }
}

/* ===== 盲象棋（暗棋） ===== */
.mc-teal { --mc: #2ec4b6; }
.mk-wrap { flex:1; display:flex; flex-direction:column; gap:10px; padding:10px 12px 14px; overflow:auto; }
.mk-head { display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; }
.mk-total { display:inline-flex; align-items:center; gap:7px; padding:5px 16px 5px 6px; border-radius:999px; background:rgba(0,0,0,.45); border:1px solid var(--line-strong); font-size:12px; font-weight:800; color:var(--gold); font-family:var(--mono); }
.mk-color { display:inline-flex; align-items:center; gap:5px; font-size:12px; color:var(--tx-2); padding:2px 8px; border-radius:6px; }
.mk-color b { font-weight:800; }
.mk-color.r { color:#f2726a; }
.mk-color.b { color:#cdd6e0; }
.mk-color.active { box-shadow:0 0 0 2px var(--gold); }
.mk-last { font-size:11px; color:var(--tx-3); }
.mk-board { display:grid; grid-template-columns:repeat(8,1fr); grid-template-rows:repeat(4,1fr); gap:5px; padding:10px; border-radius:14px; background:linear-gradient(160deg,#5a3a1e,#4a2f17); border:2px solid rgba(232,193,90,.3); box-shadow:var(--sh-2), inset 0 0 40px rgba(0,0,0,.4); max-width:520px; margin:0 auto; width:100%; }
.mk-cell { position:relative; aspect-ratio:1/1.05; border-radius:8px; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:transform .1s; }
.mk-cell.hidden { visibility:hidden; pointer-events:none; }
.mk-cell:active { transform:scale(.96); }
.mk-tile { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; border-radius:8px; font-size:24px; font-weight:800; line-height:1; user-select:none; }
.mk-tile.down { background:linear-gradient(160deg,#2a3550,#1b2438); box-shadow:inset 0 0 0 2px rgba(232,193,90,.35), inset 0 0 12px rgba(0,0,0,.4); }
.mk-tile.down::after { content:'象'; position:absolute; inset:0; display:flex; align-items:center; justify-content:center; font-size:20px; color:rgba(232,193,90,.5); }
.mk-tile.r { background:linear-gradient(165deg,#fff4f0,#fff); color:#c52828; box-shadow:var(--sh-1); }
.mk-tile.b { background:linear-gradient(165deg,#f1f1f1,#fff); color:#22303f; box-shadow:var(--sh-1); }
.mk-cell .sel { position:absolute; inset:0; border-radius:8px; box-shadow:0 0 0 3px var(--gold); animation:pulseSel 1s ease-in-out infinite; }
@keyframes pulseSel { 50% { box-shadow:0 0 0 6px rgba(232,193,90,.4), 0 0 16px rgba(232,193,90,.6); } }
.mk-cell .target { position:absolute; inset:0; border-radius:8px; box-shadow:0 0 0 2px rgba(79,156,240,.75); }
.mk-hint { text-align:center; font-size:12px; color:var(--tx-2); line-height:2.2; }
.mk-hint b { color:var(--gold); }
.mk-hint .rule { color:var(--tx-3); font-size:11px; }
@media(max-height:520px){ .mk-tile{font-size:19px} .mk-tile.down::after{font-size:16px} .mk-board{gap:4px} }
@media (max-width: 360px) {
  :root { --cw: 25px; }
  .seat { width: 76px; }
  .seat-avatar { width: 36px; height: 36px; font-size: 14px; }
  .mode-grid { gap: 8px; }
  .abtn { min-width: 66px; padding: 7px 12px; font-size: 13px; }
}
