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

[hidden] {
  display: none !important;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.game-container {
  width: 100%;
  max-width: 1200px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

/* 顶部信息栏 */
.header {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #e0e0e0;
}

.title {
  font-size: 28px;
  font-weight: bold;
  color: #333;
}

.gold-display {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: bold;
  color: #ffa500;
}

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

.btn-save {
  padding: 10px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
/* 重置按钮 */.btn-reset {  padding: 10px 20px;  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);  color: white;  border: none;  border-radius: 10px;  font-size: 16px;  font-weight: bold;  cursor: pointer;  transition: transform 0.2s, box-shadow 0.2s;  display: block;  margin: 0 auto 30px;}.btn-reset:hover {  transform: translateY(-2px);  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* 选宠物界面 */
.select-pet-screen {
  padding: 40px;
  background: linear-gradient(180deg, #ffeaa7 0%, #fdcb6e 100%);
  min-height: 500px;
}

.main-title {
  text-align: center;
  font-size: 36px;
  color: #2d3436;
  margin-bottom: 40px;
}

.pet-choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  max-width: 900px;
  margin: 0 auto;
}

.pet-choice {
  background: white;
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  border: 3px solid transparent;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.pet-choice:hover {
  transform: translateY(-10px) scale(1.05);
  border-color: #667eea;
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.3);
}

.pet-emoji {
  font-size: 80px;
  margin-bottom: 15px;
}

.pet-name {
  font-size: 28px;
  font-weight: bold;
  color: #2d3436;
  margin-bottom: 15px;
}

.pet-evolution {
  font-size: 24px;
  color: #636e72;
  margin-bottom: 10px;
}

.evolution-desc {
  font-size: 14px;
  color: #b2bec3;
}

/* 游戏主界面 */
.game-screen {
  position: relative;
  min-height: 600px;
  background: linear-gradient(180deg, #ffeaa7 0%, #fdcb6e 100%);
}

/* 跑步机 */
.treadmill {
  position: absolute;
  top: 30px;
  left: 30px;
  width: 200px;
  background: white;
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.treadmill-label {
  font-size: 18px;
  font-weight: bold;
  color: #2d3436;
  text-align: center;
  margin-bottom: 10px;
}

.treadmill-zone {
  height: 360px;
  background: linear-gradient(90deg, #74b9ff 0%, #0984e3 50%, #74b9ff 100%);
  background-size: 200% 100%;
  border-radius: 10px;
  margin-bottom: 10px;
  animation: treadmillMove 2s linear infinite;
}

@keyframes treadmillMove {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.treadmill-hint {
  font-size: 12px;
  color: #636e72;
  text-align: center;
}

.treadmill.active {
  box-shadow: 0 0 30px rgba(116, 185, 255, 0.6);
}

/* 地毯区域 */
.carpet-area {
  margin-left: 250px;
  margin-right: 300px;
  margin-top: 30px;
  height: 400px;
  background: #dfe6e9;
  border-radius: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  box-shadow: inset 0 5px 15px rgba(0, 0, 0, 0.1);
}

.pet-container {
  position: relative;
}

.pet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s;
}

.pet:active {
}

.pet.running {
  animation: running 0.5s ease-in-out infinite;
}

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

.pet-sprite {
  cursor: grab;
  font-size: 100px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s;
}
.pet:hover .pet-sprite {
.pet-sprite:active {
  cursor: grabbing;
}

  transform: scale(1.1);
}

.pet-info {
  background: white;
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  text-align: center;
  min-width: 200px;
}

.pet-name-display {
  font-size: 24px;
  font-weight: bold;
  color: #2d3436;
  margin-bottom: 10px;
}

.evolution-stage {
  font-size: 14px;
  color: #636e72;
  margin-bottom: 15px;
}

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-bar {
  flex: 1;
  height: 20px;
  background: #dfe6e9;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00b894 0%, #00cec9 100%);
  transition: width 0.5s ease;
  border-radius: 10px;
}

.progress-text {
  font-size: 14px;
  font-weight: bold;
  color: #2d3436;
  min-width: 50px;
}

/* 控制面板 */
.control-panel {
  position: absolute;
  right: 30px;
  top: 30px;
  width: 250px;
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.control-panel h2 {
  font-size: 20px;
  color: #2d3436;
  margin-bottom: 20px;
  text-align: center;
}

.food-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.food-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
  border: 2px solid #e17055;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
  font-size: 16px;
  font-weight: bold;
}

.food-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 15px rgba(225, 112, 85, 0.3);
}

.food-emoji {
  font-size: 32px;
}

.food-name {
  flex: 1;
  color: #2d3436;
}

.food-price {
  font-size: 12px;
  color: #636e72;
}

.inventory {
  border-top: 2px solid #dfe6e9;
  padding-top: 20px;
}

.inventory h3 {
  font-size: 16px;
  color: #2d3436;
  margin-bottom: 15px;
}

.inventory-item {
  display: flex;
  justify-content: space-between;
  padding: 10px;
  background: #f5f6fa;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #2d3436;
}

/* 进化弹窗 */
.evolution-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: white;
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: popupIn 0.5s ease;
}

@keyframes popupIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.popup-emoji {
  font-size: 120px;
  margin-bottom: 20px;
}

.popup-text {
  font-size: 32px;
  font-weight: bold;
  color: #2d3436;
  margin-bottom: 30px;
}

.popup-btn {
  padding: 15px 40px;
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.popup-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 10px 20px rgba(0, 184, 148, 0.3);
}

@media (max-width: 900px) {
  .pet-choices {
    grid-template-columns: 1fr;
  }
  
  .carpet-area {
    margin-right: 30px;
  }
  
  .control-panel {
    position: static;
    width: 100%;
    margin-top: 20px;
  }
  
  .treadmill {
    position: static;
    width: 100%;
    margin-bottom: 20px;
  }
}

/* 防止拖动时的选中效果 */
.pet-sprite {
  -webkit-user-select: none;

/* 防止拖动时的选中效果 */
.pet-sprite {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.pet-sprite:active {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 保持宠物容器固定高度，防止sprite脱离文档流后信息模块上移 */
.pet {
  min-height: 220px !important;
}

/* ==================== 宠物商店样式 ==================== */
.header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}


/* ==================== 宠物商店样式 ==================== */
.header-buttons {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-shop {
  background: linear-gradient(135deg, #a29bfe 0%, #6c5ce7 100%);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-shop:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6);
  background: linear-gradient(135deg, #b4a7fe 0%, #7c6ce7 100%);
}

.btn-shop:active {
  transform: translateY(-1px) scale(1.02);
}

/* 商店弹窗背景 */
.shop-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

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

/* 商店内容容器 */
.shop-content {
  background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 25px;
  padding: 35px;
  max-width: 650px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* 商店头部 */
.shop-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 3px solid #e0e6ed;
  background: linear-gradient(90deg, transparent, rgba(108, 92, 231, 0.1), transparent);
}

.shop-header h2 {
  margin: 0;
  font-size: 32px;
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.btn-close {
  background: linear-gradient(135deg, #ff7675 0%, #d63031 100%);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(214, 48, 49, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.btn-close:hover {
  background: linear-gradient(135deg, #d63031 0%, #b32625 100%);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 16px rgba(214, 48, 49, 0.6);
}

/* 商品网格 */
.shop-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 25px;
  padding: 5px;
}

/* 商品卡片 */
.shop-item {
  background: linear-gradient(145deg, #ffffff 0%, #f1f3f5 100%);
  border-radius: 20px;
  padding: 25px 20px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.shop-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6c5ce7, #a29bfe, #74b9ff);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.shop-item:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 15px 40px rgba(108, 92, 231, 0.25);
  border-color: #a29bfe;
  background: linear-gradient(145deg, #ffffff 0%, #e8ecf1 100%);
}

.shop-item:hover::before {
  transform: scaleX(1);
}

.shop-pet-emoji {
  font-size: 70px;
  margin-bottom: 12px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
  transition: transform 0.3s ease;
  display: inline-block;
}

.shop-item:hover .shop-pet-emoji {
  transform: scale(1.15) rotate(5deg);
}

.shop-pet-name {
  font-size: 20px;
  font-weight: bold;
  color: #2d3436;
  margin-bottom: 8px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.shop-pet-price {
  font-size: 16px;
  font-weight: 600;
  color: #fdcb6e;
  margin-bottom: 18px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #2d3436, #636e72);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 购买按钮 */
.btn-buy {
  background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: hidden;
}

.btn-buy::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-buy:hover::before {
  width: 300px;
  height: 300px;
}

.btn-buy:hover {
  background: linear-gradient(135deg, #00a085 0%, #008f7a 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 184, 148, 0.5);
}

.btn-buy:active {
  transform: translateY(0) scale(0.98);
}

.btn-buy:disabled {
  background: linear-gradient(135deg, #b2bec3 0%, #95a5a6 100%);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-buy:disabled::before {
  display: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .shop-items {
    grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
    gap: 18px;
  }
  
  .shop-pet-emoji {
    font-size: 55px;
  }
  
  .shop-content {
    padding: 25px 20px;
    border-radius: 20px;
  }
  
  .shop-header h2 {
    font-size: 26px;
  }
  
  .btn-shop {
    padding: 8px 14px;
    font-size: 13px;
  }
  
  .shop-item {
    padding: 20px 15px;
  }
}

/* 滚动条美化 */
.shop-content::-webkit-scrollbar {
  width: 8px;
}

.shop-content::-webkit-scrollbar-track {
  background: #f1f3f5;
  border-radius: 10px;
}

.shop-content::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe);
  border-radius: 10px;
}

.shop-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5b4cdb, #9188fe);
}
