/* ==========================================================================
   KANYA CLIMBER BODY SCORECARD — styles
   Palette (ล็อก): Navy #2E3A4C · Gold #AB9075 · Pink #F06696
                   Soft Pink #F7DDE5 · Cream #F4F3ED
   พื้นครีม ตัวอักษรกรมท่า ชมพูใช้กับ interaction ทองใช้น้อย ๆ
   Mobile-first — ออกแบบสำหรับมือถือที่บูธในยิมปีนผา
   ========================================================================== */

:root {
  --navy: #2E3A4C;
  --navy-72: rgba(46, 58, 76, 0.72);
  --navy-52: rgba(46, 58, 76, 0.52);
  --navy-14: rgba(46, 58, 76, 0.14);
  --navy-08: rgba(46, 58, 76, 0.08);
  --pink: #F06696;
  --soft-pink: #F7DDE5;
  --cream: #F4F3ED;
  --gold: #AB9075;
  --surface: #FFFFFF;

  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 1px 2px rgba(46, 58, 76, 0.04), 0 10px 24px rgba(46, 58, 76, 0.06);

  /* Thai: Prompt (ตามสเปก). English: Gotham ไม่มีสิทธิ์ใช้ในสภาพแวดล้อมนี้
     จึงใช้ geometric sans ที่มีอยู่แล้วเป็น fallback โดยไม่ดาวน์โหลดหรือเลียนแบบฟอนต์ */
  --font: 'Prompt', 'Futura', 'Avenir Next', 'Century Gothic', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 20px calc(44px + env(safe-area-inset-bottom));
}

/* -------------------- decorative climbing holds (ประดับ) -----------------
   ชิดขอบจอ ถูกครอปบางส่วน อยู่หลังพื้นหลังทั้งหมด จึงไม่ทับการ์ดหรือปุ่ม
   ------------------------------------------------------------------------ */
.holds-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hold { position: absolute; opacity: .34; }
.hold-jug    { width: 86px;  left: -68px; top: 16%;  transform: rotate(-12deg); }
.hold-sloper { width: 96px;  right: -78px; top: 48%; transform: rotate(16deg); }
.hold-edge   { width: 80px;  left: -62px; bottom: 10%; transform: rotate(8deg); opacity: .12; }

/* จอกว้างพอ: ย้ายเกาะออกมาอยู่ในช่องว่างข้างคอลัมน์เนื้อหา เห็นเต็มตัวได้ */
@media (min-width: 700px) {
  .hold-jug    { left: calc(50% - 330px); }
  .hold-sloper { right: calc(50% - 336px); }
  .hold-edge   { left: calc(50% - 322px); }
}

/* ------------------------------- header ---------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(18px + env(safe-area-inset-top)) 0 14px;
  background: var(--cream);
}

.app-header::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 100%;
  height: 18px;
  background: linear-gradient(var(--cream), rgba(244, 243, 237, 0));
  pointer-events: none;
}

.progress { display: flex; align-items: center; gap: 12px; }

.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--soft-pink);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 12.5%;
  border-radius: 99px;
  background: var(--pink);
  transition: width 300ms cubic-bezier(.4, 0, .2, 1);
}

.progress-count {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--navy-52);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------- screens --------------------------------- */
.screen { animation: screen-in 340ms cubic-bezier(.2, .7, .3, 1) both; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------- brand assets (ล็อก) -------------------------
   ใช้ภาพต้นฉบับตามที่ได้รับ ปรับได้เฉพาะขนาดและตำแหน่ง
   ------------------------------------------------------------------------ */
.logo {
  display: block;
  width: 132px;
  height: auto;
  margin: calc(26px + env(safe-area-inset-top)) 0 22px;
}
.logo-result { margin-bottom: 8px; }

.mascot { display: block; height: auto; margin-inline: auto; }
.mascot-intro  { width: 86%; max-width: 324px; margin-block: 4px 20px; }
.mascot-result { width: 108px; margin-block: 0 18px; }

/* -------------------------------- intro ---------------------------------- */
.intro-title {
  margin: 0 0 4px;
  font-size: 30px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: .01em;
  text-wrap: balance;
}

.intro-copy {
  margin: 0 0 28px;
  padding-top: 18px;
  border-top: 2px solid var(--soft-pink);
}
.intro-copy p { margin: 0 0 6px; color: var(--navy-72); }
.intro-copy p:first-child { color: var(--navy); font-weight: 600; font-size: 17px; }
.intro-copy p:last-child { margin-bottom: 0; }

/* ------------------------------ questions -------------------------------- */
.q-head { padding: 12px 0 22px; }

.q-heading {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
}

.q-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.42;
  font-weight: 600;
  /* ไทยตัดบรรทัดได้เฉพาะตรงช่องว่าง การ balance จึงทำให้บรรทัดสั้นยาวไม่สม่ำเสมอ */
}

.options { display: flex; flex-direction: column; gap: 12px; }

.option {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  min-height: 60px;
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 110ms ease;
}
.option:active { transform: scale(.993); }

.option-input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.option-key {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--cream);
  color: var(--navy-52);
  font-size: 12px;
  font-weight: 600;
  transition: background 150ms ease, color 150ms ease;
}

.option-text { font-size: 15.5px; line-height: 1.52; color: var(--navy-72); }

.option.is-selected {
  border-color: var(--pink);
  background: var(--soft-pink);
}
.option.is-selected .option-key { background: var(--pink); color: #fff; }
.option.is-selected .option-text { color: var(--navy); }

.option-input:focus-visible + .option-key { outline: 2px solid var(--pink); outline-offset: 3px; }

.q-nav { display: flex; gap: 10px; padding: 26px 0 8px; }
.q-nav .btn-ghost { flex: 0 0 34%; }
.q-nav .btn-primary { flex: 1; }

/* ------------------------------- buttons --------------------------------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 14px 20px;
  border: 0;
  border-radius: 99px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .04em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 110ms ease, background 150ms ease, color 150ms ease;
}
.btn:active { transform: scale(.985); }
.btn:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:disabled {
  background: var(--soft-pink);
  color: var(--navy-52);
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: transparent;
  color: var(--navy-72);
  border: 2px solid var(--navy-14);
}
.btn-ghost:hover { border-color: var(--pink); color: var(--pink); }

/* -------------------------------- result --------------------------------- */
.result-section { padding: 34px 0; border-top: 1px solid var(--navy-14); }
.result-section:first-of-type { border-top: 0; padding-top: 0; padding-bottom: 40px; }

.section-heading {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold);
}

/* Dominant Style = ลำดับสายตาที่เด่นที่สุดบนหน้าผลลัพธ์ */
.style-name {
  margin: 0 0 8px;
  font-size: 34px;
  line-height: 1.14;
  font-weight: 700;
  letter-spacing: -.01em;
  text-wrap: balance;
}

.style-hook {
  margin: 0 0 22px;
  font-size: 17px;
  font-weight: 600;
  color: var(--pink);
}

.body-text { margin: 0 0 12px; color: var(--navy-72); }
.body-text:last-child { margin-bottom: 0; }

/* Q8 mode line — ต่อท้ายย่อหน้าตัวตน ไม่ใช่หัวข้อใหญ่แยก */
.mode-line {
  margin: 20px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--soft-pink);
  font-size: 15px;
  font-weight: 500;
  color: var(--navy);
}

.card {
  padding: 20px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.card-title { margin: 0 0 2px; font-size: 21px; font-weight: 700; letter-spacing: .02em; }
.card-subtitle {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .03em;
  color: var(--gold);
}

/* Body Scorecard — หนึ่งสถานะต่อหนึ่ง domain */
.scorecard { display: flex; flex-direction: column; gap: 2px; }

.scorecard-row {
  padding: 15px 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}
.scorecard-row:first-child { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.scorecard-row:last-child  { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.scorecard-label {
  margin: 0 0 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy-52);
}

.scorecard-line { margin: 0; font-size: 15px; line-height: 1.55; }
.scorecard-status { font-weight: 600; color: var(--navy); }
.scorecard-text { color: var(--navy-72); }

.section-mission .mission-text {
  margin: 0;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--navy);
  color: var(--cream);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 28px;
  border-top: 1px solid var(--navy-14);
}

/* ------------------------------ responsive -------------------------------- */
@media (min-width: 481px) {
  .intro-title { font-size: 34px; }
  .style-name  { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   §14 RESULT CTA · §8 SHARE SHEET · §9–§11 STORY CARD
   ========================================================================== */

/* ปุ่มรอง: พื้นครีม/ขาว เส้นขอบชมพู ตัวอักษรชมพู */
.btn-secondary {
  background: var(--surface);
  color: var(--pink);
  border: 2px solid var(--pink);
}
.btn-secondary:hover { background: var(--soft-pink); }

/* ปุ่มลำดับท้าย: เรียบ เบา */
.btn-tertiary {
  background: transparent;
  color: var(--navy-52);
  border: 0;
  min-height: 48px;
  font-size: 15px;
}
.btn-tertiary:hover { color: var(--pink); }

/* -------------------------- share bottom sheet --------------------------- */
body.is-locked { overflow: hidden; }

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(46, 58, 76, 0.42);
  animation: fade-in 180ms ease both;
}

.sheet {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  background: var(--cream);
  border-radius: 24px 24px 0 0;
  animation: sheet-up 240ms cubic-bezier(.2, .7, .3, 1) both;
}

.sheet-title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--navy-52);
  text-align: center;
}

.sheet-status {
  margin: 4px 0 0;
  font-size: 14px;
  text-align: center;
  color: var(--navy-52);
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-up { from { transform: translateY(18px); } to { transform: none; } }

/* ------------------------ story card (1080 × 1920) -----------------------
   เวทีอยู่นอกจอ ไม่ยุ่งกับ layout ของผู้ใช้ และไม่ขึ้นกับขนาดหน้าจอ
   ------------------------------------------------------------------------ */
.share-card-stage {
  position: fixed;
  left: -12000px;
  top: 0;
  width: 1080px;
  height: 1920px;
  pointer-events: none;
}

.share-card {
  position: relative;
  width: 1080px;
  height: 1920px;
  overflow: hidden;
  background: var(--cream);
  color: var(--navy);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
  /* เว้นขอบให้ UI ของ Instagram ไม่บังเนื้อหา */
  padding: 132px 96px 128px;
}

.share-card .sc-hold { position: absolute; }

.share-card > *:not(.sc-hold) { position: relative; z-index: 1; }

.sc-top { display: flex; flex-direction: column; gap: 14px; }
.sc-logo { width: 268px; height: auto; }
.sc-label {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}

.sc-hero { margin-top: 58px; }
.sc-eyebrow {
  margin: 0 0 16px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--navy-52);
}
.sc-style {
  margin: 0 0 16px;
  font-size: 84px;
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -.01em;
}
.sc-style-emoji { margin-right: 18px; }
.sc-hook {
  margin: 0;
  font-size: 44px;
  font-weight: 600;
  color: var(--pink);
}

.sc-visual {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
.sc-mascot { width: 660px; height: auto; }
.sc-cue {
  position: absolute;
  right: 6px;
  top: 34px;
  font-size: 210px;
  line-height: 1;
  opacity: .16;
}

.sc-mission {
  padding: 40px 44px;
  border-radius: 34px;
  background: var(--surface);
}
.sc-mission-label {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
}
.sc-mission-text {
  margin: 0;
  font-size: 42px;
  line-height: 1.42;
  font-weight: 500;
}

.sc-footer { margin-top: 44px; }
.sc-footer-name {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: .04em;
}
.sc-footer-line { margin: 0; font-size: 26px; color: var(--navy-52); }

/* คำเตือนเมื่อเปิดอยู่ในเบราว์เซอร์ในแอป (LINE / IG / Facebook) */
.sheet-notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 18px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  background: var(--soft-pink);
}

.sheet-notice-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--navy);
}

.sheet-notice-action {
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--pink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
