/* 춘천 심야 여행 플래너 · 웜 라이트 테마 + 컴팩트 UI (Tailwind 보완) */

/* ---- 로고 전용 명조체 (다른 UI는 기존 폰트 유지) ---- */
.logo-font { font-family: "Gowun Batang", "Nanum Myeongjo", "Noto Serif KR", serif; }

/* ---- 카드: 순백 + 은은한 보더/섀도우 ---- */
.card-warm {
  background: #ffffff;
  border: 1px solid #fef3c7;               /* amber-100 */
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}
.card-sky {
  background: #ffffff;
  border: 1px solid #e0f2fe;               /* sky-100 */
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(14, 165, 233, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* ---- 알약 태그 칩 (위치 / 테마 / 이동수단 공통) ---- */
.chip,
.style-opt,
.move-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid #e2e8f0;               /* slate-200 */
  border-radius: 9999px;
  font-size: 0.78rem;                      /* 12.5px */
  line-height: 1.25rem;
  font-weight: 600;
  color: #475569;                          /* slate-600 */
  background: #fff;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all 0.15s ease;
}
.chip:hover,
.style-opt:hover,
.move-opt:hover { border-color: #fcd34d; }   /* amber-300 */

.chip.selected,
.style-opt.selected,
.move-opt.selected {
  border-color: #f59e0b;                   /* amber-500 */
  background: #f59e0b;
  color: #fff;
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.3);
}
/* 키보드 접근성: 숨겨진 라디오가 포커스되면 칩에 링 표시 */
.style-opt:focus-within,
.move-opt:focus-within,
.chip:focus-visible { outline: 2px solid #fcd34d; outline-offset: 1px; }

/* ---- 스텝 제목 ---- */
.step-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;                      /* 12px */
  font-weight: 700;
  color: #334155;                          /* slate-700 */
  margin-bottom: 0.3rem;
}
.step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.625rem;
  font-weight: 700;
}

/* ---- 인라인 슬림 슬라이더 (라벨 · 바 · 숫자 배지 한 줄) ---- */
.slim-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.slim-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  width: 3.9rem;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
}
.val-badge {
  min-width: 4.4rem;
  text-align: center;
  padding: 0.05rem 0.5rem;
  border-radius: 9999px;
  background: #fffbeb;                     /* amber-50 */
  border: 1px solid #fde68a;               /* amber-200 */
  color: #b45309;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
input[type="range"] {
  height: 4px;
  border-radius: 9999px;
  background: #fef3c7;
}

/* ================= 킬러 1: 미니맵 ================= */
/* 경로 그리기: 마스크 안의 굵은 선이 stroke-dasharray로 그려지며 점선을 드러냄 */
@keyframes route-draw { from { stroke-dashoffset: 1; } }
.route-draw { stroke-dasharray: 1; stroke-dashoffset: 0; animation: route-draw 0.9s ease-out both; }
/* 점선이 흐르는 효과 */
@keyframes dash-march { to { stroke-dashoffset: -8.1; } }
.route-dots { stroke-dasharray: 0.1 8; stroke-linecap: round; animation: dash-march 1s linear infinite; }
@keyframes node-pulse { 0% { transform: scale(0.6); opacity: 0.6; } 100% { transform: scale(1.7); opacity: 0; } }
.node-halo { opacity: 0; transform-box: fill-box; transform-origin: center; }
.map-node.active .node-halo { animation: node-pulse 1.8s ease-out infinite; }
.node-dot { fill: #fff; stroke: #94a3b8; stroke-width: 2; transition: all 0.3s; }
.map-node.active .node-dot { fill: #f59e0b; stroke: #fff; stroke-width: 2.5; }
.node-label { font-size: 11px; font-weight: 700; fill: #64748b; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
.map-node.active .node-label { fill: #b45309; }
@keyframes bubble-pop { from { opacity: 0; transform: scale(0.5); } }
.bubble { transform-box: fill-box; transform-origin: center; animation: bubble-pop 0.35s ease-out both; }
@keyframes mist-drift { from { transform: translateX(-6px); } to { transform: translateX(10px); } }
.mist { animation: mist-drift 9s ease-in-out infinite alternate; }
.mist-b { animation-duration: 12s; animation-direction: alternate-reverse; }

/* ================= 킬러 2: 심야 생존 영수증 ================= */
.receipt {
  position: relative;
  background: #fffef9;
  border: 1px solid #fde68a;
  border-bottom: 0;
  padding: 1rem 1rem 1.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, "Nanum Gothic Coding", monospace;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.receipt::after { /* 영수증 아래쪽 톱니 */
  content: "";
  position: absolute;
  left: -1px; right: -1px; bottom: -8px; height: 8px;
  background:
    linear-gradient(135deg, #fffef9 50%, transparent 50%) 0 0 / 12px 8px,
    linear-gradient(225deg, #fffef9 50%, transparent 50%) 0 0 / 12px 8px;
  background-repeat: repeat-x;
}
.rc-rule { border: 0; border-top: 1px dashed #d6d3d1; margin: 0.7rem 0; }
.rc-line { display: flex; justify-content: space-between; gap: 0.75rem; }
.rc-line small { display: block; color: #94a3b8; font-size: 10.5px; line-height: 1.2; }
.rc-track { height: 10px; border-radius: 9999px; background: #f1f5f9; overflow: hidden; margin-top: 0.25rem; }
.rc-bar { height: 100%; width: 0; border-radius: 9999px; background: #10b981; transition: width 0.6s ease, background-color 0.3s; }
.rc-bar.tight { background: #f59e0b; }
.rc-bar.over { background: #ef4444; }
.barcode {
  height: 28px;
  background: repeating-linear-gradient(90deg, #334155 0 2px, transparent 2px 4px, #334155 4px 5px, transparent 5px 9px, #334155 9px 12px, transparent 12px 14px);
  opacity: 0.8;
}

/* ================= 킬러 3: 챗봇 ================= */
.msg { display: flex; gap: 0.5rem; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.bubble-chat { padding: 0.5rem 0.8rem; border-radius: 1rem; font-size: 13px; line-height: 1.6; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; max-width: 85%; }
.msg.user .bubble-chat { background: #f59e0b; color: #fff; border-bottom-right-radius: 0.25rem; }
.msg.bot .bubble-chat { background: #f0f9ff; border: 1px solid #e0f2fe; color: #334155; border-bottom-left-radius: 0.25rem; }
.msg .avatar { width: 1.75rem; height: 1.75rem; border-radius: 9999px; background: #fef3c7; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.engine-tag { display: block; margin-top: 0.25rem; font-size: 10.5px; color: #94a3b8; }
@keyframes blink { 50% { opacity: 0; } }
.typing-caret::after { content: "▍"; margin-left: 1px; color: #0ea5e9; animation: blink 0.9s steps(1) infinite; }
@keyframes dot-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-3px); opacity: 1; } }
.dots span { display: inline-block; width: 5px; height: 5px; margin: 0 1.5px; border-radius: 9999px; background: #38bdf8; animation: dot-bounce 1.1s infinite; }
.dots span:nth-child(2) { animation-delay: 0.15s; }
.dots span:nth-child(3) { animation-delay: 0.3s; }

/* ================= 킬러 4: 보딩패스 티켓 + 사운드 버튼 ================= */
.ticket {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #fde68a;
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.12);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ticket:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(245, 158, 11, 0.18); }
.ticket:focus-visible { outline: 2px solid #fcd34d; outline-offset: 2px; }
.ticket-main { flex: 1; padding: 1rem 1.1rem; min-width: 0; }
.ticket-stub { padding: 1rem 1.1rem; text-align: center; background: #fffbeb; border-radius: 0 0 1rem 1rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; }
.ticket-perf { position: relative; height: 0; border-top: 2px dashed #fcd34d; margin: 0 14px; }
.ticket-perf::before, .ticket-perf::after {
  content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 9999px; background: #fbf8f3;
}
.ticket-perf::before { left: -24px; }
.ticket-perf::after { right: -24px; }
@media (min-width: 640px) {
  .ticket { flex-direction: row; }
  .ticket-stub { width: 11rem; border-radius: 0 1rem 1rem 0; }
  .ticket-perf { height: auto; width: 0; border-top: 0; border-left: 2px dashed #fcd34d; margin: 14px 0; }
  .ticket-perf::before, .ticket-perf::after { left: -11px; right: auto; }
  .ticket-perf::before { top: -24px; }
  .ticket-perf::after { top: auto; bottom: -24px; }
}
.sound-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; height: 2rem; padding: 0 0.7rem;
  border-radius: 9999px; border: 1px solid #fde68a; background: #fffbeb; color: #b45309;
  font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.15s;
}
.sound-btn:hover { background: #fef3c7; }
.sound-btn[aria-pressed="true"] { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
@keyframes soft-pulse { 50% { transform: scale(1.18); } }
.sound-btn[aria-pressed="true"] svg { animation: soft-pulse 2.4s ease-in-out infinite; }

/* 모션 최소화 선호 사용자 배려 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
}

/* ================= 7장: 외곽 안전 / 할증률 ================= */
.map-node.outer .node-dot { stroke: #ef4444; stroke-dasharray: 3 2; }
.map-node.outer.active .node-dot { fill: #ef4444; stroke: #fff; stroke-dasharray: none; }
.map-node.outer .node-label { fill: #b91c1c; }
.map-node.outer .node-halo { fill: #ef4444; }
.rate-btn { padding: 0 0.55rem; height: 1.4rem; border-radius: 9999px; border: 1px solid #e2e8f0; background: #fff; color: #475569; font-size: 11px; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.rate-btn:hover { border-color: #fcd34d; }
.rate-btn.selected { background: #f59e0b; border-color: #f59e0b; color: #fff; }

/* ================= 헤더 상태 캡슐 배지 (초록 점 + ping) ================= */
.key-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.15rem 0.7rem 0.15rem 0.55rem;
  border-radius: 9999px; border: 1px solid #a7f3d0; background: #ecfdf5; color: #047857;
  font-size: 11px; font-weight: 600; line-height: 1.25rem;
}
.key-dot-wrap { position: relative; display: inline-flex; width: 0.5rem; height: 0.5rem; }
.key-dot { position: relative; width: 100%; height: 100%; border-radius: 9999px; background: #10b981; }
.key-ping { position: absolute; inset: 0; border-radius: 9999px; background: #34d399; animation: key-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes key-ping { 0% { transform: scale(1); opacity: 0.75; } 75%, 100% { transform: scale(2.4); opacity: 0; } }

/* 플랜을 새로 만들었을 때 결과 영역을 잠깐 강조 */
@keyframes plan-flash { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55); } 100% { box-shadow: 0 0 0 14px rgba(245, 158, 11, 0); } }
#result.flash > #plan-summary { animation: plan-flash 1.2s ease-out 2; border-color: #f59e0b; }

/* 타임라인 카드의 📍 구체적 장소 태그 */
.place-tag {
  display: inline-flex; align-items: flex-start; gap: 0.3rem; align-self: flex-start;
  padding: 0.2rem 0.6rem 0.2rem 0.5rem;
  border-radius: 0.75rem; border: 1px solid #fcd34d; background: #fffbeb; color: #92400e;
  font-size: 12px; font-weight: 700; line-height: 1.35;
}

/* 첫차 타이머: 위치를 바꿔 기준 역이 달라질 때 제목·숫자가 부드럽게 갱신 */
.cd-num { display: inline-block; transform-origin: 50% 80%; }
.cd-title { display: inline-block; }
@keyframes cd-pop { 0% { opacity: 0.15; transform: translateY(5px) scale(0.88); } 60% { opacity: 1; transform: translateY(0) scale(1.06); } 100% { opacity: 1; transform: none; } }
@keyframes cd-fade { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
#timer-box.cd-swap .cd-num { animation: cd-pop 0.55s cubic-bezier(0.22, 1, 0.36, 1) both; }
#timer-box.cd-swap .cd-title,
#timer-box.cd-swap #cd-note { animation: cd-fade 0.4s ease-out both; }

/* 테마를 바꾸면 이야기 카드가 살짝 페이드되며 바뀜 */
@keyframes story-swap { from { opacity: 0.25; transform: translateY(4px); } to { opacity: 1; transform: none; } }
#story-card.story-swap { animation: story-swap 0.45s ease-out both; }

/* ================= 투톤 레이아웃: 상단 히어로만 밤하늘 다크 (아래 입력·결과는 밝은 테마 유지) ================= */
.hero-dark::before { /* 별빛 */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.55;
  background-image:
    radial-gradient(1px 1px at 12% 28%, #fff, transparent),
    radial-gradient(1px 1px at 38% 78%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 62% 22%, #fde68a, transparent),
    radial-gradient(1px 1px at 78% 66%, #fff, transparent),
    radial-gradient(1px 1px at 92% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 22% 60%, #fde68a, transparent);
  background-size: 260px 200px;
}
.hero-dark::after { /* 가로등처럼 번지는 앰버 빛 */
  content: ""; position: absolute; width: 18rem; height: 18rem; right: -4rem; top: -9rem; pointer-events: none;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.22), transparent 65%);
}
.hero-dark > * { position: relative; z-index: 1; }
.hero-dark .sound-btn { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.15); color: #fcd34d; }
.hero-dark .sound-btn:hover { background: rgba(255, 255, 255, 0.2); }
.hero-dark .sound-btn[aria-pressed="true"] { background: #0ea5e9; border-color: #0ea5e9; color: #fff; }
.hero-dark .key-badge { background: rgba(16, 185, 129, 0.12); border-color: rgba(52, 211, 153, 0.35); color: #6ee7b7; }
