* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --felt: #1b6b3a;
  --felt-dark: #14502c;
  --gold: #e8c468;
  --card-bg: #fdfdfd;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #0f1216;
  color: #f0f0f0;
  min-height: 100vh;
}

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 12px 150px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 顶栏 */
.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: linear-gradient(180deg, #1a212b 0%, #11161d 100%);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
.topbar h1 { font-size: 22px; color: var(--gold); }
.topbar h1 .sub { font-size: 13px; color: #9aa; font-weight: normal; }
.topbar-info { display: flex; gap: 12px; align-items: center; font-size: 14px; color: #cdd; flex-wrap: wrap; }

/* 牌桌 */
.table {
  position: relative;
  margin-top: 30px;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,0.018) 0 3px, transparent 3px 6px),
    repeating-linear-gradient(-45deg, rgba(0,0,0,0.03) 0 3px, transparent 3px 6px),
    radial-gradient(ellipse 70% 75% at 50% 38%, #2a8a4f 0%, #1c6e3c 55%, #124e29 100%);
  border: 14px solid #6b4622;
  border-radius: 200px;
  height: clamp(440px, 54vh, 560px);
  box-shadow:
    inset 0 0 0 3px rgba(0,0,0,0.4),
    inset 0 0 80px rgba(0,0,0,0.5),
    inset 0 4px 14px rgba(255,255,255,0.07),
    0 0 0 2px #3c2611,
    0 16px 40px rgba(0,0,0,0.6);
}
/* 实木栏圈：边框上的高光，增加质感 */
.table::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(150deg, rgba(255,225,180,0.22) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.3) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  padding: 14px;
}

.seats { position: absolute; inset: 0; }

.seat {
  position: absolute;
  width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s;
}

.seat.folded { opacity: 0.4; }
.seat.out { opacity: 0.25; filter: grayscale(1); }
.seat.active .seat-info {
  box-shadow: 0 0 0 2px var(--gold), 0 0 18px var(--gold);
  animation: pulse-glow 1.2s ease-in-out infinite;
}
.seat.winner .seat-info {
  box-shadow: 0 0 0 2px #ffe680, 0 0 26px #ffd24d;
  animation: winner-pulse 0.9s ease-in-out infinite;
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 2px var(--gold), 0 0 10px var(--gold); }
  50%      { box-shadow: 0 0 0 2px var(--gold), 0 0 22px var(--gold); }
}
@keyframes winner-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #ffe680, 0 0 14px #ffd24d; transform: scale(1); }
  50%      { box-shadow: 0 0 0 3px #ffe680, 0 0 30px #ffd24d; transform: scale(1.05); }
}

.seat-info {
  background: linear-gradient(165deg, rgba(33,44,37,0.94) 0%, rgba(14,20,16,0.94) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  padding: 7px 13px;
  text-align: center;
  min-width: 120px;
  box-shadow: 0 5px 14px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.07);
  transition: box-shadow 0.2s, transform 0.2s;
}
.seat.active .seat-info { transform: translateY(-1px); }
.seat-name { font-weight: 600; font-size: 14px; letter-spacing: 0.3px; }
.seat-stack { font-size: 13px; color: var(--gold); margin-top: 2px; }
.seat-bet { font-size: 12px; color: #8ec5ff; margin-top: 2px; }
.seat-action { font-size: 12px; color: #ffd; margin-top: 2px; }
.seat-allin { font-size: 12px; color: #ff6b6b; font-weight: 700; margin-top: 2px; }
.btn-chip {
  display: inline-block;
  background: #fff; color: #000;
  border-radius: 50%;
  width: 16px; height: 16px;
  font-size: 11px; line-height: 16px;
  font-weight: 700;
}

/* 牌 */
.seat-cards { display: flex; gap: 4px; }
.card {
  width: 42px; height: 60px;
  background: linear-gradient(160deg, #ffffff 0%, #eceef2 100%);
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 3px 8px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.9);
  color: #111;
  position: relative;
}
.card .rank { font-size: 18px; line-height: 1; }
.card .suit { font-size: 16px; line-height: 1; }
.card.red { color: #d4213d; }
.card.black { color: #1a1a1a; }
.card.dim { opacity: 0.5; }
.card.back {
  background: repeating-linear-gradient(45deg, #2a4d8f, #2a4d8f 6px, #1d3a6e 6px, #1d3a6e 12px);
  border: 2px solid #fff;
}
.card.placeholder {
  background: rgba(255,255,255,0.08);
  border: 1px dashed rgba(255,255,255,0.25);
  box-shadow: none;
}
.card.deal-in {
  animation: deal-in 0.32s ease-out backwards;
}
@keyframes deal-in {
  0%   { opacity: 0; transform: translateY(-26px) rotate(-8deg) scale(0.8); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

/* 中央区域 */
.board-area {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.pot {
  position: relative;
  z-index: 6;
  background: rgba(0,0,0,0.7);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 15px;
  color: var(--gold);
  font-weight: 600;
}
.community { display: flex; gap: 6px; }
.community .card { width: 52px; height: 72px; }
.community .card .rank { font-size: 22px; }
.community .card .suit { font-size: 20px; }
.stage {
  font-size: 14px;
  color: #dfe;
  background: rgba(0,0,0,0.4);
  padding: 4px 14px;
  border-radius: 16px;
  text-align: center;
  max-width: 420px;
}

/* 日志 */
.log-panel {
  background: #161a20;
  border-radius: 10px;
  padding: 8px 14px;
  max-height: 96px;
  display: flex;
  flex-direction: column;
}
.log-header { font-size: 13px; color: var(--gold); margin-bottom: 6px; }
.log { overflow-y: auto; font-size: 13px; color: #cdd; }
.log-line { padding: 1px 0; line-height: 1.5; }

/* 控制区 */
.controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(13, 16, 20, 0.96);
  border-top: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 -6px 24px rgba(0,0,0,0.5);
}
.action-buttons {
  display: none;
  gap: 10px;
}
.action-buttons.show { display: flex; }
.action-buttons.dim { opacity: 0.4; pointer-events: none; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: filter 0.15s, transform 0.1s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; filter: none; }

.btn-fold { background: #b23b3b; }
.btn-call { background: #2f7d4f; }
.btn-raise { background: #c78a2a; }
.btn-allin { background: #8a2be2; }
.btn-deal { background: #2f7d4f; font-size: 17px; padding: 14px 40px; }
.btn-confirm { background: #2f7d4f; padding: 8px 18px; }
.btn-cancel { background: #555; padding: 8px 18px; }

.bet-slider {
  display: none;
  align-items: center;
  gap: 12px;
  background: #161a20;
  padding: 10px 18px;
  border-radius: 10px;
}
.bet-slider.show { display: flex; }
.bet-slider input[type=range] { width: 260px; accent-color: var(--gold); }
.raise-amount {
  min-width: 60px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.deal-controls { display: none; }
.deal-controls.show { display: block; }

/* 设置按钮 */
.btn-settings {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #dfe;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-settings:hover { background: rgba(255,255,255,0.2); }

/* 设置弹窗 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: #1c2128;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 26px 30px;
  width: 360px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.modal h2 { color: var(--gold); font-size: 19px; margin-bottom: 18px; }
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 14px;
  color: #dde;
}
.setting-item input[type=number], .setting-item select {
  width: 110px;
  padding: 7px 9px;
  border-radius: 7px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #11151b;
  color: #fff;
  font-size: 14px;
}
.setting-checkbox input { width: 18px; height: 18px; accent-color: var(--gold); }
.modal-note { font-size: 12px; color: #8a9; margin: 6px 0 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* 胜率提示面板 */
.strength-panel {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: #161a20;
  border-radius: 10px;
  padding: 10px 16px;
  width: 320px;
}
.strength-panel.show { display: flex; }
.strength-row { display: flex; align-items: center; gap: 10px; }
.strength-label { font-size: 13px; color: #9ab; width: 56px; flex-shrink: 0; }
.strength-hand { font-size: 15px; font-weight: 700; color: var(--gold); }
.strength-bar-wrap {
  flex: 1;
  height: 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 6px;
  overflow: hidden;
}
.strength-bar {
  height: 100%;
  width: 0;
  background: #2f9e5f;
  border-radius: 6px;
  transition: width 0.4s ease, background 0.4s;
}
.strength-pct { font-size: 14px; font-weight: 700; color: #dfe; width: 40px; text-align: right; }

/* —— 联机：大厅登录页 —— */
.lobby-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lobby-card {
  background: #1c2128;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 30px 28px;
  width: 360px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.lobby-card h1 { color: var(--gold); font-size: 26px; text-align: center; }
.lobby-sub { color: #9ab; text-align: center; font-size: 13px; margin: 6px 0 22px; }
.lobby-field { display: block; margin-bottom: 16px; }
.lobby-field span { display: block; font-size: 13px; color: #cdd; margin-bottom: 6px; }
.lobby-field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #11151b;
  color: #fff;
  font-size: 16px;
}
.lobby-card .btn-deal { width: 100%; margin-top: 4px; }
.conn-status { text-align: center; font-size: 13px; color: #ffd; margin-top: 12px; min-height: 18px; }

/* —— 联机：房间页 —— */
.room-screen {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 12px 160px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100vh;
}
.room-code { color: var(--gold); font-weight: 600; }

/* 大厅座位区 */
.lobby-area { padding: 10px 4px; }
.lobby-area-title { color: var(--gold); font-size: 18px; margin-bottom: 6px; text-align: center; }
.lobby-config { text-align: center; color: #9ab; font-size: 13px; margin-bottom: 18px; }
.blind-info { color: #cdd; font-size: 13px; }
.lobby-seats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.lobby-seat {
  background: #161a20;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 16px;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.lobby-seat.empty { border-style: dashed; opacity: 0.5; align-items: center; }
.ls-name { font-size: 16px; font-weight: 600; color: #fff; }
.ls-empty { color: #889; }
.ls-tags { margin-top: 6px; display: flex; gap: 6px; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 10px; font-weight: 600; }
.tag.host { background: #c78a2a; color: #fff; }
.tag.ai { background: #5a6; color: #fff; }
.tag.off { background: #844; color: #fff; }
.lobby-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lobby-hint { text-align: center; color: #9ab; font-size: 13px; margin-top: 14px; }

/* 倒计时 / 等待提示 */
.turn-timer { margin-left: auto; font-size: 15px; font-weight: 700; }
.wait-msg { color: #9ab; font-size: 14px; min-height: 20px; text-align: center; }

/* 暂离 / 补充筹码 */
.self-controls { display: flex; gap: 8px; }
.btn-chip-action {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #dfe; border-radius: 8px; padding: 6px 14px;
  font-size: 13px; cursor: pointer; transition: background 0.15s;
}
.btn-chip-action:hover { background: rgba(255,255,255,0.2); }
.btn-chip-action.active { background: #c78a2a; color: #fff; border-color: #c78a2a; }
.btn-chip-action.rebuy { background: #2f7d4f; color: #fff; border-color: #2f7d4f; }
.seat.sitting { opacity: 0.55; }

/* 成牌 5 张高亮 */
.card.win-card {
  box-shadow: 0 0 0 2px #ffd24d, 0 0 14px #ffd24d;
  animation: win-card-pulse 0.9s ease-in-out infinite;
}
@keyframes win-card-pulse {
  0%, 100% { box-shadow: 0 0 0 2px #ffd24d, 0 0 10px #ffd24d; }
  50%      { box-shadow: 0 0 0 3px #ffe680, 0 0 22px #ffd24d; }
}

/* 飞动的筹码 */
.fx-layer { position: absolute; inset: 0; pointer-events: none; }
.flying-chip {
  position: fixed;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe17a, #d99b1c 70%);
  border: 2px solid #fff3c4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  z-index: 200;
  transition: transform 0.55s cubic-bezier(.4,.1,.3,1), opacity 0.55s ease;
}

/* 轮到你：屏幕脉冲 */
body.my-turn { animation: screen-pulse 1.3s ease-in-out infinite; }
@keyframes screen-pulse {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(232,196,104,0); }
  50%      { box-shadow: inset 0 0 70px 0 rgba(232,196,104,0.35); }
}

/* 聊天 */
.btn-settings.badge { position: relative; }
.btn-settings.badge::after {
  content: ''; position: absolute; top: -3px; right: -3px;
  width: 9px; height: 9px; border-radius: 50%; background: #ff5252;
}
.chat-panel {
  display: none;
  position: fixed;
  right: 14px; bottom: 96px;
  width: 300px; max-width: 90vw;
  height: 360px; max-height: 56vh;
  background: #161a20;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  z-index: 60;
  flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.chat-panel.show { display: flex; }
.chat-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; color: var(--gold); font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.chat-close { background: none; border: none; color: #9ab; font-size: 20px; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 10px 14px; font-size: 14px; }
.chat-line { padding: 3px 0; color: #dfe; line-height: 1.4; word-break: break-word; }
.chat-name { color: var(--gold); font-weight: 600; }
.chat-emojis { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 10px; border-top: 1px solid rgba(255,255,255,0.06); }
.chat-emojis button {
  background: rgba(255,255,255,0.08); border: none; border-radius: 6px;
  font-size: 18px; width: 34px; height: 32px; cursor: pointer;
}
.chat-emojis button:hover { background: rgba(255,255,255,0.18); }
.chat-input-row { display: flex; gap: 6px; padding: 10px; }
.chat-input-row input {
  flex: 1; padding: 9px 11px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.2); background: #11151b; color: #fff; font-size: 14px;
}
.chat-input-row .btn { padding: 8px 14px; }

/* 头顶聊天气泡 */
.chat-bubble {
  position: fixed;
  transform: translate(-50%, -100%) translateY(6px) scale(0.92);
  max-width: 180px;
  padding: 6px 11px;
  background: #fff;
  color: #1a1a1a;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
  word-break: break-word;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  z-index: 60;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.chat-bubble::after {
  content: '';
  position: absolute;
  left: 50%; bottom: -6px;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #fff;
  border-bottom: 0;
}
.chat-bubble.emoji { font-size: 26px; padding: 4px 12px; }
.chat-bubble.show {
  opacity: 1;
  transform: translate(-50%, -100%) translateY(0) scale(1);
}

/* 喝酒记分板 */
.score-body { flex: 1; overflow-y: auto; padding: 10px 14px; }
.score-row {
  padding: 9px 10px; margin-bottom: 8px; border-radius: 9px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06);
}
.score-row.you { background: rgba(212,175,55,0.12); border-color: rgba(212,175,55,0.35); }
.score-name { font-weight: 600; color: #ffe; font-size: 14px; margin-bottom: 3px; }
.score-nums { font-size: 13px; color: #bcd; }
.score-nums b { color: var(--gold); }
.score-nums b.pend { color: #ff9d5c; }
.score-tag { font-size: 11px; padding: 1px 6px; border-radius: 8px; margin-left: 4px; }
.score-tag.most { background: #5b2b2b; color: #ffb3a0; }
.score-tag.least { background: #2b4b34; color: #9be8b4; }

/* 喝酒控件条 */
.drink-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; }
.drink-pending { color: #ff9d5c; font-weight: 700; font-size: 14px; }

/* 座位喝酒信息 */
.seat-pending { font-size: 12px; color: #ff9d5c; margin-top: 2px; }
.seat-handbet { font-size: 12px; color: #ffd24a; font-weight: 700; margin-top: 2px; }
.seat-drink { font-size: 12px; color: #ffcaa0; font-weight: 700; margin-top: 2px; }

/* 杯 / 口 换算显示：杯更醒目，口次要 */
.cup { color: #ffce3a; font-weight: 800; font-size: 1.12em; letter-spacing: 0.5px; }
.cup::before { content: '🍺'; font-size: 0.85em; margin-right: 2px; }
.sip { color: #cdd6e0; font-size: 0.88em; margin-left: 4px; }
.score-seg { display: inline-block; margin-right: 12px; }
/* 待喝(欠酒,橙) / 结余(赢来的抵扣,绿) / 已结清(灰) */
.pend-owe { color: #ff9d5c; }
.pend-owe .cup, .pend-owe .sip { color: inherit; }
.pend-credit { color: #5fd08a; font-weight: 700; }
.pend-credit .cup, .pend-credit .sip { color: inherit; }
.pend-credit .cup::before { content: '🍺'; }
.pend-zero { color: #8aa; }

/* 让记分板按钮更显眼 */
#btnScore { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(212,175,55,0.4) inset; }

/* 结算解散按钮 */
.btn-settings.danger { border-color: #b14a3a; color: #ffbcae; }
.btn-settings.danger:hover { background: rgba(177,74,58,0.25); }

/* 大厅整晚战报 */
.lobby-settle {
  max-width: 460px; margin: 0 auto 18px; padding: 14px 16px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(212,175,55,0.25); border-radius: 12px;
}
.settle-title { margin: 0 0 10px; font-size: 16px; color: var(--gold); text-align: center; }
.lobby-settle .score-row { text-align: left; }

/* 自填喝酒口数 */
.drink-amount-input {
  width: 64px; padding: 7px 8px; border-radius: 8px; text-align: center;
  border: 1px solid rgba(255,255,255,0.25); background: #11151b; color: #fff; font-size: 15px;
}
.btn-chip-action.drink-go { background: #6b3f1f; border-color: #b9783a; color: #ffe3c8; font-weight: 700; }

/* 喝酒全体提示 toast */
.toast {
  position: fixed; top: 70px; left: 50%;
  transform: translateX(-50%) translateY(-12px);
  background: linear-gradient(180deg, #c98a3a, #a86b22);
  color: #fff; font-weight: 700; font-size: 15px;
  padding: 9px 18px; border-radius: 22px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  opacity: 0; z-index: 300; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 喝酒记录 + 房主调整 */
.drink-log-title { margin: 14px 0 6px; font-size: 13px; color: var(--gold); font-weight: 700; }
.drink-log-line { font-size: 13px; color: #bcd; padding: 2px 0; }
.drink-log-line.adjust { color: #ff9d5c; }
.drink-log-line.buyin { color: #5fd08a; }
.host-adjust { margin-top: 12px; padding: 10px; border-radius: 9px; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); }
.adjust-row { display: flex; gap: 6px; align-items: center; }
.adjust-row select, .adjust-row input {
  padding: 7px 8px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.2);
  background: #11151b; color: #fff; font-size: 13px;
}
.adjust-row select { flex: 1; }
.adjust-row input { width: 56px; text-align: center; }
.adjust-row .btn-chip-action { white-space: nowrap; }

/* 买入复活 */
.btn-chip-action.buyin { background: #6b3f1f; border-color: #b9783a; color: #ffe3c8; }
.buyin-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.buyin-list .buyin-pick { width: 100%; text-align: left; }

@media (max-width: 720px) {
  .room-screen { padding: 8px 8px 150px; }
  .topbar { padding: 7px 10px; gap: 6px; border-radius: 11px; }
  .topbar h1 { font-size: 17px; }
  .topbar h1 .sub { display: none; }
  .topbar-info { gap: 6px; font-size: 11px; }
  .btn-settings { padding: 6px 9px; font-size: 12px; }

  /* 竖屏：牌桌拉高成纵向椭圆，座位更紧凑 */
  .table { margin-top: 20px; height: clamp(440px, 62vh, 600px); border-radius: 130px; border-width: 10px; }
  .seat { width: 72px; gap: 3px; }
  .seat-info { min-width: 64px; padding: 3px 6px; border-radius: 9px; }
  .seat-name { font-size: 10px; }
  .seat-stack, .seat-bet, .seat-action, .seat-pending, .seat-handbet, .seat-drink { font-size: 9px; margin-top: 1px; }
  .card { width: 24px; height: 34px; border-radius: 4px; }
  .card .rank { font-size: 11px; }
  .card .suit { font-size: 9px; }
  .seat-cards { gap: 2px; }
  .community { gap: 3px; }
  .community .card { width: 28px; height: 40px; }
  .community .card .rank { font-size: 13px; }
  .community .card .suit { font-size: 11px; }
  .pot { font-size: 12px; padding: 3px 10px; }
  .stage { font-size: 12px; max-width: 86vw; }

  /* 控件区竖屏紧凑 */
  .strength-panel { width: 100%; }
  .controls { padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); gap: 6px; }
  .self-controls, .drink-bar { flex-wrap: wrap; justify-content: center; }
  .btn { padding: 11px 12px; font-size: 14px; }
  .action-buttons { gap: 6px; }
  .btn-chip-action { padding: 7px 10px; font-size: 12px; }
  .drink-amount-input { width: 52px; }
  .bet-slider input[type=range] { width: 150px; }

  /* 侧边面板竖屏左右留小边距，占满宽度更好用 */
  .chat-panel, .score-panel { left: 8px; right: 8px; width: auto; max-width: none; }
}

/* ===== 游戏中心首页 ===== */
.home-screen { max-width: 720px; margin: 0 auto; padding: 48px 16px 60px; text-align: center; }
.home-title { font-size: 30px; color: var(--gold); margin-bottom: 6px; }
.home-sub { color: #9ab; margin-bottom: 32px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.home-card {
  display: block; text-decoration: none; color: #f0f0f0;
  background: linear-gradient(165deg, #1c2530, #131922);
  border: 1px solid rgba(255,255,255,0.08); border-radius: 16px;
  padding: 26px 18px; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.home-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,0.5); border-color: var(--gold); }
.home-card.poker:hover { border-color: #6fae7f; }
.home-card.counter:hover { border-color: #d8a23a; }
.home-card-emoji { font-size: 46px; margin-bottom: 10px; }
.home-card-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.home-card-desc { font-size: 13px; color: #9ab; line-height: 1.5; }
.home-foot { margin-top: 30px; color: #678; font-size: 13px; }

/* ===== 喝酒计数器 ===== */
.ctr-entry { max-width: 460px; margin: 0 auto; padding: 30px 16px 60px; }
.ctr-card {
  background: #161b22; border: 1px solid rgba(255,255,255,0.08); border-radius: 14px;
  padding: 16px 18px; margin-bottom: 16px;
}
.ctr-card h3 { color: var(--gold); font-size: 16px; margin-bottom: 12px; }
.ctr-card .btn { width: 100%; margin-top: 4px; }
.ctr-resume-list { display: flex; flex-direction: column; gap: 8px; }
.ctr-resume { width: 100%; text-align: left; }

.ctr-main { max-width: 760px; margin: 0 auto; padding: 12px 12px 60px; }
.ctr-identify {
  background: rgba(216,162,58,0.14); border: 1px solid rgba(216,162,58,0.4);
  border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: 14px; color: #ffe3b0;
}
.ctr-h2 { font-size: 16px; color: var(--gold); margin: 18px 0 10px; }
.ctr-tip { font-size: 12px; color: #788; font-weight: normal; }
.ctr-board { display: flex; flex-direction: column; gap: 10px; }
.ctr-row {
  background: linear-gradient(165deg, rgba(33,44,37,0.7), rgba(14,20,16,0.7));
  border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 12px 14px;
}
.ctr-row.me { border-color: rgba(212,175,55,0.5); background: rgba(212,175,55,0.08); }
.ctr-row-top { display: flex; justify-content: space-between; align-items: center; }
.ctr-name { font-weight: 600; font-size: 16px; }
.ctr-count { font-weight: 800; font-size: 17px; }
.ctr-count.owe { color: #ff9d5c; }
.ctr-count.credit { color: #5fd08a; }
.ctr-count.zero { color: #8aa; font-weight: 600; }
.ctr-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ctr-btn {
  border: 1px solid rgba(255,255,255,0.18); background: #222a33; color: #fff;
  border-radius: 9px; padding: 9px 14px; font-size: 15px; font-weight: 700; cursor: pointer;
}
.ctr-btn:hover { background: #2b343f; }
.ctr-btn.plus { background: #6b3f1f; border-color: #b9783a; color: #ffe3c8; }
.ctr-btn.minus { background: #2b4b34; border-color: #4f8a63; color: #c9f0d6; }
.ctr-btn.claim { background: #5a4a1a; border-color: var(--gold); color: #ffe9a8; margin-top: 10px; }
.ctr-btn.custom, .ctr-btn.rename { font-weight: 600; font-size: 13px; }

.ctr-log {
  background: #11151b; border: 1px solid rgba(255,255,255,0.07); border-radius: 10px;
  padding: 10px 14px; max-height: 320px; overflow-y: auto; font-size: 13px;
}
.ctr-log-head { font-weight: 700; color: var(--gold); margin-bottom: 6px; font-size: 13px; }
.dlog-empty { color: #7a8694; font-size: 13px; padding: 2px 0; }
.ctr-log-line { padding: 3px 0; color: #bcd; line-height: 1.5; }
.ctr-log-line.owe { color: #ffcaa0; }
.ctr-log-line.credit { color: #9be8b4; }
.ctr-log-time { color: #678; margin-right: 6px; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) {
  .ctr-btn { padding: 10px 13px; }
  .home-screen { padding: 32px 14px 50px; }
}

/* 计数器：房主控制 */
.ctr-hint { font-size: 12px; color: #788; margin-bottom: 10px; }
.ctr-hostbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(212,175,55,0.1); border: 1px solid rgba(212,175,55,0.35);
  border-radius: 10px; padding: 8px 12px; margin: 12px 0;
}
.ctr-hostbar-label { color: var(--gold); font-weight: 700; margin-right: 4px; }
.ctr-crown { font-size: 13px; }
.ctr-controls.host { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(255,255,255,0.1); }
.ctr-controls.host .ctr-btn { font-size: 13px; font-weight: 600; padding: 7px 11px; background: #3a2e16; border-color: rgba(212,175,55,0.4); color: #ffe9a8; }
.ctr-btn.hremove { background: #4a2020 !important; border-color: #b14a3a !important; color: #ffbcae !important; }

/* 计数器：封存横幅 + 重置身份 */
.ctr-archived {
  background: rgba(120,120,140,0.18); border: 1px solid rgba(180,180,200,0.35);
  border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: 14px; color: #cdd5e0;
}
.ctr-btn.hreset { background: #2a3a4a !important; border-color: #5a7a9a !important; color: #cfe6ff !important; }

/* ===== 梦幻炸金花 ===== */
.home-card.dream:hover { border-color: #b06fd8; }
.home-card.gande:hover { border-color: #4aa3d8; }
.dream-center {
  display: flex; justify-content: center; gap: 30px; flex-wrap: wrap;
  padding: 16px; margin: 10px 0; background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07); border-radius: 14px;
}
.dream-label { font-size: 12px; color: #9ab; margin-bottom: 6px; text-align: center; }
.dream-public, .dream-mine { display: flex; flex-direction: column; align-items: center; }
.dream-public .card, .dream-mine .card { width: 64px; height: 90px; }
.dream-public .card .rank { font-size: 26px; } .dream-public .card .suit { font-size: 22px; }
.dream-mine .card .rank { font-size: 26px; } .dream-mine .card .suit { font-size: 22px; }
.dream-best { margin-top: 8px; font-size: 14px; color: #cdd; }
.dream-type { color: #d8a23a; font-weight: 800; }
.dream-players { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px; }
.dream-player {
  min-width: 86px; padding: 8px 10px; border-radius: 10px; text-align: center;
  background: linear-gradient(165deg, rgba(33,44,37,0.8), rgba(14,20,16,0.8));
  border: 1px solid rgba(255,255,255,0.08);
}
.dream-player.banker { border-color: var(--gold); }
.dream-player.selected { box-shadow: 0 0 0 2px rgba(176,111,216,0.6); }
.dream-player.me { background: rgba(212,175,55,0.1); }
.dream-player.off { opacity: 0.45; }
.dp-name { font-weight: 600; font-size: 13px; }
.dp-tags { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; margin-top: 3px; }
.dp-tag { font-size: 10px; padding: 1px 5px; border-radius: 6px; }
.dp-tag.banker { background: #5a4a1a; color: #ffe9a8; }
.dp-tag.sel { background: #3a2a4a; color: #e0c0ff; }
.dp-tag.ok { background: #2b4b34; color: #c9f0d6; }
.dp-tag.wait { background: #5b3a2a; color: #ffd0b0; }
.dp-pend { font-size: 11px; color: #ff9d5c; margin-top: 3px; }
.dream-phase { margin: 14px 12px 30px; padding: 14px; background: #161b22; border-radius: 12px; border: 1px solid rgba(255,255,255,0.07); }
.dream-hint { font-size: 14px; color: #dfe; line-height: 1.6; margin-bottom: 10px; }
.dream-pick, .dream-kou { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ctr-btn.pick.on { background: #5a3a7a; border-color: #b06fd8; color: #fff; }
.dream-reveal .rv-banker { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rv-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-top: 1px dashed rgba(255,255,255,0.08); font-size: 14px; }
.rv-name { font-weight: 600; min-width: 56px; }
.rv-best { color: var(--gold); }
.rv-kou { color: #9ab; font-size: 13px; }
.rv-win { color: #6ee7a0; font-weight: 700; }
.rv-lose { color: #ff9d5c; font-weight: 700; }
.rv-verdict { margin: 12px 0; font-size: 15px; font-weight: 700; color: #ffe3b0; }
.dream-reveal .card, .rv-row .card { width: 38px; height: 54px; }
.rv-row .card .rank { font-size: 16px; } .rv-row .card .suit { font-size: 13px; }

.dp-tag.ai { background: #2a3f5a; color: #9fd0ff; }
.dp-tag.kou { background: #4a3a1a; color: #ffd98a; }
.pick-kou { font-size: 11px; color: #ffd98a; margin-left: 4px; }

/* ===== 梦幻炸金花 · 围桌 ===== */
.dream-table { margin-top: 22px; height: clamp(380px, 58vh, 580px); }
.dream-table .board-area { gap: 6px; }
#dPublicCard .card { width: 56px; height: 78px; }
#dPublicCard .card .rank { font-size: 22px; } #dPublicCard .card .suit { font-size: 18px; }
.dream-seat { width: 96px; }
.dream-seat .seat-cards { position: relative; justify-content: center; }
.dream-seat .card { width: 40px; height: 56px; }
.dream-seat .card .rank { font-size: 16px; } .dream-seat .card .suit { font-size: 13px; }
.dream-seat .seat-info { min-width: 70px; padding: 4px 9px; }
.dream-seat .seat-name { font-size: 12px; }
.dream-seat.banker .seat-info { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.dream-seat.picked .seat-info { box-shadow: 0 0 0 2px #b06fd8, 0 0 14px rgba(176,111,216,0.65); }
.dream-seat.selectable { cursor: pointer; }
.dream-seat.selectable:hover .seat-info { box-shadow: 0 0 0 2px #b06fd8; }
.dream-seat.off { opacity: 0.45; }
.dream-chip {
  position: absolute; right: -12px; top: -6px;
  background: linear-gradient(180deg, #e2b34a, #a8741a); color: #2a1c00;
  font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 12px;
  border: 2px solid #fff3d0; box-shadow: 0 2px 6px rgba(0,0,0,0.55); white-space: nowrap; z-index: 2;
}
.seat-best { font-size: 12px; color: var(--gold); margin-top: 2px; }
.seat-rvres { font-size: 12px; font-weight: 800; margin-top: 2px; }
.seat-rvres.win { color: #6ee7a0; } .seat-rvres.lose { color: #ff9d5c; }
.dream-center-result { text-align: center; margin-top: 6px; min-height: 22px; }
.dcr-verdict { font-size: 15px; font-weight: 800; color: #ffe3b0; }
.dcr-verdict.rotate { color: #6ee7a0; }
.dream-actbtns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 720px) {
  .dream-table { height: clamp(420px, 62vh, 600px); }
  .dream-seat { width: 78px; }
  .dream-seat .card { width: 32px; height: 45px; }
  .dream-seat .card .rank { font-size: 13px; } .dream-seat .card .suit { font-size: 11px; }
  .dream-seat .seat-info { min-width: 58px; padding: 3px 6px; }
  .dream-seat .seat-name { font-size: 11px; }
  .dream-chip { font-size: 10px; padding: 1px 5px; right: -8px; }
  #dPublicCard .card { width: 46px; height: 64px; }
}

/* ===== 干瞪眼 ===== */
.gande-table { margin-top: 14px; height: clamp(330px, 44vh, 460px); }
.gande-seat { width: 108px; display: flex; flex-direction: column; align-items: center; gap: 0; }

/* 本墩出了什么牌 / 不要（停留在座位旁） */
.gs-actrow { min-height: 40px; display: flex; align-items: flex-end; justify-content: center; }
.gs-act { display: inline-flex; gap: 2px; align-items: center; }
.gs-act.pass { background: rgba(70,76,86,0.95); color: #c8d0d8; font-size: 12px; font-weight: 800;
  padding: 2px 10px; border-radius: 11px; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.gs-act.play { background: rgba(0,0,0,0.35); padding: 3px 4px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.gs-act.play.pop { animation: gande-pop 0.45s cubic-bezier(.2,1.3,.5,1) backwards; }
@keyframes gande-pop { 0% { opacity: 0; transform: translateY(-16px) scale(0.6); } 100% { opacity: 1; transform: none; } }
.gs-act-empty { min-height: 1px; }
.card.tiny { width: 24px; height: 34px; border-radius: 4px; }
.card.tiny .rank { font-size: 12px; } .card.tiny .suit { font-size: 9px; }

/* 扇形背牌：有几张展开几张 */
.gs-cardsrow { position: relative; min-height: 48px; display: flex; align-items: center; justify-content: center; }
.gs-fanwrap { position: relative; display: inline-block; }
.gs-fan { position: relative; display: inline-block; width: 60px; height: 44px; }
.gs-fan .card.back.fan { position: absolute; left: 50%; bottom: 0; margin-left: -12px;
  width: 24px; height: 34px; border-width: 1px; transform-origin: bottom center; box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.gs-cnt { position: absolute; right: -6px; bottom: -4px; background: rgba(0,0,0,0.8); color: #ffd86b;
  font-weight: 800; font-size: 11px; border-radius: 9px; padding: 0 6px; border: 1px solid rgba(255,255,255,0.15); }
.gs-done { color: #6ee7a0; font-weight: 800; font-size: 13px; }

.gande-seat .gs-plate { margin-top: 4px; background: linear-gradient(180deg, rgba(11,18,30,0.94), rgba(5,9,17,0.94));
  border: 1px solid rgba(255,255,255,0.12); border-radius: 11px; padding: 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.gande-seat.turn .gs-plate { border-color: #6ee7a0; box-shadow: 0 0 14px rgba(110,240,110,0.5); animation: pulse-glow 1.2s infinite; }
.gande-seat.me .gs-plate { border-color: var(--gold); }
.gande-seat.done { opacity: 0.6; }
.gande-seat.off { opacity: 0.4; }
.gs-name { font-size: 12px; color: #dbe4ee; font-weight: 600; white-space: nowrap; }
.gs-pendtag { font-size: 11px; font-weight: 700; color: #2a1c00; background: linear-gradient(180deg,#f2c54e,#d89a22);
  border-radius: 8px; padding: 0 7px; white-space: nowrap; }

.gande-tableplay { display: flex; gap: 5px; justify-content: center; min-height: 76px; align-items: center; flex-wrap: wrap; }
.gande-tableplay .card { width: 50px; height: 70px; }
.gande-freelead { color: #9fb0c0; font-size: 15px; font-style: italic; }
.gande-tableinfo { display: flex; gap: 14px; justify-content: center; margin-top: 6px; font-size: 13px; }
.gti-by { color: #ffe3b0; font-weight: 700; }
.gti-deck { color: #9ab; }

/* 手牌区 */
.gande-handwrap { margin: 6px auto 0; max-width: 920px; padding: 0 10px; }
.gande-mymeta { text-align: center; color: #bcd; font-size: 13px; margin-bottom: 4px; }
.gande-pendtag { color: #ffb86b; font-weight: 800; }
.gande-hand { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; min-height: 84px; padding: 6px 0; }
.gande-hand .card { width: 54px; height: 78px; cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.gande-hand .card.sel { transform: translateY(-14px); box-shadow: 0 0 0 2px var(--gold), 0 8px 18px rgba(0,0,0,0.55); }
.gande-hand .card.joker .rank { font-size: 15px; }
.gande-spectate { color: #8a96a4; }
.gande-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.gande-turnnote { text-align: center; color: #9fb0c0; font-size: 13px; margin-top: 6px; }
.gande-turnnote.wait { color: #7a8694; }

/* 结算 */
.gande-over { margin-top: 8px; }
.gande-result { background: rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.12); border-radius: 12px; padding: 10px 16px; display: inline-block; }
.gov-title { color: var(--gold); font-weight: 800; margin-bottom: 6px; }
.gov-row { color: #cdd6e0; font-size: 14px; padding: 2px 0; }
.gov-row.win { color: #6ee7a0; font-weight: 800; }
.gande-result .btn { margin-top: 8px; }
.gande-rules p { margin: 6px 0; color: #cdd6e0; font-size: 14px; line-height: 1.5; }

.gande-toast { position: fixed; left: 50%; bottom: 16%; transform: translateX(-50%) translateY(10px);
  background: rgba(0,0,0,0.86); color: #fff; padding: 9px 18px; border-radius: 22px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 99; border: 1px solid rgba(255,255,255,0.14); }
.gande-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 720px) {
  .gande-table { height: clamp(280px, 38vh, 380px); }
  .gande-seat { width: 74px; }
  .gande-hand .card { width: 44px; height: 64px; }
  .gande-hand .card .rank { font-size: 16px; } .gande-hand .card .suit { font-size: 13px; }
  .gande-tableplay .card { width: 42px; height: 60px; }
}

/* 干瞪眼“不要”按钮：琥珀色，明显可点（不像禁用） */
.gande-pass { background: linear-gradient(180deg, #e6913f, #c46a1c); color: #fff; padding: 8px 18px; font-weight: 700; }
.gande-pass:hover { filter: brightness(1.08); }
