/* ==========================================================================
   [Stage 1] 스피드 픽셀 언마스킹 (픽셀 퀴즈) 전용 스타일시트
   ========================================================================== */

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

/* 상단 상태 바 (진행도 및 점수) */
.stage1-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-radius: 16px;
}

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

.stage1-badge {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  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;
}

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

.stage1-stats {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.progress-pill, .score-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);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.progress-pill strong, .score-pill strong {
  color: #ff4d6d;
}

/* 메인 퀴즈 레이아웃 (좌: 이미지 + 힌트 버튼 / 우: 문항 + 보기) */
.stage1-quiz-body {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.75rem;
  align-items: stretch;
}

/* 좌측: 이미지 박스 영역 */
.quiz-media-panel {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
}

.quiz-image-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 380px;
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  background: #0f172a;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: filter;
}

/* 블러 단계 클래스 (25px -> 15px -> 5px -> 0px) */
.blur-level-3 { filter: blur(25px) brightness(0.95); }
.blur-level-2 { filter: blur(15px) brightness(0.98); }
.blur-level-1 { filter: blur(5px) brightness(1); }
.blur-level-0 { filter: blur(0px) brightness(1); }

/* 블러 안내 뱃지 오버레이 */
.blur-info-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  color: #f8fafc;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* 힌트 버튼 */
.hint-btn-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.hint-btn {
  width: 100%;
  max-width: 320px;
  padding: 0.75rem 1.25rem;
  border-radius: 30px;
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%);
  color: #4338ca;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.hint-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #c7d2fe 0%, #ddd6fe 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.25);
}

.hint-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #94a3b8;
  box-shadow: none;
}

/* 우측: 질문 및 4지선다 보기 영역 */
.quiz-content-panel {
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
}

.question-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.question-counter {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  color: #ff5277;
  letter-spacing: 0.08em;
}

.question-text {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.4;
  word-break: keep-all;
}

/* 4지선다 보기 목록 */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}

.option-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.25rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
  text-align: left;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
  position: relative;
  overflow: hidden;
}

.option-card:hover:not(.disabled) {
  background: #ffffff;
  border-color: #ff758c;
  transform: translateX(4px);
  box-shadow: 0 6px 18px rgba(255, 117, 140, 0.15);
}

.option-index {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 800;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f1f5f9;
  color: #64748b;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.option-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

/* 정답/오답 선택 상태 */
.option-card.correct {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2) !important;
}

.option-card.correct .option-index {
  background: #10b981;
  color: #ffffff;
}

.option-card.wrong {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  animation: shakeX 0.4s ease;
}

.option-card.wrong .option-index {
  background: #ef4444;
  color: #ffffff;
}

.option-card.disabled {
  cursor: default;
  opacity: 0.75;
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* 결과 및 코멘트 패널 (정답 선택 후 노출) */
.quiz-result-box {
  display: none;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem 1.4rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 182, 193, 0.8);
  box-shadow: 0 6px 20px rgba(255, 117, 140, 0.15);
  animation: fadeInUp 0.35s ease both;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.05rem;
}

.result-header.is-correct { color: #059669; }
.result-header.is-wrong { color: #dc2626; }

.result-desc {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.55;
  background: #f8fafc;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  border-left: 3px solid #ff758c;
}

.next-btn {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 30px;
  border: none;
  background: linear-gradient(135deg, #ff4d6d, #ff758c);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(255, 77, 109, 0.35);
}

.next-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 77, 109, 0.45);
}

/* ==========================================================================
   퀴즈 최종 완료 화면 (스코어카드)
   ========================================================================== */
.stage1-complete-card {
  display: none;
  width: 100%;
  max-width: 680px;
  margin: 2rem auto;
  padding: 2.5rem 2rem;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: fadeInUp 0.5s ease both;
}

.complete-trophy {
  font-size: 3.5rem;
  animation: bounceTrophy 1.5s infinite alternate ease-in-out;
}

@keyframes bounceTrophy {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-8px) scale(1.08); }
}

.complete-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
}

.complete-score-badge {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: #ff4d6d;
  background: #ffe4e6;
  padding: 0.4rem 1.8rem;
  border-radius: 50px;
  display: inline-block;
  margin: 0.3rem 0;
}

.complete-eval {
  font-size: 1.1rem;
  font-weight: 700;
  color: #475569;
}

.complete-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

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

.retry-btn:hover {
  background: #f8fafc;
  color: #1e293b;
}

.stage2-bridge-btn {
  padding: 0.85rem 1.8rem;
  border-radius: 30px;
  border: none;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #ffffff;
  font-weight: 800;
  font-size: 0.98rem;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.stage2-bridge-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.55);
}

/* ==========================================================================
   반응형 브레이크포인트
   ========================================================================== */
@media (max-width: 860px) {
  .stage1-quiz-body {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .quiz-media-panel {
    padding: 1rem;
  }

  .quiz-content-panel {
    padding: 1.25rem;
  }

  .stage1-header {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .stage1-stats {
    width: 100%;
    justify-content: space-between;
  }
}
