/* nunchi-lab/style.css — 레고블럭: 이 페이지 전용 스타일만. core-theme.css 토큰 위에 얹는다.
   캐릭터 아트는 최종 일러스트가 아직 없어 이니셜 배지로 자리표시(placeholder) 처리했다 —
   실제 8표정 일러스트 파이프라인은 별도 트랙(README 참고). */

.nunchi-lab-root {
  --nunchi-color: #9d6fff;
  --likability-color: #f97316;
  --manners-color: #22d3ee;
  --scene-glow: radial-gradient(120% 90% at 50% 0%, rgba(157, 111, 255, 0.16) 0%, transparent 60%);
}

.nunchi-stage {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  min-height: 70vh;
  background-image: var(--scene-glow);
  border-radius: var(--radius-lg);
}

/* ---------- 게이지 3축 ---------- */
.gauge-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}
.gauge-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 10px;
}
.gauge-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.gauge-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  overflow: hidden;
}
.gauge-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.gauge-fill.rising {
  animation: gauge-glow 0.6s ease-out;
}
.gauge-fill.dropping {
  animation: gauge-shake 0.3s ease-in-out;
}
@keyframes gauge-glow {
  0% { filter: brightness(1); }
  40% { filter: brightness(1.6); }
  100% { filter: brightness(1); }
}
@keyframes gauge-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) {
  .gauge-fill.rising, .gauge-fill.dropping { animation: none; }
}

/* ---------- 캐릭터 레이어 (자리표시자) ---------- */
.char-layer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.char-avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gradient-primary);
  box-shadow: 0 0 0 3px var(--card-border), var(--card-shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.char-initial {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--text-inverse);
}
.char-avatar.expr-smile,
.char-avatar.expr-laugh,
.char-avatar.expr-moved { box-shadow: 0 0 0 3px var(--card-border), 0 0 24px var(--glow-secondary-hover); }
.char-avatar.expr-laugh { transform: scale(1.06); }
.char-avatar.expr-annoyed,
.char-avatar.expr-uncomfortable { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.45); }
.char-avatar.expr-surprised { transform: scale(1.03); }
.char-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 600;
}
.char-name-en {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.82rem;
}

/* ---------- 대사창 ---------- */
.dialogue-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 12px;
  min-height: 84px;
}
.line-ko {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.line-en {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.context-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0 4px 14px;
  border-bottom: 1px dashed var(--card-border);
  margin-bottom: 14px;
}
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-primary);
  font-weight: 700;
  margin-bottom: 8px;
}
.intro-card h2, .results-card h2 {
  font-family: var(--serif);
  margin-bottom: 10px;
}
.skill-line {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 18px;
}

/* ---------- 에피소드 선택 ---------- */
.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0 0 12px;
}
.btn-back:hover { color: var(--accent-primary); }
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.episode-card {
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-primary);
}
.episode-card:hover { border-color: var(--accent-primary); background: var(--bg-elevated); }
.episode-card.is-locked { opacity: 0.72; }
.episode-card.is-locked:hover { border-color: var(--card-border); background: var(--bg-surface); }
.episode-num {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--accent-primary);
  font-weight: 700;
}
.episode-lock {
  color: var(--text-muted);
  font-weight: 700;
  margin-left: 4px;
}
.episode-title { font-family: var(--serif); font-weight: 700; }
.episode-title-en { font-size: 0.78rem; color: var(--text-muted); }

.results-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-back-list {
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
}
.btn-back-list:hover { border-color: var(--accent-primary); }

/* ---------- 선택지 ---------- */
.choice-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choice-btn {
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.choice-btn:hover:not(:disabled) {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
}
.choice-btn:disabled { opacity: 0.5; cursor: default; }
.choice-label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-primary);
  font-weight: 700;
}
.choice-text { font-family: var(--serif); font-size: 1rem; }
.choice-text-en { font-size: 0.8rem; color: var(--text-muted); }

.freeform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px dashed var(--card-border);
}
.freeform-input {
  flex: 1 1 200px;
  background: var(--bg-surface);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: var(--serif);
}
.freeform-submit {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}
.freeform-locked { justify-content: center; }
.freeform-upsell-chip {
  display: inline-block;
  background: var(--bg-surface);
  border: 1px dashed var(--accent-primary);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  color: var(--accent-primary);
  font-weight: 700;
  font-size: 0.85rem;
  text-decoration: none;
}
.freeform-upsell-chip:hover { background: var(--bg-elevated); }
.freeform-submit:disabled { opacity: 0.6; cursor: default; }
.freeform-status {
  width: 100%;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.btn-start, .btn-continue {
  background: var(--gradient-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- 속마음 버블 ---------- */
.thought-bubble {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(157, 111, 255, 0.12);
  border: 1px solid rgba(157, 111, 255, 0.3);
  backdrop-filter: blur(16px);
  animation: thought-in 0.4s ease;
}
@keyframes thought-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.thought-label { font-size: 0.78rem; color: var(--accent-primary); font-weight: 700; margin-bottom: 8px; }
.thought-ko { font-family: var(--serif); font-style: italic; font-size: 1.02rem; margin-bottom: 4px; }
.thought-en { font-size: 0.85rem; color: var(--text-muted); font-style: italic; margin-bottom: 12px; }

.nuance-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 14px; }
.chips-label { font-size: 0.72rem; color: var(--text-muted); margin-right: 4px; }
.nuance-chip {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  text-decoration: none;
}
.nuance-chip:hover { border-color: var(--accent-primary); color: var(--accent-primary); }

/* ---------- 결과 화면 ---------- */
.results-scores {
  list-style: none;
  display: flex;
  gap: 14px;
  margin: 14px 0 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.verdict-en { color: var(--text-muted); margin-bottom: 6px; }

/* ---------- 전환 ---------- */
.fade-out { opacity: 0; transition: opacity 0.18s ease; }
.fade-in { opacity: 1; transition: opacity 0.26s ease; }

@media (max-width: 640px) {
  .char-avatar { width: 76px; height: 76px; }
  .line-ko { font-size: 1.05rem; }
}
