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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

#pet-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: transparent;
  position: relative;
  overflow: visible;
}

#pet {
  width: 150px;
  height: 150px;
  background-image: url('../../assets/自嘲熊睡醒.gif');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  cursor: grab;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: transform 0.3s ease-in-out;
  z-index: 1;
}

#pet:active {
  cursor: grabbing;
}

/* 添加炫酷的UI出现动画 */
@keyframes badgeAppear {
  0% { transform: translateX(-50%) rotateY(90deg) scale(0.2); opacity: 0; filter: brightness(2); }
  50% { transform: translateX(-50%) rotateY(0deg) scale(1.3); opacity: 0.8; filter: brightness(1.5) drop-shadow(0 0 5px #8a2be2); }
  75% { transform: translateX(-50%) rotateY(0deg) scale(0.9); opacity: 1; filter: brightness(1.2) drop-shadow(0 0 3px #8a2be2); }
  100% { transform: translateX(-50%) rotateY(0deg) scale(1); opacity: 1; filter: brightness(1) drop-shadow(0 0 2px #8a2be2); }
}

@keyframes expBarAppear {
  0% { transform: translateX(-150%) scaleX(0.1); opacity: 0; }
  40% { transform: translateX(-50%) scaleX(1.2); opacity: 0.7; filter: brightness(1.5); }
  70% { transform: translateX(-50%) scaleX(0.9); opacity: 1; }
  100% { transform: translateX(-50%) scaleX(1); opacity: 1; }
}

@keyframes buttonAppear {
  0% { transform: translateY(30px) scale(0.2) rotate(45deg); opacity: 0; filter: brightness(2); }
  60% { transform: translateY(-5px) scale(1.1) rotate(0deg); opacity: 0.9; filter: brightness(1.2) drop-shadow(0 0 8px rgba(255,255,255,0.8)); }
  80% { transform: translateY(3px) scale(0.95) rotate(0deg); opacity: 1; filter: brightness(1.1) drop-shadow(0 0 5px rgba(255,255,255,0.5)); }
  100% { transform: translateY(0) scale(1) rotate(0deg); opacity: 1; filter: brightness(1) drop-shadow(0 0 3px rgba(255,255,255,0.3)); }
}

/* 等级徽章 - 炫酷出现动画 */
#level-badge {
  position: absolute;
  top: calc(50% - 85px); /* 宠物顶部上方10px */
  left: 50%;
  transform: translateX(-50%) rotateY(90deg) scale(0.2); /* 初始状态就是动画的开始状态 */
  background: linear-gradient(135deg, #8a2be2, #4a1991);
  color: white;
  border-radius: 15px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  opacity: 0; /* 初始不可见 */
  z-index: 10;
  perspective: 500px;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

#level-badge.show {
  animation: badgeAppear 0.7s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
}

/* 经验条 - 炫酷出现动画 */
#exp-bar-container {
  position: absolute;
  top: calc(50% - 55px); /* 从-70px改为-65px，往下移5px */
  left: 50%;
  transform: translateX(-150%) scaleX(0.1); /* 初始状态就是动画的开始状态 */
  width: 60px;
  height: 6px;
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  overflow: hidden;
  opacity: 0; /* 初始不可见 */
  z-index: 9;
  box-shadow: 0 0 3px rgba(255, 255, 255, 0.3) inset;
}

#exp-bar-container.show {
  animation: expBarAppear 0.6s cubic-bezier(0.215, 0.610, 0.355, 1.000) 0.2s forwards;
}

#exp-bar {
  width: 0%; /* 由JS控制进度 */
  height: 100%;
  background: linear-gradient(90deg, #4CAF50, #8BC34A);
  background-size: 200% 100%;
  animation: gradientShift 3s linear infinite;
  transition: width 0.5s ease-out;
  border-radius: 4px;
}

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

#exp-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 7px;
  font-weight: bold;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
}

/* 互动按钮组 - 炫酷出现动画 */
#interaction-buttons {
  position: absolute;
  bottom: calc(50% - 85px); /* 宠物底部下方10px */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  z-index: 100;
  pointer-events: auto; /* 确保互动按钮可点击 */
}

#interaction-buttons.show {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.circular-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background-color: white;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.3s ease;
  z-index: 200;
  opacity: 0; /* 初始不可见 */
  transform: translateY(30px) scale(0.2) rotate(45deg); /* 初始状态就是动画的开始状态 */
}

.circular-button.show {
  animation: buttonAppear 0.6s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
}

.sign-in.show {
  animation-delay: 0.3s;
}

.interact.show {
  animation-delay: 0.4s;
}

.daily-quote.show {
  animation-delay: 0.5s;
}

.circular-button:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  filter: brightness(1.1) drop-shadow(0 0 5px rgba(255,255,255,0.5));
}

.sign-in {
  background: linear-gradient(135deg, #ff9800, #ff5722);
  color: white;
}

.interact {
  background: linear-gradient(135deg, #2196F3, #03A9F4);
  color: white;
}

.daily-quote {
  background: linear-gradient(135deg, #9c27b0, #673ab7);
  color: white;
}

.icon {
  font-size: 16px;
}

/* 消息弹窗炫酷动画 */
@keyframes messageAppear {
  0% { transform: translateX(-50%) translateY(-20px) scale(0.7); opacity: 0; }
  20% { transform: translateX(-50%) translateY(5px) scale(1.05); opacity: 0.9; filter: drop-shadow(0 0 10px rgba(255,255,255,0.7)); }
  60% { transform: translateX(-50%) translateY(-3px) scale(0.97); opacity: 1; filter: drop-shadow(0 0 5px rgba(255,255,255,0.4)); }
  100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; filter: drop-shadow(0 0 0px rgba(255,255,255,0)); }
}

#message-popup.show {
  animation: messageAppear 0.7s cubic-bezier(0.215, 0.610, 0.355, 1.000) forwards;
}

/* 对话框 - 固定在宠物上方，初始状态设置为动画开始状态 */
#message-popup {
  position: absolute;
  top: calc(50% - 110px); /* 宠物上方35px */
  left: 50%;
  transform: translateX(-50%) translateY(-20px) scale(0.7); /* 初始状态就是动画的开始状态 */
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  padding: 8px 12px;
  min-width: 120px;
  max-width: 180px;
  z-index: 1000;
  opacity: 0; /* 初始不可见 */
}

/* 对话框下方尖角 */
#message-popup:after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px 8px 0 8px;
  border-style: solid;
  border-color: white transparent transparent transparent;
}

.message-content {
  margin-bottom: 5px;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  text-align: center;
}

.close-message {
  position: absolute;
  top: 5px;
  right: 5px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
}

.close-message:hover {
  color: #333;
}

/* 经验获取动画 */
#exp-gain {
  position: absolute;
  top: calc(50% - 90px);
  left: 50%;
  transform: translateX(-50%);
  color: #4CAF50;
  font-weight: bold;
  font-size: 14px;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.8);
  pointer-events: none;
  animation: expFloat 1.5s forwards;
}

@keyframes expFloat {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(-50%) translateY(-15px); opacity: 0; }
}

/* 状态类 */
.hidden {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.show {
  opacity: 1 !important;
  display: block !important;
  pointer-events: auto !important;
}

/* 专门为互动按钮组定义show类 */
#interaction-buttons.show {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* 动画效果 */
@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
  10%, 30%, 50%, 70%, 90% { transform: translate(-55%, -50%) rotate(-5deg); }
  20%, 40%, 60%, 80% { transform: translate(-45%, -50%) rotate(5deg); }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translate(-50%, -50%); }
  40% { transform: translate(-50%, -70%); }
  60% { transform: translate(-50%, -60%); }
}

@keyframes flip {
  0% { transform: translate(-50%, -50%) scaleX(1); }
  50% { transform: translate(-50%, -50%) scaleX(-1); }
  100% { transform: translate(-50%, -50%) scaleX(1); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

.bounce {
  animation: bounce 0.8s ease-in-out;
}

.flip {
  animation: flip 0.8s ease-in-out;
}

/* 修改特殊动画，用独立的缩放元素 */
.special {
  animation: special 1.2s ease-in-out !important;
}

@keyframes special {
  0% { transform: translate(-50%, -50%) scale(1); }
  10% { transform: translate(-50%, -50%) scale(1.2); }
  20% { transform: translate(-50%, -50%) scale(0.8); }
  30% { transform: translate(-50%, -50%) scale(1.1); }
  40% { transform: translate(-50%, -50%) scale(0.9); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
  60% { transform: translate(-50%, -50%) scale(0.95); }
  70% { transform: translate(-50%, -50%) scale(1.02); }
  80% { transform: translate(-50%, -50%) scale(0.98); }
  90% { transform: translate(-50%, -50%) scale(1.01); }
  100% { transform: translate(-50%, -50%) scale(1); }
} 