'use strict';
/* ========================================
   跑得快游戏样式
   ======================================== */

.pdk-table {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  min-height: 600px;
  position: relative;
  padding: 16px;
  box-sizing: border-box;
}

/* 对手区域 */
.pdk-opponent {
  position: absolute;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.pdk-opponent-top {
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
}

.pdk-opponent-left {
  top: 120px;
  left: 10px;
  flex-direction: column;
  align-items: flex-start;
}

.pdk-player-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  padding: 4px 12px;
}

.pdk-player-name {
  color: #FFD700;
  font-size: 14px;
  font-weight: 600;
}

.pdk-card-count {
  color: #aaa;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 1px 6px;
}

.pdk-played-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 4px;
  min-height: 30px;
}

/* 出牌区 */
.pdk-center {
  position: absolute;
  top: 180px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdk-last-play {
  text-align: center;
}

.pdk-played-label {
  color: #888;
  font-size: 12px;
  margin-bottom: 4px;
}

.pdk-played-row {
  display: flex;
  gap: 2px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 手牌 */
.pdk-my-hand {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  overflow-x: auto;
  padding: 0 8px;
  box-sizing: border-box;
}

/* 卡牌 */
.pdk-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 56px;
  background-repeat: no-repeat;
  background-color: transparent;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  border: 1px solid #ccc;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.pdk-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.pdk-card.pdk-selected {
  transform: translateY(-20px);
  box-shadow: 0 6px 12px rgba(255,215,0,0.5);
  border-color: #FFD700;
  border-width: 2px;
}

.pdk-card-small {
  width: 32px;
  height: 44px;
  font-size: 11px;
  cursor: default;
}

.pdk-card-small:hover {
  transform: none;
}

/* 操作栏 */
.pdk-action-bar {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  justify-content: center;
}

.pdk-action-bar .btn {
  padding: 8px 24px;
  font-size: 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  min-width: 80px;
}

.pdk-action-bar .btn-gold {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #333;
}

.pdk-action-bar .btn-outline {
  background: transparent;
  border: 1px solid #888;
  color: #ccc;
}

.pdk-action-bar .btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 状态栏 */
.pdk-status-bar {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #aaa;
  font-size: 13px;
  text-align: center;
  width: 100%;
}

/* 结果弹窗 */
.pdk-result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.pdk-result-card {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 16px;
  padding: 32px 48px;
  text-align: center;
  border: 2px solid #FFD700;
  max-width: 400px;
}

.pdk-result-card.win {
  border-color: #2ecc71;
}

.pdk-result-card.lose {
  border-color: #e74c3c;
}

.pdk-result-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.pdk-result-card.win .pdk-result-title {
  color: #2ecc71;
}

.pdk-result-card.lose .pdk-result-title {
  color: #e74c3c;
}

.pdk-result-score {
  font-size: 36px;
  font-weight: 700;
  color: #FFD700;
  margin: 12px 0;
}

.pdk-result-detail {
  color: #aaa;
  font-size: 14px;
  line-height: 1.8;
  margin: 16px 0;
}

.pdk-result-detail div {
  margin: 4px 0;
}
