@font-face {
  font-family: 'Jua';
  src: url('fonts/Jua-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg: #e4f1dd;
  --ink: #1f1f1f;
  --muted: #4d4d47;
  --card: #ffffff;
  --on: #ffe98a;
  --on-side: #e2b93b;
  --on-hot: #ffd84a;
  --sel: #ff9f43;
  --sel-side: #d9741a;
  --off: #f4f4ee;
  --off-side: #cfcfc6;
  --off-line: #8c8c84;
  --accent: #d96b00;
  --title: 'Jua', -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }

#app { max-width: 480px; margin: 0 auto; padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 14px; }
.view { display: flex; flex-direction: column; gap: 12px; }

/* 머리 */
.head { display: flex; flex-direction: column; gap: 12px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title { font-family: var(--title); font-weight: 400; font-size: 36px; line-height: 1.1; }
.hash { color: var(--accent); }
.modes { display: flex; border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; background: var(--card); }
.mode { min-width: 48px; min-height: 44px; border: 0; background: transparent; color: var(--ink); font-family: var(--title); font-size: 16px; cursor: pointer; }
.mode + .mode { border-left: 2.5px solid var(--ink); }
.mode.current { background: var(--sel); }
.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tab { min-height: 44px; display: flex; align-items: center; justify-content: center; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--card); font-family: var(--title); font-size: 17px; text-decoration: none; }
.tab.current { background: var(--on); box-shadow: 3px 3px 0 var(--ink); }

/* 공통 조각 */
.card { background: var(--card); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.chip { min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--card); font-family: var(--title); font-size: 16px; text-decoration: none; }
.chip.current { background: var(--sel); }
.legend { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.swatch { width: 14px; height: 14px; border-radius: 3px; }
.swatch.off { background: var(--off); border: 2px dashed var(--off-line); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.link-card { min-height: 44px; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; font-family: var(--title); font-size: 17px; text-decoration: none; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); }
.crumbs a { min-height: 44px; display: inline-flex; align-items: center; }
.crumbs strong { color: var(--ink); }
.group { display: flex; flex-direction: column; gap: 8px; }
.group-title { display: flex; align-items: center; gap: 6px; font-family: var(--title); font-weight: 400; font-size: 20px; }
.group-title a { text-decoration: none; }
.count { font-family: inherit; font-size: 14px; color: var(--muted); }
.pin path { fill: #ff8a4c; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.pin circle { fill: #ffffff; stroke: var(--ink); stroke-width: 1.5; }
.empty { padding: 20px 12px; text-align: center; color: var(--muted); }
.tag { background: var(--card); border: 2.5px solid var(--ink); border-radius: 10px; padding: 3px 12px; font-family: var(--title); font-size: 16px; }

/* 맛집 카드 */
.place { padding: 10px 10px 10px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.place-body { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.place-name { font-family: var(--title); font-weight: 400; font-size: 18px; overflow-wrap: anywhere; }
.place-meta, .place-line { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.place-pick { margin-top: 3px; display: flex; align-items: center; gap: 7px; font-size: 15px; }
.pick-tag { flex: none; font-family: var(--title); font-size: 13px; background: var(--sel); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 9px; }
.pick-menu { min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.btn-map { flex: none; min-width: 58px; min-height: 44px; display: flex; align-items: center; justify-content: center; border: 2.5px solid var(--ink); border-radius: 10px; background: var(--sel); font-family: var(--title); font-size: 16px; text-decoration: none; }

/* 전체보기의 나라 두 칸 */
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.duo-card { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px; text-decoration: none; }

/* 지도 */
.map-wrap { padding: 0 2px; }
.map { display: block; width: 100%; height: auto; overflow: visible; }
.map.zoomed { overflow: hidden; border: 2.5px solid var(--ink); border-radius: 14px; background: #d3e6cb; }
.map .top, .map .w, .map .lbl { transition: transform 0.18s ease-out; }
.blk { --h: 0; }
.m3d .blk.off { --h: 3; }
.m3d .blk.on { --h: 11; }
.m3d .blk.sel { --h: 20; }
.m3d .blk.on.up, .m3d a.blk:active { --h: 18; }
.m3d .top { transform: translateY(calc(var(--h) * var(--u) * -1px)); }
.m3d .w { transform: translateY(calc(var(--h) * var(--k) * var(--u) * -1px)); }
.w0 { --k: 0; }
.w1 { --k: 0.2; }
.w2 { --k: 0.4; }
.w3 { --k: 0.6; }
.w4 { --k: 0.8; }

.blk.off .top { fill: var(--off); stroke: var(--off-line); stroke-width: 1.2; stroke-dasharray: 4 3; stroke-linejoin: round; }
.blk.off .w { fill: var(--off-side); stroke: var(--off-side); stroke-width: 1; }
.blk.on .top { fill: var(--on); stroke: var(--ink); stroke-width: 2.2; stroke-linejoin: round; }
.blk.on .w { fill: var(--on-side); stroke: var(--on-side); stroke-width: 1; stroke-linejoin: round; }
.blk.on .w0 { stroke: var(--ink); stroke-width: 2.2; }
.blk.sel .top { fill: var(--sel); stroke: var(--ink); stroke-width: 2.6; stroke-linejoin: round; }
.blk.sel .w { fill: var(--sel-side); stroke: var(--sel-side); stroke-width: 1; stroke-linejoin: round; }
.blk.sel .w0 { stroke: var(--ink); stroke-width: 2.6; }
a.blk { cursor: pointer; outline: none; }
a.blk.up .top { fill: var(--on-hot); }
a.blk:focus-visible .top { stroke: var(--accent); stroke-width: 3.5; }
.mini .blk.on .top, .mini .blk.on .w0 { stroke-width: 1.5; }
.mini .blk.off .top { stroke-width: 0.8; }

.lbl { pointer-events: none; --h: 0; }
.m3d .lbl { --h: 11; transform: translateY(calc(var(--h) * var(--u) * -1px)); }
.m3d .lbl.sel { --h: 20; }
.m3d .lbl.up { --h: 18; }
.lbl rect { fill: #ffffff; stroke: var(--ink); stroke-width: 2; }
.lbl.sel rect { fill: var(--sel); }
.lbl line { stroke: var(--ink); stroke-width: 1.5; }
.lbl circle { fill: #ff8a4c; stroke: var(--ink); stroke-width: 1.5; }
.lbl text { font-family: var(--title); fill: var(--ink); }

.foot { margin-top: 8px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }

a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .map .top, .map .w, .map .lbl { transition: none; }
}
