:root {
  --bg-felt: #0c1c14;
  --bg-dark: #08110c;
  --gold-primary: #d4af37;
  --gold-glow: rgba(212, 175, 55, 0.35);
  --green-accent: #10b981;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-gold: rgba(212, 175, 55, 0.3);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Noto Serif SC", serif;
  background: radial-gradient(circle at center, #153023 0%, var(--bg-felt) 60%, var(--bg-dark) 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.poker-table {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-gold);
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-badge {
  display: inline-block;
  font-size: 12px;
  color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--border-gold);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.brand-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #fff;
}

.hud-metrics {
  display: flex;
  gap: 16px;
}

.hud-item {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.hud-item .lbl { font-size: 11px; color: var(--text-muted); }
.hud-item .val { font-size: 14px; font-weight: 600; }
.hud-item .val.gold { color: var(--gold-primary); }
.hud-item .val.green { color: var(--green-accent); }

.table-felt {
  background: radial-gradient(ellipse at center, rgba(16, 185, 129, 0.08) 0%, rgba(0, 0, 0, 0.6) 100%);
  border: 2px solid var(--border-gold);
  border-radius: 20px;
  padding: 30px;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.8), 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 30px;
  flex: 1;
}

.dealer-tray {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.deck-stack {
  position: relative;
  width: 90px;
  height: 120px;
  cursor: pointer;
  perspective: 600px;
}

.deck-card {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1e3a29 0%, #0d2316 100%);
  border: 1px solid var(--gold-primary);
  border-radius: 8px;
}
.deck-card.c1 { transform: translateY(4px) rotate(-2deg); opacity: 0.7; }
.deck-card.c2 { transform: translateY(2px) rotate(1deg); opacity: 0.85; }
.deck-card.c3 { transform: translateY(0); }
.deck-top {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2a4d37 0%, #152c1e 100%);
  border: 2px solid var(--gold-primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  color: var(--gold-primary);
  font-size: 12px;
  font-weight: bold;
}

.table-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.poker-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.poker-btn:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-2px); }
.poker-btn.primary { background: linear-gradient(135deg, #059669 0%, #047857 100%); border-color: #10b981; }
.poker-btn.primary:hover { box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4); }
.poker-btn.accent { background: linear-gradient(135deg, #b45309 0%, #92400e 100%); border-color: var(--gold-primary); }

/* 3D 舞台与卡牌 */
.cards-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  perspective: 1200px;
  min-height: 280px;
  flex-wrap: wrap;
  padding: 10px 0;
}

.card-3d-wrapper {
  width: 170px;
  height: 250px;
  cursor: pointer;
  position: relative;
  transition: transform 0.3s ease;
}
.card-3d-wrapper:hover {
  transform: translateY(-10px) scale(1.03);
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
}

.card-3d-wrapper.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* 卡牌正面 (中医病机/经方) */
.card-front {
  background: linear-gradient(145deg, #1d2922 0%, #111a14 100%);
  border: 2px solid var(--gold-primary);
  color: #fff;
}
.card-header-suit {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.suit-badge {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-primary);
}
.suit-name {
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 4px;
}
.card-center-tcm {
  text-align: center;
  margin: auto 0;
}
.tcm-main-symptom {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px;
}
.tcm-pathology {
  font-size: 12px;
  color: var(--gold-primary);
}
.card-footer-formula {
  font-size: 11px;
  color: var(--green-accent);
  text-align: right;
  border-top: 1px dashed rgba(255,255,255,0.1);
  padding-top: 6px;
}

/* 卡牌背面 (典雅八卦/国风纹样) */
.card-back {
  background: radial-gradient(circle at center, #1b3a29 0%, #0a1710 100%);
  border: 2px solid var(--gold-primary);
  transform: rotateY(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.back-pattern {
  width: 80%;
  height: 80%;
  border: 1px dashed var(--gold-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  color: var(--gold-primary);
  font-size: 28px;
}
.back-pattern span { font-size: 11px; letter-spacing: 2px; }

/* 底部辨证大成面板 */
.diagnosis-panel {
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 16px 20px;
}
.diag-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.diag-tag { font-size: 13px; color: var(--gold-primary); font-weight: 600; }
.diag-score { font-size: 14px; color: var(--green-accent); font-weight: bold; }
.diag-detail { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.toast-box {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}
.toast {
  background: rgba(16, 28, 20, 0.95);
  border: 1px solid var(--gold-primary);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
