/* ============================================================
   2026 강남아트 갤러리 QR 스탬프 투어 - Design System
   Theme: Bauhaus Art Gallery
   ============================================================ */

:root {
  --navy: #0D2040;
  --navy-soft: #1a2f52;
  --cream: #F9F5F0;
  --cream-dark: #ece5da;
  --coral: #F6745F;
  --coral-dark: #e85d47;
  --turquoise: #1CB2D6;
  --gold: #FFC700;
  --purple: #7B61FF;
  --mint: #2EC4B6;
  --pink: #F7A3B9;
  --lime: #D2FF6E;
  --ink: #2C3540;
  --white: #ffffff;
  --gray: #8a93a3;
  --gray-light: #c4cad4;
  --shadow-sm: 0 2px 8px rgba(13, 32, 64, 0.08);
  --shadow-md: 0 6px 24px rgba(13, 32, 64, 0.12);
  --shadow-lg: 0 16px 48px rgba(13, 32, 64, 0.18);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-lg: 28px;
  --font-serif: 'Playfair Display', 'Noto Serif KR', serif;
  --font-sans: 'Pretendard', 'Inter', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: var(--font-sans);
  background: var(--navy);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body { overflow-x: hidden; }

/* ---------- App Shell (모바일 프레임) ---------- */
#app-root {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 80px rgba(0,0,0,0.4);
}

.screen { min-height: 100vh; display: none; flex-direction: column; animation: fadeUp .4s ease; }
.screen.active { display: flex; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Typography ---------- */
.serif { font-family: var(--font-serif); }
.display-xl { font-family: var(--font-serif); font-weight: 800; font-size: 42px; line-height: 1.05; letter-spacing: -0.01em; }
.display-lg { font-family: var(--font-serif); font-weight: 800; font-size: 32px; line-height: 1.1; }
.display-md { font-family: var(--font-serif); font-weight: 700; font-size: 24px; line-height: 1.2; }
.title { font-weight: 700; font-size: 18px; }
.body { font-size: 14px; line-height: 1.6; color: var(--gray); }
.caption { font-size: 12px; color: var(--gray); }

/* ---------- Top Bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; position: sticky; top: 0; z-index: 50;
  background: rgba(249,245,240,0.92); backdrop-filter: blur(12px);
}
.topbar.on-dark { background: rgba(13,32,64,0.6); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none;
  background: var(--white); color: var(--navy); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: var(--shadow-sm); transition: transform .15s;
}
.icon-btn:active { transform: scale(.9); }
.topbar-stats { display: flex; gap: 8px; }
.stat-pill {
  display: flex; align-items: center; gap: 5px; background: var(--white);
  border-radius: 30px; padding: 8px 14px; font-weight: 700; font-size: 13px;
  box-shadow: var(--shadow-sm); color: var(--navy);
}
.stat-pill i { font-size: 13px; }
.stat-pill .ico-heart { color: var(--coral); }
.stat-pill .ico-bag { color: var(--turquoise); }

/* ---------- Buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius); padding: 17px 24px; cursor: pointer;
  font-family: var(--font-sans); font-weight: 700; font-size: 16px;
  transition: transform .15s, box-shadow .2s; width: 100%;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--coral); color: var(--white); box-shadow: 0 8px 24px rgba(246,116,95,.35); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-outline { background: transparent; border: 2px solid var(--navy); color: var(--navy); }
.btn-ghost { background: var(--cream-dark); color: var(--navy); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 11px 18px; font-size: 14px; width: auto; }

/* ---------- Geometric Pattern Header ---------- */
.geo-header { position: relative; height: 280px; overflow: hidden; flex-shrink: 0; }
.geo-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4,1fr); grid-template-rows: repeat(4,1fr); }
.geo-cell { position: relative; overflow: hidden; }
.geo-circle { border-radius: 50%; }
.geo-half-t { border-radius: 100% 0 0 0; }
.geo-half-b { border-radius: 0 0 100% 0; }
.geo-quarter { border-radius: 0 100% 0 0; }
.geo-tri { width: 0; height: 0; }

/* ---------- Cards ---------- */
.content-card {
  background: var(--white); border-radius: var(--radius-lg);
  margin: -40px 16px 0; padding: 28px 24px; position: relative; z-index: 5;
  box-shadow: var(--shadow-md);
}
.list-card {
  display: flex; align-items: center; gap: 14px; border-radius: var(--radius);
  padding: 14px; margin-bottom: 12px; color: var(--white); cursor: pointer;
  transition: transform .15s, box-shadow .2s; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.list-card:active { transform: scale(.98); }
.list-card-icon {
  width: 52px; height: 52px; border-radius: 50%; background: var(--navy);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  color: var(--white); font-size: 20px;
}
.list-card-body { flex: 1; min-width: 0; }
.list-card-label { font-size: 11px; opacity: .85; font-weight: 500; }
.list-card-title { font-weight: 700; font-size: 16px; margin: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card-sub { font-size: 12px; opacity: .85; }
.list-card-action { flex-shrink: 0; font-size: 18px; opacity: .9; }
.list-card.collected::after {
  content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; top: 10px; right: 12px; width: 24px; height: 24px;
  background: var(--white); color: var(--mint); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}

/* ---------- Onboarding ---------- */
.onb-wrap { flex: 1; display: flex; flex-direction: column; padding: 0; }
.onb-hero { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding: 32px 28px; position: relative; }
.onb-content { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.dots { display: flex; gap: 8px; justify-content: center; margin: 16px 0; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-light); transition: all .3s; }
.dot.active { width: 24px; background: var(--coral); }

/* ---------- Form ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--navy); }
.field label .req { color: var(--coral); }
.field input, .field select, .field textarea {
  width: 100%; padding: 15px 16px; border: 2px solid var(--cream-dark);
  border-radius: var(--radius-sm); font-family: var(--font-sans); font-size: 15px;
  background: var(--white); color: var(--ink); transition: border-color .2s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--turquoise); }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 11px 16px; border-radius: 30px; border: 2px solid var(--cream-dark);
  background: var(--white); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s; color: var(--navy);
}
.chip.selected { background: var(--navy); color: var(--white); border-color: var(--navy); }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--gray); }
.checkbox-row input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--coral); }

/* ---------- Section ---------- */
.section { padding: 24px 16px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 0 4px; }
.section-head h2 { font-family: var(--font-serif); font-size: 22px; font-weight: 800; color: var(--navy); }
.section-link { font-size: 13px; color: var(--coral); font-weight: 600; cursor: pointer; }

/* ---------- Stamp Progress ---------- */
.progress-ring { display: flex; align-items: center; gap: 16px; }
.ring-wrap { position: relative; width: 84px; height: 84px; flex-shrink: 0; }
.ring-bg { fill: none; stroke: var(--cream-dark); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--coral); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label .num { font-family: var(--font-serif); font-size: 22px; font-weight: 800; color: var(--navy); line-height: 1; }
.ring-label .total { font-size: 11px; color: var(--gray); }

/* ---------- Stamp Grid ---------- */
.stamp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stamp-item {
  aspect-ratio: 1; border-radius: var(--radius); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px; cursor: pointer;
  background: var(--white); border: 2px dashed var(--gray-light); color: var(--gray-light);
  transition: transform .15s; position: relative; overflow: hidden; text-align: center; padding: 8px;
}
.stamp-item:active { transform: scale(.95); }
.stamp-item.done { border-style: solid; border-color: transparent; color: var(--white); }
.stamp-item .stamp-ic { font-size: 26px; }
.stamp-item .stamp-nm { font-size: 10px; font-weight: 600; line-height: 1.2; }
.stamp-item.done .stamp-seal {
  position: absolute; bottom: 6px; right: 6px; font-size: 10px;
  background: rgba(255,255,255,.3); border-radius: 20px; padding: 2px 7px; font-weight: 700;
}

/* ---------- Map ---------- */
.map-canvas {
  position: relative; height: 340px; background: var(--navy);
  border-radius: var(--radius-lg); overflow: hidden; margin: 0 16px;
}
.map-bg-grid { position: absolute; inset: 0; opacity: .12; background-image: linear-gradient(var(--cream) 1px, transparent 1px), linear-gradient(90deg, var(--cream) 1px, transparent 1px); background-size: 32px 32px; }
.map-pin {
  position: absolute; transform: translate(-50%, -100%); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; transition: transform .2s;
}
.map-pin:active { transform: translate(-50%, -100%) scale(.9); }
.map-pin-dot {
  width: 38px; height: 38px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-md);
  border: 3px solid var(--cream);
}
.map-pin-dot i { transform: rotate(45deg); color: var(--white); font-size: 15px; }
.map-pin.done .map-pin-dot { border-color: var(--gold); }
.map-pin-name { font-size: 10px; color: var(--cream); margin-top: 4px; font-weight: 600; white-space: nowrap; background: rgba(13,32,64,.7); padding: 2px 7px; border-radius: 20px; }
.map-overlay-note { position: absolute; bottom: 12px; left: 12px; right: 12px; font-size: 11px; color: rgba(249,245,240,.6); text-align: center; }

/* ---------- Bottom Nav ---------- */
.bottom-nav {
  position: sticky; bottom: 0; display: flex; justify-content: space-around;
  background: var(--white); padding: 10px 8px 14px; box-shadow: 0 -4px 24px rgba(13,32,64,.08);
  border-radius: 28px 28px 0 0; z-index: 40;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer; color: var(--gray); font-size: 10px;
  font-weight: 600; padding: 6px 12px; border-radius: 16px; transition: all .15s; flex: 1;
}
.nav-item i { font-size: 19px; }
.nav-item.active { color: var(--coral); }
.nav-item.qr-center { position: relative; }
.nav-item.qr-center .qr-fab {
  width: 56px; height: 56px; border-radius: 50%; background: var(--coral);
  color: var(--white); display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-top: -28px; box-shadow: 0 8px 20px rgba(246,116,95,.45); border: 4px solid var(--white);
}

/* ---------- Modal / Sheet ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(13,32,64,.55); backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center; z-index: 100; max-width: 480px; margin: 0 auto;
}
.overlay.show { display: flex; animation: fadeUp .25s; }
.sheet {
  background: var(--cream); width: 100%; border-radius: 28px 28px 0 0;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto;
  animation: slideUp .3s ease;
}
.sheet-modal { border-radius: 28px; margin: 0 16px 16px; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-handle { width: 40px; height: 4px; background: var(--gray-light); border-radius: 4px; margin: 0 auto 20px; }

/* ---------- QR Scanner ---------- */
#qr-reader { border-radius: var(--radius); overflow: hidden; }
#qr-reader video { border-radius: var(--radius); }
.scan-frame { position: relative; }
.scan-corners::before, .scan-corners::after { content: ''; position: absolute; width: 40px; height: 40px; border: 3px solid var(--coral); }

/* ---------- Stamp Success ---------- */
.success-burst {
  width: 130px; height: 130px; border-radius: 50%; margin: 0 auto 24px;
  display: flex; align-items: center; justify-content: center; font-size: 56px; color: var(--white);
  animation: pop .5s ease;
}

/* ---------- Reward Card ---------- */
.reward-card {
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  margin-bottom: 16px; box-shadow: var(--shadow-sm); position: relative;
}
.reward-top { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 44px; color: var(--white); position: relative; overflow: hidden; }
.reward-body { padding: 18px 20px; }
.reward-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.reward-stamps { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--navy); }
.reward-stamps i { color: var(--gold); }
.progress-bar { height: 7px; background: var(--cream-dark); border-radius: 10px; overflow: hidden; margin-top: 10px; }
.progress-bar > div { height: 100%; background: var(--coral); border-radius: 10px; transition: width .8s; }

/* ---------- Lang Toggle ---------- */
.lang-toggle { display: flex; background: var(--cream-dark); border-radius: 30px; padding: 3px; }
.lang-toggle button { border: none; background: none; padding: 7px 14px; border-radius: 30px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--gray); transition: all .15s; }
.lang-toggle button.active { background: var(--navy); color: var(--white); }

/* ---------- Misc ---------- */
.spinner { width: 38px; height: 38px; border: 4px solid var(--cream-dark); border-top-color: var(--coral); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
.empty { text-align: center; padding: 48px 24px; color: var(--gray); }
.empty i { font-size: 44px; color: var(--gray-light); margin-bottom: 12px; }
.badge { display: inline-block; padding: 4px 11px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-coral { background: rgba(246,116,95,.15); color: var(--coral-dark); }
.badge-turq { background: rgba(28,178,214,.15); color: var(--turquoise); }
.badge-gold { background: rgba(255,199,0,.2); color: #b58a00; }
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: var(--white); padding: 13px 22px; border-radius: 30px;
  font-size: 14px; font-weight: 600; z-index: 200; box-shadow: var(--shadow-lg);
  opacity: 0; transition: opacity .3s, transform .3s; pointer-events: none; max-width: 90%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.scroll-area { flex: 1; overflow-y: auto; padding-bottom: 20px; }
.divider { height: 1px; background: var(--cream-dark); margin: 20px 0; }
.code-box { font-family: monospace; font-size: 24px; font-weight: 800; letter-spacing: 2px; color: var(--navy); background: var(--cream-dark); border-radius: var(--radius-sm); padding: 18px; text-align: center; margin: 16px 0; }
