/* ========== 德州撲克 — 牌桌樣式 ========== */

/* ===== 牌桌容器 ===== */
.poker-table-wrap {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, #0d3320 0%, #0a1a12 60%, #050d0a 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 綠絨桌面（橢圓） */
.poker-felt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 85%;
  max-width: 600px;
  aspect-ratio: 1.8;
  border-radius: 50%;
  background: radial-gradient(ellipse, #1a5c38 0%, #145230 50%, #0e3d22 100%);
  border: 4px solid #2a7a4a;
  box-shadow:
    0 0 40px rgba(0, 0, 0, 0.6),
    inset 0 0 60px rgba(0, 0, 0, 0.3),
    0 0 15px rgba(42, 122, 74, 0.3);
}

/* ===== 座位 ===== */
.poker-seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 10;
  transition: all 0.3s;
}

.poker-seat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--text-muted);
  transition: all 0.3s;
}

.poker-seat.occupied .poker-seat-avatar {
  background: linear-gradient(135deg, var(--purple-mid), var(--blue-mid));
  border-color: var(--cyan-neon);
  color: #fff;
}

.poker-seat.active-turn .poker-seat-avatar {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.6);
  animation: pulseGlow 1.5s infinite;
}

.poker-seat.folded {
  opacity: 0.4;
}

.poker-seat-name {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.poker-seat-chips {
  font-size: 10px;
  color: var(--gold);
  font-weight: 700;
  text-shadow: 0 0 6px rgba(251, 191, 36, 0.3);
}

.poker-seat-action {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  animation: fadeIn 0.3s;
}

.action-fold { background: rgba(239, 68, 68, 0.3); color: #f87171; }
.action-check { background: rgba(34, 197, 94, 0.3); color: #22c55e; }
.action-call { background: rgba(59, 130, 246, 0.3); color: #60a5fa; }
.action-raise { background: rgba(251, 191, 36, 0.3); color: var(--gold); }
.action-allin { background: rgba(255, 45, 149, 0.3); color: var(--pink-neon); border: 1px solid var(--pink-neon); }

/* 莊家按鈕 */
.dealer-btn {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fde68a, #fbbf24);
  color: #1a0a2e;
  font-size: 10px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
  z-index: 11;
}

/* ===== 撲克牌 ===== */
.poker-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 60px;
  border-radius: 6px;
  background: #fff;
  color: #000;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.poker-card.red { color: #dc2626; }
.poker-card.black { color: #1a1a2e; }

.poker-card-rank {
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.poker-card-suit {
  font-size: 14px;
  line-height: 1;
  margin-top: 1px;
}

.poker-card.face-down {
  background: linear-gradient(135deg, #1e3a5f, #2d5a8e);
  border: 2px solid #4a8ac7;
  color: transparent;
}

.poker-card.face-down::after {
  content: '🂠';
  font-size: 28px;
  position: absolute;
}

.poker-card-sm {
  width: 32px;
  height: 46px;
  font-size: 11px;
  border-radius: 4px;
}

.poker-card-sm .poker-card-rank { font-size: 10px; }
.poker-card-sm .poker-card-suit { font-size: 11px; }

/* 公共牌區 */
.community-cards {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  display: flex;
  gap: 6px;
  z-index: 15;
}

/* 底池顯示 */
.pot-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 30%);
  z-index: 15;
  text-align: center;
}

.pot-amount {
  font-size: 16px;
  font-weight: 900;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.pot-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===== 自己的手牌區 ===== */
.my-hole-cards {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 20;
}

.my-hole-cards .poker-card {
  width: 54px;
  height: 78px;
  font-size: 18px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.my-hole-cards .poker-card-rank { font-size: 17px; }
.my-hole-cards .poker-card-suit { font-size: 18px; }

/* ===== 操作面板 ===== */
.poker-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  z-index: 25;
}

.poker-action-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 70px;
}

.poker-action-btn:active { transform: scale(0.94); }

.poker-action-btn.fold {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.poker-action-btn.check {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.poker-action-btn.call {
  background: linear-gradient(135deg, #1d4ed8, #3b82f6);
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.poker-action-btn.raise {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: #1a0a2e;
  box-shadow: var(--glow-gold);
}

.poker-action-btn.allin {
  background: linear-gradient(135deg, #be185d, var(--pink-neon));
  color: #fff;
  box-shadow: var(--glow-pink);
}

/* 加注滑桿 */
.raise-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 200px;
}

.raise-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.raise-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}

.raise-amount-display {
  font-size: 14px;
  font-weight: 800;
  color: var(--gold);
  min-width: 50px;
  text-align: center;
}

/* ===== 計時器 ===== */
.turn-timer {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.turn-timer-bar {
  height: 100%;
  border-radius: 2px;
  background: var(--cyan-neon);
  transition: width 0.5s linear;
}

.turn-timer-bar.warning { background: var(--gold); }
.turn-timer-bar.danger { background: var(--danger); }

/* ===== 頂部資訊列 ===== */
.poker-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
}

.poker-hud-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.poker-hud-blinds {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.poker-hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 動畫 ===== */
@keyframes dealCard {
  from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  to { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes chipSlide {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-deal { animation: dealCard 0.4s ease-out; }
.animate-chip { animation: chipSlide 0.3s ease-out; }
