:root {
  --primary: #FF6B00;
  --primary-hover: #E55A00;
  --ink: #111827;
  --body: #374151;
  --muted: #6b7280;
  --line: #e5e7eb;
  --sky: linear-gradient(#9cc1e4, #dce9f5 62%);
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background: #fff; line-height: 1.6; word-break: keep-all; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

html.is-desk .ar-only,
html.is-phone .station-only { display: none !important; }

/* 공통 */
.topbar { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px 20px; }
.topbar .home img { display: block; height: 28px; width: auto; }
.langs { font-size: 14px; color: var(--muted); }
.langs a { padding: 4px; text-decoration: none; }
.langs a[aria-current] { color: var(--ink); font-weight: 700; }

.badge { display: inline-flex; align-items: center; align-self: flex-start; padding: 4px 12px; border-radius: 999px; background: #FFF1E6; color: var(--primary); font-size: 13px; font-weight: 600; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 24px; border: 0; border-radius: 999px; font-weight: 700; text-decoration: none; transition: background-color .15s, border-color .15s; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { opacity: .7; cursor: default; }
.btn-line { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn-line:hover { border-color: #d1d5db; }

.fine { margin-top: 16px; color: var(--muted); font-size: 13px; }
.fine.credit { margin-top: 6px; font-size: 11px; }

/* 거리 미리 보기 */
.stage-frame,
.start-preview { position: relative; overflow: hidden; background: var(--sky); cursor: pointer; }
.stage-frame > canvas,
.start-preview > canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* PC: 미리 보기와 안내 */
.station { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: start; max-width: 1180px; margin: 0 auto; padding: 24px 20px 80px; }
.stage { position: sticky; top: 24px; }
.stage-frame { aspect-ratio: 4 / 3; border-radius: 24px; box-shadow: 0 20px 50px rgba(17, 24, 39, .12); }
.stage-caption { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; color: var(--muted); font-size: 14px; }
.stage-langs { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-langs button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; }
.stage-langs button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

.info h1 { margin: 14px 0 16px; font-size: clamp(30px, 3.2vw, 42px); font-weight: 800; line-height: 1.25; letter-spacing: -.02em; text-wrap: balance; }
.info .lead { color: var(--body); font-size: 18px; text-wrap: pretty; }
.steps { display: grid; gap: 14px; margin: 28px 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; color: var(--body); font-size: 16px; }
.steps li::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #FFF1E6; color: var(--primary); font-size: 15px; font-weight: 700; }
.qr { display: flex; align-items: center; gap: 20px; padding: 20px; border: 1px solid var(--line); border-radius: 20px; }
.qr img { flex: none; width: 132px; height: 132px; }
.qr p { color: var(--muted); font-size: 14px; }
.qr strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 16px; }
.cta { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.cta > p { margin-bottom: 14px; font-weight: 700; }
.cta .row { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 900px) {
  .station { grid-template-columns: 1fr; gap: 32px; }
  .stage { position: static; }
}

/* 휴대폰: 시작 화면 */
.start { position: relative; z-index: 15; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; padding: 0 20px calc(20px + env(safe-area-inset-bottom)); background: #fff; }
.start > * { width: 100%; max-width: 520px; margin-left: auto; margin-right: auto; }
.start .topbar { padding: 16px 0; }
.start-body { display: flex; flex: 1; flex-direction: column; justify-content: center; gap: 16px; padding: 8px 0 24px; }
.start h1 { font-size: 32px; font-weight: 800; line-height: 1.25; letter-spacing: -.02em; }
.start .lead { color: var(--body); font-size: 17px; text-wrap: pretty; }
.start-preview { aspect-ratio: 16 / 9; border-radius: 20px; }
.place-card { display: flex; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; }
.place-card svg { flex: none; width: 26px; height: 26px; color: var(--primary); }
.place-card strong { display: block; font-size: 16px; }
.place-card p { margin-top: 2px; color: var(--muted); font-size: 14px; }
.place-card a { display: inline-block; margin-top: 6px; color: var(--primary); font-size: 14px; font-weight: 600; text-decoration: none; }
.start > .btn { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1; width: 100%; padding: 16px; font-size: 17px; box-shadow: 0 8px 24px rgba(255, 107, 0, .3); }
.start > .fine { text-align: center; }
html.is-running .start { display: none; }

/* AR 화면 */
#ar { position: fixed; inset: 0; z-index: 10; display: none; overflow: hidden; background: #000; }
#ar video,
#ar canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
#ar video { object-fit: cover; }
html.is-booting #ar,
html.is-running #ar { display: block; }

.ar-ui { position: fixed; inset: 0; z-index: 20; display: none; color: #fff; pointer-events: none; }
html.is-running .ar-ui { display: block; }
.ar-top { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; }
.chip { padding: 7px 13px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: rgba(17, 24, 39, .55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: #fff; font-size: 13px; font-weight: 600; pointer-events: auto; }
.chip-sample { border-color: transparent; background: rgba(255, 107, 0, .92); pointer-events: none; }
.status { position: absolute; top: calc(60px + env(safe-area-inset-top)); left: 50%; width: max-content; max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 14px; background: rgba(17, 24, 39, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: 13px; font-weight: 600; line-height: 1.45; text-align: center; transform: translateX(-50%); transition: opacity .4s; }
.status.is-off { opacity: 0; }
.pointer { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 6px; transform: translate(-50%, -50%); }
.pointer .arrow { position: relative; width: 48px; height: 48px; border-radius: 50%; background: var(--primary); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.pointer .arrow::after { content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px; border-top: 3px solid #fff; border-right: 3px solid #fff; transform: translate(-70%, -50%) rotate(45deg); }
.pointer span:last-child { padding: 4px 10px; border-radius: 999px; background: rgba(17, 24, 39, .6); font-size: 12px; font-weight: 700; white-space: nowrap; }
.hint { position: absolute; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); font-size: 15px; font-weight: 600; white-space: nowrap; text-shadow: 0 1px 8px rgba(0, 0, 0, .7); opacity: 0; transition: opacity .4s; }
.hint.is-on { opacity: 1; }
.ad-langs { position: absolute; left: 0; right: 0; bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0 12px; opacity: 0; transition: opacity .4s; }
.ad-langs:not(.is-on) .chip { pointer-events: none; }
.ad-langs.is-on { opacity: 1; }
.ad-langs .chip[aria-pressed="true"] { background: #fff; color: var(--ink); }

/* ?occluders=show에서만 나오는 상태 줄 */
.ar-debug { position: absolute; left: 12px; right: 12px; bottom: calc(116px + env(safe-area-inset-bottom)); max-width: 420px; margin: 0 auto; padding: 6px 10px; border-radius: 10px; background: rgba(17, 24, 39, .6); font-size: 11px; line-height: 1.45; text-align: center; }

/* 위치 접근이 막혔을 때. Chrome의 <geolocation> 버튼은 투명도·필터·변형이 걸린 곳이나 다른 요소에 가려진 곳에서는 눌리지 않습니다. */
.loc-help { position: absolute; bottom: calc(118px + env(safe-area-inset-bottom)); left: 12px; right: 12px; max-width: 420px; margin: 0 auto; padding: 16px; border-radius: 18px; background: rgba(17, 24, 39, .92); font-size: 14px; line-height: 1.55; pointer-events: auto; }
.loc-help strong { display: block; font-size: 15px; }
.loc-help p,
.loc-help ol { margin-top: 6px; color: #d1d5db; }
.loc-help ol { padding-left: 20px; }
.loc-help li + li { margin-top: 4px; }
.loc-help [data-ios-app] { white-space: nowrap; }
.loc-help .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.loc-help .btn { padding: 10px 18px; font-size: 14px; }
.btn-ghost { background: rgba(255, 255, 255, .14); color: #fff; }
.loc-help geolocation { padding: 10px 18px; border: 0; border-radius: 999px; background-color: #fff; color: #111827; font-size: 15px; font-weight: 700; }

/* 광고판을 누르면 열리는 가게 안내 */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .35); }
.sheet { width: 100%; max-width: 480px; padding: 24px 22px calc(20px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: #fff; color: var(--ink); animation: sheet-up .35s cubic-bezier(.2, .9, .3, 1); }
.sheet h2 { margin: 10px 0 2px; font-size: 24px; font-weight: 800; }
.sheet .meta { color: var(--muted); font-size: 14px; }
.sheet .offer { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #FFF7F0; font-size: 15px; }
.sheet .about { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); color: #4b5563; font-size: 14px; }
.sheet .row { display: flex; gap: 10px; margin-top: 18px; }
.sheet .row .btn { flex: 1; padding: 14px 12px; font-size: 15px; }
.sheet:lang(zh) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; word-break: normal; }
.sheet:lang(ja) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif; word-break: normal; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; }
  .sheet { padding-bottom: 22px; border-radius: 24px; }
}

.err { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 32px; background: #111827; color: #e5e7eb; font-size: 15px; line-height: 1.8; text-align: center; }
.err small { display: block; margin-top: 12px; color: #9ca3af; font-size: 12px; }
