/* =====================================================
   doll.css —— 抓娃娃（v19）
   米白柔和风格 · 半透明玻璃柜 · CSS 爪子下抓动画
   尊重 prefers-reduced-motion：动效全部在媒体查询内关闭
   ===================================================== */

.doll-wrap { padding: 4px 0 16px; }

/* ---------- 顶部积分 ---------- */
.doll-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; margin-bottom: 12px;
  background: linear-gradient(135deg, #fff7ee, #ffeef4);
  border: 1px solid #f3e2d4; border-radius: 14px;
}
.doll-score { font-size: 14px; color: #8a7563; }
.doll-score b { color: #ff7da3; font-size: 20px; margin-left: 4px; }
.doll-cost { font-size: 12px; color: #b39c8a; }

/* ---------- 玻璃柜 ---------- */
.doll-cabinet { position: relative; }
.doll-cabinet-top {
  height: 18px; margin: 0 auto;
  width: 82%; border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #f7c9a0, #eeb684);
  box-shadow: inset 0 2px 3px rgba(255,255,255,.6);
}
.doll-glass {
  position: relative; overflow: hidden;
  margin: 0 auto; width: 82%; height: 230px;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(233,247,255,.5));
  border: 1px solid rgba(255,255,255,.85);
  border-top: none; border-bottom: none;
  box-shadow: inset 0 0 22px rgba(120,180,220,.18);
  backdrop-filter: blur(2px);
}
.doll-cabinet-base {
  height: 16px; margin: 0 auto;
  width: 86%; border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg, #eeb684, #e2a86e);
  box-shadow: 0 5px 10px rgba(180,140,100,.22);
}

/* ---------- 娃娃池 ---------- */
.doll-pool {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; padding: 0 10px;
}
.doll-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 2px 6px;
  background: rgba(255,255,255,.78);
  border: 1.5px solid #e8ddd2; border-radius: 12px;
}
.doll-item-emoji { font-size: 30px; line-height: 1; }
.doll-item-name { font-size: 11px; color: #6b5d50; margin-top: 4px; }
.doll-item-rarity {
  margin-top: 3px; font-size: 9px; padding: 1px 6px; border-radius: 8px;
  background: #f0e9e0; color: #9c8a78;
}

/* 稀有度描边/标签 */
.doll-item.doll-r-rare {
  border-color: #9fb8f0; background: rgba(240,246,255,.85);
  box-shadow: 0 0 8px rgba(120,160,240,.35);
}
.doll-item.doll-r-rare .doll-item-rarity { background: #dfe8fd; color: #5a7ad2; }
.doll-item.doll-r-legend {
  border-color: #f0b8c8; background: rgba(255,240,246,.88);
  box-shadow: 0 0 10px rgba(240,150,180,.5);
}
.doll-item.doll-r-legend .doll-item-rarity { background: #ffe0ea; color: #d5587f; }

/* ---------- 爪子 ---------- */
.doll-claw {
  position: absolute; top: 10px; left: 50%;
  width: 44px; transform: translateX(-50%);
  z-index: 6; pointer-events: none;
}
.claw-rope { width: 2px; height: 34px; margin: 0 auto; background: #c9a06a; }
.claw-head { display: flex; justify-content: center; gap: 7px; margin-top: -2px; }
.claw-head span {
  width: 8px; height: 20px; background: #f4a261;
  border-radius: 3px 3px 6px 6px; box-shadow: 0 2px 2px rgba(0,0,0,.12);
}
.claw-head span:nth-child(1) { transform: rotate(16deg); transform-origin: top center; }
.claw-head span:nth-child(3) { transform: rotate(-16deg); transform-origin: top center; }

/* 下抓-收起动画（reduced-motion 关闭） */
.doll-claw.claw-grab { animation: dollGrab 1.4s ease-in-out; }
@keyframes dollGrab {
  0%   { transform: translateX(-50%) translateY(0); }
  45%  { transform: translateX(-50%) translateY(128px); }
  72%  { transform: translateX(-50%) translateY(128px); }
  100% { transform: translateX(-50%) translateY(0); }
}
.doll-claw.claw-win { animation: dollWin .5s ease; }
@keyframes dollWin {
  0%,100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-14px); }
}
.doll-claw.claw-miss { animation: dollMiss .5s ease; }
@keyframes dollMiss {
  0%,100% { transform: translateX(-50%) translateY(0); }
  25% { transform: translateX(-50%) translateX(8px); }
  50% { transform: translateX(-50%) translateX(-8px); }
  75% { transform: translateX(-50%) translateX(5px); }
}

/* ---------- 结果浮层 ---------- */
.doll-result {
  display: none; position: fixed; left: 50%; top: 42%;
  transform: translate(-50%, -50%); z-index: 12000;
  min-width: 200px; padding: 22px 28px; text-align: center;
  background: rgba(255,255,255,.97);
  border: 1px solid #f3e2d4; border-radius: 20px;
  box-shadow: 0 16px 40px rgba(150,100,120,.28);
}
.doll-result.show { display: block; animation: dollResultIn .28s ease; }
.doll-result.miss { border-color: #e6dcd0; }
.doll-result-doll { font-size: 52px; line-height: 1; }
.doll-result-text { font-size: 17px; font-weight: 800; color: #5a4a3c; margin-top: 10px; }
.doll-result-rarity { font-size: 12px; color: #b39c8a; margin-top: 4px; }
@keyframes dollResultIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.8); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ---------- 底部按钮 ---------- */
.doll-actions {
  display: flex; gap: 10px; margin-top: 16px; padding: 0 6px;
}
.doll-my-btn {
  flex: 0 0 auto; padding: 12px 16px;
  border: 1px solid #f0d9c6; border-radius: 14px;
  background: #fff; color: #8a7563; font-size: 15px; font-weight: 600;
}
.doll-my-btn:active { background: #faf2ea; }
.doll-claw-btn {
  flex: 1; padding: 12px 16px;
  border: none; border-radius: 14px;
  background: linear-gradient(135deg, #ff8fb3, #ff7da3);
  color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: 0 6px 16px rgba(255,125,163,.35);
}
.doll-claw-btn:active { transform: translateY(1px); }
.doll-claw-btn:disabled { opacity: .55; box-shadow: none; }

/* ---------- 我的娃娃屋 ---------- */
.doll-my-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 2px 12px; }
.doll-my-title { font-size: 17px; font-weight: 800; color: #5a4a3c; }
.doll-back-btn {
  padding: 7px 12px; border: 1px solid #f0d9c6; border-radius: 12px;
  background: #fff; color: #8a7563; font-size: 13px;
}
.doll-my-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.doll-my-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 6px 12px;
  background: #fff; border: 1.5px solid #e8ddd2; border-radius: 16px;
}
.doll-my-item.doll-r-rare { border-color: #9fb8f0; background: #f6f9ff; }
.doll-my-item.doll-r-legend { border-color: #f0b8c8; background: #fff5f9; }
.doll-my-emoji { font-size: 40px; line-height: 1; }
.doll-my-name { font-size: 13px; font-weight: 700; color: #5a4a3c; margin-top: 8px; }
.doll-my-rarity { font-size: 10px; color: #b39c8a; margin-top: 2px; }
.doll-my-count { font-size: 13px; font-weight: 800; color: #ff7da3; margin-top: 6px; }

/* ---------- 无障碍：尊重减少动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .doll-claw.claw-grab,
  .doll-claw.claw-win,
  .doll-claw.claw-miss,
  .doll-result.show { animation: none; }
}
