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

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #cfe8ff;
  color: #2c2c3a;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 全屏场景背景(由 JS 设置 background 为 mesh 渐变) */
#sceneBg {
  position: fixed;
  inset: 0;
  z-index: -2;
  transition: opacity 0.6s ease;
}
/* 轻微遮罩:顶部提亮、底部压暗,保证浮层文字可读 */
#sceneBg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 35%, rgba(0,0,0,0.18) 100%);
}

/* ============ 场景动态特效层 ============ */
.scene-fx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.scene-fx > span,
.scene-fx > div {
  position: absolute;
  display: block;
  pointer-events: none;
  will-change: transform, opacity;
}

/* 蝴蝶飘飞(grass):左右横移 + 上下浮 */
.fx-butterfly {
  left: -40px;
  animation-name: butterflyFly;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
@keyframes butterflyFly {
  0%   { transform: translateX(0) translateY(0) rotate(-5deg); }
  25%  { transform: translateX(25vw) translateY(-18px) rotate(8deg); }
  50%  { transform: translateX(50vw) translateY(8px) rotate(-8deg); }
  75%  { transform: translateX(75vw) translateY(-12px) rotate(6deg); }
  100% { transform: translateX(110vw) translateY(0) rotate(-5deg); }
}
/* 蒲公英花粉飘动(grass):缓慢上浮左移 */
.fx-pollen {
  top: 100%;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 4px rgba(255,255,255,0.6);
  animation-name: pollenFloat;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes pollenFloat {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  15%  { opacity: 0.9; }
  85%  { opacity: 0.9; }
  100% { transform: translateY(-90vh) translateX(-40px); opacity: 0; }
}

/* 雪花飘落(snow) */
.fx-snowflake {
  top: -20px;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 0 3px rgba(255,255,255,0.5);
  animation-name: snowFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes snowFall {
  0%   { transform: translateY(0) translateX(0); }
  50%  { transform: translateY(50vh) translateX(var(--drift, 20px)); }
  100% { transform: translateY(105vh) translateX(0); }
}
/* 小雪人左右走动(snow) */
.fx-snowman {
  bottom: 14px;
  left: 50%;
  margin-left: -21px;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.25));
  animation-name: snowmanWalk;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}
@keyframes snowmanWalk {
  0%   { transform: translateX(-90px) rotate(-3deg); }
  100% { transform: translateX(90px) rotate(3deg); }
}

/* 海鸥飞过(beach):从右往左 */
.fx-bird {
  right: -30px;
  animation-name: birdFly;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.15));
}
@keyframes birdFly {
  0%   { transform: translateX(0) translateY(0); }
  25%  { transform: translateX(-30vw) translateY(-12px); }
  50%  { transform: translateX(-55vw) translateY(6px); }
  75%  { transform: translateX(-80vw) translateY(-10px); }
  100% { transform: translateX(-115vw) translateY(0); }
}
/* 海浪起伏(beach) */
.fx-wave {
  left: 0;
  width: 200%;
  height: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0.1));
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  animation-name: waveMove;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes waveMove {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* 月亮(night) */
.fx-moon {
  top: 8%;
  right: 10%;
  font-size: 44px;
  filter: drop-shadow(0 0 18px rgba(255,245,180,0.7));
  animation: moonGlow 4s ease-in-out infinite;
}
@keyframes moonGlow {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255,245,180,0.55)); }
  50%      { filter: drop-shadow(0 0 24px rgba(255,245,180,0.85)); }
}
/* 星星闪烁(night) */
.fx-star {
  color: rgba(255,255,255,0.9);
  text-shadow: 0 0 4px rgba(255,255,255,0.7);
  animation-name: twinkle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50%      { opacity: 1; transform: scale(1.15); }
}
/* 流星划过(night) */
.fx-meteor {
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 6px 2px rgba(255,255,255,0.8);
  left: 100%;
  animation-name: meteorFly;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
.fx-meteor::after {
  content: '';
  position: absolute;
  top: 1px;
  right: 2px;
  width: 80px;
  height: 1px;
  background: linear-gradient(90deg, rgba(255,255,255,0.9), transparent);
  transform-origin: right center;
}
@keyframes meteorFly {
  0%   { transform: translate(0, 0) rotate(35deg); opacity: 0; }
  8%   { opacity: 1; }
  40%  { opacity: 1; }
  60%  { transform: translate(-90vw, 70vh) rotate(35deg); opacity: 0; }
  100% { transform: translate(-90vw, 70vh) rotate(35deg); opacity: 0; }
}

/* 萤火虫(forest):随机飘动 + 闪烁 */
.fx-firefly {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff59d;
  box-shadow: 0 0 8px 3px rgba(255,245,157,0.8), 0 0 16px 5px rgba(255,245,157,0.4);
  animation-name: fireflyFloat;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes fireflyFloat {
  0%   { transform: translate(0, 0); opacity: 0.3; }
  25%  { transform: translate(30px, -25px); opacity: 1; }
  50%  { transform: translate(-15px, -45px); opacity: 0.5; }
  75%  { transform: translate(25px, -20px); opacity: 1; }
  100% { transform: translate(0, 0); opacity: 0.3; }
}
/* 落叶(forest):旋转下落 */
.fx-leaf {
  top: -30px;
  animation-name: leafFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.15));
}
@keyframes leafFall {
  0%   { transform: translateY(0) translateX(0) rotate(0); }
  50%  { transform: translateY(50vh) translateX(40px) rotate(180deg); }
  100% { transform: translateY(105vh) translateX(-20px) rotate(360deg); }
}

/* 火星(volcano):从下往上升 */
.fx-ember {
  bottom: 0;
  color: rgba(255,160,60,0.95);
  text-shadow: 0 0 6px rgba(255,140,40,0.8);
  animation-name: emberRise;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}
@keyframes emberRise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  15%  { opacity: 1; }
  80%  { opacity: 0.7; }
  100% { transform: translateY(-75vh) translateX(var(--drift-x, 0)) scale(0.3); opacity: 0; }
}
/* 烟雾(volcano):上升膨胀 */
.fx-smoke {
  bottom: 0;
  width: 40px;
  height: 40px;
  background: radial-gradient(circle, rgba(80,70,70,0.45) 0%, transparent 70%);
  border-radius: 50%;
  animation-name: smokeRise;
  animation-timing-function: ease-out;
  animation-iteration-count: infinite;
}
@keyframes smokeRise {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  20%  { opacity: 0.5; }
  100% { transform: translateY(-60vh) scale(2.2); opacity: 0; }
}

/* 归鸟(sunset):从左往右飞 */
.fx-bird-sunset {
  left: -30px;
  animation-name: birdSunset;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}
@keyframes birdSunset {
  0%   { transform: translateX(0) translateY(0); }
  25%  { transform: translateX(30vw) translateY(-10px); }
  50%  { transform: translateX(55vw) translateY(8px); }
  75%  { transform: translateX(80vw) translateY(-8px); }
  100% { transform: translateX(115vw) translateY(0); }
}
/* 云朵(sunset):缓慢漂移 */
.fx-cloud {
  left: -60px;
  opacity: 0.85;
  filter: drop-shadow(0 3px 6px rgba(180,120,200,0.2));
  animation-name: cloudDrift;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes cloudDrift {
  0%   { transform: translateX(0); }
  100% { transform: translateX(120vw); }
}

/* 樱花瓣(sakura):旋转飘落 + 左右摇 */
.fx-petal {
  top: -20px;
  animation-name: petalFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  filter: drop-shadow(0 1px 2px rgba(220,100,150,0.25));
}
@keyframes petalFall {
  0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(105vh) translateX(var(--sway, 0)) rotate(540deg); opacity: 0; }
}

/* 尊重减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  .scene-fx > * { animation: none !important; }
}

.app {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 12px 16px;
}

/* Header - 毛玻璃浮层 */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.65);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.8);
}
.header-btns {
  display: flex;
  align-items: center;
  gap: 2px;
}
.pet-name {
  font-size: 18px;
  font-weight: 800;
  color: #d8436a;
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
  letter-spacing: 0.5px;
}
.btn-icon {
  background: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s, background 0.2s, box-shadow 0.2s;
}
.btn-icon:hover {
  background: rgba(255,255,255,0.75);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}
.btn-icon:active {
  transform: translateY(0) scale(0.92);
}
/* 精灵球图标(经典红白球 SVG) */
.icon-pokeball {
  width: 22px;
  height: 22px;
  display: block;
}
.title-pokeball {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: -4px;
  margin-right: 2px;
}

/* Pet section - 居中,占据剩余空间 */
.pet-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0;
}
.pet-stage {
  position: relative;
  width: 190px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.28) 55%, transparent 78%);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(255,255,255,0.45), inset 0 0 20px rgba(255,255,255,0.3);
}
.pet-stage.hidden {
  display: none;
}
.pet-gif {
  width: 140px;
  height: 140px;
  object-fit: contain;
  image-rendering: pixelated;
  transition: transform 0.3s;
}
.pet-gif.working {
  animation: shake 0.5s infinite;
}
.pet-gif.eating {
  animation: bounce 0.4s infinite;
}
.pet-gif.evolving {
  animation: evolveFlash 1.6s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-4px) rotate(-3deg); }
  75% { transform: translateX(4px) rotate(3deg); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes evolveFlash {
  0% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(3) saturate(0); transform: scale(1.3); opacity: 0.9; }
  100% { filter: brightness(1); transform: scale(1); }
}

/* 工作气泡 */
.work-bubble {
  position: absolute;
  top: -10px;
  right: -20px;
  background: #fff;
  border: 2px solid #ffb3c6;
  border-radius: 14px;
  padding: 6px 10px;
  display: none;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  max-width: 160px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 5;
}
.work-bubble.show {
  display: flex;
  animation: pop 0.3s ease;
}
.work-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 20px;
  border: 6px solid transparent;
  border-top-color: #ffb3c6;
}
.bubble-emoji {
  font-size: 16px;
}
.bubble-text {
  font-weight: 600;
  color: #555;
}
@keyframes pop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* 进化白光遮罩 */
.evolve-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0) 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}
.evolve-overlay.show {
  animation: whiteFlash 1.6s ease;
}
@keyframes whiteFlash {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* 经验条 */
.exp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 300px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
}
.exp-bar-wrap {
  flex: 1;
  height: 14px;
  background: rgba(0,0,0,0.08);
  border-radius: 7px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.exp-bar {
  height: 100%;
  background: linear-gradient(90deg, #ffe082, #ffb300);
  border-radius: 7px;
  width: 0;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(255,179,0,0.5);
}
.exp-text {
  font-size: 12px;
  color: #6a6a7a;
  font-weight: 600;
  min-width: 56px;
  text-align: right;
}

/* 操作面板:资源 + 统一动作按钮(毛玻璃浮层) */
.control-panel {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.65);
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.resource-row {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.resource-chip {
  font-size: 13px;
  color: #5a5a6a;
  background: rgba(255,255,255,0.7);
  padding: 5px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  font-weight: 600;
}
.resource-chip b {
  color: #d8436a;
  font-weight: 800;
}
.action-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.action-row .btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 4px;
  border-radius: 14px;
  color: #fff;
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.45);
}
.action-row .btn::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 12%;
  right: 12%;
  height: 35%;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), transparent);
  pointer-events: none;
}
.action-row .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.5);
  filter: brightness(1.06);
}
.action-row .btn:active {
  transform: translateY(1px) scale(0.96);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}
.action-row .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.action-icon { font-size: 20px; line-height: 1; position: relative; z-index: 1; }
.action-label { font-size: 12px; font-weight: 700; position: relative; z-index: 1; text-shadow: 0 1px 2px rgba(0,0,0,0.2); }

/* 各动作按钮配色(渐变) */
.feed-btn  { background: linear-gradient(160deg, #ffb74d, #ff8a3d); }
.shop-btn  { background: linear-gradient(160deg, #ba68c8, #9c27b0); }
.skill-btn-main { background: linear-gradient(160deg, #5c6bc0, #3949ab); }
.battle-btn{ background: linear-gradient(160deg, #ef5350, #d32f2f); }

/* 抽奖宝箱按钮 */
.chest-btn {
  background: linear-gradient(160deg, #a1887f, #5d4037);
  position: relative;
  border: 2px solid #ffd54f;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2), 0 0 12px rgba(255,213,79,0.4), inset 0 1px 0 rgba(255,255,255,0.4);
}
.chest-btn:hover { box-shadow: 0 6px 14px rgba(0,0,0,0.25), 0 0 18px rgba(255,213,79,0.6), inset 0 1px 0 rgba(255,255,255,0.5); }
.chest-btn:disabled { opacity: 0.55; box-shadow: 0 3px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3); }
.chest-icon svg { width: 26px; height: 22px; display: block; position: relative; z-index: 1; }
.ticket-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  background: linear-gradient(135deg, #ff5252, #d32f2f);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.35);
  border: 1.5px solid #fff;
  z-index: 2;
}

/* ============ 抽奖宝箱弹窗 + 开箱动画 ============ */
.lottery-modal-content { max-width: 380px; }
.lottery-tickets {
  text-align: center;
  font-size: 14px;
  color: #d8436a;
  font-weight: 700;
  margin-bottom: 8px;
}
.lottery-hint {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  margin: 10px 0 6px;
}
.chest-stage {
  position: relative;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  background: radial-gradient(circle, #2a1840 0%, #0d0a1a 100%);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.6);
}
.chest {
  width: 110px;
  height: 96px;
  position: relative;
  z-index: 3;
  transition: filter 0.3s, opacity 0.4s;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.chest svg { width: 100%; height: 100%; display: block; }
.chest.shaking { animation: chestShake 0.09s infinite; }
.chest.glowing { filter: drop-shadow(0 0 16px rgba(255,220,120,0.95)) drop-shadow(0 0 30px rgba(255,180,80,0.6)); }
.chest.faded { opacity: 0; transform: scale(0.6); }
@keyframes chestShake {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  20% { transform: translate(-3px, -2px) rotate(-2deg); }
  40% { transform: translate(3px, 1px) rotate(2deg); }
  60% { transform: translate(-2px, 2px) rotate(-1.5deg); }
  80% { transform: translate(2px, -1px) rotate(1.5deg); }
}

/* 旋转光射线 */
.chest-rays {
  position: absolute;
  width: 360px;
  height: 360px;
  opacity: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0deg, rgba(255,220,120,0.55) 8deg, transparent 18deg,
    transparent 36deg, rgba(255,255,200,0.45) 44deg, transparent 54deg,
    transparent 72deg, rgba(255,220,120,0.55) 80deg, transparent 90deg,
    transparent 108deg, rgba(255,255,200,0.45) 116deg, transparent 126deg,
    transparent 144deg, rgba(255,220,120,0.55) 152deg, transparent 162deg,
    transparent 180deg, rgba(255,255,200,0.45) 188deg, transparent 198deg,
    transparent 216deg, rgba(255,220,120,0.55) 224deg, transparent 234deg,
    transparent 252deg, rgba(255,255,200,0.45) 260deg, transparent 270deg,
    transparent 288deg, rgba(255,220,120,0.55) 296deg, transparent 306deg,
    transparent 324deg, rgba(255,255,200,0.45) 332deg, transparent 342deg);
  z-index: 2;
}
.chest-rays.show { animation: raySpin 1.3s ease-out; }
@keyframes raySpin {
  0% { transform: scale(0.2) rotate(0); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: scale(1.5) rotate(200deg); opacity: 0; }
}

/* 中心光爆 */
.chest-burst {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #fff59d 35%, rgba(255,200,80,0.4) 60%, transparent 75%);
  opacity: 0;
  z-index: 2;
}
.chest-burst.show { animation: burstExpand 0.9s ease-out; }
@keyframes burstExpand {
  0% { transform: scale(0.2); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: scale(14); opacity: 0; }
}

/* 粒子飞溅 */
.chest-particles { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.particle {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  box-shadow: 0 0 6px #fff;
  opacity: 0;
  transform: translate(-50%, -50%);
}
.particle.fly { animation: particleFly 1.1s ease-out forwards; }
@keyframes particleFly {
  0% { transform: translate(-50%, -50%) scale(0.5); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.2); opacity: 0; }
}

/* 奖品揭晓 */
.prize-reveal {
  position: absolute;
  z-index: 6;
  opacity: 0;
  transform: scale(0.3);
  text-align: center;
  pointer-events: none;
}
.prize-reveal.show { animation: prizePop 0.55s cubic-bezier(.2,1.5,.4,1) forwards; }
@keyframes prizePop {
  0% { opacity: 0; transform: scale(0.3) translateY(24px); }
  60% { opacity: 1; transform: scale(1.12) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.prize-card {
  background: linear-gradient(135deg, #fffbe6, #fff);
  border: 3px solid #ffd54f;
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: 0 0 22px rgba(255,213,79,0.6);
  min-width: 150px;
}
.prize-reveal.hidden-prize .prize-card {
  border: 3px solid transparent;
  background:
    linear-gradient(#1a1330, #1a1330) padding-box,
    linear-gradient(135deg, #e91e63, #9c27b0, #3f51b5, #00bcd4) border-box;
  box-shadow: 0 0 30px rgba(233,30,99,0.75), 0 0 18px rgba(0,188,212,0.4);
  animation: hiddenGlow 1.6s ease infinite alternate;
}
@keyframes hiddenGlow {
  from { box-shadow: 0 0 22px rgba(233,30,99,0.6); }
  to { box-shadow: 0 0 38px rgba(0,188,212,0.7), 0 0 14px rgba(233,30,99,0.8); }
}
.prize-emoji { font-size: 56px; line-height: 1; display: flex; justify-content: center; align-items: center; height: 64px; }
.prize-emoji.emoji-big { font-size: 56px; }
.prize-emoji svg { width: 60px; height: 60px; display: block; }
.prize-name { font-size: 17px; font-weight: 700; color: #333; margin-top: 6px; }
.prize-reveal.hidden-prize .prize-name { color: #fff59d; }
.prize-tag { font-size: 11px; color: #888; margin-top: 3px; }
.prize-reveal.hidden-prize .prize-tag { color: #ce93d8; }
.prize-tail { font-size: 12px; color: #555; margin-top: 8px; }
.prize-reveal.hidden-prize .prize-tail { color: #ff80ab; font-weight: 600; }
.hidden-banner {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, #e91e63, #9c27b0, #3f51b5);
  padding: 3px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  animation: bannerPulse 0.9s ease infinite alternate;
}
@keyframes bannerPulse {
  from { box-shadow: 0 0 6px rgba(233,30,99,0.5); transform: scale(1); }
  to { box-shadow: 0 0 18px rgba(156,39,176,0.95); transform: scale(1.05); }
}

/* 多抽结果网格 */
.prize-reveal.multi { padding: 4px 2px; }
.prize-grid {
  display: grid;
  gap: 6px;
  margin: 4px 0;
}
.prize-grid.count-5 { grid-template-columns: repeat(5, 1fr); }
.prize-grid.count-10 { grid-template-columns: repeat(5, 1fr); }
.prize-mini {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 6px 2px;
  text-align: center;
  animation: prizePop 0.4s cubic-bezier(.2,1.5,.4,1) backwards;
}
.prize-mini.is-hidden {
  background: linear-gradient(135deg, #7b1fa2, #311b92);
  border: 1px solid #fff59d;
  box-shadow: 0 0 10px rgba(255,213,79,0.7);
}
.prize-mini .prize-emoji { font-size: 30px; height: 36px; }
.prize-mini .prize-emoji.emoji-big { font-size: 30px; }
.prize-mini .prize-emoji svg { width: 32px; height: 32px; }
.prize-mini .prize-name { font-size: 10px; color: #444; margin-top: 2px; line-height: 1.2; }
.prize-mini.is-hidden .prize-name { color: #fff59d; }
.prize-reveal.multi .prize-tail { font-size: 12px; color: #555; margin-top: 8px; font-weight: 600; }
.prize-reveal.multi .prize-tail::before { content: '🎉 '; }

/* 抽奖按钮区 */
.lottery-actions { flex-wrap: wrap; gap: 6px; }
.lottery-actions .btn { font-size: 13px; padding: 8px 10px; flex: 1 1 auto; min-width: 80px; }
#openChest5Btn { background: linear-gradient(135deg, #ba68c8, #7b1fa2); color: #fff; border: none; }
#openChest5Btn:hover { box-shadow: 0 4px 12px rgba(123,31,162,0.4); }
#openChest10Btn { background: linear-gradient(135deg, #4fc3f7, #1565c0); color: #fff; border: none; }
#openChest10Btn:hover { box-shadow: 0 4px 12px rgba(21,101,192,0.4); }

/* 饱食度条 */
.satiety-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 300px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
}

/* 心情展示行 */
.mood-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 300px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.7);
}
.mood-label-static {
  font-size: 11px;
  color: #888;
  width: 28px;
  flex-shrink: 0;
}
.mood-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 10px;
  border-radius: 11px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 60px;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.18);
  transition: background 0.3s;
}
.mood-emoji { font-size: 13px; }
.mood-desc {
  font-size: 10px;
  color: #9a9aaa;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.satiety-label {
  font-size: 11px;
  color: #888;
  min-width: 24px;
}
.satiety-bar-wrap {
  flex: 1;
  height: 12px;
  background: rgba(0,0,0,0.08);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}
.satiety-bar-fill {
  height: 100%;
  border-radius: 6px;
  width: 80%;
  transition: width 0.4s ease, background 0.4s;
}
.satiety-bar-fill.sat-high { background: linear-gradient(90deg, #ff8a65, #ff5722); }
.satiety-bar-fill.sat-mid { background: linear-gradient(90deg, #ffd54f, #ff9800); }
.satiety-bar-fill.sat-low { background: linear-gradient(90deg, #ef5350, #c62828); animation: satPulse 1s infinite; }
@keyframes satPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.satiety-text {
  font-size: 11px;
  color: #888;
  min-width: 48px;
  text-align: right;
}

/* 食物行(原规则已在上方) */
.food-count {
  font-size: 15px;
  font-weight: 600;
}

/* Section title */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: #555;
  margin-bottom: 4px;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

/* Dialogue */
.dialogue-section {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.65);
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
}
.dialogue-log {
  height: 120px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px 4px;
  margin-bottom: 8px;
}
.bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
  animation: pop 0.25s ease;
}
.bubble.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #5c9ce6, #4a90d9);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(74,144,217,0.35);
}
.bubble.pet {
  align-self: flex-start;
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.7);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.bubble.loading {
  align-self: flex-start;
  background: rgba(240,240,245,0.8);
  color: #888;
}
.loading-dots::after {
  content: '...';
  animation: dots 1s infinite;
}
@keyframes dots {
  0%, 33% { content: '.'; }
  66% { content: '..'; }
  100% { content: '...'; }
}
.dialogue-input-row {
  display: flex;
  gap: 6px;
}
.dialogue-input-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: rgba(255,255,255,0.7);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dialogue-input-row input:focus {
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74,144,217,0.18);
}
.send-btn {
  background: linear-gradient(135deg, #5c9ce6, #4a90d9);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 9px 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(74,144,217,0.35);
  transition: transform 0.15s, box-shadow 0.2s;
}
.send-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(74,144,217,0.45); }
.send-btn:active { transform: scale(0.95); }

/* Tasks */
.task-section {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.65);
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.8);
}
/* 每日打卡头条 */
.daily-header {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
  padding: 7px 12px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(255,224,178,0.7), rgba(255,248,225,0.6));
  border: 1px solid rgba(255,183,77,0.4);
  border-radius: 12px;
  font-size: 12px;
  color: #6a5a3a;
}
.daily-header b { color: #e65100; font-weight: 800; }
.dh-streak { font-weight: 600; }
.dh-tasks { font-weight: 600; }
.dh-reward { margin-left: auto; font-size: 11px; opacity: 0.85; }
/* 任务预设模板按钮 */
.task-templates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.task-tpl {
  border: 1px solid rgba(255,183,77,0.5);
  background: linear-gradient(160deg, rgba(255,249,230,0.95), rgba(255,243,196,0.85));
  color: #6a5a3a;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 1px 4px rgba(255,193,7,0.18);
}
.task-tpl:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255,193,7,0.3);
  background: linear-gradient(160deg, rgba(255,249,230,1), rgba(255,238,180,0.95));
}
.task-tpl:active { transform: scale(0.95); }
.task-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
}
.task-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  align-items: center;
  gap: 6px;
  padding: 9px 11px;
  background: rgba(255,255,255,0.75);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.6);
  font-size: 14px;
  transition: transform 0.15s, box-shadow 0.2s;
}
.task-item:hover { transform: translateX(2px); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.task-item.in-progress {
  border-color: rgba(255,213,79,0.7);
  background: linear-gradient(135deg, rgba(255,253,231,0.9), rgba(255,249,196,0.8));
  box-shadow: 0 2px 8px rgba(255,213,79,0.25);
}
.task-item.completed {
  opacity: 0.55;
  text-decoration: line-through;
}
.task-icon {
  font-size: 18px;
}
.task-title {
  font-weight: 600;
}
.task-meta {
  color: #ff9800;
  font-size: 12px;
  white-space: nowrap;
}
.task-repeat {
  color: #ab47bc;
  font-size: 11px;
  white-space: nowrap;
  font-weight: 600;
}
.task-source {
  color: #aaa;
  font-size: 11px;
}
.task-status {
  color: #999;
  font-size: 11px;
  min-width: 40px;
  text-align: right;
}
.task-actions {
  display: flex;
  gap: 4px;
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin-top: 4px;
}
.task-empty {
  text-align: center;
  color: #aaa;
  padding: 16px;
  font-size: 13px;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(160deg, #ececf0, #d8d8de);
  color: #444;
  transition: filter 0.15s, transform 0.12s, box-shadow 0.2s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.6);
}
.btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.7);
}
.btn:active {
  transform: scale(0.96);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-primary {
  background: linear-gradient(160deg, #81c784, #4caf50);
  color: #fff;
  box-shadow: 0 2px 6px rgba(76,175,80,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-warn {
  background: linear-gradient(160deg, #ce93d8, #ab47bc);
  color: #fff;
  box-shadow: 0 2px 6px rgba(171,71,188,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-start {
  background: linear-gradient(160deg, #5c9ce6, #4a90d9);
  color: #fff;
  box-shadow: 0 2px 6px rgba(74,144,217,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-complete {
  background: linear-gradient(160deg, #81c784, #4caf50);
  color: #fff;
  box-shadow: 0 2px 6px rgba(76,175,80,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-abandon {
  background: linear-gradient(160deg, #ef9a9a, #e57373);
  color: #fff;
  box-shadow: 0 2px 6px rgba(229,115,115,0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-del {
  background: rgba(240,240,245,0.9);
  color: #888;
  font-size: 12px;
  padding: 4px 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.add-task-btn {
  background: linear-gradient(160deg, #5c9ce6, #4a90d9);
  color: #fff;
  box-shadow: 0 2px 6px rgba(74,144,217,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 40, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal.show {
  display: flex;
  animation: modalIn 0.25s ease;
}
#passwordModal {
  z-index: 10000;
}
}
@keyframes modalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-content {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.7);
  padding: 20px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.9);
  animation: contentIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes contentIn {
  from { transform: scale(0.85) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
  text-align: center;
  color: #d8436a;
  letter-spacing: 0.5px;
}
.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.form-row label {
  font-size: 12px;
  color: #7a7a8a;
  font-weight: 600;
}
.form-row input,
.form-row select {
  padding: 9px 12px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 12px;
  font-size: 14px;
  outline: none;
  background: rgba(255,255,255,0.8);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.form-row input:focus,
.form-row select:focus {
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74,144,217,0.18);
}
.form-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}
.form-actions.vertical {
  flex-direction: column;
}
.form-actions.vertical .btn {
  width: 100%;
}
.form-hint {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  margin-top: 8px;
}

/* Starter picker */
.starter-modal-content {
  max-width: 420px;
}
.starter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.starter-card {
  background: linear-gradient(160deg, rgba(255,249,230,0.95), rgba(255,243,196,0.9));
  border: 2px solid rgba(255,213,79,0.7);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(255,193,7,0.18);
}
.starter-card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 20px rgba(255,193,7,0.3);
}
.starter-img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  image-rendering: pixelated;
}
.starter-name {
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
  color: #d8436a;
}

/* ============ 商店 / 装饰品 ============ */

/* 钱币 + 商店按钮 */
.coins-count {
  font-size: 15px;
  font-weight: 600;
  color: #d8436a;
}

/* 食物行重排规则已合并到主 .food-row */

/* 装饰品叠层 —— 贴在宠物身体上 */
.pet-body {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s ease;
  z-index: 3;
}
/* 战斗姿态:装备武器时身体微倾 + 放大 */
.pet-body.battle {
  transform: rotate(-4deg) scale(1.06);
}
.pet-body.battle .pet-gif {
  filter: drop-shadow(0 0 8px rgba(255, 90, 70, 0.55));
}
/* 华丽姿态:戴帽/首饰时身体微微挺立 */
.pet-body.fancy {
  transform: scale(1.03);
}
.pet-body.fancy .pet-gif {
  filter: drop-shadow(0 0 6px rgba(255, 210, 80, 0.5));
}

/* 光环(在身体后方) */
.pet-aura {
  position: absolute;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  transition: opacity 0.4s;
}
.pet-aura.show {
  opacity: 1;
}
.pet-aura.battle {
  background: radial-gradient(circle, rgba(255, 90, 70, 0.45) 0%, rgba(255, 150, 80, 0.12) 50%, transparent 70%);
  animation: auraPulse 1.4s ease-in-out infinite;
}
.pet-aura.fancy {
  background: radial-gradient(circle, rgba(255, 215, 80, 0.4) 0%, rgba(255, 215, 80, 0.1) 50%, transparent 70%);
  animation: auraPulse 2s ease-in-out infinite;
}
@keyframes auraPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}

/* ============ 装备展示格(宠物下方,5 个槽位) ============ */
/* 装备不再叠在精灵身上,改显示在独立格子里,干净清晰 */
.equip-grid {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  max-width: 320px;
}
.equip-slot {
  width: 54px;
  height: 60px;
  border: 2px dashed rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  padding: 3px 2px;
  position: relative;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.18s, background 0.2s;
}
.equip-slot:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}
.equip-slot:active { transform: scale(0.95); }
/* 空槽位 */
.equip-slot.empty {
  cursor: default;
}
.equip-slot.empty:hover {
  transform: none;
  box-shadow: none;
}
.equip-placeholder {
  font-size: 22px;
  opacity: 0.3;
  line-height: 1;
}
/* 已装备:金色边框 + 暖底 */
.equip-slot.equipped {
  border-style: solid;
  border-color: rgba(255, 213, 79, 0.85);
  background: linear-gradient(160deg, rgba(255, 249, 230, 0.95), rgba(255, 243, 196, 0.9));
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}
.equip-slot.equipped:hover {
  box-shadow: 0 6px 14px rgba(255, 193, 7, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
/* 隐藏款装备:紫金渐变边框 + 深底 */
.equip-slot.equipped.hidden-item {
  border-color: transparent;
  background:
    linear-gradient(#1a1330, #1a1330) padding-box,
    linear-gradient(135deg, #e91e63, #9c27b0, #3f51b5, #00bcd4) border-box;
  box-shadow: 0 0 14px rgba(233, 30, 99, 0.5), 0 0 8px rgba(0, 188, 212, 0.3);
  animation: hiddenGlow 1.6s ease infinite alternate;
}
.equip-slot.equipped.hidden-item .equip-slot-label {
  color: #fff59d;
}
.equip-slot-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.equip-slot-icon svg { width: 100%; height: 100%; display: block; }
.equip-slot-icon .cos-emoji { font-size: 24px; line-height: 1; }
.equip-slot-label {
  font-size: 9px;
  color: #888;
  font-weight: 600;
  line-height: 1;
}
.equip-slot.equipped .equip-slot-label { color: #6a5a3a; }
@keyframes hiddenGlow {
  from { box-shadow: 0 0 10px rgba(233, 30, 99, 0.45), 0 0 6px rgba(0, 188, 212, 0.25); }
  to   { box-shadow: 0 0 18px rgba(0, 188, 212, 0.6), 0 0 10px rgba(233, 30, 99, 0.7); }
}

/* ============ 装备发光 + 粒子 ============ */
/* 普通装备发光 */
.cosmetic-layer.gear-glow {
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.8)) drop-shadow(0 2px 3px rgba(0,0,0,0.3));
  animation: gearGlowPulse 2.2s ease-in-out infinite;
}
@keyframes gearGlowPulse {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(255,255,255,0.6)) drop-shadow(0 2px 3px rgba(0,0,0,0.3)); }
  50% { filter: drop-shadow(0 0 10px rgba(255,255,255,0.95)) drop-shadow(0 2px 3px rgba(0,0,0,0.3)); }
}
/* 隐藏款装备:传说级金色彩虹光晕 */
.cosmetic-layer.gear-legendary {
  filter: drop-shadow(0 0 8px #ffd700) drop-shadow(0 0 14px rgba(255,215,0,0.6));
  animation: legendaryGlow 1.8s ease-in-out infinite;
}
@keyframes legendaryGlow {
  0%, 100% { filter: drop-shadow(0 0 6px #ffd700) drop-shadow(0 0 10px rgba(255,215,0,0.5)) drop-shadow(0 0 16px rgba(233,30,99,0.4)); }
  50% { filter: drop-shadow(0 0 10px #fff59d) drop-shadow(0 0 18px rgba(255,215,0,0.85)) drop-shadow(0 0 24px rgba(156,39,176,0.6)); }
}

/* 装备粒子层 */
.gear-fx {
  position: absolute;
  inset: -5%;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.4s;
}
.gear-fx.active { opacity: 1; }

.gear-particle {
  position: absolute;
  display: block;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}
/* 闪光(帽子) */
.gear-particle.gearSpark {
  animation: gearSparkAnim var(--dur, 2.5s) ease-in-out infinite;
}
@keyframes gearSparkAnim {
  0%, 100% { transform: scale(0.4) translateY(0); opacity: 0; }
  40% { transform: scale(1.1) translateY(-8px); opacity: 1; }
  60% { transform: scale(1.1) translateY(-12px); opacity: 0.8; }
}
/* 环绕(配饰) */
.gear-particle.gearOrbit {
  animation: gearOrbitAnim var(--dur, 4s) linear infinite;
}
@keyframes gearOrbitAnim {
  from { transform: rotate(0deg) translateX(60px) rotate(0deg); opacity: 0.7; }
  to { transform: rotate(360deg) translateX(60px) rotate(-360deg); opacity: 0.7; }
}
/* 火焰上升(武器) */
.gear-particle.gearFlame {
  animation: gearFlameAnim var(--dur, 2s) ease-out infinite;
}
@keyframes gearFlameAnim {
  0% { transform: translateY(20px) scale(0.6); opacity: 0; }
  30% { opacity: 0.9; }
  100% { transform: translateY(-30px) scale(1.2); opacity: 0; }
}
/* 爱心上升(伙伴) */
.gear-particle.gearHeart {
  animation: gearHeartAnim var(--dur, 3s) ease-out infinite;
}
@keyframes gearHeartAnim {
  0% { transform: translateY(15px) scale(0.5); opacity: 0; }
  20% { opacity: 0.9; transform: translateY(5px) scale(1); }
  100% { transform: translateY(-40px) scale(1.3); opacity: 0; }
}
/* 隐藏款星星闪烁 */
.gear-particle.gearStar {
  animation: gearStarAnim var(--dur, 2.5s) ease-in-out infinite;
  text-shadow: 0 0 6px #ffd700, 0 0 12px #ff80ab;
}
@keyframes gearStarAnim {
  0%, 100% { transform: scale(0.3) rotate(0deg); opacity: 0.2; }
  50% { transform: scale(1.3) rotate(180deg); opacity: 1; }
}

/* ============ 装饰品属性信息浮窗(body 级,固定定位,锚定装备格) ============ */
.cos-tooltip {
  position: fixed;
  left: 8px;
  top: 0;
  width: 220px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 16px;
  padding: 10px 11px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.9);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cos-tooltip.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.ct-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ct-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, rgba(255,249,230,0.95), rgba(255,243,196,0.9));
  border: 1px solid rgba(255,213,79,0.5);
  border-radius: 10px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}
.ct-icon svg { width: 28px; height: 28px; }
.ct-emoji { font-size: 22px; }
.ct-title { flex: 1; min-width: 0; }
.ct-name {
  font-size: 13px;
  font-weight: 800;
  color: #4a4a5a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ct-tags {
  display: flex;
  gap: 4px;
  margin-top: 2px;
  flex-wrap: wrap;
}
.ct-slot {
  font-size: 9px;
  font-weight: 700;
  color: #5c6bc0;
  background: rgba(92,107,192,0.12);
  padding: 1px 6px;
  border-radius: 6px;
}
.ct-hidden {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #ec407a, #ab47bc, #5c6bc0);
  padding: 1px 6px;
  border-radius: 6px;
}
.ct-close {
  background: rgba(0,0,0,0.06);
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.ct-close:hover { background: rgba(0,0,0,0.12); color: #555; }
.ct-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 8px;
}
.ct-stats .stat-chip {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 7px;
  background: linear-gradient(160deg, #fff3e0, #ffe0b2);
  color: #e65100;
  font-weight: 700;
}
.ct-desc {
  font-size: 11px;
  color: #7a7a8a;
  line-height: 1.45;
  margin-top: 7px;
}

/* 染色剂特效叠层(不改宠物本色,在周围加光晕+粒子) */
.dye-fx {
  position: absolute;
  inset: -10% -5%;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.4s;
}
.dye-fx[class*="dye-"]:not(.dye-fx.dye-none) {
  opacity: 1;
}

/* 各色光晕背景 */
.dye-fx.dye-pink   { background: radial-gradient(circle, rgba(255,182,213,0.55) 0%, rgba(255,105,180,0.25) 40%, transparent 70%); }
.dye-fx.dye-blue   { background: radial-gradient(circle, rgba(179,229,252,0.55) 0%, rgba(74,144,226,0.25) 40%, transparent 70%); }
.dye-fx.dye-green  { background: radial-gradient(circle, rgba(200,230,201,0.55) 0%, rgba(102,187,106,0.25) 40%, transparent 70%); }
.dye-fx.dye-gold   { background: radial-gradient(circle, rgba(255,241,118,0.6) 0%, rgba(255,193,7,0.3) 40%, transparent 70%); }
.dye-fx.dye-rainbow{ background: conic-gradient(from 0deg, #ff6b6b, #ffd93d, #6bcf7f, #4ecdc4, #6c5ce7, #ff6b6b); opacity: 0.35; animation: dyeRainbowSpin 6s linear infinite; }
.dye-fx.dye-galaxy { background: radial-gradient(circle, rgba(156,39,176,0.5) 0%, rgba(63,81,181,0.3) 40%, transparent 70%); box-shadow: inset 0 0 40px rgba(255,213,79,0.3); }

@keyframes dyeRainbowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 粒子通用 */
.dye-particle {
  position: absolute;
  display: block;
  pointer-events: none;
  opacity: 0;
  will-change: transform, opacity;
}

/* 飘落(樱花/雪花/落叶) */
.dye-particle.dyeFall {
  animation: dyeFallAnim var(--dur, 5s) linear infinite;
}
@keyframes dyeFallAnim {
  0% { transform: translate(0, -20px) rotate(0deg); opacity: 0; }
  10% { opacity: 0.9; }
  90% { opacity: 0.9; }
  100% { transform: translate(var(--dx, 0), var(--dy, 80px)) rotate(360deg); opacity: 0; }
}

/* 闪光(金光) */
.dye-particle.dyeSpark {
  animation: dyeSparkAnim var(--dur, 2s) ease-in-out infinite;
}
@keyframes dyeSparkAnim {
  0%, 100% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* 环绕(彩虹) */
.dye-particle.dyeOrbit {
  animation: dyeOrbitAnim var(--dur, 5s) linear infinite;
}
@keyframes dyeOrbitAnim {
  from { transform: rotate(0deg) translateX(70px) rotate(0deg); opacity: 0.8; }
  to { transform: rotate(360deg) translateX(70px) rotate(-360deg); opacity: 0.8; }
}

/* 闪烁(星河) */
.dye-particle.dyeTwinkle {
  animation: dyeTwinkleAnim var(--dur, 3s) ease-in-out infinite;
  color: #fff;
  text-shadow: 0 0 6px #fff, 0 0 12px #ce93d8;
}
@keyframes dyeTwinkleAnim {
  0%, 100% { transform: scale(0.3); opacity: 0.2; }
  50% { transform: scale(1.4); opacity: 1; }
}

/* 玩具开心动画 */
.pet-gif.happy {
  animation: happyBounce 0.5s ease 2;
}
@keyframes happyBounce {
  0%, 100% { transform: translateY(0) rotate(0); }
  25% { transform: translateY(-14px) rotate(-6deg); }
  50% { transform: translateY(0) rotate(0); }
  75% { transform: translateY(-10px) rotate(6deg); }
}

/* 奖励类型单选 */
.reward-type-row {
  display: flex;
  gap: 10px;
}
.reward-type-opt {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
}
.reward-type-opt input {
  margin: 0;
}
.repeat-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.repeat-max-input {
  width: 64px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.repeat-max-input:disabled {
  background: #f0f0f0;
  color: #aaa;
}
.repeat-max-label {
  font-size: 12px;
  color: #888;
}

/* 商店弹窗 */
.shop-modal-content {
  max-width: 420px;
}
.shop-coins {
  font-size: 13px;
  color: #888;
  font-weight: 600;
  margin-left: 8px;
}
.shop-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  justify-content: center;
}
.shop-tab {
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.7);
  border-radius: 16px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: #666;
  transition: all 0.18s;
}
.shop-tab:hover { background: rgba(255,255,255,0.9); transform: translateY(-1px); }
.shop-tab.active {
  background: linear-gradient(160deg, #ce93d8, #ab47bc);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(171,71,188,0.4);
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
}
.shop-card {
  background: linear-gradient(160deg, rgba(255,249,230,0.95), rgba(255,243,196,0.9));
  border: 2px solid rgba(255,224,130,0.7);
  border-radius: 14px;
  padding: 9px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  transition: transform 0.18s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(255,193,7,0.15);
}
.shop-card:hover { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(255,193,7,0.25); }
.shop-card.owned {
  border-color: rgba(129,199,132,0.7);
  background: linear-gradient(160deg, rgba(224,247,245,0.95), rgba(178,223,219,0.85));
  box-shadow: 0 2px 6px rgba(77,182,172,0.18);
}
.shop-card.equipped {
  border-color: #4a90d9;
  background: linear-gradient(160deg, rgba(227,242,253,0.95), rgba(187,222,251,0.9));
  box-shadow: 0 0 0 2px rgba(74,144,217,0.35), 0 4px 10px rgba(74,144,217,0.2);
}
.shop-emoji {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.12));
}
.shop-emoji svg {
  width: 100%;
  height: 100%;
}
.shop-name {
  font-weight: 700;
  color: #4a4a5a;
  font-size: 12px;
}
.shop-price {
  color: #d8436a;
  font-size: 11px;
  font-weight: 700;
}
.shop-action {
  margin-top: 4px;
}
.shop-card .btn {
  font-size: 11px;
  padding: 4px 9px;
}
.shop-stats, .inv-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  margin: 2px 0;
}
.inv-stats { justify-content: flex-start; }
.stat-chip {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(255,243,224,0.9);
  color: #e65100;
  font-weight: 700;
  white-space: nowrap;
}
.inv-stats .stat-chip { background: rgba(252,228,236,0.9); color: #ad1457; }
.btn-buy {
  background: linear-gradient(160deg, #ffb74d, #ff9800);
  color: #fff;
  box-shadow: 0 2px 5px rgba(255,152,0,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-equip {
  background: linear-gradient(160deg, #5c9ce6, #4a90d9);
  color: #fff;
  box-shadow: 0 2px 5px rgba(74,144,217,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-unequip {
  background: linear-gradient(160deg, #ececf0, #d8d8de);
  color: #555;
}
.btn-use {
  background: linear-gradient(160deg, #81c784, #66bb6a);
  color: #fff;
  box-shadow: 0 2px 5px rgba(102,187,106,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
}

/* 背包列表 */
.inventory-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
}
.inv-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: #fff9e6;
  border: 1px solid #ffe082;
  border-radius: 10px;
  font-size: 13px;
}
.inv-card.equipped {
  border-color: #4a90d9;
  background: #e3f2fd;
}
.inv-emoji {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.inv-emoji svg {
  width: 100%;
  height: 100%;
}
.inv-name {
  font-weight: 700;
  flex: 1;
}
.inv-cat {
  font-size: 11px;
  color: #888;
}
.inv-count {
  font-size: 12px;
  color: #d8436a;
  font-weight: 600;
}
.inv-action .btn {
  font-size: 12px;
  padding: 4px 10px;
}
.inv-empty {
  text-align: center;
  color: #aaa;
  padding: 24px;
  font-size: 13px;
}

/* ============ 战斗系统 ============ */

/* 对手选择列表 */
.opponent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}
.opponent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fff9e6;
  border: 2px solid #ffe082;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
}
.opponent-card.wild { background: #e8f5e9; border-color: #a5d6a7; }
.opponent-card.beaten { background: #e3f2fd; border-color: #90caf9; }
.opponent-card.locked { opacity: 0.5; cursor: not-allowed; }
.opp-emoji { font-size: 28px; }
.opp-info { flex: 1; display: flex; flex-direction: column; }
.opp-name { font-weight: 700; color: #333; }
.opp-desc { font-size: 11px; color: #888; }
.opp-reward { font-weight: 700; color: #d8436a; }

/* 战斗弹窗 */
.battle-modal-content { max-width: 460px; }
.battle-arena {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  background: linear-gradient(180deg, #ffe4b5 0%, #c8e6c9 100%);
  border-radius: 12px;
  padding: 12px;
  min-height: 180px;
  position: relative;
}
.battle-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.player-side { justify-content: flex-end; }
.enemy-side { justify-content: flex-end; }
.battle-name { font-size: 12px; font-weight: 700; color: #333; }
.hp-bar-wrap {
  width: 110px;
  height: 10px;
  background: #eee;
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid #ccc;
}
.hp-bar-fill {
  height: 100%;
  width: 100%;
  transition: width 0.4s;
}
.hp-bar-fill.hp-high { background: #66bb6a; }
.hp-bar-fill.hp-mid { background: #ffd54f; }
.hp-bar-fill.hp-low { background: #ef5350; }
.hp-text { font-size: 10px; color: #555; }
.battle-sprite {
  width: 90px;
  height: 90px;
  object-fit: contain;
  image-rendering: pixelated;
}
.enemy-sprite { transform: scaleX(-1); }
.player-sprite { animation: bounce 0.4s infinite; }

.battle-log {
  height: 100px;
  overflow-y: auto;
  background: #f7f9fc;
  border-radius: 8px;
  padding: 8px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
}
.battle-log-line { color: #444; margin-bottom: 2px; }
.battle-skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 10px;
}
.skill-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  transition: filter 0.15s, transform 0.1s;
}
.skill-btn:hover { filter: brightness(1.1); }
.skill-btn:active { transform: scale(0.96); }
.skill-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.skill-btn.fire { background: #e53935; }
.skill-btn.water { background: #1e88e5; }
.skill-btn.grass { background: #43a047; }
.skill-btn.electric { background: #fdd835; color: #333; }
.skill-btn.normal { background: #8d6e63; }
.skill-btn.bug { background: #8bc34a; }
.skill-btn.poison { background: #9c27b0; }
.skill-btn.ground { background: #8d6e63; }
.skill-btn.rock { background: #795548; }
.skill-btn.psychic { background: #ec407a; }
.skill-btn.ice { background: #4fc3f7; color: #1a237e; }
.skill-btn.ghost { background: #5e35b1; }
.skill-btn.dragon { background: #7c4dff; }
.skill-btn.fighting { background: #d84315; }
.skill-btn.flying { background: #5c6bc0; }
.skill-btn.fairy { background: #f48fb1; color: #6a1b3a; }
.skill-emoji { font-size: 18px; }
.skill-name { font-weight: 700; }
.skill-pp { font-size: 10px; opacity: 0.85; }

.battle-result {
  display: none;
  text-align: center;
  padding: 12px;
  margin-top: 10px;
}
.battle-result.show { display: block; animation: pop 0.4s ease; }
.battle-win { font-size: 22px; font-weight: 700; color: #43a047; }
.battle-lose { font-size: 22px; font-weight: 700; color: #e53935; }
.battle-reward { font-size: 14px; color: #555; margin-top: 6px; }

/* ============ 技能商店 / 装备页 ============ */

.skill-shop-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
  padding: 2px;
}
.skill-card { border-color: #c5cae9; background: #e8eaf6; }
.skill-card.owned { background: #e0f7f5; border-color: #b2dfdb; }
.skill-type-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  color: #fff;
  margin: 2px 0;
}
.skill-type-badge.fire { background: #e53935; }
.skill-type-badge.water { background: #1e88e5; }
.skill-type-badge.grass { background: #43a047; }
.skill-type-badge.electric { background: #fdd835; color: #333; }
.skill-type-badge.normal { background: #8d6e63; }

.skill-tab-content.hidden { display: none; }

.skill-slot-info { font-size: 12px; color: #666; margin-bottom: 8px; }
.skill-equipped-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.skill-slot-chip {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 16px;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: default;
}
.skill-slot-chip.equipped { cursor: pointer; }
.skill-slot-chip.empty { background: #eee; color: #aaa; border: 1px dashed #ccc; }
.skill-slot-chip.fire { background: #e53935; }
.skill-slot-chip.water { background: #1e88e5; }
.skill-slot-chip.grass { background: #43a047; }
.skill-slot-chip.electric { background: #fdd835; color: #333; }
.skill-slot-chip.normal { background: #8d6e63; }
.chip-x { font-size: 10px; opacity: 0.8; }

.skill-learned-title { font-size: 12px; font-weight: 700; color: #555; margin-bottom: 6px; }
.skill-learned-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}
.skill-learned-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  color: #fff;
  text-align: left;
}
.skill-learned-chip:disabled { opacity: 0.5; cursor: default; }
.skill-learned-chip.is-equipped { background: #9e9e9e !important; }
.skill-learned-chip.fire { background: #e53935; }
.skill-learned-chip.water { background: #1e88e5; }
.skill-learned-chip.grass { background: #43a047; }
.skill-learned-chip.electric { background: #fdd835; color: #333; }
.skill-learned-chip.normal { background: #8d6e63; }
.skill-meta-small { font-size: 10px; opacity: 0.85; margin-left: auto; }

.hidden { display: none !important; }

/* 启动云端同步遮罩 */
.boot-loading {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.boot-loading-inner {
  padding: 20px 30px;
  background: rgba(255,255,255,0.92);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  font-size: 16px;
  font-weight: 600;
  color: #5c6bc0;
  animation: bootPulse 1.2s ease-in-out infinite;
}
@keyframes bootPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ============ 宝可梦图鉴 ============ */
.dex-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e53935;
  color: #fff;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 8px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
  pointer-events: none;
}
.btn-icon { position: relative; }

.pokedex-modal-content { max-width: 480px; max-height: 88vh; overflow-y: auto; }
.dex-count { font-size: 12px; color: #888; font-weight: 400; }

.dex-progress-wrap {
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.dex-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #66bb6a, #43a047);
  border-radius: 4px;
  transition: width 0.4s;
  width: 0%;
}

/* 图鉴网格 */
.dex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}
.dex-card {
  position: relative;
  background: #f8f9fa;
  border: 2px solid #eee;
  border-left: 4px solid #ccc;
  border-radius: 10px;
  padding: 6px 4px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.dex-card:hover { transform: translateY(-2px); box-shadow: 0 3px 8px rgba(0,0,0,0.12); }
.dex-card.seen { background: #f5f5f5; }
.dex-card.caught { background: #fff8e1; border-color: #ffd54f; }
.dex-card.unseen { opacity: 0.7; }
.dex-no { font-size: 9px; color: #aaa; font-variant-numeric: tabular-nums; }
.dex-img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; margin: 2px auto; display: block; }
.dex-card.unseen .dex-img { display: none; }
.dex-silhouette { font-size: 28px; line-height: 48px; height: 48px; color: #ccc; }
.dex-silhouette.small { font-size: 20px; line-height: 32px; height: 32px; }
.dex-name { font-size: 11px; font-weight: 600; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-card.unseen .dex-name { color: #aaa; }
.dex-type { font-size: 9px; margin-top: 1px; }
.dex-card.unseen .dex-type { color: #bbb; }
.dex-mark { position: absolute; top: 2px; right: 4px; font-size: 11px; }

/* 详情视图 */
.dex-back-btn { margin-bottom: 10px; font-size: 12px; padding: 5px 12px; }
.dex-detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.dex-detail-img { width: 80px; height: 80px; object-fit: contain; image-rendering: pixelated; }
.dex-detail-info { flex: 1; }
.dex-detail-no { font-size: 11px; color: #999; }
.dex-detail-name { font-size: 20px; font-weight: 700; color: #333; margin: 2px 0; }
.dex-detail-type { margin: 4px 0; }
.dex-detail-status { font-size: 11px; color: #777; }

.dex-type-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin: 1px;
}

.dex-detail-section { margin-bottom: 12px; }
.dex-detail-title {
  font-size: 12px;
  font-weight: 700;
  color: #4a90d9;
  margin-bottom: 6px;
  padding-bottom: 3px;
  border-bottom: 1px solid #eee;
}

/* 进化链 */
.dex-evo-chain { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.dex-evo-stage { text-align: center; padding: 4px; }
.dex-evo-img { width: 44px; height: 44px; object-fit: contain; image-rendering: pixelated; }
.dex-evo-name { font-size: 10px; color: #333; margin-top: 2px; }
.dex-evo-lv { font-size: 9px; color: #aaa; }
.dex-evo-stage.unknown .dex-evo-name { color: #aaa; }
.dex-evo-arrow { color: #bbb; font-size: 16px; padding: 0 2px; }
.dex-cur { color: #4a90d9; font-size: 9px; }

/* 相克 */
.dex-matchup-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 11px; }
.dex-matchup-label { width: 72px; color: #777; flex-shrink: 0; }
.dex-matchup-list { display: flex; flex-wrap: wrap; gap: 2px; }
.dex-empty { color: #bbb; font-size: 11px; }

/* 技能 */
.dex-skill-list { display: flex; flex-wrap: wrap; gap: 4px; }
.dex-skill-chip {
  display: inline-block;
  padding: 3px 9px;
  background: #f0f4ff;
  border-radius: 10px;
  font-size: 11px;
  color: #333;
}
.dex-skill-chip small { color: #999; }

/* ============ 宠物属性查看 ============ */
.stats-modal-content { max-width: 380px; max-height: 85vh; overflow-y: auto; }
.stats-empty { text-align: center; color: #999; padding: 30px 0; font-size: 14px; }
.stats-empty-inline { color: #aaa; font-size: 12px; }

.stats-section { margin-bottom: 14px; }
.stats-section-title {
  font-size: 13px;
  font-weight: 700;
  color: #4a90d9;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eee;
}
.stats-sub-label { font-size: 11px; color: #999; margin: 6px 0 4px; }

.stats-pet-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
}
.stats-pet-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  image-rendering: pixelated;
}
.stats-pet-info { flex: 1; }
.stats-pet-name { font-size: 18px; font-weight: 700; color: #333; }
.stats-pet-species { font-size: 13px; color: #666; margin: 2px 0; }
.stats-pet-level { font-size: 12px; color: #888; }

/* 进度条行 */
.stats-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  font-size: 12px;
}
.stats-bar-label { width: 60px; color: #666; flex-shrink: 0; }
.stats-bar-wrap {
  flex: 1;
  height: 10px;
  background: #f0f0f0;
  border-radius: 5px;
  overflow: hidden;
}
.stats-bar-fill { height: 100%; border-radius: 5px; transition: width 0.3s; }
.stats-bar-fill.hp-fill { background: linear-gradient(90deg, #ef5350, #e53935); }
.stats-bar-fill.satiety-fill { background: linear-gradient(90deg, #ffa726, #fb8c00); }
.stats-bar-fill.exp-fill { background: linear-gradient(90deg, #66bb6a, #43a047); }
.stats-bar-text { width: 64px; text-align: right; color: #555; flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* 战斗属性网格 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.stat-cell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 10px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 12px;
}
.stat-cell-label { color: #777; }
.stat-cell-value { font-weight: 700; color: #333; }
.stat-cell-value.win { color: #43a047; }
.stat-cell-value.lose { color: #e53935; }

/* 装备列表 */
.stats-equip-list { display: flex; flex-direction: column; gap: 4px; }
.stats-equip-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: #f8f9fa;
  border-radius: 8px;
  font-size: 12px;
}
.stats-equip-row.equipped { background: #fff8e1; }
.equip-slot { width: 40px; color: #888; flex-shrink: 0; }
.equip-emoji { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.equip-emoji svg { width: 20px; height: 20px; }
.equip-name { color: #333; font-weight: 600; }
.equip-stats { margin-left: auto; color: #4a90d9; font-size: 11px; }
.equip-empty { color: #bbb; }

/* 技能 chip */
.skill-chip-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  color: #fff;
  background: #8d6e63;
}
.skill-chip.equipped { box-shadow: 0 0 0 2px #ffd54f; }
.skill-chip.type-fire { background: #e53935; }
.skill-chip.type-water { background: #1e88e5; }
.skill-chip.type-grass { background: #43a047; }
.skill-chip.type-electric { background: #fdd835; color: #333; }
.skill-chip.type-normal { background: #8d6e63; }
.skill-chip.type-bug { background: #8bc34a; }
.skill-chip.type-poison { background: #9c27b0; }
.skill-chip.type-ground { background: #8d6e63; }
.skill-chip.type-rock { background: #795548; }
.skill-chip.type-psychic { background: #ec407a; }
.skill-chip.type-ice { background: #4fc3f7; color: #1a237e; }
.skill-chip.type-ghost { background: #5e35b1; }
.skill-chip.type-dragon { background: #7c4dff; }
.skill-chip.type-fighting { background: #d84315; }
.skill-chip.type-flying { background: #5c6bc0; }
.skill-chip.type-fairy { background: #f48fb1; color: #6a1b3a; }

/* ============ 队伍(精灵球)============ */
.party-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 420px;
  overflow-y: auto;
  margin-bottom: 8px;
}
.party-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #fff9e6;
  border: 1px solid #ffe082;
  border-left: 4px solid #ccc;
  border-radius: 12px;
}
.party-card.active {
  background: #e3f2fd;
  border-color: #4a90d9;
  border-left-color: #4a90d9;
  box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.25);
}
.party-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.party-info { flex: 1; min-width: 0; }
.party-name {
  font-size: 14px;
  font-weight: 700;
  color: #333;
}
.party-species { font-size: 11px; color: #888; font-weight: 400; }
.party-cur { font-size: 10px; color: #4a90d9; font-weight: 700; }
.party-meta { font-size: 11px; color: #666; margin: 2px 0; }
.party-hp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}
.party-hp-row .hp-bar-wrap { width: 100px; }
.party-sat { font-size: 10px; color: #aaa; margin-top: 2px; }
.party-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.party-actions .btn { font-size: 11px; padding: 5px 10px; }

/* 战斗中:切换/扔球 操作区 */
.battle-extra-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: center;
}
.battle-extra-actions .btn { font-size: 12px; padding: 6px 12px; }
.btn-ball { background: #e53935; color: #fff; }
.btn-switch { background: #5c6bc0; color: #fff; }

/* 战斗中切换宝可梦列表 */
.battle-switch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.battle-switch-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
}
.battle-switch-card:disabled,
.battle-switch-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.battle-switch-card.active {
  border-color: #4a90d9;
  background: #e3f2fd;
}
.battle-switch-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
}
.battle-switch-info { flex: 1; }
.battle-switch-name { font-weight: 700; }
.battle-switch-hp { font-size: 10px; color: #888; }
.battle-switch-fought { font-size: 10px; color: #e53935; font-weight: 700; }

/* 扔球选择 */
.ball-pick-list {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.ball-pick-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}
.ball-pick-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.ball-pick-btn svg { width: 22px; height: 22px; }
.ball-pick-count { color: #d8436a; font-weight: 700; }

/* ============ 场景布置 ============ */
.settings-modal-content { max-width: 400px; max-height: 85vh; overflow-y: auto; }
.scene-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}
.scene-card {
  position: relative;
  height: 56px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  transition: transform 0.18s, box-shadow 0.2s, border-color 0.18s;
  background-size: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.scene-card:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 6px 14px rgba(0,0,0,0.2); }
.scene-card.active { border-color: #fff; box-shadow: 0 0 0 3px rgba(74,144,217,0.5), 0 4px 12px rgba(0,0,0,0.18); }
.scene-card.locked { filter: grayscale(0.55) brightness(0.82); }
.scene-card.too-expensive { filter: grayscale(0.7) brightness(0.7); }
.scene-card.too-expensive::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(0,0,0,0.12) 6px 12px);
  pointer-events: none;
}
.scene-emoji {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.scene-name {
  font-size: 9px;
  color: #fff;
  background: rgba(0,0,0,0.45);
  padding: 1px 4px;
  border-radius: 6px;
  margin-bottom: 3px;
  white-space: nowrap;
}
.scene-mark {
  position: absolute;
  top: 3px;
  right: 4px;
  font-size: 12px;
  color: #4a90d9;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.scene-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  font-size: 16px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.scene-price {
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ffb74d, #ff8a3d);
  padding: 1px 6px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  white-space: nowrap;
}

/* ============ 移动端适配 ============ */

/* 基础:禁用点击高亮 + 长按选中,更像原生 App */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}
body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* 100dvh 兼容 iOS Safari 地址栏伸缩 */
  min-height: 100vh;
  min-height: 100dvh;
}
.app {
  min-height: 100vh;
  min-height: 100dvh;
  /* 顶部刘海 + 底部 Home Indicator 安全区 */
  padding-top: max(10px, env(safe-area-inset-top));
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

/* 输入框 font-size ≥ 16px,防 iOS 聚焦自动放大 */
input, textarea, select {
  font-size: 16px;
}

/* 允许输入框选中(其他元素仍禁用长按) */
input, textarea, [contenteditable] {
  -webkit-user-select: text;
  user-select: text;
}

/* 小屏(≤360px):压缩字号/间距,防 5 列按钮挤 */
@media (max-width: 360px) {
  .app {
    padding: 6px 8px max(12px, env(safe-area-inset-bottom));
    gap: 7px;
  }
  .pet-name { font-size: 16px; }
  .btn-icon { width: 34px; height: 34px; font-size: 18px; }
  .resource-chip { font-size: 12px; padding: 4px 10px; }
  .action-row { gap: 4px; }
  .action-row .btn { padding: 7px 2px; border-radius: 12px; }
  .action-icon { font-size: 18px; }
  .action-label { font-size: 11px; }
  .modal-content { padding: 16px; border-radius: 18px; }
  .modal-title { font-size: 17px; }
  .lottery-actions .btn { font-size: 12px; padding: 7px 6px; min-width: 70px; }
  .pet-stage { width: 160px; height: 160px; }
  .pet-gif { width: 120px; height: 120px; }
}

/* 横屏(高度 < 500px):宠物区压缩,避免内容溢出 */
@media (max-height: 500px) and (orientation: landscape) {
  .app { gap: 6px; }
  .pet-section { min-height: 160px; flex: 0 0 auto; }
  .pet-stage { width: 150px; height: 150px; }
  .pet-gif { width: 110px; height: 110px; }
  .control-panel, .task-section { padding: 8px; }
  .modal { padding: 8px; }
  .modal-content { max-height: 96vh; max-height: 96dvh; overflow-y: auto; }
}

/* 大屏(≥640px,如 iPad 竖屏/横屏):卡片不要拉满,留白更舒服 */
@media (min-width: 640px) {
  .app {
    max-width: 520px;
    gap: 14px;
    padding-top: max(14px, env(safe-area-inset-top));
  }
  .pet-stage { width: 220px; height: 220px; }
  .pet-gif { width: 165px; height: 165px; }
}

/* 超大屏(≥1024px,iPad 横屏 / 桌面):居中限宽,两侧留背景 */
@media (min-width: 1024px) {
  .app { max-width: 560px; }
}

/* modal 小屏近乎全屏,避免内容溢出 */
@media (max-width: 380px) {
  .modal-content {
    max-width: 94vw !important;
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;
  }
}

/* 抽奖 3 按钮在窄屏换行不溢出 */
.lottery-actions {
  flex-wrap: wrap;
}
@media (max-width: 360px) {
  .lottery-actions .btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
}

/* 防止场景特效元素超出视窗产生横向滚动 */
.scene-fx { overflow: hidden; }
#sceneBg { overflow: hidden; }

/* 长按按钮防选中文字 */
.btn, .btn-icon, .action-row .btn, .scene-card, .starter-card, .shop-item, .task-item {
  -webkit-user-select: none;
  user-select: none;
}
