/* 打怪游戏样式文件 */

/* 按钮样式 */
.monster-battle-button {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
  margin-left: 10px;
}

.monster-battle-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.monster-battle-button:active {
  transform: translateY(0);
}

/* 游戏模态框 - 修改为默认可见 */
.battle-modal {
  display: flex !important;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  font-family: 'Arial', sans-serif;
}

.battle-modal-content {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 15px;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

/* 模态框头部 */
.battle-modal-header {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #e74c3c;
}

.battle-modal-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
}

.battle-modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.battle-modal-close:hover {
  transform: rotate(90deg);
}

/* 标签页导航 */
.battle-tabs {
  display: flex;
  background: linear-gradient(135deg, #3498db, #2980b9);
  border-bottom: 2px solid #3498db;
}

.battle-tab {
  padding: 15px 20px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  font-weight: bold;
  border-bottom: 3px solid transparent;
}

.battle-tab:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.battle-tab.active {
  background-color: rgba(255, 255, 255, 0.2);
  border-bottom: 3px solid #f39c12;
}

/* 标签页内容 */
.battle-tab-content {
  padding: 20px;
  color: #ecf0f1;
  overflow-y: auto;
  flex: 1;
}

.battle-tab-panel {
  display: none;
}

.battle-tab-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 玩家信息面板 */
.player-info {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
}

.player-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.stat-item {
  background: rgba(255, 255, 255, 0.2);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

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

/* 战斗区域 */
.battle-area {
  background: linear-gradient(135deg, #7f8c8d, #95a5a6);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  min-height: 300px;
  position: relative;
  overflow: hidden;
}

.monster-container {
  text-align: center;
  margin: 20px 0;
}

.monster-display {
  font-size: 60px;
  margin-bottom: 10px;
}

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

.monster-stats {
  background: rgba(255, 255, 255, 0.2);
  padding: 10px;
  border-radius: 8px;
  display: inline-block;
}

/* 生命值和魔法值条 */
.health-bar, .mana-bar {
  width: 100%;
  height: 20px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin: 5px 0;
  overflow: hidden;
}

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

.mana-fill {
  height: 100%;
  background: linear-gradient(90deg, #3498db, #2980b9);
  transition: width 0.3s ease;
}

/* 战斗控制按钮 */
.battle-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.battle-button {
  padding: 15px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
}

.attack-button {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.skill-button {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.potion-button {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.escape-button {
  background: linear-gradient(135deg, #7f8c8d, #95a5a6);
}

.battle-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.battle-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 战斗日志 */
.battle-log {
  background: rgba(0, 0, 0, 0.7);
  padding: 15px;
  border-radius: 10px;
  max-height: 150px;
  overflow-y: auto;
  margin-top: 20px;
}

.log-entry {
  margin: 5px 0;
  font-size: 14px;
  animation: slideIn 0.3s ease;
}

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

.log-player {
  color: #3498db;
}

.log-monster {
  color: #e74c3c;
}

.log-system {
  color: #f39c12;
}

/* 背包样式 */
.inventory-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.item-slot {
  background: linear-gradient(135deg, #34495e, #2c3e50);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.item-slot:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.item-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.item-name {
  font-size: 14px;
  color: #ecf0f1;
  margin: 5px 0;
}

.item-rarity-common { color: #95a5a6; }
.item-rarity-uncommon { color: #27ae60; }
.item-rarity-rare { color: #3498db; }
.item-rarity-epic { color: #9b59b6; }
.item-rarity-legendary { color: #f39c12; }
.item-rarity-mythic { color: #e74c3c; }

.item-count {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #e74c3c;
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 装备栏 */
.equipment-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.equipment-slot {
  background: linear-gradient(135deg, #16a085, #1abc9c);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
}

.equipment-type {
  font-size: 14px;
  color: #ecf0f1;
  margin-bottom: 10px;
}

.equipment-content {
  background: rgba(255, 255, 255, 0.2);
  padding: 10px;
  border-radius: 8px;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 技能列表 */
.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.skill-card {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
  padding: 15px;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.skill-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.skill-type-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 15px;
  font-size: 12px;
  margin-bottom: 10px;
}

.skill-type-active { background: #3498db; }
.skill-type-passive { background: #27ae60; }
.skill-type-ultimate { background: #e74c3c; }

/* 商店样式 */
.shop-filter {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-button {
  padding: 8px 15px;
  border: none;
  border-radius: 20px;
  background: linear-gradient(135deg, #7f8c8d, #95a5a6);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
}

.filter-button:hover, .filter-button.active {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

.shop-item {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  padding: 15px;
  border-radius: 10px;
  text-align: center;
  transition: all 0.3s ease;
}

.shop-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.buy-button {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.buy-button:hover { background: linear-gradient(135deg, #229954, #27ae60); }
.buy-button:disabled { opacity: 0.6; cursor: not-allowed; }

/* 爬塔样式 */
.tower-progress {
  background: linear-gradient(135deg, #3498db, #2980b9);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  text-align: center;
}

.tower-levels {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.tower-level {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.tower-level-locked {
  background: #7f8c8d;
  color: #34495e;
  cursor: not-allowed;
}

.tower-level-completed {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
}

.tower-level-current {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

/* 竞技场样式 */
.pvp-opponents {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  margin-top: 20px;
}

.opponent-card {
  background: linear-gradient(135deg, #e67e22, #d35400);
  padding: 15px;
  border-radius: 10px;
  transition: all 0.3s ease;
}

.opponent-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.challenge-button {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s ease;
}

.challenge-button:hover { background: linear-gradient(135deg, #c0392b, #a93226); }
.challenge-button:disabled { opacity: 0.6; cursor: not-allowed; }

.online-status {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
}

.status-online { background: #2ecc71; }
.status-offline { background: #e74c3c; }

/* 排行榜样式 */
.leaderboard-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.leaderboard-table th, .leaderboard-table td {
  padding: 12px 15px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table th { background: rgba(52, 152, 219, 0.3); }
.leaderboard-table tr:hover { background: rgba(255, 255, 255, 0.05); }

.rank-1 { background: linear-gradient(135deg, #f1c40f, #f39c12); }
.rank-2 { background: linear-gradient(135deg, #95a5a6, #7f8c8d); }
.rank-3 { background: linear-gradient(135deg, #e67e22, #d35400); }

/* 转生样式 */
.rebirth-container {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  margin-top: 20px;
}

.rebirth-requirements {
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

.requirements-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.requirements-list li {
  margin: 10px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.requirement-met { color: #2ecc71; }
.requirement-unmet { color: #e74c3c; }

.rebirth-button {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  padding: 15px 30px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.rebirth-button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
.rebirth-button:disabled { opacity: 0.6; cursor: not-allowed; }

/* 自动战斗控件 */
.auto-battle-controls {
  background: linear-gradient(135deg, #34495e, #2c3e50);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.auto-battle-toggle {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auto-battle-toggle.active {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
}

/* 消息通知 */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 10px;
  color: white;
  font-weight: bold;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  animation: slideInRight 0.3s ease, fadeOut 0.5s ease 3s forwards;
  z-index: 1001;
}

.notification-success { background: linear-gradient(135deg, #27ae60, #2ecc71); }
.notification-error { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.notification-info { background: linear-gradient(135deg, #3498db, #2980b9); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* 响应式设计 */
@media (max-width: 768px) {
  .battle-modal-content {
    width: 95%;
    height: 95vh;
  }
  
  .battle-tabs {
    overflow-x: auto;
  }
  
  .battle-tab {
    min-width: 100px;
  }
  
  .player-stats,
  .battle-controls {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 加载动画 */
.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 体力系统 */
.stamina-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stamina-bar {
  flex: 1;
  height: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
}

.stamina-fill {
  height: 100%;
  background: linear-gradient(90deg, #f1c40f, #f39c12);
  transition: width 0.3s ease;
}

.stamina-recovery {
  font-size: 12px;
  color: #f39c12;
}