/* ==========================================================================
   왕립 마법 동물 농장 (Royal Pet Farm) - Ending & Rank CSS
   ========================================================================== */

/* 상단 바 계급 뱃지 */
.rank-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid currentColor;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.rank-badge:hover {
  transform: scale(1.04);
}

/* 농장 뷰포트 내 동물 전환 탭 (보유 2마리 이상 시) */
.pet-switcher-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.92);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #fbcfe8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  z-index: 5;
}

.btn-switch-pet {
  background: none;
  border: none;
  color: #db2777;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 4px;
  display: flex;
  align-items: center;
}

.btn-switch-pet:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pet-switch-index {
  font-size: 11px;
  font-weight: 800;
  color: #475569;
  min-width: 28px;
  text-align: center;
}

.btn-add-pet-quick {
  background: #fdf2f8;
  border: 1px dashed #ec4899;
  color: #db2777;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: 2px;
}

.btn-add-pet-quick:hover {
  background: #fce7f3;
}

/* 농장에 동물이 없을 때 (졸업 후 빈 슬롯) */
.farm-empty-slate {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  padding-bottom: 20px;
  z-index: 3;
}

.empty-slate-icon {
  font-size: 48px;
  animation: floatEmpty 2s ease-in-out infinite alternate;
}

@keyframes floatEmpty {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}

.empty-slate-title {
  font-family: var(--font-title);
  font-size: 24px;
  font-weight: 700;
  color: #1e293b;
}

.empty-slate-desc {
  font-size: 13px;
  color: #475569;
  text-align: center;
  line-height: 1.4;
}

/* ==========================================================================
   엔딩 의식 모달 (마법 해방)
   ========================================================================== */
.ending-modal-card {
  max-width: 480px;
  background: radial-gradient(circle at 50% 30%, #fffbeb 0%, #ffffff 70%);
  border: 3px solid #fde047;
  box-shadow: 0 0 40px rgba(245, 158, 11, 0.4), 0 20px 40px rgba(0, 0, 0, 0.2);
  text-align: center;
  padding: 26px 20px;
}

.ending-sunburst {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(254, 240, 138, 0.6) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: burstPulse 2.5s infinite alternate;
}

@keyframes burstPulse {
  0% { transform: translateX(-50%) scale(0.9); opacity: 0.6; }
  100% { transform: translateX(-50%) scale(1.2); opacity: 1; }
}

.ending-avatar-box {
  width: 150px;
  height: 150px;
  margin: 0 auto 12px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 16px rgba(251, 191, 36, 0.8));
  animation: endingAscend 3s ease-in-out infinite alternate;
}

@keyframes endingAscend {
  0% { transform: translateY(0); }
  100% { transform: translateY(-10px); }
}

.ending-person-title-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  border: 1px solid #f59e0b;
  color: #92400e;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
}

.ending-story-scroll {
  background: #fffdf5;
  border: 1px solid #fed7aa;
  border-radius: 16px;
  padding: 14px;
  font-size: 13px;
  color: #431407;
  line-height: 1.6;
  text-align: left;
  margin-bottom: 14px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ending-reward-badge {
  background: linear-gradient(135deg, #fef9c3, #fde047);
  border: 1px solid #eab308;
  color: #854d0e;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
}

/* ==========================================================================
   도감 (엔딩 앨범) 모달
   ========================================================================== */
.album-modal-card {
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.album-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px dashed #fbcfe8;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.album-stats-chip {
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
  color: #db2777;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.album-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  overflow-y: auto;
  max-height: 58vh;
  padding: 4px;
}

.album-card {
  background: #ffffff;
  border-radius: 20px;
  border: 2px solid #e2e8f0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
}

/* 해금된 엔딩 카드 (컬러) */
.album-card.unlocked {
  border-color: #fde047;
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.15);
}

.album-card.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.25);
}

.album-thumb-box {
  width: 80px;
  height: 80px;
  position: relative;
}

.album-card.unlocked .album-thumb-box {
  filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.5));
}

/* 미해금 엔딩 카드 (실루엣) */
.album-card.locked {
  background: #f8fafc;
  opacity: 0.75;
}

.album-card.locked .album-thumb-box {
  filter: brightness(0.18) grayscale(1);
}

.album-card-name {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
}

.album-card-human {
  font-size: 11px;
  font-weight: 700;
  color: #d97706;
}

.album-card.locked .album-card-human {
  color: #94a3b8;
}

.album-status-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

.album-tag-unlocked {
  background: #fef3c7;
  color: #b45309;
}

.album-tag-locked {
  background: #e2e8f0;
  color: #64748b;
}

/* ==========================================================================
   계급 승급 축하 모달
   ========================================================================== */
.rankup-modal-card {
  max-width: 440px;
  text-align: center;
  border: 3px solid #f472b6;
  background: radial-gradient(circle at 50% 20%, #fdf2f8 0%, #ffffff 80%);
  padding: 28px 20px;
}

.rankup-icon {
  font-size: 54px;
  margin-bottom: 8px;
  animation: rankPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes rankPop {
  0% { transform: scale(0.2) rotate(-15deg); }
  100% { transform: scale(1) rotate(0); }
}

.rankup-title {
  font-family: var(--font-title);
  font-size: 28px;
  font-weight: 700;
  color: #db2777;
  margin-bottom: 6px;
}

.rankup-new-rank {
  display: inline-block;
  font-size: 18px;
  font-weight: 800;
  padding: 6px 18px;
  border-radius: 999px;
  margin-bottom: 14px;
  border: 2px solid currentColor;
}

.rankup-perks-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 13px;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 18px;
}
