* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  color: #e8e8e8;
  overflow-x: hidden;
}

.game-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 顶部信息栏 */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-stats {
  display: flex;
  gap: 30px;
  align-items: center;
}

.stat {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.stat-icon {
  font-size: 24px;
}

.stat-value {
  font-weight: bold;
  font-size: 20px;
}

.health .stat-value { color: #ff6b6b; }
.shield .stat-value { color: #74b9ff; }
.energy .stat-value { color: #ffeaa7; }

/* 元素栏 */
.elements-bar {
  display: flex;
  gap: 15px;
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-wrap: wrap;
  justify-content: center;
}

.element-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  min-width: 80px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.element-item:hover {
  transform: translateY(-2px);
}

.element-item.fire { border-color: rgba(255, 107, 107, 0.3); }
.element-item.water { border-color: rgba(116, 185, 255, 0.3); }
.element-item.thunder { border-color: rgba(255, 234, 167, 0.3); }
.element-item.earth { border-color: rgba(129, 199, 132, 0.3); }
.element-item.poison { border-color: rgba(186, 104, 200, 0.3); }

.element-item.activatable {
  animation: pulse 1.5s infinite;
  box-shadow: 0 0 15px currentColor;
}

.element-item.used {
  opacity: 0.5;
  cursor: not-allowed;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.element-icon {
  font-size: 28px;
}

.element-name {
  font-size: 12px;
  color: #aaa;
}

.element-value {
  font-size: 18px;
  font-weight: bold;
}

.fire .element-value { color: #ff6b6b; }
.water .element-value { color: #74b9ff; }
.thunder .element-value { color: #ffeaa7; }
.earth .element-value { color: #81c784; }
.poison .element-value { color: #ba68c8; }

/* 主战斗区域 */
.battle-area {
  display: flex;
  gap: 20px;
  flex: 1;
  margin-bottom: 20px;
}

/* 敌人区域 */
.enemy-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.enemy-container {
  text-align: center;
}

.enemy-sprite {
  font-size: 100px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 20px rgba(255, 100, 100, 0.5));
  transition: all 0.3s ease;
}

.enemy-sprite.damaged {
  animation: shake 0.5s ease;
  filter: drop-shadow(0 0 30px rgba(255, 0, 0, 0.8));
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  75% { transform: translateX(10px); }
}

.enemy-name {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
  color: #ff6b6b;
}

.enemy-health-bar {
  width: 200px;
  height: 20px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 10px;
  overflow: hidden;
  margin: 10px auto;
  border: 2px solid #333;
}

.enemy-health-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff4757, #ff6b81);
  transition: width 0.3s ease;
}

.enemy-health-text {
  font-size: 16px;
  color: #ff6b6b;
}

.enemy-intent {
  margin-top: 15px;
  padding: 10px 20px;
  background: rgba(255, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 14px;
  color: #ff6b6b;
}

.enemy-statuses {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: bold;
}

.status-burning {
  background: rgba(255, 107, 107, 0.3);
  color: #ff6b6b;
}

.status-poison {
  background: rgba(186, 104, 200, 0.3);
  color: #ba68c8;
}

.status-weak {
  background: rgba(255, 234, 167, 0.3);
  color: #ffeaa7;
}

.status-vulnerable {
  background: rgba(255, 165, 0, 0.3);
  color: #ffa500;
}

/* 战斗日志 */
.log-section {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.log-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #74b9ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.log-content {
  flex: 1;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.6;
}

.log-entry {
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.log-damage { color: #ff6b6b; }
.log-heal { color: #81c784; }
.log-shield { color: #74b9ff; }
.log-element { color: #ba68c8; }
.log-turn { color: #ffeaa7; font-weight: bold; }

/* 手牌区域 */
.hand-section {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.hand-title {
  font-size: 18px;
  font-weight: bold;
  color: #74b9ff;
}

.deck-info {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: #aaa;
}

.hand-cards {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  min-height: 220px;
}

/* 卡牌样式 */
.card {
  width: 180px;
  background: linear-gradient(145deg, #2d2d44 0%, #1a1a2e 100%);
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.card.fire::before { background: linear-gradient(90deg, #ff6b6b, #ff8e8e); }
.card.water::before { background: linear-gradient(90deg, #74b9ff, #a4d4ff); }
.card.thunder::before { background: linear-gradient(90deg, #ffeaa7, #fff5cc); }
.card.earth::before { background: linear-gradient(90deg, #81c784, #a5d6a7); }
.card.poison::before { background: linear-gradient(90deg, #ba68c8, #ce93d8); }

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.card.playable {
  border-color: rgba(129, 199, 132, 0.5);
  box-shadow: 0 0 15px rgba(129, 199, 132, 0.3);
}

.card.unplayable {
  opacity: 0.6;
  cursor: not-allowed;
}

.card.unplayable:hover {
  transform: none;
}

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

.card-name {
  font-size: 14px;
  font-weight: bold;
  color: #fff;
}

.card-cost {
  width: 28px;
  height: 28px;
  background: linear-gradient(145deg, #ffeaa7, #fdcb6e);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  color: #1a1a2e;
}

.card-element {
  font-size: 32px;
  text-align: center;
  margin: 10px 0;
}

.card-effects {
  font-size: 11px;
  line-height: 1.5;
}

.card-play-effect {
  color: #81c784;
  margin-bottom: 8px;
  padding: 5px;
  background: rgba(129, 199, 132, 0.1);
  border-radius: 4px;
}

.card-discard-effect {
  color: #ba68c8;
  padding: 5px;
  background: rgba(186, 104, 200, 0.1);
  border-radius: 4px;
}

/* 按钮区域 */
.action-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

.btn {
  padding: 12px 30px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-end-turn {
  background: linear-gradient(145deg, #ff6b6b, #ee5a5a);
  color: white;
}

.btn-end-turn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.btn-restart {
  background: linear-gradient(145deg, #74b9ff, #5ba0e6);
  color: white;
}

.btn-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(116, 185, 255, 0.4);
}

/* 模态框 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(145deg, #2d2d44 0%, #1a1a2e 100%);
  border-radius: 16px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
  font-size: 24px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 20px;
  color: #ffeaa7;
}

.modal-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-option {
  padding: 15px 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.modal-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 234, 167, 0.5);
  transform: translateX(5px);
}

.modal-cancel {
  margin-top: 15px;
  text-align: center;
}

.modal-cancel-btn {
  background: transparent;
  border: 1px solid #666;
  color: #aaa;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modal-cancel-btn:hover {
  border-color: #ff6b6b;
  color: #ff6b6b;
}

/* 游戏结束 */
.game-over-modal .modal-content {
  text-align: center;
}

.game-over-title {
  font-size: 36px;
  margin-bottom: 20px;
}

.game-over-title.victory {
  color: #81c784;
}

.game-over-title.defeat {
  color: #ff6b6b;
}

/* 浮动伤害数字 */
.floating-number {
  position: fixed;
  font-size: 24px;
  font-weight: bold;
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
  z-index: 100;
}

.floating-damage { color: #ff6b6b; }
.floating-heal { color: #81c784; }
.floating-shield { color: #74b9ff; }

@keyframes floatUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1.5);
  }
}

/* 玩家状态 */
.player-statuses {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 响应式 */
@media (max-width: 900px) {
  .battle-area {
    flex-direction: column;
  }

  .card {
    width: 160px;
  }

  .player-stats {
    flex-wrap: wrap;
    gap: 10px;
  }
}
