/* ============================================================
   全局 & 重置
============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --table-green: #2a7a3b;
  --table-dark: #1a5228;
  --felt-border: #8b5a2b;
  --card-bg: #fff;
  --card-red: #c0392b;
  --card-black: #1a1a2e;
  --chip-gold: #f1c40f;
  --btn-primary: #e67e22;
  --overlay-bg: rgba(0,0,0,0.75);
  --text-light: #f0f0f0;
  --text-gold: #f1c40f;
}

html, body {
  width: 100%; height: 100%;
  font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #0d1117;
  color: var(--text-light);
  overflow: hidden;
  user-select: none;
}

/* ============================================================
   屏幕管理
============================================================ */
.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; flex-direction: column; }

/* ============================================================
   大厅
============================================================ */
.lobby-bg {
  flex: 1;
  background: radial-gradient(ellipse at center, #1a3a2a 0%, #0d1f16 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}

.lobby-container {
  display: flex; flex-direction: column; align-items: center;
  gap: 16px; max-width: 440px; width: 100%;
}

.game-title {
  font-size: 2.8rem; font-weight: 900;
  background: linear-gradient(135deg, #f1c40f, #e67e22, #f1c40f);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 2px; text-align: center;
  animation: title-glow 3s ease-in-out infinite;
}
@keyframes title-glow {
  0%,100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}

.profile-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; padding: 14px 20px;
  display: flex; align-items: center; gap: 14px; width: 100%;
}
.avatar { font-size: 2.4rem; }
.profile-name {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 4px;
  outline: none; border-bottom: 1px dashed rgba(255,255,255,0.3);
  min-width: 40px; cursor: text;
}
.profile-name:focus { border-bottom-color: var(--chip-gold); }
.chips-row { font-size: 1rem; color: var(--chip-gold); font-weight: 600; }

/* 每日奖励 */
.daily-bonus {
  background: linear-gradient(135deg, #1a5c2a, #27ae60);
  border: 2px solid #2ecc71; border-radius: 14px;
  padding: 12px 18px; width: 100%;
  animation: pulse-border 1.5s infinite;
}
@keyframes pulse-border {
  0%,100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(46,204,113,0); }
}
.bonus-content { display: flex; align-items: center; gap: 12px; }
.bonus-icon { font-size: 1.8rem; }
.bonus-title { font-weight: 700; font-size: 0.9rem; }
.bonus-amount { color: var(--chip-gold); font-size: 1.1rem; font-weight: 800; }
.btn-bonus {
  margin-left: auto; padding: 7px 14px;
  background: var(--chip-gold); color: #1a1a1a;
  border: none; border-radius: 8px; font-weight: 800;
  cursor: pointer; font-size: 0.85rem;
  transition: transform 0.1s;
}
.btn-bonus:hover { transform: scale(1.05); }

/* 统计 */
.stats-row { display: flex; gap: 12px; width: 100%; }
.stat-item {
  background: rgba(255,255,255,0.06); border-radius: 12px;
  padding: 12px; text-align: center; flex: 1;
}
.stat-val { font-size: 1.4rem; font-weight: 800; color: var(--chip-gold); }
.stat-label { font-size: 0.75rem; color: #aaa; margin-top: 2px; }

/* 对手数量选择 */
.player-count-row {
  width: 100%; background: rgba(255,255,255,0.05);
  border-radius: 14px; padding: 14px 18px;
}
.player-count-label {
  font-size: 0.85rem; color: #bbb; margin-bottom: 10px; font-weight: 600;
}
.player-count-btns { display: flex; gap: 8px; }
.btn-count {
  flex: 1; padding: 8px 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; color: #ccc;
  cursor: pointer; font-size: 0.85rem; font-weight: 600;
  transition: all 0.15s;
}
.btn-count:hover { background: rgba(255,255,255,0.15); color: #fff; }
.btn-count.active {
  background: linear-gradient(135deg, #e67e22, #d35400);
  border-color: #e67e22; color: #fff;
  box-shadow: 0 2px 10px rgba(230,126,34,0.4);
}

/* 大厅按钮 */
.lobby-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.btn-primary {
  width: 100%; padding: 15px;
  background: linear-gradient(135deg, #e67e22, #d35400);
  color: white; border: none; border-radius: 12px;
  font-size: 1.1rem; font-weight: 800; cursor: pointer;
  letter-spacing: 1px;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(230,126,34,0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(230,126,34,0.6); }
.btn-primary:active { transform: translateY(0); }
.btn-multi {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg, #2980b9, #1a6693);
  color: white; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(41,128,185,0.3);
}
.btn-multi:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(41,128,185,0.5); }
.btn-secondary {
  padding: 12px 24px;
  background: rgba(255,255,255,0.1);
  color: white; border: 1px solid rgba(255,255,255,0.25);
  border-radius: 10px; font-size: 0.95rem; cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.2); }
.game-rules-hint { font-size: 0.78rem; color: #888; text-align: center; }

/* ============================================================
   游戏界面
============================================================ */
#screen-game { background: #0a1a10; display: none; flex-direction: column; }
#screen-game.active { display: flex; }

.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 44px; z-index: 10; flex-shrink: 0;
}
.btn-small {
  padding: 6px 12px; background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 8px;
  color: white; cursor: pointer; font-size: 0.82rem;
  transition: background 0.2s;
}
.btn-small:hover { background: rgba(255,255,255,0.2); }
.hand-info { font-size: 0.88rem; color: #aaa; display: flex; align-items: center; gap: 8px; }
.multi-badge {
  background: linear-gradient(135deg, #2980b9, #1a6693);
  border-radius: 10px; padding: 2px 8px;
  font-size: 0.72rem; color: #fff; font-weight: 700;
}
.top-chips { color: var(--chip-gold); font-weight: 700; font-size: 0.92rem; }

/* 游戏主区域：牌桌 + 历史侧边栏 */
.game-main {
  flex: 1; display: flex; min-height: 0; position: relative;
}

/* ============================================================
   牌桌
============================================================ */
.table-area {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 8px; min-height: 0;
}

.poker-table {
  position: relative;
  width: min(700px, 96vw);
  height: min(420px, 52vw);
  /* Pokerist 风格：浅蓝毡面 */
  background:
    radial-gradient(ellipse 85% 85% at 50% 52%,
      #7ab8d4 0%, #5898b8 40%, #3d7a9e 75%, #2a5e80 100%);
  border-radius: 50%;
  border: 14px solid #6b8fa8;
  box-shadow:
    0 0 0 5px #3d5a6e,
    0 0 0 8px #2a3f50,
    0 0 50px rgba(0,0,0,0.8),
    inset 0 4px 20px rgba(255,255,255,0.12),
    inset 0 -4px 20px rgba(0,0,0,0.2);
  transition: box-shadow 0.3s;
}
/* 桌面品牌水印 */
.poker-table::before {
  content: '';
  position: absolute; inset: 12%;
  border: 2px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  pointer-events: none;
}
/* 胜利光效 */
.poker-table.win-glow {
  box-shadow:
    0 0 0 5px #3d5a6e,
    0 0 0 8px #2a3f50,
    0 0 60px rgba(241,196,15,0.5),
    0 0 100px rgba(241,196,15,0.2);
}

/* ============================================================
   座位系统
============================================================ */
.seat {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
}
.seat.hidden { display: none !important; }
.seat-inner {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  position: relative;
}

/* 固定位置 */
.seat-bottom {
  bottom: -6px; left: 50%;
  transform: translateX(-50%) translateY(50%);
}
.seat-top {
  top: -6px; left: 50%;
  transform: translateX(-50%) translateY(-50%);
}
.seat-left {
  left: -6px; top: 50%;
  transform: translateY(-50%) translateX(-50%);
}
.seat-right {
  right: -6px; top: 50%;
  transform: translateY(-50%) translateX(50%);
}
.seat-bl {
  bottom: 12%; left: 8%;
  transform: translateX(-50%) translateY(50%);
}
.seat-br {
  bottom: 12%; right: 8%;
  transform: translateX(50%) translateY(50%);
}
.seat-tl {
  top: 12%; left: 8%;
  transform: translateX(-50%) translateY(-50%);
}
.seat-tr {
  top: 12%; right: 8%;
  transform: translateX(50%) translateY(-50%);
}

/* 玩家信息盒（Pokerist 深色卡片风格） */
.player-info-box {
  background: linear-gradient(180deg, rgba(10,25,40,0.92), rgba(5,15,28,0.96));
  border: 1.5px solid rgba(80,130,170,0.4);
  border-radius: 10px; padding: 5px 14px;
  text-align: center; min-width: 92px;
  backdrop-filter: blur(6px);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
.player-name { font-size: 0.8rem; font-weight: 800; color: #f0f0f0; }
.player-chips-box {
  font-size: 0.75rem; color: var(--chip-gold); font-weight: 700;
  margin-top: 1px;
}

/* 当前行动高亮 */
.seat.active-turn .player-info-box {
  border-color: #f1c40f;
  box-shadow: 0 0 14px rgba(241,196,15,0.7);
  animation: active-glow 0.8s ease-in-out infinite alternate;
}
@keyframes active-glow {
  from { box-shadow: 0 0 6px rgba(241,196,15,0.4); }
  to   { box-shadow: 0 0 20px rgba(241,196,15,0.95); }
}

/* 弃牌 / all-in 状态 */
.seat.folded .player-cards { opacity: 0.3; filter: grayscale(1); }
.seat.folded .player-info-box { opacity: 0.45; }
.seat.all-in .player-info-box { border-color: #9b59b6; }

/* ============================================================
   扑克牌
============================================================ */
.player-cards { display: flex; gap: 4px; justify-content: center; }

/* 标准牌 */
.card {
  width: 38px; height: 54px;
  background: var(--card-bg);
  border-radius: 6px;
  border: 1px solid #ccc;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 900;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  position: relative; line-height: 1;
  transition: transform 0.15s;
}
.card:hover { transform: translateY(-4px); }
.card.red   { color: var(--card-red); }
.card.black { color: var(--card-black); }
.card .rank { font-size: 0.88rem; font-weight: 900; line-height: 1; }
.card .suit { font-size: 1.05rem; line-height: 1; }

/* 背面 */
.card.face-down {
  background: linear-gradient(135deg, #1a237e 0%, #283593 50%, #1a237e 100%);
  border-color: #3949ab;
}
.card.face-down::after {
  content: '🂠'; font-size: 1.5rem;
  color: rgba(255,255,255,0.25); position: absolute;
}

/* 3D 翻牌包装 */
.card-3d-wrap {
  display: inline-block;
  perspective: 600px;
  width: 38px; height: 54px;
}
.card-3d-inner {
  width: 100%; height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.55s ease;
}
.card-3d-inner.revealed { transform: rotateY(180deg); }
.card-3d-front, .card-3d-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 6px;
}
.card-3d-back {
  transform: rotateY(180deg);
}

/* 公共牌 */
.community-cards {
  display: flex; gap: 6px; justify-content: center; min-height: 62px;
}
.community-cards .card {
  width: 44px; height: 62px;
}
.community-cards .card .rank { font-size: 0.95rem; }
.community-cards .card .suit { font-size: 1.15rem; }
.community-cards .card-3d-wrap {
  width: 44px; height: 62px;
}

/* 发牌动画：从中心飞出 */
@keyframes deal-from-deck {
  0%   { opacity: 0; transform: translate(0,0) scale(0.3) rotate(-5deg); }
  100% { opacity: 1; transform: translate(0,0) scale(1) rotate(0deg); }
}
.card.dealing {
  animation: deal-from-deck 0.32s cubic-bezier(.22,.68,0,1.2) forwards;
}
.card-3d-wrap.dealing {
  animation: deal-from-deck 0.32s cubic-bezier(.22,.68,0,1.2) forwards;
}

/* 公共牌翻牌效果 */
@keyframes flip-community {
  0%   { transform: rotateY(90deg) scale(0.85); opacity: 0; }
  100% { transform: rotateY(0deg)  scale(1);    opacity: 1; }
}
.community-cards .card.flip-in {
  animation: flip-community 0.35s ease-out forwards;
}

/* 胜利卡高亮 */
@keyframes card-win-pulse {
  0%,100% { box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
  50%      { box-shadow: 0 0 20px rgba(241,196,15,0.8); }
}
.card.winner-card {
  animation: card-win-pulse 1s ease-in-out infinite;
}

/* 中央区域 */
.center-area {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center;
}
.pot-display {
  background: rgba(0,0,0,0.65);
  border: 1px solid rgba(241,196,15,0.45);
  border-radius: 20px; padding: 4px 16px;
  color: var(--chip-gold); font-weight: 700; font-size: 0.88rem;
  transition: transform 0.2s;
}
.pot-display.pot-grow {
  animation: pot-grow 0.3s ease;
}
@keyframes pot-grow {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.phase-label {
  font-size: 0.72rem; color: rgba(255,255,255,0.45);
  letter-spacing: 1px; text-transform: uppercase;
}

/* 下注标签 */
.player-bet-label {
  font-size: 0.72rem; color: var(--chip-gold);
  background: rgba(0,0,0,0.6);
  border-radius: 10px; padding: 2px 8px; min-height: 18px;
}

/* 徽章 */
.player-badges { display: flex; gap: 3px; justify-content: center; }
.badge {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.58rem; font-weight: 900;
}
.badge-d  { background: #f1c40f; color: #000; }
.badge-sb { background: #3498db; color: #fff; }
.badge-bb { background: #e74c3c; color: #fff; }
.badge-allin { background: #9b59b6; color: #fff; font-size: 0.5rem; }

/* 思考指示器 */
.thinking-indicator {
  font-size: 1.1rem;
  animation: think-bounce 0.55s ease-in-out infinite alternate;
}
@keyframes think-bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-5px); }
}

/* 手牌名称标签 */
.hand-name-label {
  font-size: 0.68rem; color: #7ec8e3;
  background: rgba(0,0,0,0.55); border-radius: 6px;
  padding: 2px 8px; min-height: 16px;
  transition: all 0.3s;
}

/* ============================================================
   筹码粒子动画
============================================================ */
.chip-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 20;
  overflow: hidden; border-radius: 50%;
}
@keyframes chip-float-up {
  0%   { transform: translate(-50%,-50%) scale(1); opacity: 1; }
  80%  { opacity: 0.8; }
  100% { transform: translate(-50%,-150%) scale(0.4) rotate(180deg); opacity: 0; }
}
.chip-particle {
  position: absolute;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5d060, #e6a817 50%, #c98b10);
  border: 2px solid #f5d060;
  font-size: 10px; text-align: center; line-height: 18px; color: #7a4a00;
  font-weight: 900;
  animation: chip-float-up 1.2s ease-out forwards;
  pointer-events: none;
}

/* ============================================================
   消息日志
============================================================ */
.message-log {
  height: 52px; overflow-y: auto;
  background: rgba(0,0,0,0.42);
  border-top: 1px solid rgba(255,255,255,0.07);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  padding: 4px 12px;
  display: flex; flex-direction: column-reverse;
  flex-shrink: 0;
}
.message-log::-webkit-scrollbar { width: 3px; }
.message-log::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }
.log-entry { font-size: 0.76rem; color: #ccc; padding: 1px 0; line-height: 1.4; }
.log-entry.highlight { color: var(--chip-gold); font-weight: 700; }

/* ============================================================
   操作面板（Pokerist 风格）
============================================================ */
.action-panel {
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,10,20,0.95) 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  padding: 0;
}
.action-panel.hidden { display: none !important; }

.action-info-bar {
  text-align: center; padding: 5px 0 0;
}
.action-info-text {
  font-size: 0.8rem; color: rgba(255,255,255,0.55);
}

/* 5 个按钮行 */
.action-btns-row {
  display: flex; gap: 0; align-items: stretch; height: 62px;
}

/* Lucky Combo 触发按钮 */
.btn-lc {
  min-width: 52px; max-width: 52px;
  background: linear-gradient(180deg, #1a2a3a, #0f1e2d);
  border: none; border-right: 1px solid rgba(255,255,255,0.1);
  color: var(--chip-gold); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 6px;
  transition: background 0.15s;
}
.btn-lc:hover { background: linear-gradient(180deg, #243a4e, #162838); }
.lc-icon { font-size: 1.4rem; }
.lc-label { font-size: 0.62rem; color: rgba(255,255,255,0.6); }

/* 通用行动按钮 */
.btn-ab {
  flex: 1; border: none; cursor: pointer;
  font-size: 0.92rem; font-weight: 800;
  letter-spacing: 0.5px; color: #fff;
  border-right: 1px solid rgba(0,0,0,0.25);
  transition: filter 0.1s, transform 0.1s;
  line-height: 1.3;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
}
.btn-ab:hover  { filter: brightness(1.15); }
.btn-ab:active { transform: scale(0.97); filter: brightness(0.95); }
.btn-ab small  { font-size: 0.65rem; font-weight: 600; opacity: 0.85; }
.btn-ab:last-child { border-right: none; }

/* 盖牌（红） */
.btn-ab-fold {
  background: linear-gradient(180deg, #d63031, #a52828);
}
/* 让牌/盖牌（暗蓝） */
.btn-ab-cf {
  background: linear-gradient(180deg, #2d6a8a, #1e4d66);
}
/* 让牌 / 跟注（青绿） */
.btn-ab-call {
  background: linear-gradient(180deg, #00b5a3, #008a7a);
}
/* 加注（明亮蓝绿） */
.btn-ab-raise {
  background: linear-gradient(180deg, #0097a7, #006d7a);
}
.btn-ab.disabled {
  filter: grayscale(0.5) opacity(0.5);
  cursor: not-allowed;
}

/* ── 加注滑块面板 ─────────────────────────────────────────── */
.raise-panel {
  background: linear-gradient(180deg, rgba(0,30,50,0.97), rgba(0,20,35,0.99));
  border-top: 1px solid rgba(0,180,160,0.3);
  padding: 10px 16px 8px;
  flex-shrink: 0;
}
.raise-panel.hidden { display: none; }
.raise-panel-inner { display: flex; flex-direction: column; gap: 8px; }
.raise-panel-row { display: flex; justify-content: space-between; align-items: center; }
.raise-panel-label { font-size: 0.8rem; color: rgba(255,255,255,0.6); }
.raise-panel-value {
  font-size: 1.1rem; font-weight: 900; color: var(--chip-gold);
}
.raise-slider-full {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 8px;
  background: linear-gradient(to right, #00b5a3 0%, rgba(255,255,255,0.15) 0%);
  border-radius: 4px; outline: none; cursor: pointer;
}
.raise-slider-full::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle, #ffe066, var(--chip-gold));
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.3);
}
.raise-quick-btns {
  display: flex; gap: 6px;
}
.btn-quick-raise {
  flex: 1; padding: 5px 4px;
  background: rgba(0,181,163,0.18);
  border: 1px solid rgba(0,181,163,0.4);
  border-radius: 6px; color: #00d4be; cursor: pointer;
  font-size: 0.72rem; font-weight: 700;
  transition: background 0.15s;
}
.btn-quick-raise:hover { background: rgba(0,181,163,0.35); }
.raise-confirm-row {
  display: flex; gap: 8px; margin-top: 4px;
}
.btn-raise-cancel {
  flex: 1; padding: 7px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; color: #aaa; cursor: pointer;
  font-size: 0.82rem; font-weight: 700;
  transition: background 0.15s;
}
.btn-raise-cancel:hover { background: rgba(255,255,255,0.15); }
.btn-raise-confirm {
  flex: 2; padding: 7px;
  background: linear-gradient(135deg, #00b5a3, #007a6e);
  border: none; border-radius: 8px; color: #fff; cursor: pointer;
  font-size: 0.88rem; font-weight: 800;
  transition: filter 0.15s;
}
.btn-raise-confirm:hover { filter: brightness(1.15); }

/* (keep old range input styles for elsewhere) */
input[type=range]:not(.raise-slider-full) {
  -webkit-appearance: none; appearance: none;
  width: 130px; height: 6px;
  background: rgba(255,255,255,0.2); border-radius: 3px;
  outline: none; cursor: pointer;
}
input[type=range]:not(.raise-slider-full)::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--chip-gold); cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* ============================================================
   Lucky Combo 牌型面板（从底部滑入）
============================================================ */
.lucky-combo-panel {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 80;
  background: linear-gradient(180deg, #0d2233 0%, #071626 100%);
  border-top: 2px solid rgba(0,181,163,0.5);
  border-radius: 18px 18px 0 0;
  transform: translateY(100%);
  transition: transform 0.42s cubic-bezier(0.22, 0.68, 0, 1.15);
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.6);
}
.lucky-combo-panel.open {
  transform: translateY(0);
}
.lucky-combo-panel::-webkit-scrollbar { width: 3px; }
.lucky-combo-panel::-webkit-scrollbar-thumb { background: rgba(0,181,163,0.4); border-radius: 2px; }

.lcp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0;
  background: linear-gradient(180deg, #0d2233, #0d2233);
  z-index: 1;
}
.lcp-title {
  font-size: 1rem; font-weight: 800; color: var(--chip-gold);
  letter-spacing: 1px;
}
.lcp-close {
  background: rgba(255,255,255,0.1); border: none; border-radius: 50%;
  width: 28px; height: 28px; color: #fff; cursor: pointer;
  font-size: 0.85rem; transition: background 0.15s;
}
.lcp-close:hover { background: rgba(255,255,255,0.25); }

.lcp-body { padding: 6px 12px 10px; }

.lcp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: background 0.15s; border-radius: 6px;
}
.lcp-row:hover { background: rgba(255,255,255,0.04); }
.lcp-row:last-child { border-bottom: none; }

.lcp-cards {
  display: flex; gap: 2px; flex-shrink: 0;
}
.lc-card {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border-radius: 4px;
  padding: 2px 4px; font-size: 0.7rem; font-weight: 900;
  border: 1px solid #ddd; min-width: 24px;
  line-height: 1.2; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.lc-card.red   { color: var(--card-red); }
.lc-card.black { color: var(--card-black); }

.lcp-name {
  flex: 1; font-size: 0.92rem; font-weight: 800; color: #e8e8e8;
}
.lcp-rank {
  font-size: 0.72rem; font-weight: 700; padding: 2px 8px;
  border-radius: 10px; white-space: nowrap; flex-shrink: 0;
}
.rank-9 { background: linear-gradient(135deg, #f1c40f, #e67e22); color: #000; }
.rank-8 { background: rgba(241,196,15,0.25); color: #f1c40f; }
.rank-7 { background: rgba(231,76,60,0.25); color: #e74c3c; }
.rank-6 { background: rgba(155,89,182,0.25); color: #9b59b6; }
.rank-5 { background: rgba(52,152,219,0.25); color: #3498db; }
.rank-4 { background: rgba(26,188,156,0.25); color: #1abc9c; }
.rank-3 { background: rgba(46,204,113,0.25); color: #2ecc71; }
.rank-2 { background: rgba(255,255,255,0.1); color: #bbb; }
.rank-1 { background: rgba(255,255,255,0.06); color: #888; }

.lcp-hint {
  text-align: center; padding: 10px; font-size: 0.78rem;
  color: rgba(255,255,255,0.4);
}

/* ============================================================
   历史侧边栏
============================================================ */
.history-sidebar {
  display: flex; flex-direction: row;
  background: rgba(0,0,0,0.85);
  border-left: 1px solid rgba(255,255,255,0.08);
  transition: width 0.3s ease;
  overflow: hidden;
  flex-shrink: 0;
  width: 36px;
}
.history-sidebar:not(.collapsed) {
  width: 220px;
}

.btn-history-toggle {
  min-width: 36px; width: 36px;
  background: rgba(255,255,255,0.04);
  border: none; border-right: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5); cursor: pointer;
  padding: 10px 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  transition: background 0.2s, color 0.2s;
}
.btn-history-toggle:hover { background: rgba(255,255,255,0.1); color: #fff; }
.toggle-arrow { font-size: 0.8rem; transition: transform 0.3s; }
.history-sidebar:not(.collapsed) .toggle-arrow { transform: rotate(180deg); }
.toggle-label { font-size: 0.65rem; line-height: 1.6; text-align: center; color: #aaa; }

.history-panel {
  flex: 1; overflow: hidden;
  display: flex; flex-direction: column;
}
.history-panel-title {
  padding: 10px 12px; font-size: 0.82rem; font-weight: 700;
  color: var(--chip-gold); border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.history-list {
  flex: 1; overflow-y: auto; padding: 6px 8px;
}
.history-list::-webkit-scrollbar { width: 3px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

/* 历史条目 */
.history-item {
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 8px 4px; font-size: 0.72rem;
  animation: fade-in-left 0.3s ease;
}
@keyframes fade-in-left {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
.history-hand-no {
  color: #888; font-size: 0.68rem; margin-bottom: 4px;
}
.history-community {
  display: flex; gap: 2px; flex-wrap: wrap; margin-bottom: 5px;
}
.h-card {
  display: inline-block;
  background: #fff; border-radius: 3px;
  padding: 1px 3px; font-size: 0.65rem; font-weight: 800;
  border: 1px solid #ccc; line-height: 1.3;
}
.h-card.red { color: var(--card-red); }
.h-card.black { color: var(--card-black); }
.history-players { display: flex; flex-direction: column; gap: 2px; }
.h-player { color: #bbb; font-size: 0.68rem; }
.h-player.h-winner { color: var(--chip-gold); font-weight: 700; }

/* ============================================================
   联网多人界面
============================================================ */
#screen-multi { background: #0d1117; }
.multi-bg {
  flex: 1;
  background: radial-gradient(ellipse at center, #1a2a3a 0%, #0d1520 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.multi-container {
  display: flex; flex-direction: column; align-items: center;
  gap: 18px; max-width: 440px; width: 100%;
}
.multi-title {
  font-size: 1.8rem; font-weight: 900;
  background: linear-gradient(135deg, #3498db, #2980b9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.multi-tabs {
  display: flex; gap: 0; width: 100%;
  background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.multi-tab {
  flex: 1; padding: 10px; border: none; background: transparent;
  color: #888; cursor: pointer; font-size: 0.9rem; font-weight: 600;
  transition: all 0.2s;
}
.multi-tab.active { background: rgba(52,152,219,0.3); color: #3498db; }
.multi-tab:hover:not(.active) { background: rgba(255,255,255,0.05); color: #ccc; }

.multi-panel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.multi-hint { font-size: 0.85rem; color: #888; text-align: center; line-height: 1.5; }

.room-code-display {
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(52,152,219,0.5);
  border-radius: 16px; padding: 20px 30px;
  text-align: center; width: 100%;
  animation: code-appear 0.4s ease;
}
@keyframes code-appear {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
.room-code-label { font-size: 0.78rem; color: #888; margin-bottom: 8px; }
.room-code-value {
  font-size: 2.2rem; font-weight: 900; letter-spacing: 6px;
  color: #3498db; font-family: monospace;
}
.btn-copy-code {
  margin-top: 10px; padding: 6px 16px;
  background: rgba(52,152,219,0.2); border: 1px solid rgba(52,152,219,0.5);
  border-radius: 8px; color: #3498db; cursor: pointer; font-size: 0.8rem;
  transition: all 0.2s;
}
.btn-copy-code:hover { background: rgba(52,152,219,0.35); }

.room-code-input {
  width: 100%; padding: 14px 18px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.2); border-radius: 12px;
  color: #fff; font-size: 1.4rem; font-weight: 800;
  text-align: center; letter-spacing: 4px; font-family: monospace;
  outline: none; transition: border-color 0.2s;
}
.room-code-input:focus { border-color: #3498db; }
.room-code-input::placeholder { font-size: 0.9rem; letter-spacing: 1px; color: #555; font-weight: 400; }
.btn-multi-action {
  max-width: 260px;
}

.multi-waiting { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.waiting-title {
  font-size: 1.2rem; font-weight: 800; color: #3498db;
  animation: pulse-text 1.5s ease-in-out infinite alternate;
}
@keyframes pulse-text {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}
.multi-players-list {
  width: 100%; background: rgba(255,255,255,0.04);
  border-radius: 12px; padding: 10px; min-height: 60px;
  border: 1px solid rgba(255,255,255,0.08);
}
.multi-player-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  transition: background 0.2s;
}
.multi-player-row:hover { background: rgba(255,255,255,0.04); }
.multi-player-avatar { font-size: 1.4rem; }
.multi-player-name { font-weight: 700; font-size: 0.9rem; }
.multi-player-host { font-size: 0.7rem; color: var(--chip-gold); margin-left: 4px; }
.multi-player-seat { font-size: 0.72rem; color: #888; margin-left: auto; }
.waiting-hint { font-size: 0.82rem; color: #888; text-align: center; }

/* ── 加入房间进度条 ───────────────────────────────────────── */
.join-progress {
  width: 100%; margin-top: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.join-progress.hidden { display: none; }

.jp-steps {
  display: flex; align-items: center; gap: 0; width: 100%; max-width: 320px;
}
.jp-step {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.jp-step span {
  font-size: 0.62rem; color: rgba(255,255,255,0.4);
  white-space: nowrap; transition: color 0.3s;
}
.jp-step.active span   { color: #00d4be; }
.jp-step.done   span   { color: rgba(255,255,255,0.7); }

.jp-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.2);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.jp-step.active .jp-dot {
  background: #00d4be;
  border-color: #00d4be;
  transform: scale(1.25);
  box-shadow: 0 0 10px rgba(0,212,190,0.6);
  animation: jp-pulse 0.9s ease-in-out infinite;
}
.jp-step.done .jp-dot {
  background: #00b5a3;
  border-color: #00b5a3;
}
@keyframes jp-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(0,212,190,0.6); }
  50%       { box-shadow: 0 0 14px rgba(0,212,190,1); }
}

.jp-line {
  flex: 1; height: 2px;
  background: rgba(255,255,255,0.1);
  position: relative; overflow: hidden;
}
.jp-line::after {
  content: '';
  position: absolute; top: 0; left: 0; bottom: 0;
  width: 0; background: #00b5a3;
  transition: width 0.4s ease;
}
.jp-line.fill::after { width: 100%; }

.jp-bar-wrap {
  width: 100%; max-width: 320px; height: 6px;
  background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden;
}
.jp-bar {
  height: 100%; width: 0; border-radius: 3px;
  background: linear-gradient(90deg, #00b5a3, #00d4be);
  transition: width 0.4s ease;
}

.jp-status {
  font-size: 0.78rem; color: rgba(255,255,255,0.55);
  min-height: 1.2em; text-align: center;
}
.multi-status {
  font-size: 0.82rem; color: #3498db; text-align: center;
  min-height: 20px;
}

/* ============================================================
   结算弹窗
============================================================ */
.overlay {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; backdrop-filter: blur(4px);
}
.overlay.hidden { display: none; }

.result-modal {
  background: linear-gradient(135deg, #1a2f20, #0d1f14);
  border: 2px solid rgba(241,196,15,0.4);
  border-radius: 20px; padding: 28px 34px;
  text-align: center; max-width: 380px; width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
  animation: modal-in 0.3s ease-out;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.result-icon { font-size: 3rem; margin-bottom: 8px; }
.result-title { font-size: 1.8rem; font-weight: 900; margin-bottom: 8px; }
.result-title.win  { color: var(--chip-gold); }
.result-title.lose { color: #e74c3c; }
.result-title.tie  { color: #3498db; }
.result-message { color: #aaa; font-size: 0.9rem; margin-bottom: 12px; }
.result-hands {
  background: rgba(255,255,255,0.05); border-radius: 10px;
  padding: 10px; margin-bottom: 16px; font-size: 0.82rem;
  text-align: left; color: #ccc;
  max-height: 120px; overflow-y: auto;
}
.result-hand-row { padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,0.07); }
.result-hand-row:last-child { border-bottom: none; }
.result-winner-row { color: var(--chip-gold); font-weight: 700; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.result-actions .btn-primary { width: auto; padding: 12px 26px; font-size: 0.95rem; }

/* ============================================================
   庆祝粒子
============================================================ */
#confetti-layer {
  position: fixed; inset: 0; pointer-events: none; z-index: 200; overflow: hidden;
}
@keyframes confetti-fall {
  0%   { transform: translateY(-10px) rotate(0deg) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg) scale(0.5); opacity: 0; }
}
.confetti-piece {
  position: absolute; top: -20px;
  animation: confetti-fall linear forwards;
  border-radius: 2px;
}

/* ============================================================
   音乐按钮
============================================================ */
.btn-music-toggle {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 999;
  padding: 7px 13px; border-radius: 20px; border: none;
  background: rgba(20,15,40,0.88); color: #ffd700;
  font-size: 0.8rem; cursor: pointer;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  transition: background 0.2s, transform 0.1s;
}
.btn-music-toggle:hover { background: rgba(30,25,55,0.95); transform: translateX(-50%) scale(1.05); }
.btn-music-toggle.music-on { color: #4eff91; }

/* ============================================================
   响应式
============================================================ */
@media (max-width: 540px) {
  .game-title { font-size: 2rem; }
  .poker-table { width: 98vw; height: 60vw; border-width: 8px; }
  .card { width: 30px; height: 44px; }
  .card .rank { font-size: 0.72rem; }
  .card .suit { font-size: 0.85rem; }
  .community-cards .card { width: 36px; height: 52px; }
  .card-3d-wrap { width: 30px; height: 44px; }
  .community-cards .card-3d-wrap { width: 36px; height: 52px; }
  .btn-action { padding: 8px 12px; font-size: 0.88rem; min-width: 70px; }
  input[type=range] { width: 90px; }
  .history-sidebar { display: none; }
}
