/* 공덕 런 — 서울 지하철 표지판에서 가져온 색: 아스팔트 남색, 출구 노랑, 길 안내 청록 */
:root {
  --ink: #1c2730;
  --ink-2: #33424e;
  --paper: #fffdf6;
  --exit: #ffd23c;
  --exit-deep: #f0b400;
  --route: #12b8a6;
  --stop: #e9503f;
  --line: rgba(28, 39, 48, 0.14);
  --display: 'Jua', 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Segoe UI', Roboto, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfe3f0; color: var(--ink); font: 16px/1.4 var(--body); overscroll-behavior: none; touch-action: none; -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--route); outline-offset: 2px; }
[hidden] { display: none !important; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

/* 맨 위: 지하철 표지판 같은 띠(당일 Trip-Pups 과제 자리) */
#top { position: fixed; left: 0; right: 0; top: 0; padding: calc(8px + var(--safe-t)) 10px 0; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; z-index: 5; }
#mission { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; border-radius: 10px; padding: 7px 10px 7px 7px; font-size: 13.5px; line-height: 1.25; pointer-events: auto; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
#mission .brand { flex: none; padding: 3px 7px; border-radius: 6px; background: var(--exit); color: var(--ink); font: 400 14px/1.3 var(--display); white-space: nowrap; }
#missionText { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.top-actions { display: flex; gap: 6px; pointer-events: auto; margin-left: auto; flex: none; }
.chip-btn { height: 40px; min-width: 40px; padding: 0 12px; border-radius: 10px; background: var(--paper); font-weight: 600; font-size: 14px; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.chip-btn.icon { padding: 0; display: grid; place-items: center; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* 지도 위 이름표 */
#tags { position: fixed; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; max-width: 190px; padding: 4px 9px 4px 5px; border-radius: 8px; background: rgba(28, 39, 48, 0.92); color: #fff; font-size: 12.5px; font-weight: 600; line-height: 1.2; white-space: nowrap; pointer-events: auto; will-change: transform; transform-origin: 50% 100%; }
.tag span { overflow: hidden; text-overflow: ellipsis; }
.tag i { flex: none; width: 20px; height: 20px; border-radius: 5px; background: var(--exit); color: var(--ink); display: grid; place-items: center; font-style: normal; }
.tag i svg { width: 14px; height: 14px; stroke-width: 2.4; }
.tag small { font-weight: 500; opacity: 0.75; font-size: 11px; }
.tag::after { content: ''; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; margin-left: -5px; background: inherit; transform: rotate(45deg); border-radius: 2px; z-index: -1; }
.tag.near { background: var(--exit); color: var(--ink); font-size: 14px; padding: 6px 11px 6px 6px; }
.tag.near i { background: var(--ink); color: var(--exit); }
.tag.dest { background: var(--route); }
.tag.dest i { background: #fff; color: var(--route); }
.tag.c-toilet i { background: #9fd8ff; } .tag.c-subway i { background: #b8f0c9; } .tag.c-sight i, .tag.c-park i { background: #c9f0a8; } .tag.c-cafe i { background: #f6cfa5; }

/* 캐릭터가 하는 말 */
#say { position: fixed; left: 50%; top: 0; z-index: 3; max-width: min(300px, 78vw); padding: 10px 14px; border-radius: 16px; background: var(--paper); font-size: 15px; line-height: 1.35; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.16); transform: translate(-50%, -200px); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
#say.on { opacity: 1; }
#say::after { content: ''; position: absolute; left: 50%; bottom: -7px; width: 16px; height: 16px; margin-left: -8px; background: inherit; transform: rotate(45deg); border-radius: 3px; }
#say.think::before { content: ''; display: inline-block; width: 26px; height: 8px; margin-right: 8px; vertical-align: middle; background: radial-gradient(circle, var(--ink) 3px, transparent 3.5px) 0 0 / 9px 8px; animation: dots 0.9s steps(3) infinite; }
@keyframes dots { from { clip-path: inset(0 66% 0 0); } to { clip-path: inset(0 -34% 0 0); } }

/* 숨은 가게 찾기 */
.hunt { position: fixed; left: 10px; top: calc(62px + var(--safe-t)); z-index: 4; height: 36px; padding: 0 12px; border-radius: 18px; background: var(--paper); border: 2px solid var(--ink); font-weight: 700; font-size: 13.5px; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.hunt.done { background: var(--exit); }
#huntPanel { position: fixed; left: 10px; right: 10px; top: calc(104px + var(--safe-t)); z-index: 7; max-width: 420px; background: var(--paper); border: 2px solid var(--ink); border-radius: 16px; padding: 14px; box-shadow: 0 6px 20px rgba(28, 39, 48, 0.25); }
#huntPanel h3 { margin: 0; font: 20px var(--display); }
#huntPanel p { margin: 4px 0 10px; font-size: 13.5px; color: var(--ink-2); }
#huntPanel button.row { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 6px; border-radius: 10px; background: #eef0ec; font-size: 15px; font-weight: 600; text-align: left; }
#huntPanel button.row i { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--ink-2); font-style: normal; display: grid; place-items: center; font-size: 14px; }
#huntPanel button.row.found i { border: 0; background: var(--route); color: #fff; }
#huntPanel button.row small { margin-left: auto; font-weight: 500; color: #5d6972; }
#npcSay .more { background: none; color: #fff; text-decoration: underline; padding: 0; height: 30px; font-weight: 600; }

/* 거리의 동물이 하는 말 */
#npcSay { position: fixed; left: 0; top: 0; z-index: 3; width: max-content; max-width: min(270px, 74vw); padding: 9px 12px 10px; border-radius: 14px; background: var(--ink); color: #fff; font-size: 14px; line-height: 1.35; display: grid; gap: 6px; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2); will-change: transform; }
#npcSay b { font: 400 13px var(--display); color: var(--exit); }
#npcSay button { justify-self: start; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--exit); color: var(--ink); font-weight: 700; font-size: 13.5px; }
#npcSay::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 14px; height: 14px; margin-left: -7px; background: inherit; transform: rotate(45deg); border-radius: 3px; }
#pickTrait { margin: -4px 0 12px !important; min-height: 20px; font-size: 14px !important; font-weight: 600; color: var(--ink) !important; }
.also { margin: 10px 0 0; }
.also p { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.also button { display: block; width: 100%; text-align: left; padding: 9px 12px; margin-top: 6px; border-radius: 10px; background: #eef0ec; font-size: 14.5px; font-weight: 600; }
.also button small { font-weight: 500; color: #5d6972; }

/* 뛰어가는 중: 멈춤·바로 도착 */
#runbar { position: fixed; left: 10px; right: 10px; top: calc(62px + var(--safe-t)); z-index: 5; display: flex; align-items: center; gap: 8px; }
#runinfo { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; background: var(--route); color: #fff; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill { height: 40px; padding: 0 14px; border-radius: 20px; background: var(--paper); font-weight: 700; font-size: 14px; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.pill.stop { background: var(--stop); color: #fff; }

/* 오른쪽: 길잡이 바꾸기, 확대·축소 */
#side { position: fixed; right: 10px; top: 50%; transform: translateY(-58%); z-index: 4; display: grid; gap: 6px; }
.side-btn { width: 44px; height: 42px; border-radius: 12px; background: var(--paper); display: grid; place-items: center; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.side-btn:active { transform: translateY(2px); box-shadow: none; }
.side-btn.char { border: 2px solid var(--ink); margin-bottom: 6px; }
.side-btn.loc { height: 56px; color: #1f6fe0; margin-bottom: 6px; gap: 0; align-content: center; }
.side-btn.loc span { font-size: 10px; font-weight: 700; color: var(--ink); line-height: 1; margin-top: -2px; }
.side-btn.char img { width: 34px; height: 34px; object-fit: contain; }

#hint { position: fixed; left: 0; right: 0; bottom: calc(132px + var(--safe-b)); z-index: 2; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--ink); text-shadow: 0 0 6px #fff, 0 0 6px #fff, 0 0 2px #fff; pointer-events: none; transition: opacity 0.4s; }
#hint.off { opacity: 0; }

/* 말풍선 입력 — 이 화면의 주인공 */
#ask { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding: 0 10px calc(10px + var(--safe-b)); pointer-events: none; }
#chips { display: flex; gap: 6px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; pointer-events: auto; touch-action: pan-x; }
#chips::-webkit-scrollbar { display: none; }
#chips button { flex: none; height: 36px; padding: 0 13px; border-radius: 18px; background: var(--paper); font-size: 14px; font-weight: 600; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.16); }
#chips button.mission { box-shadow: inset 0 0 0 2px var(--exit-deep), 0 2px 0 rgba(0, 0, 0, 0.16); }
#chips button.on { background: var(--exit); }
.bubble { position: relative; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 28px; background: var(--paper); border: 3px solid var(--ink); pointer-events: auto; }
.bubble::before { content: ''; position: absolute; left: 50%; top: -11px; width: 18px; height: 18px; margin-left: -9px; background: var(--paper); border: 3px solid var(--ink); border-right: 0; border-bottom: 0; transform: rotate(45deg); border-radius: 3px 0 0 0; }
#q { flex: 1; min-width: 0; height: 44px; border: 0; background: none; font: 17px var(--body); color: var(--ink); padding: 0 8px; outline: none; -webkit-user-select: text; user-select: text; }
#q::placeholder { color: #6b7780; }
.round { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #eef0ec; }
.round.live { background: var(--stop); color: #fff; animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.send { flex: none; height: 44px; padding: 0 18px; border-radius: 22px; background: var(--exit); font: 18px var(--display); }
.send:active, .cta:active, .pill:active, #chips button:active { transform: translateY(2px); box-shadow: none; }

/* 끌면 나타나는 조이스틱 */
#stick { position: fixed; left: 0; top: 0; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.9); background: rgba(28, 39, 48, 0.16); z-index: 4; pointer-events: none; opacity: 0; transition: opacity 0.12s; }
#stick.on { opacity: 1; }
#stick i { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: var(--exit); border: 3px solid var(--ink); }

/* 장소 카드 */
#card { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; max-height: 78vh; overflow-y: auto; background: var(--paper); border-radius: 20px 20px 0 0; padding: 14px 16px calc(16px + var(--safe-b)); box-shadow: 0 -6px 24px rgba(28, 39, 48, 0.22); touch-action: pan-y; overscroll-behavior: contain; animation: rise 0.22s ease-out; -webkit-user-select: text; user-select: text; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.card-head { display: flex; gap: 10px; align-items: flex-start; }
.card-head h2 { flex: 1; margin: 0; font: 24px/1.15 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.card-head h2.long { font-size: 19px; }
.card-ko { margin: 2px 0 0; font-size: 15px; color: var(--ink-2); font-weight: 600; }
.x { flex: none; width: 40px; height: 40px; border-radius: 50%; background: #eef0ec; display: grid; place-items: center; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.fact { padding: 5px 10px; border-radius: 8px; background: #eef0ec; font-size: 13.5px; font-weight: 600; }
.fact.walk { background: var(--route); color: #fff; }
.fact.open { background: #d8f3d2; } .fact.closed { background: #fde0dc; }
.card-photo { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; margin: 4px 0 2px; background: #e7e9e4; display: block; }
.credit { font-size: 11.5px; color: #5d6972; margin: 2px 0 8px; }
.desc { margin: 8px 0; font-size: 15.5px; line-height: 1.5; max-width: 62ch; }
.rows { margin: 10px 0; border-top: 1px solid var(--line); }
.row { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.row b { flex: none; width: 76px; color: var(--ink-2); font-weight: 600; }
.row span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .muted { color: #6b7780; }
.actions { display: grid; gap: 8px; margin-top: 12px; }
.cta { height: 52px; border-radius: 14px; background: var(--exit); font: 19px var(--display); box-shadow: 0 3px 0 var(--exit-deep); width: 100%; }
.cta[disabled] { background: #e3e5df; box-shadow: none; color: #7b858c; }
.cta.dark { background: var(--ink); color: #fff; box-shadow: 0 3px 0 #000; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ghost { height: 44px; border-radius: 12px; border: 2px solid var(--ink); font-weight: 700; font-size: 14px; display: grid; place-items: center; text-decoration: none; color: var(--ink); }
.src { margin: 12px 0 0; font-size: 12px; color: #5d6972; line-height: 1.45; }
.src a { color: inherit; }

/* 직원·기사님께 보여 주는 큰 한국어 화면 */
#show { position: fixed; inset: 0; z-index: 20; background: var(--exit); display: flex; flex-direction: column; padding: calc(14px + var(--safe-t)) 18px calc(18px + var(--safe-b)); }
#show .show-top { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; }
#show { overflow-y: auto; touch-action: pan-y; gap: 12px; }
#show .big { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 8px 0; }
#show .by { font-size: 12px !important; font-weight: 600 !important; color: var(--ink-2) !important; text-align: center; margin-top: -4px !important; }
#show .say-more button[aria-pressed='true'] { background: var(--ink); color: #fff; }
#show .staff { background: #fff8dc; border-radius: 14px; padding: 10px; }
#show .staff > p { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
#show .staff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#show .staff-grid button { min-height: 52px; border-radius: 10px; background: #fff; border: 2px solid var(--ink); font-weight: 800; font-size: 17px; word-break: keep-all; padding: 6px; }
#show .heard { margin: 8px 0 0 !important; font-size: 19px; font-weight: 800; min-height: 26px; display: grid; gap: 8px; }
#show .heard:empty { display: none; }
#show .big p { margin: 0; font-family: var(--body); font-weight: 800; color: #111; line-height: 1.22; word-break: keep-all; font-size: clamp(30px, 9vw, 60px); }
#show .big .addr { font-size: clamp(22px, 6.4vw, 38px); font-weight: 700; }
#show .big .en { font-size: 15px; font-weight: 600; color: var(--ink-2); }

#show .say-more { display: grid; gap: 6px; }
#show .say-more .ghost { height: auto; min-height: 44px; padding: 8px 12px; background: rgba(255, 255, 255, 0.55); text-align: center; line-height: 1.25; }
#show .cta svg { vertical-align: -4px; margin-right: 6px; }

/* 이 지도에 대해 */
#about { position: fixed; inset: 0; z-index: 30; background: var(--paper); overflow-y: auto; padding: calc(14px + var(--safe-t)) 18px calc(24px + var(--safe-b)); touch-action: pan-y; -webkit-user-select: text; user-select: text; }
#about h2 { font: 26px var(--display); margin: 0 0 4px; }
#about h3 { font-size: 15px; margin: 18px 0 4px; }
#about p, #about li { font-size: 14px; line-height: 1.5; max-width: 66ch; }
#about ul { padding-left: 18px; margin: 4px 0; }
#about .menu { display: grid; gap: 8px; margin: 14px 0; }

/* 첫 화면: 길잡이 고르기 */
#pick { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; background: linear-gradient(to top, rgba(28, 39, 48, 0.5), rgba(28, 39, 48, 0) 55%); }
.pick-sheet { width: 100%; background: var(--paper); border-radius: 22px 22px 0 0; padding: 18px 16px calc(16px + var(--safe-b)); }
.pick-sheet h1 { margin: 0; font: 30px/1.1 var(--display); }
.pick-sheet p { margin: 4px 0 12px; font-size: 15px; color: var(--ink-2); }
#pickList { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
#pickList button { border-radius: 14px; background: #eef0ec; padding: 6px 2px 8px; border: 3px solid transparent; display: grid; justify-items: center; gap: 2px; font-weight: 700; font-size: 13.5px; }
#pickList button img { width: 100%; max-width: 74px; aspect-ratio: 1; object-fit: contain; }
#pickList button[aria-checked='true'] { background: #fff3c2; border-color: var(--ink); }
#loadNote { margin: 8px 0 0; font-size: 12.5px; text-align: center; min-height: 18px; }

@media (min-width: 720px) {
  #chips { flex-wrap: wrap; justify-content: center; overflow: visible; }
  #ask { left: 50%; right: auto; width: 520px; transform: translateX(-50%); }
  #card, .pick-sheet { max-width: 520px; margin: 0 auto; left: 0; right: 0; }
  #pick { justify-content: center; }
  #runbar { left: 50%; right: auto; width: 520px; transform: translateX(-50%); }
  #show .big { max-width: 900px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* 체험 / 내 위치 고르기 */
#modeRow { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin: 0 0 6px; border-radius: 14px; background: #e6e9e4; }
#modeRow button { padding: 10px 6px; border-radius: 10px; font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
#modeRow button[aria-checked="true"] { background: var(--paper); color: var(--ink); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.16); }
#modeRow #modeMe[aria-checked="true"] { background: #1f6fe0; color: #fff; }
#modeNote { margin: 0 0 12px !important; font-size: 13px !important; min-height: 18px; }
.side-btn.loc.on { background: #1f6fe0; color: #fff; }
.side-btn.loc.on span { color: #fff; }

/* 고른 이유 · 한국어로 대신 말하기 단추 */
.why { margin: 2px 0 10px; padding: 9px 12px; border-radius: 12px; background: #fff6cf; font-size: 14.5px; line-height: 1.4; }
.why b { margin-right: 6px; font-size: 12.5px; color: var(--ink-2); }
.cta.tall { height: 64px; display: flex; align-items: center; justify-content: center; gap: 12px; text-align: left; }
.cta.tall span { display: grid; line-height: 1.15; }
.cta.tall small { font: 600 12.5px/1.2 system-ui, sans-serif; opacity: 0.78; margin-top: 3px; }
.cta.pulse { animation: nudge 1.1s ease-in-out 3; }
@keyframes nudge { 0%, 100% { transform: none; box-shadow: 0 3px 0 #000; } 50% { transform: scale(1.03); box-shadow: 0 3px 0 #000, 0 0 0 6px rgba(255, 210, 60, 0.75); } }
@media (prefers-reduced-motion: reduce) { .cta.pulse { animation: none; box-shadow: 0 3px 0 #000, 0 0 0 4px rgba(255, 210, 60, 0.9); } }

/* 카드: 처음엔 낮게, 손잡이로 펼치기 */
.grab { display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; margin: -6px 0 4px; padding: 2px 0 4px; color: var(--ink-2); font-size: 12px; font-weight: 700; }
.grab i { width: 44px; height: 5px; border-radius: 3px; background: #c9cdc6; }
#card.peek { overflow: hidden; }
#card.peek .card-photo, #card.peek .credit, #card.peek .desc, #card.peek .rows, #card.peek .two, #card.peek .also, #card.peek .src, #card.peek .card-ko { display: none; }
#card.peek .facts { margin: 6px 0 8px; }
/* 첫 화면 로딩 */
#splash { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 14px; background: #bfe3f2 linear-gradient(#bfe3f2, #eaf5ee 70%, #d9e6cf); transition: opacity 0.45s ease; }
#splash.off { opacity: 0; pointer-events: none; }
#splash b { font: 34px/1 var(--display); color: var(--ink); background: var(--exit); padding: 8px 14px; border-radius: 12px; box-shadow: 0 4px 0 var(--exit-deep); }
#splash p { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink-2); }
#splash .hop { width: 46px; height: 40px; border-radius: 9px; background: #e8873a; position: relative; animation: hop 0.62s cubic-bezier(0.3, 0, 0.7, 1) infinite alternate; box-shadow: inset 0 -8px 0 rgba(0, 0, 0, 0.12); }
#splash .hop::before, #splash .hop::after { content: ''; position: absolute; top: -9px; width: 12px; height: 12px; border-radius: 3px; background: #e8873a; }
#splash .hop::before { left: 4px; } #splash .hop::after { right: 4px; }
#splash .shade { width: 46px; height: 8px; border-radius: 50%; background: rgba(28, 39, 48, 0.18); margin-top: -8px; animation: shade 0.62s cubic-bezier(0.3, 0, 0.7, 1) infinite alternate; }
@keyframes hop { from { transform: translateY(0) scaleY(0.94); } to { transform: translateY(-26px) scaleY(1.04); } }
@keyframes shade { from { transform: scaleX(1); opacity: 1; } to { transform: scaleX(0.6); opacity: 0.5; } }
@media (prefers-reduced-motion: reduce) { #splash .hop, #splash .shade { animation: none; } }


/* 설명 듣기(길잡이 목소리) */
.listen { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; margin: 0 0 10px; border-radius: 18px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; }
.listen:active { transform: translateY(1px); }
#card.peek .listen { display: none; }

/* 언어 고르기 */
#langBtn, .pick-lang { display: inline-flex; align-items: center; gap: 6px; }
.pick-sheet { position: relative; }
.pick-lang { position: absolute; top: 16px; right: 16px; height: 38px; padding: 0 12px; border-radius: 19px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; font-size: 14px; }
.pick-sheet h1 { padding-right: 128px; }
#langMenu { position: fixed; inset: 0; z-index: 60; background: rgba(20, 28, 36, 0.45); display: grid; place-items: center; padding: 20px; }
#langMenu[hidden] { display: none; }
.lang-sheet { width: min(340px, 100%); background: var(--paper); border-radius: 20px; padding: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3); }
#langList { display: grid; gap: 6px; }
#langList button { display: grid; grid-template-columns: 1fr auto 28px; align-items: center; gap: 10px; height: 56px; padding: 0 8px 0 16px; border-radius: 14px; background: #fff; color: var(--ink); text-align: left; }
#langList button b { font-size: 18px; font-weight: 700; }
#langList button span { font-size: 13px; color: var(--ink-2); }
#langList button i { font-style: normal; font-weight: 800; font-size: 18px; text-align: center; }
#langList button[aria-checked="true"] { background: var(--exit); }

/* 작은 전체 지도: 오른쪽 위, 언어 단추 아래. 누르면 크게 */
#mini { --m: 96px; position: fixed; right: 10px; top: calc(56px + var(--safe-t)); z-index: 4; width: var(--m); height: var(--m); padding: 0; border-radius: 16px; border: 2px solid var(--ink); background: #f3efe4; overflow: hidden; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18); transition: width 0.18s ease, height 0.18s ease; }
#mini.big { --m: min(250px, calc(100vw - 20px)); z-index: 8; }
#mini canvas { display: block; width: 100%; height: 100%; }
/* 휴대폰: 달리는 중에는 위쪽 띠가 한 줄을 다 쓰므로 지도는 그 아래로 내려간다 */
#runbar:not([hidden]) ~ #mini { top: calc(108px + var(--safe-t)); }
@media (min-width: 720px) {
  #runbar:not([hidden]) ~ #mini { top: calc(60px + var(--safe-t)); }
  #mini { --m: 148px; top: calc(60px + var(--safe-t)); right: 12px; }
  #mini.big { --m: 340px; }
  #runbar { right: 172px; }
}
@media (max-height: 620px) { #mini { --m: 78px; } }

/* 언어 단추 글자: 좁은 화면은 짧게, 넓은 화면은 이름 전부 */
#langBtn { white-space: nowrap; line-height: 1; }
#langBtn .full { display: none; }
#missionText { transition: opacity 0.2s ease; min-height: 1.25em; }
#missionText.swap { opacity: 0; }
@media (min-width: 720px) {
  #langBtn .short { display: none; }
  #langBtn .full { display: inline; }
  #mission { max-width: min(560px, 60vw); }
  #missionText { -webkit-line-clamp: 1; }
}
.peek-addr { display: none; margin: 2px 0 8px; font-size: 13.5px; color: var(--ink-2); }
#card.peek .peek-addr { display: block; }
.plainfont { font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif !important; font-weight: 800 !important; letter-spacing: -0.01em; }

/* 카드: 이름 앞 업종 아이콘 */
.cat-ic { flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--exit); color: var(--ink); display: grid; place-items: center; margin-top: -2px; }
.cat-ic svg { width: 24px; height: 24px; stroke-width: 2.2; }
.cat-ic.cat-cafe, .cat-ic.cat-bakery { background: #f6d9b8; }
.cat-ic.cat-park, .cat-ic.cat-sight { background: #cfe9c4; }
.cat-ic.cat-subway, .cat-ic.cat-toilet, .cat-ic.cat-store, .cat-ic.cat-pharmacy, .cat-ic.cat-atm, .cat-ic.cat-hospital { background: #cfe3f5; }
/* 설명 듣기 · 보여 주기 */
.talk { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.talk .listen { margin: 0; }
.listen.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.listen.pulse { animation: pulse 1.2s ease-in-out 3; box-shadow: 0 0 0 4px rgba(255, 210, 60, 0.9); }
#card.peek .talk { display: flex; }
#card.peek .talk #cardListen { display: none; }
#card.peek .listen.dark { display: inline-flex; }
/* 주소 옆 복사 */
.copy-btn { flex: none; align-self: center; margin-left: auto; height: 32px; padding: 0 12px; border-radius: 16px; border: 1.5px solid var(--ink); background: #fff; color: var(--ink); font-weight: 700; font-size: 13px; }

/* 큰 한국어 화면 다듬기: 문장은 흰 팻말 카드에, 다른 문장은 알약 단추로, 넓은 화면에서는 가운데 720px */
#show > * { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; flex-shrink: 0; }
#show .show-top span { padding: 6px 12px; border-radius: 16px; background: rgba(28, 39, 48, 0.1); }
#show .big { flex: 0 0 auto; margin-top: auto; margin-bottom: auto; background: var(--paper); border: 3px solid var(--ink); border-radius: 26px; padding: clamp(18px, 4.5vw, 34px); box-shadow: 0 7px 0 rgba(0, 0, 0, 0.22); gap: 14px; }
#show .big p#showKo { font-size: clamp(30px, 8vw, 54px); letter-spacing: -0.01em; }
#show .big .en { padding-top: 12px; border-top: 2px dashed rgba(28, 39, 48, 0.18); }
#show #showPlay { align-self: flex-start; width: auto; height: 54px; padding: 0 26px; border-radius: 27px; }
#show .by { text-align: left; margin-top: -6px !important; }
#show .say-more { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
#show .say-more .ghost { width: auto; flex: 0 1 auto; min-height: 42px; padding: 8px 16px; border-radius: 22px; border: 2px solid var(--ink); background: rgba(255, 255, 255, 0.72); font-size: 14.5px; }
#show .staff { background: var(--paper); border: 2px solid var(--ink); border-radius: 18px; padding: 12px; }
#show .staff-grid button { border-radius: 14px; }

/* 맨 위 띠: 칸은 그대로, 글자가 오른쪽에서 들어와 왼쪽으로 흘러간다 */
#mission { flex: 1 1 auto; }
#missionText { display: block; overflow: hidden; white-space: nowrap; -webkit-line-clamp: unset; min-width: 0; flex: 1; mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
#missionText .run { display: inline-block; padding-left: 100%; animation: tick 30s linear infinite; will-change: transform; }
@keyframes tick { to { transform: translateX(-100%); } }
@media (min-width: 720px) { #mission { flex: 0 0 440px; max-width: 440px; } }
@media (prefers-reduced-motion: reduce) { #missionText .run { padding-left: 0; } #missionText { white-space: normal; } }

/* 띠: 넓은 화면에서는 언어 단추 앞까지 다 쓰고, 글자는 왼쪽에서 오른쪽으로 흐른다 */
#missionText .run { animation-direction: reverse; }
@media (min-width: 720px) { #mission { flex: 1 1 auto; max-width: none; } }

html.place-view, .place-view body { height: auto; min-height: 100%; overflow: auto; touch-action: auto; background: var(--paper); user-select: text; }
.place-view main { max-width: 40rem; margin: auto; padding: max(20px, var(--safe-t)) 20px max(32px, var(--safe-b)); }
.place-view h1 { font-family: var(--display); margin-bottom: 12px; }
.place-view label { display: block; margin: 28px 0 6px; font-weight: bold; }
.place-view select { max-width: 100%; min-height: 44px; padding: 8px; color: var(--ink); background: white; font: inherit; border-radius: 6px; }
.place-view #place-choice { width: 100%; }
.place-view article { margin-top: 24px; border-top: 2px solid var(--ink); overflow-wrap: anywhere; }
