/* ==========================================================================
   [Stage 3] 200일 포춘 쿠키 뽑기 전용 스타일시트
   ========================================================================== */

.stage3-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* 상단 헤더 */
.stage3-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.6rem;
  border-radius: 16px;
}

.stage3-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stage3-badge {
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  box-shadow: 0 3px 10px rgba(236, 72, 153, 0.3);
}

.stage3-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.stage3-status-pill {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.35rem 0.85rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--text-main);
}

.stage3-status-pill strong {
  color: #f43f5e;
}

/* 안내 배너 */
.stage3-banner {
  text-align: center;
  padding: 1rem;
}

.stage3-instruction {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.stage3-sub-instruction {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ==========================================================================
   포춘 쿠키 트레이 (그리드 레이아웃)
   ========================================================================== */
.cookie-tray-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  padding: 1.5rem;
  margin: 0 auto;
  width: 100%;
}

.cookie-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.5rem 1rem;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  background: rgba(255, 255, 255, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.cookie-card-item:hover {
  transform: translateY(-8px) scale(1.04);
  background: #ffffff;
  border-color: #f59e0b;
  box-shadow: 0 16px 32px rgba(245, 158, 11, 0.25);
}

.cookie-card-item:active {
  transform: translateY(-2px) scale(0.98);
}

.cookie-img-wrapper {
  width: 130px;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.cookie-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 12px rgba(180, 83, 9, 0.25));
  transition: transform 0.3s ease;
}

.cookie-card-item:hover .cookie-img {
  transform: rotate(-5deg) scale(1.08);
}

.cookie-label {
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  color: #b45309;
  background: #fef3c7;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 쿠키 크래킹(쪼개짐) 애니메이션 클래스 */
.cookie-card-item.cracking {
  animation: cookieCrack 0.5s ease both;
  pointer-events: none;
}

@keyframes cookieCrack {
  0% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.15) rotate(8deg); }
  50% { transform: scale(0.95) rotate(-8deg); }
  75% { transform: scale(1.1) rotate(4deg); }
  100% { transform: scale(1.05) rotate(0deg); }
}

.cookie-card-item.opened {
  opacity: 0.85;
  border-color: #f43f5e;
  background: #fff1f2;
}

/* ==========================================================================
   포춘 결과 팝업 모달
   ========================================================================== */
.fortune-modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease both;
}

.fortune-modal-card {
  width: 100%;
  max-width: 580px;
  background: #ffffff;
  border-radius: 24px;
  padding: 2.5rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
  position: relative;
  border: 3px solid #ff758c;
  animation: zoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.fortune-scroll-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.fortune-icon {
  font-size: 3rem;
  animation: bounceTrophy 1.5s infinite alternate ease-in-out;
}

.fortune-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ff4d6d;
}

.fortune-message-box {
  background: #fff5f7;
  border: 2px dashed #ffb3c1;
  border-radius: 16px;
  padding: 1.5rem 1.25rem;
  width: 100%;
}

.fortune-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.7;
  word-break: keep-all;
}

.fortune-blessing {
  margin-top: 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #e11d48;
}

.fortune-modal-actions {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  margin-top: 0.5rem;
}

.more-cookie-btn {
  padding: 0.85rem 1.6rem;
  border-radius: 30px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: #475569;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.more-cookie-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #1e293b;
}

.goto-ending-btn {
  padding: 0.85rem 1.8rem;
  border-radius: 30px;
  border: none;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
}

.goto-ending-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.55);
}

/* ==========================================================================
   반응형 최적화
   ========================================================================== */
@media (max-width: 960px) {
  .cookie-tray-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 600px) {
  .stage3-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
  .cookie-img-wrapper {
    width: 100px;
    height: 100px;
  }
}
