/* ============================================
   三公游戏 H5 演示版 — 金碧辉煌主题
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --gold: #d4af37;
  --gold-light: #f5e7a3;
  --gold-dark: #8a6d1f;
  --burgundy: #7a1e2d;
  --felt: #0a5c36;
  --felt-dark: #07472a;
  --wood: #5a3820;
  --wood-light: #7a4f2e;
  --ink: #2b1d0e;
  --cream: #fff8e1;
  --danger: #c0392b;
  /* 字体缩放体系(横屏应用: vmin=高度 360~430px, 随设备平滑缩放) */
  --fs-xs: clamp(11px, 3.1vmin, 13px);   /* 辅助 */
  --fs-sm: clamp(12px, 3.3vmin, 14px);   /* 次要 */
  --fs-md: clamp(13px, 3.6vmin, 15px);   /* 正文 */
  --fs-lg: clamp(15px, 4.6vmin, 18px);   /* 弹窗标题 */
  --fs-xl: clamp(17px, 5.1vmin, 20px);   /* 大标题 */
  --fs-hash: clamp(14px, 4vmin, 20px);   /* 哈希大字 */
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: radial-gradient(circle at 50% 30%, #3a2a18 0%, #1a1108 70%, #0d0804 100%);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.scene { display: none; }
.scene.active { display: block; }
.hidden { display: none !important; }

.mono { font-family: "Consolas", "Courier New", monospace; }

/* ============ 通用按钮 ============ */
.gold-btn {
  background: linear-gradient(180deg, var(--gold-light), var(--gold) 50%, var(--gold-dark));
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  border: 2px solid var(--gold-dark);
  border-radius: 8px;
  padding: 10px 28px;
  cursor: pointer;
  letter-spacing: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.4);
  transition: transform .1s, box-shadow .2s;
}
.gold-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(212,175,55,.35); }
.gold-btn:active { transform: translateY(0); }
.gold-btn.big { 
  /* width: 100%;  */
  padding: 5px; 
  font-size: 16px; }
.gold-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.mini-btn {
  background: linear-gradient(180deg, #4a3a18, #2e220e);
  color: var(--gold-light);
  border: 1px solid var(--gold-dark);
  border-radius: 5px;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 13px;
}
.mini-btn:hover { background: linear-gradient(180deg, #5c4a1e, #3a2c12); }

.cmd-btn {
  background: linear-gradient(180deg, #4a3a18, #2e220e);
  color: var(--gold-light);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  padding: 6px 16px;
  font-size: 14px;
  cursor: pointer;
}
.cmd-btn.danger { color: #f0c0b0; border-color: var(--danger); }
.cmd-btn.danger:hover { background: linear-gradient(180deg, #5c2418, #3a130c); }

.msg { min-height: 20px; margin-top: 8px; font-size: 14px; color: var(--gold-light); text-align: center; }
.msg.error { color: #ff9a8a; }

/* ============ 登录场景 ============ */
#scene-login {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(212,175,55,.12), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(122,30,45,.25), transparent 40%),
    radial-gradient(circle at 50% 30%, #3a2a18 0%, #1a1108 70%, #0d0804 100%);
}
#scene-login.active { display: flex; }

.login-frame {
  width: 420px;
  padding: 34px 38px 26px;
  background: linear-gradient(160deg, rgba(90,56,32,.92), rgba(43,29,14,.95));
  border: 3px solid var(--gold);
  border-radius: 16px;
  box-shadow: 0 0 40px rgba(212,175,55,.28), 0 20px 50px rgba(0,0,0,.7);
  position: relative;
}
.login-frame::before {
  content: "";
  position: absolute; inset: 6px;
  border: 1px solid rgba(245,231,163,.35);
  border-radius: 11px;
  pointer-events: none;
}

.game-logo {
  text-align: center;
  font-size: 46px;
  background: linear-gradient(180deg, #fff6cf, var(--gold-light) 40%, var(--gold) 60%, var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  letter-spacing: 8px;
  margin-bottom: 4px;
}
.logo-sub { text-align: center; color: var(--gold-light); font-size: 13px; letter-spacing: 2px; margin-bottom: 24px; }

.login-form .form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-size: 13px;
  color: var(--gold-light);
  margin-bottom: 4px;
  letter-spacing: 1px;
}
.form-row input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  color: var(--cream);
  font-size: 15px;
  outline: none;
}
.form-row input:focus { border-color: var(--gold); box-shadow: 0 0 8px rgba(212,175,55,.3); }

#btn-login { width: 100%; margin-top: 10px; }

.login-footer {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: rgba(245,231,163,.55);
}

/* ============ 登录横屏适配 (左右两栏) ============ */
@media (orientation: landscape) {
  #scene-login {
    min-height: 100vh;
    padding: 12px;
  }
  .login-frame {
    width: min(92vw, 900px);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(24px, 5vw, 60px);
    padding: clamp(18px, 4vh, 36px) clamp(24px, 5vw, 48px);
  }
  .login-frame::before { inset: 8px; border-radius: 14px; }
  .login-left {
    flex: 0 1 auto;
    min-width: 0;
    text-align: center;
  }
  .login-left .game-logo {
    font-size: clamp(28px, 6vh, 46px);
    white-space: nowrap;
    letter-spacing: clamp(4px, 1vw, 8px);
    margin-bottom: 6px;
  }
  .logo-sub { margin-bottom: 0; font-size: clamp(11px, 2vh, 14px); }
  .login-form {
    flex: 1 1 auto;
    min-width: clamp(240px, 30vw, 420px);
    max-width: 420px;
    margin-left: auto;
  }
  .login-form .form-row { margin-bottom: clamp(8px, 1.6vh, 14px); }
}

/* ============ 房间场景 ============ */
#scene-room { min-height: 100vh; padding: 12px; }

/* 哈希公证(桌子内部上方, 倒计时上面) */
.header-left {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 6;
  background: rgba(20,12,4,.72);
  border: 1px solid rgba(212,175,55,.45);
  border-radius: 10px;
  padding: 6px 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,.5);
  max-width: 76%;
}
.header-left .hash-line {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  max-width: 100%;
  white-space: normal;
  word-break: break-all;
  line-height: 1.4;
}
.header-left .hash-line-main { max-width: 100%; }
.header-left .mini-btn { margin-top: 2px; }

/* 发牌倒计时(桌子内部上方中间, 位于哈希区下方, 底色透明) */
.header-center {
  /* position: absolute; */
  left: 50%;
  top: 96px;
  /* transform: translateX(-50%); */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 6;
  pointer-events: none;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.header-center .cd-big {
  font-size: 40px;
  line-height: 1.2;
}
.header-center .cd-sub {
  margin-top: 2px;
  font-size: 13px;
}

/* 头像菜单: 浮动固定在页面右上角 */
.header-right {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 头像菜单(点击弹出下拉框) */
.user-menu {
  position: relative;
  cursor: pointer;
}
.user-menu .avatar {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(160deg, rgba(90,56,32,.96), rgba(43,29,14,.97));
  border: 2px solid var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(212,175,55,.25), 0 4px 14px rgba(0,0,0,.6);
  cursor: pointer;
  transition: box-shadow .2s, transform .1s;
}
.user-menu .avatar:hover {
  box-shadow: 0 0 0 3px rgba(212,175,55,.4), 0 0 18px rgba(212,175,55,.6);
}
.user-menu .avatar:active { transform: scale(.95); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: linear-gradient(160deg, rgba(60,38,16,.98), rgba(28,18,8,.98));
  border: 1px solid var(--gold-dark);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
  padding: 8px;
  display: none;
  z-index: 50;
}
.user-menu.open .user-dropdown { display: block; }

.user-info {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(212,175,55,.2);
  margin-bottom: 4px;
}
.user-info .p-name { font-size: 15px; font-weight: 700; color: var(--gold-light); }
.user-info .p-sub { font-size: 12px; color: rgba(255,248,225,.6); }

.dropdown-item {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  color: var(--cream);
  white-space: nowrap;
}
.dropdown-item:hover { background: rgba(212,175,55,.18); }
.dropdown-item.danger { color: #ff9a8a; }
.dropdown-item.danger:hover { background: rgba(192,57,43,.25); }

/* ============ 管理中心(三层用户体系) ============ */
#agent-modal .history-modal-box {
  max-width: 520px;
  min-height: 360px;
}
.agent-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #d4af37;
  text-align: center;
  margin-bottom: 10px;
}
.agent-modal-desc {
  text-align: center;
  color: #ccc;
  margin: 12px 0;
  line-height: 1.6;
}
.agent-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.agent-tab {
  flex: 1;
  padding: 8px 4px;
  background: rgba(212,175,55,.1);
  border: 1px solid rgba(212,175,55,.35);
  color: #e8d28a;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all .2s;
}
.agent-tab:hover { background: rgba(212,175,55,.2); }
.agent-tab.active {
  background: linear-gradient(135deg, #d4af37, #e6c658);
  color: #1a1205;
  font-weight: 700;
  border-color: #d4af37;
}
.agent-pane {
  min-height: 160px;
  max-height: 380px;
  overflow-y: auto;
  padding: 10px;
  background: rgba(0,0,0,.25);
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,.2);
}
.load-tip {
  text-align: center;
  color: #aaa;
  padding: 30px 0;
}
.agent-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-card {
  flex: 1;
  text-align: center;
  padding: 14px 6px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 8px;
}
.stat-num {
  font-size: 20px;
  font-weight: 700;
  color: #e8d28a;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 13px;
  color: #aaa;
}
.rate-info { text-align: center; font-size: 12px; color: #ccc; padding: 8px; background: rgba(0,0,0,.2); border-radius: 6px; line-height: 1.6; }

/* ---- 收益中心(三级分销即时奖励) ---- */
.income-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.income-sum-item {
  flex: 1;
  text-align: center;
  padding: 5px 6px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 8px;
}
.income-sum-item .num {
  font-size: 18px;
  font-weight: 700;
  color: #e8d28a;
}
.income-sum-item .lbl {
  font-size: 13px;
  color: #aaa;
  margin-top: 4px;
}
.income-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: #ddd;
}
.income-tbl th, .income-tbl td {
  border: 1px solid rgba(255,255,255,.12);
  padding: 6px 8px;
  text-align: left;
}
.income-tbl th {
  background: rgba(212,175,55,.15);
  color: #e8d28a;
  font-weight: 600;
}
/* ---- 收益中心排版增强 ---- */
.team-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.team-card {
  text-align: center;
  padding: 10px 4px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 8px;
}
.team-card .tc-num {
  font-size: 18px;
  font-weight: 700;
  color: #e8d28a;
  margin-bottom: 4px;
}
.team-card .tc-lbl {
  font-size: 12px;
  color: #aaa;
}
@media (max-width: 420px) {
  .team-cards { grid-template-columns: repeat(2, 1fr); }
}
.promo-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #ccc;
  margin-top: 8px;
}
.pbr-lbl { flex: 0 0 auto; width: 56px; }
.pbr-val { flex: 0 0 auto; text-align: right; min-width: 48px; }
.promo-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.1);
  border-radius: 4px;
  overflow: hidden;
}
.promo-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4af37, #f0d98c);
  border-radius: 4px;
  transition: width .3s ease;
}
.promo-card.promo-ok .promo-bar-fill {
  background: linear-gradient(90deg, #52c41a, #95de64);
}
.income-tbl-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
}
.income-tbl { border-collapse: separate; border-spacing: 0; }
.income-tbl th {
  background: linear-gradient(180deg, rgba(212,175,55,.3), rgba(212,175,55,.12));
}
.income-tbl th.num, .income-tbl td.num { text-align: right; }
.income-tbl td.amt { color: #d4af37; font-weight: 700; white-space: nowrap; }
.income-tbl td.tbl-time { color: #bbb; white-space: nowrap; }
.income-tbl tbody tr:nth-child(even) { background: rgba(255,255,255,.03); }
.income-tbl tbody tr:hover { background: rgba(212,175,55,.06); }
.income-tbl .tbl-empty { color: #999; text-align: center; padding: 16px 0; }
#income-modal .history-modal-box { max-height: min(86vh, 600px); overflow-y: auto; }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }
.pager .cmd-btn { padding: 6px 12px; }
.pager .cmd-btn:disabled { opacity: .4; cursor: not-allowed; }
.income-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #e8d28a;
  margin: 12px 0 8px;
}
.team-info {
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 8px;
  padding: 10px;
}
.team-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px;
  border-bottom: 1px dashed rgba(255,255,255,.1);
  color: #ccc;
}
.team-row:last-child { border-bottom: none; }
.team-row b { color: #e8d28a; }
.promo-card {
  background: rgba(0,0,0,.25);
  border: 1px solid rgba(212,175,55,.25);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.promo-card.promo-ok { border-color: #52c41a; }
.promo-title { font-size: 14px; font-weight: 700; color: #e8d28a; }
.promo-desc { font-size: 13px; color: #aaa; margin: 4px 0; }
.promo-progress { font-size: 13px; color: #ddd; }
.promo-need { font-size: 13px; color: #ccc; margin-top: 4px; }
.promo-status { font-size: 13px; color: #52c41a; margin-top: 6px; font-weight: 700; }

.create-user-form .form-row {
  margin-bottom: 10px;
}
.create-user-form label {
  display: block;
  font-size: 13px;
  color: #ccc;
  margin-bottom: 4px;
}
.create-user-form input,
.create-user-form select {
  width: 100%;
  padding: 8px 10px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(212,175,55,.3);
  border-radius: 6px;
  color: #eee;
  font-size: 16px;
  outline: none;
}
.create-user-form input:focus,
.create-user-form select:focus {
  border-color: #d4af37;
}
.create-user-form select option {
  background: #1c1407;
  color: #eee;
}
.team-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.team-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(212,175,55,.06);
  border: 1px solid rgba(212,175,55,.15);
  border-radius: 6px;
}
.team-name {
  font-size: 14px;
  color: #eee;
}
.team-name em {
  font-style: normal;
  font-size: 12px;
  color: #d4af37;
  background: rgba(212,175,55,.15);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 4px;
}
.apply-tag {
  color: #ffb347;
  font-size: 13px;
  margin-left: 4px;
}
.team-meta {
  font-size: 13px;
  color: #aaa;
}
.agent-modal-title + p.msg {
  text-align: center;
}

/* 开新用户: 最低金额提示 / 确认弹层 / 开户资料 */
.cu-hint { color: #e8b04a; font-size: 12px; }
.create-user-confirm {
  margin-top: 10px;
  padding: 12px;
  background: rgba(212,175,55,.08);
  border: 1px solid rgba(212,175,55,.3);
  border-radius: 8px;
}
.cu-confirm-text { text-align: center; font-size: 14px; color: var(--cream); line-height: 1.6; }
.cu-confirm-text b { color: var(--gold-light); font-size: 16px; }
.create-user-result { margin-top: 4px; }
.cu-result-title { text-align: center; color: var(--gold-light); font-weight: 700; margin-bottom: 8px; }
.cu-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: rgba(0,0,0,.3);
  border: 1px solid rgba(212,175,55,.2);
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
  cursor: pointer;
}
.cu-info-row span { color: rgba(245,231,163,.7); flex: 0 0 auto; }
.cu-info-row b { color: var(--cream); word-break: break-all; margin-left: 10px; text-align: right; }

/* 开户成功资料卡片(可手动选择复制: 长按/拖动选中后复制) */
.cu-result-info {
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(212, 175, 55, .25);
  border-radius: 8px;
  padding: 12px;
  font-size: var(--fs-md);
  line-height: 1.8;
  color: var(--cream);
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
  -webkit-user-select: text;          /* iOS Safari 长按选择 */
  -webkit-touch-callout: default;     /* 允许长按弹出 选择/复制 菜单 */
  cursor: text;
  margin-bottom: 12px;
}

/* 我的账号弹窗: 表单区可滚动(标题/TAB固定) */
.account-modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* 表单行: 标题(标签)与输入框两列显示 */
.create-user-form .form-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
}
.create-user-form .form-row > label {
  white-space: nowrap;
}
.create-user-form .form-row > input,
.create-user-form .form-row > select {
  width: 100%;
  min-width: 0;
}
/* 密码条件单独一行显示 */
.form-hint {
  font-size: 12px;
  color: rgb(255, 2, 2);
  margin-bottom: 8px;
  text-align: center;
}
#agent-modal .gold-btn.big {
  width: 100%;
  margin-top: 10px;
}
#agent-modal #btn-apply-agent {
  margin-top: 16px;
}

.p-name { font-size: 17px; font-weight: 700; color: var(--gold-light); }
.p-sub { font-size: 12px; color: rgba(255,248,225,.7); }

.room-title { text-align: center; }
.t-label { font-size: 12px; color: rgba(245,231,163,.6); margin-right: 6px; }
.t-val { font-size: 26px; font-weight: 800; color: var(--gold); }
.t-round { margin-left: 14px; font-size: 13px; color: var(--gold-light); }
.t-round b { color: var(--gold); font-size: 15px; }

.room-cmd { display: flex; gap: 10px; }

/* ============ 主区域单栏布局(桌子全宽居中) ============ */
.room-body {
  display: flex;
  height: calc(100vh - 24px);
}
.room-center {
  flex: 1;
  min-width: 0;
}
.table-wrap {
  width: 100%;
  height: 100%;
}
.table-felt {
  width: 100%;
  height: 100%;
}

.panel {
  background: linear-gradient(160deg, rgba(60,38,16,.92), rgba(28,18,8,.94));
  border: 1px solid var(--gold-dark);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.panel h3 {
  font-size: 14px;
  color: var(--gold);
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(212,175,55,.3);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

/* 公证区 */
.hash-line { display: flex; gap: 6px; margin-bottom: 5px; font-size: 12px; align-items: baseline; }
.hk { color: rgba(245,231,163,.6); flex: 0 0 auto; }
.hv { color: var(--cream); word-break: break-all; }

/* 倒计时 */
.cd-big {
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  color: var(--gold-light);
  font-family: "Consolas", monospace;
  text-shadow: 0 0 14px rgba(212,175,55,.45);
}
.cd-sub { text-align: center; font-size: 12px; color: rgba(245,231,163,.65); margin-top: 2px; }

/* 玩家列表 */
.player-list { max-height: 180px; overflow-y: auto; font-size: 13px; }
.player-list .pl-item {
  display: flex; justify-content: space-between;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(212,175,55,.12);
}
.pl-item .pl-name { color: var(--cream); }
.pl-item .pl-bet { color: var(--gold-light); font-size: 12px; }
.pl-item.me { background: rgba(212,175,55,.1); border-radius: 4px; }

/* 下注面板 */
.bet-seat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.bet-seat-row label { font-size: 13px; color: var(--gold-light); }
.bet-select {
  flex: 1;
  padding: 7px;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  color: var(--cream);
  font-size: 14px;
}

.bet-chips { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px; }
.chip {
  background: radial-gradient(circle at 40% 35%, #fff2c0, var(--gold) 55%, var(--gold-dark));
  color: var(--ink);
  border-radius: 50%;
  height: 38px;
  border: 2px dashed rgba(90,56,32,.7);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,.5);
}
.chip:hover { transform: translateY(-2px); }
.chip.selected { box-shadow: 0 0 0 3px var(--cream), 0 4px 8px rgba(0,0,0,.5); }

.bet-custom input {
  width: 100%;
  padding: 8px;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  color: var(--cream);
  font-size: 14px;
  margin-bottom: 10px;
}

.my-bets { margin-top: 10px; font-size: 13px; color: var(--gold-light); line-height: 1.6; }

/* 结算列表 */
.settle-list { max-height: 200px; overflow-y: auto; font-size: 12px; }
.settle-list .s-item {
  display: flex; justify-content: space-between; gap: 6px;
  padding: 4px 4px;
  border-bottom: 1px solid rgba(212,175,55,.12);
}
.s-item .s-name { color: var(--cream); }
.s-item .s-point { color: var(--gold-light); }
.s-item .s-amt.win { color: #9f6; }
.s-item .s-amt.lose { color: #ff8a7a; }

/* ============ 下注模态框 ============ */
.bet-modal {
  position: fixed;
  inset: 0;
  background: rgba(10,6,2,.72);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bet-modal-box {
  width: 320px;
  padding: 22px 24px 18px;
  background: linear-gradient(160deg, rgba(90,56,32,.97), rgba(43,29,14,.98));
  border: 2px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 0 36px rgba(212,175,55,.3), 0 16px 40px rgba(0,0,0,.7);
  text-align: center;
}
.bet-modal-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.bet-modal-sub {
  font-size: 13px;
  color: rgba(245,231,163,.7);
  margin-bottom: 16px;
}
.bet-modal-chips {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.bet-modal-chips .chip { height: 42px; font-size: 15px; }
.bet-modal-custom {
  text-align: left;
  margin-bottom: 16px;
}
.bet-modal-custom label {
  display: block;
  font-size: 13px;
  color: var(--gold-light);
  margin-bottom: 4px;
}
.bet-modal-custom input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(0,0,0,.4);
  border: 1px solid var(--gold-dark);
  border-radius: 6px;
  color: var(--cream);
  font-size: 16px;
  outline: none;
}
.bet-modal-custom input:focus { border-color: var(--gold); box-shadow: 0 0 8px rgba(212,175,55,.3); }
.bet-modal-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.bet-modal-actions .gold-btn { flex: 1; }
.bet-modal-actions .cmd-btn { padding: 12px 18px; }

/* 本座位下注记录 */
.bet-modal-records {
  text-align: left;
  margin-bottom: 14px;
  background: rgba(0, 0, 0, .25);
  border: 1px solid rgba(212, 175, 55, .2);
  border-radius: 8px;
  padding: 8px 10px;
}
.bet-modal-records-title {
  font-size: 13px;
  color: var(--gold-light);
  margin-bottom: 4px;
  text-align: center;
}
.bet-modal-records-list {
  max-height: 120px;
  overflow-y: auto;
  font-size: 14px;
}
.bet-modal-records-list .br-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 2px;
  border-bottom: 1px dashed rgba(212, 175, 55, .15);
}
.bet-modal-records-list .br-item:last-child { border-bottom: none; }
.bet-modal-records-list .br-name { color: var(--cream); }
.bet-modal-records-list .br-amt { color: var(--gold-light); font-weight: 600; }
.bet-modal-records-list .br-empty { color: rgba(245, 231, 163, .5); text-align: center; padding: 6px 0; }

/* ============ 右下角浮动按钮组(玩家列表在上方, 结算记录在下方) ============ */
.player-list-fab,
.settle-history-fab {
  position: fixed;
  right: 20px;
  z-index: 90;
  background: linear-gradient(180deg, var(--gold-light), var(--gold) 50%, var(--gold-dark));
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  border: 2px solid var(--gold-dark);
  border-radius: 24px;
  padding: 10px 20px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.55), 0 0 12px rgba(212,175,55,.3);
  letter-spacing: 1px;
  transition: transform .1s, box-shadow .2s;
}
.player-list-fab { bottom: 76px; }
.settle-history-fab { bottom: 20px; }
.player-list-fab:hover,
.settle-history-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,175,55,.4); }
.player-list-fab:active,
.settle-history-fab:active { transform: translateY(0); }

/* ============ 结算历史弹框 ============ */
.history-modal {
  position: fixed;
  inset: 0;
  background: rgba(10,6,2,.75);
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
}
.history-modal-box {
  width: 460px;
  max-width: 92vw;
  max-height: 82vh;
  padding: 20px 22px 16px;
  background: linear-gradient(160deg, rgba(60,38,16,.98), rgba(28,18,8,.98));
  border: 2px solid var(--gold);
  border-radius: 14px;
  box-shadow: 0 0 36px rgba(212,175,55,.3), 0 16px 40px rgba(0,0,0,.7);
  display: flex;
  flex-direction: column;
}
.history-modal-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--gold-light);
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 4px;
}
.history-modal-meta {
  font-size: 13px;
  color: rgba(245,231,163,.7);
  text-align: center;
  margin-bottom: 10px;
  word-break: break-all;
  line-height: 1.5;
}
.history-modal-list {
  flex: 1;
  overflow-y: auto;
  font-size: 14px;
  margin-bottom: 12px;
  min-height: 120px;
}
.history-modal-list .h-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
  border-bottom: 1px solid rgba(212,175,55,.12);
}
.h-item .h-name { color: var(--cream); }
.h-item .h-point { color: var(--gold-light); font-size: 13px; }
.h-item .h-amt.win { color: #9f6; font-weight: 700; }
.h-item .h-amt.lose { color: #ff8a7a; font-weight: 700; }
.h-item .h-comm {
  font-size: 12px;
  color: #e8b04a;
  text-align: right;
  flex-basis: 100%;
  margin-top: 2px;
}
.history-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.history-modal-actions .cmd-btn { padding: 8px 14px; }
.history-modal-actions .cmd-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ============ 滚动条(与整体金色/深棕风格一致) ============ */
.history-modal-list,
.bet-modal-box,
.bet-modal-records-list,
.account-modal-body,
.player-list,
.settle-list,
.agent-pane {
  scrollbar-width: thin;                              /* Firefox */
  scrollbar-color: var(--gold-dark) rgba(0, 0, 0, .25);
}
.history-modal-list::-webkit-scrollbar,
.bet-modal-box::-webkit-scrollbar,
.bet-modal-records-list::-webkit-scrollbar,
.account-modal-body::-webkit-scrollbar,
.player-list::-webkit-scrollbar,
.settle-list::-webkit-scrollbar,
.agent-pane::-webkit-scrollbar {
  width: 5px;
}
.history-modal-list::-webkit-scrollbar-track,
.bet-modal-box::-webkit-scrollbar-track,
.bet-modal-records-list::-webkit-scrollbar-track,
.account-modal-body::-webkit-scrollbar-track,
.player-list::-webkit-scrollbar-track,
.settle-list::-webkit-scrollbar-track,
.agent-pane::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .25);
  border-radius: 3px;
}
.history-modal-list::-webkit-scrollbar-thumb,
.bet-modal-box::-webkit-scrollbar-thumb,
.bet-modal-records-list::-webkit-scrollbar-thumb,
.account-modal-body::-webkit-scrollbar-thumb,
.player-list::-webkit-scrollbar-thumb,
.settle-list::-webkit-scrollbar-thumb,
.agent-pane::-webkit-scrollbar-thumb {
  background: var(--gold-dark);
  border-radius: 3px;
}
.history-modal-list::-webkit-scrollbar-thumb:hover,
.bet-modal-box::-webkit-scrollbar-thumb:hover,
.bet-modal-records-list::-webkit-scrollbar-thumb:hover,
.account-modal-body::-webkit-scrollbar-thumb:hover,
.player-list::-webkit-scrollbar-thumb:hover,
.settle-list::-webkit-scrollbar-thumb:hover,
.agent-pane::-webkit-scrollbar-thumb:hover {
  background: var(--gold);
}

/* ============ 转账 ============ */
#transfer-modal .history-modal-box {
  max-width: 420px;
}
.transfer-balance {
  text-align: center;
  font-size: 14px;
  color: var(--gold-light);
  margin-bottom: 14px;
  padding: 8px;
  background: rgba(212,175,55,.08);
  border-radius: 8px;
}
.transfer-balance b {
  font-size: 18px;
  color: var(--gold-light);
  font-family: "Consolas", monospace;
}
.transfer-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}
.transfer-actions .gold-btn {
  padding: 10px 20px;
  font-size: 15px;
}
.transfer-actions .cmd-btn {
  padding: 10px 14px;
}
#transfer-confirm-modal .history-modal-box {
  max-width: 360px;
}
.transfer-confirm-info {
  padding: 12px 0 6px;
}
.transfer-confirm-info .tc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(212,175,55,.15);
  font-size: 14px;
}
.transfer-confirm-info .tc-row span {
  color: rgba(245,231,163,.7);
}
.transfer-confirm-info .tc-row b {
  color: var(--cream);
  font-size: 16px;
}
#transfer-confirm-modal .history-modal-actions .gold-btn {
  padding: 10px 18px;
}
#transfer-logs-modal .history-modal-box {
  max-width: 480px;
}
#tf-logs-list .h-item .h-name {
  font-size: 13px;
  word-break: break-all;
}
