/* 사와바라 전시관 (meta.sawabara.com) — 3D 골목 위의 화면 조각 + 목록 보기. 색은 로고 B1-01 (남색 상자 + 노란 테이프) */
:root {
  --navy: #14294F; --navy-2: #243B55; --tape: #E9B63E; --ink: #1B2434; --ink-2: #5B6777; --line: #DCE3EB; --paper: #fff; --soft: #EEF2F7; --blue: #1D5FD1; --green: #12A150;
  --font: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--ink); background: #DCEAF9; overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.ui { position: fixed; z-index: 5; }
.card { background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(20, 41, 79, .16); }
[hidden] { display: none !important; }

/* 위 막대: 이름 · 찾기 · 도구 */
.bar { left: calc(14px + var(--sl)); right: calc(14px + var(--sr)); top: calc(12px + var(--st)); display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.bar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 14px; text-decoration: none; flex: none; }
.brand img { height: 34px; }
.brand b { display: block; font-size: 18px; font-weight: 800; }
.brand small { display: block; font-size: 12.5px; color: var(--ink-2); }
.find { position: relative; flex: 1; max-width: 620px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 7px 9px; }
.tabs { display: flex; gap: 3px; flex: none; }
.tabs button { border: 0; background: var(--soft); border-radius: 7px; padding: 6px 9px; font-size: 13px; font-weight: 700; }
.tabs button.on { background: var(--navy); color: #fff; }
#q { flex: 1; min-width: 0; border: 2px solid var(--blue); border-radius: 9px; padding: 8px 11px; font: inherit; font-size: 15px; outline: none; background: #fff; }
.hits { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(20, 41, 79, .18); max-height: 50vh; overflow: auto; padding: 6px; }
.hits button { display: flex; width: 100%; text-align: left; border: 0; background: none; border-radius: 9px; padding: 9px 10px; gap: 8px; align-items: baseline; }
.hits button:hover, .hits button:focus-visible { background: var(--soft); outline: none; }
.hits b { font-size: 15px; }
.hits small { color: var(--ink-2); font-size: 12.5px; }
.hits .none { padding: 10px; color: var(--ink-2); font-size: 14px; }
.tools { display: flex; gap: 6px; flex: none; }
.tools .card { display: block; border: 1px solid var(--line); padding: 9px 12px; font-size: 14px; font-weight: 700; text-decoration: none; }

/* 왼쪽 분류 */
.cats { left: calc(14px + var(--sl)); top: calc(88px + var(--st)); display: grid; gap: 3px; padding: 8px; width: 190px; max-height: calc(100% - 200px); overflow: auto; }
.cats button { border: 0; background: none; text-align: left; border-radius: 8px; padding: 7px 9px; font-size: 14px; font-weight: 600; }
.cats button.on { background: var(--navy); color: #fff; }

/* 오른쪽 업체 카드 */
.booth { right: calc(14px + var(--sr)); top: calc(88px + var(--st)); width: 360px; padding: 16px 18px; }
.booth h2 { margin: 0 30px 4px 0; font-size: 22px; }
.booth p { margin: 3px 0; font-size: 14.5px; color: #475467; line-height: 1.5; }
.booth .open { font-weight: 700; }
.trial { display: inline-block; vertical-align: middle; background: var(--tape); color: var(--navy); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 800; }
.booth .open.on { color: #0B7A3B; } .booth .open.off { color: #B42318; }
.booth .x { position: absolute; right: 10px; top: 10px; border: 0; background: var(--soft); border-radius: 50%; width: 30px; height: 30px; }
.go { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.go a, .go span { display: block; text-align: center; padding: 10px 6px; border-radius: 9px; font-size: 14.5px; font-weight: 700; text-decoration: none; background: var(--soft); }
.go .p { background: var(--blue); color: #fff; } .go .g { background: var(--green); color: #fff; }
.go .off { background: #F2F4F7; color: #A0A8B4; border: 1px dashed #C9D0DA; line-height: 1.15; }
.go .off small { display: block; font-size: 11px; font-weight: 600; }
.booth .phone { margin-top: 8px; font-size: 15px; color: var(--ink); }
.booth .phone button { margin-left: 6px; border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 3px 8px; font-size: 12.5px; }

/* 아래: 안내 · 상태 · 이름표 · 조이스틱 */
.hint { left: 50%; bottom: calc(18px + var(--sb)); transform: translateX(-50%); padding: 9px 16px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.state { left: 50%; bottom: calc(66px + var(--sb)); transform: translateX(-50%); background: var(--tape); color: var(--navy); font-weight: 800; border-radius: 999px; padding: 5px 14px; font-size: 13.5px; }
.me { left: 0; top: 0; transform: translate(-50%, -100%); background: #fff; border-radius: 999px; padding: 2px 11px; font-weight: 800; font-size: 13px; box-shadow: 0 4px 10px rgba(20, 41, 79, .18); pointer-events: none; }
/* 조이스틱: 화면 위에 투명하게 떠 있음 (골목이 비쳐 보이게) — 업체 카드는 늘 이 위에 뜬다 */
.stick { z-index: 6; left: calc(50% - 44px); bottom: calc(18px + var(--sb)); width: 88px; height: 88px; border-radius: 50%; background: rgba(255, 255, 255, .10); border: 2px solid rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px rgba(20, 41, 79, .12); touch-action: none; -webkit-user-select: none; user-select: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; background: rgba(255, 255, 255, .55); border: 1px solid rgba(255, 255, 255, .8); box-shadow: 0 3px 10px rgba(20, 41, 79, .18); pointer-events: none; }
.empty { left: 50%; top: 42%; transform: translate(-50%, -50%); padding: 20px 24px; text-align: center; display: grid; gap: 6px; width: min(380px, calc(100% - 32px)); }
.empty b { font-size: 18px; } .empty span { color: var(--ink-2); font-size: 14px; } .empty a { color: var(--blue); font-weight: 700; text-decoration: none; }
.noscript { padding: 24px; background: #fff; position: relative; z-index: 9; }

/* 휴대폰: 찾기를 둘째 줄로, 분류는 가로 띠, 업체 카드는 아래에서 */
@media (max-width: 860px) {
  .bar { flex-wrap: wrap; }
  .brand { padding: 6px 10px; } .brand img { height: 28px; } .brand b { font-size: 15px; } .brand small { display: none; }
  .tools { margin-left: auto; } .tools .card { padding: 8px 10px; font-size: 13px; }
  .tools a:nth-child(2), .tools a:nth-child(3) { display: none; }
  .find { order: 3; flex-basis: 100%; max-width: none; flex-wrap: wrap; }
  .tabs { width: 100%; } .tabs button { flex: 1; }
  /* 휴대폰 아래부터: 분류 띠(맨 아래) → 조이스틱 → 업체 카드 */
  .cats { left: 0; right: 0; top: auto; bottom: 0; width: auto; display: flex; overflow-x: auto; border-radius: 0; border-width: 1px 0 0; box-shadow: none; padding: 6px calc(10px + var(--sr)) calc(6px + var(--sb)) calc(10px + var(--sl)); max-height: none; background: rgba(255, 255, 255, .92); }
  .stick { bottom: calc(60px + var(--sb)); }
  .cats button { white-space: nowrap; flex: none; }
  /* 업체 카드 = 조이스틱 바로 위 (겹치지 않게), 위 막대와도 안 겹치게 높이 제한 */
  .booth { left: calc(8px + var(--sl)); right: calc(8px + var(--sr)); top: auto; bottom: calc(160px + var(--sb)); width: auto; max-height: calc(100% - 312px - var(--st) - var(--sb)); overflow: auto; padding: 12px 14px; }
  .booth h2 { font-size: 18px; } .booth p { font-size: 13.5px; line-height: 1.45; }
  .booth .go { grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 8px; } .booth .go a, .booth .go span { padding: 8px 2px; font-size: 12.5px; }
  .booth .go .off small { font-size: 10px; }
  .booth .cat, .booth .intro { display: none; }   /* 휴대폰은 카드를 낮게 — 캐릭터가 카드 위로 보이게 (소개는 업체 페이지·목록에서) */
  .hint { display: none; }
  .state { bottom: auto; top: calc(200px + var(--st)); }
  .booth { z-index: 7; }   /* 「나」 이름표보다 위 */
}
@media (pointer: coarse) { .hint { display: none; } }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* 목록 보기 (/list) */
body.listpage { overflow: auto; background: #F4F6F9; }
.lhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px max(16px, var(--sr)) 12px max(16px, var(--sl)); background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.lhead .brand { padding: 0; }
.lhead .back { background: var(--navy); color: #fff; border-radius: 9px; padding: 8px 12px; font-weight: 700; font-size: 14px; text-decoration: none; }
.lmain { max-width: 880px; margin: 0 auto; padding: 16px max(16px, var(--sr)) 24px max(16px, var(--sl)); display: grid; gap: 12px; }
.lcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.lcard h2 { margin: 0 0 4px; font-size: 20px; }
.lcard p { margin: 3px 0; color: #475467; font-size: 14.5px; line-height: 1.55; }
.lcard .go { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.lempty { color: var(--ink-2); text-align: center; padding: 40px 0; }
.lfoot { text-align: center; color: var(--ink-2); font-size: 13px; padding: 10px 16px 30px; }
