/* 核桃的玩物 —— 页面 + 盲盒 + 小游戏弹窗 样式 */

/* ─────────── 页面布局 ─────────── */
.walnut-main { display: flex; flex-direction: column; gap: 18px; }

/* 未收拾提醒条 */
.wn-pending {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #FFF6E0; border: 2px solid #FFD93D; border-radius: 14px;
  padding: 12px 16px; color: #7a5a00; font-weight: 600;
}
.wn-pending .wn-pending-text { line-height: 1.5; }
.wn-pending b { color: #b3560e; }

/* 盲盒舞台：居中大卡片 */
.wn-stage { display: flex; justify-content: center; }
.wn-box, .wn-reveal { width: 100%; max-width: 480px; }
.wn-box {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 18px; background: #fff; border: 3px solid #EEF1F6; border-radius: 24px;
  padding: 40px 28px; box-shadow: 0 10px 30px rgba(74,144,255,.08);
}
.wn-gift { line-height: 0; animation: wn-bob 2.4s ease-in-out infinite; }
.wn-box-tip { color: #667085; font-size: 1.05rem; line-height: 1.7; margin: 0; }
.wn-start.btn-big { font-size: 1.25rem; padding: 14px 40px; }

/* 抽中揭晓卡 */
.wn-reveal-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px;
  background: #fff; border: 3px solid #FFD93D; border-radius: 24px; padding: 26px 22px;
  box-shadow: 0 12px 34px rgba(255,169,60,.18);
}
.wn-reveal-badge { font-size: 1.35rem; font-weight: 800; color: #FF7A00; }
.wn-photo-wrap { width: 100%; }
.wn-photo {
  width: 100%; max-height: 340px; object-fit: contain; border-radius: 16px;
  background: #F5F7FA; border: 1px solid #EEF1F6;
}
.wn-photo--none {
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem; height: 200px;
}
.wn-toy-title { font-size: 1.6rem; font-weight: 800; color: #2C3E50; }
.wn-go { color: #4A90FF; font-weight: 700; }
.wn-spot {
  background: #F0F7FF; border-radius: 12px; padding: 10px 14px; color: #345; font-size: .98rem;
  width: 100%; box-sizing: border-box;
}
.wn-spot b { color: #1c6ff0; }
.wn-reveal-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 6px; }

.btn-big { font-size: 1.1rem; padding: 12px 28px; border-radius: 14px; }

/* ─────────── 管理员：照片管理 ─────────── */
.wn-admin {
  background: #fff; border: 2px dashed #D7DEE8; border-radius: 18px; padding: 18px 18px 22px;
}
.wn-admin-title { margin: 0 0 14px; font-size: 1.1rem; color: #2C3E50; }
.wn-admin-hint { font-size: .82rem; color: #98A2B3; font-weight: 400; margin-left: 6px; }
.wn-upload-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.wn-file-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.wn-file-btn {
  background: #EEF4FF; color: #1c6ff0; font-weight: 700; padding: 9px 16px; border-radius: 10px;
  white-space: nowrap;
}
.wn-file-name { font-size: .86rem; color: #98A2B3; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wn-input {
  flex: 1 1 180px; min-width: 140px; padding: 9px 12px; border: 1.5px solid #E3E8F0;
  border-radius: 10px; font-size: .95rem; box-sizing: border-box;
}
.wn-input:focus { outline: none; border-color: #4A90FF; }

.wn-toys { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.wn-toys-empty { color: #98A2B3; padding: 10px 2px; }
.wn-toy-card {
  border: 1.5px solid #EEF1F6; border-radius: 14px; overflow: hidden; background: #fff;
  display: flex; flex-direction: column;
}
.wn-toy-card.off { opacity: .5; }
.wn-toy-thumb { width: 100%; height: 110px; object-fit: cover; background: #F5F7FA; }
.wn-toy-thumb.wn-photo--none { height: 110px; font-size: 2.4rem; }
.wn-toy-meta { padding: 8px 10px; flex: 1; }
.wn-toy-name { font-weight: 700; color: #2C3E50; font-size: .95rem; }
.wn-toy-spot { font-size: .8rem; color: #98A2B3; margin-top: 3px; }
.wn-toy-ops { display: flex; border-top: 1px solid #EEF1F6; }
.wn-op { flex: 1; border: none; background: #fff; padding: 8px 0; cursor: pointer; font-size: .85rem; color: #475467; }
.wn-op:hover { background: #F5F7FA; }
.wn-op--del { color: #FF5A5A; border-left: 1px solid #EEF1F6; }

/* ─────────── 提示 toast ─────────── */
.wn-toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px);
  background: #2C3E50; color: #fff; padding: 12px 22px; border-radius: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 4000;
}
.wn-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ══════════════════════════════════════════════════════════════
   小游戏弹窗（WalnutMinigames.run 生成）+ 各小游戏共享控件
   ══════════════════════════════════════════════════════════════ */
body.wm-lock { overflow: hidden; }

.wm-overlay {
  position: fixed; inset: 0; z-index: 3000; display: flex; align-items: center; justify-content: center;
  background: rgba(20,28,44,.55); backdrop-filter: blur(2px); padding: 16px;
  animation: wm-fade-in .18s ease;
}
.wm-overlay.wm-out { animation: wm-fade-out .18s ease forwards; }
.wm-modal {
  position: relative; width: 100%; max-width: 440px; background: #fff; border-radius: 22px;
  box-shadow: 0 20px 60px rgba(0,0,0,.28); overflow: hidden; display: flex; flex-direction: column;
  max-height: 92vh; animation: wm-pop .22s cubic-bezier(.2,1.2,.4,1);
}
.wm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid #F0F2F6;
}
.wm-title { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; font-weight: 800; color: #2C3E50; }
.wm-title-emoji { font-size: 1.3rem; }
.wm-head-btns { display: flex; align-items: center; gap: 6px; }
.wm-shuffle {
  border: 1.5px solid #E3E8F0; background: #fff; color: #475467; border-radius: 10px;
  padding: 6px 10px; font-size: .82rem; cursor: pointer; white-space: nowrap;
}
.wm-shuffle:hover { background: #F5F7FA; }
.wm-close {
  border: none; background: #F0F2F6; color: #475467; width: 34px; height: 34px; border-radius: 50%;
  font-size: 1.4rem; line-height: 1; cursor: pointer; flex-shrink: 0;
}
.wm-close:hover { background: #E3E8F0; }
.wm-stage { padding: 20px 18px; overflow-y: auto; }
.wm-foot { padding: 10px 16px 14px; text-align: center; color: #98A2B3; font-size: .85rem; }

/* 通关庆祝层 */
.wm-win {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.86); z-index: 5; overflow: hidden;
}
.wm-win-badge { font-size: 2rem; font-weight: 900; color: #00A344; animation: wm-pop .3s cubic-bezier(.2,1.4,.4,1); }
.wm-confetti {
  position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px;
  animation: wm-confetti-fall 1s linear forwards;
}

/* ── 共享控件（各小游戏复用，保证视觉统一）── */
.wm-game { min-height: 200px; }
.wm-prompt { text-align: center; font-size: 1.05rem; font-weight: 700; color: #2C3E50; margin-bottom: 12px; }
.wm-note { text-align: center; font-size: .86rem; color: #98A2B3; margin-top: 10px; }
.wm-dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.wm-dot { width: 9px; height: 9px; border-radius: 50%; background: #E3E8F0; transition: background .2s; }
.wm-dot.on { background: #00C853; }
.wm-btn {
  display: inline-block; border: none; background: #4A90FF; color: #fff; font-weight: 700;
  padding: 11px 22px; border-radius: 12px; cursor: pointer; font-size: 1rem; transition: transform .08s;
}
.wm-btn:active { transform: scale(.96); }
.wm-btn:disabled { opacity: .5; cursor: default; }
.wm-choices { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.wm-choice {
  border: 2px solid #E3E8F0; background: #fff; color: #2C3E50; font-weight: 700; font-size: 1.05rem;
  padding: 12px 18px; border-radius: 12px; cursor: pointer; transition: transform .08s, border-color .12s;
}
.wm-choice:active { transform: scale(.96); }
.wm-choice.good { border-color: #00C853; background: #E9FBEF; color: #0a8a3d; }
.wm-choice.bad { border-color: #FF5A5A; background: #FFECEC; animation: wm-shake .3s; }
.wm-grid { display: grid; gap: 8px; justify-content: center; margin: 0 auto; }
.wm-cell {
  aspect-ratio: 1/1; display: flex; align-items: center; justify-content: center;
  border: 2px solid #E3E8F0; border-radius: 10px; background: #fff; cursor: pointer;
  font-size: 1.6rem; user-select: none; transition: transform .08s, border-color .12s, background .12s;
}
.wm-cell:active { transform: scale(.95); }
.wm-good { color: #0a8a3d; }
.wm-bad { color: #FF5A5A; }

/* ─────────── 动画 ─────────── */
@keyframes wn-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px) rotate(-2deg); } }
@keyframes wn-pop { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.wn-pop { animation: wn-pop .28s cubic-bezier(.2,1.2,.4,1); }
@keyframes wm-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes wm-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes wm-pop { 0% { transform: scale(.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes wm-shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes wm-confetti-fall { to { transform: translateY(360px) rotate(360deg); opacity: .2; } }

/* ─────────── 手机端：更简洁 ─────────── */
@media (max-width: 640px) {
  .wn-box { padding: 30px 18px; }
  .wn-gift svg { width: 140px; height: 140px; }
  .wn-box-tip { font-size: .98rem; }
  .wn-file-name { max-width: 110px; }
  .wm-modal { max-width: 100%; }
}
