:root {
  /* 주색: 호수 블루 1개 */
  --blue: #2563EB;
  --blue-weak: #DBEAFE;
  /* 강조색: 하트 코랄 1개 */
  --coral: #F43F5E;
  /* 회색 스케일 */
  --g900: #0F172A;
  --g700: #334155;
  --g500: #64748B;
  --g300: #CBD5E1;
  --g200: #E2E8F0;
  --g100: #F1F5F9;
  --bg: #F6F8FA;
  /* 글래스 */
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: 1px solid rgba(255, 255, 255, 0.7);
  --shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 8px 28px rgba(15, 23, 42, 0.1);
  --sp: 8px;
  --radius: 16px;
  --scroll-thumb: rgba(100, 116, 139, 0.35);
  --scroll-thumb-hover: rgba(100, 116, 139, 0.6);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

/* 커스텀 스크롤바 */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

/* fixed 요소의 조상에 transform/filter가 생기지 않게 보호 (탭바 고정 유지) */
html, body, main { transform: none !important; filter: none !important; perspective: none !important; }

body {
  margin: 0;
  padding-bottom: 80px;
  min-height: 100vh;
  font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Noto Sans JP", "Noto Sans SC", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--g900);
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(1100px 500px at 50% -10%, rgba(37, 99, 235, 0.08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}

html:lang(zh) body { font-family: "Noto Sans SC", "Pretendard Variable", system-ui, sans-serif; }
html:lang(ja) body { font-family: "Noto Sans JP", "Pretendard Variable", system-ui, sans-serif; }

.icon { display: block; }
h1, h2, h3, h4 { font-family: "Outfit", "Pretendard Variable", Pretendard, system-ui, sans-serif; letter-spacing: -0.01em; }
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3, html:lang(zh) h4 { font-family: "Outfit", "Noto Sans SC", sans-serif; }
html:lang(ja) h1, html:lang(ja) h2, html:lang(ja) h3, html:lang(ja) h4 { font-family: "Outfit", "Noto Sans JP", sans-serif; }

/* ---------- 헤더 (슬림) ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  padding: 10px 16px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--g200);
}
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-header h1 { margin: 0; font-size: 1.1rem; color: var(--g900); font-weight: 700; }
.subtitle { margin: 2px 0 0; font-size: 0.78rem; color: var(--g500); }
.header-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; min-width: 40px; border-radius: 12px;
  border: 1px solid var(--g200); background: #fff; color: var(--g700); cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.icon-btn:hover { border-color: var(--blue); color: var(--blue); }
.icon-btn:active { transform: scale(0.96); }
.sos-btn { border-color: transparent; background: var(--coral); color: #fff; }
.sos-btn:hover { color: #fff; opacity: 0.92; }
.menu-btn { display: none; }

/* 언어 드롭다운 */
.lang-dd { position: relative; }
.lang-trigger {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 10px;
  border: 1px solid var(--g200); border-radius: 12px; background: #fff; color: var(--g700);
  font: inherit; font-size: 0.85rem; cursor: pointer; transition: border-color 0.15s;
}
.lang-trigger:hover { border-color: var(--blue); }
.lang-current { font-weight: 600; }
.lang-caret { display: inline-flex; transition: transform 0.2s; color: var(--g500); }
.lang-dd.open .lang-caret { transform: rotate(180deg); }
.lang-menu {
  position: absolute; right: 0; top: 46px; min-width: 150px; margin: 0; padding: 6px; list-style: none;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: var(--glass-border); border-radius: 14px; box-shadow: var(--shadow-lg); z-index: 60;
  animation: dd-in 0.16s ease;
}
@keyframes dd-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.lang-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 10px; border-radius: 10px; cursor: pointer; font-size: 0.9rem; color: var(--g700);
  min-height: 40px;
}
.lang-opt:hover, .lang-opt:focus { background: var(--g100); outline: none; }
.lang-opt .lang-check { opacity: 0; color: var(--blue); }
.lang-opt.selected { color: var(--blue); font-weight: 600; }
.lang-opt.selected .lang-check { opacity: 1; }

/* ---------- 레이아웃 공통 ---------- */
main { padding: 16px; max-width: 760px; margin: 0 auto; }
.section-head { margin: 24px 0 12px; }
.section-head:first-child { margin-top: 8px; }
.section-head h2 { margin: 0; font-size: 1.05rem; color: var(--g900); font-weight: 700; }
.section-head p, .section-note { margin: 2px 0 0; font-size: 0.82rem; color: var(--g500); }

.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; color: var(--g500); font-size: 0.9rem; padding: 32px 16px;
}
.empty-ic { color: var(--g300); }
.btn-primary {
  min-height: 44px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--blue); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.97); }

.btn-line {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 44px; margin-top: 8px; padding: 0 16px;
  border: 1px solid var(--g200); border-radius: 12px; background: #fff; color: var(--g700);
  font: inherit; font-weight: 600; font-size: 0.9rem; text-decoration: none; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.btn-line:hover { border-color: var(--blue); color: var(--blue); }
.btn-line:active { transform: scale(0.98); }

/* ---------- 검색 / 칩 ---------- */
.controls { margin-bottom: 8px; }
.search-wrap { position: relative; margin-bottom: 10px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--g500); display: inline-flex; }
#spot-search {
  width: 100%; min-height: 44px; padding: 0 14px 0 40px;
  border: 1px solid var(--g200); border-radius: 12px; font: inherit; font-size: 0.95rem;
  color: var(--g900); background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
}
#spot-search::placeholder { color: var(--g500); }
#spot-search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 40px; padding: 0 14px; border: 1px solid var(--g200); border-radius: 999px;
  background: #fff; color: var(--g700); font: inherit; font-size: 0.85rem; cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}
.chip:hover { border-color: var(--blue); }
.chip:active { transform: scale(0.96); }
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }

/* ---------- 카드 ---------- */
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card {
  position: relative; background: #fff; border: 1px solid var(--g200); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card:hover { box-shadow: var(--shadow-lg); border-color: var(--g300); }
.card:active { transform: scale(0.99); }
.card-thumb {
  height: 84px; display: flex; align-items: center; justify-content: center; color: var(--blue);
  background: var(--blue-weak);
}
/* 카테고리별 아주 연한 단색 배경 (주색 계열 + 회색 톤으로만) */
.cat-nature { background: #E7F0FE; color: #2563EB; }
.cat-activity { background: #EEF2F7; color: #475569; }
.cat-culture { background: #EAF1FD; color: #3B6FD4; }
.cat-nightview { background: #E8ECF4; color: #334155; }
.cat-food { background: #F0F4FA; color: #4C6FB5; }
.card-body { padding: 12px; }
.card-body h3 { margin: 0 0 4px; font-size: 0.95rem; color: var(--g900); font-weight: 600; }
.card-body p { margin: 0; font-size: 0.82rem; color: var(--g500); line-height: 1.5; }

/* 하트 버튼 */
.heart-btn {
  position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--g200); background: rgba(255, 255, 255, 0.92); color: var(--g500);
  cursor: pointer; z-index: 2; transition: transform 0.15s, color 0.15s, border-color 0.15s;
}
.heart-btn:hover { border-color: var(--coral); color: var(--coral); }
.heart-btn.on { color: var(--coral); border-color: var(--coral); }
.heart-btn.on .icon { fill: var(--coral); }
.heart-btn.pop { animation: heart-pop 0.35s ease; }
@keyframes heart-pop { 0% { transform: scale(1); } 30% { transform: scale(1.35); } 60% { transform: scale(0.9); } 100% { transform: scale(1); } }
.heart-btn.big { position: static; width: 44px; height: 44px; }

/* 음식 / 먹기 카드 */
.food-card, .eat-card { grid-column: 1 / -1; cursor: default; padding: 16px; }
.food-card:active, .eat-card:active { transform: none; }
.food-head { display: flex; align-items: center; gap: 10px; }
.food-ic { color: var(--blue); display: inline-flex; }
.food-head h3 { margin: 0; font-size: 1.05rem; }
.food-card > p { font-size: 0.9rem; color: var(--g700); }
.food-card h4, .eat-card h4 { margin: 14px 0 6px; font-size: 0.85rem; color: var(--blue); font-weight: 700; }
.tip { background: var(--g100); border: 1px solid var(--g200); padding: 10px 12px; border-radius: 12px; font-size: 0.86rem; color: var(--g700); }
.phrase-mini { list-style: none; padding: 0; margin: 0; }
.phrase-mini li { padding: 8px 10px; border-radius: 10px; background: var(--g100); margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.phrase-mini .ko { font-weight: 600; color: var(--g900); }
.phrase-mini .roman { font-size: 0.8rem; color: var(--blue); font-style: italic; }
.phrase-mini .trans { font-size: 0.82rem; color: var(--g500); }

.eat-steps { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.eat-step { display: flex; gap: 12px; align-items: flex-start; }
.eat-step-num {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-weak); color: var(--blue);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem;
}
.eat-step strong { display: block; color: var(--g900); font-size: 0.92rem; }
.eat-step p { margin: 2px 0 0; font-size: 0.85rem; color: var(--g700); }

/* ---------- 회화 ---------- */
.phrase-list { display: flex; flex-direction: column; gap: 8px; }
.phrase-card { background: #fff; border: 1px solid var(--g200); border-left: 3px solid var(--blue); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.phrase-ko { font-size: 1.02rem; font-weight: 700; color: var(--g900); }
.phrase-roman { font-size: 0.85rem; color: var(--blue); font-style: italic; margin: 3px 0; }
.phrase-trans { font-size: 0.9rem; color: var(--g500); }

/* ---------- HOME ---------- */
.hero { margin-bottom: 8px; }
.hero-top h2 { margin: 4px 0 6px; font-size: 1.4rem; color: var(--g900); }
.hero-line { margin: 0 0 14px; font-size: 0.95rem; color: var(--g700); }
.feat-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.feat {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px;
  text-align: left; padding: 14px 16px; min-height: 44px; cursor: pointer;
  background: #fff; border: 1px solid var(--g200); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.feat:hover { border-color: var(--blue); box-shadow: var(--shadow-lg); }
.feat:active { transform: scale(0.99); }
.feat-ic { grid-row: 1 / 3; align-self: center; color: var(--blue); display: inline-flex; }
.feat-title { font-weight: 700; color: var(--g900); }
.feat-desc { font-size: 0.82rem; color: var(--g500); }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-card {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 14px; cursor: pointer;
  background: #fff; border: 1px solid var(--g200); border-radius: 14px; box-shadow: var(--shadow);
  color: var(--g900); font: inherit; font-weight: 600; font-size: 0.86rem; text-align: left;
  transition: transform 0.15s, border-color 0.15s;
}
.quick-card:hover { border-color: var(--blue); }
.quick-card:active { transform: scale(0.98); }
.quick-ic { color: var(--blue); display: inline-flex; }

.seasonal { margin-top: 16px; }
.seasonal-card {
  display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer;
  background: var(--blue-weak); border: 1px solid #C7DBFB; border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.seasonal-card:active { transform: scale(0.99); }
.seasonal-ic { color: var(--blue); display: inline-flex; }
.seasonal-card h3 { margin: 0 0 4px; color: var(--g900); font-size: 1rem; }
.seasonal-card p { margin: 0; font-size: 0.85rem; color: var(--g700); }

/* ---------- 플래너 ---------- */
.planner-form {
  display: flex; flex-direction: column; gap: 6px; padding: 16px; margin-bottom: 12px;
  background: #fff; border: 1px solid var(--g200); border-radius: var(--radius); box-shadow: var(--shadow);
}
.planner-form label { font-size: 0.78rem; font-weight: 700; color: var(--g700); margin-top: 8px; }
.planner-form select, .planner-form input[type=time], .plan-form input, .plan-form select, #pl-save-wrap input {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--g200); border-radius: 10px; font: inherit;
  color: var(--g900); background: #fff;
}
.planner-form #pl-generate {
  margin-top: 14px; min-height: 48px; border: 0; border-radius: 12px; background: var(--blue); color: #fff;
  font: inherit; font-weight: 700; cursor: pointer; transition: transform 0.15s, opacity 0.15s;
}
.planner-form #pl-generate:hover { opacity: 0.92; }
.planner-form #pl-generate:active { transform: scale(0.98); }
.planner-form #pl-generate:disabled { opacity: 0.6; }
.disclaimer { font-size: 0.78rem; color: var(--g500); margin: 0 0 12px; }

.timeline { display: flex; flex-direction: column; margin-bottom: 12px; }
.tl-row {
  display: grid; grid-template-columns: 50px 28px 1fr; align-items: center; gap: 8px;
  padding: 10px 0 10px 12px; margin-left: 6px; border-left: 2px solid var(--g200);
}
.tl-time { font-weight: 700; color: var(--blue); font-size: 0.85rem; }
.tl-ic { color: var(--g500); display: inline-flex; }
.tl-body { display: flex; flex-direction: column; }
.tl-body strong { font-size: 0.9rem; color: var(--g900); }
.tl-body em { font-style: normal; font-size: 0.76rem; color: var(--g500); }

#pl-save-wrap { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
#pl-save-wrap input { flex: 1; min-width: 140px; }
#pl-save { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--g900); color: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: transform 0.15s; }
#pl-save:active { transform: scale(0.98); }

/* 즐겨찾기/일정 */
.plan-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.plan-form input, .plan-form select { flex: 1; min-width: 120px; }
.plan-form button { min-height: 44px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font: inherit; font-weight: 600; cursor: pointer; transition: transform 0.15s; }
.plan-form button:active { transform: scale(0.98); }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-day { background: #fff; border: 1px solid var(--g200); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.plan-day h4 { margin: 0 0 8px; color: var(--g700); font-size: 0.85rem; }
.plan-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid var(--g100); font-size: 0.92rem; }
.plan-item:first-of-type { border-top: 0; }
.plan-del { width: 36px; height: 36px; min-width: 36px; border-radius: 10px; }

/* ---------- 상세 모달 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, 0.45); display: flex; align-items: flex-end; justify-content: center; }
.modal-box {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  padding: 22px 20px 28px; border-radius: 20px 20px 0 0;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border: var(--glass-border); box-shadow: var(--shadow-lg); animation: slideup 0.2s ease;
}
@keyframes slideup { from { transform: translateY(24px); } to { transform: translateY(0); } }
.modal-close { position: absolute; top: 12px; right: 12px; }
.detail-thumb { height: 110px; border-radius: 14px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-head h2 { margin: 0; color: var(--g900); font-size: 1.2rem; }
.detail-desc { font-size: 0.92rem; color: var(--g700); margin: 10px 0; }
.detail-info { margin: 14px 0; }
.detail-info dt { font-weight: 700; font-size: 0.8rem; color: var(--blue); margin-top: 10px; }
.detail-info dd { margin: 3px 0 0; font-size: 0.9rem; color: var(--g700); }
#sos-title { color: var(--g900); margin: 4px 0 14px; }

/* ---------- 긴급 ---------- */
.emergency-list { display: flex; flex-direction: column; gap: 10px; }
.emergency-card { background: #fff; border: 1px solid var(--g200); border-left: 3px solid var(--coral); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.em-head { display: flex; align-items: center; gap: 10px; }
.em-ic { color: var(--coral); display: inline-flex; }
.em-head h3 { margin: 0; font-size: 1rem; }
.em-call { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 4px; min-height: 44px; padding: 0 16px; border-radius: 10px; background: var(--coral); color: #fff; text-decoration: none; font-weight: 700; }
.emergency-card p { font-size: 0.86rem; color: var(--g500); margin: 8px 0 0; }

/* ---------- 보여주기 ---------- */
.show-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.show-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 44px; padding: 16px 10px; cursor: pointer;
  background: #fff; border: 1px solid var(--g200); border-radius: 14px; box-shadow: var(--shadow);
  color: var(--g900); font: inherit; font-size: 0.82rem; font-weight: 600; text-align: center;
  transition: transform 0.15s, border-color 0.15s;
}
.show-tile:hover { border-color: var(--blue); }
.show-tile:active { transform: scale(0.97); }
.show-ic { color: var(--blue); display: inline-flex; }

.showcard-modal { position: fixed; inset: 0; z-index: 80; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.showcard-close { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; }
.showcard-body { width: 100%; max-width: 560px; }
.sc-ko { font-size: 2rem; font-weight: 800; color: var(--g900); line-height: 1.4; margin: 12px 0; word-break: keep-all; }
.sc-counter { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 18px 0; }
.sc-btn { width: 56px; height: 56px; border-radius: 14px; border: 0; background: var(--blue); color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.sc-btn:active { transform: scale(0.94); }
.sc-count { display: flex; flex-direction: column; }
.sc-count em { font-style: normal; font-size: 0.8rem; color: var(--g500); }
.sc-count strong { font-size: 2rem; color: var(--g900); }
.sc-opts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }
.sc-opt { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--blue); background: #fff; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }
.sc-opt.on { background: var(--blue); color: #fff; }
.sc-meaning { font-size: 1rem; color: var(--g500); margin-top: 18px; }

/* ---------- 뉴스 ---------- */
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-card { background: #fff; border: 1px solid var(--g200); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; transition: border-color 0.15s; }
.news-card.open { border-color: var(--blue); }
.news-head { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 14px; border: 0; background: none; font: inherit; color: var(--g900); cursor: pointer; }
.news-head:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 12px; }
.news-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex-shrink: 0; border: 1px solid var(--g200); }
.news-thumb-ph { display: inline-flex; align-items: center; justify-content: center; background: var(--g100); color: var(--g500); }
.news-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.news-title { font-size: 0.95rem; font-weight: 600; color: var(--g900); line-height: 1.4; }
.news-meta { font-size: 0.76rem; color: var(--g500); }
.news-prev { font-size: 0.8rem; color: var(--g500); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-arrow { flex-shrink: 0; color: var(--g500); display: inline-flex; transition: transform 0.25s; }
.news-card.open .news-arrow { transform: rotate(180deg); }
.news-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.3s ease; }
.news-card.open .news-panel { grid-template-rows: 1fr; }
.news-panel-inner { overflow: hidden; min-height: 0; padding: 0 14px; }
.news-card.open .news-panel-inner { padding: 0 14px 14px; }
.article-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; }
.summary-ttl { margin: 0 0 10px; font-weight: 700; color: var(--g900); }
.summary { background: var(--g100); border: 1px solid var(--g200); border-radius: 12px; padding: 12px 14px; }
.summary-error { border-color: #FBCFE8; }
.summary-head { font-size: 0.72rem; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.summary-text { margin: 0; font-size: 0.9rem; color: var(--g700); }
.article-points { margin: 10px 0 0; padding-left: 18px; }
.article-points li { font-size: 0.86rem; color: var(--g700); margin-bottom: 4px; }
.news-actions { margin-top: 12px; }
.news-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--g200); border-radius: 10px; background: #fff; color: var(--g700); font: inherit; font-size: 0.82rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.news-btn:hover { border-color: var(--blue); color: var(--blue); }
.retry-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; border: 0; background: none; color: var(--blue); font: inherit; font-weight: 600; cursor: pointer; }

.links-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.link-card { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--g200); box-shadow: var(--shadow); color: var(--g900); text-decoration: none; font-size: 0.85rem; font-weight: 600; transition: border-color 0.15s; }
.link-card:hover { border-color: var(--blue); }
.link-ic { color: var(--blue); display: inline-flex; }

/* ---------- 온보딩 ---------- */
.onboard-box { text-align: center; max-width: 400px; border-radius: 20px; align-self: center; }
.ob-ic { display: inline-flex; color: var(--blue); }
.onboard-slide h2 { color: var(--g900); margin: 12px 0 8px; }
.onboard-slide p { font-size: 0.92rem; color: var(--g700); }
.onboard-dots { display: flex; gap: 8px; justify-content: center; margin: 18px 0; }
.onboard-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--g300); transition: width 0.2s; }
.onboard-dots span.on { background: var(--blue); width: 20px; border-radius: 4px; }
.onboard-actions { display: flex; justify-content: space-between; gap: 10px; }
.onboard-skip { min-height: 44px; background: none; border: 0; color: var(--g500); font: inherit; cursor: pointer; padding: 0 12px; }
.onboard-next { flex: 1; min-height: 48px; border: 0; border-radius: 12px; background: var(--blue); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.onboard-next:active { transform: scale(0.98); }

/* ---------- 하단 탭 바 (선택 항목만 주색) ---------- */
.tab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--g200); padding-bottom: env(safe-area-inset-bottom);
}
.tab-bar button {
  flex: 1; min-height: 56px; border: 0; background: none; padding: 8px 2px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--g500);
  transition: color 0.15s;
}
.tab-bar button .nav-ic { display: inline-flex; transition: transform 0.2s; }
.tab-bar button em { font-style: normal; font-size: 0.68rem; }
.tab-bar button.active { color: var(--blue); font-weight: 700; }
.tab-bar button.active .nav-ic { transform: translateY(-1px); }
.tab-bar button:active { transform: scale(0.96); }

/* ---------- 드로어 ---------- */
.drawer-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, 0.4); }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 300px; max-width: 80vw; padding: 20px 16px; z-index: 71;
  background: var(--glass-strong); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  border-left: 1px solid var(--g200); box-shadow: var(--shadow-lg);
  transform: translateX(110%); transition: transform 0.3s ease; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer h2 { margin: 4px 0 16px; color: var(--g900); }
.drawer-close { position: absolute; top: 14px; right: 14px; }
.drawer-nav { display: flex; flex-direction: column; gap: 6px; }
.drawer-nav button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--g200); border-radius: 12px; background: #fff; color: var(--g700);
  font: inherit; font-size: 0.95rem; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.drawer-nav button .nav-ic { display: inline-flex; }
.drawer-nav button em { font-style: normal; }
.drawer-nav button:hover { border-color: var(--blue); }
.drawer-nav button.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- 토스트 ---------- */
.toast-container { position: fixed; right: 16px; bottom: 76px; display: flex; flex-direction: column-reverse; gap: 8px; z-index: 90; pointer-events: none; }
.toast {
  background: var(--g900); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 0.86rem; font-weight: 600; max-width: 78vw; animation: toast-in 0.3s ease;
}
.toast.out { animation: toast-out 0.4s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toast-out { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(40px); } }

/* ---------- 스켈레톤 (shimmer) ---------- */
.shimmer {
  background: linear-gradient(90deg, var(--g100) 25%, var(--g200) 37%, var(--g100) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.card.sk, .news-card.sk { cursor: default; pointer-events: none; }
.sk-thumb { height: 84px; }
.sk-thumb-sq { width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0; }
.sk-img { width: 100%; height: 150px; border-radius: 12px; margin-bottom: 10px; }
.sk-line { height: 12px; border-radius: 6px; margin: 8px 0; }
.sk-title { height: 16px; width: 70%; }
.sk-meta { width: 40%; }
.sk-dot { width: 18px; height: 18px; border-radius: 50%; }

/* ---------- 등장 애니메이션 (stagger) ---------- */
/* 조상에 transform을 걸지 않도록, 개별 콘텐츠 요소에만 적용 */
.tab-panel.anim .card,
.tab-panel.anim .feat,
.tab-panel.anim .quick-card,
.tab-panel.anim .seasonal-card,
.tab-panel.anim .phrase-card,
.tab-panel.anim .show-tile,
.tab-panel.anim .emergency-card,
.tab-panel.anim .link-card,
.tab-panel.anim .plan-day,
.tab-panel.anim .tl-row,
.tab-panel.anim .news-card,
.card, .feat, .quick-card, .phrase-card, .show-tile, .link-card, .tl-row, .news-card, .emergency-card {
  opacity: 0; animation: rise 0.4s ease forwards; animation-delay: calc(var(--i, 0) * 0.1s);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 큰 화면 / PC ---------- */
@media (min-width: 620px) {
  .card-grid { grid-template-columns: 1fr 1fr 1fr; }
  .feat-grid { grid-template-columns: 1fr 1fr 1fr; }
  .quick-grid, .links-list { grid-template-columns: 1fr 1fr 1fr 1fr; }
  .show-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (min-width: 1024px) {
  body { padding-bottom: 24px; }
  .tab-bar { display: none; }
  .menu-btn { display: inline-flex; }
  .toast-container { bottom: 24px; }
  main { max-width: 900px; }
  .modal { align-items: center; }
  .modal-box { border-radius: 20px; }
}

/* ---------- 움직임 최소화 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .card, .feat, .quick-card, .phrase-card, .show-tile, .link-card, .tl-row, .news-card, .emergency-card,
  .seasonal-card { opacity: 1 !important; transform: none !important; }
  .heart-btn.pop { animation: none; }
  .shimmer { animation: none; background: var(--g100); }
}

/* ========================================================= */
/* Mist Quest (게임화)                                        */
/* 규칙: transform 애니메이션은 main/모달 안쪽 콘텐츠에만.      */
/*       fixed 요소(.tab-bar .modal .drawer .toast .confetti)  */
/*       와 그 조상(html/body/main)에는 걸지 않는다.            */
/* ========================================================= */

/* ---- 레벨 카드 ---- */
.level-card {
  margin: 8px 0 8px; padding: 16px; border-radius: var(--radius);
  background: var(--glass-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: var(--glass-border); box-shadow: var(--shadow);
}
.lc-main { display: flex; align-items: center; gap: 12px; }
.lc-badge {
  flex-shrink: 0; width: 56px; height: 56px; border-radius: 16px; background: var(--blue); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.lc-badge span { font-size: 0.7rem; opacity: 0.85; }
.lc-badge strong { font-size: 1.4rem; font-family: "Outfit", sans-serif; }
.lc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lc-title { font-weight: 700; font-size: 1.05rem; color: var(--g900); }
.lc-xp { font-size: 0.82rem; color: var(--g500); }
.lc-town {
  flex-shrink: 0; width: 96px; height: 56px; padding: 0; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--g200); background: #fff; cursor: pointer; transition: border-color 0.15s;
}
.lc-town:hover { border-color: var(--blue); }
.lc-town:active { transform: scale(0.97); }
.lc-bar { height: 10px; margin: 14px 0 8px; border-radius: 999px; background: var(--g200); overflow: hidden; }
.lc-fill { display: block; height: 100%; border-radius: 999px; background: var(--blue); transition: width 0.9s cubic-bezier(.2,.8,.2,1); }
.lc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: var(--g500); }
.lc-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border: 1px solid var(--g200); border-radius: 10px; background: #fff; color: var(--g700);
  font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.lc-link:hover { border-color: var(--blue); color: var(--blue); }

/* ---- 안개 지도 ---- */
.mist-wrap {
  padding: 12px; border-radius: var(--radius); background: #fff; border: 1px solid var(--g200); box-shadow: var(--shadow);
}
.mist-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.82rem; color: var(--g700); font-weight: 600; }
.mist-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--g200); overflow: hidden; }
.mist-bar span { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 999px; transition: width 0.9s ease; }
.mist-svg { display: block; width: 100%; max-width: 560px; margin: 0 auto; height: auto; border-radius: 12px; }
.m-land { fill: #EEF2F6; }
.m-water { fill: #BFD5FA; }
.m-stream { fill: none; stroke: #BFD5FA; stroke-width: 5; stroke-linecap: round; }
.m-hill { fill: #DDE4EC; }
.pin { cursor: pointer; outline: none; }
.pin-hit { fill: transparent; }
.pin-shape { fill: #94A3B8; stroke: #fff; stroke-width: 1.5; transition: fill 0.4s; }
.pin-dot { fill: #fff; }
.pin.on .pin-shape { fill: var(--blue); }
.pin-badge { fill: var(--coral); stroke: #fff; stroke-width: 1.5; }
.pin-label { font-size: 8.5px; font-weight: 600; fill: var(--g700); text-anchor: middle; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.pin:focus-visible .pin-shape { stroke: var(--g900); stroke-width: 2.5; }
.fog-base { fill: rgba(248, 250, 252, 0.82); }
/* 안개는 보이기만 하고 클릭은 아래 핀으로 통과시킨다 */
.fog { pointer-events: none; }
.fog-puff { fill: rgba(255, 255, 255, 0.9); }
/* 안개가 천천히 흐르는 애니메이션 (SVG 내부 요소만) */
.fog-drift { animation: fog-drift 14s ease-in-out infinite alternate; }
@keyframes fog-drift { from { transform: translateX(-14px); } to { transform: translateX(14px); } }

/* 상세 화면 체크인 */
.ci-wrap { margin: 4px 0 8px; }
.ci-btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ci-btn:disabled { opacity: 0.7; }
.ci-badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  background: var(--blue-weak); color: var(--blue); font-size: 0.85rem; font-weight: 700;
}

/* ---- 오늘의 미션 ---- */
.mission-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  background: #fff; border: 1px solid var(--g200); box-shadow: var(--shadow);
}
.mission-card .ms-body { flex: 1 1 200px; }
.mission-card .ms-btn { flex: 1 1 100%; justify-content: center; }
@media (min-width: 620px) { .mission-card .ms-btn { flex: 0 0 auto; } }
.ms-ic { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-weak); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
.ms-body { flex: 1; min-width: 0; }
.ms-text { margin: 0; font-size: 0.92rem; color: var(--g900); }
.ms-meta { font-size: 0.78rem; color: var(--g500); }
.ms-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--blue); border-radius: 12px; background: #fff; color: var(--blue);
  font: inherit; font-size: 0.82rem; font-weight: 700; cursor: pointer; transition: background 0.15s, color 0.15s;
}
.ms-btn:hover { background: var(--blue); color: #fff; }
.ms-btn:active { transform: scale(0.96); }
.ms-btn.done { border-color: var(--g200); color: var(--g500); background: var(--g100); cursor: default; }

/* ---- 놀이 그리드 ---- */
.play-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.play-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 44px; padding: 14px;
  background: #fff; border: 1px solid var(--g200); border-radius: 14px; box-shadow: var(--shadow);
  font: inherit; text-align: left; color: var(--g900); cursor: pointer; transition: border-color 0.15s;
}
.play-tile:hover { border-color: var(--blue); }
.play-tile:active { transform: scale(0.97); }
.play-ic { color: var(--blue); display: inline-flex; }
.play-label { font-weight: 700; font-size: 0.9rem; }
.play-sub { font-size: 0.76rem; color: var(--g500); }

/* ---- 게임 모달 공통 ---- */
.game-box h2 { margin: 4px 40px 8px 0; color: var(--g900); font-size: 1.15rem; }
.gm-lead { margin: 0 0 6px; font-weight: 700; color: var(--g900); }
.gm-text { margin: 0 0 12px; font-size: 0.88rem; color: var(--g500); }
.gm-actions { display: flex; gap: 8px; }
.gm-actions .btn-line, .gm-actions .btn-primary { flex: 1; margin-top: 0; }

/* 세그먼트 컨트롤 */
.seg { display: flex; gap: 4px; padding: 4px; margin-bottom: 12px; border-radius: 12px; background: var(--g100); }
.seg-scroll { overflow-x: auto; }
.seg-btn {
  flex: 1; min-height: 40px; padding: 0 10px; border: 0; border-radius: 9px; background: none;
  color: var(--g500); font: inherit; font-size: 0.82rem; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.seg-btn.active { background: #fff; color: var(--blue); box-shadow: var(--shadow); }

/* ---- 도전과제 ---- */
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ach {
  display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px;
  background: #fff; border: 1px solid var(--g200);
  opacity: 0; animation: rise 0.4s ease forwards; animation-delay: calc(var(--i, 0) * 0.1s);
}
.ach-ic { color: var(--blue); display: inline-flex; }
.ach strong { font-size: 0.88rem; color: var(--g900); }
.ach p { margin: 0; font-size: 0.76rem; color: var(--g500); line-height: 1.45; }
.ach-bar { height: 6px; margin-top: 6px; border-radius: 999px; background: var(--g200); overflow: hidden; }
.ach-bar span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.ach-meta { font-size: 0.72rem; color: var(--g500); font-weight: 600; }
.ach.locked { background: var(--g100); }
.ach.locked .ach-ic, .ach.locked strong { color: var(--g500); }
.ach.locked .ach-bar span { background: var(--g300); }
.ach.done { border-color: #C7DBFB; }
.ach.done .ach-ic { animation: badge-pop 0.5s ease both; animation-delay: calc(var(--i, 0) * 0.1s + 0.2s); }
@keyframes badge-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ---- My Lake Town ---- */
.town-svg { display: block; width: 100%; height: 100%; }
.town-big { border-radius: 14px; overflow: hidden; border: 1px solid var(--g200); margin-bottom: 12px; aspect-ratio: 16 / 9; }
.tw-sky { fill: #F1F5FB; }
.tw-lake { fill: #BFD5FA; }
.tw-ground { fill: #E2E8F0; }
.tw-layer g, .tw-layer path, .tw-layer circle, .tw-layer rect { stroke: var(--g700); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.tw-tree circle { fill: #D6E4FB; }
.tw-boat path:first-child { fill: #fff; }
.tw-shop rect { fill: #fff; }
.tw-light { fill: var(--coral) !important; stroke: none !important; }
.tw-fire circle, .tw-fire path { stroke: var(--coral); }
.tw-wheel circle { fill: none; }
/* 잠긴 요소: 실루엣 */
.tw-layer.locked g, .tw-layer.locked path, .tw-layer.locked circle, .tw-layer.locked rect {
  stroke: var(--g300) !important; fill: none !important; stroke-dasharray: 3 3;
}
/* 새로 해금된 요소 등장 */
.tw-new { animation: tw-in 0.8s cubic-bezier(.2,.8,.2,1) both; transform-box: fill-box; transform-origin: center bottom; }
@keyframes tw-in { 0% { opacity: 0; transform: translateY(10px) scale(0.6); } 100% { opacity: 1; transform: none; } }
.tw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tw-item {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px;
  background: #fff; border: 1px solid var(--g200); font-size: 0.88rem; color: var(--g900);
  opacity: 0; animation: rise 0.4s ease forwards; animation-delay: calc(var(--i, 0) * 0.1s);
}
.tw-item em { margin-left: auto; font-style: normal; font-size: 0.76rem; color: var(--g500); }
.tw-ic { color: var(--blue); display: inline-flex; }
.tw-item.locked { background: var(--g100); color: var(--g500); }
.tw-item.locked .tw-ic { color: var(--g500); }

/* ---- 레벨업 ---- */
.lu { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lu-badge {
  width: 84px; height: 84px; border-radius: 24px; background: var(--blue); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  animation: badge-pop 0.6s ease both;
}
.lu-badge span { font-size: 0.8rem; opacity: 0.85; }
.lu-badge strong { font-size: 2.2rem; font-family: "Outfit", sans-serif; }
.lu-label { margin: 8px 0 0; font-size: 0.76rem; font-weight: 700; color: var(--g500); text-transform: uppercase; letter-spacing: 0.04em; }
.lu-title { margin: 0; font-size: 1.3rem; font-weight: 700; color: var(--g900); }
.lu-town { width: 100%; margin-top: 8px; }
.lu-list { list-style: none; margin: 0 0 8px; padding: 0; }
.lu-list li { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--blue); font-weight: 600; font-size: 0.9rem; }
.lu .btn-primary { width: 100%; margin-top: 8px; }
.confetti { position: fixed; inset: 0; z-index: 95; pointer-events: none; }

/* ---- 퀴즈 ---- */
.qz-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--g500); margin-bottom: 8px; }
.qz-combo { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: #FFE4E8; color: #BE123C; font-weight: 700; animation: badge-pop 0.4s ease; }
.qz-ko { margin: 0 0 14px; font-size: 1.6rem; font-weight: 800; color: var(--g900); text-align: center; }
.qz-opts { display: grid; grid-template-columns: 1fr; gap: 8px; }
.qz-opt {
  min-height: 48px; padding: 0 14px; border: 1px solid var(--g200); border-radius: 12px; background: #fff;
  color: var(--g900); font: inherit; font-size: 0.92rem; text-align: left; cursor: pointer; transition: border-color 0.15s;
}
.qz-opt:hover:not([disabled]) { border-color: var(--blue); }
.qz-opt:active:not([disabled]) { transform: scale(0.98); }
.qz-opt.right { border-color: var(--blue); background: var(--blue-weak); color: #1E40AF; font-weight: 700; }
.qz-opt.wrong { border-color: var(--coral); background: #FFE4E8; color: #9F1239; }
.qz-result { margin: 12px 0 4px; text-align: center; font-weight: 700; }
.qz-result.ok { color: #1E40AF; }
.qz-result.no { color: #9F1239; }
#qz-next { width: 100%; margin-top: 8px; }

/* ---- 맵기 룰렛 ---- */
.rl-wrap { position: relative; width: 240px; max-width: 80%; margin: 0 auto 12px; }
.rl-pointer {
  position: absolute; top: -4px; left: 50%; margin-left: -10px; width: 0; height: 0; z-index: 2;
  border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 18px solid var(--g900);
}
.rl-wheel { display: block; width: 100%; height: auto; transition: transform 3.2s cubic-bezier(.15,.85,.2,1); }
.rl-seg { stroke: #fff; stroke-width: 2; }
.rl-s0 { fill: #DBEAFE; } .rl-s1 { fill: #BFDBFE; } .rl-s2 { fill: #93C5FD; } .rl-s3 { fill: #FDA4AF; } .rl-s4 { fill: #F43F5E; }
.rl-txt { font-size: 11px; font-weight: 700; fill: var(--g900); text-anchor: middle; dominant-baseline: middle; }
.rl-hub { fill: #fff; stroke: var(--g300); stroke-width: 2; }
.rl-result { min-height: 24px; margin: 0 0 10px; text-align: center; color: var(--g900); }
#rl-spin { width: 100%; }

/* ---- 스크래치 카드 ---- */
.scr-card {
  position: relative; min-height: 140px; border-radius: 14px; overflow: hidden;
  background: var(--blue-weak); border: 1px solid #C7DBFB;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.scr-tmi { margin: 0; width: 100%; text-align: center; color: #1E3A8A; font-weight: 600; font-size: 0.95rem; }
#scr-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; transition: opacity 0.4s; }
#scr-canvas:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; }
#scr-canvas.scr-done { opacity: 0; }

/* stagger 대상에 게임 요소 추가 */
.play-tile, .mission-card, .level-card { opacity: 0; animation: rise 0.4s ease forwards; animation-delay: calc(var(--i, 0) * 0.1s); }

@media (min-width: 620px) {
  .play-grid { grid-template-columns: repeat(5, 1fr); }
  .ach-grid { grid-template-columns: 1fr 1fr 1fr; }
  .qz-opts { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .fog-drift, .tw-new, .ach, .tw-item, .play-tile, .mission-card, .level-card, .lu-badge, .qz-combo { animation: none !important; opacity: 1 !important; }
  .rl-wheel, .lc-fill, .mist-bar span { transition: none !important; }
}

/* ========================================================= */
/* 개편 B                                                     */
/* ========================================================= */

/* ---- (5) 헤더: 한 줄, 줄바꿈 없음 ---- */
.header-row { flex-wrap: nowrap; }
.app-header h1 { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-right { flex-shrink: 0; }
.subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang-trigger { white-space: nowrap; padding: 0 8px; gap: 4px; }
.lang-current { font-size: 0.8rem; letter-spacing: 0.02em; }

/* ---- (4) 하트: 원 정중앙 20px, 빈 상태 = 회색 선만 / 채운 상태 = 같은 경로 코랄 채움 ---- */
.heart-btn { padding: 0; line-height: 0; }
.heart-btn .icon { width: 20px; height: 20px; display: block; fill: none; stroke: var(--g500); }
.heart-btn:hover .icon { stroke: var(--coral); }
.heart-btn.on .icon { fill: var(--coral); stroke: var(--coral); }
.heart-btn.pop .icon { animation: heart-pop 0.35s ease; transform-origin: center; }
.heart-btn.pop { animation: none; }

/* ---- (3) 캐러셀 ---- */
.carousel { position: relative; margin: 12px 0 4px; }
.car-viewport { overflow: hidden; border-radius: var(--radius); }
/* 트랙은 main 안의 일반 요소. fixed 요소의 조상이 아니므로 transform 이동 OK */
.car-track { display: flex; transition: transform 0.45s cubic-bezier(.2,.8,.2,1); }
.slide {
  flex: 0 0 100%; min-height: 128px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 18px 20px; border: 0; text-align: left; cursor: pointer; font: inherit; color: #fff;
}
.slide:focus-visible { outline: 3px solid var(--g900); outline-offset: -3px; }
.slide-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 62%; }
.slide-text strong { font-family: "Outfit", "Pretendard Variable", sans-serif; font-size: 1.1rem; }
.slide-text span { font-size: 0.86rem; line-height: 1.45; opacity: 0.95; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* 블루 1색 계열의 명암만 사용 (+ 맛집은 코랄 한 장) */
.sl-mission { background: linear-gradient(135deg, #2563EB, #1E40AF); }
.sl-season  { background: linear-gradient(135deg, #3B82F6, #1D4ED8); }
.sl-mist    { background: linear-gradient(135deg, #64748B, #334155); }
.sl-food    { background: linear-gradient(135deg, #F43F5E, #BE123C); }
.sl-route   { background: linear-gradient(135deg, #1E40AF, #0F172A); }
.slide-art { flex-shrink: 0; width: 38%; max-width: 150px; height: auto; }
.a-line { fill: none; stroke: rgba(255,255,255,0.9); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.a-line.w { stroke-width: 8; stroke: rgba(255,255,255,0.75); }
.a-ring { fill: none; stroke: rgba(255,255,255,0.85); stroke-width: 6; }
.a-fill { fill: rgba(255,255,255,0.95); }
.a-fill.o { fill: rgba(255,255,255,0.55); }
.car-arrow {
  position: absolute; top: 64px; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.6); background: rgba(255,255,255,0.85); color: var(--g900);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.car-arrow.prev { left: 8px; } .car-arrow.next { right: 8px; }
.carousel:hover .car-arrow, .car-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .car-arrow { display: none; } }
.car-dots { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
/* 터치 영역 44px, 보이는 점은 작게 */
.car-dot { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.car-dot::after { content: ""; width: 8px; height: 8px; border-radius: 999px; background: var(--g300); transition: width 0.25s, background 0.25s; }
.car-dot.on::after { width: 22px; background: var(--blue); }

/* ---- (1) 근처 맛집 ---- */
.nearby-controls { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.nearby-controls .seg { margin-bottom: 0; }
.nearby-controls .seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.nb-select { min-height: 44px; padding: 0 12px; border: 1px solid var(--g200); border-radius: 10px; font: inherit; background: #fff; color: var(--g900); }
.nb-radius { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; font-size: 0.85rem; color: var(--g700); font-weight: 600; }
.nb-radius input[type=range], .stay-row input[type=range] { width: 100%; min-height: 32px; accent-color: var(--blue); }
.nb-radius output, .stay-row output { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; color: var(--g900); }
.nb-note { margin: -4px 0 10px; font-size: 0.8rem; color: var(--g500); }
.nb-list { display: flex; flex-direction: column; gap: 10px; }
.nb-card {
  display: flex; gap: 12px; padding: 14px; background: #fff; border: 1px solid var(--g200); border-radius: var(--radius); box-shadow: var(--shadow);
  opacity: 0; animation: rise 0.4s ease forwards; animation-delay: calc(var(--i, 0) * 0.1s);
}
.nb-card.pick { border-color: #C7DBFB; background: #F7FAFF; }
.nb-ic { flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--blue-weak); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; }
.nb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.nb-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.nb-title strong { font-size: 0.95rem; color: var(--g900); }
.badge-pick { font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--blue); color: #fff; letter-spacing: 0.02em; }
.nb-orig { font-size: 0.78rem; color: var(--g500); }
.nb-desc { margin: 0; font-size: 0.84rem; color: var(--g700); }
.nb-meta { font-size: 0.78rem; color: var(--g500); }
.nb-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.map-chip {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--g200); background: #fff; color: var(--g700); font: inherit; font-size: 0.78rem; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.map-chip:hover { border-color: var(--blue); color: var(--blue); }
.map-chip:active { transform: scale(0.96); }
.map-chip.strong { color: var(--blue); border-color: #C7DBFB; }
.map-chip.ate { color: var(--g900); }
.map-chip.ate.done { background: var(--g100); color: var(--g500); border-color: var(--g200); cursor: default; }
.nb-card.sk .nb-ic { background: none; }

/* ---- (2) 하루 코스 ---- */
.route-intro { padding: 14px 16px; border-radius: var(--radius); background: var(--blue-weak); border: 1px solid #C7DBFB; margin-bottom: 12px; }
.ri-lead { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 600; color: #1E3A8A; }
.ri-lead .icon { flex-shrink: 0; color: var(--blue); margin-top: 2px; }
.ri-example { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 0.8rem; color: var(--g700); }
.ri-tag { flex-shrink: 0; font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #fff; color: var(--blue); border: 1px solid #C7DBFB; }
.stepper { padding: 16px; background: #fff; border: 1px solid var(--g200); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 8px; }
.step-head { list-style: none; display: flex; gap: 8px; margin: 0 0 14px; padding: 0; }
.step-head li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 0.74rem; color: var(--g500); text-align: center; position: relative; }
.step-head li:not(:last-child)::after { content: ""; position: absolute; top: 14px; left: calc(50% + 18px); right: calc(-50% + 18px); height: 2px; background: var(--g200); }
.step-head li.done:not(:last-child)::after { background: var(--blue); }
.sh-num { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: var(--g100); color: var(--g500); border: 1px solid var(--g200); }
.step-head li.on .sh-num { background: var(--blue); color: #fff; border-color: var(--blue); }
.step-head li.done .sh-num { background: var(--blue-weak); color: var(--blue); border-color: #C7DBFB; }
.step-head li.on .sh-label { color: var(--g900); font-weight: 700; }
.step-panel { display: flex; flex-direction: column; gap: 6px; }
.step-panel label { font-size: 0.78rem; font-weight: 700; color: var(--g700); margin-top: 8px; }
.step-panel select, .step-panel input[type=time], .step-panel input[type=date] {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--g200); border-radius: 10px; font: inherit; color: var(--g900); background: #fff;
}
.stay-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.step-actions { display: flex; gap: 8px; margin-top: 16px; }
.step-actions .btn-line { margin-top: 0; flex: 1; }
.step-actions .btn-primary { flex: 2; }
.step-actions .btn-primary:disabled { opacity: 0.6; }
.tl-row { grid-template-columns: 50px 28px 1fr auto; }
.tl-ci {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 10px; border-radius: 10px;
  border: 1px solid var(--blue); background: #fff; color: var(--blue); font: inherit; font-size: 0.76rem; font-weight: 700; cursor: pointer;
}
.tl-ci:active { transform: scale(0.96); }
.tl-row .ci-badge { min-height: 28px; font-size: 0.72rem; padding: 0 8px; }
.ci-badge:not(.gps) { background: var(--g100); color: var(--g700); }

.route-list { display: flex; flex-direction: column; gap: 10px; }
.route-item { position: relative; border-radius: var(--radius); overflow: hidden; opacity: 0; animation: rise 0.4s ease forwards; animation-delay: calc(var(--i, 0) * 0.1s); }
.route-item.removing { animation: route-out 0.22s ease forwards; }
@keyframes route-out { to { opacity: 0; max-height: 0; margin: 0; } }
.route-del {
  position: absolute; inset: 0 0 0 auto; width: 96px; border: 0; background: var(--coral); color: #fff; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 0.76rem; font-weight: 700;
}
.route-card { position: relative; background: #fff; border: 1px solid var(--g200); border-radius: var(--radius); box-shadow: var(--shadow); transition: transform 0.2s ease; touch-action: pan-y; }
.route-item.dragging .route-card { transition: none; }
.route-card summary { list-style: none; display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; cursor: pointer; }
.route-card summary::-webkit-details-marker { display: none; }
.route-card summary:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: var(--radius); }
.rc-date { font-size: 0.78rem; color: var(--g500); font-weight: 600; }
.rc-names { font-weight: 700; color: var(--g900); font-size: 0.92rem; }
.rc-prog { display: inline-flex; align-items: center; gap: 4px; font-size: 0.78rem; color: var(--g700); }
.rc-prog.done { color: var(--blue); font-weight: 700; }
.rc-bar { height: 6px; border-radius: 999px; background: var(--g200); overflow: hidden; margin-top: 4px; }
.rc-bar span { display: block; height: 100%; background: var(--blue); }
.rc-timeline { padding: 0 12px 12px; margin: 0; }
/* 마우스·키보드 사용자: 삭제 버튼을 카드 옆에 항상 접근 가능하게 (밀지 않아도 포커스로 열 수 있음) */
.route-item:focus-within:not(.dragging) .route-del:focus-visible ~ .route-card { transform: translateX(-96px); }

/* ---- (6) 튜토리얼 코치마크 ---- */
/* .tour는 fixed. 그 안 요소도 fixed이며, 위치는 left/top으로만 옮긴다(transform 없음). */
.tour { position: fixed; inset: 0; z-index: 120; }
.tour-spot {
  position: fixed; border-radius: 14px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.62), 0 0 0 3px rgba(255,255,255,0.9);
  transition: left 0.25s ease, top 0.25s ease, width 0.25s ease, height 0.25s ease;
}
.tour-pop {
  position: fixed; padding: 16px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-lg);
  border: 1px solid var(--g200); transition: left 0.25s ease, top 0.25s ease;
}
.tour-top { display: flex; justify-content: space-between; align-items: center; }
.tour-step { font-size: 0.76rem; font-weight: 700; color: var(--blue); background: var(--blue-weak); padding: 3px 10px; border-radius: 999px; }
.tour-skip { min-height: 40px; padding: 0 8px; border: 0; background: none; color: var(--g500); font: inherit; font-size: 0.82rem; cursor: pointer; }
.tour-pop h3 { margin: 8px 0 4px; font-size: 1.05rem; color: var(--g900); }
.tour-pop p { margin: 0; font-size: 0.9rem; color: var(--g700); }
.tour-actions { display: flex; gap: 8px; margin-top: 14px; }
.tour-actions .btn-line { margin-top: 0; flex: 1; }
.tour-actions .btn-primary { flex: 1.4; }
.tour-actions .btn-line:disabled { opacity: 0.4; }

@media (min-width: 620px) {
  .nearby-controls { display: grid; grid-template-columns: auto 1fr; align-items: center; }
  .nearby-controls .chips, .nearby-controls .nb-radius { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .car-track, .route-card, .tour-spot, .tour-pop { transition: none !important; }
  .nb-card, .route-item { animation: none !important; opacity: 1 !important; }
  .heart-btn.pop .icon { animation: none; }
}
