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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  min-height: 100dvh;
  color: #fff;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 游戏房间：牌桌可上下滑动 */
#gameRoom {
  display: block;
  min-height: 100vh;
}

/* 大厅样式 */
.lobby-container {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 60px 80px 160px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 520px;
  width: 100%;
}

.title {
  font-size: 48px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 18px;
  color: #aaa;
  margin-bottom: 40px;
}

/* 大厅右下角：复制日志 + 语言切换 */
.lobby-footer-right {
  position: fixed;
  bottom: calc(6px + env(safe-area-inset-bottom, 0));
  right: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
}
body:has(#gameRoom:not(.hidden)) .lobby-footer-right {
  display: none !important;
}

.lobby-footer-right .copy-log-btn {
  padding: 6px 8px;
  font-size: 12px;
}

.lang-toggle-btn {
  position: fixed;
  bottom: 6px;
  right: 16px;
  z-index: 60;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 12px;
  cursor: pointer;
}
.lobby-footer-right .lang-toggle-btn {
  position: static;
}

.lang-toggle-btn:hover {
  background: rgba(30, 64, 175, 0.9);
}

/* 玩家信息显示（大厅顶部统计条） */
.player-stats {
  margin: 0 0 18px;
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-label {
  font-size: 12px;
  color: #aaa;
}

.stat-value {
  font-size: 18px;
  font-weight: bold;
  color: #ffd700;
}

.lobby-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.nickname-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.avatar-box:hover {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.avatar-placeholder {
  font-size: 22px;
}

/* 头像选择弹窗 */
.avatar-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 120;
}
.avatar-panel.hidden {
  display: none;
}
.avatar-grid {
  background: rgba(15, 23, 42, 0.98);
  padding: 16px;
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
}
.avatar-item-btn {
  border: none;
  padding: 0;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}
.avatar-item-btn img {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
}

/* 昵称下方：创建房间 / 加入房间按钮行 */
.lobby-mode-row {
  display: flex;
  gap: 12px;
  width: 100%;
  margin: 10px 0 4px;
}

.lobby-mode-row .btn {
  flex: 1;
  min-width: 0;
}

.lobby-buttons-row {
  display: flex;
  gap: 12px;
  width: 100%;
}

.lobby-buttons-row .btn {
  flex: 1;
  min-width: 0;
}

.lobby-buttons-row #getChipsBtn {
  flex: 0 0 auto;
}

.lobby-buttons-row .quick-start-wrapper {
  flex: 1 1 auto;
}

.quick-start-wrapper {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.quick-start-wrapper > #quickStartBtn {
  width: 100%;
}

.quick-start-item {
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.quick-start-item:hover {
  background: rgba(55, 65, 81, 0.9);
}

.quick-start-item:active {
  background: rgba(31, 41, 55, 1);
}

/* 获取筹码弹窗：整体优化，无表头 */
#getChipsModal .join-form-card.get-chips-card {
  position: relative;
  max-width: 420px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
}
#getChipsModal .get-chips-title {
  margin: 0 0 14px 0;
  padding-right: 72px;
  font-size: 17px;
  font-weight: 600;
  color: #f1f5f9;
}
#getChipsModal .get-chips-balance {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
  color: #fde68a;
  transition: transform 0.2s ease;
}
#getChipsModal .get-chips-balance-pop .chip-icon {
  animation: get-chips-icon-pop 0.32s ease-out;
}
@keyframes get-chips-icon-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
/* 充值区：深色卡片、金边、筹码图标 + 价格=数量 */
#getChipsModal .get-chips-recharge-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-shrink: 0;
}
#getChipsModal .get-chips-recharge-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  background: linear-gradient(165deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 14px;
  color: #e2e8f0;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
#getChipsModal .get-chips-recharge-panel:hover {
  border-color: rgba(251, 191, 36, 0.6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(251, 191, 36, 0.15);
  transform: translateY(-2px);
}
#getChipsModal .get-chips-recharge-panel:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
#getChipsModal .get-chips-recharge-chip-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
}
/* 充值区复用加注选项的 chip1~4 图标，覆盖定位与尺寸 */
#getChipsModal .get-chips-recharge-chip-wrap .raise-chip-icon {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  width: 28px;
  height: 28px;
  background-size: contain;
  background-repeat: no-repeat;
}
#getChipsModal .get-chips-recharge-price {
  font-size: 14px;
  font-weight: 700;
  color: #fde68a;
  letter-spacing: 0.02em;
  margin-bottom: 2px;
}
#getChipsModal .get-chips-recharge-eq {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}
#getChipsModal .get-chips-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  margin: 0;
  padding: 12px 0 0;
  border-top: 1px solid rgba(71, 85, 105, 0.4);
  -webkit-overflow-scrolling: touch;
}
#getChipsModal .get-chips-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}
#getChipsModal .get-chips-table td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  vertical-align: middle;
}
#getChipsModal .get-chips-table tbody tr:last-child td {
  border-bottom: none;
}
#getChipsModal .get-chips-row:hover td {
  background: rgba(15, 23, 42, 0.25);
}
#getChipsModal .get-chips-desc-cell {
  color: #cbd5e1;
  width: 58%;
}
#getChipsModal .get-chips-action-cell {
  width: 42%;
  white-space: normal;
}
#getChipsModal .get-chips-row-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 3px;
}
#getChipsModal .get-chips-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: #94a3b8;
}
#getChipsModal .get-chips-desc strong {
  color: #fde68a;
}
#getChipsModal .get-chips-action-cell-empty {
  color: #64748b;
  font-size: 12px;
}
#getChipsModal .get-chips-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#getChipsModal .get-chips-actions-right {
  justify-content: flex-end;
}
#getChipsModal .get-chips-table-btn {
  min-width: 88px;
  box-sizing: border-box;
}
#getChipsModal .get-chips-invite-row.get-chips-actions-right {
  justify-content: flex-end;
}
#getChipsModal .get-chips-status {
  font-size: 11px;
  color: #94a3b8;
  white-space: normal;
}
#getChipsModal .get-chips-invite-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
#getChipsModal .get-chips-invite-count {
  font-size: 11px;
  color: #cbd5e1;
  flex-shrink: 0;
}
#getChipsModal .get-chips-invite-input {
  flex: 1;
  min-width: 90px;
  max-width: 150px;
  font-size: 11px;
  padding: 5px 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid #334155;
  border-radius: 6px;
  color: #e2e8f0;
}

.quick-start-item.selected {
  background: rgba(59, 130, 246, 0.95);
  color: #f9fafb;
}

.quick-start-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.quick-start-item.affordable {
  color: #fde68a;
  font-weight: 600;
}

.quick-start-item.affordable.selected {
  background: linear-gradient(135deg, #f59e0b, #facc15);
  color: #111827;
}

/* 竞技场二级弹窗中的档位列表：可触摸滑动，隐藏滚动条 */
.arena-tier-list {
  margin-top: 4px;
  max-height: 260px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.arena-tier-list::-webkit-scrollbar {
  display: none;
}

/* 创建房间按钮行：创建 + 加入并排 */
.create-room-buttons-row {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.create-room-buttons-row .btn {
  flex: 1;
  min-width: 0;
}

/* 创建房间：小盲选择与最低带入提示 */
.create-room-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  margin-bottom: 4px;
}

.create-room-label {
  font-size: 14px;
  color: #ccc;
}

.create-room-select {
  padding: 10px 14px;
  font-size: 15px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  outline: none;
}

.create-room-select:focus {
  border-color: #ffd700;
}

.create-room-select option {
  background: #1a1a2e;
  color: #e8e8e8;
}

.create-room-select option.affordable-option {
  color: #fde68a;
  font-weight: 600;
}

.create-room-select option:disabled {
  color: #6b7280;
}

.create-room-label .chip-icon-inline {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  vertical-align: middle;
  object-fit: contain;
}

.create-room-password-input {
  margin-top: 6px;
}

.create-room-option {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 6px;
}

.create-room-timer-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #bbb;
  cursor: pointer;
}

.create-room-timer-mode input {
  margin: 0;
}

.create-room-block > #createRoomBtn {
  margin-top: 14px;
}

.input-group input,
.join-form input {
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  outline: none;
  transition: all 0.3s;
}

.input-group input:focus,
.join-form input:focus {
  border-color: #ffd700;
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.input-group input::placeholder,
.join-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* 加入房间表单：作为二级弹窗居中显示 */
.join-form {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.join-form-card {
  position: relative;
  width: 92%;
  max-width: 380px;
  padding: 22px 20px 20px;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.3);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 弹窗筹码显示（与主页筹码数字同色） */
.modal-chips-display {
  position: absolute;
  bottom: 14px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: bold;
  color: #ffd700;
}
.modal-chips-display.modal-chips-top-right {
  bottom: auto;
  left: auto;
  top: 18px;
  right: 20px;
}
.modal-chips-display .chip-icon-inline {
  width: 18px;
  height: 18px;
  background-image: url('/chip.png');
  background-size: contain;
  background-repeat: no-repeat;
  flex-shrink: 0;
}
.modal-chips-value {
  color: #ffd700;
}

/* 创建好友房弹窗：开启语音放左下角 */
.create-room-voice-bottom-left {
  position: absolute;
  bottom: 14px;
  left: 20px;
  margin-top: 0;
}

/* 竞技场弹窗：自动补足筹码放下面居中 */
#arenaForm .join-form-card {
  padding-bottom: 48px;
}
.arena-auto-topup-row {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  top: auto;
}
.arena-auto-topup-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #ccc;
  cursor: pointer;
  user-select: none;
}
.arena-auto-topup-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.join-form-title {
  margin: 0 0 4px;
  font-size: 22px;
}

.join-form-subtitle {
  margin: 0 0 10px;
  font-size: 13px;
  color: #aaa;
}

/* 创建好友房弹窗：筹码右上角、新手/高手一行、语音左下角 */
#createRoomForm .join-form-card {
  align-items: stretch;
  padding-bottom: 108px;
}
#createRoomForm .create-room-select,
#createRoomForm .create-room-password-input {
  margin-top: 2px;
}
#createRoomForm .create-room-voice-bottom-left {
  margin-top: 0;
}

/* 创建好友房：新手/高手横排两格，均分宽度、不换行 */
.create-room-timer-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
}
.create-room-timer-opt {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  margin: 0;
  font-size: 13px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.create-room-timer-opt:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}
.create-room-timer-opt input {
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.create-room-timer-opt:has(input:checked) {
  border-color: rgba(253, 230, 138, 0.5);
  background: rgba(253, 230, 138, 0.1);
}
.create-room-timer-opt:has(input:checked) span,
.create-room-timer-opt input:checked + span {
  color: #fde68a;
  font-weight: 600;
}

#createRoomForm .join-form-actions {
  position: absolute;
  bottom: 14px;
  right: 20px;
  margin-top: 0;
}

.join-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.create-room-option {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.create-room-timer-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}

.create-room-voice-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.create-room-voice-toggle {
  font-size: 13px;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 6px;
}

.create-room-voice-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.create-room-voice-toggle input[type="checkbox"]:checked {
  accent-color: #facc15; /* 明亮黄色勾选 */
}

.create-room-voice-toggle input[type="checkbox"]:checked + span {
  color: #facc15;
  font-weight: 600;
}

/* 好友房语音控制：在房间号下方，竖排 */
.voice-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
  flex-shrink: 0;
}
.voice-panel.hidden {
  display: none !important;
}
.voice-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.voice-btn.voice-on {
  background: rgba(34, 197, 94, 0.8);
}
.voice-btn.voice-on::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #22c55e, transparent 25%, #16a34a 50%, transparent 75%, #22c55e);
  animation: voice-border-spin 1.5s linear infinite;
  z-index: -1;
}
.voice-btn.voice-on::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.9);
  z-index: -1;
}
@keyframes voice-border-spin {
  to { transform: rotate(360deg); }
}
.voice-btn.voice-off { opacity: 0.6; }

.join-confirm-btn {
  min-width: 110px;
}

.join-cancel-btn {
  min-width: 80px;
}

.btn {
  padding: 15px 30px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.btn:active:not(:disabled) {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.06s ease;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.version-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 40px 0 0;
}
.version-label {
  margin: 0;
  font-size: 12px;
  color: #ccc;
  text-align: center;
}

.legal-disclaimer {
  text-align: center;
  font-size: 11px;
  color: #888;
  padding: 0 12px;
  margin-top: 10px;
}
/* 复制日志（反馈问题）：链接样式按钮 */
.copy-log-btn {
  font-size: 11px;
  color: #888;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 4px;
}
.copy-log-btn:hover { color: #aaa; }
.game-room-log { margin-left: 0; margin-right: 8px; }
.game-room-log.copy-log-alert { color: #e74c3c; }
.game-room-log.copy-log-alert:hover { color: #c0392b; }

.btn-primary {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
}

.btn-secondary {
  background: linear-gradient(135deg, #4a90d9, #2d6ab3);
  color: #fff;
}

/* 获取筹码按钮与竞技场按钮颜色互换：
   - 获取筹码：使用次要蓝色按钮
   - 竞技场：使用主色（黄色系）按钮 */
#getChipsBtn {
  background: linear-gradient(135deg, #4a90d9, #2d6ab3);
  color: #fff;
}

#quickStartBtn {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
}

.btn-warning {
  background: linear-gradient(135deg, #ffc107, #ffb300);
  color: #fff;
}

.btn-danger {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
}

.btn-success {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  color: #fff;
}

/* 亮牌按钮 */
.btn-show-cards {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}
.btn-show-cards:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #666;
}

.btn-small {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-tiny {
  padding: 4px 10px;
  font-size: 11px;
}


/* 筹码图标（用于玩家筹码显示） */
.chip-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 4px;
  background-image: url('/chip.png'); /* 请将筹码图放到 public/chip.png */
  background-size: contain;
  background-repeat: no-repeat;
  vertical-align: middle;
}
/* 保留旧类名定义，避免潜在引用 */
.join-form {
}

/* 游戏房间顶部栏：房号左、状态中、离开房间右 */
.game-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 30px;
  padding-top: calc(15px + env(safe-area-inset-top, 0));
  padding-left: calc(30px + env(safe-area-inset-left, 0));
  padding-right: calc(30px + env(safe-area-inset-right, 0));
  background: transparent;
}

.game-header .room-info {
  flex-shrink: 0;
}

.game-header .game-status {
  flex: 1;
  text-align: center;
  margin: 0 12px;
}

/* 房间上方“等待玩家加入”已去掉，不再显示 */
.game-status.always-hidden {
  display: none !important;
}

.game-header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex-shrink: 0;
}

.game-header-right {
  flex-shrink: 0;
}

.game-header #settlementBtn {
  flex-shrink: 0;
}

/* 手机端：房号与结算/退出同一行、竞技场换房与退出同高 */
@media (max-width: 768px) {
  .game-header {
    flex-wrap: nowrap;
    align-items: center;
    padding-left: calc(12px + env(safe-area-inset-left, 0));
    padding-right: calc(12px + env(safe-area-inset-right, 0));
    gap: 8px;
  }
  .game-header-left {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 0;
  }
  .game-header-left .room-info {
    margin: 0;
  }
  .game-header-left .change-room-btn {
    margin: 0;
    flex-shrink: 0;
  }
  .game-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }
  .game-header-right .copy-log-btn.game-room-log {
    flex-shrink: 0;
  }
  .game-header #settlementBtn {
    flex-shrink: 0;
    order: 1;
  }
}

.game-header .room-code {
  font-size: 18px;
  font-weight: bold;
  color: #ffd700;
  letter-spacing: 1px;
}

/* 游戏房间左上角「链接」按钮：细灰色文字 + 下划线链接风格 */
.copy-link-btn {
  font-size: 12px;
  color: #ccc;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 6px;
  text-decoration: underline;
}
.copy-link-btn:hover {
  color: #fff;
}

.game-header .total-chips {
  font-size: 18px;
  font-weight: bold;
  color: #ffd700;
  letter-spacing: 1px;
  margin-left: 12px;
}

/* 游戏房间：左上角房号，右上角离开房间按钮（兼容旧类名） */
.game-room-top {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: env(safe-area-inset-top, 0);
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.room-code-fixed {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  font-size: 16px;
  color: #aaa;
}

.room-code-line {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
}

.total-chips {
  font-size: 16px;
  font-weight: normal;
  color: #aaa;
}

.room-code-fixed .room-code-value {
  font-size: 20px;
  font-weight: bold;
  color: #ffd700;
  letter-spacing: 2px;
  cursor: pointer;
  user-select: none;
}

.room-code-fixed .room-code-value:hover {
  color: #fff;
}

.leave-room-fixed {
  min-width: auto;
  padding: 4px 10px;
  font-size: 12px;
  flex-shrink: 0;
}

.action-buttons-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.action-buttons-wrap .action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.start-game-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 90;
  pointer-events: none;
}

.start-game-wrap .start-game-btn {
  pointer-events: auto;
  min-width: 150px;
  margin: 0;
}

/* 荷官区域：图 + 打赏按钮 + 台词 */
.dealer-wrap {
  position: absolute;
  top: -8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.dealer-wrap .dealer-image {
  position: relative;
  top: 0;
  left: 0;
  transform: none;
  pointer-events: none;
}

/* 打赏按钮已隐藏 */
.dealer-wrap .dealer-tip-btn {
  display: none !important;
}
.dealer-wrap .dealer-tip-btn.dealer-tip-btn-visible {
  pointer-events: auto;
  margin-top: 0;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 20px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
  border: none;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.dealer-wrap .dealer-tip-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.dealer-wrap .dealer-tip-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 筹码落点区域：保留位置与尺寸供飞筹码动画使用，线框隐藏 */
.chip-landing-zone {
  position: absolute;
  top: 140px;
  left: 50%;
  transform: translateX(-50%);
  width: 170px;
  height: 120px;
  border: none;
  border-radius: 0;
  background: transparent;
  z-index: 75;
  pointer-events: none;
}

.empty-room-hint {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 14px;
  color: #e5e7eb;
  z-index: 210;
}
.empty-room-hint.hidden {
  display: none;
}
.empty-room-text {
  margin: 0;
  font-size: 14px;
}

/* 底池数字：位于筹码落点区域上方，间距 15px */
.pot-display.pot-display-above-zone {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 15px;
  z-index: 200;
}

/* 打赏时从荷官位置飘出的红色爱心 */
.heart-float {
  position: fixed;
  font-size: 40px;
  color: #e74c3c;
  pointer-events: none;
  z-index: 200;
  animation: heartFloat 2s ease-out forwards;
  text-shadow: 0 0 8px rgba(231, 76, 60, 0.8);
}

@keyframes heartFloat {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(0);
  }
  15% {
    opacity: 1;
    transform: scale(1.2) translateY(-15px);
  }
  30% {
    transform: scale(1) translateY(-35px);
  }
  100% {
    opacity: 0;
    transform: scale(0.8) translateY(-120px);
  }
}

.dealer-speech {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  min-width: 120px;
  max-width: 180px;
  padding: 8px 12px;
  font-size: 14px;
  color: #1a1a2e;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}

.dealer-speech.dealer-speech-visible {
  opacity: 1;
}

/* 荷官图：发牌从该区域飞入 */
.dealer-image {
  position: relative;
  width: 156px;
  height: 156px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(46, 204, 113, 0.9);
  box-shadow: 0 0 24px rgba(46, 204, 113, 0.85), 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dealer-image {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dealer-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dealer-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #4a90d9, #2d6ab3);
  border-radius: 50%;
}

.dealer-image img[style*="display: none"] ~ .dealer-placeholder,
.dealer-image .dealer-placeholder:only-child {
  display: flex;
}

.poker-table {
  position: relative;
  width: 100%;
  height: calc(100vh - 240px + 100px);
  background: radial-gradient(ellipse at center, #2e7d32 0%, #1b5e20 70%, #0d330d 100%);
  border: 15px solid #5d4037;
  border-radius: 200px;
  margin-top: 140px;
  overflow: visible;
  box-shadow: 0 8px 0 #1b5e20, 0 12px 0 rgba(0,0,0,0.15), 0 24px 40px rgba(0,0,0,0.35);
}

.center-result-banner {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  padding: 10px 26px;
  border-radius: 999px;
  background: radial-gradient(circle at top, rgba(251, 191, 36, 0.22), rgba(15, 23, 42, 0.96));
  border: 2px solid rgba(251, 191, 36, 0.9);
  color: #fef9c3;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(250, 204, 21, 0.7);
  pointer-events: none;
  opacity: 0;
  z-index: 80;
}

.center-result-animate {
  animation: centerResultPop 0.9s ease-out forwards;
}

@keyframes centerResultPop {
  0% {
    transform: translate(-50%, -40%) scale(0.6);
    opacity: 0;
  }
  25% {
    transform: translate(-50%, -46%) scale(1.1);
    opacity: 1;
  }
  65% {
    transform: translate(-50%, -50%) scale(1.0);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -56%) scale(0.9);
    opacity: 0;
  }
}

#gameRoom .poker-table {
  margin-top: 240px;
}

/* 手机竖屏 */
@media (max-width: 768px) {
  #gameRoom .poker-table {
    height: calc(100vh - 320px + 100px);
    margin-top: 270px;
  }
  .dealer-image {
    width: 117px;
    height: 117px;
    top: -6%;
  }
}

.poker-table::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  height: 60%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

/* 座位样式 */
.seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 120px;
}

/* 我的座位与手牌整体下移 35px */
#seat-0 {
  transform: translateX(-50%) translateY(35px) !important;
}
/* 我的手牌往上提高 10px，与头像拉开距离 */
#seat-0 #myCards {
  transform: translateY(-10px);
}

/* 左右两侧上下座位各间隔至少 30px；左侧两座往左 20px，右侧两座往右 20px */
#seat-2 {
  transform: translateY(-15px) translateX(-20px);
}
#seat-1 {
  transform: translateY(15px) translateX(-20px);
}
#seat-3 {
  transform: translateY(-15px) translateX(20px);
}
#seat-4 {
  transform: translateY(15px) translateX(20px);
}

.player-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 12px 15px;
  border-radius: 10px;
  backdrop-filter: blur(5px);
  position: relative;
  transform: translateY(-4px);
}

.player-avatar {
  font-size: 28px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  overflow: visible;
  position: relative;
}

/* 本端「不听他」角标（仅本地生效） */
.avatar-mute-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 12px;
  line-height: 1;
  z-index: 2;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 4px;
  padding: 1px 2px;
}
.avatar-mute-badge.hidden {
  display: none !important;
}
/* 10连胜专属饰品（头像左上角，房间内所有人可见） */
.player-avatar .streak10-badge {
  position: absolute;
  top: 0;
  left: 0;
  width: 22px;
  height: 22px;
  object-fit: contain;
  z-index: 2;
}
.player-avatar.has-img img {
  max-width: 40px;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.player-name {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
  margin-top: 5px;
  white-space: nowrap;
}

.player-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #ffd700;
}

.player-chips .chip-icon {
  margin-right: 4px;
  vertical-align: middle;
}

.player-cards {
  display: flex;
  gap: 3px;
  min-height: 45px;
}

.player-bet {
  font-size: 14px;
  color: #ffffff;
  font-weight: bold;
  min-height: 20px;
}

.player-status {
  font-size: 12px;
  color: #aaa;
  min-height: 16px;
}

/* 座位状态 */
.seat.active .player-info {
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.26), rgba(34, 197, 94, 0.4));
  box-shadow:
    0 0 24px rgba(251, 191, 36, 0.95),
    0 0 40px rgba(251, 191, 36, 0.75);
  border: 2px solid #facc15;
}

.seat.my-seat:not(.active) .player-info {
  box-shadow: 0 0 22px rgba(74, 222, 128, 0.95);
  border: 2px solid #4ade80;
}

.seat.other-seat:not(.active) .player-info {
  box-shadow: 0 0 18px rgba(76, 175, 80, 0.8);
  border: 2px solid #4caf50;
}

.seat.folded .player-info {
  opacity: 0.5;
}

.seat.sitting-out .player-info {
  opacity: 0.45;
  border: 2px dashed #888;
  box-shadow: none;
}
.seat.sitting-out .player-status {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffd700;
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* 弃牌玩家的手牌半透明 */
.seat.folded .player-cards .card {
  opacity: 0.45;
}

/* 弃牌 FOLD 红色斜体印章，盖在头像框上 */
.fold-stamp {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%) rotate(-18deg);
  padding: 4px 14px;
  border: 2px solid rgba(220, 38, 38, 0.9);
  border-radius: 6px;
  color: rgba(220, 38, 38, 0.95);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.05);
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.45);
  text-shadow:
    0 0 2px rgba(248, 113, 113, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 60;
}

/* 亮牌后手牌绿色描边 */
.seat.cards-revealed .player-cards {
  box-shadow: 0 0 0 3px #2ecc71;
  border-radius: 8px;
}
.seat.cards-revealed .player-cards .card {
  box-shadow: 0 0 0 1px #2ecc71;
}

/* 摊牌/获胜手牌更明显绿边 */
.player-cards .card.winning-card {
  border: 2px solid #4ade80;
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.7);
}

/* 牌局进行中时，空座位半透明 */
.seat.empty.in-game {
  opacity: 0.4;
}

.seat.all-in .player-info {
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
  border: 2px solid #ff6b6b;
}

.seat.winner .player-info {
  animation: winPulse 1s ease-in-out infinite;
}

@keyframes winPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.win-streak-badge {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 300;
  pointer-events: none;
  color: #ffd700;
  font-size: 32px;
  font-weight: bold;
  text-shadow: 0 2px 12px rgba(0,0,0,0.9), 0 0 6px #ffc107;
  letter-spacing: 0.08em;
  opacity: 1;
}
.win-streak-badge.hidden {
  display: none;
}
.win-streak-badge.win-badge-fadeup {
  animation: winBadgeFadeUp 2s ease-out forwards;
}
@keyframes winBadgeFadeUp {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  30%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -120%) scale(0.9); }
}

/* 公共牌区（底池已移至筹码区上方） */
.community-area {
  position: absolute;
  top: 55%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pot-display {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 25px;
  border-radius: 25px;
  position: relative;
  z-index: 200;
}

/* 底池前筹码图标，有筹码飞入时放大 130% 再恢复 */
.pot-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  flex-shrink: 0;
  background-image: url('/chip.png');
  background-size: contain;
  background-repeat: no-repeat;
}

@keyframes potIconPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.pot-icon.pot-icon-pop {
  animation: potIconPop 0.4s ease-out;
}

.pot-amount {
  font-size: 24px;
  font-weight: bold;
  color: #ffd700;
}

.community-cards {
  display: flex;
  gap: 8px;
  /* 公共牌层级应在筹码之上，确保发出的牌不会被桌面筹码遮挡 */
  position: relative;
  z-index: 80;
}

.current-bet {
  display: none; /* 底牌下方当前下注信息已隐藏 */
  font-size: 14px;
  color: #ffffff;
}

/* 扑克牌样式（基础尺寸，其他玩家盖着的牌） */
.card {
  height: 48px;
  width: auto;
  aspect-ratio: 58 / 85;
  background: #fff;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

/* 我的手牌 & 公共牌（桌面基础尺寸，高度约 60px） */
.card-my,
.card-board {
  height: 60px;
  width: auto;
  aspect-ratio: 58 / 85;
}

/* 手牌和公共牌从荷官图片中间飞入（由 JS runCardFlyFromDealer 实现） */
.card.card-fly-from-dealer {
  transform-origin: 50% 50%;
}

.card.red {
  color: #e74c3c;
}

.card.black {
  color: #2c3e50;
}

.card.back {
  background: linear-gradient(135deg, #1a237e, #283593);
  border: 2px solid #fff;
}

/* 其他玩家盖着的手牌：1px 白色描边 */
.seat .player-cards .card.back {
  border: 1px solid #fff;
}

/* 新扑克牌布局：一个数字一个花色，4:6 比例，整体微微倾斜 */
.card-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform: rotate(-10deg);
}

.card-rank-main {
  flex: 6;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 24px;
  letter-spacing: 0.02em;
}

.card-suit-main {
  flex: 4;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  font-size: 16px;
}

/* 我的手牌与公共牌稍微放大字号，保持 4:6 视觉比例 */
.card-my .card-rank-main,
.card-board .card-rank-main {
  font-size: 30px;
}

.card-my .card-suit-main,
.card-board .card-suit-main {
  font-size: 20px;
}

/* 其他玩家手牌：等比缩小，避免溢出头像区域 */
.seat .player-cards .card:not(.card-my):not(.card-board) .card-rank-main {
  font-size: 18px;
}

.seat .player-cards .card:not(.card-my):not(.card-board) .card-suit-main {
  font-size: 13px;
}

/* 玩家外框顺时针倒计时进度条 */
.seat-timer-ring {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  padding: 3px;
  pointer-events: none;
  z-index: 2;
  background:
    conic-gradient(var(--ring-color, #ffd700) var(--timer-deg, 0deg), var(--ring-bg, rgba(255, 215, 0, 0.12)) 0deg);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0;
  transition: none;
  box-shadow:
    0 0 8px var(--ring-glow, rgba(255, 215, 0, 0.9)),
    0 0 16px var(--ring-glow, rgba(255, 215, 0, 0.6)),
    0 0 24px var(--ring-glow, rgba(255, 215, 0, 0.4));
}

.seat.countdown-active .player-info .seat-timer-ring {
  opacity: 1;
}

/* 结算面板下方的行为记录：默认显示 5 行，超出可滚动 */
.settlement-log {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #ccc;
  text-align: left;
  height: 7.5em;   /* 5 行：5 × 1.5em */
  max-height: 7.5em;
  overflow-y: auto;
  padding-right: 4px;
}

.settlement-log-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #999;
}

/* 操作面板（无黑色底板），保证在倒计时之上且可点击 */
.action-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: transparent;
  padding: 10px 12px 8px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0));
  padding-left: calc(12px + env(safe-area-inset-left, 0));
  padding-right: calc(12px + env(safe-area-inset-right, 0));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.raise-amount.hidden {
  display: none !important;
}

.action-info {
  font-size: 18px;
  color: #ffd700;
  display: flex;
  align-items: center;
  gap: 15px;
}

/* 倒计时样式：不阻挡操作面板点击 */
.action-timer {
  /* 旧的圆形倒计时隐藏，只保留 DOM，不再展示 */
  display: none;
  pointer-events: none;
}

.timer-ring {
  position: relative;
  width: 32px;
  height: 32px;
}

.timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.15);
  stroke-width: 2;
}

.timer-progress {
  fill: none;
  stroke: #ffd700; /* 黄色 */
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: bold;
  color: #ffd700;
}

/* 倒计时紧急状态 */
.action-timer.timer-urgent .timer-progress {
  stroke: #e74c3c;
}
.action-timer.timer-urgent .timer-text {
  color: #e74c3c;
}

/* 下注飞筹码动画 */
.chip-fly {
  position: absolute;
  width: 20px;
  height: 20px;
  background-image: url('/chip.png'); /* 默认筹码图标（兼容旧样式） */
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 70;
  transform: translate(0, 0);
  opacity: 1;
  transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

/* 不同下注额度对应的筹码皮肤（仅飞往底池的筹码使用） */
.chip-fly-pot.chip-style-1 {
  background-image: url('/card/card1.png');
}
.chip-fly-pot.chip-style-2 {
  background-image: url('/card/card2.png');
}
.chip-fly-pot.chip-style-3 {
  background-image: url('/card/card3.png');
}
.chip-fly-pot.chip-style-4 {
  background-image: url('/card/card4.png');
}

.chip-target-debug {
  display: none; /* 隐藏筹码目标白框，需要调试时可改为 block */
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  pointer-events: none;
  z-index: 85;
}

@keyframes roundResultFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -30px);
  }
}

.round-result-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 75;
  animation: roundResultFloat 2s ease-out forwards;
}

.round-result-float .round-float-chip {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.round-result-float.negative {
  color: #f97373;
}

/* 大牌提示（四条/三条/同花顺/皇家同花顺/顺子/同花/葫芦） */
.hand-badge {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-weight: bold;
  background: linear-gradient(135deg, #fff4c2, #ffd700, #ffb300);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  z-index: 80;
  animation: handBadgeFloat 1.6s ease-out forwards;
}

@keyframes handBadgeFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  20% {
    opacity: 1;
    transform: translate(-50%, -8px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -26px);
  }
}

/* 黄色 ALL IN 飘字：外发光、上飘、停留约 1 秒后消失（不显示白色状态文字） */
.all-in-float {
  position: absolute;
  transform: translate(-50%, 0);
  font-size: 22px;
  font-weight: bold;
  color: #ffeb3b;
  text-shadow:
    0 0 10px #ffeb3b,
    0 0 20px #ffc107,
    0 0 30px rgba(255, 235, 59, 0.8);
  pointer-events: none;
  z-index: 80;
  white-space: nowrap;
  animation: allInFloat 2.2s ease-out forwards;
}

@keyframes allInFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, 0);
  }
  15% {
    opacity: 1;
    transform: translate(-50%, -25px);
  }
  15.01%, 65% {
    opacity: 1;
    transform: translate(-50%, -25px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -45px);
  }
}

.action-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.action-buttons .btn {
  min-width: 72px;
  padding: 6px 10px;
  font-size: 14px;
  color: #ffffff;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 0.9),
    0 1px 2px rgba(0, 0, 0, 0.9);
  font-weight: 600;
}

/* 预托管操作高亮：白色描边 + 外发光（仅未禁用时显示，禁用按钮不高亮） */
.action-buttons .btn.pending-action:not(:disabled) {
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.95),
    0 0 12px rgba(255, 255, 255, 0.8);
}

/* 不能托管/不能操作的操作区按钮：置灰，不高亮 */
.action-buttons .btn:disabled {
  opacity: 0.6;
  background: #4a4a4a !important;
  color: #888 !important;
  border-color: #3a3a3a;
  box-shadow: none !important;
  transform: none !important;
}
.action-buttons .btn:disabled.pending-action {
  box-shadow: none !important;
}

/* 加注选项弹窗：全屏遮罩 + 底部扇形 4 选项 */
.raise-amount.raise-options-popup {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 0 calc(80px + env(safe-area-inset-bottom, 0)) 0;
  z-index: 500;
  pointer-events: none;
}
.raise-amount.raise-options-popup:not(.hidden) {
  pointer-events: auto;
}
.raise-options-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
}
.raise-options-fan {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  padding: 8px;
  min-height: 100px;
}
.raise-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 72px;
  padding: 14px 12px 10px;
  transform-origin: bottom center;
  pointer-events: auto;
  transition: transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.raise-option:active {
  transform: scale(0.90) !important;
}
.raise-option:nth-child(1) { transform: rotate(-32deg); }
.raise-option:nth-child(2) { transform: rotate(-11deg); }
.raise-option:nth-child(3) { transform: rotate(11deg); }
.raise-option:nth-child(4) { transform: rotate(32deg); }
.raise-option .raise-option-label,
.raise-option .raise-option-amount {
  color: #fff;
  text-shadow:
    0 0 2px rgba(0, 0, 0, 1),
    0 1px 3px rgba(0, 0, 0, 0.9),
    0 0 4px rgba(0, 0, 0, 0.8);
}
.raise-option .raise-option-label {
  font-size: 12px;
  white-space: nowrap;
}
.raise-option .raise-option-amount {
  font-size: 14px;
  font-weight: bold;
  margin-top: 2px;
}

/* 加注选项上方的筹码图标（使用四种新皮肤，略微超出按钮顶部） */
.raise-chip-icon {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}
.raise-chip-1 { background-image: url('/card/card1.png'); }
.raise-chip-2 { background-image: url('/card/card2.png'); }
.raise-chip-3 { background-image: url('/card/card3.png'); }
.raise-chip-4 { background-image: url('/card/card4.png'); }

/* 弹窗样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  padding: 40px 60px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 215, 0, 0.3);
}

.modal-content h2 {
  font-size: 32px;
  margin-bottom: 30px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 结算弹窗布局优化 */
.settlement-modal {
  max-width: 420px;
  width: 92%;
  padding: 24px 28px;
  text-align: center;
}

.settlement-modal-header {
  position: relative;
  margin-bottom: 2px;
}

.settlement-title {
  font-size: 22px;
  margin: 0;
  text-align: center;
  padding-right: 44px;
}

.sound-toggle-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.sound-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.settlement-subtitle {
  font-size: 13px;
  color: #aaa;
  margin: 0 0 16px 0;
}

.settlement-subtitle {
  font-size: 13px;
  color: #aaa;
  margin: 0 0 16px 0;
}

.settlement-table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.settlement-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.settlement-table th {
  padding: 10px 12px;
  text-align: left;
  color: #ffd700;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 215, 0, 0.25);
}

.settlement-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.settlement-table tbody tr:last-child td {
  border-bottom: none;
}

.settlement-table tbody tr.winner {
  background: rgba(46, 204, 113, 0.12);
}

.settlement-table tbody tr.loser {
  background: rgba(231, 76, 60, 0.12);
}

.settlement-table .col-nickname {
  font-weight: 600;
  color: #eee;
}

.settlement-table .col-change.positive {
  color: #2ecc71;
  font-weight: 600;
}

.settlement-table .col-change.negative {
  color: #e74c3c;
  font-weight: 600;
}

.settlement-table .col-chips {
  color: #ccc;
  font-variant-numeric: tabular-nums;
}

.settlement-mvp {
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd700, #ffb300);
  color: #1b1b2f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}

.settlement-log-wrap {
  text-align: left;
  margin-bottom: 20px;
  font-size: 13px;
}

.settlement-log-wrap summary {
  cursor: pointer;
  color: #aaa;
  padding: 6px 0;
  user-select: none;
}

.settlement-log-wrap[open] summary {
  margin-bottom: 8px;
}

#settlementList {
  margin-bottom: 0;
}

.settlement-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  min-width: 300px;
}

.settlement-item.winner {
  background: rgba(46, 204, 113, 0.2);
  border: 1px solid #2ecc71;
}

.settlement-item.loser {
  background: rgba(231, 76, 60, 0.2);
  border: 1px solid #e74c3c;
}

.settlement-nickname {
  font-size: 18px;
  font-weight: bold;
}

.settlement-amount {
  font-size: 20px;
  font-weight: bold;
}

.settlement-amount.positive {
  color: #2ecc71;
}

.settlement-amount.negative {
  color: #e74c3c;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

/* 响应式 - 手机端 */
@media (max-width: 768px) {
  .lobby-container {
    padding: 30px 20px;
    margin: 15px;
    width: 90%;
    max-width: 400px;
  }

  .title {
    font-size: 28px;
  }

  .subtitle {
    font-size: 14px;
    margin-bottom: 25px;
  }

  .input-group input,
  .join-form input {
    padding: 12px 15px;
    font-size: 14px;
  }

  .btn {
    padding: 12px 20px;
    font-size: 14px;
  }

  .poker-table {
    height: calc(100vh - 280px + 100px);
    margin-top: 100px;
    border-width: 8px;
    border-radius: 120px;
  }

  .seat {
    min-width: 70px;
    transform: translateY(110px) !important; /* 整体下移 110px（上移 30px），避免公牌挡住手牌 */
  }

  /* 手机竖屏下，按人体工程学重新摆放 5 个座位：
     - 自己（0号位）略上移，为底部手势和操作按钮留足空间
     - 其余 4 个座位均在屏幕四角附近，避免太靠边缘难以点击 */
  #seat-0 {
    bottom: 14% !important;
    transform: translate(-50%, 110px) !important;
  }

  #seat-1 {
    bottom: 25% !important;
    left: calc(8% - 20px) !important;
    transform: translateX(-20px) translateY(110px) !important;
  }

  #seat-2 {
    top: 8% !important;
    left: calc(8% - 20px) !important;
    transform: translateX(-20px) translateY(110px) !important;
  }

  #seat-3 {
    top: 8% !important;
    right: calc(8% - 20px) !important;
    transform: translateX(20px) translateY(110px) !important;
  }

  #seat-4 {
    bottom: 25% !important;
    right: calc(8% - 20px) !important;
    transform: translateX(20px) translateY(110px) !important;
  }

  .player-info {
    padding: 5px 8px;
  }

  .player-avatar {
    font-size: 20px;
    width: 30px;
    height: 30px;
  }

  .player-name {
    font-size: 11px;
  }

  .player-chips {
    font-size: 15px;
  }

  .card {
    width: 28px;
    height: 40px;
  }

  /* 小屏下我的手牌与公共牌保持 4:6 布局但整体缩小 */
  .card-my,
  .card-board {
    height: 54px;
    width: auto;
  }

  .card-my .card-rank-main,
  .card-board .card-rank-main {
    font-size: 26px;
  }

  .card-my .card-suit-main,
  .card-board .card-suit-main {
    font-size: 18px;
  }

  /* 其他玩家手牌在小屏上进一步缩小 */
  .seat .player-cards .card:not(.card-my):not(.card-board) .card-rank-main {
    font-size: 14px;
  }

  .seat .player-cards .card:not(.card-my):not(.card-board) .card-suit-main {
    font-size: 10px;
  }

  .pot-display {
    padding: 8px 15px;
  }

  .pot-icon {
    width: 20px;
    height: 20px;
  }

  .pot-amount {
    font-size: 18px;
  }

  .action-panel {
    padding: 12px 8px;
    gap: 10px;
  }

  .action-info {
    font-size: 14px;
  }

  .action-buttons {
    gap: 8px;
  }

  .action-buttons .btn {
    min-width: 60px;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .raise-option {
    min-width: 64px;
    padding: 8px 10px;
    font-size: 12px;
  }
  .raise-option:nth-child(1) { transform: rotate(-30deg); }
  .raise-option:nth-child(2) { transform: rotate(-10deg); }
  .raise-option:nth-child(3) { transform: rotate(10deg); }
  .raise-option:nth-child(4) { transform: rotate(30deg); }

  .modal-content {
    padding: 25px 20px;
    width: 90%;
    max-width: 350px;
  }

  .modal-content h2 {
    font-size: 24px;
  }

  .settlement-modal {
    padding: 20px 16px;
    max-width: 96%;
  }

  .settlement-title {
    font-size: 20px;
  }

  .settlement-subtitle {
    font-size: 12px;
  }

  .settlement-table th,
  .settlement-table td {
    padding: 8px 10px;
    font-size: 13px;
  }

  .settlement-item {
    min-width: auto;
    padding: 10px 15px;
  }

  .settlement-nickname {
    font-size: 14px;
  }

  .settlement-amount {
    font-size: 16px;
  }

  .leave-room-fixed {
    padding: 6px 12px;
    font-size: 11px;
    min-height: 44px;
  }

  .game-room-top {
    top: 8px;
    left: 8px;
    gap: 8px;
  }

  .room-code-fixed {
    font-size: 14px;
  }

  .room-code-fixed .room-code-value {
    font-size: 16px;
  }
}

/* 更小屏幕 */
@media (max-width: 400px) {
  .title {
    font-size: 24px;
  }

  .poker-table {
    border-radius: 80px;
  }

  .card {
    width: 24px;
    height: 35px;
  }

  /* 更小屏幕下也维持我的手牌与公共牌高度 60px（如有需要再单独调优） */
  .card-my,
  .card-board {
    height: 60px;
    width: auto;
  }

  /* 更小屏下牌面数字与花色，确保不重叠 */
  .card-my .suit,
  .card-board .suit {
    font-size: 10px;
  }

  .card-my .rank,
  .card-board .rank {
    font-size: 10px;
    line-height: 1;
  }

  .card-my .suit.top-left,
  .card-board .suit.top-left {
    top: 1px;
    left: 1px;
  }

  .card-my .suit.bottom-right,
  .card-board .suit.bottom-right {
    bottom: 1px;
    right: 1px;
  }

  /* 仅其他玩家小牌缩小，手牌/公共牌不适用 */
  .card:not(.card-my):not(.card-board) .rank {
    font-size: 6px;
    line-height: 1;
  }

  .card:not(.card-my):not(.card-board) .suit {
    font-size: 6px;
  }

  .card:not(.card-my):not(.card-board) .suit.top-left {
    top: 0;
    left: 0;
  }

  .card:not(.card-my):not(.card-board) .suit.bottom-right {
    bottom: 0;
    right: 0;
  }

  .action-buttons .btn {
    min-width: 55px;
    min-height: 44px;
    padding: 8px 10px;
    font-size: 11px;
  }

  .game-room-top {
    left: 6px;
  }
}

/* 倒计时样式 */
.action-timer {
  display: none;
  margin-left: 15px;
}

/* 黄色圆圈倒计时已去掉，不再展示 */
.action-timer:not(.hidden) {
  display: none !important;
}

.timer-ring {
  position: relative;
  width: 40px;
  height: 40px;
}

.timer-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.timer-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 3;
}

.timer-progress {
  fill: none;
  stroke: #ffd700;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  font-weight: bold;
  color: #ffd700;
}

/* 手机端牌面不重叠 */
@media (max-width: 768px) {
  .poker-table {
    transform: translateY(-150px);
    margin-bottom: 150px;
  }

  .player-cards {
    gap: 2px;
    min-height: 35px;
  }

  .community-cards {
    gap: 4px;
  }

  #myCards {
    gap: 2px;
  }

  .seat .player-cards .card {
    width: 24px;
    height: 34px;
  }

  #myCards .card {
    width: 28px;
    height: 40px;
  }

  /* 手机端下我的手牌和公共牌使用与基础高度 60px 保持一致 */
  #myCards .card.card-my {
    height: 60px;
    width: auto;
  }
  .community-cards .card.card-board {
    height: 60px;
    width: auto;
  }

  /* 牌面内容不溢出、数字与花色不重叠 */
  #myCards .card.card-my,
  .community-cards .card.card-board {
    overflow: hidden;
  }
}

.emoji-btn {
  font-size: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.emoji-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.emoji-btn:active:not(:disabled) {
  transform: scale(0.88);
  transition: transform 0.06s ease;
}

.emoji-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.emoji-btn:disabled:hover {
  transform: none;
}

/* 表情显示 */
.emoji-display {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

.emoji-popup {
  position: absolute;
  font-size: 48px;
  animation: emojiFloat 1s ease-out forwards;
  pointer-events: none;
}

@keyframes emojiFloat {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(0);
  }
  20% {
    opacity: 1;
    transform: scale(1.2) translateY(-10px);
  }
  60% {
    opacity: 1;
    transform: scale(1) translateY(-18px);
  }
  100% {
    opacity: 0;
    transform: scale(0.85) translateY(-28px);
  }
}

/* 房主标识 */
.host-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 16px;
}

/* 点击其他玩家头像：操作弹层（点赞/鄙视/踢出） */
.avatar-action-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 600;
  pointer-events: auto;
}
.avatar-action-backdrop.hidden {
  display: none !important;
}
.avatar-action-popup {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(20% + env(safe-area-inset-bottom, 0));
  min-width: 180px;
  max-width: min(280px, 85vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(180deg, #2a2a3e 0%, #1e1e2d 100%);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08);
  z-index: 601;
  pointer-events: auto;
}
.avatar-action-popup.hidden {
  display: none !important;
}
.avatar-action-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.avatar-action-header-avatar {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  font-size: 24px;
}
.avatar-action-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.avatar-action-header-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.avatar-action-header-winrate {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}
.avatar-action-header-winrate.hidden {
  display: none !important;
}

.avatar-action-header-net,
.avatar-action-header-style {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.78);
}
.avatar-action-header-net.positive {
  color: #fde68a;
  font-weight: 600;
}
.avatar-action-header-net.negative {
  color: #fb7185;
  font-weight: 600;
}
.avatar-action-header-net.hidden,
.avatar-action-header-style.hidden {
  display: none !important;
}
.avatar-action-btn {
  min-height: 48px;
  padding: 12px 20px;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s, opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.avatar-action-btn:active {
  transform: scale(0.97);
}
.avatar-action-like {
  background: linear-gradient(135deg, #51cf66 0%, #40c057 100%);
  color: #fff;
}
.avatar-action-dislike {
  background: linear-gradient(135deg, #ff6b6b 0%, #fa5252 100%);
  color: #fff;
}
.avatar-action-kick {
  background: linear-gradient(135deg, #495057 0%, #343a40 100%);
  color: #fff;
}
@media (max-width: 768px) {
  .avatar-action-popup {
    bottom: calc(18% + env(safe-area-inset-bottom, 0));
    min-width: 160px;
    padding: 12px;
    gap: 8px;
  }
  .avatar-action-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 15px;
  }
}

/* 表情弹窗面板 */
.emoji-popup-panel {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  z-index: 100;
}

.emoji-popup-panel .emoji-btn {
  font-size: 18px;
  padding: 5px;
}

/* 互动短语气泡容器 */
.phrase-bubble-container {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1001;
}

.phrase-bubble-popup {
  position: absolute;
  max-width: min(85vw, 260px);
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  animation: phraseBubbleIn 0.25s ease-out forwards;
  pointer-events: none;
}

.phrase-bubble-popup::before {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: rgba(0, 0, 0, 0.85);
}

@keyframes phraseBubbleIn {
  0% { opacity: 0; transform: translateX(-50%) scale(0.9); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}

.phrase-bubble-popup.fade-out {
  animation: phraseBubbleOut 0.3s ease-in forwards;
}

@keyframes phraseBubbleOut {
  0% { opacity: 1; transform: translateX(-50%) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) scale(0.95); }
}

/* 右下角短语按钮（上移 60px） */
.phrase-bubble-btn {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #5c6bc0, #3949ab);
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
/* 左下角亮牌按钮：风格与高度与短语一致 */
.show-cards-btn {
  right: auto;
  left: 20px;
}

.phrase-bubble-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}
.phrase-bubble-btn:active {
  transform: scale(0.90);
  transition: transform 0.06s ease;
}

.phrase-bubble-btn.hidden {
  display: none;
}

/* 短语面板（在短语按钮上方） */
.phrase-panel {
  position: fixed;
  bottom: 140px;
  right: 20px;
  width: 280px;
  max-height: 70vh;
  background: rgba(30, 30, 40, 0.98);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 101;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.phrase-panel.hidden {
  display: none;
}

.phrase-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.phrase-panel-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
}

.phrase-panel-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 22px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.phrase-panel-target {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.phrase-panel-target label {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
}

.phrase-panel-target select {
  flex: 1;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 13px;
}

.phrase-tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  flex-wrap: wrap;
}

.phrase-tab {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
  font-size: 12px;
  cursor: pointer;
}

.phrase-tab.active {
  background: #5c6bc0;
  color: #fff;
}

.phrase-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.phrase-list-scroll {
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  max-height: 50vh;
}

.phrase-item-btn {
  padding: 10px 12px;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.phrase-item-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}
.phrase-item-btn:active {
  transform: scale(0.95);
  transition: transform 0.06s ease;
}

/* 长按短语轮盘 */
.phrase-wheel {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  padding: 12px;
  background: rgba(30, 30, 40, 0.98);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 102;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 60vh;
  overflow-y: auto;
}

.phrase-wheel.hidden {
  display: none;
}

.phrase-wheel .phrase-item-btn {
  white-space: nowrap;
}

.btn-info {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  color: #fff;
}

.btn-copy {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 5px;
}

.btn-copy:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* 游戏状态高亮 */
#gameStatus {
  transition: all 0.3s ease;
  padding: 5px 15px;
  border-radius: 5px;
}

/* 座位高亮动画 */
.seat.my-seat .player-info,
.seat.other-seat .player-info {
  transition: all 0.3s ease;
}

.seat.my-seat .player-info {
  box-shadow: 0 0 22px rgba(74, 222, 128, 0.95);
  border: 2px solid #4ade80;
}

.seat.other-seat .player-info {
  box-shadow: 0 0 18px rgba(76, 175, 80, 0.8);
  border: 2px solid #4caf50;
}

/* 空座位半透明 */
.seat.empty.in-game {
  opacity: 0.4;
}

/* 可访问性 - 屏幕阅读器专用 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 键盘导航焦点样式 */
*:focus {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #ffd700;
  outline-offset: 2px;
}

/* 按钮焦点动画 */
.btn:focus-visible {
  animation: focusPulse 0.5s ease-in-out;
}

@keyframes focusPulse {
  0%, 100% { box-shadow: 0 0 0 2px #ffd700; }
  50% { box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.5); }
}

/* 输入框焦点样式 */
input:focus {
  border-color: #ffd700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* AI建议按钮样式 */
#ai-assist-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  border: none;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  -webkit-tap-highlight-color: transparent;
}

#ai-assist-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #818cf8, #6366f1);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

#ai-assist-btn:active:not(:disabled) {
  transform: scale(0.92);
  transition: transform 0.06s ease;
}

#ai-assist-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #666;
  box-shadow: none;
}

#ai-assist-btn.loading {
  pointer-events: none;
}

#ai-assist-btn .ai-icon {
  font-size: 18px;
}

/* AI 建议面板样式已移除 */

/* 响应式调整 */
@media (max-width: 768px) {
  #ai-assist-btn {
    padding: 10px 15px;
    font-size: 12px;
  }
  
  /* AI 建议面板响应式样式已移除 */
}

/* 玩家行动飘字 */
.action-float {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  animation: actionFloatUp 2s ease-out forwards;
}
.action-float-fold  { color: #ff6b6b; }
.action-float-check { color: #51cf66; }
.action-float-call  { color: #ffd43b; }
.action-float-raise { color: #ff922b; }
.action-float-all-in {
  /* ALL IN + 金额使用高亮黄色，提升可读性 */
  color: #ffd43b;
  font-size: 16px;
  text-shadow:
    0 0 8px rgba(255, 212, 59, 0.8),
    0 1px 4px rgba(0, 0, 0, 0.8);
}
.action-float-small-blind { color: #74c0fc; }
.action-float-big-blind   { color: #a9e34b; }

@keyframes actionFloatUp {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(-30px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-45px); }
}

/* 托管/取消托管 飘字（操作面板上方） */
.pending-float {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 2px rgba(0,0,0,0.9), 0 0 8px rgba(255,255,255,0.6);
  white-space: nowrap;
  pointer-events: none;
  z-index: 200;
  animation: pendingFloatUp 2s ease-out forwards;
}
@keyframes pendingFloatUp {
  0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; transform: translateX(-50%) translateY(-24px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-40px); }
}
