/* ============================================================
   🟢 몽실 공통 스타일 (B안)
   - 질문/선택지/결과 화면 통일
   - 에너지 배터리 / 몽실 러너 포함
   ============================================================ */

/* 기본 */
body {
  margin: 0;
  padding: 0;
  font-family: "Pretendard Variable", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fafafa;
  color: #2a2522;
}

.page {
  max-width: 780px;
  margin: 96px auto 40px;
  padding: 0 18px;
}

/* 상단 고정 */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  background: #ffffffcc;
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.to-main {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  font-size: 1rem;
}

.to-main img {
  width: 32px;
  height: 32px;
}

/* 제목 영역 */
.test-header {
  margin-top: 16px;
}

.test-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin: 0;
}

.test-desc {
  margin-top: 6px;
  color: #666;
  font-size: .95rem;
}

/* =======================
   질문 카드
   ======================= */
.question-area {
  margin-top: 20px;
  padding: 20px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.05);
}

.question-text {
  font-size: 1.1rem;
  margin-bottom: 18px;
  line-height: 1.45;
  min-height: 3.8em;
  display: flex;
  align-items: flex-start;

}

/* 선택지 */
.options-area {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 18px;
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0,0,0,0.04);
  transition: 0.15s ease;
}

.option-btn:nth-child(1) { background: #f3f0ed; }
.option-btn:nth-child(2) { background: #f1edff; }
.option-btn:nth-child(3) { background: #eaf7ff; }
.option-btn:nth-child(4) { background: #e8f9f1; }
.option-btn:nth-child(5) { background: #e6f2ff; }

.option-btn:hover { opacity: .9; }

.option-btn.selected {
  border-color: #86cbb2;
  box-shadow:
    0 0 0 2px rgba(134,203,178,0.45),
    0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

/* 이전/건너뛰기 버튼 */
.nav-btns {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.nav {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
}

.nav.prev { background: #f5f5f5; }
.nav.skip { background: #faf0e7; }

/* =======================
   결과 카드
   ======================= */
.result-area {
  margin-top: 20px;
  padding: 20px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 10px 32px rgba(0,0,0,0.05);
}

.result-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
}

.result-quote {
  color: #7a6f6a;
  margin: 6px 0 18px;
  font-size: 1rem;
}

.result-desc p {
  margin: 4px 0 8px;
  line-height: 1.48;
}

/* 척도 전체 */
.scale-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* 개별 척도 */
.ms-scale-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ms-scale-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.ms-scale-title {
  font-weight: 600;

}

.ms-scale-label {
  font-size: 0.82rem;
  color: #7e736c;
  white-space: nowrap;
}

/* 바 */
.ms-scale-bar {
  width: 100%;
  height: 11px;
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
}

.ms-scale-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9fd3ff, #a3e4c6, #ffe29f);
}

/* 리마인드 */
.mind-reminder-box {
  margin-top: 20px;
  padding: 16px;
  background: #eef8ee;
  border-radius: 16px;
}

/* 결과 하단 버튼 */
.bottom-btns {
  margin-top: 20px;
  display: flex;
  gap: 12px;
}

.btn {
  flex: 1;
  padding: 14px;
  border-radius: 14px;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  text-align: center;
}

.btn.main { background: #f5f5f5; }
.btn.retry { background: #e8f5ff; }

.hidden { display: none; }

/* =======================
   🔋 에너지 배터리 전용 (기존 기능 유지)
   ======================= */
.battery-pack {
  display:flex;
  gap:6px;
  margin:18px 0 4px;
}

.batt-cell {
  width:40px;
  height:18px;
  border-radius:6px;
  background:#eaeaea;
  overflow:hidden;
  position:relative;
}

.batt-cell .fill {
  display:block;
  height:100%;
  background:#8bdcff;
  transition:width .2s ease;
}

.batt-cell.blink .fill {
  animation: battBlink 0.6s infinite alternate;
}

@keyframes battBlink {
  0% { opacity:0.5; }
  100% { opacity:1; }
}

.battery-label {
  font-size:0.95rem;
  text-align:center;
  color:#555;
  margin-bottom:10px;
}

/* =======================
   🐻‍❄ 몽실 러너 (공통 진행률)
   ======================= */

.mongsil-runner {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f6ff;
  border: 1px solid rgba(120,130,180,0.18);
}

.m-runner-track {
  position: relative;
  display:flex;
  align-items:center;
  gap:8px;
  height:36px;
}

.m-runner-rock {
  width:26px;
  height:26px;
  border-radius:50%;
  background: #d3c3b1;
  box-shadow:
    inset 0 0 0 1px rgba(90,70,50,0.25),
    0 2px 4px rgba(0,0,0,0.12);
}

.m-runner-line {
  flex:1;
  height:6px;
  border-radius:999px;
  background:#e1e6ff;
  position:relative;
  overflow:hidden;
}

.m-runner-line-fill {
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width:0;
  border-radius:inherit;
  background:linear-gradient(90deg,#9fd3ff,#ffe29f);
  transition:width .25s ease;
}

.m-runner-mascot{
  position:absolute;
  top:50%;
  left:0%;
  transform:translate(-50%,-50%);
  width:40px;
  height:40px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 4px 12px rgba(0,0,0,0.12);
  display:flex;
  align-items:center;
  justify-content:center;
  animation:mRunnerDance 0.9s ease-in-out infinite alternate;
  z-index:2;              /* ★ 바보다 항상 위에 오도록 */
}

.m-runner-mascot img{
  width:72%;
  height:72%;
  object-fit:contain;
}
.m-runner-label {
  font-size: 0.82rem;
  color:#6a647c;
  min-width: 52px;
  text-align:right;
}

@keyframes mRunnerDance {
  0%   { transform:translate(-50%,-50%) translateY(0); }
  100% { transform:translate(-50%,-50%) translateY(-4px); }
}

/* (옵션) 구름 점 형태를 쓰고 싶은 테스트용 */
.cloud-progress {
  display:flex;
  gap:6px;
  margin:10px 0 16px;
  justify-content:center;
}

.cloud-dot {
  width:10px;
  height:10px;
  border-radius:999px;
  border:1px solid rgba(94,73,61,0.25);
  background:#fff;
  opacity:.35;
  transition:.15s;
}

.cloud-dot.filled {
  background:#e9f4ff;
  opacity:.9;
}

.cloud-dot.current {
  transform:scale(1.25);
  box-shadow:0 0 0 2px rgba(120,170,255,0.4);
}

/* 반응형 */
@media (max-width: 480px) {
  .page {
    margin-top: 80px;
    padding: 0 12px 32px;
  }
  .question-area,
  .result-area {
    padding: 16px;
  }
  .test-title {
    font-size: 1.5rem;
  }
  .question-text {
    font-size: 1.02rem;
  }
  .option-btn {
    padding: 14px;
    font-size: 0.98rem;
  }
  .m-runner-mascot {
    width: 34px;
    height: 34px;
  }
}

/* ===============================
   🐻‍❄ 몽실 러너 강제 패치 (v2025.91)
   - 몽실이가 막대 뒤에 숨는 문제 방지
   =============================== */

.mongsil-runner {
  overflow: visible !important;
}

.mongsil-runner .m-runner-line {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #e1e6ff;
  overflow: visible !important; /* ⛔ 숨김 방지 */
  z-index: 1;
}

.mongsil-runner .m-runner-line-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #9fd3ff, #ffe29f);
  transition: width 0.25s ease;
  z-index: 1;
}

.mongsil-runner .m-runner-mascot {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: mRunnerDance 0.9s ease-in-out infinite alternate;
  z-index: 3 !important; /* 항상 맨 위 */
  pointer-events: none;
}

.mongsil-runner .m-runner-mascot img {
  width: 72%;
  height: 72%;
  object-fit: contain;
}

/* =======================
   🎢 도파민 공장장 전용 시각화 (Emoji 버전)
   ======================= */

.dopamine-visual {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.dopamine-visual-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 18px;
  background: #f7f3ff;
  border: 1px solid rgba(140, 120, 200, 0.15);
  box-shadow: 0 8px 24px rgba(80, 60, 120, 0.08);
}

.dopamine-emoji {
  font-size: 2.6rem;
  line-height: 1;
}

.dopamine-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #6a5a9a;
}

/* 모바일에서 살짝 축소 */
@media (max-width: 480px) {
  .dopamine-emoji {
    font-size: 2.3rem;
  }
}

