/* ==========================================================================
   ICDM 부스 메디컬 퀴즈 웹앱 - 통합 고도화 스타일시트 (ui-polish-v02.css v2.5)
   노보노디스크 세마글루타이드(Semaglutide) 브랜드 테마 및 프리미엄 인터페이스
   ========================================================================== */

/* 1. 디자인 시스템 토큰 (CSS 변수 정의) */
:root {
  /* 브랜드 시그니처 컬러 */
  --wegovy-cyan: #0092bc;          /* 위고비 메인 시안 블루 */
  --wegovy-light: #e6f6fa;         /* 위고비 연한 배경 틴트 */
  --wegovy-glow: rgba(0, 146, 188, 0.32);

  --ozempic-orange: #ed7801;       /* 오젬픽 메인 오렌지 */
  --ozempic-light: #fff3e8;        /* 오젬픽 연한 배경 틴트 */
  --ozempic-glow: rgba(237, 120, 1, 0.32);

  /* 테마 및 텍스트 잉크 */
  --space-dark: #040a16;           /* 우주/에너지 심층 배경 */
  --space-navy: #07152b;           /* 네이비 중간톤 */
  --text-dark: #0f2338;            /* 퀴즈 카드 본문 딥 네이비 */
  --text-muted: #536d80;           /* 부가 설명 보조 텍스트 */
  --text-light: #e8f4fc;           /* 다크 배경 위 밝은 텍스트 */
  --card-border: rgba(225, 238, 248, 0.9);
  --card-shadow: 0 22px 55px rgba(0, 5, 18, 0.48);
}

/* 2. 전역 리셋 및 기본 설정 */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background-color: var(--space-dark);
  color: var(--text-light);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "SF Pro Display", system-ui, Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 스크린리더 전용 숨김 유틸리티 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 3. 배경 레이어: 깊이감 있는 우주 심층 네이비 배경 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(ellipse 85% 45% at 0% 12%, rgba(0, 146, 188, 0.28) 0%, transparent 70%),
    radial-gradient(ellipse 85% 45% at 100% 12%, rgba(237, 120, 1, 0.24) 0%, transparent 70%),
    linear-gradient(180deg, #07152b 0%, #050e1f 45%, #040a16 100%);
  background-repeat: no-repeat;
  background-size: cover;
}

/* 상단 원형 링(body::after) 완전 제거 */
body::after {
  display: none !important;
  content: none !important;
}

/* 인터랙티브 광원 파티클 캔버스 (Soft Glow 효과 적용) */
#field {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  opacity: 0.95;
}

/* 필름 그레인 질감 */
.grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

/* 4. 메인 쉘 레이아웃 (세로 화면 중앙 정렬 및 여백 밸런스) */
.shell {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 440px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 18px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

/* 5. 상단 바 & 언어 선택 스위처 */
.topbar {
  width: 100%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 6px;
  position: relative;
  z-index: 10;
}

.top-actions {
  display: flex;
  align-items: center;
}

.language {
  display: flex;
  align-items: center;
  background: rgba(14, 30, 56, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  padding: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(8px);
}

.lang {
  border: none;
  background: transparent;
  color: #8da4b8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang.active {
  background: linear-gradient(135deg, #3d68ff 0%, #1e4bd8 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(45, 95, 255, 0.4);
}

.lang:not(.active):hover {
  color: #ffffff;
}

/* 6. 히어로 섹션 (키 비주얼 타이틀 & 투어 뱃지) */
.hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-top: 2px;
  margin-bottom: 16px;
}

.hero-art-wrap {
  width: 100%;
  max-width: 320px;
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.hero-art {
  width: 100%;
  height: auto;
  max-height: 84px;
  object-fit: contain;
  filter: drop-shadow(0 2px 14px rgba(120, 210, 255, 0.45));
  transition: transform 0.3s ease;
}

/* 스탬프 투어 참여 안내 캡슐 뱃지 */
.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  background: rgba(7, 24, 52, 0.65);
  border: 1px solid rgba(89, 195, 240, 0.4);
  border-radius: 9999px;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0, 146, 188, 0.2);
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38c8ff;
  box-shadow: 0 0 8px #38c8ff;
  animation: pulseDot 2s infinite ease-in-out;
}

.eyebrow {
  color: #d8f2ff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

/* 7. 퀴즈 패널 (화이트 프리미엄 글래스 카드) */
.quiz-panel {
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 22px;
  box-shadow: var(--card-shadow), 0 0 0 1px rgba(255, 255, 255, 0.85);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* 퀴즈 박스 상단 그라데이션 라인: 파란색(#0092bc)에서 주황색(#ed7801)으로 바로 직결 그라데이션 */
.quiz-panel::before {
  content: "";
  display: block;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--wegovy-cyan) 0%, var(--ozempic-orange) 100%);
}

/* 카드 헤더 */
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px 12px;
  border-bottom: 1px solid rgba(16, 40, 64, 0.08);
}

.panel-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #174868;
}

.panel-pulse {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--wegovy-cyan);
  box-shadow: 0 0 0 3px rgba(0, 146, 188, 0.18);
  animation: pulseDot 1.8s infinite;
}

/* 문제 영역 */
.question-wrap {
  padding: 18px 22px 16px;
  text-align: left;
}

.question {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.42;
  letter-spacing: -0.02em;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.question-en {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-line;
  letter-spacing: -0.01em;
}

/* 8. 선택지 버튼 그룹 - 로고 대폭 확대 및 여유 있는 버튼 높이 */
.choices {
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 0 20px 22px;
}

.choice {
  position: relative;
  width: 100%;
  min-height: 80px;
  padding: 12px 18px;
  border-radius: 17px;
  border: 1.5px solid rgba(16, 40, 64, 0.12);
  background: #ffffff;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.choice-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-left: 28px;
}

/* 선택지 번호 뱃지 (1, 2) - 좌측 절대 위치 */
.choice-num {
  position: absolute;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 13.5px;
  font-weight: 800;
  color: #557285;
  background: rgba(16, 40, 64, 0.06);
  transition: all 0.2s ease;
}

/* 로고 이미지 - 대폭 확대 적용 */
.choice-logo {
  display: block;
  object-fit: contain;
  margin: 0 auto;
  transition: transform 0.2s ease;
}

/* 위고비 로고: 대폭 확대 */
.choice-logo.wegovy-logo {
  height: 52px;
  max-width: 215px;
}

/* 오젬픽 로고: 대폭 확대 */
.choice-logo.ozempic-logo {
  height: 45px;
  max-width: 190px;
}

/* 위고비 버튼 전용 스타일 */
.choice.wegovy {
  background: linear-gradient(100deg, var(--wegovy-light) 0%, #ffffff 55%);
  border-color: rgba(0, 146, 188, 0.35);
  box-shadow: inset 4px 0 0 var(--wegovy-cyan);
}

.choice.wegovy:hover,
.choice.wegovy:focus-visible {
  border-color: var(--wegovy-cyan);
  box-shadow: inset 4px 0 0 var(--wegovy-cyan), 0 8px 22px var(--wegovy-glow);
  transform: translateY(-2px);
}

.choice.wegovy:hover .choice-num {
  background: var(--wegovy-cyan);
  color: #ffffff;
}

.choice.wegovy:hover .choice-logo {
  transform: scale(1.03);
}

/* 오젬픽 버튼 전용 스타일 */
.choice.ozempic {
  background: linear-gradient(100deg, var(--ozempic-light) 0%, #ffffff 55%);
  border-color: rgba(237, 120, 1, 0.35);
  box-shadow: inset 4px 0 0 var(--ozempic-orange);
}

.choice.ozempic:hover,
.choice.ozempic:focus-visible {
  border-color: var(--ozempic-orange);
  box-shadow: inset 4px 0 0 var(--ozempic-orange), 0 8px 22px var(--ozempic-glow);
  transform: translateY(-2px);
}

.choice.ozempic:hover .choice-num {
  background: var(--ozempic-orange);
  color: #ffffff;
}

.choice.ozempic:hover .choice-logo {
  transform: scale(1.03);
}

/* 터치 활성 상태 (모바일 탭 피드백) */
.choice:active {
  transform: scale(0.985);
}

/* 9. 하단 푸터 안내 문구 */
.footer {
  width: 100%;
  text-align: center;
  margin-top: 12px;
}

.footer-note {
  font-size: 11px;
  color: #7d9bb1;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

/* 10. 정답 / 오답 알림 모달 다이얼로그 */
.answer-modal[hidden] {
  display: none !important;
}

.answer-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

/* 배경 어두운 블러 백드롭 */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 8, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.25s ease-out;
}

/* 모달 카드 */
.modal-card {
  position: relative;
  z-index: 101;
  width: min(340px, calc(100vw - 36px));
  padding: 34px 24px 26px;
  border-radius: 22px;
  background: #ffffff;
  color: var(--text-dark);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.3);
  text-align: center;
  overflow: hidden;
  animation: modalPop 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* 모달 카드 상단 악센트 그라데이션 바: 파란색에서 주황색으로 바로 연결 */
.modal-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--wegovy-cyan) 0%, var(--ozempic-orange) 100%);
}

/* 상태 아이콘 (성공/경고) */
.modal-status-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e6f6fa;
  color: var(--wegovy-cyan);
  font-size: 22px;
}

.modal-status-icon::after {
  content: "✓";
  font-weight: 900;
}

.modal-kicker {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--wegovy-cyan);
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-title {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-dark);
  margin-bottom: 14px;
}

.modal-detail {
  font-size: 13.5px;
  line-height: 1.65;
  color: #405d70;
  margin-bottom: 24px;
  word-break: keep-all;
}

.modal-close {
  width: 100%;
  min-height: 46px;
  padding: 10px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #123c49 0%, #0d2831 100%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(18, 60, 73, 0.35);
  transition: all 0.2s ease;
}

.modal-close:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(18, 60, 73, 0.45);
}

.modal-close:active {
  transform: scale(0.98);
}

/* 오답 상태 스타일 (.is-wrong) */
.is-wrong .modal-card {
  animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.is-wrong .modal-card::before {
  background: linear-gradient(90deg, #ed7801 0%, #d85f00 100%);
}

.is-wrong .modal-status-icon {
  background: #fff3e8;
  color: var(--ozempic-orange);
}

.is-wrong .modal-status-icon::after {
  content: "!";
}

.is-wrong .modal-kicker {
  color: var(--ozempic-orange);
}

.is-wrong .modal-close {
  background: linear-gradient(135deg, #ed7801 0%, #c96200 100%);
  box-shadow: 0 4px 16px rgba(237, 120, 1, 0.35);
}

/* 정답 시 축하 콘페티 애니메이션 */
.confetti {
  position: absolute;
  left: 50%;
  top: 50px;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.confetti i {
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 12px;
  background: var(--c);
  border-radius: 2px;
  transform: rotate(var(--a)) translateY(var(--d));
  animation: confettiAnim 0.95s cubic-bezier(0.1, 0.8, 0.3, 1) both;
}

.is-wrong .confetti {
  display: none;
}

/* 키프레임 애니메이션 모음 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.9) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

@keyframes confettiAnim {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(0) scale(0.2); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(var(--d)) scale(1); }
}

/* 11. 미디어 쿼리: 작은 모바일 화면 (<= 375px) 대응 */
@media (max-width: 375px) {
  .shell {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .hero-art-wrap {
    max-width: 270px;
  }
  
  .question {
    font-size: 17px;
  }
  
  .question-en {
    font-size: 12.5px;
  }
  
  .choice {
    min-height: 72px;
    padding: 10px 14px;
  }

  .choice-content {
    padding-left: 24px;
  }
  
  .choice-logo.wegovy-logo {
    max-width: 180px;
    height: 44px;
  }

  .choice-logo.ozempic-logo {
    max-width: 160px;
    height: 38px;
  }
}

/* 12. 미디어 쿼리: 태블릿 및 대형 키오스크 화면 (>= 600px) 최적화 */
@media (min-width: 600px) {
  .shell {
    max-width: 540px;
    justify-content: center;
    gap: 28px;
    padding-top: 36px;
    padding-bottom: 28px;
  }

  .topbar {
    position: absolute;
    top: 24px;
    right: 24px;
    width: auto;
    margin-bottom: 0;
  }

  .hero {
    margin-top: 10px;
    margin-bottom: 12px;
  }

  .hero-art-wrap {
    max-width: 400px;
    margin-bottom: 14px;
  }

  .hero-art {
    max-height: 105px;
  }

  .eyebrow-badge {
    padding: 7px 18px;
  }

  .eyebrow {
    font-size: 13px;
  }

  .quiz-panel {
    max-width: 480px;
    border-radius: 24px;
  }

  .panel-head {
    padding: 18px 28px 15px;
  }

  .panel-kicker {
    font-size: 12px;
  }

  .question-wrap {
    padding: 24px 28px 20px;
  }

  .question {
    font-size: 22px;
    margin-bottom: 12px;
  }

  .question-en {
    font-size: 15px;
    line-height: 1.68;
  }

  .choices {
    padding: 0 28px 28px;
    gap: 14px;
  }

  .choice {
    min-height: 94px;
    padding: 16px 28px;
    border-radius: 20px;
  }

  .choice-content {
    padding-left: 36px;
  }

  .choice-num {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }

  .choice-logo.wegovy-logo {
    height: 62px;
    max-width: 250px;
  }

  .choice-logo.ozempic-logo {
    height: 54px;
    max-width: 220px;
  }

  .modal-card {
    width: min(420px, calc(100vw - 48px));
    padding: 40px 32px 30px;
    border-radius: 26px;
  }

  .modal-title {
    font-size: 32px;
  }

  .modal-detail {
    font-size: 15.5px;
  }

  .modal-close {
    min-height: 52px;
    font-size: 16px;
  }

  .footer {
    margin-top: 0;
  }

  .footer-note {
    font-size: 12px;
  }
}
