/* 앱 화면 미리보기 템플릿 — 틀 (디자인이 아니다)
   - 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;

  /* 에버랜드 디자인 시스템 (components.html · A안 퍼플 + 라임) */
  --n-0: #FFFFFF; --n-50: #F6F6F8; --n-100: #EEEEF2; --n-200: #E2E2E8; --n-300: #C9C9D1;
  --n-500: #8A8A96; --n-600: #6B6B76; --n-900: #17161C;
  --p-50: #F3EFFD; --p-100: #E7DEFB; --p-200: #CEBDF7; --p-300: #AB8EF1; --p-400: #885FEC;
  --p-500: #6632E6; --p-600: #5429BD; --p-700: #422195; --p-800: #31186E; --p-900: #1F0F45;
  --accent: #C8F03C; --on-accent: #1F0F45;
  --r-badge: 8px; --r-input: 12px; --r-card: 16px; --r-sheet: 24px; --r-full: 999px; --margin: 20px;

  /* 틀 수치 */
  --side: 20px;       /* 화면 좌우 여백 */
  --tab-h: 66px;      /* 하단 탭 높이 */
  --head-h: 56px;     /* 머리줄 높이 */
  --status-h: 47px;   /* PC 틀 안의 가짜 상태 표시줄 */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font: "Pretendard", -apple-system, "Apple SD Gothic Neo", sans-serif; /* 화면 파일에서 Pretendard 연결 */
}

* { 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(--n-900); background: #E9E9EE;
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 0;
  -webkit-font-smoothing: antialiased; letter-spacing: 0;
  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; font-weight: 800; font-size: 20px; letter-spacing: -0.3px; color: var(--p-800); }
.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: 0 4px env(safe-area-inset-bottom, 0px); flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--n-0); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: 0 -1px 0 var(--n-200), 0 -6px 20px rgba(31,15,69,.06); position: relative; z-index: 25; }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--n-500); }
.tabbar a .ic { width: 26px; height: 26px; --ibg: var(--n-0); }
.tabbar a[aria-current="page"] { color: var(--p-700); font-weight: 700; }
.tabbar a[aria-current="page"] .ic { --duo: var(--accent); }
.tabbar a.is-mid { color: var(--n-900); font-weight: 700; justify-content: flex-end; padding-bottom: 9px; }
.tabbar__mid { width: 58px; height: 58px; margin-top: -32px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; border: 4px solid var(--n-0); box-shadow: 0 4px 12px rgba(31,15,69,.12); }
.tabbar__mid .ic { width: 28px; height: 28px; }

/* 탭이 없는 화면의 아래 고정 버튼 자리 */
.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; }
}
