/* ranch.css — P1 牧场：牧场卡片 + 动物详情弹窗（暖可爱风，复用 style.css 变量） */

/* ---------- 牧场卡片 ---------- */
.ranch-card {
  background: linear-gradient(160deg, #FFFDF7 0%, #FFF3E0 58%, #F0F7E4 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-top: 12px;
}
.ranch-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ranch-title { font-size: 15px; font-weight: 700; color: var(--brown); }
.ranch-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.ranch-badge {
  font-size: 11px; font-weight: 700; color: #6D4C41;
  background: rgba(255,255,255,.8); padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* 未解锁引导 */
.ranch-locked { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 8px 0 4px; }
.ranch-locked-emoji { font-size: 40px; animation: bounce 2s ease-in-out infinite; }
.ranch-locked-text { font-size: 13px; color: var(--ink); line-height: 1.7; }
.ranch-locked-text b { color: #E65100; }
.ranch-goshop { margin-top: 4px; font-size: 14px; }

/* 开门 */
.ranch-door {
  width: 100%; border: none; border-radius: 14px; padding: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer;
  background: var(--green); color: #fff; box-shadow: 0 3px 0 #558B2F;
  transition: transform .1s, box-shadow .1s;
}
.ranch-door:active { transform: scale(.97); box-shadow: 0 1px 0 #558B2F; }
.ranch-door.opened, .ranch-door:disabled {
  background: var(--green-soft); color: var(--ink-soft); box-shadow: none; cursor: default;
}

/* 自动喂食器 */
.ranch-feeder {
  margin-top: 10px; padding: 7px 12px;
  font-size: 12px; font-weight: 700; color: #558B2F;
  background: rgba(255,255,255,.65); border-radius: 10px;
}

/* 打扫 */
.ranch-clean-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ranch-clean {
  flex: 1; min-width: 110px; border: none; border-radius: 999px; padding: 8px 12px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  background: #FFE0B2; color: #E65100; box-shadow: 0 2px 0 #FFB74D;
  transition: transform .1s;
}
.ranch-clean:active { transform: scale(.95); }

/* 动物列表 */
.ranch-animals { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ranch-empty {
  text-align: center; font-size: 13px; color: var(--ink-soft);
  background: rgba(255,255,255,.55); border-radius: 12px; padding: 18px 10px;
}
.animal-card {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,.85); border: 2px solid #FFD54F;
  border-radius: 16px; padding: 10px 12px;
  transition: border-color .2s, box-shadow .2s;
}
.animal-card.sp-cow { border-color: #81D4FA; }
.animal-card.sp-sheep { border-color: var(--pink); }
.animal-card.patted { border-color: #F48FB1 !important; box-shadow: 0 0 0 3px rgba(244,143,177,.35); }

.animal-avatar {
  flex-shrink: 0; width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px; line-height: 1; cursor: pointer;
  background: var(--bg); border-radius: 18px;
  animation: bounce 2.4s ease-in-out infinite;
}
.animal-card.patted .animal-avatar { animation: r-pet-bounce .5s ease 3; }
@keyframes r-pet-bounce {
  0%,100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.12) rotate(-6deg); }
}

.animal-info { flex: 1; min-width: 0; }
.animal-top { display: flex; align-items: baseline; gap: 6px; }
.animal-name { font-size: 15px; font-weight: 700; color: var(--brown); cursor: pointer; }
.animal-name:active { opacity: .6; }
.animal-age { font-size: 10px; color: var(--ink-soft); }

.animal-mood { margin: 3px 0 6px; font-size: 13px; letter-spacing: 1px; user-select: none; }
.animal-mood.low { filter: grayscale(.8); opacity: .7; }
.mood-txt { margin-left: 5px; font-size: 10px; color: var(--ink-soft); letter-spacing: 0; }

/* 产品状态 */
.animal-product { display: flex; align-items: center; gap: 8px; }
.prod-ready { font-size: 13px; font-weight: 700; color: #E65100; animation: r-pulse 1.2s ease-in-out infinite; }
@keyframes r-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
.ranch-collect { width: auto; margin: 0; padding: 6px 18px; font-size: 13px; border-radius: 999px; box-shadow: 0 2px 0 #558B2F; }
.prod-progress { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.prod-bar { height: 7px; background: rgba(93,64,55,.15); border-radius: 999px; overflow: hidden; }
.prod-bar i { display: block; height: 100%; background: linear-gradient(90deg, #FFD54F, #FFB300); border-radius: 999px; transition: width .5s; }
.prod-remain { font-size: 11px; color: var(--ink-soft); }

/* 照料按钮 */
.animal-care {
  flex-shrink: 0; border: none; border-radius: 999px; padding: 8px 14px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  background: var(--pink); color: #AD1457; box-shadow: 0 2px 0 #F48FB1;
  transition: transform .1s;
}
.animal-care:active { transform: scale(.93); }

/* 摸摸动画：飘爱心 */
.ranch-heart {
  position: absolute; bottom: 45%; font-size: 18px;
  pointer-events: none; z-index: 5;
  animation: r-heart-rise 1.2s ease-out forwards;
}
@keyframes r-heart-rise {
  0% { transform: translateY(0) scale(.5); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(-70px) scale(1.2); opacity: 0; }
}

/* ---------- 动物详情弹窗（#animal-modal） ---------- */
.am-hero { text-align: center; font-size: 56px; line-height: 1.2; animation: bounce 2.4s ease-in-out infinite; }
.am-name { text-align: center; font-size: 20px; font-weight: 700; color: var(--brown); margin-top: 4px; }
.am-sub { text-align: center; font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.am-mood { text-align: center; font-size: 22px; letter-spacing: 3px; margin-top: 10px; user-select: none; }
.am-mood.low { filter: grayscale(.8); opacity: .7; }
.am-tip {
  margin: 10px 0 14px; padding: 8px 12px;
  font-size: 12px; color: var(--ink-soft); text-align: center;
  background: var(--bg); border-radius: 10px;
}
.am-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.am-act {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 8px; font-size: 14px; font-weight: 700; color: var(--brown);
  background: var(--bg); border: 2px solid var(--green-soft); border-radius: 14px;
  cursor: pointer; transition: transform .1s, border-color .1s, background .1s;
}
.am-act:active { transform: scale(.95); border-color: var(--green); background: var(--green-soft); }
.am-act-emoji { font-size: 22px; }
.am-act.dis, .am-act:disabled { opacity: .5; cursor: default; }
.am-rename { display: flex; gap: 8px; margin-top: 14px; }
.am-rename .inp { flex: 1; padding: 10px 12px; font-size: 14px; }
.am-rename-btn { width: auto; margin: 0; padding: 0 18px; font-size: 14px; }
