/* ============ 家庭德州扑克 · 私人牌室 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #06120d;
  --ink-2: #0b1d15;
  --felt: #11533a;
  --felt-deep: #0a3527;
  --brass: #d8b878;
  --brass-bright: #f1d59a;
  --cream: #f4efe4;
  --muted: #a8b8ae;
  --line: rgba(216, 184, 120, 0.22);
  --danger: #e2634f;
  --ok: #57c98b;
  --panel: rgba(8, 24, 18, 0.94);
  --radius: 14px;
  --radius-sm: 9px;
  --serif: 'Georgia', 'Songti SC', 'Noto Serif SC', 'SimSun', serif;
  --sans: 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
}

html, body {
  width: 100%;
  min-height: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body { overflow-x: hidden; }
body.in-game { overflow: hidden; }
body:not(.in-game) { overflow-y: auto; }
.hidden { display: none !important; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; letter-spacing: 0.01em; }
button, input, select { font-family: inherit; font-size: 15px; }
button { cursor: pointer; }
input, select { color: var(--cream); }

.eyebrow {
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--brass);
  text-transform: uppercase;
  margin-bottom: 6px;
}

/* ---------- 加载 ---------- */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #124633 0%, #06120d 70%);
}
.loading-content { text-align: center; }
.brand-mark {
  font-family: var(--serif); font-size: 58px; color: var(--brass);
  letter-spacing: 0.08em; margin-bottom: 12px;
}
.brand-mark span { color: var(--cream); }
.loading-content h1 { font-size: 22px; color: var(--cream); margin-bottom: 18px; }
.loading-bar { width: 240px; height: 4px; background: rgba(255,255,255,.1); margin: 0 auto 12px; border-radius: 3px; overflow: hidden; }
.loading-progress { height: 100%; width: 0; background: linear-gradient(90deg, var(--brass), var(--brass-bright)); animation: load 1.2s ease-out forwards; }
.loading-text { font-size: 14px; color: var(--muted); }
@keyframes load { to { width: 100%; } }

/* ---------- 通用页面 ---------- */
.page-scroll {
  min-height: 100vh;
  padding: 20px clamp(12px, 3vw, 40px) 32px;
  background:
    radial-gradient(ellipse at 15% -10%, rgba(30, 110, 76, 0.55), transparent 55%),
    radial-gradient(ellipse at 90% 0%, rgba(80, 60, 25, 0.35), transparent 50%),
    var(--ink);
}

.btn-primary, .btn-secondary, .btn-text {
  border: none; border-radius: var(--radius-sm); font-weight: 600;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.btn-primary {
  width: 100%; padding: 13px 18px; font-size: 16px;
  background: linear-gradient(135deg, var(--brass) 0%, #b9924f 100%);
  color: #201503; letter-spacing: .04em;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-secondary {
  padding: 10px 16px; font-size: 14px; color: var(--cream);
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
}
.btn-secondary:hover { background: rgba(255,255,255,.12); border-color: var(--brass); }
.btn-secondary.compact { padding: 7px 12px; font-size: 14px; white-space: nowrap; }
.btn-text { background: none; padding: 6px 2px; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.btn-text:hover { color: var(--brass-bright); }
.danger-text { color: #f0a091; }

.section-heading { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.section-heading h2 { font-size: 20px; }
.section-heading p { font-size: 14px; color: var(--muted); margin-top: 2px; }
.section-number {
  font-family: var(--serif); font-size: 14px; color: var(--brass);
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px;
  flex: 0 0 auto; margin-top: 3px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.form-group input {
  width: 100%; padding: 12px 13px; font-size: 16px;
  background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-sm); outline: none;
}
.form-group input:focus { border-color: var(--brass); }

/* ---------- 登录 ---------- */
#login-screen { display: flex; align-items: center; justify-content: center; }
.login-shell {
  width: 100%; max-width: 1040px; display: grid;
  grid-template-columns: 1.05fr 0.95fr; gap: 32px; align-items: center;
}
.login-intro h1 { font-size: clamp(30px, 4vw, 46px); line-height: 1.22; margin: 10px 0 14px; }
.login-intro p { font-size: 16px; color: var(--muted); max-width: 30em; }
.rule-strip { display: flex; gap: 22px; margin-top: 26px; flex-wrap: wrap; }
.rule-strip span { font-size: 14px; color: var(--muted); }
.rule-strip strong { font-family: var(--serif); font-size: 26px; color: var(--brass); margin-right: 4px; }
.login-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.entry-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: rgba(0,0,0,.35); padding: 5px; border-radius: 10px; margin-bottom: 18px; }
.entry-tab {
  padding: 9px; font-size: 15px; font-weight: 600; color: var(--muted);
  background: none; border: none; border-radius: 7px;
}
.entry-tab.active { background: rgba(216,184,120,.16); color: var(--brass-bright); box-shadow: inset 0 0 0 1px var(--line); }
.avatar-grid, .outfit-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.avatar-item, .outfit-item {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 21px; background: rgba(255,255,255,.04);
  border: 1px solid transparent; border-radius: 8px;
}
.avatar-item:hover, .outfit-item:hover { border-color: rgba(216,184,120,.5); }
.avatar-item.selected, .outfit-item.selected { border-color: var(--brass); background: rgba(216,184,120,.16); }
#admin-login-form .btn-text { display: block; margin: 12px auto 0; }

/* ---------- 大厅 ---------- */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.page-header h1 { font-size: clamp(24px, 3vw, 32px); }
.account-strip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.account-strip > div { display: flex; flex-direction: column; }
.account-strip span { font-size: 14px; color: var(--muted); }
.account-strip strong { font-size: 17px; color: var(--brass-bright); font-family: var(--serif); }
.admin-identity { font-size: 14px; color: var(--brass); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; }

.lobby-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
.create-room-panel, .rooms-section {
  background: rgba(8, 26, 19, .78); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.room-form label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 12px; font-weight: 600; }
.room-form input, .room-form select {
  width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 15px;
  background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px; outline: none;
}
.room-form input:focus, .room-form select:focus { border-color: var(--brass); }
.lobby-rules { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.lobby-rules h3 { font-size: 16px; margin-bottom: 6px; }
.lobby-rules p { font-size: 14px; color: var(--muted); }

.rooms-heading { align-items: center; }
.rooms-heading .section-heading > div:nth-child(2) { flex: 1; }
.rooms-heading button { margin-left: auto; }
.room-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.room-card {
  border: 1px solid rgba(255,255,255,.1); border-radius: 12px;
  padding: 13px; background: linear-gradient(160deg, rgba(20,64,46,.75), rgba(8,28,20,.85));
  display: flex; flex-direction: column; gap: 9px;
}
.room-card:hover { border-color: rgba(216,184,120,.45); }
.room-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.room-card-top h3 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-pill { font-size: 14px; padding: 2px 9px; border-radius: 999px; flex: 0 0 auto; }
.status-pill.waiting { background: rgba(255,255,255,.1); color: var(--muted); }
.status-pill.countdown { background: rgba(216,184,120,.2); color: var(--brass-bright); }
.status-pill.playing { background: rgba(87,201,139,.18); color: var(--ok); }
.room-card-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.seat-meter { height: 4px; background: rgba(255,255,255,.1); border-radius: 3px; overflow: hidden; }
.seat-meter > div { height: 100%; background: linear-gradient(90deg, var(--brass), var(--brass-bright)); }
.room-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--muted); }
.room-enter-btn {
  padding: 8px 14px; font-size: 14px; font-weight: 700;
  border-radius: 8px; border: none; color: #201503;
  background: linear-gradient(135deg, var(--brass), #bc9852);
}
.room-enter-btn:hover { filter: brightness(1.08); }
.empty-state { font-size: 14px; color: var(--muted); padding: 18px; border: 1px dashed var(--line); border-radius: 10px; text-align: center; }

/* ---------- 管理后台 ---------- */
.admin-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.metric-card { background: rgba(8,26,19,.8); border: 1px solid var(--line); border-radius: 12px; padding: 13px 15px; display: flex; flex-direction: column; gap: 3px; }
.metric-card span { font-size: 14px; color: var(--muted); }
.metric-card strong { font-family: var(--serif); font-size: 24px; color: var(--brass-bright); }
.admin-data-section { background: rgba(8,26,19,.7); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.data-table th { text-align: left; font-size: 14px; color: var(--brass); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: middle; }
.data-table td.positive { color: var(--ok); }
.data-table td.negative { color: var(--danger); }
.admin-chips-input { width: 120px; padding: 7px 9px; font-size: 15px; background: rgba(0,0,0,.35); border: 1px solid rgba(255,255,255,.16); border-radius: 7px; }
.table-action-btn { padding: 7px 13px; font-size: 14px; font-weight: 600; border-radius: 7px; border: none; background: var(--brass); color: #201503; }
.table-action-btn.danger { background: rgba(226,99,79,.85); color: #fff; }
.table-action-btn:hover { filter: brightness(1.08); }
.table-empty { color: var(--muted); text-align: center; padding: 16px; }

/* ---------- 牌桌 ---------- */
#game-screen { position: fixed; inset: 0; overflow: hidden; }
#table-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

#top-bar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0,0,0,.82), rgba(0,0,0,0));
}
.top-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.top-left > div { min-width: 0; }
.room-name { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.room-meta { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 34vw; }
.top-right { display: flex; gap: 6px; }
.icon-btn {
  min-width: 40px; height: 38px; padding: 0 10px;
  border-radius: 999px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.55); color: var(--cream); font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--brass); }
.text-icon { font-size: 14px; }
.pot-display {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 14px; border-radius: 999px;
  background: rgba(0,0,0,.62); border: 1px solid var(--brass);
  color: var(--brass); font-size: 14px;
}
.pot-amount { font-family: var(--serif); font-size: 20px; color: var(--brass-bright); }
.pot-label { font-size: 14px; color: var(--muted); }
.admin-page-header { border-bottom-color: rgba(216,184,120,.45); }

.panel {
  position: absolute; left: 12px; top: calc(62px + env(safe-area-inset-top));
  z-index: 100; width: 172px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
}
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 15px; font-weight: 600; }
.role-badge { font-size: 14px; color: var(--muted); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 1px 8px; font-weight: 500; }
.role-badge.owner { color: var(--brass-bright); border-color: var(--brass); }
.chips-display { margin: 3px 0 5px; font-size: 14px; color: var(--gold, #ffd700); }
.chips-display strong { font-family: var(--serif); font-size: 18px; color: var(--brass-bright); }
.panel .btn-text { font-size: 14px; }

.table-status {
  position: absolute; left: 50%; top: calc(64px + env(safe-area-inset-top));
  transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 16px; border-radius: 12px; text-align: center;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.12);
  max-width: min(92vw, 520px);
}
.table-status strong { font-size: 15px; color: var(--brass-bright); }
.table-status span { font-size: 14px; color: var(--muted); }
.countdown-value { font-family: var(--serif); font-size: 27px; color: var(--brass-bright); line-height: 1.1; }

.action-panel {
  position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 120;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  justify-content: center; padding: 9px 12px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  max-width: calc(100vw - 24px);
}
.ready-summary { font-size: 14px; color: var(--muted); }
.btn-ready {
  padding: 11px 26px; font-size: 16px; font-weight: 700; letter-spacing: .05em;
  border: none; border-radius: 10px; color: #201503;
  background: linear-gradient(135deg, var(--brass), #b9924f);
}
.btn-ready.is-ready { background: linear-gradient(135deg, #57c98b, #2f9c66); color: #042213; }
.btn-ready:disabled { opacity: .45; cursor: not-allowed; }
#spectator-panel { flex-direction: column; gap: 2px; }
#spectator-panel strong { font-size: 15px; color: var(--brass-bright); }
#spectator-panel span { font-size: 14px; color: var(--muted); }

.owner-config {
  position: absolute; right: 12px; top: calc(62px + env(safe-area-inset-top)); z-index: 210;
  width: 260px; padding: 14px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  box-shadow: 0 20px 50px rgba(0,0,0,.55);
}
.owner-config .section-heading { margin-bottom: 10px; justify-content: space-between; }
.owner-config h2 { font-size: 16px; }
.owner-config label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.owner-config input, .owner-config select {
  width: 100%; margin-top: 5px; padding: 9px 11px; font-size: 15px;
  background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.14); border-radius: 7px;
}
.owner-config p { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.close-btn { width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255,255,255,.1); color: var(--cream); font-size: 17px; }

/* 下注行动面板 */
.action-betting { flex-direction: column; gap: 7px; padding: 9px 12px; width: min(560px, calc(100vw - 24px)); }
.action-top { display: flex; align-items: center; gap: 10px; width: 100%; }
.action-turn { font-size: 14px; font-weight: 700; color: var(--brass-bright); }
.action-timer-wrap { margin-left: auto; display: flex; align-items: center; gap: 6px; width: 118px; }
.action-timer-bar { height: 5px; width: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--ok), var(--brass-bright)); transition: width .1s linear; }
.action-timer { font-size: 14px; color: var(--muted); min-width: 22px; text-align: right; font-variant-numeric: tabular-nums; }
.action-buttons { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.act-btn {
  flex: 1 1 0; min-width: 64px; padding: 10px 8px; font-size: 15px; font-weight: 700;
  border-radius: 10px; border: 1px solid transparent; color: #fff;
  transition: filter .12s ease, transform .12s ease;
}
.act-btn:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.act-btn:disabled { opacity: .42; cursor: not-allowed; }
.act-btn.fold { background: rgba(226, 99, 79, .88); }
.act-btn.check, .act-btn.call { background: rgba(87, 201, 139, .92); color: #042213; }
.act-btn.raise { background: linear-gradient(135deg, var(--brass), #b9924f); color: #201503; white-space: nowrap; }
.act-btn.allin { background: linear-gradient(135deg, #e2643f, #a83f22); }
.raise-group { flex: 1 1 100%; display: flex; gap: 6px; }
.raise-group input {
  flex: 0 1 132px; min-width: 0; padding: 9px 10px; font-size: 15px;
  background: rgba(0, 0, 0, .4); border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 10px; color: var(--cream); outline: none;
}
.raise-group input:focus { border-color: var(--brass); }
.raise-group .act-btn { flex: 1 1 auto; }

body.acting #my-hand { bottom: calc(186px + env(safe-area-inset-bottom)); }
body.acting #chat-panel { bottom: calc(168px + env(safe-area-inset-bottom)); }

/* 公共牌大图 */
#community-overlay {
  position: fixed; inset: 0; z-index: 400; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(0, 0, 0, .8);
}
.community-overlay-content {
  width: 100%; max-width: 620px; padding: 16px; border-radius: 16px;
  background: linear-gradient(160deg, #12462f, #081d15);
  border: 1px solid var(--brass); box-shadow: 0 24px 60px rgba(0, 0, 0, .65);
  animation: pop .25s ease;
}
.community-overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.community-overlay-head strong { font-size: 17px; color: var(--brass-bright); }
.community-overlay-cards { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.community-overlay-tip { margin-top: 14px; font-size: 14px; color: var(--muted); text-align: center; }
.community-empty { font-size: 14px; color: var(--muted); padding: 20px; }
.poker-card.large { width: 104px; height: 148px; border-radius: 10px; }
.poker-card.large .pc-rank { font-size: 34px; }
.poker-card.large .pc-suit-small { font-size: 20px; top: 6px; left: 9px; }
.poker-card.large .pc-suit-big { font-size: 52px; }

/* 结算明细 */
.result-detail { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-width: 440px; }
.result-hand-row { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; background: rgba(255, 255, 255, .05); font-size: 14px; }
.result-hand-row.winner { background: rgba(216, 184, 120, .16); box-shadow: inset 0 0 0 1px var(--line); }
.rh-name { min-width: 62px; max-width: 96px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rh-cards { display: flex; gap: 3px; }
.rh-type { margin-left: auto; color: var(--brass-bright); white-space: nowrap; }
.poker-card.mini { width: 30px; height: 42px; border-radius: 4px; box-shadow: none; border-color: #b8ae98; }
.poker-card.mini .pc-rank { font-size: 14px; }
.poker-card.mini .pc-suit-small { display: none; }
.poker-card.mini .pc-suit-big { font-size: 16px; }

/* 座位徽章 */
.mini-badge.dealer { background: #f3efe2; color: #08251a; font-weight: 700; }
.mini-badge.sb { background: rgba(52, 152, 219, .3); color: #8ec9f0; }
.mini-badge.bb { background: rgba(231, 76, 60, .3); color: #f3a89f; }
.mini-badge.allin { background: rgba(255, 138, 91, .25); color: #ffb08c; }
.mini-badge.bet { background: rgba(241, 213, 154, .2); color: var(--brass-bright); }
.seat-row.folded { opacity: .55; }

#my-hand {
  position: absolute; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateZ(0); z-index: 300;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  pointer-events: none;
  padding: 6px 10px; border-radius: 10px;
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(216, 184, 120, .3);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .7);
  backdrop-filter: blur(6px);
  isolation: isolate;
}
.my-hand-cards { display: flex; gap: 9px; }
.my-hand-name { font-size: 14px; color: var(--brass-bright); }
.poker-card {
  width: 68px; height: 96px; border-radius: 8px; background: #fdfaf2;
  border: 1px solid #cfc6b3; position: relative; color: #14211a;
  box-shadow: 0 6px 16px rgba(0,0,0,.5);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.poker-card.red { color: #b8322a; }
.pc-rank { font-family: var(--serif); font-size: 25px; font-weight: 700; line-height: 1; }
.pc-suit-small { position: absolute; top: 4px; left: 6px; font-size: 15px; }
.pc-suit-big { font-size: 30px; line-height: 1; }

/* 九座状态面板 */
.seat-panel {
  position: absolute; right: 12px; top: calc(152px + env(safe-area-inset-top)); z-index: 200;
  width: 268px; max-height: min(46vh, 420px); overflow-y: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px;
}
.seat-panel-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.seat-panel-header strong { flex: 1; }
.seat-panel-header span { font-size: 14px; color: var(--brass); }
.seat-panel-header button { width: 26px; height: 26px; border: none; border-radius: 50%; background: rgba(255,255,255,.1); color: var(--cream); font-size: 15px; }
.seat-list { display: flex; flex-direction: column; gap: 5px; }
.seat-row {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 6px 8px; border-radius: 8px; font-size: 14px;
  background: rgba(255,255,255,.05);
}
.seat-row.me { background: rgba(216,184,120,.14); box-shadow: inset 0 0 0 1px var(--line); }
.seat-row.empty { color: var(--muted); background: rgba(255,255,255,.02); }
.seat-index { width: 19px; height: 19px; border-radius: 50%; background: rgba(0,0,0,.4); font-size: 14px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.seat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.seat-chips { font-size: 14px; color: var(--brass-bright); }
.seat-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.mini-badge { font-size: 14px; padding: 0 6px; border-radius: 999px; }
.mini-badge.owner { background: rgba(216,184,120,.24); color: var(--brass-bright); }
.mini-badge.ready { background: rgba(87,201,139,.2); color: var(--ok); }
.mini-badge.folded { background: rgba(255,255,255,.1); color: var(--muted); }
.mini-badge.offline { background: rgba(226,99,79,.2); color: #f0a091; }
.spectator-list { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.spectator-title { font-size: 14px; color: var(--muted); margin-bottom: 3px; }
.spectator-names { font-size: 14px; color: var(--cream); }

/* 聊天 */
#chat-panel {
  position: absolute; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 150;
  width: 268px; max-height: 300px; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.chat-tabs { display: flex; border-bottom: 1px solid var(--line); }
.chat-tab { flex: 1; padding: 8px; font-size: 14px; background: none; border: none; color: var(--muted); }
.chat-tab.active { color: var(--brass-bright); background: rgba(216,184,120,.12); }
.chat-close { display: none; width: 34px; border: none; background: none; color: var(--muted); font-size: 16px; }
.chat-content { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; min-height: 80px; }
.chat-message { font-size: 14px; line-height: 1.4; word-break: break-word; }
.msg-sender { color: var(--ok); font-weight: 600; }
.chat-message.system { color: var(--muted); font-size: 14px; }
.chat-input-area { display: flex; gap: 6px; padding: 7px; border-top: 1px solid var(--line); }
#chat-input { flex: 1; min-width: 0; padding: 8px 10px; font-size: 15px; background: rgba(0,0,0,.34); border: 1px solid rgba(255,255,255,.14); border-radius: 7px; outline: none; }
#chat-input:focus { border-color: var(--brass); }
#chat-send-btn { padding: 8px 14px; font-size: 14px; font-weight: 600; border: none; border-radius: 7px; background: var(--brass); color: #201503; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; padding: 8px; overflow-y: auto; }
.emoji-btn { aspect-ratio: 1; font-size: 20px; background: none; border: none; border-radius: 6px; }
.emoji-btn:hover { background: rgba(255,255,255,.1); }

/* 弹窗 */
.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 12px; background: rgba(0,0,0,.72); }
.modal-content { width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto; background: #0a1f17; border: 1px solid var(--line); border-radius: 16px; }
.modal-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); background: #0a1f17; }
.modal-header h2 { font-size: 18px; color: var(--brass-bright); }
.stats-body { padding: 14px 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.stat-card { background: rgba(255,255,255,.05); border-radius: 10px; padding: 10px; text-align: center; }
.stat-card.highlight { background: rgba(216,184,120,.14); box-shadow: inset 0 0 0 1px var(--line); }
.stat-period { font-size: 14px; color: var(--muted); }
.stat-value { font-family: var(--serif); font-size: 19px; font-weight: 700; word-break: break-all; }
.stat-value.positive { color: var(--ok); }
.stat-value.negative { color: var(--danger); }
.stat-games { font-size: 14px; color: var(--muted); }
.leaderboard-section h3 { font-size: 16px; margin-bottom: 8px; color: var(--brass); }
.leaderboard { display: flex; flex-direction: column; gap: 5px; }
.leaderboard-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; background: rgba(255,255,255,.04); border-radius: 8px; font-size: 14px; }
.leaderboard-rank { width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.leaderboard-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-chips { color: var(--brass-bright); }
.leaderboard-profit { min-width: 72px; text-align: right; }
.leaderboard-profit.positive { color: var(--ok); }
.leaderboard-profit.negative { color: var(--danger); }


#hand-result { position: fixed; inset: 0; z-index: 320; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.result-content { text-align: center; padding: 26px 40px; border-radius: 16px; border: 1px solid var(--brass); background: linear-gradient(150deg, rgba(20,80,55,.96), rgba(8,30,22,.98)); box-shadow: 0 24px 60px rgba(0,0,0,.6); animation: pop .32s ease; }
.result-content.lose { border-color: rgba(255,255,255,.25); background: linear-gradient(150deg, rgba(46,52,49,.96), rgba(14,20,17,.98)); }
.result-title { font-family: var(--serif); font-size: 26px; color: var(--brass-bright); }
.result-hand { font-size: 16px; color: var(--cream); margin: 4px 0; }
.result-chips { font-family: var(--serif); font-size: 24px; color: var(--brass-bright); }
@keyframes pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: scale(1); } }

#floating-effects { position: fixed; inset: 0; z-index: 250; pointer-events: none; }
.floating-emoji { position: absolute; font-size: 34px; animation: floatUp 2s ease-out forwards; }
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-120px) scale(1.4) rotate(16deg); }
}

/* 系统锁定屏 */#lock-screen {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, #124633 0%, #06120d 70%);
  padding: 20px;
}
.lock-content { width: 100%; max-width: 380px; text-align: center; }
.lock-icon { font-size: 64px; margin-bottom: 18px; }
.lock-title { font-size: 26px; color: var(--brass-bright); margin-bottom: 12px; letter-spacing: .04em; }
.lock-desc { font-size: 15px; color: var(--muted); line-height: 1.6; margin-bottom: 22px; }
#unlock-password {
  width: 100%; padding: 13px 16px; font-size: 16px;
  background: rgba(0,0,0,.4); color: var(--cream);
  border: 1px solid var(--line); border-radius: 10px;
  outline: none; margin-bottom: 12px; text-align: center; letter-spacing: .1em;
}
#unlock-password:focus { border-color: var(--brass); }
#unlock-submit { margin-top: 4px; }
.lock-error { margin-top: 12px; font-size: 14px; color: var(--danger); }

/* 本桌历史 */.history-body { padding: 14px; max-height: 70vh; overflow-y: auto; }
.history-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 15px; }
.history-item { margin-bottom: 14px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.07); }
.history-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.hh-time { color: var(--brass-bright); font-weight: 700; font-variant-numeric: tabular-nums; }
.hh-pot { margin-left: auto; color: var(--brass); font-weight: 600; }
.history-community { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); padding: 4px 0 8px; }
.hc-cards { display: flex; gap: 4px; }
.history-rows { display: flex; flex-direction: column; gap: 4px; }
.history-row { display: grid; grid-template-columns: 26px 1fr auto auto auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; font-size: 14px; background: rgba(0,0,0,.2); }
.history-row.winner { background: rgba(216,184,120,.16); box-shadow: inset 0 0 0 1px var(--line); }
.hr-seat { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: rgba(255,255,255,.08); color: var(--brass); font-size: 14px; font-weight: 700; }
.hr-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-cards { display: flex; gap: 3px; }
.hr-hand { color: var(--brass-bright); font-size: 14px; white-space: nowrap; }
.hr-commit { color: var(--muted); font-size: 14px; white-space: nowrap; }
.hr-gain { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 60px; text-align: right; }
.hr-gain.pos { color: var(--ok); }
.hr-gain.neg { color: var(--danger); }
.history-card { display: inline-block; min-width: 22px; padding: 2px 4px; border-radius: 3px; background: #fdfaf2; color: #14211a; font-weight: 700; font-size: 14px; text-align: center; }
.history-card.red { color: #c03028; }
.history-folded { color: var(--muted); font-size: 14px; font-style: italic; }
@media (max-width: 600px) {
  .history-row { grid-template-columns: 22px 1fr auto; grid-row-gap: 4px; }
  .hr-cards, .hr-hand, .hr-commit, .hr-gain { grid-column: span 1; }
  .history-row { font-size: 14px; }
}

/* ALL IN 弹幕 */.allin-barrage {
  position: absolute; left: 100%;
  white-space: nowrap; font-weight: 900; font-size: 32px;
  font-family: var(--serif);
  background: linear-gradient(135deg, #ffd76a, #ff7e3f 60%, #e2643f);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(255, 150, 60, .35);
  letter-spacing: .04em;
  animation: allinSlide 4s linear forwards;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6));
}
@keyframes allinSlide {
  0% { transform: translateX(0); opacity: 0; }
  6% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateX(calc(-100vw - 100%)); opacity: 0; }
}
@media (max-width: 820px) {
  .allin-barrage { font-size: 24px; }
}

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 900;
  padding: 10px 18px; border-radius: 999px; font-size: 15px;
  background: rgba(8, 24, 18, .96); border: 1px solid var(--brass); color: var(--cream);
  box-shadow: 0 12px 30px rgba(0,0,0,.5); max-width: calc(100vw - 32px);
}

body.offline::after {
  content: '连接中断，正在重连…';
  position: fixed; top: 0; left: 0; right: 0; z-index: 950;
  padding: 5px; text-align: center; font-size: 14px;
  background: rgba(226,99,79,.92); color: #fff;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; gap: 20px; max-width: 560px; }
  .login-intro h1 { font-size: 30px; }
  .rule-strip { margin-top: 14px; gap: 16px; }
  .lobby-layout { grid-template-columns: 1fr; }
  .create-room-panel { order: 2; }
  .rooms-section { order: 1; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .page-scroll { padding: 14px 10px 24px; }
  .page-header { margin-bottom: 12px; }
  .account-strip { gap: 8px; width: 100%; justify-content: space-between; }

  #top-bar { padding: 6px 8px; padding-top: calc(6px + env(safe-area-inset-top)); gap: 6px; }
  .room-name, .room-meta { max-width: 32vw; font-size: 15px; }
  .icon-btn { min-width: 36px; height: 34px; padding: 0 8px; font-size: 14px; }
  .pot-display { padding: 4px 10px; }
  .pot-amount { font-size: 17px; }

  .panel { left: 8px; width: 150px; padding: 8px 10px; }
  .chips-display strong { font-size: 16px; }
  .table-status { top: calc(54px + env(safe-area-inset-top)); padding: 5px 12px; max-width: 86vw; }
  .table-status strong { font-size: 14px; }
  .countdown-value { font-size: 23px; }

  /* 手机端：相机跟随自己座位后，3D 中底牌在近景，DOM 兜底缩小移到顶部，避免压住 3D 底牌 */
  #my-hand {
    top: calc(54px + env(safe-area-inset-top));
    bottom: auto;
    left: auto; right: 8px;
    transform: none;
    padding: 4px 6px; gap: 3px;
    background: rgba(0,0,0,.65);
  }
  body.acting #my-hand { bottom: auto; }
  #my-hand .poker-card { width: 40px; height: 56px; }
  #my-hand .pc-rank { font-size: 16px; }
  #my-hand .pc-suit-big { font-size: 19px; }
  #my-hand .my-hand-name { font-size: 14px; }
  .poker-card { width: 58px; height: 82px; }
  .pc-rank { font-size: 21px; }
  .pc-suit-big { font-size: 25px; }

  .action-panel {
    left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom));
    transform: none; max-width: none; width: auto; padding: 8px 10px; gap: 8px;
  }
  .ready-summary { flex: 1 1 100%; text-align: center; }
  .btn-ready { flex: 1; padding: 11px; font-size: 16px; }
  #config-toggle-btn { flex: 1; }

  .owner-config {
    left: 8px; right: 8px; width: auto;
    top: calc(54px + env(safe-area-inset-top));
  }

  /* 九座面板与聊天改为抽屉 */
  .seat-panel {
    display: none; right: 8px; left: 8px; width: auto;
    top: calc(54px + env(safe-area-inset-top)); max-height: 50vh;
  }
  .seat-panel.mobile-open { display: block; }

  #chat-panel {
    display: none; right: 8px; left: 8px; bottom: calc(84px + env(safe-area-inset-bottom));
    width: auto; max-height: 42vh;
  }
  body.acting #chat-panel { bottom: calc(232px + env(safe-area-inset-bottom)); }
  #chat-panel.mobile-open { display: flex; }
  .chat-close { display: block; }
  .chat-tab { padding: 11px 8px; font-size: 15px; }
  #chat-input { font-size: 16px; }
  .room-list { grid-template-columns: 1fr; }
  .avatar-grid, .outfit-grid { grid-template-columns: repeat(8, 1fr); }
  .avatar-item, .outfit-item { font-size: 18px; }
}

@media (max-width: 480px) {
  .room-name { max-width: 40vw; }
  .room-meta { max-width: 46vw; }
  .avatar-grid, .outfit-grid { grid-template-columns: repeat(8, 1fr); gap: 4px; }
  .avatar-item, .outfit-item { font-size: 17px; border-radius: 6px; }
  .login-card { padding: 16px; }
  .login-intro h1 { font-size: 26px; }
  .stat-value { font-size: 17px; }
  .modal-content { max-height: 92vh; }
  .result-content { padding: 22px 26px; }
  .result-title { font-size: 22px; }
}

/* 横屏手机：压缩上下空间 */
@media (max-height: 520px) and (orientation: landscape) {
  #game-screen #top-bar { padding-top: 4px; }
  .panel { top: calc(48px + env(safe-area-inset-top)); width: 140px; padding: 6px 9px; }
  .panel .btn-text { display: none; }
  .table-status { top: calc(46px + env(safe-area-inset-top)); }
  #my-hand { top: calc(48px + env(safe-area-inset-top)); bottom: auto; right: 8px; left: auto; transform: none; }
  body.acting #my-hand { bottom: auto; }
  .poker-card { width: 50px; height: 70px; }
  .pc-rank { font-size: 18px; }
  .pc-suit-big { font-size: 21px; }
  .action-panel { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(6px + env(safe-area-inset-bottom)); }
  .ready-summary { flex: 0 1 auto; }
  .btn-ready { flex: 0 0 auto; padding: 10px 22px; }
  #chat-panel { bottom: calc(62px + env(safe-area-inset-bottom)); height: 60vh; max-height: none; }
}

/* ==================== 手机端 2D 牌桌 ==================== */
#mobile-table { display: none; }
@media (max-width: 820px) {
  /* 隐藏 3D canvas，启用 2D 牌桌 */
  body.in-game #table-canvas { display: none !important; }
  body.in-game #mobile-table {
    display: block;
    position: absolute; inset: 0;
    pointer-events: none;
    overflow: hidden;
  }
  /* 手机端隐藏底部 DOM 兜底（2D 牌桌已包含我的底牌） */
  body.in-game #my-hand { display: none !important; }
}

#mobile-table {
  font-family: var(--sans);
  color: var(--cream);
}

/* 桌面：椭圆毡布 */
.mt-felt {
  position: absolute;
  left: 50%; top: 38%;
  width: 92%; aspect-ratio: 1.5 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, #1f8058 0%, #155a3e 55%, #0a3826 100%);
  box-shadow:
    inset 0 0 0 6px #3a2517,
    inset 0 0 0 8px #d8b878,
    inset 0 0 0 10px #3a2517,
    0 0 60px rgba(0,0,0,.6);
}

/* 座位容器：覆盖整个桌面区域 */
.mt-seats {
  position: absolute;
  left: 50%; top: 38%;
  width: 100%; aspect-ratio: 1.5 / 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* 单个座位 */
.mt-seat {
  position: absolute;
  min-width: 78px;
  transform: translate(-50%, -50%);
  padding: 5px 8px;
  background: rgba(8,18,13,.82);
  border: 1px solid rgba(216,184,120,.25);
  border-radius: 8px;
  text-align: center;
  font-size: 14px;
  color: var(--cream);
  pointer-events: auto;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.mt-seat.empty { background: rgba(0,0,0,.3); border-style: dashed; color: rgba(255,255,255,.3); pointer-events: auto; }
.mt-seat.empty:hover { border-color: var(--brass-bright); color: var(--brass-bright); background: rgba(216,184,120,.1); }
.seat-row.empty.clickable { cursor: pointer; transition: background .15s; }
.seat-row.empty.clickable:hover { background: rgba(216,184,120,.1); }
.mt-seat.acting { border-color: var(--brass-bright); box-shadow: 0 0 12px rgba(255,215,106,.6); }
.mt-seat.folded { opacity: .45; }
.mt-seat.winner { border-color: var(--brass-bright); background: rgba(216,184,120,.18); }
.mt-seat-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 90px; }
.mt-seat-stack { color: var(--brass); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 1px; }
.mt-seat-badges { display: flex; gap: 3px; justify-content: center; margin-top: 3px; flex-wrap: wrap; }
.mt-badge { display: inline-block; padding: 1px 5px; border-radius: 4px; font-size: 14px; font-weight: 700; line-height: 1.2; }
.mt-badge.d { background: var(--brass-bright); color: #14211a; }
.mt-badge.sb { background: #4a90e2; color: white; }
.mt-badge.bb { background: #e2643f; color: white; }
.mt-badge.bet { background: rgba(0,0,0,.6); color: var(--brass-bright); }
.mt-badge.allin { background: #e2643f; color: white; }
.mt-badge.fold { background: rgba(0,0,0,.5); color: #999; }

/* 中央：底池 + 公共牌 + 阶段 */
.mt-center {
  position: absolute;
  left: 50%; top: 38%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  width: 80%;
  max-width: 380px;
}
.mt-pot { display: inline-flex; align-items: baseline; gap: 5px; padding: 4px 14px; background: rgba(0,0,0,.55); border: 1px solid var(--line); border-radius: 999px; margin-bottom: 8px; }
.mt-pot-label { font-size: 14px; color: var(--muted); }
.mt-pot-amount { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--brass-bright); font-variant-numeric: tabular-nums; }
.mt-pot-unit { font-size: 14px; color: var(--brass); font-weight: 600; }
.mt-community { display: flex; gap: 5px; justify-content: center; min-height: 80px; }
.mt-community .poker-card { width: 50px; height: 70px; pointer-events: auto; cursor: pointer; }
.mt-community .poker-card .pc-rank { font-size: 19px; }
.mt-community .poker-card .pc-suit-big { font-size: 22px; }
.mt-stage { margin-top: 6px; font-size: 14px; color: var(--brass); font-weight: 600; letter-spacing: .04em; }

/* 自己：底部居中放大显示 */
.mt-self {
  position: absolute;
  left: 50%; bottom: calc(140px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  text-align: center;
  pointer-events: auto;
  padding: 8px 14px;
  background: rgba(0,0,0,.55);
  border: 2px solid var(--brass-bright);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.6), 0 0 16px rgba(216,184,120,.25);
  backdrop-filter: blur(8px);
}
body.acting .mt-self { bottom: calc(228px + env(safe-area-inset-bottom)); }
.mt-self-cards { display: flex; gap: 8px; justify-content: center; }
.mt-self-cards .poker-card { width: 72px; height: 100px; box-shadow: 0 3px 12px rgba(0,0,0,.5); }
.mt-self-cards .poker-card .pc-rank { font-size: 26px; }
.mt-self-cards .poker-card .pc-suit-big { font-size: 32px; }
.mt-self-meta { display: flex; gap: 10px; justify-content: center; margin-top: 5px; font-size: 14px; color: var(--brass-bright); font-weight: 600; }
.mt-self-hand-name { margin-top: 4px; font-size: 15px; color: var(--brass-bright); font-weight: 700; letter-spacing: .04em; }

/* 横屏手机：整体缩小一点 */
@media (max-width: 820px) and (max-height: 520px) and (orientation: landscape) {
  .mt-felt { top: 50%; width: 78%; aspect-ratio: 2 / 1; }
  .mt-seats { top: 50%; width: 92%; aspect-ratio: 2 / 1; }
  .mt-center { top: 50%; }
  .mt-self { bottom: calc(86px + env(safe-area-inset-bottom)); padding: 5px 10px; }
  body.acting .mt-self { bottom: calc(168px + env(safe-area-inset-bottom)); }
  .mt-self-cards .poker-card { width: 56px; height: 78px; }
  .mt-self-cards .poker-card .pc-rank { font-size: 20px; }
  .mt-self-cards .poker-card .pc-suit-big { font-size: 26px; }
  .mt-community .poker-card { width: 42px; height: 60px; }
  .mt-community .poker-card .pc-rank { font-size: 16px; }
  .mt-community .poker-card .pc-suit-big { font-size: 18px; }
  .mt-seat { min-width: 64px; padding: 3px 6px; font-size: 14px; }
}

/* ==================== 桌面端启用 2D 牌桌（覆盖 3D） ==================== */
/* 全局隐藏 3D canvas */
#table-canvas { display: none !important; }
/* 桌面端默认显示 2D 牌桌（不再限制 820px） */
body.in-game #mobile-table {
  display: block;
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  font-family: var(--sans);
  color: var(--cream);
}
body.in-game #my-hand { display: none !important; }

/* 桌面端更大的桌面与字体 */
@media (min-width: 821px) {
  .mt-felt { top: 42%; width: 78%; max-width: 1000px; aspect-ratio: 1.7 / 1; box-shadow: inset 0 0 0 8px #3a2517, inset 0 0 0 10px #d8b878, inset 0 0 0 12px #3a2517, 0 0 80px rgba(0,0,0,.6); }
  .mt-seats { top: 42%; width: 92%; max-width: 1180px; aspect-ratio: 1.7 / 1; }
  .mt-center { top: 42%; max-width: 540px; }
  .mt-seat { min-width: 110px; padding: 8px 12px; font-size: 15px; }
  .mt-seat-name { font-size: 15px; max-width: 140px; }
  .mt-seat-stack { font-size: 16px; margin-top: 2px; }
  .mt-seat-badges { gap: 4px; margin-top: 4px; }
  .mt-badge { font-size: 14px; padding: 2px 6px; }
  .mt-pot { padding: 6px 18px; margin-bottom: 12px; gap: 6px; }
  .mt-pot-label { font-size: 15px; }
  .mt-pot-amount { font-size: 30px; }
  .mt-pot-unit { font-size: 16px; }
  .mt-community { min-height: 110px; gap: 8px; }
  .mt-community .poker-card { width: 70px; height: 98px; }
  .mt-community .poker-card .pc-rank { font-size: 26px; }
  .mt-community .poker-card .pc-suit-big { font-size: 32px; }
  .mt-stage { margin-top: 10px; font-size: 16px; }
  .mt-self { bottom: 130px; padding: 12px 20px; }
  body.acting .mt-self { bottom: 220px; }
  .mt-self-cards { gap: 12px; }
  .mt-self-cards .poker-card { width: 96px; height: 134px; }
  .mt-self-cards .poker-card .pc-rank { font-size: 34px; }
  .mt-self-cards .poker-card .pc-suit-big { font-size: 42px; }
  .mt-self-meta { font-size: 16px; gap: 14px; margin-top: 8px; }
  .mt-self-hand-name { font-size: 17px; margin-top: 6px; }
}

/* 通用确认弹窗（替代原生 confirm） */
#confirm-modal { z-index: 9000; }
.confirm-content { max-width: 360px; padding: 22px; text-align: center; }
.confirm-text { font-size: 16px; color: var(--cream); line-height: 1.6; margin-bottom: 20px; white-space: pre-wrap; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }
.confirm-actions button { min-width: 100px; padding: 10px 18px; font-size: 15px; }


/* ==================== 认证 / 账号体系 ==================== */
.auth-error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(226,100,63,.15);
  border: 1px solid rgba(226,100,63,.5);
  color: #ffb59b;
  font-size: 15px;
  line-height: 1.5;
}
.auth-error.hidden { display: none !important; }

.prompt-input {
  width: 100%;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.35);
  color: var(--cream);
  font-size: 16px;
  font-family: var(--sans);
}
.prompt-input:focus { outline: none; border-color: var(--brass-bright); }

.btn-primary.compact, .btn-secondary.compact {
  padding: 8px 14px;
  font-size: 15px;
}

.invite-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--brass-bright);
}

.backup-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin: 16px 0 8px;
}
.backup-actions .file-btn { cursor: pointer; display: inline-flex; align-items: center; }
.backup-tip {
  font-size: 14px;
  color: #f0b429;
  background: rgba(240,180,41,.1);
  border: 1px solid rgba(240,180,41,.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
  line-height: 1.6;
}
#admin-import-status { font-size: 14px; padding: 4px 10px; border-radius: 6px; }
#admin-import-status.ok { color: #5fd96a; background: rgba(95,217,106,.12); }
#admin-import-status.err { color: #ff7d7d; background: rgba(255,125,125,.12); }

.admin-data-section .data-table td .table-action-btn { margin: 2px 4px 2px 0; }
