/* ============================================================
   欢欢的猫狗屋 · 森系暖调悬浮卡片 UI
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }

:root {
  --cream: #FFFBF2;
  --cream-dark: #F5E8D0;
  --accent: #E8A33D;
  --accent-dark: #C47F1F;
  --green: #8BAE6B;
  --green-dark: #6B8E4E;
  --red: #D4765A;
  --pink: #E89AB0;
  --purple: #B89AD4;
  --ink: #5C4A3A;
  --ink-light: #9A8570;
  --soft-shadow: 0 4px 20px rgba(80, 55, 30, 0.15);
  --soft-shadow-lg: 0 8px 32px rgba(80, 55, 30, 0.25);
  --inner-highlight: inset 0 1px 0 rgba(255,255,255,0.7);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: linear-gradient(135deg, #4A3828 0%, #3A2A1E 50%, #2E2015 100%);
  color: var(--ink);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  display: flex;
  justify-content: center;
}

#shell {
  width: 100%;
  max-width: 520px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #2E2015;
  box-shadow: 0 0 80px rgba(0,0,0,0.6);
}

/* ========== 游戏画布区 ========== */
#game-wrap {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: #000;
}
#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  filter: contrast(1.02) saturate(1.05);
  touch-action: none;
}
#game3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  pointer-events: none;
  padding: 0;
  background: none;
}

/* 顶部标题栏：森系暖调渐变条 */
#hud-title {
  text-align: center;
  margin: 0;
  padding: 12px 16px 10px;
  background: linear-gradient(180deg, rgba(74,56,40,0.85) 0%, rgba(74,56,40,0.6) 70%, rgba(74,56,40,0) 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  position: relative;
}
/* 标题两侧装饰叶子 */
#hud-title::before,
#hud-title::after {
  content: "🌿";
  position: absolute;
  top: 14px;
  font-size: 16px;
  opacity: 0.8;
}
#hud-title::before { left: 18px; transform: scaleX(-1); }
#hud-title::after { right: 18px; }

.hud-title-text {
  font-size: 20px;
  font-weight: 900;
  color: #FFF5E0;
  letter-spacing: 3px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.15);
}
.hud-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(180deg, #F0A8B8, #E088A0);
  border-radius: 12px;
  padding: 3px 10px;
  vertical-align: middle;
  box-shadow: 0 2px 8px rgba(224,136,160,0.4), var(--inner-highlight);
  font-weight: 700;
}
.scene-pill {
  display: inline-block;
  margin-left: 8px;
  font-size: 11px;
  color: #fff;
  background: linear-gradient(180deg, #A5C885, #7E9B57);
  border-radius: 12px;
  padding: 3px 12px;
  box-shadow: 0 2px 8px rgba(126,155,87,0.4), var(--inner-highlight);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  font-weight: 700;
}

/* 统计栏：右上角悬浮胶囊组 */
#hud-stats {
  position: absolute;
  top: 8px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  margin-top: 0;
  padding: 0;
  z-index: 30;
}
.hud-stat {
  background: rgba(255, 251, 242, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 3px 12px;
  font-size: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18), var(--inner-highlight);
  font-weight: 800;
  white-space: nowrap;
  color: var(--ink);
  border: 1.5px solid rgba(255,255,255,0.6);
  min-width: 60px;
  text-align: right;
}

.hud-stat .ico { font-size: 13px; margin-right: 2px; }

#hud-clock {
  text-align: center;
  margin-top: 6px;
  font-size: 11px;
  color: #FFF5E0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  font-weight: 600;
  letter-spacing: 1px;
}
#touch-cue {
  position: absolute;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(74,56,40,0.9);
  backdrop-filter: blur(8px);
  color: #FFF5E0;
  font-size: 12px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(255,255,255,0.2);
  z-index: 19;
  animation: cuePulse 2s infinite;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
@keyframes cuePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ========== 底部 Dock：悬浮卡片式 ========== */
#dock {
  background: linear-gradient(180deg, rgba(74,56,40,0.0) 0%, rgba(74,56,40,0.4) 30%, rgba(60,42,28,0.95) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 14px 10px calc(16px + env(safe-area-inset-bottom));
  gap: 8px;
  z-index: 30;
  position: relative;
}
/* Dock 顶部装饰线 */
#dock::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.dock-btn {
  position: relative;
  border: none;
  background: linear-gradient(180deg, #FFF8EC 0%, #F5E8D0 100%);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 0 9px;
  cursor: pointer;
  box-shadow:
    var(--inner-highlight),
    inset 0 -2px 4px rgba(140,90,40,0.12),
    0 4px 12px rgba(0,0,0,0.18);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  border: 1.5px solid rgba(255,255,255,0.5);
}
.dock-btn:active {
  transform: translateY(3px) scale(0.94);
  box-shadow:
    inset 0 2px 8px rgba(120,70,30,0.25),
    0 1px 4px rgba(0,0,0,0.12);
}
.d-ico {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.15));
}
.d-txt {
  font-size: 10.5px;
  font-weight: 800;
  color: #7A5530;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  letter-spacing: 0.5px;
}
.dot {
  position: absolute;
  top: 5px; right: 7px;
  width: 11px; height: 11px;
  background: linear-gradient(180deg, #F09080, #E07060);
  border: 2px solid #fff;
  border-radius: 50%;
  display: none;
  box-shadow: 0 2px 6px rgba(224,112,96,0.5);
}
.dot.show { display: block; animation: dotBlink 1.2s infinite; }
@keyframes dotBlink { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.8); } }

/* ========== 弹窗 ========== */
.modal-root {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: rgba(40,28,18,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: 100%;
  max-width: 460px;
  max-height: 88%;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 20%),
    var(--cream);
  border: none;
  border-radius: 28px;
  box-shadow:
    var(--inner-highlight),
    0 20px 60px rgba(0,0,0,0.4),
    0 6px 16px rgba(0,0,0,0.15);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.4);
}
.modal.modal-center { width: 92%; max-width: 380px; }
@keyframes popIn { from { transform: scale(0.8) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }

.modal-head {
  background: linear-gradient(180deg, #E8CFA8 0%, #D4B896 60%, #C4A882 100%);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--inner-highlight), 0 3px 10px rgba(0,0,0,0.12);
  position: relative;
}
/* 弹窗标题装饰 */
.modal-head::before {
  content: "🐾";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
}
.modal-head h2 {
  font-size: 17px;
  color: #FFF8EC;
  letter-spacing: 2px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.25);
  font-weight: 800;
  padding-left: 20px;
}
.modal-x {
  border: none;
  background: linear-gradient(180deg, #FFF8EC, #F0E0C8);
  color: #8A6540;
  font-size: 17px;
  font-weight: 800;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--inner-highlight), 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.15s ease;
}
.modal-x:active { transform: translateY(1px) scale(0.92); }
.modal-body {
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* 通用控件 */
.btn {
  display: inline-block;
  border: none;
  background: linear-gradient(180deg, #FFF0D0 0%, #F0D8A8 50%, #E5C088 100%);
  color: #7A5530;
  font-size: 14px;
  font-weight: 800;
  padding: 11px 24px;
  border-radius: 18px;
  cursor: pointer;
  box-shadow:
    var(--inner-highlight),
    inset 0 -2px 4px rgba(140,90,40,0.12),
    0 4px 12px rgba(0,0,0,0.18);
  text-align: center;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  border: 1.5px solid rgba(255,255,255,0.4);
}
.btn:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 8px rgba(120,70,30,0.25),
    0 1px 4px rgba(0,0,0,0.12);
}
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-green {
  background: linear-gradient(180deg, #C0E0A0 0%, #9DC079 50%, #7E9B57 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.btn-red {
  background: linear-gradient(180deg, #F0B098 0%, #E08868 50%, #C75B39 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.btn-big { display: block; width: 100%; padding: 14px; font-size: 16px; border-radius: 20px; }
.btn-sm { padding: 8px 16px; font-size: 12px; border-radius: 14px; }

.sec-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-dark);
  margin: 18px 0 12px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
  letter-spacing: 1px;
  border-radius: 2px;
  position: relative;
}
.sec-title::before {
  content: "✦";
  position: absolute;
  left: -2px;
  top: -2px;
  font-size: 8px;
  color: var(--accent);
}
.sec-title:first-child { margin-top: 0; }

.sec-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-dark);
  margin: 12px 0 8px;
  padding-left: 8px;
  border-left: 3px solid rgba(255, 170, 100, 0.8);
  letter-spacing: 1px;
  background: rgba(255, 240, 220, 0.5);
  border-radius: 0 8px 8px 0;
}

/* ===== NPC 聊天面板 ===== */
.npc-chat {
  display: flex;
  flex-direction: column;
  height: 520px;
  max-height: 74vh;
}
/* 氛围背景（方案C）：完整图 contain 居中不裁切 + 同一张图模糊放大铺满，聊天内容半透明浮上层 */
.npc-chat.wtbg {
  position: relative;
  background: transparent;
  border-radius: 14px;
  overflow: hidden;
  padding: 8px;
  gap: 8px;
}
.npc-chat.wtbg::before {
  content: "";
  position: absolute;
  inset: -18px;
  background-image: inherit;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  filter: blur(18px);
  transform: scale(1.1);
  z-index: 0;
}
.npc-chat.wtbg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: contain;
  background-position: center 26%;
  background-repeat: no-repeat;
  z-index: 1;
}
.npc-chat.wtbg > * { position: relative; z-index: 2; }
.npc-chat.wtbg .npc-msgs {
  background: linear-gradient(180deg, rgba(255,251,242,0.55), rgba(251,243,227,0.4));
  border: 1px solid rgba(255,255,255,0.55);
}
.npc-chat.wtbg .npc-input {
  background: rgba(255,253,246,0.6);
}
.npc-msgs {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 8px;
  background: linear-gradient(180deg, #FFFDF6, #FBF3E3);
  border-radius: 12px;
  border: 1px solid rgba(200,155,110,0.35);
  margin-bottom: 10px;
}
.npc-msg { display: flex; margin: 6px 0; }
.npc-msg.npc { justify-content: flex-start; }
.npc-msg.you { justify-content: flex-end; }
.npc-msg .bub {
  max-width: 78%;
  padding: 8px 11px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.npc-msg.npc .bub {
  background: #FFFFFF;
  color: #5C4A3A;
  border: 1px solid #E7D3B4;
  border-top-left-radius: 4px;
}
.npc-msg.you .bub {
  background: linear-gradient(180deg, #FFD9A8, #FFC98A);
  color: #6B4A26;
  border: 1px solid #F0B978;
  border-top-right-radius: 4px;
}
.npc-input { display: flex; gap: 8px; }
.npc-input input {
  flex: 1;
  border: 1px solid #D9BE96;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 14px;
  background: #FFFDF6;
  color: #5C4A3A;
  outline: none;
}
.npc-input input:focus { border-color: #E0A45E; box-shadow: 0 0 0 2px rgba(224,164,94,0.25); }
.npc-input .btn { flex-shrink: 0; padding: 9px 16px; }

/* ===== NPC 打招呼确认框 ===== */
.npc-greet {
  font-size: 15px;
  line-height: 1.6;
  color: #5C4A3A;
  background: #FFFDF6;
  border: 1px solid #EAD6B8;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
  text-align: center;
}
.npc-ask {
  font-size: 14px;
  font-weight: 700;
  color: #6B4A26;
  text-align: center;
  margin-bottom: 14px;
}
.npc-ask-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.npc-ask-btns .btn { flex: 1; max-width: 150px; }

/* 进度条 */
.bar {
  height: 18px;
  background: linear-gradient(180deg, #E8D5B8, #F0E2C8);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(120,80,40,0.2), inset 0 -1px 0 rgba(255,255,255,0.4);
}
.bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(180deg, #FFD888 0%, #F5B050 50%, #E89838 100%);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
  transition: width 0.4s ease;
}
.bar-green > i { background: linear-gradient(180deg, #C8E8A8 0%, #95C070 50%, #7E9B57 100%); }
.bar-red > i { background: linear-gradient(180deg, #F8B8A0 0%, #E89070 50%, #C75B39 100%); }

/* 网格卡片 */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.card {
  background: linear-gradient(180deg, #FFFEF8, #FBF2E2 95%);
  border-radius: 18px;
  padding: 10px 6px;
  text-align: center;
  position: relative;
  box-shadow: var(--inner-highlight), 0 4px 14px rgba(90,60,30,0.1);
  border: 1.5px solid rgba(255,255,255,0.5);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card:active { transform: scale(0.94); }
.card.got { background: linear-gradient(180deg, #F2F8E8, #E7F0D5); }
.card .c-pix {
  width: 52px; height: 52px;
  margin: 6px auto 7px;
  image-rendering: auto;
  border-radius: 16px;
  background: linear-gradient(180deg, #F8ECD8, #ECD8BC);
  box-shadow: inset 0 0 0 1px rgba(140,90,50,0.1);
}
.card.locked .c-pix { filter: brightness(0.88) saturate(0.35); }
.card .c-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(232,213,184,0.65);
  backdrop-filter: blur(3px);
  border-radius: 18px;
}
.card .c-name { font-size: 11.5px; font-weight: 800; color: var(--ink); }
.card .c-desc { font-size: 10px; color: var(--ink-light); margin-top: 2px; line-height: 1.3; }

/* 商店条目 */
.shop-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, #FFFEF8, #FBF2E2 95%);
  border-radius: 18px;
  padding: 12px 15px;
  margin-bottom: 12px;
  box-shadow: var(--inner-highlight), 0 4px 14px rgba(90,60,30,0.08);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.shop-row .s-ico { font-size: 32px; width: 42px; text-align: center; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1)); }
.shop-row .s-img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15)); flex-shrink: 0; }
.shop-row .s-info { flex: 1; min-width: 0; }
.shop-row .s-name { font-size: 13.5px; font-weight: 800; }
.shop-row .s-desc { font-size: 11px; color: var(--ink-light); margin-top: 2px; }
.shop-row .s-cost { font-size: 13px; font-weight: 900; color: var(--red); margin-top: 4px; }

/* 任务列表 */
.quest-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #FFFEF8, #FBF2E2 95%);
  border-radius: 18px;
  padding: 12px 15px;
  margin-bottom: 12px;
  box-shadow: var(--inner-highlight), 0 4px 14px rgba(90,60,30,0.08);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.quest-row .q-ico { font-size: 24px; }
.quest-row .q-info { flex: 1; min-width: 0; }
.quest-row .q-name { font-size: 13px; font-weight: 800; }
.quest-row .q-prog { font-size: 11px; color: var(--ink-light); margin-top: 3px; }
.quest-row.done { background: linear-gradient(180deg, #F2F8E8, #E7F0D5); }
.quest-row.done .q-name { color: var(--green-dark); }

/* 彩蛋纸条 */
.note-card {
  background: linear-gradient(180deg, #FFF8E8, #FFF0D8);
  border-radius: 20px;
  padding: 22px 20px;
  text-align: center;
  box-shadow: var(--inner-highlight), 0 6px 20px rgba(90,60,30,0.12);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.note-card .note-text { font-size: 15px; line-height: 2; color: var(--ink); font-weight: 700; }
.note-card .note-reward {
  margin-top: 14px;
  font-size: 14px;
  color: var(--red);
  font-weight: 900;
}
.streak-pill {
  display: inline-block;
  background: linear-gradient(180deg, #F8C070, #E89838 70%, #D98227);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 5px 16px;
  border-radius: 999px;
  margin-bottom: 12px;
  box-shadow: 0 3px 10px rgba(232,152,56,0.4), var(--inner-highlight);
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* 生日大卡 */
.birthday-hero {
  background: linear-gradient(160deg, #FFD9A0 0%, #FFA8B8 50%, #E88AA0 100%);
  border-radius: 28px;
  padding: 28px 20px;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  box-shadow: var(--inner-highlight), 0 10px 30px rgba(0,0,0,0.25);
}
.birthday-hero .b-title { font-size: 26px; font-weight: 900; letter-spacing: 4px; }
.birthday-hero .b-sub { margin-top: 14px; font-size: 14px; line-height: 2; opacity: 0.95; }
.birthday-hero .b-cake { font-size: 48px; display: block; margin-bottom: 10px; }

/* 统计格子 */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-cell {
  background: linear-gradient(180deg, #FFFEF8, #FBF2E2 95%);
  border-radius: 18px;
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--inner-highlight), 0 4px 14px rgba(90,60,30,0.08);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.stat-cell .v { font-size: 18px; font-weight: 900; color: var(--accent-dark); }
.stat-cell .k { font-size: 10.5px; color: var(--ink-light); font-weight: 700; margin-top: 4px; }

/* 宠物状态条 */
.petbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #FFFEF8, #FBF2E2 95%);
  border-radius: 18px;
  padding: 10px 15px;
  margin-bottom: 12px;
  box-shadow: var(--inner-highlight), 0 4px 14px rgba(90,60,30,0.08);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.petbar .p-ico {
  width: 40px; height: 40px;
  image-rendering: auto;
  border-radius: 14px;
  background: linear-gradient(180deg, #F8ECD8, #ECD8BC);
  box-shadow: inset 0 0 0 1px rgba(140,90,50,0.1);
}
.petbar .p-info { flex: 1; min-width: 0; }
.petbar .p-name { font-size: 13.5px; font-weight: 900; }
.petbar .p-bars { display: flex; gap: 6px; margin-top: 5px; }
.petbar .p-bars .bar { flex: 1; height: 10px; }
.petbar .p-tag { font-size: 10.5px; font-weight: 800; color: var(--accent-dark); }

/* 成就弹窗 */
.achieve-pop {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: linear-gradient(180deg, #FFF0C2, #FFD46A);
  border-radius: 22px;
  padding: 16px 24px;
  text-align: center;
  box-shadow: var(--inner-highlight), 0 10px 30px rgba(0,0,0,0.3);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  width: 78%;
  border: 2px solid rgba(255,255,255,0.5);
}
.achieve-pop .a-t { font-size: 11px; font-weight: 900; color: #8B6914; letter-spacing: 2px; }
.achieve-pop .a-n { font-size: 16px; font-weight: 900; color: #5C3A1E; margin-top: 4px; }

/* Toast */
#toast-root {
  position: absolute;
  top: 12px; left: 0; right: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
.toast {
  background: rgba(74,56,40,0.92);
  backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: #FFF5E0;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 999px;
  animation: toastIn 0.3s ease;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}
@keyframes toastIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 设置 */
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #FFFEF8, #FBF2E2 95%);
  border-radius: 18px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: var(--inner-highlight), 0 4px 14px rgba(90,60,30,0.08);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.switch {
  width: 52px; height: 30px;
  background: #C9B394;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: inset 0 2px 5px rgba(90,60,30,0.25);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 24px; height: 24px;
  background: linear-gradient(180deg, #fff, #EDE3D2);
  border-radius: 50%;
  transition: left 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.switch.on { background: var(--green); }
.switch.on::after { left: 25px; }

/* ===== 点击宠物互动面板 ===== */
.pa-head { text-align: center; margin-bottom: 12px; }
.pa-pix {
  width: 110px; height: 110px;
  margin: 0 auto 8px;
  border-radius: 26px;
  background: linear-gradient(180deg, #FBF1DE, #EFDDC0);
  image-rendering: auto;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.5),
    inset 0 -5px 12px rgba(120,70,30,0.15),
    0 6px 16px rgba(0,0,0,0.15);
}
.pa-name { font-size: 19px; font-weight: 900; color: var(--ink); }
.pa-lv { font-size: 11.5px; color: var(--accent-dark); font-weight: 800; margin-top: 4px; }
.pa-mood {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, #FFFEF8, #FBF2E2 95%);
  border-radius: 18px;
  padding: 12px 15px;
  margin: 10px 0;
  box-shadow: var(--inner-highlight), 0 4px 14px rgba(90,60,30,0.08);
  border: 1.5px solid rgba(255,255,255,0.5);
}
.pa-mood-label { font-size: 12.5px; font-weight: 900; color: var(--ink); white-space: nowrap; }
.pa-mood .bar { flex: 1; }
.pa-mood-num { font-size: 18px; font-weight: 900; color: var(--red); white-space: nowrap; }
.pa-mood-tag { font-size: 11.5px; font-weight: 800; color: var(--accent-dark); white-space: nowrap; }
.pa-sub {
  display: flex;
  justify-content: space-around;
  font-size: 11.5px;
  color: var(--ink-light);
  font-weight: 700;
  margin: 8px 0 14px;
}
.pa-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.pa-btn {
  padding: 12px 4px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border-radius: 16px;
}
.pa-btn-green {
  background: linear-gradient(180deg, #C0E0A0, #9DC079 55%, #7E9B57 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.pa-btn-red {
  background: linear-gradient(180deg, #F0B098, #E08868 55%, #C75B39 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

/* 性格标签徽章 */
.pa-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #E8B56E, #D08A3E);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 2px;
  box-shadow: 0 1px 3px rgba(120,70,20,0.3);
}
.c-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #E8B56E, #D08A3E);
  border-radius: 999px;
  padding: 1px 7px;
  margin: 3px 0;
}

/* 指令训练 */
.pa-tricks-title {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--ink);
  margin: 14px 0 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pa-tricks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.trick-btn {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  background: linear-gradient(180deg, #FFFDF7, #F5E6CE);
  border: 1.5px solid #E4C7A0;
  border-radius: 999px;
  padding: 7px 12px;
  box-shadow: 0 2px 6px rgba(120,70,20,0.1);
  cursor: pointer;
}
.trick-btn.on {
  background: linear-gradient(180deg, #FFE9B0, #F2C877);
  border-color: #D9A23E;
  color: #6B4A12;
}
.trick-btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}
.pa-perf-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.pa-btn-gold {
  background: linear-gradient(180deg, #F7D87E, #E8B83E 55%, #C98F1B 100%);
  color: #fff;
  text-shadow: 0 1px 3px rgba(120,70,0,0.3);
  border-radius: 14px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 800;
}

/* 表演编排 */
.perf-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 6px;
}
.perf-seq-title {
  font-size: 12.5px;
  font-weight: 900;
  color: var(--ink);
  margin: 12px 0 6px;
}
.perf-seq {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  align-items: center;
}
.perf-seq-item {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, #F7B0B8, #E06878);
  border-radius: 999px;
  padding: 5px 11px;
}
.muted { opacity: 0.6; }

/* 引导 */
.guide-step { text-align: center; padding: 8px 6px; }
.guide-step .g-emoji { font-size: 52px; display: block; margin-bottom: 12px; }
.guide-step .g-text { font-size: 14.5px; line-height: 2; font-weight: 700; }
.guide-dots { display: flex; justify-content: center; gap: 10px; margin: 16px 0 10px; }
.guide-dots i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #D9C9B4;
  transition: all 0.3s ease;
}
.guide-dots i.on { background: var(--accent); transform: scale(1.3); }

.hidden { display: none !important; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.center { text-align: center; }
.small { font-size: 11px; color: var(--ink-light); }

/* ========== 领养中心 ========== */
.adopt-tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 14px 0 10px;
}
.adopt-tab {
  border: none;
  background: rgba(255,255,255,0.5);
  color: var(--ink-light);
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 18px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}
.adopt-tab:hover { background: rgba(255,255,255,0.8); }
.adopt-tab.active {
  background: linear-gradient(180deg, #F5A623, #E8941A);
  color: #fff;
  box-shadow: 0 3px 10px rgba(232,148,26,0.4);
}

.adopt-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.adopt-card {
  display: flex;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,248,236,0.95) 100%);
  border-radius: 20px;
  padding: 14px;
  box-shadow:
    var(--inner-highlight),
    0 4px 14px rgba(120,80,40,0.15);
  border: 1.5px solid rgba(255,255,255,0.6);
  transition: transform 0.2s ease;
}
.adopt-card:hover { transform: translateY(-2px); }
.adopt-card-img {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #FFF5E6, #FFE8CC);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.adopt-card-img img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}
.adopt-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.adopt-card-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 3px;
}
.adopt-card-type {
  font-size: 14px;
}
.adopt-card-desc {
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.5;
  margin-bottom: 4px;
}
.adopt-card-likes {
  font-size: 11px;
  color: #D4786A;
  margin-bottom: 6px;
}
.btn-adopt {
  align-self: flex-start;
  background: linear-gradient(180deg, #F5A623, #E8941A);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(232,148,26,0.35);
}

/* ========== 宠物管理 ========== */
.pet-manager-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}
.pet-manager-card {
  display: flex;
  gap: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(255,248,236,0.95) 100%);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 3px 12px rgba(120,80,40,0.12);
  border: 1.5px solid rgba(255,255,255,0.6);
}
.pet-manager-card.inactive {
  opacity: 0.65;
  background: linear-gradient(135deg, rgba(240,235,225,0.8) 0%, rgba(230,225,215,0.85) 100%);
}
.pet-manager-img {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #FFF5E6, #FFE8CC);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pet-manager-img img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}
.pet-manager-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  background: linear-gradient(180deg, #7CB342, #689F38);
  color: #fff;
  box-shadow: 0 2px 6px rgba(104,159,56,0.4);
}
.pet-manager-badge.rest {
  background: linear-gradient(180deg, #9E9E9E, #757575);
  box-shadow: 0 2px 6px rgba(117,117,117,0.4);
}
.pet-manager-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.pet-manager-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 2px;
}
.pet-manager-breed {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-light);
}
.pet-manager-stats {
  font-size: 11.5px;
  color: var(--ink-light);
  margin-bottom: 8px;
}
.pet-manager-actions {
  display: flex;
  gap: 8px;
}
.btn-xs {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 12px;
  font-weight: 700;
}
.btn-warn {
  background: linear-gradient(180deg, #FF8A65, #F4511E);
  color: #fff;
  box-shadow: 0 2px 8px rgba(244,81,30,0.3);
}

/* ========== 改名 ========== */
.rename-preview {
  text-align: center;
  margin: 16px 0;
}
.rename-preview img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.15));
}
.rename-current {
  font-size: 13px;
  color: var(--ink-light);
  margin-top: 8px;
}
.rename-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: rgba(255,255,255,0.8);
  border: 2px solid rgba(200,170,130,0.4);
  border-radius: 16px;
  outline: none;
  transition: border-color 0.2s ease;
  text-align: center;
}
.rename-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
}

/* ========== 装扮系统 ========== */
.pa-outfit-btn {
  text-align: center;
  margin-top: 10px;
}
.pa-btn-outfit {
  background: linear-gradient(180deg, #CE93D8, #AB47BC);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(171,71,188,0.35);
  min-width: 120px;
}

.outfit-slot-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  margin: 12px 0 8px;
  padding-left: 4px;
  border-left: 3px solid var(--accent);
}

.outfit-preview {
  display: flex;
  gap: 14px;
  align-items: center;
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,248,236,0.8));
  border-radius: 18px;
  padding: 14px;
  margin-top: 14px;
  box-shadow: 0 3px 12px rgba(120,80,40,0.1);
}
.outfit-preview img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}
.outfit-current {
  flex: 1;
}
.outfit-current-item {
  font-size: 12.5px;
  color: var(--ink);
  padding: 3px 0;
  font-weight: 600;
}
.outfit-slot-icon {
  margin-right: 4px;
}

.outfit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.outfit-card {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(255,248,236,0.95));
  border-radius: 14px;
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(120,80,40,0.1);
}
.outfit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(120,80,40,0.18);
}
.outfit-card.equipped {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255,243,224,0.95), rgba(255,224,178,0.95));
  box-shadow: 0 3px 12px rgba(245,166,35,0.25);
}
.outfit-card img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  margin-bottom: 6px;
}
.outfit-card-name {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.outfit-card-status {
  font-size: 10px;
  color: var(--ink-light);
  font-weight: 600;
}
.outfit-card.equipped .outfit-card-status {
  color: var(--accent);
}
