/* ========== 方块拓荒者 - 游戏样式 ========== */

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

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

.game-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* 顶部状态栏 */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 15px 25px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-title {
  font-size: 24px;
  font-weight: bold;
  background: linear-gradient(90deg, #ffd700, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.resources-bar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.3);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s;
}

.resource-item:hover {
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.resource-item .icon {
  font-size: 18px;
}

.resource-item .amount {
  font-weight: bold;
  min-width: 50px;
  text-align: right;
}

.resource-item.rare {
  background: rgba(147, 112, 219, 0.3);
  border: 1px solid rgba(147, 112, 219, 0.5);
}

/* 主游戏区域 */
.main-content {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
}

@media (max-width: 900px) {
  .main-content {
    grid-template-columns: 1fr;
  }
}

/* 探索区域 */
.explore-section {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.section-title {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.area-selector {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.area-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 13px;
}

.area-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.area-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  transform: scale(1.05);
}

.area-btn.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 探索按钮 */
.explore-btn-container {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.explore-btn {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
  position: relative;
  overflow: hidden;
}

.explore-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.6);
}

.explore-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.explore-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.explore-btn .btn-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 8px;
}

.explore-btn .stamina-cost {
  font-size: 12px;
  opacity: 0.8;
}

/* 探索结果动画 */
.explore-result {
  text-align: center;
  padding: 20px;
  min-height: 80px;
}

.result-animation {
  animation: popIn 0.5s ease-out;
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.result-resource {
  font-size: 48px;
  margin-bottom: 10px;
}

.result-amount {
  font-size: 24px;
  font-weight: bold;
  color: #ffd700;
}

.result-rare {
  animation: glow 1s ease-in-out infinite alternate;
}

@keyframes glow {
  from { filter: drop-shadow(0 0 5px #ffd700); }
  to { filter: drop-shadow(0 0 20px #ffd700); }
}

/* 体力条 */
.stamina-bar {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  height: 12px;
  overflow: hidden;
  margin-top: 15px;
}

.stamina-fill {
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  transition: width 0.3s;
  border-radius: 10px;
}

.stamina-text {
  text-align: center;
  font-size: 12px;
  margin-top: 5px;
  opacity: 0.7;
}

/* 侧边栏 */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 建筑列表 */
.building-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.building-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  transition: all 0.3s;
}

.building-item:hover {
  background: rgba(0, 0, 0, 0.3);
}

.building-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.building-details {
  display: flex;
  flex-direction: column;
}

.building-name {
  font-weight: bold;
  font-size: 14px;
}

.building-level {
  font-size: 11px;
  opacity: 0.7;
}

.building-cost {
  font-size: 11px;
  color: #ffd700;
}

.build-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  transition: all 0.3s;
}

.build-btn:hover:not(:disabled) {
  transform: scale(1.05);
}

.build-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #666;
}

.build-btn.max-level {
  background: #9C27B0;
}

/* 事件弹窗 */
.event-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

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

.event-modal {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-radius: 20px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s ease-out;
}

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

.event-icon {
  font-size: 64px;
  text-align: center;
  margin-bottom: 15px;
}

.event-name {
  font-size: 22px;
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
  color: #ffd700;
}

.event-desc {
  text-align: center;
  margin-bottom: 20px;
  opacity: 0.9;
  line-height: 1.5;
}

.event-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.event-choice-btn {
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
  text-align: left;
}

.event-choice-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: translateX(5px);
}

.event-result {
  text-align: center;
  padding: 20px;
  font-size: 16px;
  line-height: 1.6;
}

.event-close-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 15px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.event-close-btn:hover {
  transform: scale(1.02);
}

/* 天赋选择界面 */
.talent-select-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.talent-title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 10px;
  background: linear-gradient(90deg, #ffd700, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.talent-subtitle {
  opacity: 0.7;
  margin-bottom: 30px;
}

.talent-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.talent-card {
  width: 200px;
  padding: 25px;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.talent-card:hover {
  transform: translateY(-10px);
  border-color: #ffd700;
  box-shadow: 0 20px 40px rgba(255, 215, 0, 0.2);
}

.talent-card .icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.talent-card .name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 10px;
}

.talent-card .desc {
  font-size: 13px;
  opacity: 0.8;
  line-height: 1.5;
}

.talent-card .rarity {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  margin-top: 10px;
  font-weight: bold;
}

.rarity-common { background: #666; }
.rarity-uncommon { background: #4CAF50; }
.rarity-rare { background: #2196F3; }
.rarity-epic { background: #9C27B0; }
.rarity-legendary { background: linear-gradient(90deg, #ffd700, #ff6b6b); }

/* 产出信息 */
.production-info {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 10px;
  line-height: 1.8;
}

.production-info .prod-item {
  display: flex;
  justify-content: space-between;
}

/* 统计信息 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 8px;
}

.stat-label {
  opacity: 0.6;
  font-size: 10px;
}

.stat-value {
  font-weight: bold;
  font-size: 14px;
  color: #ffd700;
}

/* 宠物展示 */
.pets-display {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pet-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 215, 0, 0.2);
  border-radius: 50%;
  font-size: 20px;
  border: 2px solid rgba(255, 215, 0, 0.5);
}

/* 转生按钮 */
.prestige-btn {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff6b6b, #c44569);
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
}

.prestige-btn:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

.prestige-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.prestige-info {
  font-size: 11px;
  text-align: center;
  opacity: 0.6;
  margin-top: 8px;
}

/* 浮动文字动画 */
.floating-text {
  position: fixed;
  pointer-events: none;
  font-weight: bold;
  font-size: 18px;
  animation: floatUp 1s ease-out forwards;
  z-index: 500;
}

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

/* 标签页 */
.tabs {
  display: flex;
  gap: 5px;
  margin-bottom: 15px;
  background: rgba(0, 0, 0, 0.2);
  padding: 5px;
  border-radius: 10px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  color: #fff;
  cursor: pointer;
  border-radius: 8px;
  font-size: 12px;
  transition: all 0.3s;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.2);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}
