/**
 * 分步发牌动画 Engine 专属 CSS
 */

.setup-controls-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.player-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn-player {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-player:hover {
  border-color: var(--accent-cyan);
  color: var(--text-main);
}

.btn-player.active {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ctrl {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-ctrl:hover:not(:disabled) {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

.btn-ctrl.btn-primary {
  background: var(--accent-cyan);
  color: #0F172A;
  border-color: var(--accent-cyan);
  font-weight: 700;
}

.step-indicator {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 0.85rem;
  color: var(--accent-cyan);
  font-weight: 700;
  min-width: 140px;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(15, 23, 42, 0.8);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-gold));
  transition: width 0.3s ease;
}

/* 步骤说明 Banner (紧凑) */
.step-banner {
  background: rgba(56, 189, 248, 0.08);
  border: 1px dashed var(--accent-cyan);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 10px;
}

.step-banner h3 {
  font-size: 0.98rem;
  color: var(--accent-cyan);
  margin-bottom: 2px;
}

.step-banner p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 极客沙盘视图 (左右双栏并列 Layout) */
.sandbox-board {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 14px;
  flex-wrap: wrap;
}

.public-zone {
  flex: 3;
  min-width: 660px;
}

.personal-zone {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
}

.board-zone {
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  transition: all 0.3s ease;
}

.board-zone.active-zone {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
}

.zone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.personal-zone .zone-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.trainer-tag {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--accent-gold);
  padding: 2px 8px;
  border-radius: 6px;
  display: inline-block;
}

.zone-badge {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.zone-subinfo {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* 传说 & 稀有卡牌 Row */
.special-cards-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
}

.special-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.special-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}

.tag-rare {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
}

.tag-legendary {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  border: 1px solid var(--accent-purple);
}

.pokemon-card.rare-card {
  border: 2px solid var(--accent-gold);
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.2), rgba(15, 23, 42, 0.9));
}

.pokemon-card.leg-card {
  border: 2px solid var(--accent-purple);
  background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.2), rgba(15, 23, 42, 0.9));
}

.card-must-wild {
  font-size: 0.72rem;
  color: var(--accent-purple);
  font-weight: 700;
}

.card-bonus-tag {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-align: center;
  background: rgba(15, 23, 42, 0.8);
  padding: 2px 4px;
  border-radius: 4px;
}

.face-down-cards-box {
  height: 40px;
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}

.ghost-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.row-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
  width: 80px;
}

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

.legendary-tile {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--accent-gold);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 130px;
  transition: all 0.3s ease;
}

.ghost {
  opacity: 0.2;
  filter: grayscale(1);
}

.tile-avatar {
  font-size: 1.5rem;
}

.tile-info {
  display: flex;
  flex-direction: column;
}

.tile-name {
  font-size: 0.85rem;
  font-weight: 700;
}

.tile-pts {
  font-size: 0.78rem;
  color: var(--accent-gold);
  font-weight: 700;
}

/* 卡牌阵 Grid */
.card-market-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}

.special-cards-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.deck-stack-spacer {
  width: 120px;
  height: 140px;
  flex-shrink: 0;
  box-sizing: border-box;
  visibility: hidden;
  pointer-events: none;
}

.pokemon-card {
  width: 120px;
  height: 140px;
  flex-shrink: 0;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card-market-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.empty-card-placeholder {
  width: 120px;
  height: 140px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.2);
}

.placeholder-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 视频原版桌面 Layout */
.public-board-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
}

.public-cards-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 右侧：精灵球筹码塔 (垂直堆叠) */
.public-tokens-col {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed var(--border-color);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 90px;
}

.col-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}

.tokens-vertical-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.token-stack-vertical-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* 牌堆真实背面 Design */
.deck-stack {
  width: 120px;
  height: 140px;
  flex-shrink: 0;
  box-sizing: border-box;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s ease;
  border: 3px solid #FFFFFF;
}

.deck-stack::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  right: -3px;
  bottom: -3px;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.7);
  background: rgba(15, 23, 42, 0.6);
  z-index: -1;
  pointer-events: none;
}

.deck-stack::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  right: -6px;
  bottom: -6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(15, 23, 42, 0.4);
  z-index: -2;
  pointer-events: none;
}

.deck-stack:hover {
  transform: translateY(-4px);
}

.deck-logo {
  font-size: 0.75rem;
  font-weight: 800;
  color: #FFF;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  letter-spacing: 1px;
}

.deck-dots {
  font-size: 1.1rem;
  color: #FFF;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.6);
}

/* 匹配原版物理照片背面颜色 */
.deck-stack.lvl-1 {
  background: linear-gradient(135deg, #22C55E, #15803D);
}

.deck-stack.lvl-2 {
  background: linear-gradient(135deg, #F97316, #C2410C);
}

.deck-stack.lvl-3 {
  background: linear-gradient(135deg, #0284C7, #0369A1);
}

.deck-stack.lvl-rare {
  background: linear-gradient(135deg, #EC4899, #BE185D);
}

.deck-stack.lvl-leg {
  background: linear-gradient(135deg, #A855F7, #6B21A8);
}

.deck-badge {
  font-size: 1.2rem;
  font-weight: 800;
  color: #FFF;
}

.deck-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: #FFF;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.deck-rem-tag {
  font-size: 0.7rem;
  color: #FFF;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.special-deck-flex {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.special-pair {
  display: flex;
  gap: 12px;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  padding: 8px;
  border-radius: 10px;
  border: 1px dashed var(--border-color);
}

.market-cards {
  display: flex;
  gap: 12px;
  flex: 1;
  overflow-x: auto;
}

.pokemon-card {
  width: 120px;
  height: 140px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pokemon-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-pts {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.card-avatar {
  font-size: 2.2rem;
}

.card-name {
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 2px;
}

.card-cost {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.cost-badge {
  font-size: 0.72rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
}

.cost-fire { background: var(--c-fire); }
.cost-water { background: var(--c-water); }
.cost-grass { background: #334155; border: 1px solid #64748B; }
.cost-electric { background: var(--c-electric); }
.cost-psychic { background: var(--c-psychic); }
.cost-wild { background: #A855F7; border: 1px solid #C084FC; }

.pokemon-card.rare-card {
  border: 1.5px solid #EC4899;
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.25);
  background: rgba(236, 72, 153, 0.08);
}

.pokemon-card.leg-card {
  border: 1.5px solid #A855F7;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
  background: rgba(168, 85, 247, 0.08);
}

.card-must-wild {
  font-size: 0.65rem;
  color: #C084FC;
  font-weight: 700;
  background: rgba(168, 85, 247, 0.2);
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
}

.card-bonus-tag {
  font-size: 0.68rem;
  color: var(--accent-gold);
  font-weight: 700;
  text-align: center;
  margin-top: 2px;
}

/* 精灵球堆 */
.bank-tokens-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tokens-flex {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.token-stack-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.token-coin {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  border: 2px solid #FFF;
}

.token-fire { background: var(--c-fire); }
.token-water { background: var(--c-water); }
.token-grass { background: var(--c-grass); }
.token-electric { background: var(--c-electric); }
.token-psychic { background: var(--c-psychic); }
.token-wild { background: var(--c-wild); }

.token-count-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.token-name {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.trainer-tag {
  font-size: 0.78rem;
  color: var(--accent-gold);
  font-weight: 700;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--accent-gold);
}

/* 个人桌域 (右侧侧边栏 Dashboard) */
.personal-sidebar-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  justify-content: space-between;
}

.sidebar-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-vp-val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.vp-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(15, 23, 42, 0.9);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.vp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-gold), #FBBF24);
  transition: width 0.3s ease;
}

.card-subnote {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.captured-discount-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.panel-title {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}

.reserved-slots {
  display: flex;
  gap: 6px;
}

.empty-slot {
  flex: 1;
  height: 28px;
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.face-down-cards-box {
  height: 28px;
  border: 1px dashed var(--border-color);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
}

.ghost-text {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.held-token-slots {
  display: flex;
  gap: 4px;
  justify-content: space-between;
  padding: 4px 0;
}

.slot-circle {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.25);
  font-weight: bold;
}

.held-tokens-bar {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-tokens-text {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.captured-discount-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.discount-pill {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
}

.highlight-box {
  outline: 2px dashed var(--accent-cyan);
  outline-offset: 4px;
  border-radius: 8px;
}

/* 动画 Keyframes */
.animate-deal {
  animation: dealIn 0.4s ease-out forwards;
}

.animate-pop {
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-bounce {
  animation: bounceCoin 0.4s ease forwards;
}

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

@keyframes popIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes bounceCoin {
  0% { transform: translateY(-10px); }
  50% { transform: translateY(4px); }
  100% { transform: translateY(0); }
}
