/* catchGo ShareWeb — layout เปลือกนอก + CTA เท่านั้น
   engine สมุด (3D page-flip, ปก, หน้ากระดาษ, scrubber ฯลฯ) ย้ายไป lib/stamp-book.css แล้ว
   ไฟล์นี้เหลือแค่: base body · #app host · loading/error · footer CTA · responsive shell */

:root {
  --sea: #0F7C7C;
  --sea-deep: #0A5E5E;
  --coral: #EC6044;
  --amber: #F4A23C;
  --ink: #1E3A38;
  --muted: #7E948F;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  font-family: 'Mali', system-ui, 'Noto Sans Thai', sans-serif;
  color: var(--ink);
}
body {
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  /* พื้นหลังฉากตอนกำลังโหลด (ก่อน lib จะทาสีของตัวเอง) */
  background: radial-gradient(130% 90% at 50% 0%, #0F7C7C 0%, #0A5249 55%, #08403B 100%);
}

/* ============================================================
   #app = host ของ StampBook (lib จะ position:absolute เต็ม host)
   ต้อง position:relative + เต็มจอ
   ============================================================ */
#app {
  position: fixed;
  inset: 0;
  /* host ให้ lib mount — ตัว lib จัด layout ภายในเอง */
}

/* ---------- Loading / Error (ก่อน lib mount) ---------- */
.center-msg {
  position: absolute; inset: 0; margin: auto; height: max-content;
  color: #fff; text-align: center; padding: 32px;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.center-msg .spinner {
  width: 44px; height: 44px; margin: 0 auto 18px;
  border: 4px solid rgba(255,255,255,.25); border-top-color: #fff;
  border-radius: 50%; animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-msg h2 { font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: 22px; margin-bottom: 8px; }
.center-msg p { opacity: .85; font-size: 14px; line-height: 1.6; }

/* ============================================================
   Footer CTA — overlay ล่างจอ (นอก host สมุด)
   z สูงกว่า lib (lib z-index:1) เพื่อไม่โดนทับ
   ============================================================ */
.cta {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  width: 100%; text-align: center;
  padding: 10px 16px calc(10px + var(--safe-bottom));
  background: rgba(0,0,0,.28); backdrop-filter: blur(6px);
  border-top: 1px solid rgba(255,255,255,.12);
  pointer-events: auto;
}
.cta .line { color: #fff; font-size: 13px; margin-bottom: 8px; font-weight: 500; }
.cta .stores { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cta a.store {
  display: inline-flex; align-items: center; gap: 7px; text-decoration: none;
  font-family: 'Mali', sans-serif; font-weight: 600; font-size: 13px; color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--amber));
  padding: 8px 15px; border-radius: 999px; box-shadow: 0 4px 12px rgba(0,0,0,.28);
}
.cta a.store.ghost { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); }
.cta a.store:active { transform: scale(.96); }

/* เว้นที่ล่างสุดของสมุดให้พ้น CTA (lib hint อยู่ล่าง → ดัน scrubber ขึ้นเล็กน้อย) */
.stampbook { padding-bottom: 74px; }

@media (min-width: 560px) {
  /* desktop/จอกว้าง: จำกัดเป็นคอลัมน์กว้างเท่ามือถือ + centre จริง
     (right:auto + width ทับ inset:0 เดิม ไม่งั้นหนังสือชิดซ้ายเหลือที่ว่างขวา) */
  #app { left: 50%; right: auto; width: 440px; max-width: 92vw; transform: translateX(-50%); box-shadow: 0 0 90px -30px rgba(0,0,0,.45); }
  .cta { left: 50%; right: auto; width: 440px; max-width: 92vw; transform: translateX(-50%); }
}
