/* 앱 화면 미리보기 템플릿 — 틀 (디자인이 아니다)
   - PC에서는 화면 가운데에 폰 틀(393 × 852)을 그리고, 폰(폭 500 이하)에서는 틀 없이 화면을 꽉 채운다.
   - 여기 있는 색·높이·여백·글꼴·둥글기는 전부 자리표시다. 각자 디자인 값으로 바꿔 쓴다.
   - 버튼·목록 같은 부품 모양은 여기 없다. 예시 화면용은 example.css 에 따로 있고, 지워도 틀은 그대로 돈다. */

:root {
  --g-0: #ffffff;
  --g-50: #f4f4f4;
  --g-100: #e9e9e9;
  --g-200: #d4d4d4;
  --g-300: #bdbdbd;
  --g-500: #8a8a8a;
  --g-600: #666666;
  --g-700: #4a4a4a;
  --g-900: #1b1b1b;

  /* 아래 수치도 자리표시: 프로젝트 기준으로 바꾼다 */
  --side: 20px;       /* 화면 좌우 여백 */
  --tab-h: 64px;      /* 하단 탭 높이 */
  --head-h: 56px;     /* 머리줄 높이 */
  --status-h: 47px;   /* PC 틀 안의 가짜 상태 표시줄 */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; /* 폰 기본 글꼴. 프로젝트 글꼴로 바꾼다 */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body.app {
  font-family: var(--font); color: var(--g-900); background: #dcdcdc;
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 0;
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--g-900); outline-offset: 2px; border-radius: 8px; }
.ic { width: 24px; height: 24px; display: inline-block; flex: none; }
.ic--20 { width: 20px; height: 20px; }
.ic--16 { width: 16px; height: 16px; }
.ic svg { width: 100%; height: 100%; display: block; }
.num { font-variant-numeric: tabular-nums; }

/* ── 1. 폰 틀 (PC에서만 보임) ─────────────── */
.device {
  width: 393px; height: 852px; background: var(--g-0); border-radius: 48px; overflow: hidden;
  position: relative; box-shadow: 0 24px 60px rgba(0,0,0,.18), 0 0 0 10px #111;
  display: flex; flex-direction: column;
}
.status-bar { height: var(--status-h); flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 32px 0 40px; font-weight: 600; font-size: 16px; background: var(--g-0); position: relative; z-index: 30; }
.status-bar__island { position: absolute; left: 50%; top: 11px; width: 120px; height: 34px; margin-left: -60px; background: #111; border-radius: 20px; }
.status-bar__icons { display: flex; gap: 6px; align-items: center; }
.status-bar__icons i { display: block; width: 25px; height: 12px; border: 1.5px solid var(--g-900); border-radius: 4px; box-shadow: inset 0 0 0 1.5px var(--g-0), inset 19px 0 0 var(--g-900); }
.status-bar__icons i:first-child { width: 0; height: 0; border: 0; border-bottom: 11px solid var(--g-900); border-left: 16px solid transparent; border-radius: 0; box-shadow: none; }

/* 화면 지도의 작은 그림용(?bare): 틀·그림자 없이 화면만 */
body.app.is-bare { padding: 0; background: transparent; display: block; min-height: 0; }
body.app.is-bare .device { border-radius: 0; box-shadow: none; }

/* ── 2. 폰에서 열면: 틀을 벗기고 화면을 꽉 채운다 ──
   env(safe-area-inset-*)는 폰의 노치·홈 막대 자리. 내용이 그 밑으로 들어가지 않게 그만큼 띄운다. */
@media (max-width: 500px) {
  html:has(body.app:not(.is-bare)) { height: 100%; overflow: hidden; }
  body.app:not(.is-bare) { position: fixed; inset: 0; padding: 0; display: block; background: var(--g-0); min-height: 0; }
  body.app:not(.is-bare) .device { width: 100%; height: 100%; border-radius: 0; box-shadow: none; padding-top: env(safe-area-inset-top, 0px); }
  body.app:not(.is-bare) .status-bar { display: none; }
}

/* ── 3. 화면 · 머리줄 · 하단 탭 ───────────── */
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scrollbar-width: none; }
.screen::-webkit-scrollbar { display: none; }
.screen__pad { padding: 16px var(--side) 32px; }

.head { height: var(--head-h); flex: none; display: flex; align-items: center; gap: 4px; padding: 0 12px 0 var(--side); background: var(--g-0); position: relative; z-index: 20; }
.head--back { padding-left: 4px; }
.head__logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; }
.head__logo b { display: block; width: 28px; height: 28px; border-radius: 8px; background: var(--g-200); }
.head__title { font-size: 18px; font-weight: 700; }
.head__space { flex: 1; }
.head__btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; }
.head__btn:active { background: var(--g-50); }

.tabbar { height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid var(--g-100); background: var(--g-0); position: relative; z-index: 25; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--g-500); }
.tabbar a[aria-current="page"] { color: var(--g-900); }
.tabbar a[aria-current="page"] .ic svg * { stroke-width: 2; }

/* 탭이 없는 화면의 아래 고정 버튼 자리 */
.foot { flex: none; padding: 12px var(--side) calc(16px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--g-100); background: var(--g-0); }

/* ── 4. 아래에서 올라오는 시트 · 알림 띠 (움직임은 app.js, 모양은 자리표시) ── */
.scrim { position: absolute; inset: 0; background: rgba(0,0,0,.32); z-index: 39; opacity: 0; pointer-events: none; transition: opacity .3s var(--ease-out); }
.scrim.is-on { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 40; max-height: 86%; background: var(--g-0); border-radius: 24px 24px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.12); transform: translateY(105%); transition: transform .38s var(--ease-out); display: flex; flex-direction: column; }
.sheet.is-on { transform: none; }
.sheet__grab { display: block; width: 100%; height: 28px; flex: none; position: relative; touch-action: none; cursor: grab; }
.sheet__grab::after { content: ""; position: absolute; left: 50%; top: 10px; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--g-300); }
.sheet__body { overflow-y: auto; padding: 4px var(--side) 16px; scrollbar-width: none; }
.sheet__body::-webkit-scrollbar { display: none; }
.sheet__title { font-size: 22px; font-weight: 800; }
.sheet__foot { flex: none; padding: 12px var(--side) calc(16px + env(safe-area-inset-bottom, 0px)); }

.toast { position: absolute; left: 16px; right: 16px; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 16px); z-index: 50; background: var(--g-900); color: var(--g-0); border-radius: 14px; padding: 14px 16px; font-size: 15px; font-weight: 600; line-height: 1.45; transform: translateY(12px); opacity: 0; transition: transform .3s var(--ease-out), opacity .3s var(--ease-out); pointer-events: none; }
.toast.is-on { transform: none; opacity: 1; }

/* ── 5. 빈 곳을 꾹 누르면 차오르는 고리 (화면 지도로 돌아가기) ── */
.hold { position: fixed; z-index: 999; width: 136px; height: 136px; margin: -68px 0 0 -68px; pointer-events: none; opacity: 0; animation: hold-in .12s var(--wait) linear forwards; }
.hold svg { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 2px 8px rgba(0,0,0,.25)); }
.hold circle { fill: none; stroke-width: 10; }
.hold__bg { stroke: rgba(255,255,255,.9); }
.hold__bar { stroke: var(--g-900); stroke-linecap: round; stroke-dasharray: 377; stroke-dashoffset: 377; animation: hold-fill var(--hold) var(--wait) linear forwards; }
.hold__t { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 8px; white-space: nowrap; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--g-900); color: var(--g-0); font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; }
@keyframes hold-in { to { opacity: 1; } }
@keyframes hold-fill { to { stroke-dashoffset: 0; } }

.is-dragging, .is-dragging * { cursor: grabbing !important; }
@media (prefers-reduced-motion: reduce) {
  *:not(.hold):not(.hold__bar), *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
