/*
 * story.css — 메인 이야기 (장면 창 · 이야기 수첩 · 위쪽 목표 칸)
 */

/* 위쪽 상태 막대의 목표 칸 */
.hud-story { border: 0; font: inherit; cursor: pointer; color: #5b3f74; font-weight: 700; background: #f4ecf8; box-shadow: 0 0 0 2px #b59ac7; }
.hud-story:hover { background: #fff; }
.tt-goals { margin: 4px 0; padding-left: 4px; list-style: none; font-size: 13px; line-height: 1.7; }

/* 장면 창 */
.story-modal { position: relative; overflow: hidden; width: min(720px, 94vw); padding: 18px 22px 16px; background: #fbf4e2; box-shadow: 0 0 0 3px #3a2718, 0 0 0 7px #8b5a34, 0 12px 40px rgba(0, 0, 0, 0.5); }
.story-modal.is-end { background: #fbf2dc; }
.story-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.story-step { padding: 0 8px; background: #5b3f74; color: #fff4e2; font-size: 13px; line-height: 22px; }
.story-title { font-family: var(--font-title); font-weight: 400; font-size: 24px; color: var(--ink); }
.story-stage { position: relative; display: flex; flex-direction: column; gap: 12px; min-height: 260px; }
.story-scene { display: flex; align-items: flex-end; gap: 16px; min-height: 230px; }
.story-scene.is-narration .talk-text { animation: narr-in 0.6s ease-out; }
@keyframes narr-in { from { opacity: 0; letter-spacing: 1px; } to { opacity: 1; } }
.story-scene.is-narration { align-items: center; justify-content: center; }
.story-talk { flex: 1; width: auto; }
.story-scene.is-narration .story-talk { background: transparent; box-shadow: none; text-align: center; }
.story-scene.is-narration .talk-text { font-style: italic; color: var(--ink-2); font-size: 17px; }
.story-goals-mini { padding: 8px 12px; background: #f4ecf8; box-shadow: 0 0 0 2px #b59ac7; font-size: 14px; }
.story-goals-mini ul { margin: 4px 0 0; padding-left: 18px; }
.story-reward { padding: 10px 14px; background: #fff3cf; box-shadow: 0 0 0 2px #d8b25a; }
.story-reward-title { font-weight: 700; color: #8a5a00; margin-bottom: 6px; }
.story-unlocks { margin: 6px 0 0; padding-left: 4px; list-style: none; font-size: 14px; line-height: 1.8; }

/* 이야기 수첩 */
.story-journal { width: min(640px, 94vw); max-height: 86vh; overflow-y: auto; padding: 18px 22px; background: #fbf4e2; box-shadow: 0 0 0 3px #3a2718, 0 0 0 7px #8b5a34; }
.journal-now { padding: 12px 14px; background: #fffaf0; box-shadow: 0 0 0 2px var(--paper-edge); margin-bottom: 14px; }
.journal-summary { margin: 4px 0 10px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.journal-unlock { font-size: 13px; color: #5b3f74; }
.story-goals { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.goal-line { display: flex; align-items: baseline; gap: 8px; }
.goal-check { color: #5b3f74; font-weight: 700; }
.goal-label { flex: 1; font-weight: 700; }
.goal-count { font-size: 13px; color: var(--ink-soft); }
.story-goals li.is-done .goal-label { color: var(--green, #3f7a4f); text-decoration: line-through; }
.story-goals li.is-done .goal-check { color: var(--green, #3f7a4f); }
.goal-bar { height: 6px; margin: 3px 0 0 20px; background: #e8dcc4; }
.goal-bar span { display: block; height: 100%; background: #8c6bb0; }
.goal-hint { margin: 4px 0 0 20px; font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.journal-past ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.journal-past-head { display: flex; align-items: center; gap: 8px; }
.journal-past-head b { flex: 1; }

/* 장 제목 카드 (시작 장면 처음) */
.story-titlecard { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: radial-gradient(circle, #2c2236 0%, #17111d 80%); color: #f4e6c8; cursor: pointer; animation: stc-in 0.6s ease-out; transition: opacity 0.45s, filter 0.45s; }
.story-titlecard.is-out { opacity: 0; filter: blur(4px); }
.stc-step { font-size: 14px; letter-spacing: 6px; color: #c9b27a; animation: stc-rise 0.7s ease-out; }
.stc-line { width: 0; height: 2px; background: linear-gradient(90deg, transparent, #c9b27a, transparent); animation: stc-line 0.8s 0.15s ease-out forwards; }
.stc-title { font-family: var(--font-title); font-size: 34px; animation: stc-rise 0.8s 0.1s ease-out backwards; }
@keyframes stc-in { from { opacity: 0; } }
@keyframes stc-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes stc-line { to { width: 260px; } }

/* 끝 장면 보상: 도장 찍히듯 */
.story-reward { animation: reward-in 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes reward-in { from { opacity: 0; transform: scale(0.85); } }

/* 대사 기록 */
.story-log { flex: 1; max-height: 300px; overflow-y: auto; margin: 0; padding: 10px 14px; list-style: none; background: #fffaf0; box-shadow: 0 0 0 2px var(--paper-edge); display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; line-height: 1.65; animation: fade-in 0.25s ease-out; }
.story-log li { opacity: 0.75; }
.story-log li.is-now { opacity: 1; }
.story-log li b { color: var(--red-dark); }
.story-log li.log-me b { color: var(--blue); }
.story-log li.log-narration { font-style: italic; color: var(--ink-2); text-align: center; }
.btn.is-on { --face: var(--gold-soft); }
